Added decent spacing to all scripts thanks to Rubocop

This commit is contained in:
Maruno17
2021-12-18 15:25:40 +00:00
parent f7b76ae62e
commit d17fc40a47
207 changed files with 18577 additions and 18587 deletions

View File

@@ -4,45 +4,45 @@
class MoveRelearner_Scene
VISIBLEMOVES = 4
def pbDisplay(msg,brief = false)
UIHelper.pbDisplay(@sprites["msgwindow"],msg,brief) { pbUpdate }
def pbDisplay(msg, brief = false)
UIHelper.pbDisplay(@sprites["msgwindow"], msg, brief) { pbUpdate }
end
def pbConfirm(msg)
UIHelper.pbConfirm(@sprites["msgwindow"],msg) { pbUpdate }
UIHelper.pbConfirm(@sprites["msgwindow"], msg) { pbUpdate }
end
def pbUpdate
pbUpdateSpriteHash(@sprites)
end
def pbStartScene(pokemon,moves)
@pokemon=pokemon
@moves=moves
moveCommands=[]
def pbStartScene(pokemon, moves)
@pokemon = pokemon
@moves = moves
moveCommands = []
moves.each { |m| moveCommands.push(GameData::Move.get(m).name) }
# Create sprite hash
@viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
@viewport.z=99999
@sprites={}
addBackgroundPlane(@sprites,"bg","reminderbg",@viewport)
@sprites["pokeicon"]=PokemonIconSprite.new(@pokemon,@viewport)
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
@viewport.z = 99999
@sprites = {}
addBackgroundPlane(@sprites, "bg", "reminderbg", @viewport)
@sprites["pokeicon"] = PokemonIconSprite.new(@pokemon, @viewport)
@sprites["pokeicon"].setOffset(PictureOrigin::Center)
@sprites["pokeicon"].x=320
@sprites["pokeicon"].y=84
@sprites["background"]=IconSprite.new(0,0,@viewport)
@sprites["pokeicon"].x = 320
@sprites["pokeicon"].y = 84
@sprites["background"] = IconSprite.new(0, 0, @viewport)
@sprites["background"].setBitmap("Graphics/Pictures/reminderSel")
@sprites["background"].y=78
@sprites["background"].src_rect=Rect.new(0,72,258,72)
@sprites["overlay"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
@sprites["background"].y = 78
@sprites["background"].src_rect = Rect.new(0, 72, 258, 72)
@sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
pbSetSystemFont(@sprites["overlay"].bitmap)
@sprites["commands"]=Window_CommandPokemon.new(moveCommands,32)
@sprites["commands"].height=32*(VISIBLEMOVES+1)
@sprites["commands"].visible=false
@sprites["msgwindow"]=Window_AdvancedTextPokemon.new("")
@sprites["msgwindow"].visible=false
@sprites["msgwindow"].viewport=@viewport
@typebitmap=AnimatedBitmap.new(_INTL("Graphics/Pictures/types"))
@sprites["commands"] = Window_CommandPokemon.new(moveCommands, 32)
@sprites["commands"].height = 32 * (VISIBLEMOVES + 1)
@sprites["commands"].visible = false
@sprites["msgwindow"] = Window_AdvancedTextPokemon.new("")
@sprites["msgwindow"].visible = false
@sprites["msgwindow"].viewport = @viewport
@typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/types"))
pbDrawMoveList
pbDeactivateWindows(@sprites)
# Fade in all sprites
@@ -50,7 +50,7 @@ class MoveRelearner_Scene
end
def pbDrawMoveList
overlay=@sprites["overlay"].bitmap
overlay = @sprites["overlay"].bitmap
overlay.clear
@pokemon.types.each_with_index do |type, i|
type_number = GameData::Type.get(type).icon_position
@@ -58,68 +58,68 @@ class MoveRelearner_Scene
type_x = (@pokemon.types.length == 1) ? 400 : 366 + 70 * i
overlay.blt(type_x, 70, @typebitmap.bitmap, type_rect)
end
textpos=[
[_INTL("Teach which move?"),16,2,0,Color.new(88,88,80),Color.new(168,184,184)]
textpos = [
[_INTL("Teach which move?"), 16, 2, 0, Color.new(88, 88, 80), Color.new(168, 184, 184)]
]
imagepos=[]
yPos=76
imagepos = []
yPos = 76
for i in 0...VISIBLEMOVES
moveobject=@moves[@sprites["commands"].top_item+i]
moveobject = @moves[@sprites["commands"].top_item + i]
if moveobject
moveData=GameData::Move.get(moveobject)
moveData = GameData::Move.get(moveobject)
type_number = GameData::Type.get(moveData.display_type(@pokemon)).icon_position
imagepos.push(["Graphics/Pictures/types", 12, yPos + 8, 0, type_number * 28, 64, 28])
textpos.push([moveData.name,80,yPos,0,Color.new(248,248,248),Color.new(0,0,0)])
if moveData.total_pp>0
textpos.push([_INTL("PP"),112,yPos+32,0,Color.new(64,64,64),Color.new(176,176,176)])
textpos.push([_INTL("{1}/{1}",moveData.total_pp),230,yPos+32,1,
Color.new(64,64,64),Color.new(176,176,176)])
textpos.push([moveData.name, 80, yPos, 0, Color.new(248, 248, 248), Color.new(0, 0, 0)])
if moveData.total_pp > 0
textpos.push([_INTL("PP"), 112, yPos + 32, 0, Color.new(64, 64, 64), Color.new(176, 176, 176)])
textpos.push([_INTL("{1}/{1}", moveData.total_pp), 230, yPos + 32, 1,
Color.new(64, 64, 64), Color.new(176, 176, 176)])
else
textpos.push(["-",80,yPos,0,Color.new(64,64,64),Color.new(176,176,176)])
textpos.push(["--",228,yPos+32,1,Color.new(64,64,64),Color.new(176,176,176)])
textpos.push(["-", 80, yPos, 0, Color.new(64, 64, 64), Color.new(176, 176, 176)])
textpos.push(["--", 228, yPos + 32, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)])
end
end
yPos+=64
yPos += 64
end
imagepos.push(["Graphics/Pictures/reminderSel",
0,78+(@sprites["commands"].index-@sprites["commands"].top_item)*64,
0,0,258,72])
selMoveData=GameData::Move.get(@moves[@sprites["commands"].index])
0, 78 + (@sprites["commands"].index - @sprites["commands"].top_item) * 64,
0, 0, 258, 72])
selMoveData = GameData::Move.get(@moves[@sprites["commands"].index])
basedamage = selMoveData.display_damage(@pokemon)
category = selMoveData.display_category(@pokemon)
accuracy = selMoveData.display_accuracy(@pokemon)
textpos.push([_INTL("CATEGORY"),272,108,0,Color.new(248,248,248),Color.new(0,0,0)])
textpos.push([_INTL("POWER"),272,140,0,Color.new(248,248,248),Color.new(0,0,0)])
textpos.push([basedamage<=1 ? basedamage==1 ? "???" : "---" : sprintf("%d",basedamage),
468,140,2,Color.new(64,64,64),Color.new(176,176,176)])
textpos.push([_INTL("ACCURACY"),272,172,0,Color.new(248,248,248),Color.new(0,0,0)])
textpos.push([accuracy==0 ? "---" : "#{accuracy}%",
468,172,2,Color.new(64,64,64),Color.new(176,176,176)])
pbDrawTextPositions(overlay,textpos)
imagepos.push(["Graphics/Pictures/category",436,116,0,category*28,64,28])
if @sprites["commands"].index<@moves.length-1
imagepos.push(["Graphics/Pictures/reminderButtons",48,350,0,0,76,32])
textpos.push([_INTL("CATEGORY"), 272, 108, 0, Color.new(248, 248, 248), Color.new(0, 0, 0)])
textpos.push([_INTL("POWER"), 272, 140, 0, Color.new(248, 248, 248), Color.new(0, 0, 0)])
textpos.push([basedamage <= 1 ? basedamage == 1 ? "???" : "---" : sprintf("%d", basedamage),
468, 140, 2, Color.new(64, 64, 64), Color.new(176, 176, 176)])
textpos.push([_INTL("ACCURACY"), 272, 172, 0, Color.new(248, 248, 248), Color.new(0, 0, 0)])
textpos.push([accuracy == 0 ? "---" : "#{accuracy}%",
468, 172, 2, Color.new(64, 64, 64), Color.new(176, 176, 176)])
pbDrawTextPositions(overlay, textpos)
imagepos.push(["Graphics/Pictures/category", 436, 116, 0, category * 28, 64, 28])
if @sprites["commands"].index < @moves.length - 1
imagepos.push(["Graphics/Pictures/reminderButtons", 48, 350, 0, 0, 76, 32])
end
if @sprites["commands"].index>0
imagepos.push(["Graphics/Pictures/reminderButtons",134,350,76,0,76,32])
if @sprites["commands"].index > 0
imagepos.push(["Graphics/Pictures/reminderButtons", 134, 350, 76, 0, 76, 32])
end
pbDrawImagePositions(overlay,imagepos)
drawTextEx(overlay,272,214,230,5,selMoveData.description,
Color.new(64,64,64),Color.new(176,176,176))
pbDrawImagePositions(overlay, imagepos)
drawTextEx(overlay, 272, 214, 230, 5, selMoveData.description,
Color.new(64, 64, 64), Color.new(176, 176, 176))
end
# Processes the scene
def pbChooseMove
oldcmd=-1
pbActivateWindow(@sprites,"commands") {
oldcmd = -1
pbActivateWindow(@sprites, "commands") {
loop do
oldcmd=@sprites["commands"].index
oldcmd = @sprites["commands"].index
Graphics.update
Input.update
pbUpdate
if @sprites["commands"].index!=oldcmd
@sprites["background"].x=0
@sprites["background"].y=78+(@sprites["commands"].index-@sprites["commands"].top_item)*64
if @sprites["commands"].index != oldcmd
@sprites["background"].x = 0
@sprites["background"].y = 78 + (@sprites["commands"].index - @sprites["commands"].top_item) * 64
pbDrawMoveList
end
if Input.trigger?(Input::BACK)