From 33781493f4fa6feef8677ef875303ddb022c64b5 Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Sun, 19 Dec 2021 12:19:08 +0000 Subject: [PATCH] More aligning of code --- .../004_Interpreter_Commands.rb | 9 +- .../004_Game classes/002_Game_System.rb | 4 +- .../004_Game classes/006_Game_MapFactory.rb | 9 +- .../005_Sprites/003_Sprite_Character.rb | 3 +- .../005_Sprites/009_Sprite_DynamicShadows.rb | 6 +- .../006_Map renderer/001_TilemapRenderer.rb | 2 +- .../006_Map renderer/003_AutotileExpander.rb | 16 +-- .../006_Map renderer/004_TileDrawingHelper.rb | 7 +- .../007_Objects and windows/003_Window.rb | 18 +-- .../004_SpriteWindow.rb | 7 +- .../005_SpriteWindow_text.rb | 31 +++-- .../007_SpriteWrapper.rb | 6 +- .../007_Objects and windows/010_DrawText.rb | 15 ++- .../007_Objects and windows/011_Messages.rb | 18 +-- .../007_Objects and windows/012_TextEntry.rb | 6 +- Data/Scripts/008_Audio/002_Audio_Play.rb | 2 +- Data/Scripts/009_Scenes/001_Transitions.rb | 4 +- .../002_PBS data/009_Species_Files.rb | 2 +- .../011_Battle/001_Battle/001_Battle.rb | 8 +- .../001_Battle/002_Battle_StartAndEnd.rb | 28 ++--- .../003_Battle_ExpAndMoveLearning.rb | 6 +- .../001_Battle/005_Battle_ActionSwitching.rb | 16 ++- .../001_Battle/006_Battle_ActionUseItem.rb | 2 +- .../001_Battle/008_Battle_ActionOther.rb | 2 +- .../001_Battle/009_Battle_CommandPhase.rb | 4 +- .../001_Battle/011_Battle_EndOfRoundPhase.rb | 36 +++--- .../002_Battler/004_Battler_Statuses.rb | 12 +- .../002_Battler/005_Battler_StatStages.rb | 23 ++-- .../002_Battler/006_Battler_AbilityAndItem.rb | 8 +- .../002_Battler/007_Battler_UseMove.rb | 4 +- .../009_Battler_UseMoveSuccessChecks.rb | 5 +- .../010_Battler_UseMoveTriggerEffects.rb | 2 +- .../011_Battle/003_Move/002_Move_Usage.rb | 10 +- .../003_Move/003_Move_UsageCalculations.rb | 60 +++++---- .../003_Move/004_Move_BaseEffects.rb | 4 +- .../003_Move/005_MoveEffects_Misc.rb | 10 +- .../003_Move/006_MoveEffects_BattlerStats.rb | 2 +- .../003_Move/007_MoveEffects_BattlerOther.rb | 8 +- .../008_MoveEffects_MoveAttributes.rb | 10 +- .../003_Move/010_MoveEffects_Healing.rb | 4 +- .../003_Move/011_MoveEffects_Items.rb | 6 +- .../012_MoveEffects_ChangeMoveEffect.rb | 2 +- .../013_MoveEffects_SwitchingActing.rb | 20 +-- .../004_Scene/002_Scene_Initialize.rb | 11 +- .../004_Scene/003_Scene_ChooseCommands.rb | 8 +- .../004_Scene/004_Scene_PlayAnimations.rb | 42 ++++--- .../004_Scene/005_Battle_Scene_Menus.rb | 22 ++-- .../004_Scene/008_Battle_Scene_Animations.rb | 11 +- Data/Scripts/011_Battle/005_AI/002_AI_Item.rb | 2 +- .../005_AI/006_AI_Move_Utilities.rb | 65 ++++++---- .../007_BattleAnimationPlayer.rb | 66 +++++----- .../001_SafariBattle.rb | 10 +- .../002_BugContestBattle.rb | 5 +- .../004_BattleArenaBattle.rb | 26 ++-- .../003_Overworld_MapTransitionAnims.rb | 2 +- Data/Scripts/012_Overworld/001_Overworld.rb | 7 +- .../001_Overworld_BattleStarting.rb | 3 +- .../012_Overworld/004_Overworld_FieldMoves.rb | 12 +- .../006_Overworld_BerryPlants.rb | 12 +- .../008_Overworld_RandomDungeons.rb | 10 +- Data/Scripts/013_Items/001_Item_Utilities.rb | 26 ++-- Data/Scripts/013_Items/004_Item_Phone.rb | 2 +- Data/Scripts/013_Items/005_Item_PokeRadar.rb | 2 +- Data/Scripts/013_Items/006_Item_Mail.rb | 25 ++-- Data/Scripts/013_Items/008_PokemonBag.rb | 5 +- .../002_Trainer_LoadAndNew.rb | 4 +- .../003_UI_EggHatching.rb | 10 +- .../004_UI_Evolution.rb | 10 +- .../001_Non-interactive UI/005_UI_Trading.rb | 16 +-- .../006_UI_HallOfFame.rb | 4 +- Data/Scripts/016_UI/001_UI_PauseMenu.rb | 8 +- Data/Scripts/016_UI/002_UI_Pokedex_Menu.rb | 7 +- Data/Scripts/016_UI/003_UI_Pokedex_Main.rb | 2 +- Data/Scripts/016_UI/005_UI_Party.rb | 39 +++--- Data/Scripts/016_UI/006_UI_Summary.rb | 2 +- Data/Scripts/016_UI/007_UI_Bag.rb | 19 +-- Data/Scripts/016_UI/009_UI_RegionMap.rb | 2 +- Data/Scripts/016_UI/010_UI_Phone.rb | 13 +- Data/Scripts/016_UI/011_UI_Jukebox.rb | 8 +- Data/Scripts/016_UI/012_UI_TrainerCard.rb | 6 +- Data/Scripts/016_UI/013_UI_Load.rb | 6 +- Data/Scripts/016_UI/014_UI_Save.rb | 3 +- Data/Scripts/016_UI/015_UI_Options.rb | 36 +++--- Data/Scripts/016_UI/017_UI_PokemonStorage.rb | 21 ++-- Data/Scripts/016_UI/019_UI_PC.rb | 10 +- Data/Scripts/016_UI/020_UI_PokeMart.rb | 27 ++-- Data/Scripts/016_UI/021_UI_MoveRelearner.rb | 2 +- Data/Scripts/016_UI/022_UI_PurifyChamber.rb | 25 ++-- Data/Scripts/016_UI/023_UI_MysteryGift.rb | 7 +- Data/Scripts/016_UI/024_UI_TextEntry.rb | 13 +- .../017_Minigames/001_Minigame_Duel.rb | 3 +- .../017_Minigames/002_Minigame_TripleTriad.rb | 21 ++-- .../017_Minigames/003_Minigame_SlotMachine.rb | 2 +- .../017_Minigames/004_Minigame_VoltorbFlip.rb | 6 +- .../017_Minigames/006_Minigame_Mining.rb | 12 +- .../017_Minigames/007_Minigame_TilePuzzles.rb | 32 ++--- .../001_Challenge_BattleChallenge.rb | 24 ++-- .../001_Battle Frontier/002_Challenge_Data.rb | 2 +- .../003_Challenge_ChooseFoes.rb | 5 +- .../001_Battle Frontier/005_UI_BattleSwap.rb | 28 +++-- .../002_BugContest.rb | 7 +- .../001_ChallengeGenerator_Data.rb | 4 +- .../004_ChallengeGenerator_BattleSim.rb | 5 +- .../001_Editor screens/001_EditorScreens.rb | 63 ++++++---- .../002_EditorScreens_TerrainTags.rb | 7 +- .../003_EditorScreens_MapConnections.rb | 17 +-- .../001_AnimEditor_SceneElements.rb | 39 +++--- .../002_AnimEditor_ControlsButtons.rb | 17 ++- .../003_AnimEditor_Interpolation.rb | 10 +- .../005_AnimEditor_Functions.rb | 5 +- .../Scripts/020_Debug/002_Editor_DataTypes.rb | 53 ++++---- .../003_Debug menus/001_Debug_Menus.rb | 2 +- .../003_Debug menus/002_Debug_MenuCommands.rb | 24 ++-- .../003_Debug_MenuExtraCode.rb | 2 +- .../005_Debug_PokemonCommands.rb | 118 ++++++++++-------- .../007_Debug_BattleCommands.rb | 21 ++-- .../008_Debug_BattlerCommands.rb | 35 +++--- Data/Scripts/020_Debug/003_Editor_Listers.rb | 23 ++-- .../021_Compiler/002_Compiler_CompilePBS.rb | 29 ++--- .../021_Compiler/003_Compiler_WritePBS.rb | 10 +- .../004_Compiler_MapsAndEvents.rb | 58 +++++---- 121 files changed, 977 insertions(+), 838 deletions(-) diff --git a/Data/Scripts/003_Game processing/004_Interpreter_Commands.rb b/Data/Scripts/003_Game processing/004_Interpreter_Commands.rb index 3dd50ceb0..eb833b5a8 100644 --- a/Data/Scripts/003_Game processing/004_Interpreter_Commands.rb +++ b/Data/Scripts/003_Game processing/004_Interpreter_Commands.rb @@ -816,7 +816,7 @@ class Interpreter y = $game_variables[@parameters[5]] end $game_screen.pictures[number].show(@parameters[1], @parameters[2], - x, y, @parameters[6], @parameters[7], @parameters[8], @parameters[9]) + x, y, @parameters[6], @parameters[7], @parameters[8], @parameters[9]) return true end #----------------------------------------------------------------------------- @@ -832,7 +832,7 @@ class Interpreter y = $game_variables[@parameters[5]] end $game_screen.pictures[number].move(@parameters[1] * Graphics.frame_rate / 20, - @parameters[2], x, y, @parameters[6], @parameters[7], @parameters[8], @parameters[9]) + @parameters[2], x, y, @parameters[6], @parameters[7], @parameters[8], @parameters[9]) return true end #----------------------------------------------------------------------------- @@ -849,7 +849,7 @@ class Interpreter def command_234 number = @parameters[0] + ($game_temp.in_battle ? 50 : 0) $game_screen.pictures[number].start_tone_change(@parameters[1], - @parameters[2] * Graphics.frame_rate / 20) + @parameters[2] * Graphics.frame_rate / 20) return true end #----------------------------------------------------------------------------- @@ -953,7 +953,8 @@ class Interpreter sscreen = PokemonEntry.new(sscene) $game_actors[@parameters[0]].name = sscreen.pbStartScreen( _INTL("Enter {1}'s name.", $game_actors[@parameters[0]].name), - 1, @parameters[1], $game_actors[@parameters[0]].name) + 1, @parameters[1], $game_actors[@parameters[0]].name + ) } end return true diff --git a/Data/Scripts/004_Game classes/002_Game_System.rb b/Data/Scripts/004_Game classes/002_Game_System.rb index 4ed361348..774f9c55c 100644 --- a/Data/Scripts/004_Game classes/002_Game_System.rb +++ b/Data/Scripts/004_Game classes/002_Game_System.rb @@ -65,7 +65,7 @@ class Game_System if bgm != nil && bgm.name != "" if FileTest.audio_exist?("Audio/BGM/" + bgm.name) bgm_play_internal2("Audio/BGM/" + bgm.name, - bgm.volume, bgm.pitch, @bgm_position) if !@defaultBGM + bgm.volume, bgm.pitch, @bgm_position) if !@defaultBGM end else @bgm_position = position if !@bgm_paused @@ -74,7 +74,7 @@ class Game_System end if @defaultBGM bgm_play_internal2("Audio/BGM/" + @defaultBGM.name, - @defaultBGM.volume, @defaultBGM.pitch, @bgm_position) + @defaultBGM.volume, @defaultBGM.pitch, @bgm_position) end Graphics.frame_reset end diff --git a/Data/Scripts/004_Game classes/006_Game_MapFactory.rb b/Data/Scripts/004_Game classes/006_Game_MapFactory.rb index ef6d4dd71..a20fcc154 100644 --- a/Data/Scripts/004_Game classes/006_Game_MapFactory.rb +++ b/Data/Scripts/004_Game classes/006_Game_MapFactory.rb @@ -270,15 +270,14 @@ class PokemonMapFactory # the array (3,-4), because (5-2=3) and (1-5=-4). def getThisAndOtherEventRelativePos(thisEvent, otherEvent) return [0, 0] if !thisEvent || !otherEvent - return getRelativePos( - thisEvent.map.map_id, thisEvent.x, thisEvent.y, - otherEvent.map.map_id, otherEvent.x, otherEvent.y) + return getRelativePos(thisEvent.map.map_id, thisEvent.x, thisEvent.y, + otherEvent.map.map_id, otherEvent.x, otherEvent.y) end def getThisAndOtherPosRelativePos(thisEvent, otherMapID, otherX, otherY) return [0, 0] if !thisEvent - return getRelativePos( - thisEvent.map.map_id, thisEvent.x, thisEvent.y, otherMapID, otherX, otherY) + return getRelativePos(thisEvent.map.map_id, thisEvent.x, thisEvent.y, + otherMapID, otherX, otherY) end # Unused diff --git a/Data/Scripts/005_Sprites/003_Sprite_Character.rb b/Data/Scripts/005_Sprites/003_Sprite_Character.rb index 780c7edcf..2839fc734 100644 --- a/Data/Scripts/005_Sprites/003_Sprite_Character.rb +++ b/Data/Scripts/005_Sprites/003_Sprite_Character.rb @@ -117,7 +117,8 @@ class Sprite_Character < RPG::Sprite self.oy = @ch else @charbitmap = AnimatedBitmap.new( - 'Graphics/Characters/' + @character_name, @character_hue) + 'Graphics/Characters/' + @character_name, @character_hue + ) RPG::Cache.retain('Graphics/Characters/', @character_name, @character_hue) if @character == $game_player @charbitmapAnimated = true @bushbitmap.dispose if @bushbitmap diff --git a/Data/Scripts/005_Sprites/009_Sprite_DynamicShadows.rb b/Data/Scripts/005_Sprites/009_Sprite_DynamicShadows.rb index 341f2192b..18b50d4e7 100644 --- a/Data/Scripts/005_Sprites/009_Sprite_DynamicShadows.rb +++ b/Data/Scripts/005_Sprites/009_Sprite_DynamicShadows.rb @@ -38,15 +38,15 @@ class Sprite_Shadow < RPG::Sprite @chbitmap.dispose if @chbitmap if @tile_id >= 384 @chbitmap = pbGetTileBitmap(@character.map.tileset_name, - @tile_id, @character.character_hue) + @tile_id, @character.character_hue) self.src_rect.set(0, 0, 32, 32) @ch = 32 @cw = 32 self.ox = 16 self.oy = 32 else - @chbitmap = AnimatedBitmap.new( - 'Graphics/Characters/' + @character.character_name, @character.character_hue) + @chbitmap = AnimatedBitmap.new('Graphics/Characters/' + @character.character_name, + @character.character_hue) @cw = @chbitmap.width / 4 @ch = @chbitmap.height / 4 self.ox = @cw / 2 diff --git a/Data/Scripts/006_Map renderer/001_TilemapRenderer.rb b/Data/Scripts/006_Map renderer/001_TilemapRenderer.rb index 9ec6a236d..1da1aaf57 100644 --- a/Data/Scripts/006_Map renderer/001_TilemapRenderer.rb +++ b/Data/Scripts/006_Map renderer/001_TilemapRenderer.rb @@ -379,7 +379,7 @@ class TilemapRenderer filename = extra_autotile_arrays[1][tile_id - single_autotile_start_id] end tile.set_bitmap(filename, tile_id, true, @autotiles.animated?(filename), - priority, @autotiles[filename]) + priority, @autotiles[filename]) else filename = map.tileset_name tile.set_bitmap(filename, tile_id, false, false, priority, @tilesets[filename]) diff --git a/Data/Scripts/006_Map renderer/003_AutotileExpander.rb b/Data/Scripts/006_Map renderer/003_AutotileExpander.rb index 2ffa487e4..337342c5e 100644 --- a/Data/Scripts/006_Map renderer/003_AutotileExpander.rb +++ b/Data/Scripts/006_Map renderer/003_AutotileExpander.rb @@ -32,20 +32,20 @@ class TilemapRenderer case id when 1 # Top left corner new_bitmap.blt(dest_x, dest_y, bitmap, - Rect.new(frame * SOURCE_TILE_WIDTH * 3, SOURCE_TILE_HEIGHT * 4, - SOURCE_TILE_WIDTH, SOURCE_TILE_HEIGHT)) + Rect.new(frame * SOURCE_TILE_WIDTH * 3, SOURCE_TILE_HEIGHT * 4, + SOURCE_TILE_WIDTH, SOURCE_TILE_HEIGHT)) when 2 # Top right corner new_bitmap.blt(dest_x, dest_y, bitmap, - Rect.new(SOURCE_TILE_WIDTH + frame * SOURCE_TILE_WIDTH * 3, SOURCE_TILE_HEIGHT * 4, - SOURCE_TILE_WIDTH, SOURCE_TILE_HEIGHT)) + Rect.new(SOURCE_TILE_WIDTH + frame * SOURCE_TILE_WIDTH * 3, SOURCE_TILE_HEIGHT * 4, + SOURCE_TILE_WIDTH, SOURCE_TILE_HEIGHT)) when 4 # Bottom right corner new_bitmap.blt(dest_x, dest_y, bitmap, - Rect.new(SOURCE_TILE_WIDTH + frame * SOURCE_TILE_WIDTH * 3, SOURCE_TILE_HEIGHT * 5, - SOURCE_TILE_WIDTH, SOURCE_TILE_HEIGHT)) + Rect.new(SOURCE_TILE_WIDTH + frame * SOURCE_TILE_WIDTH * 3, SOURCE_TILE_HEIGHT * 5, + SOURCE_TILE_WIDTH, SOURCE_TILE_HEIGHT)) when 8 # Bottom left corner new_bitmap.blt(dest_x, dest_y, bitmap, - Rect.new(frame * SOURCE_TILE_WIDTH * 3, SOURCE_TILE_HEIGHT * 5, - SOURCE_TILE_WIDTH, SOURCE_TILE_HEIGHT)) + Rect.new(frame * SOURCE_TILE_WIDTH * 3, SOURCE_TILE_HEIGHT * 5, + SOURCE_TILE_WIDTH, SOURCE_TILE_HEIGHT)) end next end diff --git a/Data/Scripts/006_Map renderer/004_TileDrawingHelper.rb b/Data/Scripts/006_Map renderer/004_TileDrawingHelper.rb index af1f7c583..22b6a71b2 100644 --- a/Data/Scripts/006_Map renderer/004_TileDrawingHelper.rb +++ b/Data/Scripts/006_Map renderer/004_TileDrawingHelper.rb @@ -106,7 +106,7 @@ class TileDrawingHelper tile_position = tiles[i] - 1 src.set(tile_position % 6 * 16 + anim, tile_position / 6 * 16, 16, 16) bitmap.stretch_blt(Rect.new(i % 2 * cxTile + x, i / 2 * cyTile + y, cxTile, cyTile), - autotile, src) + autotile, src) end end end @@ -180,9 +180,8 @@ def bltMinimapAutotile(dstBitmap, x, y, srcBitmap, id) src = Rect.new(0, 0, 0, 0) for i in 0...4 tile_position = tiles[i] - 1 - src.set( - tile_position % 6 * cxTile + anim, - tile_position / 6 * cyTile, cxTile, cyTile) + src.set(tile_position % 6 * cxTile + anim, + tile_position / 6 * cyTile, cxTile, cyTile) dstBitmap.blt(i % 2 * cxTile + x, i / 2 * cyTile + y, srcBitmap, src) end end diff --git a/Data/Scripts/007_Objects and windows/003_Window.rb b/Data/Scripts/007_Objects and windows/003_Window.rb index 67177c90d..77f1dadaa 100644 --- a/Data/Scripts/007_Objects and windows/003_Window.rb +++ b/Data/Scripts/007_Objects and windows/003_Window.rb @@ -522,24 +522,19 @@ class Window @cursorbitmap.clear @sprites["cursor"].bitmap = @cursorbitmap @sprites["cursor"].src_rect.set(0, 0, width, height) - rect = Rect.new(margin, margin, - width - fullmargin, height - fullmargin) + rect = Rect.new(margin, margin, width - fullmargin, height - fullmargin) @cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[8]) @cursorbitmap.blt(0, 0, @_windowskin, cursorrects[4]) # top left @cursorbitmap.blt(width - margin, 0, @_windowskin, cursorrects[5]) # top right @cursorbitmap.blt(0, height - margin, @_windowskin, cursorrects[6]) # bottom right @cursorbitmap.blt(width - margin, height - margin, @_windowskin, cursorrects[7]) # bottom left - rect = Rect.new(margin, 0, - width - fullmargin, margin) + rect = Rect.new(margin, 0, width - fullmargin, margin) @cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[0]) - rect = Rect.new(0, margin, - margin, height - fullmargin) + rect = Rect.new(0, margin, margin, height - fullmargin) @cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[1]) - rect = Rect.new(width - margin, margin, - margin, height - fullmargin) + rect = Rect.new(width - margin, margin, margin, height - fullmargin) @cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[2]) - rect = Rect.new(margin, height - margin, - width - fullmargin, margin) + rect = Rect.new(margin, height - margin, width - fullmargin, margin) @cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[3]) else @sprites["cursor"].visible = false @@ -553,8 +548,7 @@ class Window @sprites["side#{i}"].src_rect.set(0, 0, dwidth, dheight) @sidebitmaps[i].clear if sideRects[i].width > 0 && sideRects[i].height > 0 - @sidebitmaps[i].stretch_blt(@sprites["side#{i}"].src_rect, - @_windowskin, sideRects[i]) + @sidebitmaps[i].stretch_blt(@sprites["side#{i}"].src_rect, @_windowskin, sideRects[i]) end end backwidth = @width - 4 diff --git a/Data/Scripts/007_Objects and windows/004_SpriteWindow.rb b/Data/Scripts/007_Objects and windows/004_SpriteWindow.rb index eb4eb78b1..b8fb9ed60 100644 --- a/Data/Scripts/007_Objects and windows/004_SpriteWindow.rb +++ b/Data/Scripts/007_Objects and windows/004_SpriteWindow.rb @@ -618,8 +618,7 @@ class SpriteWindow < Window @sprites["corner1"].src_rect.set(cx, 0, endX, startY) @sprites["corner2"].src_rect.set(0, cy, startX, endY) @sprites["corner3"].src_rect.set(cx, cy, endX, endY) - backRect = Rect.new(@skinrect.x, @skinrect.y, - @skinrect.width, @skinrect.height) + backRect = Rect.new(@skinrect.x, @skinrect.y, @skinrect.width, @skinrect.height) blindsRect = nil sideRects = [ Rect.new(startX, 0, @skinrect.width, startY), # side0 (top) @@ -753,10 +752,10 @@ class SpriteWindow < Window if (@compat & CompatBits::StretchSides) > 0 && @skinformat == 0 # Compatibility mode: Stretch sides @sidebitmaps[i].stretch_blt(@sprites["side#{i}"].src_rect, - @_windowskin, sideRects[i]) + @_windowskin, sideRects[i]) else tileBitmap(@sidebitmaps[i], @sprites["side#{i}"].src_rect, - @_windowskin, sideRects[i]) + @_windowskin, sideRects[i]) end end end diff --git a/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb b/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb index d8ce3d931..678725123 100644 --- a/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb +++ b/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb @@ -52,7 +52,7 @@ class Window_UnformattedTextPokemon < SpriteWindow_Base dims = [0, 0] cwidth = maxwidth < 0 ? Graphics.width : maxwidth getLineBrokenChunks(self.contents, text, - cwidth - self.borderX - SpriteWindow_Base::TEXTPADDING, dims, true) + cwidth - self.borderX - SpriteWindow_Base::TEXTPADDING, dims, true) return dims end @@ -99,10 +99,10 @@ class Window_UnformattedTextPokemon < SpriteWindow_Base def refresh self.contents = pbDoEnsureBitmap(self.contents, self.width - self.borderX, - self.height - self.borderY) + self.height - self.borderY) self.contents.clear drawTextEx(self.contents, 0, 4, self.contents.width, 0, - @text.gsub(/\r/, ""), @baseColor, @shadowColor) + @text.gsub(/\r/, ""), @baseColor, @shadowColor) end end @@ -234,7 +234,7 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base dims = [0, 0] cwidth = (maxwidth < 0) ? Graphics.width : maxwidth chars = getFormattedTextForDims(self.contents, 0, 0, - cwidth - self.borderX - 2 - 6, -1, text, @lineHeight, true) + cwidth - self.borderX - 2 - 6, -1, text, @lineHeight, true) for ch in chars dims[0] = [dims[0], ch[1] + ch[3]].max dims[1] = [dims[1], ch[2] + ch[4]].max @@ -309,8 +309,8 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base if @letterbyletter @fmtchars = [] fmt = getFormattedText(self.contents, 0, 0, - self.width - self.borderX - SpriteWindow_Base::TEXTPADDING, -1, - shadowctag(@baseColor, @shadowColor) + value, 32, true) + self.width - self.borderX - SpriteWindow_Base::TEXTPADDING, -1, + shadowctag(@baseColor, @shadowColor) + value, 32, true) @oldfont = self.contents.font.clone for ch in fmt chx = ch[1] + ch[3] @@ -337,8 +337,8 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base fmt.clear else @fmtchars = getFormattedText(self.contents, 0, 0, - self.width - self.borderX - SpriteWindow_Base::TEXTPADDING, -1, - shadowctag(@baseColor, @shadowColor) + value, 32, true) + self.width - self.borderX - SpriteWindow_Base::TEXTPADDING, -1, + shadowctag(@baseColor, @shadowColor) + value, 32, true) @oldfont = self.contents.font.clone for ch in @fmtchars chx = ch[1] + ch[3] @@ -660,7 +660,7 @@ class Window_InputNumberPokemon < SpriteWindow_Base def refresh self.contents = pbDoEnsureBitmap(self.contents, - self.width - self.borderX, self.height - self.borderY) + self.width - self.borderX, self.height - self.borderY) pbSetSystemFont(self.contents) self.contents.clear s = sprintf("%0*d", @digits_max, @number.abs) @@ -1226,7 +1226,7 @@ class Window_CommandPokemon < Window_DrawableCommand pbSetSystemFont(self.contents) if @starting rect = drawCursor(index, rect) pbDrawShadowText(self.contents, rect.x, rect.y, rect.width, rect.height, - @commands[index], self.baseColor, self.shadowColor) + @commands[index], self.baseColor, self.shadowColor) end end @@ -1248,8 +1248,8 @@ class Window_AdvancedCommandPokemon < Window_DrawableCommand def textWidth(bitmap, text) dims = [nil, 0] chars = getFormattedText(bitmap, 0, 0, - Graphics.width - self.borderX - SpriteWindow_Base::TEXTPADDING - 16, - -1, text, self.rowHeight, true, true) + Graphics.width - self.borderX - SpriteWindow_Base::TEXTPADDING - 16, + -1, text, self.rowHeight, true, true) for ch in chars dims[0] = dims[0] ? [dims[0], ch[1]].min : ch[1] dims[1] = [dims[1], ch[1] + ch[3]].max @@ -1342,11 +1342,10 @@ class Window_AdvancedCommandPokemon < Window_DrawableCommand if toUnformattedText(@commands[index]).gsub(/\n/, "") == @commands[index] # Use faster alternative for unformatted text without line breaks pbDrawShadowText(self.contents, rect.x, rect.y, rect.width, rect.height, - @commands[index], self.baseColor, self.shadowColor) + @commands[index], self.baseColor, self.shadowColor) else - chars = getFormattedText( - self.contents, rect.x, rect.y + 4, rect.width, rect.height, - @commands[index], rect.height, true, true) + chars = getFormattedText(self.contents, rect.x, rect.y + 4, rect.width, rect.height, + @commands[index], rect.height, true, true) drawFormattedChars(self.contents, chars) end end diff --git a/Data/Scripts/007_Objects and windows/007_SpriteWrapper.rb b/Data/Scripts/007_Objects and windows/007_SpriteWrapper.rb index 85b3e4784..ffa426013 100644 --- a/Data/Scripts/007_Objects and windows/007_SpriteWrapper.rb +++ b/Data/Scripts/007_Objects and windows/007_SpriteWrapper.rb @@ -136,11 +136,11 @@ class AnimatedSprite < SpriteWrapper end if @animbitmap.width % framewidth != 0 raise _INTL("Bitmap's width ({1}) is not a multiple of frame width ({2}) [Bitmap={3}]", - @animbitmap.width, framewidth, animname) + @animbitmap.width, framewidth, animname) end if @animbitmap.height % frameheight != 0 raise _INTL("Bitmap's height ({1}) is not a multiple of frame height ({2}) [Bitmap={3}]", - @animbitmap.height, frameheight, animname) + @animbitmap.height, frameheight, animname) end @framecount = framecount @framewidth = framewidth @@ -167,7 +167,7 @@ class AnimatedSprite < SpriteWrapper end if @animbitmap.width % framecount != 0 raise _INTL("Bitmap's width ({1}) is not a multiple of frame count ({2}) [Bitmap={3}]", - @animbitmap.width, framewidth, animname) + @animbitmap.width, framewidth, animname) end @framecount = framecount @framewidth = @animbitmap.width / @framecount diff --git a/Data/Scripts/007_Objects and windows/010_DrawText.rb b/Data/Scripts/007_Objects and windows/010_DrawText.rb index 0ff8c2da7..4f55f5bcc 100644 --- a/Data/Scripts/007_Objects and windows/010_DrawText.rb +++ b/Data/Scripts/007_Objects and windows/010_DrawText.rb @@ -31,7 +31,7 @@ def colorToRgb32(color) return sprintf("%02X%02X%02X", color.red.to_i, color.green.to_i, color.blue.to_i) else return sprintf("%02X%02X%02X%02X", - color.red.to_i, color.green.to_i, color.blue.to_i, color.alpha.to_i) + color.red.to_i, color.green.to_i, color.blue.to_i, color.alpha.to_i) end end @@ -163,10 +163,9 @@ def getFormattedTextForDims(bitmap, xDst, yDst, widthDst, heightDst, text, lineh if newlineBreaks text2.gsub!(/<(\/?)(br)(\s*\=\s*([^>]*))?>/i, "\n") end - return getFormattedText( - bitmap, xDst, yDst, widthDst, heightDst, - text2, lineheight, newlineBreaks, - explicitBreaksOnly, true) + return getFormattedText(bitmap, xDst, yDst, widthDst, heightDst, + text2, lineheight, newlineBreaks, + explicitBreaksOnly, true) end def getFormattedTextFast(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight, @@ -412,7 +411,7 @@ def getFormattedText(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight = end if controls.length == 0 ret = getFormattedTextFast(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight, - newlineBreaks, explicitBreaksOnly) + newlineBreaks, explicitBreaksOnly) dummybitmap.dispose if dummybitmap return ret end @@ -1051,7 +1050,7 @@ def drawSingleFormattedChar(bitmap, ch) end if ch[10] # underline bitmap.fill_rect(ch[1], ch[2] + ch[4] - 4 - [(ch[4] - bitmap.font.size) / 2, 0].max - 2, - ch[3] - 2, 2, ch[8]) + ch[3] - 2, 2, ch[8]) end if ch[11] # strikeout bitmap.fill_rect(ch[1], ch[2] + (ch[4] / 2) - 4, ch[3] - 2, 2, ch[8]) @@ -1088,7 +1087,7 @@ end def drawTextEx(bitmap, x, y, width, numlines, text, baseColor, shadowColor) normtext = getLineBrokenChunks(bitmap, text, width, nil, true) renderLineBrokenChunksWithShadow(bitmap, x, y, normtext, numlines * 32, - baseColor, shadowColor) + baseColor, shadowColor) end def drawFormattedTextEx(bitmap, x, y, width, text, baseColor = nil, shadowColor = nil, lineheight = 32) diff --git a/Data/Scripts/007_Objects and windows/011_Messages.rb b/Data/Scripts/007_Objects and windows/011_Messages.rb index 46bb93a4b..af7670d1e 100644 --- a/Data/Scripts/007_Objects and windows/011_Messages.rb +++ b/Data/Scripts/007_Objects and windows/011_Messages.rb @@ -713,9 +713,9 @@ def pbMessage(message, commands = nil, cmdIfCancel = 0, skin = nil, defaultCmd = msgwindow = pbCreateMessageWindow(nil, skin) if commands ret = pbMessageDisplay(msgwindow, message, true, - proc { |msgwindow| - next Kernel.pbShowCommands(msgwindow, commands, cmdIfCancel, defaultCmd, &block) - }, &block) + proc { |msgwindow| + next Kernel.pbShowCommands(msgwindow, commands, cmdIfCancel, defaultCmd, &block) + }, &block) else pbMessageDisplay(msgwindow, message, &block) end @@ -735,9 +735,9 @@ end def pbMessageChooseNumber(message, params, &block) msgwindow = pbCreateMessageWindow(nil, params.messageSkin) ret = pbMessageDisplay(msgwindow, message, true, - proc { |msgwindow| - next pbChooseNumber(msgwindow, params, &block) - }, &block) + proc { |msgwindow| + next pbChooseNumber(msgwindow, params, &block) + }, &block) pbDisposeMessageWindow(msgwindow) return ret end @@ -878,9 +878,9 @@ end def pbMessageFreeText(message, currenttext, passwordbox, maxlength, width = 240, &block) msgwindow = pbCreateMessageWindow retval = pbMessageDisplay(msgwindow, message, true, - proc { |msgwindow| - next pbFreeText(msgwindow, currenttext, passwordbox, maxlength, width, &block) - }, &block) + proc { |msgwindow| + next pbFreeText(msgwindow, currenttext, passwordbox, maxlength, width, &block) + }, &block) pbDisposeMessageWindow(msgwindow) return retval end diff --git a/Data/Scripts/007_Objects and windows/012_TextEntry.rb b/Data/Scripts/007_Objects and windows/012_TextEntry.rb index bcce92b2b..7ba64d173 100644 --- a/Data/Scripts/007_Objects and windows/012_TextEntry.rb +++ b/Data/Scripts/007_Objects and windows/012_TextEntry.rb @@ -173,7 +173,7 @@ class Window_TextEntry < SpriteWindow_Base def refresh self.contents = pbDoEnsureBitmap(self.contents, self.width - self.borderX, - self.height - self.borderY) + self.height - self.borderY) bitmap = self.contents bitmap.clear x = 0 @@ -333,7 +333,7 @@ class Window_MultilineTextEntry < SpriteWindow_Base def getTextChars if !@textchars @textchars = getLineBrokenText(self.contents, @helper.text, - self.contents.width, nil) + self.contents.width, nil) end return @textchars end @@ -503,7 +503,7 @@ class Window_MultilineTextEntry < SpriteWindow_Base def refresh newContents = pbDoEnsureBitmap(self.contents, self.width - self.borderX, - self.height - self.borderY) + self.height - self.borderY) @textchars = nil if self.contents != newContents self.contents = newContents bitmap = self.contents diff --git a/Data/Scripts/008_Audio/002_Audio_Play.rb b/Data/Scripts/008_Audio/002_Audio_Play.rb index ca5db2725..5f9080fc4 100644 --- a/Data/Scripts/008_Audio/002_Audio_Play.rb +++ b/Data/Scripts/008_Audio/002_Audio_Play.rb @@ -30,7 +30,7 @@ def pbResolveAudioFile(str, volume = nil, pitch = nil) if str.is_a?(RPG::AudioFile) if volume || pitch return RPG::AudioFile.new(str.name, volume || str.volume || 100, - pitch || str.pitch || 100) + pitch || str.pitch || 100) else return str end diff --git a/Data/Scripts/009_Scenes/001_Transitions.rb b/Data/Scripts/009_Scenes/001_Transitions.rb index 5e1b3c39c..cf4a6d5e2 100644 --- a/Data/Scripts/009_Scenes/001_Transitions.rb +++ b/Data/Scripts/009_Scenes/001_Transitions.rb @@ -415,10 +415,10 @@ module Transitions @overworld_bitmap.height * inv_proportion) # Take all of buffer_original, shrink it and put it into buffer_temp @buffer_temp.stretch_blt(new_size_rect, - @buffer_original, Rect.new(0, 0, @overworld_bitmap.width, @overworld_bitmap.height)) + @buffer_original, Rect.new(0, 0, @overworld_bitmap.width, @overworld_bitmap.height)) # Take shrunken area from buffer_temp and stretch it into buffer @overworld_bitmap.stretch_blt(Rect.new(0, 0, @overworld_bitmap.width, @overworld_bitmap.height), - @buffer_temp, new_size_rect) + @buffer_temp, new_size_rect) if @timer >= @start_black_fade @overworld_sprite.opacity = 255 * (1 - (@timer - @start_black_fade) / (@duration - @start_black_fade)) end diff --git a/Data/Scripts/010_Data/002_PBS data/009_Species_Files.rb b/Data/Scripts/010_Data/002_PBS data/009_Species_Files.rb index 82b43854d..8b12a805b 100644 --- a/Data/Scripts/010_Data/002_PBS data/009_Species_Files.rb +++ b/Data/Scripts/010_Data/002_PBS data/009_Species_Files.rb @@ -28,7 +28,7 @@ module GameData # Look for a graphic matching this combination's parameters try_species_text = try_species ret = pbResolveBitmap(sprintf("%s%s%s%s%s%s", path, try_subfolder, - try_species_text, try_form, try_gender, try_shadow)) + try_species_text, try_form, try_gender, try_shadow)) return ret if ret end return nil diff --git a/Data/Scripts/011_Battle/001_Battle/001_Battle.rb b/Data/Scripts/011_Battle/001_Battle/001_Battle.rb index cda3f7301..73f74925e 100644 --- a/Data/Scripts/011_Battle/001_Battle/001_Battle.rb +++ b/Data/Scripts/011_Battle/001_Battle/001_Battle.rb @@ -701,8 +701,8 @@ class Battle @field.weather = newWeather duration = (fixedDuration) ? 5 : -1 if duration > 0 && user && user.itemActive? - duration = Battle::ItemEffects.triggerWeatherExtender(user.item, - @field.weather, duration, user, self) + duration = Battle::ItemEffects.triggerWeatherExtender(user.item, @field.weather, + duration, user, self) end @field.weatherDuration = duration weather_data = GameData::BattleWeather.try_get(@field.weather) @@ -779,8 +779,8 @@ class Battle @field.terrain = newTerrain duration = (fixedDuration) ? 5 : -1 if duration > 0 && user && user.itemActive? - duration = Battle::ItemEffects.triggerTerrainExtender(user.item, - newTerrain, duration, user, self) + duration = Battle::ItemEffects.triggerTerrainExtender(user.item, newTerrain, + duration, user, self) end @field.terrainDuration = duration terrain_data = GameData::BattleTerrain.try_get(@field.terrain) diff --git a/Data/Scripts/011_Battle/001_Battle/002_Battle_StartAndEnd.rb b/Data/Scripts/011_Battle/001_Battle/002_Battle_StartAndEnd.rb index 3df3c3c5f..08984fb34 100644 --- a/Data/Scripts/011_Battle/001_Battle/002_Battle_StartAndEnd.rb +++ b/Data/Scripts/011_Battle/001_Battle/002_Battle_StartAndEnd.rb @@ -56,14 +56,14 @@ class Battle # Compare the have values with the need values if requireds.length > sideCounts.length raise _INTL("Error: def pbGetOwnerIndexFromBattlerIndex gives invalid owner index ({1} for battle type {2}v{3}, trainers {4}v{5})", - requireds.length - 1, @sideSizes[0], @sideSizes[1], side1counts.length, side2counts.length) + requireds.length - 1, @sideSizes[0], @sideSizes[1], side1counts.length, side2counts.length) end sideCounts.each_with_index do |_count, i| if !requireds[i] || requireds[i] == 0 raise _INTL("Player-side trainer {1} has no battler position for their Pokémon to go (trying {2}v{3} battle)", - i + 1, @sideSizes[0], @sideSizes[1]) if side == 0 + i + 1, @sideSizes[0], @sideSizes[1]) if side == 0 raise _INTL("Opposing trainer {1} has no battler position for their Pokémon to go (trying {2}v{3} battle)", - i + 1, @sideSizes[0], @sideSizes[1]) if side == 1 + i + 1, @sideSizes[0], @sideSizes[1]) if side == 1 end next if requireds[i] <= sideCounts[i] # Trainer has enough Pokémon to fill their positions if requireds[i] == 1 @@ -166,10 +166,10 @@ class Battle pbDisplayPaused(_INTL("Oh! A wild {1} appeared!", foeParty[0].name)) when 2 pbDisplayPaused(_INTL("Oh! A wild {1} and {2} appeared!", foeParty[0].name, - foeParty[1].name)) + foeParty[1].name)) when 3 pbDisplayPaused(_INTL("Oh! A wild {1}, {2} and {3} appeared!", foeParty[0].name, - foeParty[1].name, foeParty[2].name)) + foeParty[1].name, foeParty[2].name)) end else # Trainer battle case @opponent.length @@ -177,10 +177,10 @@ class Battle pbDisplayPaused(_INTL("You are challenged by {1}!", @opponent[0].full_name)) when 2 pbDisplayPaused(_INTL("You are challenged by {1} and {2}!", @opponent[0].full_name, - @opponent[1].full_name)) + @opponent[1].full_name)) when 3 pbDisplayPaused(_INTL("You are challenged by {1}, {2} and {3}!", - @opponent[0].full_name, @opponent[1].full_name, @opponent[2].full_name)) + @opponent[0].full_name, @opponent[1].full_name, @opponent[2].full_name)) end end # Send out Pokémon (opposing trainers first) @@ -199,10 +199,10 @@ class Battle msg += _INTL("{1} sent out {2}!", t.full_name, @battlers[sent[0]].name) when 2 msg += _INTL("{1} sent out {2} and {3}!", t.full_name, - @battlers[sent[0]].name, @battlers[sent[1]].name) + @battlers[sent[0]].name, @battlers[sent[1]].name) when 3 msg += _INTL("{1} sent out {2}, {3} and {4}!", t.full_name, - @battlers[sent[0]].name, @battlers[sent[1]].name, @battlers[sent[2]].name) + @battlers[sent[0]].name, @battlers[sent[1]].name, @battlers[sent[2]].name) end toSendOut.concat(sent) end @@ -217,7 +217,7 @@ class Battle msg += _INTL("Go! {1} and {2}!", @battlers[sent[0]].name, @battlers[sent[1]].name) when 3 msg += _INTL("Go! {1}, {2} and {3}!", @battlers[sent[0]].name, - @battlers[sent[1]].name, @battlers[sent[2]].name) + @battlers[sent[1]].name, @battlers[sent[2]].name) end toSendOut.concat(sent) end @@ -403,10 +403,10 @@ class Battle pbDisplayPaused(_INTL("You defeated {1}!", @opponent[0].full_name)) when 2 pbDisplayPaused(_INTL("You defeated {1} and {2}!", @opponent[0].full_name, - @opponent[1].full_name)) + @opponent[1].full_name)) when 3 pbDisplayPaused(_INTL("You defeated {1}, {2} and {3}!", @opponent[0].full_name, - @opponent[1].full_name, @opponent[2].full_name)) + @opponent[1].full_name, @opponent[2].full_name)) end @opponent.each_with_index do |_t, i| @scene.pbShowOpponent(i) @@ -431,10 +431,10 @@ class Battle pbDisplayPaused(_INTL("You lost against {1}!", @opponent[0].full_name)) when 2 pbDisplayPaused(_INTL("You lost against {1} and {2}!", - @opponent[0].full_name, @opponent[1].full_name)) + @opponent[0].full_name, @opponent[1].full_name)) when 3 pbDisplayPaused(_INTL("You lost against {1}, {2} and {3}!", - @opponent[0].full_name, @opponent[1].full_name, @opponent[2].full_name)) + @opponent[0].full_name, @opponent[1].full_name, @opponent[2].full_name)) end end # Lose money from losing a battle diff --git a/Data/Scripts/011_Battle/001_Battle/003_Battle_ExpAndMoveLearning.rb b/Data/Scripts/011_Battle/001_Battle/003_Battle_ExpAndMoveLearning.rb index 5c69d39d1..934496aa7 100644 --- a/Data/Scripts/011_Battle/001_Battle/003_Battle_ExpAndMoveLearning.rb +++ b/Data/Scripts/011_Battle/001_Battle/003_Battle_ExpAndMoveLearning.rb @@ -174,7 +174,7 @@ class Battle if newLevel < curLevel debugInfo = "Levels: #{curLevel}->#{newLevel} | Exp: #{pkmn.exp}->#{expFinal} | gain: #{expGained}" raise _INTL("{1}'s new level is less than its\r\ncurrent level, which shouldn't happen.\r\n[Debug: {2}]", - pkmn.name, debugInfo) + pkmn.name, debugInfo) end # Give Exp if pkmn.shadowPokemon? @@ -219,7 +219,7 @@ class Battle @scene.pbRefreshOne(battler.index) if battler pbDisplayPaused(_INTL("{1} grew to Lv. {2}!", pkmn.name, curLevel)) @scene.pbLevelUp(pkmn, battler, oldTotalHP, oldAttack, oldDefense, - oldSpAtk, oldSpDef, oldSpeed) + oldSpAtk, oldSpDef, oldSpeed) # Learn all moves learned at this level moveList = pkmn.getMoveList moveList.each { |m| pbLearnMove(idxParty, m[1]) if m[0] == curLevel } @@ -249,7 +249,7 @@ class Battle end # Pokémon already knows the maximum number of moves; try to forget one to learn the new move pbDisplayPaused(_INTL("{1} wants to learn {2}, but it already knows {3} moves.", - pkmnName, moveName, pkmn.numMoves.to_word)) + pkmnName, moveName, pkmn.numMoves.to_word)) if pbDisplayConfirm(_INTL("Should {1} forget a move to learn {2}?", pkmnName, moveName)) loop do forgetMove = @scene.pbForgetMove(pkmn, newMove) diff --git a/Data/Scripts/011_Battle/001_Battle/005_Battle_ActionSwitching.rb b/Data/Scripts/011_Battle/001_Battle/005_Battle_ActionSwitching.rb index 92ed2683e..d7f705818 100644 --- a/Data/Scripts/011_Battle/001_Battle/005_Battle_ActionSwitching.rb +++ b/Data/Scripts/011_Battle/001_Battle/005_Battle_ActionSwitching.rb @@ -19,18 +19,16 @@ class Battle if partyScene owner = pbGetOwnerFromPartyIndex(idxBattler, idxParty) partyScene.pbDisplay(_INTL("You can't switch {1}'s Pokémon with one of yours!", - owner.name)) + owner.name)) end return false end if party[idxParty].fainted? - partyScene.pbDisplay(_INTL("{1} has no energy left to battle!", - party[idxParty].name)) if partyScene + partyScene.pbDisplay(_INTL("{1} has no energy left to battle!", party[idxParty].name)) if partyScene return false end if pbFindBattler(idxParty, idxBattler) - partyScene.pbDisplay(_INTL("{1} is already in battle!", - party[idxParty].name)) if partyScene + partyScene.pbDisplay(_INTL("{1} is already in battle!", party[idxParty].name)) if partyScene return false end return true @@ -48,7 +46,7 @@ class Battle allSameSideBattlers(idxBattler).each do |b| next if choices[b.index][0] != :SwitchOut || choices[b.index][1] != idxParty partyScene.pbDisplay(_INTL("{1} has already been selected.", - pbParty(idxBattler)[idxParty].name)) if partyScene + pbParty(idxBattler)[idxParty].name)) if partyScene return false end # Check whether battler can switch out @@ -77,7 +75,7 @@ class Battle next if !b.abilityActive? if Battle::AbilityEffects.triggerTrappingByTarget(b.ability, battler, b, self) partyScene.pbDisplay(_INTL("{1}'s {2} prevents switching!", - b.pbThis, b.abilityName)) if partyScene + b.pbThis, b.abilityName)) if partyScene return false end end @@ -85,7 +83,7 @@ class Battle next if !b.itemActive? if Battle::ItemEffects.triggerTrappingByTarget(b.item, battler, b, self) partyScene.pbDisplay(_INTL("{1}'s {2} prevents switching!", - b.pbThis, b.itemName)) if partyScene + b.pbThis, b.itemName)) if partyScene return false end end @@ -172,7 +170,7 @@ class Battle idxPartyForName = new_index if new_index >= 0 && new_index != idxPartyNew end if pbDisplayConfirm(_INTL("{1} is about to send in {2}. Will you switch your Pokémon?", - opponent.full_name, enemyParty[idxPartyForName].name)) + opponent.full_name, enemyParty[idxPartyForName].name)) idxPlayerPartyNew = pbSwitchInBetween(0, false, true) if idxPlayerPartyNew >= 0 pbMessageOnRecall(@battlers[0]) diff --git a/Data/Scripts/011_Battle/001_Battle/006_Battle_ActionUseItem.rb b/Data/Scripts/011_Battle/001_Battle/006_Battle_ActionUseItem.rb index 958dde11b..e04963b88 100644 --- a/Data/Scripts/011_Battle/001_Battle/006_Battle_ActionUseItem.rb +++ b/Data/Scripts/011_Battle/001_Battle/006_Battle_ActionUseItem.rb @@ -10,7 +10,7 @@ class Battle # Embargo if battler && battler.effects[PBEffects::Embargo] > 0 scene.pbDisplay(_INTL("Embargo's effect prevents the item's use on {1}!", - battler.pbThis(true))) if showMessages + battler.pbThis(true))) if showMessages return false end return true diff --git a/Data/Scripts/011_Battle/001_Battle/008_Battle_ActionOther.rb b/Data/Scripts/011_Battle/001_Battle/008_Battle_ActionOther.rb index 6f6cca749..0474a84e6 100644 --- a/Data/Scripts/011_Battle/001_Battle/008_Battle_ActionOther.rb +++ b/Data/Scripts/011_Battle/001_Battle/008_Battle_ActionOther.rb @@ -140,7 +140,7 @@ class Battle pbDisplay(_INTL("{1}'s fervent wish has reached {2}!", trainerName, battler.pbThis)) else pbDisplay(_INTL("{1}'s {2} is reacting to {3}'s {4}!", - battler.pbThis, battler.itemName, trainerName, pbGetMegaRingName(idxBattler))) + battler.pbThis, battler.itemName, trainerName, pbGetMegaRingName(idxBattler))) end pbCommonAnimation("MegaEvolution", battler) battler.pokemon.makeMega diff --git a/Data/Scripts/011_Battle/001_Battle/009_Battle_CommandPhase.rb b/Data/Scripts/011_Battle/001_Battle/009_Battle_CommandPhase.rb index e16785cb4..7ea985396 100644 --- a/Data/Scripts/011_Battle/001_Battle/009_Battle_CommandPhase.rb +++ b/Data/Scripts/011_Battle/001_Battle/009_Battle_CommandPhase.rb @@ -128,8 +128,8 @@ class Battle next false end next false if !pkmn - next false if !ItemHandlers.triggerCanUseInBattle(item, - pkmn, battler, idxMove, firstAction, self, itemScene) + next false if !ItemHandlers.triggerCanUseInBattle(item, pkmn, battler, idxMove, + firstAction, self, itemScene) next false if !pbRegisterItem(idxBattler, item, idxPkmn, idxMove) ret = true next true diff --git a/Data/Scripts/011_Battle/001_Battle/011_Battle_EndOfRoundPhase.rb b/Data/Scripts/011_Battle/001_Battle/011_Battle_EndOfRoundPhase.rb index f4134bfce..af24e9abe 100644 --- a/Data/Scripts/011_Battle/001_Battle/011_Battle_EndOfRoundPhase.rb +++ b/Data/Scripts/011_Battle/001_Battle/011_Battle_EndOfRoundPhase.rb @@ -231,7 +231,7 @@ class Battle next if !moveUser # User is fainted move = pos.effects[PBEffects::FutureSightMove] pbDisplay(_INTL("{1} took the {2} attack!", @battlers[idxPos].pbThis, - GameData::Move.get(move).name)) + GameData::Move.get(move).name)) # NOTE: Future Sight failing against the target here doesn't count towards # Stomping Tantrum. userLastMoveFailed = moveUser.lastMoveFailed @@ -332,7 +332,7 @@ class Battle pbCommonAnimation("LeechSeed", recipient, b) b.pbTakeEffectDamage(b.totalhp / 8) { |hp_lost| recipient.pbRecoverHPFromDrain(hp_lost, b, - _INTL("{1}'s health is sapped by Leech Seed!", b.pbThis)) + _INTL("{1}'s health is sapped by Leech Seed!", b.pbThis)) recipient.pbAbilitiesOnDamageTaken } recipient.pbFaint if recipient.fainted? @@ -519,53 +519,53 @@ class Battle for side in 0...2 # Reflect pbEORCountDownSideEffect(side, PBEffects::Reflect, - _INTL("{1}'s Reflect wore off!", @battlers[side].pbTeam)) + _INTL("{1}'s Reflect wore off!", @battlers[side].pbTeam)) # Light Screen pbEORCountDownSideEffect(side, PBEffects::LightScreen, - _INTL("{1}'s Light Screen wore off!", @battlers[side].pbTeam)) + _INTL("{1}'s Light Screen wore off!", @battlers[side].pbTeam)) # Safeguard pbEORCountDownSideEffect(side, PBEffects::Safeguard, - _INTL("{1} is no longer protected by Safeguard!", @battlers[side].pbTeam)) + _INTL("{1} is no longer protected by Safeguard!", @battlers[side].pbTeam)) # Mist pbEORCountDownSideEffect(side, PBEffects::Mist, - _INTL("{1} is no longer protected by mist!", @battlers[side].pbTeam)) + _INTL("{1} is no longer protected by mist!", @battlers[side].pbTeam)) # Tailwind pbEORCountDownSideEffect(side, PBEffects::Tailwind, - _INTL("{1}'s Tailwind petered out!", @battlers[side].pbTeam)) + _INTL("{1}'s Tailwind petered out!", @battlers[side].pbTeam)) # Lucky Chant pbEORCountDownSideEffect(side, PBEffects::LuckyChant, - _INTL("{1}'s Lucky Chant wore off!", @battlers[side].pbTeam)) + _INTL("{1}'s Lucky Chant wore off!", @battlers[side].pbTeam)) # Pledge Rainbow pbEORCountDownSideEffect(side, PBEffects::Rainbow, - _INTL("The rainbow on {1}'s side disappeared!", @battlers[side].pbTeam(true))) + _INTL("The rainbow on {1}'s side disappeared!", @battlers[side].pbTeam(true))) # Pledge Sea of Fire pbEORCountDownSideEffect(side, PBEffects::SeaOfFire, - _INTL("The sea of fire around {1} disappeared!", @battlers[side].pbTeam(true))) + _INTL("The sea of fire around {1} disappeared!", @battlers[side].pbTeam(true))) # Pledge Swamp pbEORCountDownSideEffect(side, PBEffects::Swamp, - _INTL("The swamp around {1} disappeared!", @battlers[side].pbTeam(true))) + _INTL("The swamp around {1} disappeared!", @battlers[side].pbTeam(true))) # Aurora Veil pbEORCountDownSideEffect(side, PBEffects::AuroraVeil, - _INTL("{1}'s Aurora Veil wore off!", @battlers[side].pbTeam(true))) + _INTL("{1}'s Aurora Veil wore off!", @battlers[side].pbTeam(true))) end # Trick Room pbEORCountDownFieldEffect(PBEffects::TrickRoom, - _INTL("The twisted dimensions returned to normal!")) + _INTL("The twisted dimensions returned to normal!")) # Gravity pbEORCountDownFieldEffect(PBEffects::Gravity, - _INTL("Gravity returned to normal!")) + _INTL("Gravity returned to normal!")) # Water Sport pbEORCountDownFieldEffect(PBEffects::WaterSportField, - _INTL("The effects of Water Sport have faded.")) + _INTL("The effects of Water Sport have faded.")) # Mud Sport pbEORCountDownFieldEffect(PBEffects::MudSportField, - _INTL("The effects of Mud Sport have faded.")) + _INTL("The effects of Mud Sport have faded.")) # Wonder Room pbEORCountDownFieldEffect(PBEffects::WonderRoom, - _INTL("Wonder Room wore off, and Defense and Sp. Def stats returned to normal!")) + _INTL("Wonder Room wore off, and Defense and Sp. Def stats returned to normal!")) # Magic Room pbEORCountDownFieldEffect(PBEffects::MagicRoom, - _INTL("Magic Room wore off, and held items' effects returned to normal!")) + _INTL("Magic Room wore off, and held items' effects returned to normal!")) # End of terrains pbEORTerrain priority.each do |b| diff --git a/Data/Scripts/011_Battle/002_Battler/004_Battler_Statuses.rb b/Data/Scripts/011_Battle/002_Battler/004_Battler_Statuses.rb index c087e9ad3..4c3b6a021 100644 --- a/Data/Scripts/011_Battle/002_Battler/004_Battler_Statuses.rb +++ b/Data/Scripts/011_Battle/002_Battler/004_Battler_Statuses.rb @@ -62,7 +62,7 @@ class Battle::Battler when :Electric if newStatus == :SLEEP @battle.pbDisplay(_INTL("{1} surrounds itself with electrified terrain!", - pbThis(true))) if showMessages + pbThis(true))) if showMessages return false end when :Misty @@ -133,19 +133,19 @@ class Battle::Battler case newStatus when :SLEEP msg = _INTL("{1} stays awake because of {2}'s {3}!", - pbThis, immAlly.pbThis(true), immAlly.abilityName) + pbThis, immAlly.pbThis(true), immAlly.abilityName) when :POISON msg = _INTL("{1} cannot be poisoned because of {2}'s {3}!", - pbThis, immAlly.pbThis(true), immAlly.abilityName) + pbThis, immAlly.pbThis(true), immAlly.abilityName) when :BURN msg = _INTL("{1} cannot be burned because of {2}'s {3}!", - pbThis, immAlly.pbThis(true), immAlly.abilityName) + pbThis, immAlly.pbThis(true), immAlly.abilityName) when :PARALYSIS msg = _INTL("{1} cannot be paralyzed because of {2}'s {3}!", - pbThis, immAlly.pbThis(true), immAlly.abilityName) + pbThis, immAlly.pbThis(true), immAlly.abilityName) when :FROZEN msg = _INTL("{1} cannot be frozen solid because of {2}'s {3}!", - pbThis, immAlly.pbThis(true), immAlly.abilityName) + pbThis, immAlly.pbThis(true), immAlly.abilityName) end else case newStatus diff --git a/Data/Scripts/011_Battle/002_Battler/005_Battler_StatStages.rb b/Data/Scripts/011_Battle/002_Battler/005_Battler_StatStages.rb index 1c351eac7..1550977bf 100644 --- a/Data/Scripts/011_Battle/002_Battler/005_Battler_StatStages.rb +++ b/Data/Scripts/011_Battle/002_Battler/005_Battler_StatStages.rb @@ -15,7 +15,7 @@ class Battle::Battler # Check the stat stage if statStageAtMax?(stat) @battle.pbDisplay(_INTL("{1}'s {2} won't go any higher!", - pbThis, GameData::Stat.get(stat).name)) if showFailMsg + pbThis, GameData::Stat.get(stat).name)) if showFailMsg return false end return true @@ -142,22 +142,25 @@ class Battle::Battler end if abilityActive? return false if !@battle.moldBreaker && Battle::AbilityEffects.triggerStatLossImmunity( - self.ability, self, stat, @battle, showFailMsg) + self.ability, self, stat, @battle, showFailMsg + ) return false if Battle::AbilityEffects.triggerStatLossImmunityNonIgnorable( - self.ability, self, stat, @battle, showFailMsg) + self.ability, self, stat, @battle, showFailMsg + ) end if !@battle.moldBreaker allAllies.each do |b| next if !b.abilityActive? return false if Battle::AbilityEffects.triggerStatLossImmunityFromAlly( - b.ability, b, self, stat, @battle, showFailMsg) + b.ability, b, self, stat, @battle, showFailMsg + ) end end end # Check the stat stage if statStageAtMin?(stat) @battle.pbDisplay(_INTL("{1}'s {2} won't go any lower!", - pbThis, GameData::Stat.get(stat).name)) if showFailMsg + pbThis, GameData::Stat.get(stat).name)) if showFailMsg return false end return true @@ -298,7 +301,7 @@ class Battle::Battler @battle.pbDisplay(_INTL("{1} is protected by its substitute!", pbThis)) else @battle.pbDisplay(_INTL("{1}'s substitute protected it from {2}'s {3}!", - pbThis, user.pbThis(true), user.abilityName)) + pbThis, user.pbThis(true), user.abilityName)) end return false end @@ -308,7 +311,7 @@ class Battle::Battler @battle.pbDisplay(_INTL("{1}'s {2} cannot be lowered!", pbThis, GameData::Stat.get(:ATTACK).name)) else @battle.pbDisplay(_INTL("{1}'s {2} prevents {3} loss!", pbThis, abilityName, - GameData::Stat.get(:ATTACK).name)) + GameData::Stat.get(:ATTACK).name)) end @battle.pbHideAbilitySplash(self) return false @@ -322,14 +325,14 @@ class Battle::Battler if !hasActiveAbility?(:CONTRARY) if pbOwnSide.effects[PBEffects::Mist] > 0 @battle.pbDisplay(_INTL("{1} is protected from {2}'s {3} by Mist!", - pbThis, user.pbThis(true), user.abilityName)) + pbThis, user.pbThis(true), user.abilityName)) return false end if abilityActive? if Battle::AbilityEffects.triggerStatLossImmunity(self.ability, self, :ATTACK, @battle, false) || Battle::AbilityEffects.triggerStatLossImmunityNonIgnorable(self.ability, self, :ATTACK, @battle, false) @battle.pbDisplay(_INTL("{1}'s {2} prevented {3}'s {4} from working!", - pbThis, abilityName, user.pbThis(true), user.abilityName)) + pbThis, abilityName, user.pbThis(true), user.abilityName)) return false end end @@ -337,7 +340,7 @@ class Battle::Battler next if !b.abilityActive? if Battle::AbilityEffects.triggerStatLossImmunityFromAlly(b.ability, b, self, :ATTACK, @battle, false) @battle.pbDisplay(_INTL("{1} is protected from {2}'s {3} by {4}'s {5}!", - pbThis, user.pbThis(true), user.abilityName, b.pbThis(true), b.abilityName)) + pbThis, user.pbThis(true), user.abilityName, b.pbThis(true), b.abilityName)) return false end end diff --git a/Data/Scripts/011_Battle/002_Battler/006_Battler_AbilityAndItem.rb b/Data/Scripts/011_Battle/002_Battler/006_Battler_AbilityAndItem.rb index 4f32c2494..7430b7d1c 100644 --- a/Data/Scripts/011_Battle/002_Battler/006_Battler_AbilityAndItem.rb +++ b/Data/Scripts/011_Battle/002_Battler/006_Battler_AbilityAndItem.rb @@ -124,7 +124,7 @@ class Battle::Battler @battle.pbDisplay(_INTL("It doesn't affect {1}...", pbThis(true))) else @battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!", - pbThis, abilityName, move.name)) + pbThis, abilityName, move.name)) end end @battle.pbHideAbilitySplash(self) @@ -154,7 +154,7 @@ class Battle::Battler @battle.pbDisplay(_INTL("It doesn't affect {1}...", pbThis(true))) else @battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!", - pbThis, abilityName, move.name)) + pbThis, abilityName, move.name)) end end @battle.pbHideAbilitySplash(self) @@ -249,10 +249,10 @@ class Battle::Battler @battle.pbShowAbilitySplash(b) if Battle::Scene::USE_ABILITY_SPLASH @battle.pbDisplay(_INTL("{1} shared its {2} with {3}!", - b.pbThis, b.itemName, pbThis(true))) + b.pbThis, b.itemName, pbThis(true))) else @battle.pbDisplay(_INTL("{1}'s {2} let it share its {3} with {4}!", - b.pbThis, b.abilityName, b.itemName, pbThis(true))) + b.pbThis, b.abilityName, b.itemName, pbThis(true))) end self.item = b.item b.item = nil diff --git a/Data/Scripts/011_Battle/002_Battler/007_Battler_UseMove.rb b/Data/Scripts/011_Battle/002_Battler/007_Battler_UseMove.rb index 00102b532..504379756 100644 --- a/Data/Scripts/011_Battle/002_Battler/007_Battler_UseMove.rb +++ b/Data/Scripts/011_Battle/002_Battler/007_Battler_UseMove.rb @@ -557,7 +557,7 @@ class Battle::Battler @battle.pbHideAbilitySplash(nextUser) if !Battle::Scene::USE_ABILITY_SPLASH @battle.pbDisplay(_INTL("{1} kept the dance going with {2}!", - nextUser.pbThis, nextUser.abilityName)) + nextUser.pbThis, nextUser.abilityName)) end nextUser.effects[PBEffects::Dancer] = true if nextUser.pbCanChooseMove?(move, false) @@ -641,7 +641,7 @@ class Battle::Battler # actual removal of the item happens in def pbEffectsAfterMove. @battle.pbCommonAnimation("UseItem", user) @battle.pbDisplay(_INTL("The {1} strengthened {2}'s power!", - GameData::Item.get(user.effects[PBEffects::GemConsumed]).name, move.name)) + GameData::Item.get(user.effects[PBEffects::GemConsumed]).name, move.name)) end # Messages about missed target(s) (relevant for multi-target moves only) if !move.pbRepeatHit? diff --git a/Data/Scripts/011_Battle/002_Battler/009_Battler_UseMoveSuccessChecks.rb b/Data/Scripts/011_Battle/002_Battler/009_Battler_UseMoveSuccessChecks.rb index a22aa8683..3b2494757 100644 --- a/Data/Scripts/011_Battle/002_Battler/009_Battler_UseMoveSuccessChecks.rb +++ b/Data/Scripts/011_Battle/002_Battler/009_Battler_UseMoveSuccessChecks.rb @@ -87,8 +87,7 @@ class Battle::Battler # executing them) if hasActiveItem?(:ASSAULTVEST) && move.statusMove? && move.id != :MEFIRST && commandPhase if showMessages - msg = _INTL("The effects of the {1} prevent status moves from being used!", - itemName) + msg = _INTL("The effects of the {1} prevent status moves from being used!", itemName) (commandPhase) ? @battle.pbDisplayPaused(msg) : @battle.pbDisplay(msg) end return false @@ -277,7 +276,7 @@ class Battle::Battler if @effects[PBEffects::Attract] >= 0 @battle.pbCommonAnimation("Attract", self) @battle.pbDisplay(_INTL("{1} is in love with {2}!", pbThis, - @battle.battlers[@effects[PBEffects::Attract]].pbThis(true))) + @battle.battlers[@effects[PBEffects::Attract]].pbThis(true))) if @battle.pbRandom(100) < 50 @battle.pbDisplay(_INTL("{1} is immobilized by love!", pbThis)) @lastMoveFailed = true diff --git a/Data/Scripts/011_Battle/002_Battler/010_Battler_UseMoveTriggerEffects.rb b/Data/Scripts/011_Battle/002_Battler/010_Battler_UseMoveTriggerEffects.rb index d609f397f..751c53930 100644 --- a/Data/Scripts/011_Battle/002_Battler/010_Battler_UseMoveTriggerEffects.rb +++ b/Data/Scripts/011_Battle/002_Battler/010_Battler_UseMoveTriggerEffects.rb @@ -71,7 +71,7 @@ class Battle::Battler if target.effects[PBEffects::Grudge] && target.fainted? move.pp = 0 @battle.pbDisplay(_INTL("{1}'s {2} lost all of its PP due to the grudge!", - user.pbThis, move.name)) + user.pbThis, move.name)) end # Destiny Bond (recording that it should apply) if target.effects[PBEffects::DestinyBond] && target.fainted? diff --git a/Data/Scripts/011_Battle/003_Move/002_Move_Usage.rb b/Data/Scripts/011_Battle/003_Move/002_Move_Usage.rb index 49e558f5c..5f198e84c 100644 --- a/Data/Scripts/011_Battle/003_Move/002_Move_Usage.rb +++ b/Data/Scripts/011_Battle/003_Move/002_Move_Usage.rb @@ -86,8 +86,8 @@ class Battle::Move return false if @battle.moldBreaker ret = false if target.abilityActive? - ret = Battle::AbilityEffects.triggerMoveImmunity(target.ability, - user, target, self, @calcType, @battle, show_message) + ret = Battle::AbilityEffects.triggerMoveImmunity(target.ability, user, target, + self, @calcType, @battle, show_message) end return ret end @@ -131,7 +131,7 @@ class Battle::Move @battle.pbDisplay(_INTL("{1} is unaffected!", target.pbThis)) else @battle.pbDisplay(_INTL("{1} is unaffected because of its {2}!", - target.pbThis, target.abilityName)) + target.pbThis, target.abilityName)) end @battle.pbHideAbilitySplash(target) end @@ -145,7 +145,7 @@ class Battle::Move @battle.pbDisplay(_INTL("{1} is unaffected!", target.pbThis)) else @battle.pbDisplay(_INTL("{1} is unaffected because of {2}'s {3}!", - target.pbThis, b.pbThis(true), b.abilityName)) + target.pbThis, b.pbThis(true), b.abilityName)) end @battle.pbHideAbilitySplash(target) end @@ -294,7 +294,7 @@ class Battle::Move if target.damageState.affection_critical if numTargets > 1 @battle.pbDisplay(_INTL("{1} landed a critical hit on {2}, wishing to be praised!", - user.pbThis, target.pbThis(true))) + user.pbThis, target.pbThis(true))) else @battle.pbDisplay(_INTL("{1} landed a critical hit, wishing to be praised!", user.pbThis)) end diff --git a/Data/Scripts/011_Battle/003_Move/003_Move_UsageCalculations.rb b/Data/Scripts/011_Battle/003_Move/003_Move_UsageCalculations.rb index f78c6b294..81da306e4 100644 --- a/Data/Scripts/011_Battle/003_Move/003_Move_UsageCalculations.rb +++ b/Data/Scripts/011_Battle/003_Move/003_Move_UsageCalculations.rb @@ -131,26 +131,31 @@ class Battle::Move def pbCalcAccuracyModifiers(user, target, modifiers) # Ability effects that alter accuracy calculation if user.abilityActive? - Battle::AbilityEffects.triggerAccuracyCalcFromUser(user.ability, - modifiers, user, target, self, @calcType) + Battle::AbilityEffects.triggerAccuracyCalcFromUser( + user.ability, modifiers, user, target, self, @calcType + ) end user.allAllies.each do |b| next if !b.abilityActive? - Battle::AbilityEffects.triggerAccuracyCalcFromAlly(b.ability, - modifiers, user, target, self, @calcType) + Battle::AbilityEffects.triggerAccuracyCalcFromAlly( + b.ability, modifiers, user, target, self, @calcType + ) end if target.abilityActive? && !@battle.moldBreaker - Battle::AbilityEffects.triggerAccuracyCalcFromTarget(target.ability, - modifiers, user, target, self, @calcType) + Battle::AbilityEffects.triggerAccuracyCalcFromTarget( + target.ability, modifiers, user, target, self, @calcType + ) end # Item effects that alter accuracy calculation if user.itemActive? - Battle::ItemEffects.triggerAccuracyCalcFromUser(user.item, - modifiers, user, target, self, @calcType) + Battle::ItemEffects.triggerAccuracyCalcFromUser( + user.item, modifiers, user, target, self, @calcType + ) end if target.itemActive? - Battle::ItemEffects.triggerAccuracyCalcFromTarget(target.item, - modifiers, user, target, self, @calcType) + Battle::ItemEffects.triggerAccuracyCalcFromTarget( + target.item, modifiers, user, target, self, @calcType + ) end # Other effects, inc. ones that set accuracy_multiplier or evasion_stage to # specific values @@ -295,8 +300,9 @@ class Battle::Move end # Ability effects that alter damage if user.abilityActive? - Battle::AbilityEffects.triggerDamageCalcFromUser(user.ability, - user, target, self, multipliers, baseDmg, type) + Battle::AbilityEffects.triggerDamageCalcFromUser( + user.ability, user, target, self, multipliers, baseDmg, type + ) end if !@battle.moldBreaker # NOTE: It's odd that the user's Mold Breaker prevents its partner's @@ -304,29 +310,35 @@ class Battle::Move # how it works. user.allAllies.each do |b| next if !b.abilityActive? - Battle::AbilityEffects.triggerDamageCalcFromAlly(b.ability, - user, target, self, multipliers, baseDmg, type) + Battle::AbilityEffects.triggerDamageCalcFromAlly( + b.ability, user, target, self, multipliers, baseDmg, type + ) end if target.abilityActive? - Battle::AbilityEffects.triggerDamageCalcFromTarget(target.ability, - user, target, self, multipliers, baseDmg, type) if !@battle.moldBreaker - Battle::AbilityEffects.triggerDamageCalcFromTargetNonIgnorable(target.ability, - user, target, self, multipliers, baseDmg, type) + Battle::AbilityEffects.triggerDamageCalcFromTarget( + target.ability, user, target, self, multipliers, baseDmg, type + ) + Battle::AbilityEffects.triggerDamageCalcFromTargetNonIgnorable( + target.ability, user, target, self, multipliers, baseDmg, type + ) end target.allAllies.each do |b| next if !b.abilityActive? - Battle::AbilityEffects.triggerDamageCalcFromTargetAlly(b.ability, - user, target, self, multipliers, baseDmg, type) + Battle::AbilityEffects.triggerDamageCalcFromTargetAlly( + b.ability, user, target, self, multipliers, baseDmg, type + ) end end # Item effects that alter damage if user.itemActive? - Battle::ItemEffects.triggerDamageCalcFromUser(user.item, - user, target, self, multipliers, baseDmg, type) + Battle::ItemEffects.triggerDamageCalcFromUser( + user.item, user, target, self, multipliers, baseDmg, type + ) end if target.itemActive? - Battle::ItemEffects.triggerDamageCalcFromTarget(target.item, - user, target, self, multipliers, baseDmg, type) + Battle::ItemEffects.triggerDamageCalcFromTarget( + target.item, user, target, self, multipliers, baseDmg, type + ) end # Parental Bond's second attack if user.effects[PBEffects::ParentalBond] == 1 diff --git a/Data/Scripts/011_Battle/003_Move/004_Move_BaseEffects.rb b/Data/Scripts/011_Battle/003_Move/004_Move_BaseEffects.rb index 3fd27fead..4dd023cd5 100644 --- a/Data/Scripts/011_Battle/003_Move/004_Move_BaseEffects.rb +++ b/Data/Scripts/011_Battle/003_Move/004_Move_BaseEffects.rb @@ -256,7 +256,7 @@ class Battle::Move::TargetMultiStatDownMove < Battle::Move for i in 0...@statDown.length / 2 next if !target.pbCanLowerStatStage?(@statDown[i * 2], user, self) if target.pbLowerStatStage(@statDown[i * 2], @statDown[i * 2 + 1], user, - showAnim, false, (showMirrorArmorSplash) ? 1 : 3) + showAnim, false, (showMirrorArmorSplash) ? 1 : 3) showAnim = false end showMirrorArmorSplash = false @@ -567,7 +567,7 @@ class Battle::Move::PledgeMove < Battle::Move user.effects[PBEffects::FirstPledge] = nil return if !@pledgeSetup @battle.pbDisplay(_INTL("{1} is waiting for {2}'s move...", - user.pbThis, @pledgeOtherUser.pbThis(true))) + user.pbThis, @pledgeOtherUser.pbThis(true))) @pledgeOtherUser.effects[PBEffects::FirstPledge] = @function @pledgeOtherUser.effects[PBEffects::MoveNext] = true user.lastMoveFailed = true # Treated as a failure for Stomping Tantrum diff --git a/Data/Scripts/011_Battle/003_Move/005_MoveEffects_Misc.rb b/Data/Scripts/011_Battle/003_Move/005_MoveEffects_Misc.rb index f6c0b96bc..b6b8733e6 100644 --- a/Data/Scripts/011_Battle/003_Move/005_MoveEffects_Misc.rb +++ b/Data/Scripts/011_Battle/003_Move/005_MoveEffects_Misc.rb @@ -386,7 +386,7 @@ class Battle::Move::AddSpikesToFoeSide < Battle::Move def pbEffectGeneral(user) user.pbOpposingSide.effects[PBEffects::Spikes] += 1 @battle.pbDisplay(_INTL("Spikes were scattered all around {1}'s feet!", - user.pbOpposingTeam(true))) + user.pbOpposingTeam(true))) end end @@ -408,7 +408,7 @@ class Battle::Move::AddToxicSpikesToFoeSide < Battle::Move def pbEffectGeneral(user) user.pbOpposingSide.effects[PBEffects::ToxicSpikes] += 1 @battle.pbDisplay(_INTL("Poison spikes were scattered all around {1}'s feet!", - user.pbOpposingTeam(true))) + user.pbOpposingTeam(true))) end end @@ -429,7 +429,7 @@ class Battle::Move::AddStealthRocksToFoeSide < Battle::Move def pbEffectGeneral(user) user.pbOpposingSide.effects[PBEffects::StealthRock] = true @battle.pbDisplay(_INTL("Pointed stones float in the air around {1}!", - user.pbOpposingTeam(true))) + user.pbOpposingTeam(true))) end end @@ -450,7 +450,7 @@ class Battle::Move::AddStickyWebToFoeSide < Battle::Move def pbEffectGeneral(user) user.pbOpposingSide.effects[PBEffects::StickyWeb] = true @battle.pbDisplay(_INTL("A sticky web has been laid out beneath {1}'s feet!", - user.pbOpposingTeam(true))) + user.pbOpposingTeam(true))) end end @@ -672,7 +672,7 @@ class Battle::Move::UserSwapsPositionsWithAlly < Battle::Move idxB = @idxAlly if @battle.pbSwapBattlers(idxA, idxB) @battle.pbDisplay(_INTL("{1} and {2} switched places!", - @battle.battlers[idxB].pbThis, @battle.battlers[idxA].pbThis(true))) + @battle.battlers[idxB].pbThis, @battle.battlers[idxA].pbThis(true))) [idxA, idxB].each { |idx| @battle.pbEffectsOnBattlerEnteringPosition(@battle.battlers[idx]) } end end diff --git a/Data/Scripts/011_Battle/003_Move/006_MoveEffects_BattlerStats.rb b/Data/Scripts/011_Battle/003_Move/006_MoveEffects_BattlerStats.rb index 98e4ca469..a789764ce 100644 --- a/Data/Scripts/011_Battle/003_Move/006_MoveEffects_BattlerStats.rb +++ b/Data/Scripts/011_Battle/003_Move/006_MoveEffects_BattlerStats.rb @@ -1386,7 +1386,7 @@ class Battle::Move::LowerPoisonedTargetAtkSpAtkSpd1 < Battle::Move for i in 0...@statDown.length / 2 next if !target.pbCanLowerStatStage?(@statDown[i * 2], user, self) if target.pbLowerStatStage(@statDown[i * 2], @statDown[i * 2 + 1], user, - showAnim, false, (showMirrorArmorSplash) ? 1 : 3) + showAnim, false, (showMirrorArmorSplash) ? 1 : 3) showAnim = false end showMirrorArmorSplash = false diff --git a/Data/Scripts/011_Battle/003_Move/007_MoveEffects_BattlerOther.rb b/Data/Scripts/011_Battle/003_Move/007_MoveEffects_BattlerOther.rb index ec3e5ca0c..63c6e78d6 100644 --- a/Data/Scripts/011_Battle/003_Move/007_MoveEffects_BattlerOther.rb +++ b/Data/Scripts/011_Battle/003_Move/007_MoveEffects_BattlerOther.rb @@ -820,7 +820,7 @@ class Battle::Move::SetUserTypesToTargetTypes < Battle::Move def pbEffectAgainstTarget(user, target) user.pbChangeTypes(target) @battle.pbDisplay(_INTL("{1}'s type changed to match {2}'s!", - user.pbThis, target.pbThis(true))) + user.pbThis, target.pbThis(true))) end end @@ -1067,7 +1067,7 @@ class Battle::Move::SetUserAbilityToTargetAbility < Battle::Move user.ability = target.ability @battle.pbReplaceAbilitySplash(user) @battle.pbDisplay(_INTL("{1} copied {2}'s {3}!", - user.pbThis, target.pbThis(true), target.abilityName)) + user.pbThis, target.pbThis(true), target.abilityName)) @battle.pbHideAbilitySplash(user) user.pbOnLosingAbility(oldAbil) user.pbTriggerAbilityOnGainingIt @@ -1169,7 +1169,7 @@ class Battle::Move::UserTargetSwapAbilities < Battle::Move @battle.pbDisplay(_INTL("{1} swapped Abilities with its target!", user.pbThis)) else @battle.pbDisplay(_INTL("{1} swapped its {2} Ability with its target's {3} Ability!", - user.pbThis, target.abilityName, user.abilityName)) + user.pbThis, target.abilityName, user.abilityName)) end if user.opposes?(target) @battle.pbHideAbilitySplash(user) @@ -1359,7 +1359,7 @@ class Battle::Move::StartGravity < Battle::Move showMessage = true end @battle.pbDisplay(_INTL("{1} couldn't stay airborne because of gravity!", - b.pbThis)) if showMessage + b.pbThis)) if showMessage end end end diff --git a/Data/Scripts/011_Battle/003_Move/008_MoveEffects_MoveAttributes.rb b/Data/Scripts/011_Battle/003_Move/008_MoveEffects_MoveAttributes.rb index 1e494beef..2d3a5b8ab 100644 --- a/Data/Scripts/011_Battle/003_Move/008_MoveEffects_MoveAttributes.rb +++ b/Data/Scripts/011_Battle/003_Move/008_MoveEffects_MoveAttributes.rb @@ -80,7 +80,7 @@ class Battle::Move::OHKO < Battle::Move::FixedDamageMove @battle.pbDisplay(_INTL("But it failed to affect {1}!", target.pbThis(true))) else @battle.pbDisplay(_INTL("But it failed to affect {1} because of its {2}!", - target.pbThis(true), target.abilityName)) + target.pbThis(true), target.abilityName)) end @battle.pbHideAbilitySplash(target) end @@ -149,12 +149,12 @@ class Battle::Move::DamageTargetAlly < Battle::Move end if hitAlly.length == 2 @battle.pbDisplay(_INTL("The bursting flame hit {1} and {2}!", - @battle.battlers[hitAlly[0][0]].pbThis(true), - @battle.battlers[hitAlly[1][0]].pbThis(true))) + @battle.battlers[hitAlly[0][0]].pbThis(true), + @battle.battlers[hitAlly[1][0]].pbThis(true))) elsif hitAlly.length > 0 hitAlly.each do |b| @battle.pbDisplay(_INTL("The bursting flame hit {1}!", - @battle.battlers[b[0]].pbThis(true))) + @battle.battlers[b[0]].pbThis(true))) end end hitAlly.each { |b| @battle.battlers[b[0]].pbItemHPHealCheck } @@ -824,7 +824,7 @@ class Battle::Move::StartWeakenDamageAgainstUserSideIfHail < Battle::Move user.pbOwnSide.effects[PBEffects::AuroraVeil] = 5 user.pbOwnSide.effects[PBEffects::AuroraVeil] = 8 if user.hasActiveItem?(:LIGHTCLAY) @battle.pbDisplay(_INTL("{1} made {2} stronger against physical and special moves!", - @name, user.pbTeam(true))) + @name, user.pbTeam(true))) end end diff --git a/Data/Scripts/011_Battle/003_Move/010_MoveEffects_Healing.rb b/Data/Scripts/011_Battle/003_Move/010_MoveEffects_Healing.rb index efb8e6733..40b86fe8d 100644 --- a/Data/Scripts/011_Battle/003_Move/010_MoveEffects_Healing.rb +++ b/Data/Scripts/011_Battle/003_Move/010_MoveEffects_Healing.rb @@ -468,7 +468,7 @@ class Battle::Move::UserLosesHalfOfTotalHPExplosive < Battle::Move @battle.pbDisplay(_INTL("{1} cannot use {2}!", user.pbThis, @name)) else @battle.pbDisplay(_INTL("{1} cannot use {2} because of {3}'s {4}!", - user.pbThis, @name, bearer.pbThis(true), bearer.abilityName)) + user.pbThis, @name, bearer.pbThis(true), bearer.abilityName)) end @battle.pbHideAbilitySplash(bearer) return true @@ -500,7 +500,7 @@ class Battle::Move::UserFaintsExplosive < Battle::Move @battle.pbDisplay(_INTL("{1} cannot use {2}!", user.pbThis, @name)) else @battle.pbDisplay(_INTL("{1} cannot use {2} because of {3}'s {4}!", - user.pbThis, @name, bearer.pbThis(true), bearer.abilityName)) + user.pbThis, @name, bearer.pbThis(true), bearer.abilityName)) end @battle.pbHideAbilitySplash(bearer) return true diff --git a/Data/Scripts/011_Battle/003_Move/011_MoveEffects_Items.rb b/Data/Scripts/011_Battle/003_Move/011_MoveEffects_Items.rb index 658111fca..837114e80 100644 --- a/Data/Scripts/011_Battle/003_Move/011_MoveEffects_Items.rb +++ b/Data/Scripts/011_Battle/003_Move/011_MoveEffects_Items.rb @@ -98,7 +98,7 @@ class Battle::Move::UserTargetSwapItems < Battle::Move @battle.pbDisplay(_INTL("But it failed to affect {1}!", target.pbThis(true))) else @battle.pbDisplay(_INTL("But it failed to affect {1} because of its {2}!", - target.pbThis(true), target.abilityName)) + target.pbThis(true), target.abilityName)) end @battle.pbHideAbilitySplash(target) end @@ -223,7 +223,7 @@ class Battle::Move::CorrodeTargetItem < Battle::Move @battle.pbDisplay(_INTL("{1} is unaffected!", target.pbThis)) else @battle.pbDisplay(_INTL("{1} is unaffected because of its {2}!", - target.pbThis(true), target.abilityName)) + target.pbThis(true), target.abilityName)) end @battle.pbHideAbilitySplash(target) end @@ -239,7 +239,7 @@ class Battle::Move::CorrodeTargetItem < Battle::Move def pbEffectAgainstTarget(user, target) @battle.corrosiveGas[target.index % 2][target.pokemonIndex] = true @battle.pbDisplay(_INTL("{1} corroded {2}'s {3}!", - user.pbThis, target.pbThis(true), target.itemName)) + user.pbThis, target.pbThis(true), target.itemName)) end end diff --git a/Data/Scripts/011_Battle/003_Move/012_MoveEffects_ChangeMoveEffect.rb b/Data/Scripts/011_Battle/003_Move/012_MoveEffects_ChangeMoveEffect.rb index b1cb136b8..ca0eca685 100644 --- a/Data/Scripts/011_Battle/003_Move/012_MoveEffects_ChangeMoveEffect.rb +++ b/Data/Scripts/011_Battle/003_Move/012_MoveEffects_ChangeMoveEffect.rb @@ -521,7 +521,7 @@ class Battle::Move::UserAddStockpileRaiseDefSpDef1 < Battle::Move def pbEffectGeneral(user) user.effects[PBEffects::Stockpile] += 1 @battle.pbDisplay(_INTL("{1} stockpiled {2}!", - user.pbThis, user.effects[PBEffects::Stockpile])) + user.pbThis, user.effects[PBEffects::Stockpile])) showAnim = true if user.pbCanRaiseStatStage?(:DEFENSE, user, self) if user.pbRaiseStatStage(:DEFENSE, 1, user, showAnim) diff --git a/Data/Scripts/011_Battle/003_Move/013_MoveEffects_SwitchingActing.rb b/Data/Scripts/011_Battle/003_Move/013_MoveEffects_SwitchingActing.rb index f2750d10f..e9d0114e6 100644 --- a/Data/Scripts/011_Battle/003_Move/013_MoveEffects_SwitchingActing.rb +++ b/Data/Scripts/011_Battle/003_Move/013_MoveEffects_SwitchingActing.rb @@ -37,7 +37,7 @@ class Battle::Move::SwitchOutUserStatusMove < Battle::Move def pbEndOfMoveUsageEffect(user, targets, numHits, switchedBattlers) return if user.wild? @battle.pbDisplay(_INTL("{1} went back to {2}!", user.pbThis, - @battle.pbGetOwnerName(user.index))) + @battle.pbGetOwnerName(user.index))) @battle.pbPursuit(user.index) return if user.fainted? newPkmn = @battle.pbGetReplacementPokemonIndex(user.index) # Owner chooses @@ -71,7 +71,7 @@ class Battle::Move::SwitchOutUserDamagingMove < Battle::Move return if targetSwitched return if !@battle.pbCanChooseNonActive?(user.index) @battle.pbDisplay(_INTL("{1} went back to {2}!", user.pbThis, - @battle.pbGetOwnerName(user.index))) + @battle.pbGetOwnerName(user.index))) @battle.pbPursuit(user.index) return if user.fainted? newPkmn = @battle.pbGetReplacementPokemonIndex(user.index) # Owner chooses @@ -103,7 +103,7 @@ class Battle::Move::LowerTargetAtkSpAtk1SwitchOutUser < Battle::Move::TargetMult return if switcher.fainted? || numHits == 0 return if !@battle.pbCanChooseNonActive?(switcher.index) @battle.pbDisplay(_INTL("{1} went back to {2}!", switcher.pbThis, - @battle.pbGetOwnerName(switcher.index))) + @battle.pbGetOwnerName(switcher.index))) @battle.pbPursuit(switcher.index) return if switcher.fainted? newPkmn = @battle.pbGetReplacementPokemonIndex(switcher.index) # Owner chooses @@ -673,7 +673,7 @@ class Battle::Move::LowerPPOfTargetLastMoveBy3 < Battle::Move reduction = [3, last_move.pp].min target.pbSetPP(last_move, last_move.pp - reduction) @battle.pbDisplay(_INTL("It reduced the PP of {1}'s {2} by {3}!", - target.pbThis(true), last_move.name, reduction)) + target.pbThis(true), last_move.name, reduction)) end end @@ -698,7 +698,7 @@ class Battle::Move::LowerPPOfTargetLastMoveBy4 < Battle::Move reduction = [4, last_move.pp].min target.pbSetPP(last_move, last_move.pp - reduction) @battle.pbDisplay(_INTL("It reduced the PP of {1}'s {2} by {3}!", - target.pbThis(true), last_move.name, reduction)) + target.pbThis(true), last_move.name, reduction)) end end @@ -733,7 +733,7 @@ class Battle::Move::DisableTargetLastMoveUsed < Battle::Move target.effects[PBEffects::Disable] = 5 target.effects[PBEffects::DisableMove] = target.lastRegularMoveUsed @battle.pbDisplay(_INTL("{1}'s {2} was disabled!", target.pbThis, - GameData::Move.get(target.lastRegularMoveUsed).name)) + GameData::Move.get(target.lastRegularMoveUsed).name)) target.pbItemStatusCureCheck end end @@ -853,7 +853,7 @@ class Battle::Move::DisableTargetStatusMoves < Battle::Move @battle.pbDisplay(_INTL("But it failed!")) else @battle.pbDisplay(_INTL("But it failed because of {1}'s {2}!", - target.pbThis(true), target.abilityName)) + target.pbThis(true), target.abilityName)) end @battle.pbHideAbilitySplash(target) end @@ -897,8 +897,10 @@ end class Battle::Move::DisableTargetSoundMoves < Battle::Move def pbAdditionalEffect(user, target) return if target.fainted? || target.damageState.substitute - @battle.pbDisplay(_INTL("The effects of {1} prevent {2} from using certain moves!", - @name, target.pbThis(true))) if target.effects[PBEffects::ThroatChop] == 0 + if target.effects[PBEffects::ThroatChop] == 0 + @battle.pbDisplay(_INTL("The effects of {1} prevent {2} from using certain moves!", + @name, target.pbThis(true))) + end target.effects[PBEffects::ThroatChop] = 3 end end diff --git a/Data/Scripts/011_Battle/004_Scene/002_Scene_Initialize.rb b/Data/Scripts/011_Battle/004_Scene/002_Scene_Initialize.rb index b09348bc9..b698cd463 100644 --- a/Data/Scripts/011_Battle/004_Scene/002_Scene_Initialize.rb +++ b/Data/Scripts/011_Battle/004_Scene/002_Scene_Initialize.rb @@ -28,11 +28,12 @@ class Battle::Scene pbCreateBackdropSprites # Create message box graphic messageBox = pbAddSprite("messageBox", 0, Graphics.height - 96, - "Graphics/Pictures/Battle/overlay_message", @viewport) + "Graphics/Pictures/Battle/overlay_message", @viewport) messageBox.z = 195 # Create message window (displays the message) - msgWindow = Window_AdvancedTextPokemon.newWithSize("", - 16, Graphics.height - 96 + 2, Graphics.width - 32, 96, @viewport) + msgWindow = Window_AdvancedTextPokemon.newWithSize( + "", 16, Graphics.height - 96 + 2, Graphics.width - 32, 96, @viewport + ) msgWindow.z = 200 msgWindow.opacity = 0 msgWindow.baseColor = MESSAGE_BASE_COLOR @@ -49,7 +50,7 @@ class Battle::Scene # The party lineup graphics (bar and balls) for both sides for side in 0...2 partyBar = pbAddSprite("partyBar_#{side}", 0, 0, - "Graphics/Pictures/Battle/overlay_lineup", @viewport) + "Graphics/Pictures/Battle/overlay_lineup", @viewport) partyBar.z = 120 partyBar.mirror = true if side == 0 # Player's lineup bar only partyBar.visible = false @@ -139,7 +140,7 @@ class Battle::Scene for side in 0...2 baseX, baseY = Battle::Scene.pbBattlerPosition(side) base = pbAddSprite("base_#{side}", baseX, baseY, - (side == 0) ? playerBase : enemyBase, @viewport) + (side == 0) ? playerBase : enemyBase, @viewport) base.z = 1 if base.bitmap base.ox = base.bitmap.width / 2 diff --git a/Data/Scripts/011_Battle/004_Scene/003_Scene_ChooseCommands.rb b/Data/Scripts/011_Battle/004_Scene/003_Scene_ChooseCommands.rb index b289eb74c..56c174d11 100644 --- a/Data/Scripts/011_Battle/004_Scene/003_Scene_ChooseCommands.rb +++ b/Data/Scripts/011_Battle/004_Scene/003_Scene_ChooseCommands.rb @@ -200,10 +200,10 @@ class Battle::Scene # Start Bag screen itemScene = PokemonBag_Scene.new itemScene.pbStartScene($bag, true, - proc { |item| - useType = GameData::Item.get(item).battle_use - next useType && useType > 0 - }, false) + proc { |item| + useType = GameData::Item.get(item).battle_use + next useType && useType > 0 + }, false) # Loop while in Bag screen wasTargeting = false loop do diff --git a/Data/Scripts/011_Battle/004_Scene/004_Scene_PlayAnimations.rb b/Data/Scripts/011_Battle/004_Scene/004_Scene_PlayAnimations.rb index ddeb57c87..a638bf8da 100644 --- a/Data/Scripts/011_Battle/004_Scene/004_Scene_PlayAnimations.rb +++ b/Data/Scripts/011_Battle/004_Scene/004_Scene_PlayAnimations.rb @@ -58,8 +58,9 @@ class Battle::Scene # Animates a party lineup appearing for the given side #============================================================================= def pbShowPartyLineup(side, fullAnim = false) - @animations.push(Animation::LineupAppear.new(@sprites, @viewport, - side, @battle.pbParty(side), @battle.pbPartyStarts(side), fullAnim)) + @animations.push(Animation::LineupAppear.new( + @sprites, @viewport, side, @battle.pbParty(side), @battle.pbPartyStarts(side), fullAnim + )) if !fullAnim while inPartyAnimation? pbUpdate @@ -112,13 +113,15 @@ class Battle::Scene pbChangePokemon(b[0], pkmn) pbRefresh if @battle.opposes?(b[0]) - sendOutAnim = Animation::PokeballTrainerSendOut.new(@sprites, @viewport, - @battle.pbGetOwnerIndexFromBattlerIndex(b[0]) + 1, - @battle.battlers[b[0]], startBattle, i) + sendOutAnim = Animation::PokeballTrainerSendOut.new( + @sprites, @viewport, @battle.pbGetOwnerIndexFromBattlerIndex(b[0]) + 1, + @battle.battlers[b[0]], startBattle, i + ) else - sendOutAnim = Animation::PokeballPlayerSendOut.new(@sprites, @viewport, - @battle.pbGetOwnerIndexFromBattlerIndex(b[0]) + 1, - @battle.battlers[b[0]], startBattle, i) + sendOutAnim = Animation::PokeballPlayerSendOut.new( + @sprites, @viewport, @battle.pbGetOwnerIndexFromBattlerIndex(b[0]) + 1, + @battle.battlers[b[0]], startBattle, i + ) end dataBoxAnim = Animation::DataBoxAppear.new(@sprites, @viewport, b[0]) sendOutAnims.push([sendOutAnim, dataBoxAnim, false]) @@ -296,11 +299,13 @@ class Battle::Scene def pbLevelUp(pkmn, _battler, oldTotalHP, oldAttack, oldDefense, oldSpAtk, oldSpDef, oldSpeed) pbTopRightWindow( _INTL("Max. HP+{1}\r\nAttack+{2}\r\nDefense+{3}\r\nSp. Atk+{4}\r\nSp. Def+{5}\r\nSpeed+{6}", - pkmn.totalhp - oldTotalHP, pkmn.attack - oldAttack, pkmn.defense - oldDefense, - pkmn.spatk - oldSpAtk, pkmn.spdef - oldSpDef, pkmn.speed - oldSpeed)) + pkmn.totalhp - oldTotalHP, pkmn.attack - oldAttack, pkmn.defense - oldDefense, + pkmn.spatk - oldSpAtk, pkmn.spdef - oldSpDef, pkmn.speed - oldSpeed) + ) pbTopRightWindow( _INTL("Max. HP{1}\r\nAttack{2}\r\nDefense{3}\r\nSp. Atk{4}\r\nSp. Def{5}\r\nSpeed{6}", - pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed)) + pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed) + ) end #============================================================================= @@ -326,8 +331,9 @@ class Battle::Scene #============================================================================= def pbThrow(ball, shakes, critical, targetBattler, showPlayer = false) @briefMessage = false - captureAnim = Animation::PokeballThrowCapture.new(@sprites, @viewport, - ball, shakes, critical, @battle.battlers[targetBattler], showPlayer) + captureAnim = Animation::PokeballThrowCapture.new( + @sprites, @viewport, ball, shakes, critical, @battle.battlers[targetBattler], showPlayer + ) loop do captureAnim.update pbUpdate @@ -367,8 +373,9 @@ class Battle::Scene def pbThrowAndDeflect(ball, idxBattler) @briefMessage = false - throwAnim = Animation::PokeballThrowDeflect.new(@sprites, @viewport, - ball, @battle.battlers[idxBattler]) + throwAnim = Animation::PokeballThrowDeflect.new( + @sprites, @viewport, ball, @battle.battlers[idxBattler] + ) loop do throwAnim.update pbUpdate @@ -533,8 +540,9 @@ class Battle::Scene targetHeight = userHeight end animPlayer.setLineTransform( - FOCUSUSER_X, FOCUSUSER_Y, FOCUSTARGET_X, FOCUSTARGET_Y, - oldUserX, oldUserY - userHeight / 2, oldTargetX, oldTargetY - targetHeight / 2) + FOCUSUSER_X, FOCUSUSER_Y, FOCUSTARGET_X, FOCUSTARGET_Y, + oldUserX, oldUserY - userHeight / 2, oldTargetX, oldTargetY - targetHeight / 2 + ) # Play the animation animPlayer.start loop do diff --git a/Data/Scripts/011_Battle/004_Scene/005_Battle_Scene_Menus.rb b/Data/Scripts/011_Battle/004_Scene/005_Battle_Scene_Menus.rb index 6e301e5c9..8a7610fc8 100644 --- a/Data/Scripts/011_Battle/004_Scene/005_Battle_Scene_Menus.rb +++ b/Data/Scripts/011_Battle/004_Scene/005_Battle_Scene_Menus.rb @@ -118,8 +118,9 @@ class Battle::Scene::CommandMenu < Battle::Scene::MenuBase self.x = 0 self.y = Graphics.height - 96 # Create message box (shows "What will X do?") - @msgBox = Window_UnformattedTextPokemon.newWithSize("", - self.x + 16, self.y + 2, 220, Graphics.height - self.y, viewport) + @msgBox = Window_UnformattedTextPokemon.newWithSize( + "", self.x + 16, self.y + 2, 220, Graphics.height - self.y, viewport + ) @msgBox.baseColor = TEXT_BASE_COLOR @msgBox.shadowColor = TEXT_SHADOW_COLOR @msgBox.windowskin = nil @@ -146,8 +147,9 @@ class Battle::Scene::CommandMenu < Battle::Scene::MenuBase end else # Create command window (shows Fight/Bag/Pokémon/Run) - @cmdWindow = Window_CommandPokemon.newWithSize([], - self.x + Graphics.width - 240, self.y, 240, Graphics.height - self.y, viewport) + @cmdWindow = Window_CommandPokemon.newWithSize( + [], self.x + Graphics.width - 240, self.y, 240, Graphics.height - self.y, viewport + ) @cmdWindow.columns = 2 @cmdWindow.columnSpacing = 4 @cmdWindow.ignore_input = true @@ -287,15 +289,17 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase addSprite("shiftButton", @shiftButton) else # Create message box (shows type and PP of selected move) - @msgBox = Window_AdvancedTextPokemon.newWithSize("", - self.x + 320, self.y, Graphics.width - 320, Graphics.height - self.y, viewport) + @msgBox = Window_AdvancedTextPokemon.newWithSize( + "", self.x + 320, self.y, Graphics.width - 320, Graphics.height - self.y, viewport + ) @msgBox.baseColor = TEXT_BASE_COLOR @msgBox.shadowColor = TEXT_SHADOW_COLOR pbSetNarrowFont(@msgBox.contents) addSprite("msgBox", @msgBox) # Create command window (shows moves) - @cmdWindow = Window_CommandPokemon.newWithSize([], - self.x, self.y, 320, Graphics.height - self.y, viewport) + @cmdWindow = Window_CommandPokemon.newWithSize( + [], self.x, self.y, 320, Graphics.height - self.y, viewport + ) @cmdWindow.columns = 2 @cmdWindow.columnSpacing = 4 @cmdWindow.ignore_input = true @@ -392,7 +396,7 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase @msgBox.text = _INTL("PP: ---
TYPE/{1}", moveType) else @msgBox.text = _ISPRINTF("PP: {1: 2d}/{2: 2d}
TYPE/{3:s}", - move.pp, move.total_pp, moveType) + move.pp, move.total_pp, moveType) end return end diff --git a/Data/Scripts/011_Battle/004_Scene/008_Battle_Scene_Animations.rb b/Data/Scripts/011_Battle/004_Scene/008_Battle_Scene_Animations.rb index 1a7fd7021..8734a8eeb 100644 --- a/Data/Scripts/011_Battle/004_Scene/008_Battle_Scene_Animations.rb +++ b/Data/Scripts/011_Battle/004_Scene/008_Battle_Scene_Animations.rb @@ -42,7 +42,7 @@ class Battle::Scene::Animation::Intro < Battle::Scene::Animation blackScreen.moveOpacity(0, 8, 0) # Fading blackness over command bar blackBar = addNewSprite(@sprites["cmdBar_bg"].x, @sprites["cmdBar_bg"].y, - "Graphics/Battle animations/black_bar") + "Graphics/Battle animations/black_bar") blackBar.setZ(0, 998) blackBar.moveOpacity(appearTime * 3 / 4, appearTime / 4, 0) end @@ -448,7 +448,7 @@ class Battle::Scene::Animation::PokeballPlayerSendOut < Battle::Scene::Animation delay = ball.totalDuration # 0 or 7 # Poké Ball trajectory animation createBallTrajectory(ball, delay, 12, - ballStartX, ballStartY, ballMidX, ballMidY, battlerStartX, battlerStartY - 18) + ballStartX, ballStartY, ballMidX, ballMidY, battlerStartX, battlerStartY - 18) ball.setZ(9, batSprite.z - 1) delay = ball.totalDuration + 4 delay += 10 * @idxOrder # Stagger appearances if multiple Pokémon are sent out at once @@ -651,8 +651,7 @@ class Battle::Scene::Animation::BattlerFaint < Battle::Scene::Animation shadow = addSprite(shaSprite, PictureOrigin::Center) # Get approx duration depending on sprite's position/size. Min 20 frames. battlerTop = batSprite.y - batSprite.height - cropY = Battle::Scene.pbBattlerPosition(@idxBattler, - @battle.pbSideSize(@idxBattler))[1] + cropY = Battle::Scene.pbBattlerPosition(@idxBattler, @battle.pbSideSize(@idxBattler))[1] cropY += 8 duration = (cropY - battlerTop) / 8 duration = 10 if duration < 10 # Min 0.5 seconds @@ -734,7 +733,7 @@ class Battle::Scene::Animation::PokeballThrowCapture < Battle::Scene::Animation # Poké Ball arc animation ball.setSE(delay, "Battle throw") createBallTrajectory(ball, delay, 16, - ballStartX, ballStartY, ballMidX, ballMidY, ballEndX, ballEndY) + ballStartX, ballStartY, ballMidX, ballMidY, ballEndX, ballEndY) ball.setZ(9, batSprite.z + 1) ball.setSE(delay + 16, "Battle ball hit") # Poké Ball opens up @@ -867,7 +866,7 @@ class Battle::Scene::Animation::PokeballThrowDeflect < Battle::Scene::Animation # Poké Ball arc animation ball.setSE(0, "Battle throw") createBallTrajectory(ball, 0, 16, - ballStartX, ballStartY, ballMidX, ballMidY, ballEndX, ballEndY) + ballStartX, ballStartY, ballMidX, ballMidY, ballEndX, ballEndY) # Poké Ball knocked back delay = ball.totalDuration ball.setSE(delay, "Battle ball drop") diff --git a/Data/Scripts/011_Battle/005_AI/002_AI_Item.rb b/Data/Scripts/011_Battle/005_AI/002_AI_Item.rb index 211e99462..3e4434d44 100644 --- a/Data/Scripts/011_Battle/005_AI/002_AI_Item.rb +++ b/Data/Scripts/011_Battle/005_AI/002_AI_Item.rb @@ -105,7 +105,7 @@ class Battle::AI next if !i next if !@battle.pbCanUseItemOnPokemon?(i, pkmn, battler, @battle.scene, false) next if !ItemHandlers.triggerCanUseInBattle(i, pkmn, battler, nil, - false, self, @battle.scene, false) + false, self, @battle.scene, false) # Log HP healing items if losthp > 0 power = hpItems[i] diff --git a/Data/Scripts/011_Battle/005_AI/006_AI_Move_Utilities.rb b/Data/Scripts/011_Battle/005_AI/006_AI_Move_Utilities.rb index c0a0fa415..8f4edf386 100644 --- a/Data/Scripts/011_Battle/005_AI/006_AI_Move_Utilities.rb +++ b/Data/Scripts/011_Battle/005_AI/006_AI_Move_Utilities.rb @@ -271,11 +271,13 @@ class Battle::AI if GameData::Type.exists?(:FLYING) if skill >= PBTrainerAI.highSkill targetTypes = target.pbTypes(true) - mult = Effectiveness.calculate(:FLYING, - targetTypes[0], targetTypes[1], targetTypes[2]) + mult = Effectiveness.calculate( + :FLYING, targetTypes[0], targetTypes[1], targetTypes[2] + ) else - mult = Effectiveness.calculate(:FLYING, - target.types[0], target.types[1], target.effects[PBEffects::Type3]) + mult = Effectiveness.calculate( + :FLYING, target.types[0], target.types[1], target.effects[PBEffects::Type3] + ) end baseDmg = (baseDmg.to_f * mult / Effectiveness::NORMAL_EFFECTIVE).round end @@ -338,15 +340,17 @@ class Battle::AI break end if canCheck - Battle::AbilityEffects.triggerDamageCalcFromUser(user.ability, - user, target, move, multipliers, baseDmg, type) + Battle::AbilityEffects.triggerDamageCalcFromUser( + user.ability, user, target, move, multipliers, baseDmg, type + ) end end if skill >= PBTrainerAI.mediumSkill && !moldBreaker user.allAllies.each do |b| next if !b.abilityActive? - Battle::AbilityEffects.triggerDamageCalcFromAlly(b.ability, - user, target, move, multipliers, baseDmg, type) + Battle::AbilityEffects.triggerDamageCalcFromAlly( + b.ability, user, target, move, multipliers, baseDmg, type + ) end end if skill >= PBTrainerAI.bestSkill && !moldBreaker && target.abilityActive? @@ -360,15 +364,17 @@ class Battle::AI break end if canCheck - Battle::AbilityEffects.triggerDamageCalcFromTarget(target.ability, - user, target, move, multipliers, baseDmg, type) + Battle::AbilityEffects.triggerDamageCalcFromTarget( + target.ability, user, target, move, multipliers, baseDmg, type + ) end end if skill >= PBTrainerAI.bestSkill && !moldBreaker target.allAllies.each do |b| next if !b.abilityActive? - Battle::AbilityEffects.triggerDamageCalcFromTargetAlly(b.ability, - user, target, move, multipliers, baseDmg, type) + Battle::AbilityEffects.triggerDamageCalcFromTargetAlly( + b.ability, user, target, move, multipliers, baseDmg, type + ) end end # Item effects that alter damage @@ -379,16 +385,18 @@ class Battle::AI # round. itemBlacklist = [:EXPERTBELT, :LIFEORB] if !itemBlacklist.include?(user.item_id) - Battle::ItemEffects.triggerDamageCalcFromUser(user.item, - user, target, move, multipliers, baseDmg, type) + Battle::ItemEffects.triggerDamageCalcFromUser( + user.item, user, target, move, multipliers, baseDmg, type + ) end end if skill >= PBTrainerAI.bestSkill && target.itemActive? # NOTE: Type-weakening berries aren't suitable for checking at the start # of the round. if target.item && !target.item.is_berry? - Battle::ItemEffects.triggerDamageCalcFromTarget(target.item, - user, target, move, multipliers, baseDmg, type) + Battle::ItemEffects.triggerDamageCalcFromTarget( + target.item, user, target, move, multipliers, baseDmg, type + ) end end # Global abilities @@ -640,32 +648,37 @@ class Battle::AI # Ability effects that alter accuracy calculation if skill >= PBTrainerAI.mediumSkill if user.abilityActive? - Battle::AbilityEffects.triggerAccuracyCalcFromUser(user.ability, - modifiers, user, target, move, type) + Battle::AbilityEffects.triggerAccuracyCalcFromUser( + user.ability, modifiers, user, target, move, type + ) end user.allAllies.each do |b| next if !b.abilityActive? - Battle::AbilityEffects.triggerAccuracyCalcFromAlly(b.ability, - modifiers, user, target, move, type) + Battle::AbilityEffects.triggerAccuracyCalcFromAlly( + b.ability, modifiers, user, target, move, type + ) end end if skill >= PBTrainerAI.bestSkill if target.abilityActive? && !moldBreaker - Battle::AbilityEffects.triggerAccuracyCalcFromTarget(target.ability, - modifiers, user, target, move, type) + Battle::AbilityEffects.triggerAccuracyCalcFromTarget( + target.ability, modifiers, user, target, move, type + ) end end # Item effects that alter accuracy calculation if skill >= PBTrainerAI.mediumSkill if user.itemActive? - Battle::ItemEffects.triggerAccuracyCalcFromUser(user.item, - modifiers, user, target, move, type) + Battle::ItemEffects.triggerAccuracyCalcFromUser( + user.item, modifiers, user, target, move, type + ) end end if skill >= PBTrainerAI.bestSkill if target.itemActive? - Battle::ItemEffects.triggerAccuracyCalcFromTarget(target.item, - modifiers, user, target, move, type) + Battle::ItemEffects.triggerAccuracyCalcFromTarget( + target.item, modifiers, user, target, move, type + ) end end # Other effects, inc. ones that set accuracy_multiplier or evasion_stage to specific values diff --git a/Data/Scripts/011_Battle/006_Other battle code/007_BattleAnimationPlayer.rb b/Data/Scripts/011_Battle/006_Other battle code/007_BattleAnimationPlayer.rb index 2c3a1a149..24ba70f07 100644 --- a/Data/Scripts/011_Battle/006_Other battle code/007_BattleAnimationPlayer.rb +++ b/Data/Scripts/011_Battle/006_Other battle code/007_BattleAnimationPlayer.rb @@ -222,7 +222,8 @@ class RPG::Animation timing.se = RPG::AudioFile.new( othertiming.se.name.clone, othertiming.se.volume, - othertiming.se.pitch) + othertiming.se.pitch + ) timing.flash_scope = othertiming.flash_scope timing.flash_color = othertiming.flash_color.clone timing.flash_duration = othertiming.flash_duration @@ -290,57 +291,57 @@ class PBAnimTiming when 1 text = sprintf("[%d] Set BG: \"%s\"", @frame + 1, name) text += sprintf(" (color=%s,%s,%s,%s)", - (@colorRed != nil) ? @colorRed.to_i : "-", - (@colorGreen != nil) ? @colorGreen.to_i : "-", - (@colorBlue != nil) ? @colorBlue.to_i : "-", - (@colorAlpha != nil) ? @colorAlpha.to_i : "-") + (@colorRed != nil) ? @colorRed.to_i : "-", + (@colorGreen != nil) ? @colorGreen.to_i : "-", + (@colorBlue != nil) ? @colorBlue.to_i : "-", + (@colorAlpha != nil) ? @colorAlpha.to_i : "-") text += sprintf(" (opacity=%s)", @opacity.to_i) text += sprintf(" (coords=%s,%s)", - (@bgX != nil) ? @bgX : "-", - (@bgY != nil) ? @bgY : "-") + (@bgX != nil) ? @bgX : "-", + (@bgY != nil) ? @bgY : "-") return text when 2 text = sprintf("[%d] Change BG: @%d", @frame + 1, duration) if @colorRed != nil || @colorGreen != nil || @colorBlue != nil || @colorAlpha != nil text += sprintf(" (color=%s,%s,%s,%s)", - (@colorRed != nil) ? @colorRed.to_i : "-", - (@colorGreen != nil) ? @colorGreen.to_i : "-", - (@colorBlue != nil) ? @colorBlue.to_i : "-", - (@colorAlpha != nil) ? @colorAlpha.to_i : "-") + (@colorRed != nil) ? @colorRed.to_i : "-", + (@colorGreen != nil) ? @colorGreen.to_i : "-", + (@colorBlue != nil) ? @colorBlue.to_i : "-", + (@colorAlpha != nil) ? @colorAlpha.to_i : "-") end text += sprintf(" (opacity=%s)", @opacity.to_i) if @opacity != nil if @bgX != nil || @bgY != nil text += sprintf(" (coords=%s,%s)", - (@bgX != nil) ? @bgX : "-", - (@bgY != nil) ? @bgY : "-") + (@bgX != nil) ? @bgX : "-", + (@bgY != nil) ? @bgY : "-") end return text when 3 text = sprintf("[%d] Set FG: \"%s\"", @frame + 1, name) text += sprintf(" (color=%s,%s,%s,%s)", - (@colorRed != nil) ? @colorRed.to_i : "-", - (@colorGreen != nil) ? @colorGreen.to_i : "-", - (@colorBlue != nil) ? @colorBlue.to_i : "-", - (@colorAlpha != nil) ? @colorAlpha.to_i : "-") + (@colorRed != nil) ? @colorRed.to_i : "-", + (@colorGreen != nil) ? @colorGreen.to_i : "-", + (@colorBlue != nil) ? @colorBlue.to_i : "-", + (@colorAlpha != nil) ? @colorAlpha.to_i : "-") text += sprintf(" (opacity=%s)", @opacity.to_i) text += sprintf(" (coords=%s,%s)", - (@bgX != nil) ? @bgX : "-", - (@bgY != nil) ? @bgY : "-") + (@bgX != nil) ? @bgX : "-", + (@bgY != nil) ? @bgY : "-") return text when 4 text = sprintf("[%d] Change FG: @%d", @frame + 1, duration) if @colorRed != nil || @colorGreen != nil || @colorBlue != nil || @colorAlpha != nil text += sprintf(" (color=%s,%s,%s,%s)", - (@colorRed != nil) ? @colorRed.to_i : "-", - (@colorGreen != nil) ? @colorGreen.to_i : "-", - (@colorBlue != nil) ? @colorBlue.to_i : "-", - (@colorAlpha != nil) ? @colorAlpha.to_i : "-") + (@colorRed != nil) ? @colorRed.to_i : "-", + (@colorGreen != nil) ? @colorGreen.to_i : "-", + (@colorBlue != nil) ? @colorBlue.to_i : "-", + (@colorAlpha != nil) ? @colorAlpha.to_i : "-") end text += sprintf(" (opacity=%s)", @opacity.to_i) if @opacity != nil if @bgX != nil || @bgY != nil text += sprintf(" (coords=%s,%s)", - (@bgX != nil) ? @bgX : "-", - (@bgY != nil) ? @bgY : "-") + (@bgX != nil) ? @bgX : "-", + (@bgY != nil) ? @bgY : "-") end return text end @@ -638,11 +639,11 @@ def pbSpriteSetAnimFrame(sprite, frame, user = nil, target = nil, inEditor = fal if pattern >= 0 animwidth = 192 sprite.src_rect.set((pattern % 5) * animwidth, (pattern / 5) * animwidth, - animwidth, animwidth) + animwidth, animwidth) else sprite.src_rect.set(0, 0, - (sprite.bitmap) ? sprite.bitmap.width : 128, - (sprite.bitmap) ? sprite.bitmap.height : 128) + (sprite.bitmap) ? sprite.bitmap.width : 128, + (sprite.bitmap) ? sprite.bitmap.height : 128) end sprite.zoom_x = frame[AnimFrame::ZOOMX] / 100.0 sprite.zoom_y = frame[AnimFrame::ZOOMY] / 100.0 @@ -807,7 +808,7 @@ class PBAnimationPlayerX # Load the animation's spritesheet and assign it to all the sprites. if !@animbitmap || @animbitmap.disposed? @animbitmap = AnimatedBitmap.new("Graphics/Animations/" + @animation.graphic, - @animation.hue).deanimate + @animation.hue).deanimate for i in 0...MAX_SPRITES @animsprites[i].bitmap = @animbitmap if @animsprites[i] end @@ -851,10 +852,9 @@ class PBAnimationPlayerX sprite.y = cel[AnimFrame::Y] + @userOrig[1] - Battle::Scene::FOCUSUSER_Y when 3 # Focused on user and target next if !@srcLine || !@dstLine - point = transformPoint( - @srcLine[0], @srcLine[1], @srcLine[2], @srcLine[3], - @dstLine[0], @dstLine[1], @dstLine[2], @dstLine[3], - sprite.x, sprite.y) + point = transformPoint(@srcLine[0], @srcLine[1], @srcLine[2], @srcLine[3], + @dstLine[0], @dstLine[1], @dstLine[2], @dstLine[3], + sprite.x, sprite.y) sprite.x = point[0] sprite.y = point[1] if isReversed(@srcLine[0], @srcLine[2], @dstLine[0], @dstLine[2]) && diff --git a/Data/Scripts/011_Battle/007_Other battle types/001_SafariBattle.rb b/Data/Scripts/011_Battle/007_Other battle types/001_SafariBattle.rb index c2a0773a6..fad28f979 100644 --- a/Data/Scripts/011_Battle/007_Other battle types/001_SafariBattle.rb +++ b/Data/Scripts/011_Battle/007_Other battle types/001_SafariBattle.rb @@ -122,7 +122,7 @@ class Battle::Scene::Animation::ThrowBait < Battle::Scene::Animation trainer = addSprite(traSprite, PictureOrigin::Bottom) # Set up bait sprite ball = addNewSprite(ballStartX, ballStartY, - "Graphics/Battle animations/safari_bait", PictureOrigin::Center) + "Graphics/Battle animations/safari_bait", PictureOrigin::Center) ball.setZ(0, batSprite.z + 1) # Trainer animation if traSprite.bitmap.width >= traSprite.bitmap.height * 2 @@ -132,7 +132,7 @@ class Battle::Scene::Animation::ThrowBait < Battle::Scene::Animation # Bait arc animation ball.setSE(delay, "Battle throw") createBallTrajectory(ball, delay, 12, - ballStartX, ballStartY, ballMidX, ballMidY, ballEndX, ballEndY) + ballStartX, ballStartY, ballMidX, ballMidY, ballEndX, ballEndY) ball.setZ(9, batSprite.z + 1) delay = ball.totalDuration ball.moveOpacity(delay + 8, 2, 0) @@ -187,7 +187,7 @@ class Battle::Scene::Animation::ThrowRock < Battle::Scene::Animation trainer = addSprite(traSprite, PictureOrigin::Bottom) # Set up bait sprite ball = addNewSprite(ballStartX, ballStartY, - "Graphics/Battle animations/safari_rock", PictureOrigin::Center) + "Graphics/Battle animations/safari_rock", PictureOrigin::Center) ball.setZ(0, batSprite.z + 1) # Trainer animation if traSprite.bitmap.width >= traSprite.bitmap.height * 2 @@ -197,7 +197,7 @@ class Battle::Scene::Animation::ThrowRock < Battle::Scene::Animation # Bait arc animation ball.setSE(delay, "Battle throw") createBallTrajectory(ball, delay, 12, - ballStartX, ballStartY, ballMidX, ballMidY, ballEndX, ballEndY) + ballStartX, ballStartY, ballMidX, ballMidY, ballEndX, ballEndY) ball.setZ(9, batSprite.z + 1) delay = ball.totalDuration ball.setSE(delay, "Battle damage weak") @@ -205,7 +205,7 @@ class Battle::Scene::Animation::ThrowRock < Battle::Scene::Animation ball.setVisible(delay + 4, false) # Set up anger sprite anger = addNewSprite(ballEndX - 42, ballEndY - 36, - "Graphics/Battle animations/safari_anger", PictureOrigin::Center) + "Graphics/Battle animations/safari_anger", PictureOrigin::Center) anger.setVisible(0, false) anger.setZ(0, batSprite.z + 1) # Show anger appearing diff --git a/Data/Scripts/011_Battle/007_Other battle types/002_BugContestBattle.rb b/Data/Scripts/011_Battle/007_Other battle types/002_BugContestBattle.rb index 96c946f23..1fed48415 100644 --- a/Data/Scripts/011_Battle/007_Other battle types/002_BugContestBattle.rb +++ b/Data/Scripts/011_Battle/007_Other battle types/002_BugContestBattle.rb @@ -63,9 +63,8 @@ class BugContestBattle < Battle lastPokemon = pbBugContestState.lastPokemon pbDisplayPaused(_INTL("You already caught a {1}.", lastPokemon.name)) helptext = _INTL("STOCK POKéMON:\n {1} Lv.{2} MaxHP: {3}\nTHIS POKéMON:\n {4} Lv.{5} MaxHP: {6}", - lastPokemon.name, lastPokemon.level, lastPokemon.totalhp, - pkmn.name, pkmn.level, pkmn.totalhp - ) + lastPokemon.name, lastPokemon.level, lastPokemon.totalhp, + pkmn.name, pkmn.level, pkmn.totalhp) @scene.pbShowHelp(helptext) if pbDisplayConfirm(_INTL("Switch Pokémon?")) pbBugContestState.lastPokemon = pkmn diff --git a/Data/Scripts/011_Battle/007_Other battle types/004_BattleArenaBattle.rb b/Data/Scripts/011_Battle/007_Other battle types/004_BattleArenaBattle.rb index e53af4ef2..2b72ead13 100644 --- a/Data/Scripts/011_Battle/007_Other battle types/004_BattleArenaBattle.rb +++ b/Data/Scripts/011_Battle/007_Other battle types/004_BattleArenaBattle.rb @@ -182,7 +182,7 @@ class BattleArenaBattle < Battle # Make judgment if points[0] == points[1] pbDisplay(_INTL("{1} tied the opponent\n{2} in a referee's decision!", - @battlers[0].name, @battlers[1].name)) + @battlers[0].name, @battlers[1].name)) # NOTE: Pokémon doesn't really lose HP, but the effect is mostly the # same. @battlers[0].hp = 0 @@ -191,12 +191,12 @@ class BattleArenaBattle < Battle @battlers[1].pbFaint(false) elsif points[0] > points[1] pbDisplay(_INTL("{1} defeated the opponent\n{2} in a referee's decision!", - @battlers[0].name, @battlers[1].name)) + @battlers[0].name, @battlers[1].name)) @battlers[1].hp = 0 @battlers[1].pbFaint(false) else pbDisplay(_INTL("{1} lost to the opponent\n{2} in a referee's decision!", - @battlers[0].name, @battlers[1].name)) + @battlers[0].name, @battlers[1].name)) @battlers[0].hp = 0 @battlers[0].pbFaint(false) end @@ -266,7 +266,7 @@ class Battle::Scene def pbBattleArenaBattlers(battler1, battler2) pbMessage(_INTL("REFEREE: {1} VS {2}!\nCommence battling!\\wtnp[20]", - battler1.name, battler2.name)) { pbBattleArenaUpdate } + battler1.name, battler2.name)) { pbBattleArenaUpdate } end def pbBattleArenaJudgment(battler1, battler2, ratings1, ratings2) @@ -277,7 +277,7 @@ class Battle::Scene msgwindow = pbCreateMessageWindow dimmingvp = Viewport.new(0, 0, Graphics.width, Graphics.height - msgwindow.height) pbMessageDisplay(msgwindow, - _INTL("REFEREE: That's it! We will now go to judging to determine the winner!\\wtnp[20]")) { + _INTL("REFEREE: That's it! We will now go to judging to determine the winner!\\wtnp[20]")) { pbBattleArenaUpdate dimmingvp.update } @@ -305,21 +305,21 @@ class Battle::Scene end updateJudgment(infowindow, 1, battler1, battler2, ratings1, ratings2) pbMessageDisplay(msgwindow, - _INTL("REFEREE: Judging category 1, Mind!\nThe Pokémon showing the most guts!\\wtnp[40]")) { + _INTL("REFEREE: Judging category 1, Mind!\nThe Pokémon showing the most guts!\\wtnp[40]")) { pbBattleArenaUpdate dimmingvp.update infowindow.update } updateJudgment(infowindow, 2, battler1, battler2, ratings1, ratings2) pbMessageDisplay(msgwindow, - _INTL("REFEREE: Judging category 2, Skill!\nThe Pokémon using moves the best!\\wtnp[40]")) { + _INTL("REFEREE: Judging category 2, Skill!\nThe Pokémon using moves the best!\\wtnp[40]")) { pbBattleArenaUpdate dimmingvp.update infowindow.update } updateJudgment(infowindow, 3, battler1, battler2, ratings1, ratings2) pbMessageDisplay(msgwindow, - _INTL("REFEREE: Judging category 3, Body!\nThe Pokémon with the most vitality!\\wtnp[40]")) { + _INTL("REFEREE: Judging category 3, Body!\nThe Pokémon with the most vitality!\\wtnp[40]")) { pbBattleArenaUpdate dimmingvp.update infowindow.update @@ -332,23 +332,23 @@ class Battle::Scene end if total1 == total2 pbMessageDisplay(msgwindow, - _INTL("REFEREE: Judgment: {1} to {2}!\nWe have a draw!\\wtnp[40]", total1, total2)) { + _INTL("REFEREE: Judgment: {1} to {2}!\nWe have a draw!\\wtnp[40]", total1, total2)) { pbBattleArenaUpdate dimmingvp.update infowindow.update } elsif total1 > total2 pbMessageDisplay(msgwindow, - _INTL("REFEREE: Judgment: {1} to {2}!\nThe winner is {3}'s {4}!\\wtnp[40]", - total1, total2, @battle.pbGetOwnerName(battler1.index), battler1.name)) { + _INTL("REFEREE: Judgment: {1} to {2}!\nThe winner is {3}'s {4}!\\wtnp[40]", + total1, total2, @battle.pbGetOwnerName(battler1.index), battler1.name)) { pbBattleArenaUpdate dimmingvp.update infowindow.update } else pbMessageDisplay(msgwindow, - _INTL("REFEREE: Judgment: {1} to {2}!\nThe winner is {3}!\\wtnp[40]", - total1, total2, battler2.name)) { + _INTL("REFEREE: Judgment: {1} to {2}!\nThe winner is {3}!\\wtnp[40]", + total1, total2, battler2.name)) { pbBattleArenaUpdate dimmingvp.update infowindow.update diff --git a/Data/Scripts/012_Overworld/001_Overworld visuals/003_Overworld_MapTransitionAnims.rb b/Data/Scripts/012_Overworld/001_Overworld visuals/003_Overworld_MapTransitionAnims.rb index 127a5785b..f1343023e 100644 --- a/Data/Scripts/012_Overworld/001_Overworld visuals/003_Overworld_MapTransitionAnims.rb +++ b/Data/Scripts/012_Overworld/001_Overworld visuals/003_Overworld_MapTransitionAnims.rb @@ -31,7 +31,7 @@ def pbCaveEntranceEx(exiting) for i in 0...totalBands currentGray = grays[i] sprite.bitmap.fill_rect(Rect.new(x, y, rectwidth, rectheight), - Color.new(currentGray, currentGray, currentGray)) + Color.new(currentGray, currentGray, currentGray)) x += bandwidth y += bandheight rectwidth -= bandwidth * 2 diff --git a/Data/Scripts/012_Overworld/001_Overworld.rb b/Data/Scripts/012_Overworld/001_Overworld.rb index dfaf908c5..00f34d775 100644 --- a/Data/Scripts/012_Overworld/001_Overworld.rb +++ b/Data/Scripts/012_Overworld/001_Overworld.rb @@ -507,7 +507,8 @@ def pbMoveRoute(event, commands, waitComplete = false) i += 2 when PBMoveRoute::Graphic route.list.push(RPG::MoveCommand.new(commands[i], - [commands[i + 1], commands[i + 2], commands[i + 3], commands[i + 4]])) + [commands[i + 1], commands[i + 2], + commands[i + 3], commands[i + 4]])) i += 4 else route.list.push(RPG::MoveCommand.new(commands[i])) @@ -728,7 +729,7 @@ def pbItemBall(item, quantity = 1) pbMessage(_INTL("\\me[{1}]You found a \\c[1]{2}\\c[0]!\\wtnp[30]", meName, itemname)) end pbMessage(_INTL("You put the {1} in\\nyour Bag's \\c[1]{3}\\c[0] pocket.", - itemname, pocket, PokemonBag.pocket_names[pocket - 1])) + itemname, pocket, PokemonBag.pocket_names[pocket - 1])) return true end # Can't add the item @@ -774,7 +775,7 @@ def pbReceiveItem(item, quantity = 1) end if $bag.add(item, quantity) # If item can be added pbMessage(_INTL("You put the {1} in\\nyour Bag's \\c[1]{3}\\c[0] pocket.", - itemname, pocket, PokemonBag.pocket_names[pocket - 1])) + itemname, pocket, PokemonBag.pocket_names[pocket - 1])) return true end return false # Can't add the item diff --git a/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb b/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb index d90224623..c9bcdc46d 100644 --- a/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb +++ b/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb @@ -508,8 +508,7 @@ def pbTrainerBattle(trainerID, trainerName, endSpeech = nil, # Perform the battle if $game_temp.waiting_trainer decision = pbTrainerBattleCore($game_temp.waiting_trainer[0], - [trainerID, trainerName, trainerPartyID, endSpeech] - ) + [trainerID, trainerName, trainerPartyID, endSpeech]) else decision = pbTrainerBattleCore([trainerID, trainerName, trainerPartyID, endSpeech]) end diff --git a/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb b/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb index 62e8a7551..76cd3da5b 100644 --- a/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb +++ b/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb @@ -91,7 +91,8 @@ def pbHiddenMoveAnimation(pokemon) interp = RectInterpolator.new( Rect.new(0, Graphics.height / 2, Graphics.width, 0), Rect.new(0, (Graphics.height - bg.bitmap.height) / 2, Graphics.width, bg.bitmap.height), - Graphics.frame_rate / 4) + Graphics.frame_rate / 4 + ) ptinterp = nil phase = 1 frames = 0 @@ -110,7 +111,8 @@ def pbHiddenMoveAnimation(pokemon) ptinterp = PointInterpolator.new( Graphics.width + (sprite.bitmap.width / 2), bg.bitmap.height / 2, Graphics.width / 2, bg.bitmap.height / 2, - Graphics.frame_rate * 4 / 10) + Graphics.frame_rate * 4 / 10 + ) end when 2 # Slide Pokémon sprite in from right to centre ptinterp.update @@ -129,7 +131,8 @@ def pbHiddenMoveAnimation(pokemon) ptinterp = PointInterpolator.new( Graphics.width / 2, bg.bitmap.height / 2, -(sprite.bitmap.width / 2), bg.bitmap.height / 2, - Graphics.frame_rate * 4 / 10) + Graphics.frame_rate * 4 / 10 + ) frames = 0 end when 4 # Slide Pokémon sprite off from centre to left @@ -142,7 +145,8 @@ def pbHiddenMoveAnimation(pokemon) interp = RectInterpolator.new( Rect.new(0, (Graphics.height - bg.bitmap.height) / 2, Graphics.width, bg.bitmap.height), Rect.new(0, Graphics.height / 2, Graphics.width, 0), - Graphics.frame_rate / 4) + Graphics.frame_rate / 4 + ) end when 5 # Shrink viewport height from full to zero interp.update diff --git a/Data/Scripts/012_Overworld/006_Overworld_BerryPlants.rb b/Data/Scripts/012_Overworld/006_Overworld_BerryPlants.rb index 8c3612844..fb48695dc 100644 --- a/Data/Scripts/012_Overworld/006_Overworld_BerryPlants.rb +++ b/Data/Scripts/012_Overworld/006_Overworld_BerryPlants.rb @@ -272,7 +272,7 @@ class BerryPlantSprite @old_stage > 0 && berry_plant.growth_stage <= GameData::BerryPlant::NUMBER_OF_GROWTH_STAGES + 1 spriteset = $scene.spriteset(@map.map_id) spriteset.addUserAnimation(Settings::PLANT_SPARKLE_ANIMATION_ID, - @event.x, @event.y, false, 1) if spriteset + @event.x, @event.y, false, 1) if spriteset end end @old_stage = berry_plant.growth_stage @@ -356,7 +356,7 @@ def pbBerryPlant GameData::BerryPlant::WATERING_CANS.each do |item| next if !$bag.has?(item) break if !pbConfirmMessage(_INTL("Want to sprinkle some water with the {1}?", - GameData::Item.get(item).name)) + GameData::Item.get(item).name)) berry_plant.water pbMessage(_INTL("{1} watered the plant.\\wtnp[40]", $player.name)) if Settings::NEW_BERRY_PLANTS @@ -376,7 +376,7 @@ def pbBerryPlant pbMessage(_INTL("{1} has been laid down.\1", GameData::Item.get(berry_plant.mulch_id).name)) else case pbMessage(_INTL("It's soft, earthy soil."), - [_INTL("Fertilize"), _INTL("Plant Berry"), _INTL("Exit")], -1) + [_INTL("Fertilize"), _INTL("Plant Berry"), _INTL("Exit")], -1) when 0 # Fertilize mulch = nil pbFadeOutIn { @@ -417,10 +417,10 @@ def pbBerryPlant $bag.remove(berry) if Settings::NEW_BERRY_PLANTS pbMessage(_INTL("The {1} was planted in the soft, earthy soil.", - GameData::Item.get(berry).name)) + GameData::Item.get(berry).name)) else pbMessage(_INTL("{1} planted a {2} in the soft loamy soil.", - $player.name, GameData::Item.get(berry).name)) + $player.name, GameData::Item.get(berry).name)) end end end @@ -454,7 +454,7 @@ def pbPickBerry(berry, qty = 1) end pocket = berry.pocket pbMessage(_INTL("{1} put the \\c[1]{2}\\c[0] in the \\c[1]{4}\\c[0] Pocket.\1", - $player.name, berry_name, pocket, PokemonBag.pocket_names[pocket - 1])) + $player.name, berry_name, pocket, PokemonBag.pocket_names[pocket - 1])) if Settings::NEW_BERRY_PLANTS pbMessage(_INTL("The soil returned to its soft and earthy state.")) else diff --git a/Data/Scripts/012_Overworld/008_Overworld_RandomDungeons.rb b/Data/Scripts/012_Overworld/008_Overworld_RandomDungeons.rb index 58b3bacfe..65026d40d 100644 --- a/Data/Scripts/012_Overworld/008_Overworld_RandomDungeons.rb +++ b/Data/Scripts/012_Overworld/008_Overworld_RandomDungeons.rb @@ -575,11 +575,11 @@ module RandomDungeonGenerator for y in 0...maxHeight / cellHeight for x in 0...maxWidth / cellWidth pattern = maze.getEdgePattern(x, y) - if DungeonMaze.paint_cell_contents( - self, BUFFER_X + x * cellWidth, BUFFER_Y + y * cellHeight, - corridor_patterns[pattern], DungeonMaze::TURN_NONE) - roomcount += 1 - end + next if !DungeonMaze.paint_cell_contents( + self, BUFFER_X + x * cellWidth, BUFFER_Y + y * cellHeight, + corridor_patterns[pattern], DungeonMaze::TURN_NONE + ) + roomcount += 1 end end # If no rooms were generated, make the whole map a room diff --git a/Data/Scripts/013_Items/001_Item_Utilities.rb b/Data/Scripts/013_Items/001_Item_Utilities.rb index da79df86c..024fe7504 100644 --- a/Data/Scripts/013_Items/001_Item_Utilities.rb +++ b/Data/Scripts/013_Items/001_Item_Utilities.rb @@ -161,9 +161,9 @@ def pbChangeLevel(pkmn, new_level, scene) special_defense_diff = pkmn.spdef - old_special_defense speed_diff = pkmn.speed - old_speed pbTopRightWindow(_INTL("Max. HP{1}\r\nAttack{2}\r\nDefense{3}\r\nSp. Atk{4}\r\nSp. Def{5}\r\nSpeed{6}", - total_hp_diff, attack_diff, defense_diff, special_attack_diff, special_defense_diff, speed_diff), scene) + total_hp_diff, attack_diff, defense_diff, special_attack_diff, special_defense_diff, speed_diff), scene) pbTopRightWindow(_INTL("Max. HP{1}\r\nAttack{2}\r\nDefense{3}\r\nSp. Atk{4}\r\nSp. Def{5}\r\nSpeed{6}", - pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed), scene) + pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed), scene) else pkmn.changeHappiness("vitamin") if scene.is_a?(PokemonPartyScreen) @@ -178,9 +178,9 @@ def pbChangeLevel(pkmn, new_level, scene) special_defense_diff = pkmn.spdef - old_special_defense speed_diff = pkmn.speed - old_speed pbTopRightWindow(_INTL("Max. HP+{1}\r\nAttack+{2}\r\nDefense+{3}\r\nSp. Atk+{4}\r\nSp. Def+{5}\r\nSpeed+{6}", - total_hp_diff, attack_diff, defense_diff, special_attack_diff, special_defense_diff, speed_diff), scene) + total_hp_diff, attack_diff, defense_diff, special_attack_diff, special_defense_diff, speed_diff), scene) pbTopRightWindow(_INTL("Max. HP{1}\r\nAttack{2}\r\nDefense{3}\r\nSp. Atk{4}\r\nSp. Def{5}\r\nSpeed{6}", - pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed), scene) + pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed), scene) # Learn new moves upon level up movelist = pkmn.getMoveList for i in movelist @@ -259,9 +259,9 @@ def pbChangeExp(pkmn, new_exp, scene) special_defense_diff = pkmn.spdef - old_special_defense speed_diff = pkmn.speed - old_speed pbTopRightWindow(_INTL("Max. HP{1}\r\nAttack{2}\r\nDefense{3}\r\nSp. Atk{4}\r\nSp. Def{5}\r\nSpeed{6}", - total_hp_diff, attack_diff, defense_diff, special_attack_diff, special_defense_diff, speed_diff), scene) + total_hp_diff, attack_diff, defense_diff, special_attack_diff, special_defense_diff, speed_diff), scene) pbTopRightWindow(_INTL("Max. HP{1}\r\nAttack{2}\r\nDefense{3}\r\nSp. Atk{4}\r\nSp. Def{5}\r\nSpeed{6}", - pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed), scene) + pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed), scene) else # Gains Exp difference = new_exp - pkmn.exp if scene.is_a?(PokemonPartyScreen) @@ -287,9 +287,9 @@ def pbChangeExp(pkmn, new_exp, scene) special_defense_diff = pkmn.spdef - old_special_defense speed_diff = pkmn.speed - old_speed pbTopRightWindow(_INTL("Max. HP+{1}\r\nAttack+{2}\r\nDefense+{3}\r\nSp. Atk+{4}\r\nSp. Def+{5}\r\nSpeed+{6}", - total_hp_diff, attack_diff, defense_diff, special_attack_diff, special_defense_diff, speed_diff), scene) + total_hp_diff, attack_diff, defense_diff, special_attack_diff, special_defense_diff, speed_diff), scene) pbTopRightWindow(_INTL("Max. HP{1}\r\nAttack{2}\r\nDefense{3}\r\nSp. Atk{4}\r\nSp. Def{5}\r\nSpeed{6}", - pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed), scene) + pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed), scene) # Learn new moves upon level up movelist = pkmn.getMoveList for i in movelist @@ -495,7 +495,7 @@ def pbNatureChangingMint(new_nature, item, pkmn, scene) pkmn.calc_stats scene.pbRefresh scene.pbDisplay(_INTL("{1}'s stats may have changed due to the effects of the {2}!", - pkmn.name, GameData::Item.get(item).name)) + pkmn.name, GameData::Item.get(item).name)) return true end @@ -596,7 +596,7 @@ def pbLearnMove(pkmn, move, ignore_if_known = false, by_machine = false, &block) return true end pbMessage(_INTL("{1} wants to learn {2}, but it already knows {3} moves.\1", - pkmn_name, move_name, pkmn.numMoves.to_word), &block) + pkmn_name, move_name, pkmn.numMoves.to_word), &block) if pbConfirmMessage(_INTL("Should {1} forget a move to learn {2}?", pkmn_name, move_name), &block) loop do move_index = pbForgetMove(pkmn, move) @@ -688,7 +688,8 @@ def pbUseItem(bag, item, bagscene = nil) max_at_once = [max_at_once, $bag.quantity(item)].min if max_at_once > 1 qty = screen.scene.pbChooseNumber( - _INTL("How many {1} do you want to use?", GameData::Item.get(item).name), max_at_once) + _INTL("How many {1} do you want to use?", GameData::Item.get(item).name), max_at_once + ) screen.scene.pbSetHelpText("") if screen.is_a?(PokemonPartyScreen) end if qty >= 1 @@ -749,7 +750,8 @@ def pbUseItemOnPokemon(item, pkmn, scene) max_at_once = [max_at_once, $bag.quantity(item)].min if max_at_once > 1 qty = scene.scene.pbChooseNumber( - _INTL("How many {1} do you want to use?", itm.name), max_at_once) + _INTL("How many {1} do you want to use?", itm.name), max_at_once + ) scene.scene.pbSetHelpText("") if scene.is_a?(PokemonPartyScreen) end return false if qty <= 0 diff --git a/Data/Scripts/013_Items/004_Item_Phone.rb b/Data/Scripts/013_Items/004_Item_Phone.rb index 3267afcce..1745c2122 100644 --- a/Data/Scripts/013_Items/004_Item_Phone.rb +++ b/Data/Scripts/013_Items/004_Item_Phone.rb @@ -48,7 +48,7 @@ def pbPhoneRegisterBattle(message, event, trainertype, trainername, maxbattles) message = _INTL("Let me register you.") if !message return if !pbConfirmMessage(message) displayname = _INTL("{1} {2}", GameData::TrainerType.get(trainertype).name, - pbGetMessageFromHash(MessageTypes::TrainerNames, trainername)) + pbGetMessageFromHash(MessageTypes::TrainerNames, trainername)) if contact # Previously registered, just make visible contact[0] = true else # Add new contact diff --git a/Data/Scripts/013_Items/005_Item_PokeRadar.rb b/Data/Scripts/013_Items/005_Item_PokeRadar.rb index 6e01f0b7e..b320b764a 100644 --- a/Data/Scripts/013_Items/005_Item_PokeRadar.rb +++ b/Data/Scripts/013_Items/005_Item_PokeRadar.rb @@ -35,7 +35,7 @@ def pbCanUsePokeRadar? # Can't use Radar if it isn't fully charged if $PokemonGlobal.pokeradarBattery && $PokemonGlobal.pokeradarBattery > 0 pbMessage(_INTL("The battery has run dry!\nFor it to recharge, you need to walk another {1} steps.", - $PokemonGlobal.pokeradarBattery)) + $PokemonGlobal.pokeradarBattery)) return false end return true diff --git a/Data/Scripts/013_Items/006_Item_Mail.rb b/Data/Scripts/013_Items/006_Item_Mail.rb index 523cf5542..1bf4c07c5 100644 --- a/Data/Scripts/013_Items/006_Item_Mail.rb +++ b/Data/Scripts/013_Items/006_Item_Mail.rb @@ -41,22 +41,25 @@ def pbDisplayMail(mail, _bearer = nil) if GameData::Item.get(mail.item).is_icon_mail? if mail.poke1 sprites["bearer"] = IconSprite.new(64, 288, viewport) - bitmapFileName = GameData::Species.icon_filename(mail.poke1[0], - mail.poke1[3], mail.poke1[1], mail.poke1[2], mail.poke1[4], mail.poke1[5]) + bitmapFileName = GameData::Species.icon_filename( + mail.poke1[0], mail.poke1[3], mail.poke1[1], mail.poke1[2], mail.poke1[4], mail.poke1[5] + ) sprites["bearer"].setBitmap(bitmapFileName) sprites["bearer"].src_rect.set(0, 0, 64, 64) end if mail.poke2 sprites["bearer2"] = IconSprite.new(144, 288, viewport) - bitmapFileName = GameData::Species.icon_filename(mail.poke2[0], - mail.poke2[3], mail.poke2[1], mail.poke2[2], mail.poke2[4], mail.poke2[5]) + bitmapFileName = GameData::Species.icon_filename( + mail.poke2[0], mail.poke2[3], mail.poke2[1], mail.poke2[2], mail.poke2[4], mail.poke2[5] + ) sprites["bearer2"].setBitmap(bitmapFileName) sprites["bearer2"].src_rect.set(0, 0, 64, 64) end if mail.poke3 sprites["bearer3"] = IconSprite.new(224, 288, viewport) - bitmapFileName = GameData::Species.icon_filename(mail.poke3[0], - mail.poke3[3], mail.poke3[1], mail.poke3[2], mail.poke3[4], mail.poke3[5]) + bitmapFileName = GameData::Species.icon_filename( + mail.poke3[0], mail.poke3[3], mail.poke3[1], mail.poke3[2], mail.poke3[4], mail.poke3[5] + ) sprites["bearer3"].setBitmap(bitmapFileName) sprites["bearer3"].src_rect.set(0, 0, 64, 64) end @@ -68,14 +71,14 @@ def pbDisplayMail(mail, _bearer = nil) if mail.message && mail.message != "" isDark = isDarkBackground(sprites["card"].bitmap, Rect.new(48, 48, Graphics.width - 96, 32 * 7)) drawTextEx(overlay, 48, 52, Graphics.width - (48 * 2), 7, mail.message, - (isDark) ? baseForDarkBG : baseForLightBG, - (isDark) ? shadowForDarkBG : shadowForLightBG) + (isDark) ? baseForDarkBG : baseForLightBG, + (isDark) ? shadowForDarkBG : shadowForLightBG) end if mail.sender && mail.sender != "" isDark = isDarkBackground(sprites["card"].bitmap, Rect.new(336, 322, 144, 32 * 1)) drawTextEx(overlay, 336, 326, 144, 1, mail.sender, - (isDark) ? baseForDarkBG : baseForLightBG, - (isDark) ? shadowForDarkBG : shadowForLightBG) + (isDark) ? baseForDarkBG : baseForLightBG, + (isDark) ? shadowForDarkBG : shadowForLightBG) end pbFadeInAndShow(sprites) loop do @@ -95,7 +98,7 @@ def pbWriteMail(item, pkmn, pkmnid, scene) message = "" loop do message = pbMessageFreeText(_INTL("Please enter a message (max. 250 characters)."), - "", false, 250, Graphics.width) { scene.pbUpdate } + "", false, 250, Graphics.width) { scene.pbUpdate } if message != "" # Store mail if a message was written poke1 = poke2 = nil diff --git a/Data/Scripts/013_Items/008_PokemonBag.rb b/Data/Scripts/013_Items/008_PokemonBag.rb index 75b8a671d..119216878 100644 --- a/Data/Scripts/013_Items/008_PokemonBag.rb +++ b/Data/Scripts/013_Items/008_PokemonBag.rb @@ -78,7 +78,8 @@ class PokemonBag max_size = max_pocket_size(pocket) max_size = @pockets[pocket].length + 1 if max_size < 0 # Infinite size return ItemStorageHelper.can_add?( - @pockets[pocket], max_size, Settings::BAG_MAX_PER_SLOT, item_data.id, qty) + @pockets[pocket], max_size, Settings::BAG_MAX_PER_SLOT, item_data.id, qty + ) end def add(item, qty = 1) @@ -88,7 +89,7 @@ class PokemonBag max_size = max_pocket_size(pocket) max_size = @pockets[pocket].length + 1 if max_size < 0 # Infinite size ret = ItemStorageHelper.add(@pockets[pocket], - max_size, Settings::BAG_MAX_PER_SLOT, item_data.id, qty) + max_size, Settings::BAG_MAX_PER_SLOT, item_data.id, qty) if ret && Settings::BAG_POCKET_AUTO_SORT[pocket - 1] @pockets[pocket].sort! { |a, b| GameData::Item.keys.index(a[0]) <=> GameData::Item.keys.index(b[0]) } end diff --git a/Data/Scripts/015_Trainers and player/002_Trainer_LoadAndNew.rb b/Data/Scripts/015_Trainers and player/002_Trainer_LoadAndNew.rb index 134082db8..daa298461 100644 --- a/Data/Scripts/015_Trainers and player/002_Trainer_LoadAndNew.rb +++ b/Data/Scripts/015_Trainers and player/002_Trainer_LoadAndNew.rb @@ -24,7 +24,7 @@ def pbNewTrainer(tr_type, tr_name, tr_version, save_changes = true) params.setRange(1, GameData::GrowthRate.max_level) params.setDefaultValue(10) level = pbMessageChooseNumber(_INTL("Set the level for {1} (max. #{params.maxNumber}).", - GameData::Species.get(species).name), params) + GameData::Species.get(species).name), params) party.push([species, level]) break else @@ -87,7 +87,7 @@ def pbTrainerCheck(tr_type, tr_name, max_battles, tr_version = 0) return true if GameData::Trainer.exists?(tr_type, tr_name, tr_version) # Add new trainer if pbConfirmMessage(_INTL("Add new trainer variant {1} (of {2}) for {3} {4}?", - tr_version, max_battles, tr_type.to_s, tr_name)) + tr_version, max_battles, tr_type.to_s, tr_name)) pbNewTrainer(tr_type, tr_name, tr_version) end return true diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/003_UI_EggHatching.rb b/Data/Scripts/016_UI/001_Non-interactive UI/003_UI_EggHatching.rb index 0c62137ac..f85770799 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/003_UI_EggHatching.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/003_UI_EggHatching.rb @@ -18,7 +18,7 @@ class PokemonEggHatch_Scene @viewport.z = 99999 # Create background image addBackgroundOrColoredPlane(@sprites, "background", "hatchbg", - Color.new(248, 248, 248), @viewport) + Color.new(248, 248, 248), @viewport) # Create egg sprite/Pokémon sprite @sprites["pokemon"] = PokemonSprite.new(@viewport) @sprites["pokemon"].setOffset(PictureOrigin::Bottom) @@ -46,7 +46,7 @@ class PokemonEggHatch_Scene @sprites["overlay"].z = 200 @sprites["overlay"].bitmap = Bitmap.new(Graphics.width, Graphics.height) @sprites["overlay"].bitmap.fill_rect(0, 0, Graphics.width, Graphics.height, - Color.new(255, 255, 255)) + Color.new(255, 255, 255)) @sprites["overlay"].opacity = 0 # Start up scene pbFadeInAndShow(@sprites) @@ -103,10 +103,10 @@ class PokemonEggHatch_Scene pbMEPlay("Evolution success") @pokemon.name = nil pbMessage(_INTL("\\se[]{1} hatched from the Egg!\\wt[80]", @pokemon.name)) { update } - if pbConfirmMessage( - _INTL("Would you like to nickname the newly hatched {1}?", @pokemon.name)) { update } + if pbConfirmMessage(_INTL("Would you like to nickname the newly hatched {1}?", + @pokemon.name)) { update } nickname = pbEnterPokemonName(_INTL("{1}'s nickname?", @pokemon.name), - 0, Pokemon::MAX_NAME_SIZE, "", @pokemon, true) + 0, Pokemon::MAX_NAME_SIZE, "", @pokemon, true) @pokemon.name = nickname @nicknamed = true end diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb b/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb index f0da60788..2eda75cb9 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb @@ -496,7 +496,7 @@ class PokemonEvolutionScene @msgviewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @msgviewport.z = 99999 addBackgroundOrColoredPlane(@sprites, "background", "evolutionbg", - Color.new(248, 248, 248), @bgviewport) + Color.new(248, 248, 248), @bgviewport) rsprite1 = PokemonSprite.new(@viewport) rsprite1.setOffset(PictureOrigin::Center) rsprite1.setPokemonBitmap(@pokemon, false) @@ -534,7 +534,7 @@ class PokemonEvolutionScene pbBGMStop @pokemon.play_cry pbMessageDisplay(@sprites["msgwindow"], - _INTL("\\se[]What? {1} is evolving!\\^", @pokemon.name)) { pbUpdate } + _INTL("\\se[]What? {1} is evolving!\\^", @pokemon.name)) { pbUpdate } pbMessageWaitForInput(@sprites["msgwindow"], 50, true) { pbUpdate } pbPlayDecisionSE oldstate = pbSaveSpriteState(@sprites["rsprite1"]) @@ -560,7 +560,7 @@ class PokemonEvolutionScene if canceled $stats.evolutions_cancelled += 1 pbMessageDisplay(@sprites["msgwindow"], - _INTL("Huh? {1} stopped evolving!", @pokemon.name)) { pbUpdate } + _INTL("Huh? {1} stopped evolving!", @pokemon.name)) { pbUpdate } else pbEvolutionSuccess end @@ -580,8 +580,8 @@ class PokemonEvolutionScene pbMEPlay("Evolution success") newspeciesname = GameData::Species.get(@newspecies).name pbMessageDisplay(@sprites["msgwindow"], - _INTL("\\se[]Congratulations! Your {1} evolved into {2}!\\wt[80]", - @pokemon.name, newspeciesname)) { pbUpdate } + _INTL("\\se[]Congratulations! Your {1} evolved into {2}!\\wt[80]", + @pokemon.name, newspeciesname)) { pbUpdate } @sprites["msgwindow"].text = "" # Check for consumed item and check if Pokémon should be duplicated pbEvolutionMethodAfterEvolution diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/005_UI_Trading.rb b/Data/Scripts/016_UI/001_Non-interactive UI/005_UI_Trading.rb index b2da85fdd..13a08d0a7 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/005_UI_Trading.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/005_UI_Trading.rb @@ -37,7 +37,7 @@ class PokemonTrade_Scene @trader1 = trader1 @trader2 = trader2 addBackgroundOrColoredPlane(@sprites, "background", "tradebg", - Color.new(248, 248, 248), @viewport) + Color.new(248, 248, 248), @viewport) @sprites["rsprite1"] = PokemonSprite.new(@viewport) @sprites["rsprite1"].setPokemonBitmap(@pokemon, false) @sprites["rsprite1"].setOffset(PictureOrigin::Bottom) @@ -176,21 +176,21 @@ class PokemonTrade_Scene speciesname1 = GameData::Species.get(@pokemon.species).name speciesname2 = GameData::Species.get(@pokemon2.species).name pbMessageDisplay(@sprites["msgwindow"], - _ISPRINTF("{1:s}\r\nID: {2:05d} OT: {3:s}\\wtnp[0]", - @pokemon.name, @pokemon.owner.public_id, @pokemon.owner.name)) { pbUpdate } + _ISPRINTF("{1:s}\r\nID: {2:05d} OT: {3:s}\\wtnp[0]", + @pokemon.name, @pokemon.owner.public_id, @pokemon.owner.name)) { pbUpdate } pbMessageWaitForInput(@sprites["msgwindow"], 50, true) { pbUpdate } pbPlayDecisionSE pbScene1 pbMessageDisplay(@sprites["msgwindow"], - _INTL("For {1}'s {2},\r\n{3} sends {4}.\1", @trader1, speciesname1, @trader2, speciesname2)) { pbUpdate } + _INTL("For {1}'s {2},\r\n{3} sends {4}.\1", @trader1, speciesname1, @trader2, speciesname2)) { pbUpdate } pbMessageDisplay(@sprites["msgwindow"], - _INTL("{1} bids farewell to {2}.", @trader2, speciesname2)) { pbUpdate } + _INTL("{1} bids farewell to {2}.", @trader2, speciesname2)) { pbUpdate } pbScene2 pbMessageDisplay(@sprites["msgwindow"], - _ISPRINTF("{1:s}\r\nID: {2:05d} OT: {3:s}\1", - @pokemon2.name, @pokemon2.owner.public_id, @pokemon2.owner.name)) { pbUpdate } + _ISPRINTF("{1:s}\r\nID: {2:05d} OT: {3:s}\1", + @pokemon2.name, @pokemon2.owner.public_id, @pokemon2.owner.name)) { pbUpdate } pbMessageDisplay(@sprites["msgwindow"], - _INTL("Take good care of {1}.", speciesname2)) { pbUpdate } + _INTL("Take good care of {1}.", speciesname2)) { pbUpdate } end end diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb b/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb index fc68f5616..d48827e49 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb @@ -283,13 +283,13 @@ class HallOfFame_Scene lefttext += _INTL("IDNo.{1}
", pubid) lefttext += _ISPRINTF("Time{1:02d}:{2:02d}
", hour, min) lefttext += _INTL("Pokédex{1}/{2}
", - $player.pokedex.owned_count, $player.pokedex.seen_count) + $player.pokedex.owned_count, $player.pokedex.seen_count) @sprites["messagebox"] = Window_AdvancedTextPokemon.new(lefttext) @sprites["messagebox"].viewport = @viewport @sprites["messagebox"].width = 192 if @sprites["messagebox"].width < 192 @sprites["msgwindow"] = pbCreateMessageWindow(@viewport) pbMessageDisplay(@sprites["msgwindow"], - _INTL("League champion!\nCongratulations!\\^")) + _INTL("League champion!\nCongratulations!\\^")) end def writePokemonData(pokemon, hallNumber = -1) diff --git a/Data/Scripts/016_UI/001_UI_PauseMenu.rb b/Data/Scripts/016_UI/001_UI_PauseMenu.rb index 181c0d3ea..db8b5c616 100644 --- a/Data/Scripts/016_UI/001_UI_PauseMenu.rb +++ b/Data/Scripts/016_UI/001_UI_PauseMenu.rb @@ -130,15 +130,15 @@ class PokemonPauseMenu @scene.pbShowInfo(_INTL("Balls: {1}", pbSafariState.ballcount)) else @scene.pbShowInfo(_INTL("Steps: {1}/{2}\nBalls: {3}", - pbSafariState.steps, Settings::SAFARI_STEPS, pbSafariState.ballcount)) + pbSafariState.steps, Settings::SAFARI_STEPS, pbSafariState.ballcount)) end commands[cmdQuit = commands.length] = _INTL("Quit") elsif pbInBugContest? if pbBugContestState.lastPokemon @scene.pbShowInfo(_INTL("Caught: {1}\nLevel: {2}\nBalls: {3}", - pbBugContestState.lastPokemon.speciesName, - pbBugContestState.lastPokemon.level, - pbBugContestState.ballcount)) + pbBugContestState.lastPokemon.speciesName, + pbBugContestState.lastPokemon.level, + pbBugContestState.ballcount)) else @scene.pbShowInfo(_INTL("Caught: None\nBalls: {1}", pbBugContestState.ballcount)) end diff --git a/Data/Scripts/016_UI/002_UI_Pokedex_Menu.rb b/Data/Scripts/016_UI/002_UI_Pokedex_Menu.rb index c725ced43..735a6db33 100644 --- a/Data/Scripts/016_UI/002_UI_Pokedex_Menu.rb +++ b/Data/Scripts/016_UI/002_UI_Pokedex_Menu.rb @@ -18,9 +18,9 @@ class Window_DexesList < Window_CommandPokemon super(index, count, rect) if index >= 0 && index < @commands2.length pbDrawShadowText(self.contents, rect.x + 254, rect.y, 64, rect.height, - sprintf("%d", @commands2[index][0]), self.baseColor, self.shadowColor, 1) + sprintf("%d", @commands2[index][0]), self.baseColor, self.shadowColor, 1) pbDrawShadowText(self.contents, rect.x + 350, rect.y, 64, rect.height, - sprintf("%d", @commands2[index][1]), self.baseColor, self.shadowColor, 1) + sprintf("%d", @commands2[index][1]), self.baseColor, self.shadowColor, 1) allseen = (@commands2[index][0] >= @commands2[index][2]) allown = (@commands2[index][1] >= @commands2[index][2]) pbDrawImagePositions(self.contents, [ @@ -47,7 +47,8 @@ class PokemonPokedexMenu_Scene @sprites["background"] = IconSprite.new(0, 0, @viewport) @sprites["background"].setBitmap(_INTL("Graphics/Pictures/Pokedex/bg_menu")) @sprites["headings"] = Window_AdvancedTextPokemon.newWithSize( - _INTL("SEENOBTAINED"), 286, 136, 208, 64, @viewport) + _INTL("SEENOBTAINED"), 286, 136, 208, 64, @viewport + ) @sprites["headings"].windowskin = nil @sprites["commands"] = Window_DexesList.new(commands, commands2, Graphics.width - 84) @sprites["commands"].x = 40 diff --git a/Data/Scripts/016_UI/003_UI_Pokedex_Main.rb b/Data/Scripts/016_UI/003_UI_Pokedex_Main.rb index 7810ff915..1826a6da2 100644 --- a/Data/Scripts/016_UI/003_UI_Pokedex_Main.rb +++ b/Data/Scripts/016_UI/003_UI_Pokedex_Main.rb @@ -49,7 +49,7 @@ class Window_Pokedex < Window_DrawableCommand text = sprintf("%03d ----------", indexNumber) end pbDrawShadowText(self.contents, rect.x + 36, rect.y + 6, rect.width, rect.height, - text, self.baseColor, self.shadowColor) + text, self.baseColor, self.shadowColor) end def refresh diff --git a/Data/Scripts/016_UI/005_UI_Party.rb b/Data/Scripts/016_UI/005_UI_Party.rb index d4de7d4cf..3d22fa60a 100644 --- a/Data/Scripts/016_UI/005_UI_Party.rb +++ b/Data/Scripts/016_UI/005_UI_Party.rb @@ -127,7 +127,7 @@ class Window_CommandPokemonColor < Window_CommandPokemon shadow = Color.new(128, 192, 240) end pbDrawShadowText(self.contents, rect.x, rect.y, rect.width, rect.height, - @commands[index], base, shadow) + @commands[index], base, shadow) end end @@ -406,16 +406,14 @@ class PokemonPartyPanel < SpriteWrapper # Draw shiny icon if @pokemon.shiny? pbDrawImagePositions(@overlaysprite.bitmap, - [["Graphics/Pictures/shiny", 80, 48, 0, 0, 16, 16]] - ) + [["Graphics/Pictures/shiny", 80, 48, 0, 0, 16, 16]]) end end pbDrawTextPositions(@overlaysprite.bitmap, textpos) # Draw level text if !@pokemon.egg? pbDrawImagePositions(@overlaysprite.bitmap, - [["Graphics/Pictures/Party/overlay_lv", 20, 70, 0, 0, 22, 14]] - ) + [["Graphics/Pictures/Party/overlay_lv", 20, 70, 0, 0, 22, 14]]) pbSetSmallFont(@overlaysprite.bitmap) pbDrawTextPositions(@overlaysprite.bitmap, [ [@pokemon.level.to_s, 42, 57, 0, basecolor, shadowcolor] @@ -461,7 +459,8 @@ class PokemonParty_Scene @sprites["messagebox"].letterbyletter = true pbBottomLeftLines(@sprites["messagebox"], 2) @sprites["storagetext"] = Window_UnformattedTextPokemon.new( - @can_access_storage ? _INTL("[Special]: To Boxes") : "") + @can_access_storage ? _INTL("[Special]: To Boxes") : "" + ) @sprites["storagetext"].x = 32 @sprites["storagetext"].y = Graphics.height - @sprites["messagebox"].height - 16 @sprites["storagetext"].z = 10 @@ -1103,11 +1102,15 @@ class PokemonPartyScreen annot.push((elig) ? _INTL("ABLE") : _INTL("NOT ABLE")) end ret = -1 - @scene.pbStartScene(@party, - (@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."), annot) + @scene.pbStartScene( + @party, + (@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."), + annot + ) loop do @scene.pbSetHelpText( - (@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel.")) + (@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel.") + ) pkmnid = @scene.pbChoosePokemon break if pkmnid < 0 if !eligibility[pkmnid] && !allowIneligible @@ -1131,11 +1134,15 @@ class PokemonPartyScreen annot.push((elig) ? _INTL("ABLE") : _INTL("NOT ABLE")) end ret = -1 - @scene.pbStartScene(@party, - (@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."), annot) + @scene.pbStartScene( + @party, + (@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."), + annot + ) loop do @scene.pbSetHelpText( - (@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel.")) + (@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel.") + ) pkmnid = @scene.pbChoosePokemon break if pkmnid < 0 if !eligibility[pkmnid] && !allowIneligible @@ -1158,8 +1165,8 @@ class PokemonPartyScreen end end @scene.pbStartScene(@party, - (@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."), - nil, false, can_access_storage) + (@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."), + nil, false, can_access_storage) loop do @scene.pbSetHelpText((@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel.")) pkmnid = @scene.pbChoosePokemon(false, -1, 1) @@ -1250,7 +1257,7 @@ class PokemonPartyScreen return [pkmn, pkmn.moves[i].id] end @scene.pbStartScene(@party, - (@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel.")) + (@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel.")) break end return [pkmn, pkmn.moves[i].id] @@ -1273,7 +1280,7 @@ class PokemonPartyScreen end elsif cmdMail >= 0 && command == cmdMail command = @scene.pbShowCommands(_INTL("Do what with the mail?"), - [_INTL("Read"), _INTL("Take"), _INTL("Cancel")]) + [_INTL("Read"), _INTL("Take"), _INTL("Cancel")]) case command when 0 # Read pbFadeOutIn { diff --git a/Data/Scripts/016_UI/006_UI_Summary.rb b/Data/Scripts/016_UI/006_UI_Summary.rb index 5fc00b9b4..733905cb9 100644 --- a/Data/Scripts/016_UI/006_UI_Summary.rb +++ b/Data/Scripts/016_UI/006_UI_Summary.rb @@ -1084,7 +1084,7 @@ class PokemonSummary_Scene markrect.x = i * MARK_WIDTH markrect.y = [(markings[i] || 0), mark_variants - 1].min * MARK_HEIGHT @sprites["markingoverlay"].bitmap.blt(300 + 58 * (i % 3), 154 + 50 * (i / 3), - @markingbitmap.bitmap, markrect) + @markingbitmap.bitmap, markrect) end textpos = [ [_INTL("Mark {1}", pokemon.name), 366, 90, 2, base, shadow], diff --git a/Data/Scripts/016_UI/007_UI_Bag.rb b/Data/Scripts/016_UI/007_UI_Bag.rb index 7aa6f5370..63c05ebdc 100644 --- a/Data/Scripts/016_UI/007_UI_Bag.rb +++ b/Data/Scripts/016_UI/007_UI_Bag.rb @@ -197,8 +197,9 @@ class PokemonBag_Scene @sprites["itemlist"].baseColor = ITEMLISTBASECOLOR @sprites["itemlist"].shadowColor = ITEMLISTSHADOWCOLOR @sprites["itemicon"] = ItemIconSprite.new(48, Graphics.height - 48, nil, @viewport) - @sprites["itemtext"] = Window_UnformattedTextPokemon.newWithSize("", - 72, 270, Graphics.width - 72 - 24, 128, @viewport) + @sprites["itemtext"] = Window_UnformattedTextPokemon.newWithSize( + "", 72, 270, Graphics.width - 72 - 24, 128, @viewport + ) @sprites["itemtext"].baseColor = ITEMTEXTBASECOLOR @sprites["itemtext"].shadowColor = ITEMTEXTSHADOWCOLOR @sprites["itemtext"].visible = true @@ -268,13 +269,16 @@ class PokemonBag_Scene if @choosing && @filterlist for i in 1...@bag.pockets.length if @filterlist[i].length == 0 - @sprites["pocketicon"].bitmap.blt(6 + (i - 1) * 22, 6, - @pocketbitmap.bitmap, Rect.new((i - 1) * 20, 28, 20, 20)) + @sprites["pocketicon"].bitmap.blt( + 6 + (i - 1) * 22, 6, @pocketbitmap.bitmap, Rect.new((i - 1) * 20, 28, 20, 20) + ) end end end - @sprites["pocketicon"].bitmap.blt(2 + (@sprites["itemlist"].pocket - 1) * 22, 2, - @pocketbitmap.bitmap, Rect.new((@sprites["itemlist"].pocket - 1) * 28, 0, 28, 28)) + @sprites["pocketicon"].bitmap.blt( + 2 + (@sprites["itemlist"].pocket - 1) * 22, 2, @pocketbitmap.bitmap, + Rect.new((@sprites["itemlist"].pocket - 1) * 28, 0, 28, 28) + ) # Refresh the item window @sprites["itemlist"].refresh # Refresh more things @@ -552,7 +556,8 @@ class PokemonBagScreen params.setRange(0, Settings::BAG_MAX_PER_SLOT) params.setDefaultValue(qty) newqty = pbMessageChooseNumber( - _INTL("Choose new quantity of {1} (max. #{Settings::BAG_MAX_PER_SLOT}).", itemplural), params) { @scene.pbUpdate } + _INTL("Choose new quantity of {1} (max. #{Settings::BAG_MAX_PER_SLOT}).", itemplural), params + ) { @scene.pbUpdate } if newqty > qty @bag.add(item, newqty - qty) elsif newqty < qty diff --git a/Data/Scripts/016_UI/009_UI_RegionMap.rb b/Data/Scripts/016_UI/009_UI_RegionMap.rb index 50a6217e7..235822468 100644 --- a/Data/Scripts/016_UI/009_UI_RegionMap.rb +++ b/Data/Scripts/016_UI/009_UI_RegionMap.rb @@ -185,7 +185,7 @@ class PokemonRegionMap_Scene f.write("\#-------------------------------\r\n") f.write(sprintf("[%d]\r\n", i)) f.write(sprintf("Name = %s\r\nFilename = %s\r\n", - Compiler.csvQuote(map[0]), Compiler.csvQuote(map[1]))) + Compiler.csvQuote(map[0]), Compiler.csvQuote(map[1]))) for loc in map[2] f.write("Point = ") Compiler.pbWriteCsvRecord(loc, f, [nil, "uussUUUU"]) diff --git a/Data/Scripts/016_UI/010_UI_Phone.rb b/Data/Scripts/016_UI/010_UI_Phone.rb index d55b247ce..de4611980 100644 --- a/Data/Scripts/016_UI/010_UI_Phone.rb +++ b/Data/Scripts/016_UI/010_UI_Phone.rb @@ -43,13 +43,15 @@ class PokemonPhoneScene @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport.z = 99999 @sprites["list"] = Window_PhoneList.newEmpty(152, 32, Graphics.width - 142, Graphics.height - 80, @viewport) - @sprites["header"] = Window_UnformattedTextPokemon.newWithSize(_INTL("Phone"), - 2, -18, 128, 64, @viewport) + @sprites["header"] = Window_UnformattedTextPokemon.newWithSize( + _INTL("Phone"), 2, -18, 128, 64, @viewport + ) @sprites["header"].baseColor = Color.new(248, 248, 248) @sprites["header"].shadowColor = Color.new(0, 0, 0) mapname = (@trainers[0][2]) ? pbGetMapNameFromId(@trainers[0][2]) : "" - @sprites["bottom"] = Window_AdvancedTextPokemon.newWithSize("", - 162, Graphics.height - 64, Graphics.width - 158, 64, @viewport) + @sprites["bottom"] = Window_AdvancedTextPokemon.newWithSize( + "", 162, Graphics.height - 64, Graphics.width - 158, 64, @viewport + ) @sprites["bottom"].text = "" + mapname @sprites["info"] = Window_AdvancedTextPokemon.newWithSize("", -8, 224, 180, 160, @viewport) addBackgroundPlane(@sprites, "bg", "phonebg", @viewport) @@ -68,8 +70,7 @@ class PokemonPhoneScene for trainer in @trainers if trainer.length == 4 displayname = _INTL("{1} {2}", GameData::TrainerType.get(trainer[0]).name, - pbGetMessageFromHash(MessageTypes::TrainerNames, trainer[1]) - ) + pbGetMessageFromHash(MessageTypes::TrainerNames, trainer[1])) commands.push(displayname) # trainer's display name else commands.push(trainer[1]) # NPC's display name diff --git a/Data/Scripts/016_UI/011_UI_Jukebox.rb b/Data/Scripts/016_UI/011_UI_Jukebox.rb index 601efa58e..9ad789ad9 100644 --- a/Data/Scripts/016_UI/011_UI_Jukebox.rb +++ b/Data/Scripts/016_UI/011_UI_Jukebox.rb @@ -14,12 +14,14 @@ class PokemonJukebox_Scene @sprites["background"] = IconSprite.new(0, 0, @viewport) @sprites["background"].setBitmap("Graphics/Pictures/jukeboxbg") @sprites["header"] = Window_UnformattedTextPokemon.newWithSize( - _INTL("Jukebox"), 2, -18, 128, 64, @viewport) + _INTL("Jukebox"), 2, -18, 128, 64, @viewport + ) @sprites["header"].baseColor = Color.new(248, 248, 248) @sprites["header"].shadowColor = Color.new(0, 0, 0) @sprites["header"].windowskin = nil - @sprites["commands"] = Window_CommandPokemon.newWithSize(@commands, - 94, 92, 324, 224, @viewport) + @sprites["commands"] = Window_CommandPokemon.newWithSize( + @commands, 94, 92, 324, 224, @viewport + ) @sprites["commands"].windowskin = nil pbFadeInAndShow(@sprites) { pbUpdate } end diff --git a/Data/Scripts/016_UI/012_UI_TrainerCard.rb b/Data/Scripts/016_UI/012_UI_TrainerCard.rb index 85c0dc8f5..e63a758f6 100644 --- a/Data/Scripts/016_UI/012_UI_TrainerCard.rb +++ b/Data/Scripts/016_UI/012_UI_TrainerCard.rb @@ -45,9 +45,9 @@ class PokemonTrainerCard_Scene time = (hour > 0) ? _INTL("{1}h {2}m", hour, min) : _INTL("{1}m", min) $PokemonGlobal.startTime = pbGetTimeNow if !$PokemonGlobal.startTime starttime = _INTL("{1} {2}, {3}", - pbGetAbbrevMonthName($PokemonGlobal.startTime.mon), - $PokemonGlobal.startTime.day, - $PokemonGlobal.startTime.year) + pbGetAbbrevMonthName($PokemonGlobal.startTime.mon), + $PokemonGlobal.startTime.day, + $PokemonGlobal.startTime.year) textPositions = [ [_INTL("Name"), 34, 58, 0, baseColor, shadowColor], [$player.name, 302, 58, 1, baseColor, shadowColor], diff --git a/Data/Scripts/016_UI/013_UI_Load.rb b/Data/Scripts/016_UI/013_UI_Load.rb index 4993c5269..7dbf71fdd 100644 --- a/Data/Scripts/016_UI/013_UI_Load.rb +++ b/Data/Scripts/016_UI/013_UI_Load.rb @@ -106,8 +106,10 @@ class PokemonLoad_Scene addBackgroundOrColoredPlane(@sprites, "background", "loadbg", Color.new(248, 248, 248), @viewport) y = 16 * 2 for i in 0...commands.length - @sprites["panel#{i}"] = PokemonLoadPanel.new(i, commands[i], - (show_continue) ? (i == 0) : false, trainer, frame_count, stats, map_id, @viewport) + @sprites["panel#{i}"] = PokemonLoadPanel.new( + i, commands[i], (show_continue) ? (i == 0) : false, trainer, + frame_count, stats, map_id, @viewport + ) @sprites["panel#{i}"].x = 24 * 2 @sprites["panel#{i}"].y = y @sprites["panel#{i}"].pbRefresh diff --git a/Data/Scripts/016_UI/014_UI_Save.rb b/Data/Scripts/016_UI/014_UI_Save.rb index b9479ef1c..274f7a1fe 100644 --- a/Data/Scripts/016_UI/014_UI_Save.rb +++ b/Data/Scripts/016_UI/014_UI_Save.rb @@ -87,8 +87,7 @@ class PokemonSaveScreen pbMessage(_INTL('WARNING!')) pbMessage(_INTL('There is a different game file that is already saved.')) pbMessage(_INTL("If you save now, the other file's adventure, including items and Pokémon, will be entirely lost.")) - if !pbConfirmMessageSerious( - _INTL('Are you sure you want to save now and overwrite the other save file?')) + if !pbConfirmMessageSerious(_INTL('Are you sure you want to save now and overwrite the other save file?')) pbSEPlay('GUI save choice') @scene.pbEndScreen return false diff --git a/Data/Scripts/016_UI/015_UI_Options.rb b/Data/Scripts/016_UI/015_UI_Options.rb index 447379a47..359cd3e7a 100644 --- a/Data/Scripts/016_UI/015_UI_Options.rb +++ b/Data/Scripts/016_UI/015_UI_Options.rb @@ -205,7 +205,7 @@ class Window_PokemonOption < Window_DrawableCommand optionname = (index == @options.length) ? _INTL("Cancel") : @options[index].name optionwidth = rect.width * 9 / 20 pbDrawShadowText(self.contents, rect.x, rect.y, optionwidth, rect.height, optionname, - @nameBaseColor, @nameShadowColor) + @nameBaseColor, @nameShadowColor) return if index == @options.length if @options[index].is_a?(EnumOption) if @options[index].values.length > 1 @@ -219,42 +219,42 @@ class Window_PokemonOption < Window_DrawableCommand ivalue = 0 for value in @options[index].values pbDrawShadowText(self.contents, xpos, rect.y, optionwidth, rect.height, value, - (ivalue == self[index]) ? @selBaseColor : self.baseColor, - (ivalue == self[index]) ? @selShadowColor : self.shadowColor - ) + (ivalue == self[index]) ? @selBaseColor : self.baseColor, + (ivalue == self[index]) ? @selShadowColor : self.shadowColor) xpos += self.contents.text_size(value).width xpos += spacing ivalue += 1 end else pbDrawShadowText(self.contents, rect.x + optionwidth, rect.y, optionwidth, rect.height, - optionname, self.baseColor, self.shadowColor) + optionname, self.baseColor, self.shadowColor) end elsif @options[index].is_a?(NumberOption) value = _INTL("Type {1}/{2}", @options[index].optstart + self[index], - @options[index].optend - @options[index].optstart + 1) + @options[index].optend - @options[index].optstart + 1) xpos = optionwidth + rect.x pbDrawShadowText(self.contents, xpos, rect.y, optionwidth, rect.height, value, - @selBaseColor, @selShadowColor) + @selBaseColor, @selShadowColor) elsif @options[index].is_a?(SliderOption) value = sprintf(" %d", @options[index].optend) sliderlength = optionwidth - self.contents.text_size(value).width xpos = optionwidth + rect.x self.contents.fill_rect(xpos, rect.y - 2 + rect.height / 2, - optionwidth - self.contents.text_size(value).width, 4, self.baseColor) + optionwidth - self.contents.text_size(value).width, 4, self.baseColor) self.contents.fill_rect( - xpos + (sliderlength - 8) * (@options[index].optstart + self[index]) / @options[index].optend, - rect.y - 8 + rect.height / 2, - 8, 16, @selBaseColor) + xpos + (sliderlength - 8) * (@options[index].optstart + self[index]) / @options[index].optend, + rect.y - 8 + rect.height / 2, + 8, 16, @selBaseColor + ) value = sprintf("%d", @options[index].optstart + self[index]) xpos += optionwidth - self.contents.text_size(value).width pbDrawShadowText(self.contents, xpos, rect.y, optionwidth, rect.height, value, - @selBaseColor, @selShadowColor) + @selBaseColor, @selShadowColor) else value = @options[index].values[self[index]] xpos = optionwidth + rect.x pbDrawShadowText(self.contents, xpos, rect.y, optionwidth, rect.height, value, - @selBaseColor, @selShadowColor) + @selBaseColor, @selShadowColor) end end @@ -291,7 +291,8 @@ class PokemonOption_Scene @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport.z = 99999 @sprites["title"] = Window_UnformattedTextPokemon.newWithSize( - _INTL("Options"), 0, 0, Graphics.width, 64, @viewport) + _INTL("Options"), 0, 0, Graphics.width, 64, @viewport + ) @sprites["textbox"] = pbCreateMessageWindow @sprites["textbox"].text = _INTL("Speech frame {1}.", 1 + $PokemonSystem.textskin) @sprites["textbox"].letterbyletter = false @@ -376,9 +377,10 @@ class PokemonOption_Scene ) ] @PokemonOptions = pbAddOnOptions(@PokemonOptions) - @sprites["option"] = Window_PokemonOption.new(@PokemonOptions, 0, - @sprites["title"].height, Graphics.width, - Graphics.height - @sprites["title"].height - @sprites["textbox"].height) + @sprites["option"] = Window_PokemonOption.new( + @PokemonOptions, 0, @sprites["title"].height, Graphics.width, + Graphics.height - @sprites["title"].height - @sprites["textbox"].height + ) @sprites["option"].viewport = @viewport @sprites["option"].visible = true # Get the values of each option diff --git a/Data/Scripts/016_UI/017_UI_PokemonStorage.rb b/Data/Scripts/016_UI/017_UI_PokemonStorage.rb index 690bf3076..2350e26bd 100644 --- a/Data/Scripts/016_UI/017_UI_PokemonStorage.rb +++ b/Data/Scripts/016_UI/017_UI_PokemonStorage.rb @@ -95,9 +95,9 @@ class MosaicPokemonSprite < PokemonSprite @mosaicbitmap2.clear @mosaicbitmap.stretch_blt(Rect.new(0, 0, newWidth, newHeight), @oldbitmap, @oldbitmap.rect) @mosaicbitmap2.stretch_blt( - Rect.new(-@mosaic / 2 + 1, -@mosaic / 2 + 1, - @mosaicbitmap2.width, @mosaicbitmap2.height), - @mosaicbitmap, Rect.new(0, 0, newWidth, newHeight)) + Rect.new(-@mosaic / 2 + 1, -@mosaic / 2 + 1, @mosaicbitmap2.width, @mosaicbitmap2.height), + @mosaicbitmap, Rect.new(0, 0, newWidth, newHeight) + ) self.bitmap = @mosaicbitmap2 end @inrefresh = false @@ -410,7 +410,7 @@ class PokemonBoxSprite < SpriteWrapper widthval = @contents.text_size(boxname).width xval = 162 - (widthval / 2) pbDrawShadowText(@contents, xval, 8, widthval, 32, - boxname, Color.new(248, 248, 248), Color.new(40, 48, 48)) + boxname, Color.new(248, 248, 248), Color.new(40, 48, 48)) @refreshBox = false end yval = self.y + 30 @@ -1326,7 +1326,7 @@ class PokemonStorageScene markrect.x = i * MARK_WIDTH markrect.y = [(markings[i] || 0), mark_variants - 1].min * MARK_HEIGHT @sprites["markingoverlay"].bitmap.blt(336 + 58 * (i % 3), 106 + 50 * (i / 3), - @markingbitmap.bitmap, markrect) + @markingbitmap.bitmap, markrect) end textpos = [ [_INTL("OK"), 402, 208, 2, base, shadow, 1], @@ -1923,13 +1923,12 @@ class PokemonStorageScreen def pbBoxCommands commands = [ - _INTL("Jump"), - _INTL("Wallpaper"), - _INTL("Name"), - _INTL("Cancel") + _INTL("Jump"), + _INTL("Wallpaper"), + _INTL("Name"), + _INTL("Cancel") ] - command = pbShowCommands( - _INTL("What do you want to do?"), commands) + command = pbShowCommands(_INTL("What do you want to do?"), commands) case command when 0 destbox = @scene.pbChooseBox(_INTL("Jump to which Box?")) diff --git a/Data/Scripts/016_UI/019_UI_PC.rb b/Data/Scripts/016_UI/019_UI_PC.rb index a2cf0e780..8e77f9334 100644 --- a/Data/Scripts/016_UI/019_UI_PC.rb +++ b/Data/Scripts/016_UI/019_UI_PC.rb @@ -44,8 +44,7 @@ class StorageSystemPC [_INTL("Organize the Pokémon in Boxes and in your party."), _INTL("Move Pokémon stored in Boxes to your party."), _INTL("Store Pokémon in your party in Boxes."), - _INTL("Return to the previous menu.")], -1, command - ) + _INTL("Return to the previous menu.")], -1, command) if command >= 0 && command < 3 case command when 1 # Withdraw @@ -123,8 +122,7 @@ def pbPCItemStorage [_INTL("Take out items from the PC."), _INTL("Store items in the PC."), _INTL("Throw away items stored in the PC."), - _INTL("Go back to the previous menu.")], -1, command - ) + _INTL("Go back to the previous menu.")], -1, command) case command when 0 # Withdraw Item if !$PokemonGlobal.pcItemStorage @@ -179,7 +177,7 @@ def pbPCMailbox if command >= 0 && command < $PokemonGlobal.mailbox.length mailIndex = command commandMail = pbMessage(_INTL("What do you want to do with {1}'s Mail?", - $PokemonGlobal.mailbox[mailIndex].sender), [ + $PokemonGlobal.mailbox[mailIndex].sender), [ _INTL("Read"), _INTL("Move to Bag"), _INTL("Give"), @@ -241,7 +239,7 @@ def pbPokeCenterPC loop do commands = PokemonPCList.getCommandList command = pbMessage(_INTL("Which PC should be accessed?"), commands, - commands.length, nil, command) + commands.length, nil, command) break if !PokemonPCList.callCommand(command) end pbSEPlay("PC close") diff --git a/Data/Scripts/016_UI/020_UI_PokeMart.rb b/Data/Scripts/016_UI/020_UI_PokeMart.rb index 204469a77..7c81404a7 100644 --- a/Data/Scripts/016_UI/020_UI_PokeMart.rb +++ b/Data/Scripts/016_UI/020_UI_PokeMart.rb @@ -203,13 +203,15 @@ class PokemonMart_Scene @sprites["background"].setBitmap("Graphics/Pictures/martScreen") @sprites["icon"] = ItemIconSprite.new(36, Graphics.height - 50, nil, @viewport) winAdapter = buying ? BuyAdapter.new(adapter) : SellAdapter.new(adapter) - @sprites["itemwindow"] = Window_PokemonMart.new(stock, winAdapter, - Graphics.width - 316 - 16, 12, 330 + 16, Graphics.height - 126) + @sprites["itemwindow"] = Window_PokemonMart.new( + stock, winAdapter, Graphics.width - 316 - 16, 12, 330 + 16, Graphics.height - 126 + ) @sprites["itemwindow"].viewport = @viewport @sprites["itemwindow"].index = 0 @sprites["itemwindow"].refresh - @sprites["itemtextwindow"] = Window_UnformattedTextPokemon.newWithSize("", - 64, Graphics.height - 96 - 16, Graphics.width - 64, 128, @viewport) + @sprites["itemtextwindow"] = Window_UnformattedTextPokemon.newWithSize( + "", 64, Graphics.height - 96 - 16, Graphics.width - 64, 128, @viewport + ) pbPrepareWindow(@sprites["itemtextwindow"]) @sprites["itemtextwindow"].baseColor = Color.new(248, 248, 248) @sprites["itemtextwindow"].shadowColor = Color.new(0, 0, 0) @@ -554,7 +556,7 @@ class PokemonMartScreen end if GameData::Item.get(item).is_important? if !pbConfirm(_INTL("Certainly. You want {1}. That will be ${2}. OK?", - itemname, price.to_s_formatted)) + itemname, price.to_s_formatted)) next end quantity = 1 @@ -562,11 +564,12 @@ class PokemonMartScreen maxafford = (price <= 0) ? Settings::BAG_MAX_PER_SLOT : @adapter.getMoney / price maxafford = Settings::BAG_MAX_PER_SLOT if maxafford > Settings::BAG_MAX_PER_SLOT quantity = @scene.pbChooseNumber( - _INTL("{1}? Certainly. How many would you like?", itemname), item, maxafford) + _INTL("{1}? Certainly. How many would you like?", itemname), item, maxafford + ) next if quantity == 0 price *= quantity if !pbConfirm(_INTL("{1}, and you want {2}. That will be ${3}. OK?", - itemname, quantity, price.to_s_formatted)) + itemname, quantity, price.to_s_formatted)) next end end @@ -633,7 +636,8 @@ class PokemonMartScreen @scene.pbShowMoney if qty > 1 qty = @scene.pbChooseNumber( - _INTL("{1}? How many would you like to sell?", itemname), item, qty) + _INTL("{1}? How many would you like to sell?", itemname), item, qty + ) end if qty == 0 @scene.pbHideMoney @@ -669,9 +673,8 @@ def pbPokemonMart(stock, speech = nil, cantsell = false) commands[cmdBuy = commands.length] = _INTL("Buy") commands[cmdSell = commands.length] = _INTL("Sell") if !cantsell commands[cmdQuit = commands.length] = _INTL("Quit") - cmd = pbMessage( - speech ? speech : _INTL("Welcome! How may I serve you?"), - commands, cmdQuit + 1) + cmd = pbMessage(speech ? speech : _INTL("Welcome! How may I serve you?"), + commands, cmdQuit + 1) loop do if cmdBuy >= 0 && cmd == cmdBuy scene = PokemonMart_Scene.new @@ -686,7 +689,7 @@ def pbPokemonMart(stock, speech = nil, cantsell = false) break end cmd = pbMessage(_INTL("Is there anything else I can help you with?"), - commands, cmdQuit + 1) + commands, cmdQuit + 1) end $game_temp.clear_mart_prices end diff --git a/Data/Scripts/016_UI/021_UI_MoveRelearner.rb b/Data/Scripts/016_UI/021_UI_MoveRelearner.rb index f76876527..6139b203e 100644 --- a/Data/Scripts/016_UI/021_UI_MoveRelearner.rb +++ b/Data/Scripts/016_UI/021_UI_MoveRelearner.rb @@ -105,7 +105,7 @@ class MoveRelearner_Scene end pbDrawImagePositions(overlay, imagepos) drawTextEx(overlay, 272, 214, 230, 5, selMoveData.description, - Color.new(64, 64, 64), Color.new(176, 176, 176)) + Color.new(64, 64, 64), Color.new(176, 176, 176)) end # Processes the scene diff --git a/Data/Scripts/016_UI/022_UI_PurifyChamber.rb b/Data/Scripts/016_UI/022_UI_PurifyChamber.rb index 50bba40b1..e212c73ad 100644 --- a/Data/Scripts/016_UI/022_UI_PurifyChamber.rb +++ b/Data/Scripts/016_UI/022_UI_PurifyChamber.rb @@ -411,7 +411,8 @@ class PurifyChamberScreen if @chamber.setCount(set) == 0 && @chamber.isPurifiableIgnoreRegular?(set) pkmn = @chamber.getShadow(set) @scene.pbDisplay( - _INTL("This {1} is ready to open its heart. However, there must be at least one regular Pokémon in the set to perform a purification ceremony.", pkmn.name)) + _INTL("This {1} is ready to open its heart. However, there must be at least one regular Pokémon in the set to perform a purification ceremony.", pkmn.name) + ) end end @@ -447,7 +448,8 @@ class PurifyChamberScreen commands.push(_INTL("CANCEL")) choice = @scene.pbShowCommands( _INTL("What shall I do with this {1}?", - heldpkmn ? heldpkmn.name : curpkmn.name), commands) + heldpkmn ? heldpkmn.name : curpkmn.name), commands + ) if choice == 0 if heldpkmn if pbPlace(heldpkmn, cmd[1]) # calls place or shift as appropriate @@ -664,7 +666,7 @@ class Window_PurifyChamberSets < Window_DrawableCommand end if @chamber.setCount(index) > 0 pbDrawGauge(self.contents, Rect.new(rect.x + 16, rect.y + 6, 48, 8), - Color.new(0, 0, 256), @chamber[index].tempo, PurifyChamber.maximumTempo) + Color.new(0, 0, 256), @chamber[index].tempo, PurifyChamber.maximumTempo) end if @chamber.getShadow(index) pbDrawGauge(self.contents, Rect.new(rect.x + 16, rect.y + 18, 48, 8), @@ -949,12 +951,12 @@ class PurifyChamberSetView < SpriteWrapper if pkmn if pkmn.types.length == 1 textpos.push([_INTL("{1} Lv.{2} {3}", pkmn.name, pkmn.level, - GameData::Type.get(pkmn.types[0]).name), + GameData::Type.get(pkmn.types[0]).name), 2, -6, 0, Color.new(248, 248, 248), Color.new(128, 128, 128)]) else textpos.push([_INTL("{1} Lv.{2} {3}/{4}", pkmn.name, pkmn.level, - GameData::Type.get(pkmn.types[0]).name, - GameData::Type.get(pkmn.types[1]).name), + GameData::Type.get(pkmn.types[0]).name, + GameData::Type.get(pkmn.types[1]).name), 2, -6, 0, Color.new(248, 248, 248), Color.new(128, 128, 128)]) end textpos.push([_INTL("FLOW"), 2 + @info.bitmap.width / 2, 18, 0, @@ -964,15 +966,15 @@ class PurifyChamberSetView < SpriteWrapper Color.new(192, 0, 256), pkmn.heart_gauge, pkmn.max_gauge_size) # draw flow gauge pbDrawGauge(@info.bitmap, Rect.new(@info.bitmap.width * 3 / 4, 24 + 8, @info.bitmap.width * 1 / 4, 8), - Color.new(0, 0, 248), @chamber.chamberFlow(@set), 6) + Color.new(0, 0, 248), @chamber.chamberFlow(@set), 6) end if @chamber.setCount(@set) > 0 textpos.push([_INTL("TEMPO"), 2, 18, 0, Color.new(248, 248, 248), Color.new(128, 128, 128)]) # draw tempo gauge pbDrawGauge(@info.bitmap, Rect.new(@info.bitmap.width * 1 / 4, 24 + 8, @info.bitmap.width * 1 / 4, 8), - Color.new(0, 0, 248), @chamber[@set].tempo, - PurifyChamber.maximumTempo) + Color.new(0, 0, 248), @chamber[@set].tempo, + PurifyChamber.maximumTempo) end pbDrawTextPositions(@info.bitmap, textpos) @info.x = Graphics.width - @info.bitmap.width @@ -1111,9 +1113,10 @@ class PurifyChamberScene @viewportmsg = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewportmsg.z = 99999 addBackgroundOrColoredPlane(@sprites, "bg", "purifychamberbg", - Color.new(0, 0, 0), @viewport) + Color.new(0, 0, 0), @viewport) @sprites["setwindow"] = Window_PurifyChamberSets.new( - @chamber, 0, 0, 112, Graphics.height, @viewport) + @chamber, 0, 0, 112, Graphics.height, @viewport + ) @sprites["setview"] = PurifyChamberSetView.new(@chamber, set, @viewport) @sprites["msgwindow"] = Window_AdvancedTextPokemon.new("") @sprites["msgwindow"].viewport = @viewportmsg diff --git a/Data/Scripts/016_UI/023_UI_MysteryGift.rb b/Data/Scripts/016_UI/023_UI_MysteryGift.rb index 0be008008..27f84d3e0 100644 --- a/Data/Scripts/016_UI/023_UI_MysteryGift.rb +++ b/Data/Scripts/016_UI/023_UI_MysteryGift.rb @@ -23,7 +23,8 @@ def pbEditMysteryGift(type, item, id = 0, giftname = "") commands.push(_INTL("[Custom]")) loop do command = pbMessage( - _INTL("Choose a phrase to be where the gift Pokémon was obtained from."), commands, -1) + _INTL("Choose a phrase to be where the gift Pokémon was obtained from."), commands, -1 + ) if command < 0 return nil if pbConfirmMessage(_INTL("Stop editing this gift?")) elsif command < commands.length - 1 @@ -45,7 +46,7 @@ def pbEditMysteryGift(type, item, id = 0, giftname = "") params.setCancelValue(0) loop do newtype = pbMessageChooseNumber(_INTL("Choose a quantity of {1}.", - GameData::Item.get(item).name), params) + GameData::Item.get(item).name), params) if newtype == 0 return nil if pbConfirmMessage(_INTL("Stop editing this gift?")) else @@ -400,7 +401,7 @@ def pbReceiveMysteryGift(id) pbMessage(_INTL("\\me[Item get]You obtained some \\c[1]{1}\\c[0]!\\wtnp[30]", itemname)) elsif itm.is_machine? # TM or HM pbMessage(_INTL("\\me[Item get]You obtained \\c[1]{1} {2}\\c[0]!\\wtnp[30]", itemname, - GameData::Move.get(itm.move).name)) + GameData::Move.get(itm.move).name)) elsif qty > 1 pbMessage(_INTL("\\me[Item get]You obtained {1} \\c[1]{2}\\c[0]!\\wtnp[30]", qty, itemname)) elsif itemname.starts_with_vowel? diff --git a/Data/Scripts/016_UI/024_UI_TextEntry.rb b/Data/Scripts/016_UI/024_UI_TextEntry.rb index 314f55cb3..7ad4e9264 100644 --- a/Data/Scripts/016_UI/024_UI_TextEntry.rb +++ b/Data/Scripts/016_UI/024_UI_TextEntry.rb @@ -50,16 +50,16 @@ class Window_CharacterEntry < Window_DrawableCommand rect = drawCursor(index, rect) if index == @charset.length # -1 pbDrawShadowText(self.contents, rect.x, rect.y, rect.width, rect.height, "[ ]", - self.baseColor, self.shadowColor) + self.baseColor, self.shadowColor) elsif index == @charset.length + 1 # -2 pbDrawShadowText(self.contents, rect.x, rect.y, rect.width, rect.height, @othercharset, - self.baseColor, self.shadowColor) + self.baseColor, self.shadowColor) elsif index == @charset.length + 2 # -3 pbDrawShadowText(self.contents, rect.x, rect.y, rect.width, rect.height, _INTL("OK"), - self.baseColor, self.shadowColor) + self.baseColor, self.shadowColor) else pbDrawShadowText(self.contents, rect.x, rect.y, rect.width, rect.height, @charset[index], - self.baseColor, self.shadowColor) + self.baseColor, self.shadowColor) end end end @@ -81,8 +81,9 @@ class PokemonEntryScene @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport.z = 99999 if USEKEYBOARD - @sprites["entry"] = Window_TextEntry_Keyboard.new(initialText, - 0, 0, 400 - 112, 96, helptext, true) + @sprites["entry"] = Window_TextEntry_Keyboard.new( + initialText, 0, 0, 400 - 112, 96, helptext, true + ) Input.text_input = true else @sprites["entry"] = Window_TextEntry.new(initialText, 0, 0, 400, 96, helptext, true) diff --git a/Data/Scripts/017_Minigames/001_Minigame_Duel.rb b/Data/Scripts/017_Minigames/001_Minigame_Duel.rb index ee9a64ca6..a62d66bf2 100644 --- a/Data/Scripts/017_Minigames/001_Minigame_Duel.rb +++ b/Data/Scripts/017_Minigames/001_Minigame_Duel.rb @@ -419,7 +419,8 @@ def pbDuel(trainer_id, trainer_name, event, speeches) trainer_id = GameData::TrainerType.get(trainer_id).id duel = PokemonDuel.new opponent = NPCTrainer.new( - pbGetMessageFromHash(MessageTypes::TrainerNames, trainer_name), trainer_id) + pbGetMessageFromHash(MessageTypes::TrainerNames, trainer_name), trainer_id + ) speech_texts = [] for i in 0...12 speech_texts.push(_I(speeches[i])) diff --git a/Data/Scripts/017_Minigames/002_Minigame_TripleTriad.rb b/Data/Scripts/017_Minigames/002_Minigame_TripleTriad.rb index a730ae4e6..a915e55fc 100644 --- a/Data/Scripts/017_Minigames/002_Minigame_TripleTriad.rb +++ b/Data/Scripts/017_Minigames/002_Minigame_TripleTriad.rb @@ -169,8 +169,9 @@ class TriadScene @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport.z = 99999 addBackgroundPlane(@sprites, "background", "triad_bg", @viewport) - @sprites["helpwindow"] = Window_AdvancedTextPokemon.newWithSize("", - 0, Graphics.height - 64, Graphics.width, 64, @viewport) + @sprites["helpwindow"] = Window_AdvancedTextPokemon.newWithSize( + "", 0, Graphics.height - 64, Graphics.width, 64, @viewport + ) for i in 0...@battle.width * @battle.height @sprites["sprite#{i}"] = SpriteWrapper.new(@viewport) @sprites["sprite#{i}"].x = Graphics.width / 2 - 118 + (i % 3) * 78 @@ -637,7 +638,7 @@ class TriadScreen def pbAdd(items, item) return ItemStorageHelper.add(items, $PokemonGlobal.triads.maxSize, - TriadStorage::MAX_PER_SLOT, item, 1) + TriadStorage::MAX_PER_SLOT, item, 1) end def pbSubtract(items, item) @@ -719,7 +720,7 @@ class TriadScreen for i in 0...$PokemonGlobal.triads.length item = $PokemonGlobal.triads[i] ItemStorageHelper.add(@triadCards, $PokemonGlobal.triads.maxSize, - TriadStorage::MAX_PER_SLOT, item[0], item[1]) + TriadStorage::MAX_PER_SLOT, item[0], item[1]) count += item[1] # Add item count to total count end @board = [] @@ -1076,7 +1077,8 @@ def pbBuyTriads cmdwindow = Window_CommandPokemonEx.newWithSize(realcommands, 0, 0, Graphics.width / 2, Graphics.height) cmdwindow.z = 99999 goldwindow = Window_UnformattedTextPokemon.newWithSize( - _INTL("Money:\r\n{1}", pbGetGoldString), 0, 0, 32, 32) + _INTL("Money:\r\n{1}", pbGetGoldString), 0, 0, 32, 32 + ) goldwindow.resizeToFit(goldwindow.text, Graphics.width) goldwindow.x = Graphics.width - goldwindow.width goldwindow.y = 0 @@ -1118,7 +1120,8 @@ def pbBuyTriads params.setInitialValue(1) params.setCancelValue(0) quantity = pbMessageChooseNumber( - _INTL("The {1} card? Certainly. How many would you like?", itemname), params) + _INTL("The {1} card? Certainly. How many would you like?", itemname), params + ) next if quantity <= 0 price *= quantity next if !pbConfirmMessage(_INTL("{1}, and you want {2}. That will be ${3}. OK?", itemname, quantity, price.to_s_formatted)) @@ -1162,7 +1165,8 @@ def pbSellTriads cmdwindow = Window_CommandPokemonEx.newWithSize(commands, 0, 0, Graphics.width / 2, Graphics.height) cmdwindow.z = 99999 goldwindow = Window_UnformattedTextPokemon.newWithSize( - _INTL("Money:\r\n{1}", pbGetGoldString), 0, 0, 32, 32) + _INTL("Money:\r\n{1}", pbGetGoldString), 0, 0, 32, 32 + ) goldwindow.resizeToFit(goldwindow.text, Graphics.width) goldwindow.x = Graphics.width - goldwindow.width goldwindow.y = 0 @@ -1216,7 +1220,8 @@ def pbSellTriads params.setInitialValue(1) params.setCancelValue(0) quantity = pbMessageChooseNumber( - _INTL("The {1} card? How many would you like to sell?", itemname), params) + _INTL("The {1} card? How many would you like to sell?", itemname), params + ) end if quantity > 0 price /= 4 diff --git a/Data/Scripts/017_Minigames/003_Minigame_SlotMachine.rb b/Data/Scripts/017_Minigames/003_Minigame_SlotMachine.rb index 14cee5655..b41d7b26b 100644 --- a/Data/Scripts/017_Minigames/003_Minigame_SlotMachine.rb +++ b/Data/Scripts/017_Minigames/003_Minigame_SlotMachine.rb @@ -254,7 +254,7 @@ class SlotMachineScene y = [170, 122, 218, 82, 82][i - 1] @sprites["row#{i}"] = IconSprite.new(2, y, @viewport) @sprites["row#{i}"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/line%1d%s", - 1 + i / 2, (i >= 4) ? ((i == 4) ? "a" : "b") : "")) + 1 + i / 2, (i >= 4) ? ((i == 4) ? "a" : "b") : "")) @sprites["row#{i}"].visible = false end @sprites["light1"] = IconSprite.new(16, 32, @viewport) diff --git a/Data/Scripts/017_Minigames/004_Minigame_VoltorbFlip.rb b/Data/Scripts/017_Minigames/004_Minigame_VoltorbFlip.rb index 06e1248e8..5aed8f4fd 100644 --- a/Data/Scripts/017_Minigames/004_Minigame_VoltorbFlip.rb +++ b/Data/Scripts/017_Minigames/004_Minigame_VoltorbFlip.rb @@ -85,12 +85,12 @@ class VoltorbFlip pbUpdateColumnNumbers(0, 0, i) end pbDrawShadowText(@sprites["text"].bitmap, 8, 16, 118, 26, - _INTL("Your coins"), Color.new(60, 60, 60), Color.new(150, 190, 170), 1) + _INTL("Your coins"), Color.new(60, 60, 60), Color.new(150, 190, 170), 1) pbDrawShadowText(@sprites["text"].bitmap, 8, 82, 118, 26, - _INTL("Earned coins"), Color.new(60, 60, 60), Color.new(150, 190, 170), 1) + _INTL("Earned coins"), Color.new(60, 60, 60), Color.new(150, 190, 170), 1) # Draw current level pbDrawShadowText(@sprites["level"].bitmap, 8, 150, 118, 28, - _INTL("Level {1}", @level.to_s), Color.new(60, 60, 60), Color.new(150, 190, 170), 1) + _INTL("Level {1}", @level.to_s), Color.new(60, 60, 60), Color.new(150, 190, 170), 1) # Displays total and current coins pbUpdateCoins # Draw curtain effect diff --git a/Data/Scripts/017_Minigames/006_Minigame_Mining.rb b/Data/Scripts/017_Minigames/006_Minigame_Mining.rb index d22fc99ff..ccf81fc81 100644 --- a/Data/Scripts/017_Minigames/006_Minigame_Mining.rb +++ b/Data/Scripts/017_Minigames/006_Minigame_Mining.rb @@ -492,9 +492,9 @@ class MiningGameScene for index in revealed burieditem = @items[index] revealeditems.bitmap.blt(32 * burieditem[1], 64 + 32 * burieditem[2], - @itembitmap.bitmap, - Rect.new(32 * ITEMS[burieditem[0]][2], 32 * ITEMS[burieditem[0]][3], - 32 * ITEMS[burieditem[0]][4], 32 * ITEMS[burieditem[0]][5])) + @itembitmap.bitmap, + Rect.new(32 * ITEMS[burieditem[0]][2], 32 * ITEMS[burieditem[0]][3], + 32 * ITEMS[burieditem[0]][4], 32 * ITEMS[burieditem[0]][5])) if i > halfFlashTime revealeditems.color = Color.new(255, 255, 255, (halfFlashTime * 2 - i) * alphaDiff) else @@ -531,7 +531,7 @@ class MiningGameScene collapseFraction = (Graphics.height.to_f / collapseTime).ceil for i in 1..collapseTime @sprites["collapse"].bitmap.fill_rect(0, collapseFraction * (i - 1), - Graphics.width, collapseFraction * i, Color.new(0, 0, 0)) + Graphics.width, collapseFraction * i, Color.new(0, 0, 0)) Graphics.update end pbMessage(_INTL("The wall collapsed!")) @@ -590,10 +590,10 @@ class MiningGameScene for i in @itemswon if $bag.add(i) pbMessage(_INTL("One {1} was obtained.\\se[Mining item get]\\wtnp[30]", - GameData::Item.get(i).name)) + GameData::Item.get(i).name)) else pbMessage(_INTL("One {1} was found, but you have no room for it.", - GameData::Item.get(i).name)) + GameData::Item.get(i).name)) end end end diff --git a/Data/Scripts/017_Minigames/007_Minigame_TilePuzzles.rb b/Data/Scripts/017_Minigames/007_Minigame_TilePuzzles.rb index 7e83a58fc..cb6a1895b 100644 --- a/Data/Scripts/017_Minigames/007_Minigame_TilePuzzles.rb +++ b/Data/Scripts/017_Minigames/007_Minigame_TilePuzzles.rb @@ -56,11 +56,13 @@ class TilePuzzleCursor < BitmapSprite if @game != 3 expand = (@holding) ? 0 : 4 for i in 0...4 - self.bitmap.blt(x + (i % 2) * (@tilewidth - @cursorbitmap.width / 4) + expand * (((i % 2) * 2) - 1), - y + (i / 2) * (@tileheight - @cursorbitmap.height / 2) + expand * (((i / 2) * 2) - 1), - @cursorbitmap.bitmap, Rect.new( - (i % 2) * @cursorbitmap.width / 4, (i / 2) * @cursorbitmap.height / 2, - @cursorbitmap.width / 4, @cursorbitmap.height / 2)) + self.bitmap.blt( + x + (i % 2) * (@tilewidth - @cursorbitmap.width / 4) + expand * (((i % 2) * 2) - 1), + y + (i / 2) * (@tileheight - @cursorbitmap.height / 2) + expand * (((i / 2) * 2) - 1), + @cursorbitmap.bitmap, Rect.new((i % 2) * @cursorbitmap.width / 4, + (i / 2) * @cursorbitmap.height / 2, + @cursorbitmap.width / 4, @cursorbitmap.height / 2) + ) end end # Arrows @@ -72,10 +74,10 @@ class TilePuzzleCursor < BitmapSprite (@tileheight - @cursorbitmap.height / 2) / 2, -expand] for i in 0...4 if @arrows[i] - self.bitmap.blt(x + xin[i], y + yin[i], @cursorbitmap.bitmap, Rect.new( - @cursorbitmap.width / 2 + (i % 2) * (@cursorbitmap.width / 4), - (i / 2) * (@cursorbitmap.height / 2), - @cursorbitmap.width / 4, @cursorbitmap.height / 2)) + self.bitmap.blt(x + xin[i], y + yin[i], @cursorbitmap.bitmap, + Rect.new(@cursorbitmap.width / 2 + (i % 2) * (@cursorbitmap.width / 4), + (i / 2) * (@cursorbitmap.height / 2), + @cursorbitmap.width / 4, @cursorbitmap.height / 2)) end end end @@ -122,11 +124,11 @@ class TilePuzzleScene @sprites["tile#{i}"].bitmap.clear if rotatebitmaps[@angles[i]] @sprites["tile#{i}"].bitmap.blt(0, 0, rotatebitmaps[@angles[i]].bitmap, - Rect.new(@tilewidth * (i % @boardwidth), @tileheight * (i / @boardwidth), @tilewidth, @tileheight)) + Rect.new(@tilewidth * (i % @boardwidth), @tileheight * (i / @boardwidth), @tilewidth, @tileheight)) @sprites["tile#{i}"].angle = 0 else @sprites["tile#{i}"].bitmap.blt(0, 0, @tilebitmap.bitmap, - Rect.new(@tilewidth * (i % @boardwidth), @tileheight * (i / @boardwidth), @tilewidth, @tileheight)) + Rect.new(@tilewidth * (i % @boardwidth), @tileheight * (i / @boardwidth), @tilewidth, @tileheight)) @sprites["tile#{i}"].angle = @angles[i] * 90 end end @@ -173,13 +175,13 @@ class TilePuzzleScene @sprites["tile#{i}"].oy = @tileheight / 2 break if @game == 3 && i >= @boardwidth * @boardheight - 1 @sprites["tile#{i}"].bitmap.blt(0, 0, @tilebitmap.bitmap, - Rect.new(@tilewidth * (i % @boardwidth), @tileheight * (i / @boardwidth), @tilewidth, @tileheight)) + Rect.new(@tilewidth * (i % @boardwidth), @tileheight * (i / @boardwidth), @tilewidth, @tileheight)) end @heldtile = -1 @angles = [] @tiles = pbShuffleTiles @sprites["cursor"] = TilePuzzleCursor.new(@game, pbDefaultCursorPosition, - @tilewidth, @tileheight, @boardwidth, @boardheight) + @tilewidth, @tileheight, @boardwidth, @boardheight) update pbFadeInAndShow(@sprites) end @@ -509,8 +511,8 @@ class TilePuzzleScene extratile = @sprites["tile#{@boardwidth * @boardheight - 1}"] extratile.bitmap.clear extratile.bitmap.blt(0, 0, @tilebitmap.bitmap, - Rect.new(@tilewidth * (@boardwidth - 1), @tileheight * (@boardheight - 1), - @tilewidth, @tileheight)) + Rect.new(@tilewidth * (@boardwidth - 1), @tileheight * (@boardheight - 1), + @tilewidth, @tileheight)) extratile.opacity = 0 appearTime = Graphics.frame_rate * 8 / 10 opacityDiff = (255.0 / appearTime).ceil diff --git a/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/001_Challenge_BattleChallenge.rb b/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/001_Challenge_BattleChallenge.rb index 967a3a4ed..bb74700ed 100644 --- a/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/001_Challenge_BattleChallenge.rb +++ b/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/001_Challenge_BattleChallenge.rb @@ -20,8 +20,8 @@ class BattleChallenge @numRounds = numrounds @rules = rules register(id, id[/double/], 3, - id[/^factory/] ? BattleFactoryID : BattleTowerID, - id[/open$/] ? 1 : 0) + id[/^factory/] ? BattleFactoryID : BattleTowerID, + id[/open$/] ? 1 : 0) pbWriteCup(id, rules) end @@ -99,8 +99,8 @@ class BattleChallenge bttrainers = pbGetBTTrainers(@id) trainerdata = bttrainers[self.nextTrainer] ret = pbOrganizedBattleEx(opponent, self.rules, - pbGetMessageFromHash(MessageTypes::EndSpeechLose, trainerdata[4]), - pbGetMessageFromHash(MessageTypes::EndSpeechWin, trainerdata[3])) + pbGetMessageFromHash(MessageTypes::EndSpeechLose, trainerdata[4]), + pbGetMessageFromHash(MessageTypes::EndSpeechWin, trainerdata[3])) return ret end @@ -372,8 +372,9 @@ class BattleFactoryData bttrainers = pbGetBTTrainers(pbBattleChallenge.currentChallenge) trainerdata = bttrainers[@trainerid] @opponent = NPCTrainer.new( - pbGetMessageFromHash(MessageTypes::TrainerNames, trainerdata[1]), - trainerdata[0]) + pbGetMessageFromHash(MessageTypes::TrainerNames, trainerdata[1]), + trainerdata[0] + ) opponentPkmn = pbBattleFactoryPokemon(pbBattleChallenge.rules, @bcdata.wins, @bcdata.swaps, @rentals) @opponent.party = opponentPkmn.sample(3) end @@ -394,10 +395,11 @@ class BattleFactoryData bttrainers = pbGetBTTrainers(pbBattleChallenge.currentChallenge) trainerdata = bttrainers[trainerid] @opponent = NPCTrainer.new( - pbGetMessageFromHash(MessageTypes::TrainerNames, trainerdata[1]), - trainerdata[0]) + pbGetMessageFromHash(MessageTypes::TrainerNames, trainerdata[1]), + trainerdata[0] + ) opponentPkmn = pbBattleFactoryPokemon(pbBattleChallenge.rules, @bcdata.wins, @bcdata.swaps, - [].concat(@rentals).concat(@oldopponent)) + [].concat(@rentals).concat(@oldopponent)) @opponent.party = opponentPkmn.sample(3) end @@ -417,7 +419,7 @@ class BattleFactoryData bttrainers = pbGetBTTrainers(pbBattleChallenge.currentChallenge) trainerdata = bttrainers[@trainerid] return pbOrganizedBattleEx(@opponent, challenge.rules, - pbGetMessageFromHash(MessageTypes::EndSpeechLose, trainerdata[4]), - pbGetMessageFromHash(MessageTypes::EndSpeechWin, trainerdata[3])) + pbGetMessageFromHash(MessageTypes::EndSpeechLose, trainerdata[4]), + pbGetMessageFromHash(MessageTypes::EndSpeechWin, trainerdata[3])) end end diff --git a/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/002_Challenge_Data.rb b/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/002_Challenge_Data.rb index 1b0f33a3f..0ca054fb8 100644 --- a/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/002_Challenge_Data.rb +++ b/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/002_Challenge_Data.rb @@ -148,7 +148,7 @@ class PBPokemon ev_array.push(s.id) if pkmn.ev[s.id] > 60 end return self.new(pkmn.species, pkmn.item_id, pkmn.nature, - mov1, mov2, mov3, mov4, ev_array) + mov1, mov2, mov3, mov4, ev_array) end def initialize(species, item, nature, move1, move2, move3, move4, ev) diff --git a/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/003_Challenge_ChooseFoes.rb b/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/003_Challenge_ChooseFoes.rb index 251a91632..448f63ca2 100644 --- a/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/003_Challenge_ChooseFoes.rb +++ b/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/003_Challenge_ChooseFoes.rb @@ -43,8 +43,9 @@ def pbGenerateBattleTrainer(idxTrainer, rules) # Create the trainer trainerdata = bttrainers[idxTrainer] opponent = NPCTrainer.new( - pbGetMessageFromHash(MessageTypes::TrainerNames, trainerdata[1]), - trainerdata[0]) + pbGetMessageFromHash(MessageTypes::TrainerNames, trainerdata[1]), + trainerdata[0] + ) # Determine how many IVs the trainer's Pokémon will have indvalues = 31 indvalues = 21 if idxTrainer < 220 diff --git a/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/005_UI_BattleSwap.rb b/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/005_UI_BattleSwap.rb index c9d962dd9..d96718d0f 100644 --- a/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/005_UI_BattleSwap.rb +++ b/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/005_UI_BattleSwap.rb @@ -7,13 +7,17 @@ class BattleSwapScene @sprites = {} addBackgroundPlane(@sprites, "bg", "rentbg", @viewport) @sprites["title"] = Window_UnformattedTextPokemon.newWithSize( - _INTL("RENTAL POKéMON"), 0, 0, Graphics.width, 64, @viewport) + _INTL("RENTAL POKéMON"), 0, 0, Graphics.width, 64, @viewport + ) @sprites["list"] = Window_AdvancedCommandPokemonEx.newWithSize( - [], 0, 64, Graphics.width, Graphics.height - 128, @viewport) - @sprites["help"] = Window_UnformattedTextPokemon.newWithSize("", - 0, Graphics.height - 64, Graphics.width, 64, @viewport) - @sprites["msgwindow"] = Window_AdvancedTextPokemon.newWithSize("", - 0, Graphics.height - 64, Graphics.height, 64, @viewport) + [], 0, 64, Graphics.width, Graphics.height - 128, @viewport + ) + @sprites["help"] = Window_UnformattedTextPokemon.newWithSize( + "", 0, Graphics.height - 64, Graphics.width, 64, @viewport + ) + @sprites["msgwindow"] = Window_AdvancedTextPokemon.newWithSize( + "", 0, Graphics.height - 64, Graphics.height, 64, @viewport + ) @sprites["msgwindow"].visible = false pbUpdateChoices([]) pbDeactivateWindows(@sprites) @@ -29,13 +33,17 @@ class BattleSwapScene @sprites = {} addBackgroundPlane(@sprites, "bg", "swapbg", @viewport) @sprites["title"] = Window_UnformattedTextPokemon.newWithSize( - _INTL("POKéMON SWAP"), 0, 0, Graphics.width, 64, @viewport) + _INTL("POKéMON SWAP"), 0, 0, Graphics.width, 64, @viewport + ) @sprites["list"] = Window_AdvancedCommandPokemonEx.newWithSize( - [], 0, 64, Graphics.width, Graphics.height - 128, @viewport) + [], 0, 64, Graphics.width, Graphics.height - 128, @viewport + ) @sprites["help"] = Window_UnformattedTextPokemon.newWithSize( - "", 0, Graphics.height - 64, Graphics.width, 64, @viewport) + "", 0, Graphics.height - 64, Graphics.width, 64, @viewport + ) @sprites["msgwindow"] = Window_AdvancedTextPokemon.newWithSize( - "", 0, Graphics.height - 64, Graphics.width, 64, @viewport) + "", 0, Graphics.height - 64, Graphics.width, 64, @viewport + ) @sprites["msgwindow"].visible = false pbInitSwapScreen pbDeactivateWindows(@sprites) diff --git a/Data/Scripts/018_Alternate battle modes/002_BugContest.rb b/Data/Scripts/018_Alternate battle modes/002_BugContest.rb index c6a931083..495a23180 100644 --- a/Data/Scripts/018_Alternate battle modes/002_BugContest.rb +++ b/Data/Scripts/018_Alternate battle modes/002_BugContest.rb @@ -293,9 +293,10 @@ Events.onMapChange += proc { |_sender, _e| Events.onMapSceneChange += proc { |_sender, e| scene = e[0] if pbInBugContest? && pbBugContestState.decision == 0 && BugContestState::TIME_ALLOWED > 0 - scene.spriteset.addUserSprite(TimerDisplay.new( - pbBugContestState.timer, - BugContestState::TIME_ALLOWED * Graphics.frame_rate)) + scene.spriteset.addUserSprite( + TimerDisplay.new(pbBugContestState.timer, + BugContestState::TIME_ALLOWED * Graphics.frame_rate) + ) end } diff --git a/Data/Scripts/018_Alternate battle modes/003_Battle Frontier generator/001_ChallengeGenerator_Data.rb b/Data/Scripts/018_Alternate battle modes/003_Battle Frontier generator/001_ChallengeGenerator_Data.rb index f153c7644..9b252df7d 100644 --- a/Data/Scripts/018_Alternate battle modes/003_Battle Frontier generator/001_ChallengeGenerator_Data.rb +++ b/Data/Scripts/018_Alternate battle modes/003_Battle Frontier generator/001_ChallengeGenerator_Data.rb @@ -295,10 +295,10 @@ def pbWriteCup(id, rules) cmd = 0 if trlists.length != 0 cmd = pbMessage(_INTL("Generate Pokémon teams for this challenge?"), - [_INTL("NO"), _INTL("YES, USE EXISTING"), _INTL("YES, USE NEW")], 1) + [_INTL("NO"), _INTL("YES, USE EXISTING"), _INTL("YES, USE NEW")], 1) else cmd = pbMessage(_INTL("Generate Pokémon teams for this challenge?"), - [_INTL("YES"), _INTL("NO")], 2) + [_INTL("YES"), _INTL("NO")], 2) case cmd when 0 cmd = 2 diff --git a/Data/Scripts/018_Alternate battle modes/003_Battle Frontier generator/004_ChallengeGenerator_BattleSim.rb b/Data/Scripts/018_Alternate battle modes/003_Battle Frontier generator/004_ChallengeGenerator_BattleSim.rb index 76a88705e..0d6126a9f 100644 --- a/Data/Scripts/018_Alternate battle modes/003_Battle Frontier generator/004_ChallengeGenerator_BattleSim.rb +++ b/Data/Scripts/018_Alternate battle modes/003_Battle Frontier generator/004_ChallengeGenerator_BattleSim.rb @@ -342,8 +342,9 @@ def pbDecideWinnerScore(party0, party1, rating) for move in party0[i].moves next if !move for j in 0...party1.length - score += pbDecideWinnerEffectiveness(move.id, - types1[j], types2[j], abilities[j], [-16, -8, 0, 4, 12, 20]) + score += pbDecideWinnerEffectiveness( + move.id, types1[j], types2[j], abilities[j], [-16, -8, 0, 4, 12, 20] + ) end end basestatsum = baseStatTotal(party0[i].species) diff --git a/Data/Scripts/020_Debug/001_Editor screens/001_EditorScreens.rb b/Data/Scripts/020_Debug/001_Editor screens/001_EditorScreens.rb index 232455667..ab7d948c7 100644 --- a/Data/Scripts/020_Debug/001_Editor screens/001_EditorScreens.rb +++ b/Data/Scripts/020_Debug/001_Editor screens/001_EditorScreens.rb @@ -8,8 +8,9 @@ def pbEncountersEditor commands = [] maps = [] list = pbListWindow([]) - help_window = Window_UnformattedTextPokemon.newWithSize(_INTL("Edit wild encounters"), - Graphics.width / 2, 0, Graphics.width / 2, 96) + help_window = Window_UnformattedTextPokemon.newWithSize( + _INTL("Edit wild encounters"), Graphics.width / 2, 0, Graphics.width / 2, 96 + ) help_window.z = 99999 ret = 0 need_refresh = true @@ -128,8 +129,9 @@ def pbEncounterMapVersionEditor(enc_data) commands = [] enc_types = [] list = pbListWindow([]) - help_window = Window_UnformattedTextPokemon.newWithSize(_INTL("Edit map's encounters"), - Graphics.width / 2, 0, Graphics.width / 2, 96) + help_window = Window_UnformattedTextPokemon.newWithSize( + _INTL("Edit map's encounters"), Graphics.width / 2, 0, Graphics.width / 2, 96 + ) help_window.z = 99999 ret = 0 need_refresh = true @@ -219,7 +221,7 @@ def pbEncounterMapVersionEditor(enc_data) end if new_type_commands.length > 0 chosen_type_cmd = pbMessage(_INTL("Choose an encounter type to copy to."), - new_type_commands, -1) + new_type_commands, -1) if chosen_type_cmd >= 0 new_type = new_types[chosen_type_cmd] enc_data.step_chances[new_type] = enc_data.step_chances[this_type] @@ -253,8 +255,9 @@ end def pbEncounterTypeEditor(enc_data, enc_type) commands = [] list = pbListWindow([]) - help_window = Window_UnformattedTextPokemon.newWithSize(_INTL("Edit encounter slots"), - Graphics.width / 2, 0, Graphics.width / 2, 96) + help_window = Window_UnformattedTextPokemon.newWithSize( + _INTL("Edit encounter slots"), Graphics.width / 2, 0, Graphics.width / 2, 96 + ) help_window.z = 99999 enc_type_name = "" ret = 0 @@ -409,7 +412,7 @@ end def pbTrainerTypeEditorNew(default_name) # Choose a name name = pbMessageFreeText(_INTL("Please enter the trainer type's name."), - (default_name) ? default_name.gsub(/_+/, " ") : "", false, 30) + (default_name) ? default_name.gsub(/_+/, " ") : "", false, 30) if nil_or_empty?(name) return nil if !default_name name = default_name @@ -942,7 +945,7 @@ end def pbItemEditorNew(default_name) # Choose a name name = pbMessageFreeText(_INTL("Please enter the item's name."), - (default_name) ? default_name.gsub(/_+/, " ") : "", false, 30) + (default_name) ? default_name.gsub(/_+/, " ") : "", false, 30) if nil_or_empty?(name) return if !default_name name = default_name @@ -1171,8 +1174,9 @@ def pbRegionalDexEditor(dex) viewport.z = 99999 cmd_window = pbListWindow([]) info = Window_AdvancedTextPokemon.newWithSize( - _INTL("Z+Up/Down: Rearrange entries\nZ+Right: Insert new entry\nZ+Left: Delete entry\nD: Clear entry"), - Graphics.width / 2, 64, Graphics.width / 2, Graphics.height - 64, viewport) + _INTL("Z+Up/Down: Rearrange entries\nZ+Right: Insert new entry\nZ+Left: Delete entry\nD: Clear entry"), + Graphics.width / 2, 64, Graphics.width / 2, Graphics.height - 64, viewport + ) info.z = 2 dex.compact! ret = dex.clone @@ -1226,7 +1230,9 @@ def pbRegionalDexEditor(dex) when 0 if cmd[1] >= 0 # Edit entry case pbMessage(_INTL("\\ts[]Do what with this entry?"), - [_INTL("Change species"), _INTL("Clear"), _INTL("Insert entry"), _INTL("Delete entry"), _INTL("Cancel")], 5) + [_INTL("Change species"), _INTL("Clear"), + _INTL("Insert entry"), _INTL("Delete entry"), + _INTL("Cancel")], 5) when 0 # Change species species = pbChooseSpeciesList(dex[cmd[1]]) if species @@ -1252,7 +1258,7 @@ def pbRegionalDexEditor(dex) end else # Cancel case pbMessage(_INTL("Save changes?"), - [_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3) + [_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3) when 0 # Save all changes to Dex dex.slice!(-1) while !dex[-1] ret = dex @@ -1276,11 +1282,14 @@ def pbRegionalDexEditorMain cmd_window = pbListWindow([]) cmd_window.viewport = viewport cmd_window.z = 2 - title = Window_UnformattedTextPokemon.newWithSize(_INTL("Regional Dexes Editor"), - Graphics.width / 2, 0, Graphics.width / 2, 64, viewport) + title = Window_UnformattedTextPokemon.newWithSize( + _INTL("Regional Dexes Editor"), Graphics.width / 2, 0, Graphics.width / 2, 64, viewport + ) title.z = 2 - info = Window_AdvancedTextPokemon.newWithSize(_INTL("Z+Up/Down: Rearrange Dexes"), - Graphics.width / 2, 64, Graphics.width / 2, Graphics.height - 64, viewport) + info = Window_AdvancedTextPokemon.newWithSize( + _INTL("Z+Up/Down: Rearrange Dexes"), Graphics.width / 2, 64, + Graphics.width / 2, Graphics.height - 64, viewport + ) info.z = 2 dex_lists = [] pbLoadRegionalDexes.each_with_index { |d, index| dex_lists[index] = d.clone } @@ -1314,7 +1323,8 @@ def pbRegionalDexEditorMain when 0 # Clicked on a command/Dex if cmd[1] == 0 # Add new Dex case pbMessage(_INTL("Fill in this new Dex?"), - [_INTL("Leave blank"), _INTL("National Dex"), _INTL("Nat. Dex grouped families"), _INTL("Cancel")], 4) + [_INTL("Leave blank"), _INTL("National Dex"), + _INTL("Nat. Dex grouped families"), _INTL("Cancel")], 4) when 0 # Leave blank dex_lists.push([]) refresh_list = true @@ -1337,7 +1347,7 @@ def pbRegionalDexEditorMain end elsif cmd[1] > 0 # Edit a Dex case pbMessage(_INTL("\\ts[]Do what with this Dex?"), - [_INTL("Edit"), _INTL("Copy"), _INTL("Delete"), _INTL("Cancel")], 4) + [_INTL("Edit"), _INTL("Copy"), _INTL("Delete"), _INTL("Cancel")], 4) when 0 # Edit dex_lists[cmd[1] - 1] = pbRegionalDexEditor(dex_lists[cmd[1] - 1]) refresh_list = true @@ -1352,7 +1362,7 @@ def pbRegionalDexEditorMain end else # Cancel case pbMessage(_INTL("Save changes?"), - [_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3) + [_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3) when 0 # Save all changes to Dexes save_data(dex_lists, "Data/regional_dexes.dat") $game_temp.regional_dexes_data = nil @@ -1432,11 +1442,14 @@ def pbAnimationsOrganiser cmdwin = pbListWindow([]) cmdwin.viewport = viewport cmdwin.z = 2 - title = Window_UnformattedTextPokemon.newWithSize(_INTL("Animations Organiser"), - Graphics.width / 2, 0, Graphics.width / 2, 64, viewport) + title = Window_UnformattedTextPokemon.newWithSize( + _INTL("Animations Organiser"), Graphics.width / 2, 0, Graphics.width / 2, 64, viewport + ) title.z = 2 - info = Window_AdvancedTextPokemon.newWithSize(_INTL("Z+Up/Down: Swap\nZ+Left: Delete\nZ+Right: Insert"), - Graphics.width / 2, 64, Graphics.width / 2, Graphics.height - 64, viewport) + info = Window_AdvancedTextPokemon.newWithSize( + _INTL("Z+Up/Down: Swap\nZ+Left: Delete\nZ+Right: Insert"), + Graphics.width / 2, 64, Graphics.width / 2, Graphics.height - 64, viewport + ) info.z = 2 commands = [] refreshlist = true @@ -1474,7 +1487,7 @@ def pbAnimationsOrganiser pbWait(Graphics.frame_rate * 2 / 10) when 0 cmd2 = pbMessage(_INTL("Save changes?"), - [_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3) + [_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3) if [0, 1].include?(cmd2) if cmd2 == 0 # Save animations here diff --git a/Data/Scripts/020_Debug/001_Editor screens/002_EditorScreens_TerrainTags.rb b/Data/Scripts/020_Debug/001_Editor screens/002_EditorScreens_TerrainTags.rb index 48871aead..f45f6da11 100644 --- a/Data/Scripts/020_Debug/001_Editor screens/002_EditorScreens_TerrainTags.rb +++ b/Data/Scripts/020_Debug/001_Editor screens/002_EditorScreens_TerrainTags.rb @@ -17,8 +17,9 @@ class PokemonTilesetScene @viewport.z = 99999 @sprites = {} @sprites["title"] = Window_UnformattedTextPokemon.newWithSize( - _INTL("Tileset Editor\r\nA/S: SCROLL\r\nZ: MENU"), - TILESET_WIDTH, 0, Graphics.width - TILESET_WIDTH, 128, @viewport) + _INTL("Tileset Editor\r\nA/S: SCROLL\r\nZ: MENU"), + TILESET_WIDTH, 0, Graphics.width - TILESET_WIDTH, 128, @viewport + ) @sprites["tileset"] = BitmapSprite.new(TILESET_WIDTH, Graphics.height, @viewport) @sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) pbSetSystemFont(@sprites["overlay"].bitmap) @@ -74,7 +75,7 @@ class PokemonTilesetScene for xx in 0...TILES_PER_ROW id_x_offset = (autotile_row) ? xx * TILES_PER_AUTOTILE : xx @tilehelper.bltTile(@sprites["tileset"].bitmap, xx * TILE_SIZE, yy * TILE_SIZE, - id_y_offset + id_x_offset) + id_y_offset + id_x_offset) end end end diff --git a/Data/Scripts/020_Debug/001_Editor screens/003_EditorScreens_MapConnections.rb b/Data/Scripts/020_Debug/001_Editor screens/003_EditorScreens_MapConnections.rb index 45d8aa9ca..a44808c43 100644 --- a/Data/Scripts/020_Debug/001_Editor screens/003_EditorScreens_MapConnections.rb +++ b/Data/Scripts/020_Debug/001_Editor screens/003_EditorScreens_MapConnections.rb @@ -60,15 +60,16 @@ class SelectionSprite < Sprite if @othersprite && !@othersprite.disposed? && @othersprite.bitmap && !@othersprite.bitmap.disposed? @sprite.bitmap = pbDoEnsureBitmap( - @sprite.bitmap, @othersprite.bitmap.width, @othersprite.bitmap.height) + @sprite.bitmap, @othersprite.bitmap.width, @othersprite.bitmap.height + ) red = Color.new(255, 0, 0) @sprite.bitmap.clear @sprite.bitmap.fill_rect(0, 0, @othersprite.bitmap.width, 2, red) @sprite.bitmap.fill_rect(0, @othersprite.bitmap.height - 2, - @othersprite.bitmap.width, 2, red) + @othersprite.bitmap.width, 2, red) @sprite.bitmap.fill_rect(0, 0, 2, @othersprite.bitmap.height, red) @sprite.bitmap.fill_rect(@othersprite.bitmap.width - 2, 0, 2, - @othersprite.bitmap.height, red) + @othersprite.bitmap.height, red) end end @@ -324,8 +325,9 @@ class MapScreenScene @selmapid = -1 @sprites["background"] = ColoredPlane.new(Color.new(160, 208, 240), @viewport) @sprites["selsprite"] = SelectionSprite.new(@viewport) - @sprites["title"] = Window_UnformattedTextPokemon.newWithSize(_INTL("D: Help"), - 0, Graphics.height - 64, Graphics.width, 64, @viewport) + @sprites["title"] = Window_UnformattedTextPokemon.newWithSize( + _INTL("D: Help"), 0, Graphics.height - 64, Graphics.width, 64, @viewport + ) @sprites["title"].z = 2 @mapinfos = pbLoadMapInfos conns = MapFactoryHelper.getMapConnections @@ -358,8 +360,9 @@ class MapScreenScene helptext += _INTL("Double-click: Edit map's metadata\r\n") helptext += _INTL("Drag map to move it\r\n") helptext += _INTL("Arrow keys/drag canvas: Move around canvas") - title = Window_UnformattedTextPokemon.newWithSize(helptext, - 0, 0, Graphics.width * 8 / 10, Graphics.height, @viewport) + title = Window_UnformattedTextPokemon.newWithSize( + helptext, 0, 0, Graphics.width * 8 / 10, Graphics.height, @viewport + ) title.z = 2 loop do Graphics.update diff --git a/Data/Scripts/020_Debug/002_Animation editor/001_AnimEditor_SceneElements.rb b/Data/Scripts/020_Debug/002_Animation editor/001_AnimEditor_SceneElements.rb index d19125ae1..aee3d7210 100644 --- a/Data/Scripts/020_Debug/002_Animation editor/001_AnimEditor_SceneElements.rb +++ b/Data/Scripts/020_Debug/002_Animation editor/001_AnimEditor_SceneElements.rb @@ -223,7 +223,7 @@ class AnimationWindow < SpriteWrapper @contents.fill_rect(0, 0, @contents.width, @contents.height, Color.new(180, 180, 180)) @contents.blt(0, 0, @arrows.bitmap, Rect.new(0, 0, arrowwidth, 96)) @contents.blt(arrowwidth + NUMFRAMES * 96, 0, @arrows.bitmap, - Rect.new(arrowwidth, 0, arrowwidth, 96)) + Rect.new(arrowwidth, 0, arrowwidth, 96)) havebitmap = (self.animbitmap && !self.animbitmap.disposed?) if havebitmap rect = Rect.new(0, 0, 0, 0) @@ -484,7 +484,7 @@ class AnimationCanvas < Sprite else begin @animbitmap = AnimatedBitmap.new("Graphics/Animations/" + @animation.graphic, - @animation.hue).deanimate + @animation.hue).deanimate rescue @animbitmap = nil end @@ -527,13 +527,13 @@ class AnimationCanvas < Sprite @sprites["pokemon_1"].bitmap = @target @sprites["pokemon_1"].z = 16 pbSpriteSetAnimFrame(@sprites["pokemon_0"], - pbCreateCel(Battle::Scene::FOCUSUSER_X, - Battle::Scene::FOCUSUSER_Y, -1, 2), - @sprites["pokemon_0"], @sprites["pokemon_1"]) + pbCreateCel(Battle::Scene::FOCUSUSER_X, + Battle::Scene::FOCUSUSER_Y, -1, 2), + @sprites["pokemon_0"], @sprites["pokemon_1"]) pbSpriteSetAnimFrame(@sprites["pokemon_1"], - pbCreateCel(Battle::Scene::FOCUSTARGET_X, - Battle::Scene::FOCUSTARGET_Y, -2, 1), - @sprites["pokemon_0"], @sprites["pokemon_1"]) + pbCreateCel(Battle::Scene::FOCUSTARGET_X, + Battle::Scene::FOCUSTARGET_Y, -2, 1), + @sprites["pokemon_0"], @sprites["pokemon_1"]) usersprite = @sprites["pokemon_#{oppmove ? 1 : 0}"] targetsprite = @sprites["pokemon_#{oppmove ? 0 : 1}"] olduserx = usersprite ? usersprite.x : 0 @@ -541,12 +541,15 @@ class AnimationCanvas < Sprite oldtargetx = targetsprite ? targetsprite.x : 0 oldtargety = targetsprite ? targetsprite.y : 0 @player = PBAnimationPlayerX.new(@animation, - @battle.battlers[oppmove ? 1 : 0], @battle.battlers[oppmove ? 0 : 1], self, oppmove, true) + @battle.battlers[oppmove ? 1 : 0], + @battle.battlers[oppmove ? 0 : 1], + self, oppmove, true) @player.setLineTransform( - Battle::Scene::FOCUSUSER_X, Battle::Scene::FOCUSUSER_Y, - Battle::Scene::FOCUSTARGET_X, Battle::Scene::FOCUSTARGET_Y, - olduserx, oldusery, - oldtargetx, oldtargety) + Battle::Scene::FOCUSUSER_X, Battle::Scene::FOCUSUSER_Y, + Battle::Scene::FOCUSTARGET_X, Battle::Scene::FOCUSTARGET_Y, + olduserx, oldusery, + oldtargetx, oldtargety + ) @player.start @playing = true @sprites["pokemon_0"].x += BORDERSIZE @@ -992,10 +995,9 @@ class BitmapDisplayWindow < SpriteWindow_Base wh = sx * wh ww = self.contents.width end - dest = Rect.new( - (self.contents.width - ww) / 2, - (self.contents.height - wh) / 2, - ww, wh) + dest = Rect.new((self.contents.width - ww) / 2, + (self.contents.height - wh) / 2, + ww, wh) src = Rect.new(0, 0, bmap.width, bmap.height) self.contents.stretch_blt(dest, bmap, src) bmap.dispose @@ -1009,7 +1011,8 @@ class AnimationNameWindow @canvas = canvas @oldname = nil @window = Window_UnformattedTextPokemon.newWithSize( - _INTL("Name: {1}", @canvas.animation.name), x, y, width, height, viewport) + _INTL("Name: {1}", @canvas.animation.name), x, y, width, height, viewport + ) end def viewport=(value); @window.viewport = value; end diff --git a/Data/Scripts/020_Debug/002_Animation editor/002_AnimEditor_ControlsButtons.rb b/Data/Scripts/020_Debug/002_Animation editor/002_AnimEditor_ControlsButtons.rb index 4fea00f57..7ee56b7fe 100644 --- a/Data/Scripts/020_Debug/002_Animation editor/002_AnimEditor_ControlsButtons.rb +++ b/Data/Scripts/020_Debug/002_Animation editor/002_AnimEditor_ControlsButtons.rb @@ -8,8 +8,8 @@ module ShadowText x += (w / 2) - (width / 2) end pbDrawShadowText(bitmap, x, y, w, h, t, - disabled ? Color.new(26 * 8, 26 * 8, 25 * 8) : Color.new(12 * 8, 12 * 8, 12 * 8), - Color.new(26 * 8, 26 * 8, 25 * 8)) + disabled ? Color.new(26 * 8, 26 * 8, 25 * 8) : Color.new(12 * 8, 12 * 8, 12 * 8), + Color.new(26 * 8, 26 * 8, 25 * 8)) end end @@ -47,10 +47,7 @@ class UIControl end def toAbsoluteRect(rc) - return Rect.new( - rc.x + self.parentX, - rc.y + self.parentY, - rc.width, rc.height) + return Rect.new(rc.x + self.parentX, rc.y + self.parentY, rc.width, rc.height) end def parentX @@ -442,7 +439,7 @@ class Slider < UIControl shadowtext(bitmap, x, y, size, height, self.label) x += size shadowtext(bitmap, x, y, leftarrows.width, height, _INTL(" << "), - self.disabled || self.curvalue == self.minvalue) + self.disabled || self.curvalue == self.minvalue) @leftarrow = Rect.new(x, y, leftarrows.width, height) x += leftarrows.width if !self.disabled @@ -451,7 +448,7 @@ class Slider < UIControl end x += numbers shadowtext(bitmap, x, y, rightarrows.width, height, _INTL(" >> "), - self.disabled || self.curvalue == self.maxvalue) + self.disabled || self.curvalue == self.maxvalue) @rightarrow = Rect.new(x, y, rightarrows.width, height) end end @@ -690,7 +687,7 @@ class TextSlider < UIControl shadowtext(bitmap, x, y, size, height, self.label) x += size shadowtext(bitmap, x, y, leftarrows.width, height, _INTL(" << "), - self.disabled || self.curvalue == self.minvalue) + self.disabled || self.curvalue == self.minvalue) @leftarrow = Rect.new(x, y, leftarrows.width, height) x += leftarrows.width if !self.disabled @@ -699,7 +696,7 @@ class TextSlider < UIControl end x += @maxoptionwidth shadowtext(bitmap, x, y, rightarrows.width, height, _INTL(" >> "), - self.disabled || self.curvalue == self.maxvalue) + self.disabled || self.curvalue == self.maxvalue) @rightarrow = Rect.new(x, y, rightarrows.width, height) end end diff --git a/Data/Scripts/020_Debug/002_Animation editor/003_AnimEditor_Interpolation.rb b/Data/Scripts/020_Debug/002_Animation editor/003_AnimEditor_Interpolation.rb index a81029e55..530657059 100644 --- a/Data/Scripts/020_Debug/002_Animation editor/003_AnimEditor_Interpolation.rb +++ b/Data/Scripts/020_Debug/002_Animation editor/003_AnimEditor_Interpolation.rb @@ -283,8 +283,9 @@ def pbDefinePath(canvas) showline = false sliderwin2.visible = false # This window displays the mouse's current position - window = Window_UnformattedTextPokemon.newWithSize("", - 0, 320 - 64, 128, 64, canvas.viewport) + window = Window_UnformattedTextPokemon.newWithSize( + "", 0, 320 - 64, 128, 64, canvas.viewport + ) loop do Graphics.update Input.update @@ -363,8 +364,9 @@ def pbDefinePath(canvas) point.dispose end points.clear - window = Window_UnformattedTextPokemon.newWithSize("", - 0, 320 - 64, 128, 64, canvas.viewport) + window = Window_UnformattedTextPokemon.newWithSize( + "", 0, 320 - 64, 128, 64, canvas.viewport + ) sliderwin2.visible = false loop do Graphics.update diff --git a/Data/Scripts/020_Debug/002_Animation editor/005_AnimEditor_Functions.rb b/Data/Scripts/020_Debug/002_Animation editor/005_AnimEditor_Functions.rb index be7334917..9f32747e0 100644 --- a/Data/Scripts/020_Debug/002_Animation editor/005_AnimEditor_Functions.rb +++ b/Data/Scripts/020_Debug/002_Animation editor/005_AnimEditor_Functions.rb @@ -128,8 +128,9 @@ def pbAnimList(animations, canvas, animwin) cmdwin.index = animations.selected cmdwin.viewport = canvas.viewport helpwindow = Window_UnformattedTextPokemon.newWithSize( - _INTL("Enter: Load/rename an animation\nEsc: Cancel"), - 320, 0, 320, 128, canvas.viewport) + _INTL("Enter: Load/rename an animation\nEsc: Cancel"), + 320, 0, 320, 128, canvas.viewport + ) maxsizewindow = ControlWindow.new(0, 416, 320, 32 * 3) maxsizewindow.addSlider(_INTL("Total Animations:"), 1, 2000, animations.length) maxsizewindow.addButton(_INTL("Resize Animation List")) diff --git a/Data/Scripts/020_Debug/002_Editor_DataTypes.rb b/Data/Scripts/020_Debug/002_Editor_DataTypes.rb index 525dbc04c..8bf62406d 100644 --- a/Data/Scripts/020_Debug/002_Editor_DataTypes.rb +++ b/Data/Scripts/020_Debug/002_Editor_DataTypes.rb @@ -156,7 +156,7 @@ end module StringProperty def self.set(settingname, oldsetting) return pbMessageFreeText(_INTL("Set the value for {1}.", settingname), - (oldsetting) ? oldsetting : "", false, 250, Graphics.width) + (oldsetting) ? oldsetting : "", false, 250, Graphics.width) end def self.format(value) @@ -177,7 +177,7 @@ class LimitStringProperty def set(settingname, oldsetting) return pbMessageFreeText(_INTL("Set the value for {1}.", settingname), - (oldsetting) ? oldsetting : "", false, @limit) + (oldsetting) ? oldsetting : "", false, @limit) end end @@ -265,7 +265,7 @@ class StringListProperty entry = real_cmds[cmd] if entry[1] == -1 # Add new value new_value = pbMessageFreeText(_INTL("Enter the new value."), - "", false, 250, Graphics.width) + "", false, 250, Graphics.width) if !nil_or_empty?(new_value) if real_cmds.any? { |e| e[0] == new_value } oldsel = new_value # Already have value; just move cursor to it @@ -276,10 +276,10 @@ class StringListProperty end else # Edit value case pbMessage(_INTL("\\ts[]Do what with this value?"), - [_INTL("Edit"), _INTL("Delete"), _INTL("Cancel")], 3) + [_INTL("Edit"), _INTL("Delete"), _INTL("Cancel")], 3) when 0 # Edit new_value = pbMessageFreeText(_INTL("Enter the new value."), - entry[0], false, 250, Graphics.width) + entry[0], false, 250, Graphics.width) if !nil_or_empty?(new_value) if real_cmds.any? { |e| e[0] == new_value } # Already have value; delete this one real_cmds.delete_at(cmd) @@ -684,8 +684,9 @@ end def chooseMapPoint(map, rgnmap = false) viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) viewport.z = 99999 - title = Window_UnformattedTextPokemon.newWithSize(_INTL("Click a point on the map."), - 0, Graphics.height - 64, Graphics.width, 64, viewport) + title = Window_UnformattedTextPokemon.newWithSize( + _INTL("Click a point on the map."), 0, Graphics.height - 64, Graphics.width, 64, viewport + ) title.z = 2 if rgnmap sprite = RegionMapSprite.new(map, viewport) @@ -739,7 +740,7 @@ module MapCoordsFacingProperty mappoint = chooseMapPoint(chosenmap) if mappoint facing = pbMessage(_INTL("Choose the direction to face in."), - [_INTL("Down"), _INTL("Left"), _INTL("Right"), _INTL("Up")], -1) + [_INTL("Down"), _INTL("Left"), _INTL("Right"), _INTL("Up")], -1) return (facing >= 0) ? [chosenmap, mappoint[0], mappoint[1], [2, 4, 6, 8][facing]] : oldsetting else return oldsetting @@ -848,7 +849,7 @@ end module ItemNameProperty def self.set(settingname, oldsetting) return pbMessageFreeText(_INTL("Set the value for {1}.", settingname), - (oldsetting) ? oldsetting : "", false, 30) + (oldsetting) ? oldsetting : "", false, 30) end def self.defaultValue @@ -1039,7 +1040,7 @@ class GameDataPoolProperty end else # Edit existing value case pbMessage(_INTL("\\ts[]Do what with this value?"), - [_INTL("Change value"), _INTL("Delete"), _INTL("Cancel")], 3) + [_INTL("Change value"), _INTL("Delete"), _INTL("Cancel")], 3) when 0 # Change value new_value = pbChooseFromGameDataList(@game_data, entry[0]) if new_value && new_value != entry[0] @@ -1065,7 +1066,7 @@ class GameDataPoolProperty end else # Cancel/quit case pbMessage(_INTL("Apply changes?"), - [_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3) + [_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3) when 0 values.shift # Remove the "add value" option for i in 0...values.length @@ -1173,7 +1174,7 @@ module LevelUpMovesProperty end else # Edit existing move case pbMessage(_INTL("\\ts[]Do what with this move?"), - [_INTL("Change level"), _INTL("Change move"), _INTL("Delete"), _INTL("Cancel")], 4) + [_INTL("Change level"), _INTL("Change move"), _INTL("Delete"), _INTL("Cancel")], 4) when 0 # Change level params = ChooseNumberParams.new params.setRange(0, GameData::GrowthRate.max_level) @@ -1219,7 +1220,7 @@ module LevelUpMovesProperty end else # Cancel/quit case pbMessage(_INTL("Save changes?"), - [_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3) + [_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3) when 0 realcmds.shift for i in 0...realcmds.length @@ -1320,14 +1321,14 @@ class EvolutionsProperty param_type = evo_method_data.parameter if param_type.nil? commands.push(_INTL("{1}: {2}", - GameData::Species.get(realcmds[i][0]).name, evo_method_data.real_name)) + GameData::Species.get(realcmds[i][0]).name, evo_method_data.real_name)) else if param_type.is_a?(Symbol) && !GameData.const_defined?(param_type) level = getConstantName(param_type, level) end level = "???" if !level || (level.is_a?(String) && level.empty?) commands.push(_INTL("{1}: {2}, {3}", - GameData::Species.get(realcmds[i][0]).name, evo_method_data.real_name, level.to_s)) + GameData::Species.get(realcmds[i][0]).name, evo_method_data.real_name, level.to_s)) end end cmd[1] = i if oldsel >= 0 && realcmds[i][3] == oldsel @@ -1379,8 +1380,8 @@ class EvolutionsProperty end else # Edit evolution case pbMessage(_INTL("\\ts[]Do what with this evolution?"), - [_INTL("Change species"), _INTL("Change method"), - _INTL("Change parameter"), _INTL("Delete"), _INTL("Cancel")], 5) + [_INTL("Change species"), _INTL("Change method"), + _INTL("Change parameter"), _INTL("Delete"), _INTL("Cancel")], 5) when 0 # Change species newspecies = pbChooseSpeciesList(entry[0]) if newspecies @@ -1451,7 +1452,7 @@ class EvolutionsProperty end else cmd2 = pbMessage(_INTL("Save changes?"), - [_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3) + [_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3) if [0, 1].include?(cmd2) if cmd2 == 0 for i in 0...realcmds.length @@ -1531,10 +1532,10 @@ module EncounterSlotProperty if species_data.form > 0 if value[2] == value[3] return sprintf("%d, %s_%d (Lv.%d)", value[0], - species_data.real_name, species_data.form, value[2]) + species_data.real_name, species_data.form, value[2]) end return sprintf("%d, %s_%d (Lv.%d-%d)", value[0], - species_data.real_name, species_data.form, value[2], value[3]) + species_data.real_name, species_data.form, value[2], value[3]) end if value[2] == value[3] return sprintf("%d, %s (Lv.%d)", value[0], species_data.real_name, value[2]) @@ -1554,11 +1555,13 @@ def pbPropertyList(title, data, properties, saveprompt = false) list = pbListWindow([], Graphics.width / 2) list.viewport = viewport list.z = 2 - title = Window_UnformattedTextPokemon.newWithSize(title, - list.width, 0, Graphics.width / 2, 64, viewport) + title = Window_UnformattedTextPokemon.newWithSize( + title, list.width, 0, Graphics.width / 2, 64, viewport + ) title.z = 2 - desc = Window_UnformattedTextPokemon.newWithSize("", - list.width, title.height, Graphics.width / 2, Graphics.height - title.height, viewport) + desc = Window_UnformattedTextPokemon.newWithSize( + "", list.width, title.height, Graphics.width / 2, Graphics.height - title.height, viewport + ) desc.z = 2 selectedmap = -1 retval = nil @@ -1614,7 +1617,7 @@ def pbPropertyList(title, data, properties, saveprompt = false) end if selectedmap == -1 && saveprompt cmd = pbMessage(_INTL("Save changes?"), - [_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3) + [_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3) if cmd == 2 selectedmap = list.index else diff --git a/Data/Scripts/020_Debug/003_Debug menus/001_Debug_Menus.rb b/Data/Scripts/020_Debug/003_Debug menus/001_Debug_Menus.rb index 37d9c6a1b..219f8e6bf 100644 --- a/Data/Scripts/020_Debug/003_Debug menus/001_Debug_Menus.rb +++ b/Data/Scripts/020_Debug/003_Debug menus/001_Debug_Menus.rb @@ -270,7 +270,7 @@ module Battle::DebugMixin help_text += _INTL("Form: {1}", battler.form) help_text += "\r\n" help_text += _INTL("Level {1}, {2}", battler.level, - (battler.pokemon.male?) ? "♂" : (battler.pokemon.female?) ? "♀" : "genderless") + (battler.pokemon.male?) ? "♂" : (battler.pokemon.female?) ? "♀" : "genderless") help_text += ", " + _INTL("Shiny") if battler.pokemon.shiny? help_text += "\r\n" help_text += _INTL("HP: {1}/{2} ({3}%)", battler.hp, battler.totalhp, (100.0 * battler.hp / battler.totalhp).to_i) diff --git a/Data/Scripts/020_Debug/003_Debug menus/002_Debug_MenuCommands.rb b/Data/Scripts/020_Debug/003_Debug menus/002_Debug_MenuCommands.rb index 325409138..b33ee04bc 100644 --- a/Data/Scripts/020_Debug/003_Debug menus/002_Debug_MenuCommands.rb +++ b/Data/Scripts/020_Debug/003_Debug menus/002_Debug_MenuCommands.rb @@ -211,7 +211,7 @@ DebugMenuCommands.register("testwildbattle", { params.setInitialValue(5) params.setCancelValue(0) level = pbMessageChooseNumber(_INTL("Set the wild {1}'s level.", - GameData::Species.get(species).name), params) + GameData::Species.get(species).name), params) if level > 0 $game_temp.encounter_type = nil pbWildBattle(species, level) @@ -257,7 +257,8 @@ DebugMenuCommands.register("testwildbattleadvanced", { params.setInitialValue(size0) params.setCancelValue(0) newSize = pbMessageChooseNumber( - _INTL("Choose the number of battlers on the player's side (max. {1}).", maxVal), params) + _INTL("Choose the number of battlers on the player's side (max. {1}).", maxVal), params + ) size0 = newSize if newSize > 0 elsif pkmnCmd == pkmnCmds.length - 3 # Add Pokémon species = pbChooseSpeciesList @@ -267,7 +268,7 @@ DebugMenuCommands.register("testwildbattleadvanced", { params.setInitialValue(5) params.setCancelValue(0) level = pbMessageChooseNumber(_INTL("Set the wild {1}'s level.", - GameData::Species.get(species).name), params) + GameData::Species.get(species).name), params) pkmn.push(Pokemon.new(species, level)) if level > 0 end else # Edit a Pokémon @@ -324,8 +325,9 @@ DebugMenuCommands.register("testtrainerbattleadvanced", { next elsif size1 > trainers.length && trainers[0][1].party_count == 1 pbMessage( - _INTL("Opposing side size cannot be {1}, as that requires the first trainer to have 2 or more Pokémon, which they don't.", - size1)) + _INTL("Opposing side size cannot be {1}, as that requires the first trainer to have 2 or more Pokémon, which they don't.", + size1) + ) next end setBattleRule(sprintf("%dv%d", size0, size1)) @@ -347,7 +349,8 @@ DebugMenuCommands.register("testtrainerbattleadvanced", { params.setInitialValue(size1) params.setCancelValue(0) newSize = pbMessageChooseNumber( - _INTL("Choose the number of battlers on the opponent's side (max. {1}).", maxVal), params) + _INTL("Choose the number of battlers on the opponent's side (max. {1}).", maxVal), params + ) size1 = newSize if newSize > 0 elsif trainerCmd == trainerCmds.length - 3 # Set player side size if !pbCanDoubleBattle? @@ -360,7 +363,8 @@ DebugMenuCommands.register("testtrainerbattleadvanced", { params.setInitialValue(size0) params.setCancelValue(0) newSize = pbMessageChooseNumber( - _INTL("Choose the number of battlers on the player's side (max. {1}).", maxVal), params) + _INTL("Choose the number of battlers on the player's side (max. {1}).", maxVal), params + ) size0 = newSize if newSize > 0 elsif trainerCmd == trainerCmds.length - 4 # Add trainer trainerdata = pbListScreen(_INTL("CHOOSE A TRAINER"), TrainerBattleLister.new(0, false)) @@ -371,7 +375,7 @@ DebugMenuCommands.register("testtrainerbattleadvanced", { else # Edit a trainer if pbConfirmMessage(_INTL("Change this trainer?")) trainerdata = pbListScreen(_INTL("CHOOSE A TRAINER"), - TrainerBattleLister.new(trainers[trainerCmd][0], false)) + TrainerBattleLister.new(trainers[trainerCmd][0], false)) if trainerdata tr = pbLoadTrainer(trainerdata[0], trainerdata[1], trainerdata[2]) trainers[trainerCmd] = [0, tr] @@ -480,7 +484,7 @@ DebugMenuCommands.register("additem", { params.setInitialValue(1) params.setCancelValue(0) qty = pbMessageChooseNumber(_INTL("Add how many {1}?", - GameData::Item.get(item).name_plural), params) + GameData::Item.get(item).name_plural), params) if qty > 0 $bag.add(item, qty) pbMessage(_INTL("Gave {1}x {2}.", qty, GameData::Item.get(item).name)) @@ -660,7 +664,7 @@ DebugMenuCommands.register("fillboxes", { pbMessage(_INTL("Storage boxes were filled with one Pokémon of each species.")) if !completed pbMessage(_INTL("Note: The number of storage spaces ({1} boxes of {2}) is less than the number of species.", - Settings::NUM_STORAGE_BOXES, box_qty)) + Settings::NUM_STORAGE_BOXES, box_qty)) end } }) diff --git a/Data/Scripts/020_Debug/003_Debug menus/003_Debug_MenuExtraCode.rb b/Data/Scripts/020_Debug/003_Debug menus/003_Debug_MenuExtraCode.rb index 4c7b06c7a..6b6e36b0c 100644 --- a/Data/Scripts/020_Debug/003_Debug menus/003_Debug_MenuExtraCode.rb +++ b/Data/Scripts/020_Debug/003_Debug menus/003_Debug_MenuExtraCode.rb @@ -139,7 +139,7 @@ def pbDebugVariableScreen(id) $game_map.need_refresh = true elsif $game_variables[id].is_a?(String) value = pbMessageFreeText(_INTL("Set variable {1}.", id), - $game_variables[id], false, 250, Graphics.width) + $game_variables[id], false, 250, Graphics.width) $game_variables[id] = value $game_map.need_refresh = true end diff --git a/Data/Scripts/020_Debug/003_Debug menus/005_Debug_PokemonCommands.rb b/Data/Scripts/020_Debug/003_Debug menus/005_Debug_PokemonCommands.rb index 415fa77bf..0c4905f7f 100644 --- a/Data/Scripts/020_Debug/003_Debug menus/005_Debug_PokemonCommands.rb +++ b/Data/Scripts/020_Debug/003_Debug menus/005_Debug_PokemonCommands.rb @@ -58,7 +58,8 @@ PokemonDebugMenuCommands.register("sethp", { params.setRange(0, pkmn.totalhp) params.setDefaultValue(pkmn.hp) newhp = pbMessageChooseNumber( - _INTL("Set {1}'s HP (max. {2}).", pkmn.name, pkmn.totalhp), params) { screen.pbUpdate } + _INTL("Set {1}'s HP (max. {2}).", pkmn.name, pkmn.totalhp), params + ) { screen.pbUpdate } if newhp != pkmn.hp pkmn.hp = newhp screen.pbRefreshSingle(pkmnid) @@ -90,7 +91,7 @@ PokemonDebugMenuCommands.register("setstatus", { msg = _INTL("Current status: {1}", GameData::Status.get(pkmn.status).name) if pkmn.status == :SLEEP msg = _INTL("Current status: {1} (turns: {2})", - GameData::Status.get(pkmn.status).name, pkmn.statusCount) + GameData::Status.get(pkmn.status).name, pkmn.statusCount) end cmd = screen.pbShowCommands(msg, commands, cmd) break if cmd < 0 @@ -106,7 +107,8 @@ PokemonDebugMenuCommands.register("setstatus", { params.setRange(0, 9) params.setDefaultValue(3) count = pbMessageChooseNumber( - _INTL("Set the Pokémon's sleep count."), params) { screen.pbUpdate } + _INTL("Set the Pokémon's sleep count."), params + ) { screen.pbUpdate } cancel = true if count <= 0 end if !cancel @@ -164,9 +166,9 @@ PokemonDebugMenuCommands.register("setpokerus", { _INTL("Has strain {1}, infectious for {2} more days.", pokerus / 16, pokerus % 16), _INTL("Has strain {1}, not infectious.", pokerus / 16)][pkmn.pokerusStage] cmd = screen.pbShowCommands(msg, - [_INTL("Give random strain"), - _INTL("Make not infectious"), - _INTL("Clear Pokérus")], cmd) + [_INTL("Give random strain"), + _INTL("Make not infectious"), + _INTL("Clear Pokérus")], cmd) break if cmd < 0 case cmd when 0 # Give random strain @@ -209,7 +211,8 @@ PokemonDebugMenuCommands.register("setlevel", { params.setRange(1, GameData::GrowthRate.max_level) params.setDefaultValue(pkmn.level) level = pbMessageChooseNumber( - _INTL("Set the Pokémon's level (max. {1}).", params.maxNumber), params) { screen.pbUpdate } + _INTL("Set the Pokémon's level (max. {1}).", params.maxNumber), params + ) { screen.pbUpdate } if level != pkmn.level pkmn.level = level pkmn.calc_stats @@ -237,7 +240,8 @@ PokemonDebugMenuCommands.register("setexp", { params.setRange(minxp, maxxp - 1) params.setDefaultValue(pkmn.exp) newexp = pbMessageChooseNumber( - _INTL("Set the Pokémon's Exp (range {1}-{2}).", minxp, maxxp - 1), params) { screen.pbUpdate } + _INTL("Set the Pokémon's Exp (range {1}-{2}).", minxp, maxxp - 1), params + ) { screen.pbUpdate } if newexp != pkmn.exp pkmn.exp = newexp pkmn.calc_stats @@ -258,9 +262,9 @@ PokemonDebugMenuCommands.register("hiddenvalues", { loop do persid = sprintf("0x%08X", pkmn.personalID) cmd = screen.pbShowCommands(_INTL("Personal ID is {1}.", persid), - [_INTL("Set EVs"), - _INTL("Set IVs"), - _INTL("Randomise pID")], cmd) + [_INTL("Set EVs"), + _INTL("Set IVs"), + _INTL("Randomise pID")], cmd) break if cmd < 0 case cmd when 0 # Set EVs @@ -277,8 +281,8 @@ PokemonDebugMenuCommands.register("hiddenvalues", { evcommands.push(_INTL("Randomise all")) evcommands.push(_INTL("Max randomise all")) cmd2 = screen.pbShowCommands(_INTL("Change which EV?\nTotal: {1}/{2} ({3}%)", - totalev, Pokemon::EV_LIMIT, - 100 * totalev / Pokemon::EV_LIMIT), evcommands, cmd2) + totalev, Pokemon::EV_LIMIT, + 100 * totalev / Pokemon::EV_LIMIT), evcommands, cmd2) break if cmd2 < 0 if cmd2 < ev_id.length params = ChooseNumberParams.new @@ -291,7 +295,7 @@ PokemonDebugMenuCommands.register("hiddenvalues", { params.setDefaultValue(thisValue) params.setCancelValue(thisValue) f = pbMessageChooseNumber(_INTL("Set the EV for {1} (max. {2}).", - GameData::Stat.get(ev_id[cmd2]).name, upperLimit), params) { screen.pbUpdate } + GameData::Stat.get(ev_id[cmd2]).name, upperLimit), params) { screen.pbUpdate } if f != pkmn.ev[ev_id[cmd2]] pkmn.ev[ev_id[cmd2]] = f pkmn.calc_stats @@ -330,8 +334,8 @@ PokemonDebugMenuCommands.register("hiddenvalues", { totaliv += pkmn.iv[s.id] end msg = _INTL("Change which IV?\nHidden Power:\n{1}, power {2}\nTotal: {3}/{4} ({5}%)", - GameData::Type.get(hiddenpower[0]).name, hiddenpower[1], totaliv, - iv_id.length * Pokemon::IV_STAT_LIMIT, 100 * totaliv / (iv_id.length * Pokemon::IV_STAT_LIMIT)) + GameData::Type.get(hiddenpower[0]).name, hiddenpower[1], totaliv, + iv_id.length * Pokemon::IV_STAT_LIMIT, 100 * totaliv / (iv_id.length * Pokemon::IV_STAT_LIMIT)) ivcommands.push(_INTL("Randomise all")) cmd2 = screen.pbShowCommands(msg, ivcommands, cmd2) break if cmd2 < 0 @@ -341,7 +345,7 @@ PokemonDebugMenuCommands.register("hiddenvalues", { params.setDefaultValue(pkmn.iv[iv_id[cmd2]]) params.setCancelValue(pkmn.iv[iv_id[cmd2]]) f = pbMessageChooseNumber(_INTL("Set the IV for {1} (max. 31).", - GameData::Stat.get(iv_id[cmd2]).name), params) { screen.pbUpdate } + GameData::Stat.get(iv_id[cmd2]).name), params) { screen.pbUpdate } if f != pkmn.iv[iv_id[cmd2]] pkmn.iv[iv_id[cmd2]] = f pkmn.calc_stats @@ -372,7 +376,8 @@ PokemonDebugMenuCommands.register("sethappiness", { params.setRange(0, 255) params.setDefaultValue(pkmn.happiness) h = pbMessageChooseNumber( - _INTL("Set the Pokémon's happiness (max. 255)."), params) { screen.pbUpdate } + _INTL("Set the Pokémon's happiness (max. 255)."), params + ) { screen.pbUpdate } if h != pkmn.happiness pkmn.happiness = h screen.pbRefreshSingle(pkmnid) @@ -396,7 +401,8 @@ PokemonDebugMenuCommands.register("setbeauty", { params.setRange(0, 255) params.setDefaultValue(pkmn.beauty) newval = pbMessageChooseNumber( - _INTL("Set the Pokémon's Beauty (max. 255)."), params) { screen.pbUpdate } + _INTL("Set the Pokémon's Beauty (max. 255)."), params + ) { screen.pbUpdate } if newval != pkmn.beauty pkmn.beauty = newval screen.pbRefreshSingle(pkmnid) @@ -414,7 +420,8 @@ PokemonDebugMenuCommands.register("setcool", { params.setRange(0, 255) params.setDefaultValue(pkmn.cool) newval = pbMessageChooseNumber( - _INTL("Set the Pokémon's Cool (max. 255)."), params) { screen.pbUpdate } + _INTL("Set the Pokémon's Cool (max. 255)."), params + ) { screen.pbUpdate } if newval != pkmn.cool pkmn.cool = newval screen.pbRefreshSingle(pkmnid) @@ -432,7 +439,8 @@ PokemonDebugMenuCommands.register("setcute", { params.setRange(0, 255) params.setDefaultValue(pkmn.cute) newval = pbMessageChooseNumber( - _INTL("Set the Pokémon's Cute (max. 255)."), params) { screen.pbUpdate } + _INTL("Set the Pokémon's Cute (max. 255)."), params + ) { screen.pbUpdate } if newval != pkmn.cute pkmn.cute = newval screen.pbRefreshSingle(pkmnid) @@ -450,7 +458,8 @@ PokemonDebugMenuCommands.register("setsmart", { params.setRange(0, 255) params.setDefaultValue(pkmn.smart) newval = pbMessageChooseNumber( - _INTL("Set the Pokémon's Smart (max. 255)."), params) { screen.pbUpdate } + _INTL("Set the Pokémon's Smart (max. 255)."), params + ) { screen.pbUpdate } if newval != pkmn.smart pkmn.smart = newval screen.pbRefreshSingle(pkmnid) @@ -468,7 +477,8 @@ PokemonDebugMenuCommands.register("settough", { params.setRange(0, 255) params.setDefaultValue(pkmn.tough) newval = pbMessageChooseNumber( - _INTL("Set the Pokémon's Tough (max. 255)."), params) { screen.pbUpdate } + _INTL("Set the Pokémon's Tough (max. 255)."), params + ) { screen.pbUpdate } if newval != pkmn.tough pkmn.tough = newval screen.pbRefreshSingle(pkmnid) @@ -486,7 +496,8 @@ PokemonDebugMenuCommands.register("setsheen", { params.setRange(0, 255) params.setDefaultValue(pkmn.sheen) newval = pbMessageChooseNumber( - _INTL("Set the Pokémon's Sheen (max. 255)."), params) { screen.pbUpdate } + _INTL("Set the Pokémon's Sheen (max. 255)."), params + ) { screen.pbUpdate } if newval != pkmn.sheen pkmn.sheen = newval screen.pbRefreshSingle(pkmnid) @@ -575,9 +586,9 @@ PokemonDebugMenuCommands.register("setmovepp", { loop do msg = _INTL("{1}: PP {2}/{3} (PP Up {4}/3)", movename, move.pp, move.total_pp, move.ppup) cmd2 = screen.pbShowCommands(msg, - [_INTL("Set PP"), - _INTL("Full PP"), - _INTL("Set PP Up")], cmd2) + [_INTL("Set PP"), + _INTL("Full PP"), + _INTL("Set PP Up")], cmd2) break if cmd2 < 0 case cmd2 when 0 # Change PP @@ -585,7 +596,8 @@ PokemonDebugMenuCommands.register("setmovepp", { params.setRange(0, move.total_pp) params.setDefaultValue(move.pp) h = pbMessageChooseNumber( - _INTL("Set PP of {1} (max. {2}).", movename, move.total_pp), params) { screen.pbUpdate } + _INTL("Set PP of {1} (max. {2}).", movename, move.total_pp), params + ) { screen.pbUpdate } move.pp = h when 1 # Full PP move.pp = move.total_pp @@ -594,7 +606,8 @@ PokemonDebugMenuCommands.register("setmovepp", { params.setRange(0, 3) params.setDefaultValue(move.ppup) h = pbMessageChooseNumber( - _INTL("Set PP Up of {1} (max. 3).", movename), params) { screen.pbUpdate } + _INTL("Set PP Up of {1} (max. 3).", movename), params + ) { screen.pbUpdate } move.ppup = h move.pp = move.total_pp if move.pp > move.total_pp end @@ -765,9 +778,9 @@ PokemonDebugMenuCommands.register("setgender", { loop do msg = [_INTL("Gender is male."), _INTL("Gender is female.")][pkmn.male? ? 0 : 1] cmd = screen.pbShowCommands(msg, - [_INTL("Make male"), - _INTL("Make female"), - _INTL("Reset")], cmd) + [_INTL("Make male"), + _INTL("Make female"), + _INTL("Reset")], cmd) break if cmd < 0 case cmd when 0 # Make male @@ -801,9 +814,9 @@ PokemonDebugMenuCommands.register("speciesform", { msg = [_INTL("Species {1}, form {2}.", pkmn.speciesName, pkmn.form), _INTL("Species {1}, form {2} (forced).", pkmn.speciesName, pkmn.form)][(pkmn.forced_form.nil?) ? 0 : 1] cmd = screen.pbShowCommands(msg, - [_INTL("Set species"), - _INTL("Set form"), - _INTL("Remove form override")], cmd) + [_INTL("Set species"), + _INTL("Set form"), + _INTL("Remove form override")], cmd) break if cmd < 0 case cmd when 0 # Set species @@ -869,11 +882,8 @@ PokemonDebugMenuCommands.register("setshininess", { loop do msg_idx = pkmn.shiny? ? (pkmn.super_shiny? ? 1 : 0) : 2 msg = [_INTL("Is shiny."), _INTL("Is super shiny."), _INTL("Is normal (not shiny).")][msg_idx] - cmd = screen.pbShowCommands(msg, - [_INTL("Make shiny"), - _INTL("Make super shiny"), - _INTL("Make normal"), - _INTL("Reset")], cmd) + cmd = screen.pbShowCommands(msg, [_INTL("Make shiny"), _INTL("Make super shiny"), + _INTL("Make normal"), _INTL("Reset")], cmd) break if cmd < 0 case cmd when 0 # Make shiny @@ -934,7 +944,7 @@ PokemonDebugMenuCommands.register("setribbons", { ids = [] GameData::Ribbon.each do |ribbon_data| commands.push(_INTL("{1} {2}", - (pkmn.hasRibbon?(ribbon_data.id)) ? "[Y]" : "[ ]", ribbon_data.name)) + (pkmn.hasRibbon?(ribbon_data.id)) ? "[Y]" : "[ ]", ribbon_data.name)) ids.push(ribbon_data.id) end commands.push(_INTL("Give all")) @@ -1000,11 +1010,11 @@ PokemonDebugMenuCommands.register("ownership", { _INTL("Foreign Pokémon\n{1}\n{2}\n{3} ({4})", pkmn.owner.name, gender, pkmn.owner.public_id, pkmn.owner.id)][pkmn.foreign?($player) ? 1 : 0] cmd = screen.pbShowCommands(msg, - [_INTL("Make player's"), - _INTL("Set OT's name"), - _INTL("Set OT's gender"), - _INTL("Random foreign ID"), - _INTL("Set foreign ID")], cmd) + [_INTL("Make player's"), + _INTL("Set OT's name"), + _INTL("Set OT's gender"), + _INTL("Random foreign ID"), + _INTL("Set foreign ID")], cmd) break if cmd < 0 case cmd when 0 # Make player's @@ -1013,7 +1023,7 @@ PokemonDebugMenuCommands.register("ownership", { pkmn.owner.name = pbEnterPlayerName(_INTL("{1}'s OT's name?", pkmn.name), 1, Settings::MAX_PLAYER_NAME_SIZE) when 2 # Set OT's gender cmd2 = screen.pbShowCommands(_INTL("Set OT's gender."), - [_INTL("Male"), _INTL("Female"), _INTL("Unknown")], pkmn.owner.gender) + [_INTL("Male"), _INTL("Female"), _INTL("Unknown")], pkmn.owner.gender) pkmn.owner.gender = cmd2 if cmd2 >= 0 when 3 # Random foreign ID pkmn.owner.id = $player.make_foreign_ID @@ -1022,7 +1032,8 @@ PokemonDebugMenuCommands.register("ownership", { params.setRange(0, 65535) params.setDefaultValue(pkmn.owner.public_id) val = pbMessageChooseNumber( - _INTL("Set the new ID (max. 65535)."), params) { screen.pbUpdate } + _INTL("Set the new ID (max. 65535)."), params + ) { screen.pbUpdate } pkmn.owner.id = val | val << 16 end end @@ -1073,9 +1084,9 @@ PokemonDebugMenuCommands.register("setegg", { msg = [_INTL("Not an egg"), _INTL("Egg (hatches in {1} steps).", pkmn.steps_to_hatch)][pkmn.egg? ? 1 : 0] cmd = screen.pbShowCommands(msg, - [_INTL("Make egg"), - _INTL("Make Pokémon"), - _INTL("Set steps left to 1")], cmd) + [_INTL("Make egg"), + _INTL("Make Pokémon"), + _INTL("Set steps left to 1")], cmd) break if cmd < 0 case cmd when 0 # Make egg @@ -1131,8 +1142,9 @@ PokemonDebugMenuCommands.register("shadowpkmn", { params.setRange(0, pkmn.max_gauge_size) params.setDefaultValue(pkmn.heart_gauge) val = pbMessageChooseNumber( - _INTL("Set the heart gauge (max. {1}).", pkmn.max_gauge_size), - params) { screen.pbUpdate } + _INTL("Set the heart gauge (max. {1}).", pkmn.max_gauge_size), + params + ) { screen.pbUpdate } if val != oldheart pkmn.adjustHeart(val - oldheart) pkmn.check_ready_to_purify diff --git a/Data/Scripts/020_Debug/003_Debug menus/007_Debug_BattleCommands.rb b/Data/Scripts/020_Debug/003_Debug menus/007_Debug_BattleCommands.rb index 9ca5ae563..d8715e086 100644 --- a/Data/Scripts/020_Debug/003_Debug menus/007_Debug_BattleCommands.rb +++ b/Data/Scripts/020_Debug/003_Debug menus/007_Debug_BattleCommands.rb @@ -162,7 +162,8 @@ BattleDebugMenuCommands.register("weather", { when 0 # Change type weather_cmd = weather_types.index(battle.field.weather) || 0 new_weather = pbMessage( - "\\ts[]" + _INTL("Choose the new weather type."), weather_cmds, -1, nil, weather_cmd) + "\\ts[]" + _INTL("Choose the new weather type."), weather_cmds, -1, nil, weather_cmd + ) if new_weather >= 0 battle.field.weather = weather_types[new_weather] battle.field.weatherDuration = 5 if battle.field.weatherDuration == 0 @@ -177,7 +178,8 @@ BattleDebugMenuCommands.register("weather", { params.setInitialValue([battle.field.weatherDuration, 0].max) params.setCancelValue([battle.field.weatherDuration, 0].max) new_duration = pbMessageChooseNumber( - "\\ts[]" + _INTL("Choose the new weather duration (0=infinite)."), params) + "\\ts[]" + _INTL("Choose the new weather duration (0=infinite)."), params + ) if new_duration != [battle.field.weatherDuration, 0].max battle.field.weatherDuration = (new_duration == 0) ? -1 : new_duration end @@ -223,7 +225,8 @@ BattleDebugMenuCommands.register("terrain", { when 0 # Change type terrain_cmd = terrain_types.index(battle.field.terrain) || 0 new_terrain = pbMessage( - "\\ts[]" + _INTL("Choose the new terrain type."), terrain_cmds, -1, nil, terrain_cmd) + "\\ts[]" + _INTL("Choose the new terrain type."), terrain_cmds, -1, nil, terrain_cmd + ) if new_terrain >= 0 battle.field.terrain = terrain_types[new_terrain] battle.field.terrainDuration = 5 if battle.field.terrainDuration == 0 @@ -238,7 +241,8 @@ BattleDebugMenuCommands.register("terrain", { params.setInitialValue([battle.field.terrainDuration, 0].max) params.setCancelValue([battle.field.terrainDuration, 0].max) new_duration = pbMessageChooseNumber( - "\\ts[]" + _INTL("Choose the new terrain duration (0=infinite)."), params) + "\\ts[]" + _INTL("Choose the new terrain duration (0=infinite)."), params + ) if new_duration != [battle.field.terrainDuration, 0].max battle.field.terrainDuration = (new_duration == 0) ? -1 : new_duration end @@ -275,13 +279,14 @@ BattleDebugMenuCommands.register("environment", { when 0 # Change environment environment_cmd = environment_types.index(battle.environment) || 0 new_environment = pbMessage( - "\\ts[]" + _INTL("Choose the new environment."), environment_cmds, -1, nil, environment_cmd) + "\\ts[]" + _INTL("Choose the new environment."), environment_cmds, -1, nil, environment_cmd + ) if new_environment >= 0 battle.environment = environment_types[new_environment] end when 1 # Change time of day new_time = pbMessage("\\ts[]" + _INTL("Choose the new time."), - [_INTL("Day"), _INTL("Evening"), _INTL("Night")], -1, nil, battle.time) + [_INTL("Day"), _INTL("Evening"), _INTL("Night")], -1, nil, battle.time) battle.time = new_time if new_time >= 0 && new_time != battle.time end end @@ -358,7 +363,7 @@ BattleDebugMenuCommands.register("mega_evolution", { end end cmd = pbMessage("\\ts[]" + _INTL("Choose trainer to toggle whether they can Mega Evolve."), - commands, -1, nil, cmd) + commands, -1, nil, cmd) break if cmd < 0 real_cmd = cmds[cmd] if battle.megaEvolution[real_cmd[0]][real_cmd[1]] == -1 @@ -384,6 +389,6 @@ BattleDebugMenuCommands.register("speed_order", { commands.push(sprintf("[%d] %s (speed: %d)", b.index, b.pbThis, value[1])) end pbMessage("\\ts[]" + _INTL("Battlers are listed from fastest to slowest. Speeds include modifiers."), - commands, -1) + commands, -1) } }) diff --git a/Data/Scripts/020_Debug/003_Debug menus/008_Debug_BattlerCommands.rb b/Data/Scripts/020_Debug/003_Debug menus/008_Debug_BattlerCommands.rb index 8f375f81b..df9c9b17e 100644 --- a/Data/Scripts/020_Debug/003_Debug menus/008_Debug_BattlerCommands.rb +++ b/Data/Scripts/020_Debug/003_Debug menus/008_Debug_BattlerCommands.rb @@ -72,7 +72,8 @@ BattlerDebugMenuCommands.register("sethp", { params.setRange(1, battler.totalhp) params.setDefaultValue(battler.hp) new_hp = pbMessageChooseNumber( - "\\ts[]" + _INTL("Set {1}'s HP (1-{2}).", battler.pbThis(true), battler.totalhp), params) + "\\ts[]" + _INTL("Set {1}'s HP (1-{2}).", battler.pbThis(true), battler.totalhp), params + ) battler.hp = new_hp if new_hp != battler.hp } }) @@ -126,7 +127,8 @@ BattlerDebugMenuCommands.register("setstatus", { params.setDefaultValue(0) params.setCancelValue(-1) count = pbMessageChooseNumber( - "\\ts[]" + _INTL("Set {1}'s toxic count (0-15).", battler.pbThis(true)), params) + "\\ts[]" + _INTL("Set {1}'s toxic count (0-15).", battler.pbThis(true)), params + ) next if count < 0 battler.statusCount = 1 battler.effects[PBEffects::Toxic] = count @@ -192,7 +194,8 @@ BattlerDebugMenuCommands.register("setstatstages", { params.setNegativesAllowed(true) params.setDefaultValue(battler.stages[stat_ids[cmd]]) value = pbMessageChooseNumber( - "\\ts[]" + _INTL("Set the stage for {1}.", GameData::Stat.get(stat_ids[cmd]).name), params) + "\\ts[]" + _INTL("Set the stage for {1}.", GameData::Stat.get(stat_ids[cmd]).name), params + ) battler.stages[stat_ids[cmd]] = value else # Reset all stats GameData::Stat.each_battle { |stat| battler.stages[stat.id] = 0 } @@ -214,7 +217,8 @@ BattlerDebugMenuCommands.register("setlevel", { params.setRange(1, GameData::GrowthRate.max_level) params.setDefaultValue(pkmn.level) level = pbMessageChooseNumber( - "\\ts[]" + _INTL("Set the Pokémon's level (max. {1}).", params.maxNumber), params) + "\\ts[]" + _INTL("Set the Pokémon's level (max. {1}).", params.maxNumber), params + ) if level != pkmn.level pkmn.level = level pkmn.calc_stats @@ -242,7 +246,8 @@ BattlerDebugMenuCommands.register("setexp", { params.setRange(min_exp, max_exp - 1) params.setDefaultValue(pkmn.exp) new_exp = pbMessageChooseNumber( - "\\ts[]" + _INTL("Set the Pokémon's Exp (range {1}-{2}).", min_exp, max_exp - 1), params) + "\\ts[]" + _INTL("Set the Pokémon's Exp (range {1}-{2}).", min_exp, max_exp - 1), params + ) pkmn.exp = new_exp if new_exp != pkmn.exp } }) @@ -273,7 +278,7 @@ BattlerDebugMenuCommands.register("hiddenvalues", { ev_commands.push(_INTL("Randomise all")) ev_commands.push(_INTL("Max randomise all")) cmd2 = pbMessage("\\ts[]" + _INTL("Change which EV?\nTotal: {1}/{2} ({3}%)", - total_evs, Pokemon::EV_LIMIT, 100 * total_evs / Pokemon::EV_LIMIT), + total_evs, Pokemon::EV_LIMIT, 100 * total_evs / Pokemon::EV_LIMIT), ev_commands, -1, nil, cmd2) break if cmd2 < 0 if cmd2 < ev_id.length @@ -287,7 +292,7 @@ BattlerDebugMenuCommands.register("hiddenvalues", { params.setDefaultValue(thisValue) params.setCancelValue(thisValue) f = pbMessageChooseNumber("\\ts[]" + _INTL("Set the EV for {1} (max. {2}).", - GameData::Stat.get(ev_id[cmd2]).name, upperLimit), params) + GameData::Stat.get(ev_id[cmd2]).name, upperLimit), params) if f != pkmn.ev[ev_id[cmd2]] pkmn.ev[ev_id[cmd2]] = f pkmn.calc_stats @@ -326,8 +331,8 @@ BattlerDebugMenuCommands.register("hiddenvalues", { totaliv += pkmn.iv[s.id] end msg = _INTL("Change which IV?\nHidden Power:\n{1}, power {2}\nTotal: {3}/{4} ({5}%)", - GameData::Type.get(hiddenpower[0]).name, hiddenpower[1], totaliv, - iv_id.length * Pokemon::IV_STAT_LIMIT, 100 * totaliv / (iv_id.length * Pokemon::IV_STAT_LIMIT)) + GameData::Type.get(hiddenpower[0]).name, hiddenpower[1], totaliv, + iv_id.length * Pokemon::IV_STAT_LIMIT, 100 * totaliv / (iv_id.length * Pokemon::IV_STAT_LIMIT)) ivcommands.push(_INTL("Randomise all")) cmd2 = pbMessage("\\ts[]" + msg, ivcommands, -1, nil, cmd2) break if cmd2 < 0 @@ -337,7 +342,7 @@ BattlerDebugMenuCommands.register("hiddenvalues", { params.setDefaultValue(pkmn.iv[iv_id[cmd2]]) params.setCancelValue(pkmn.iv[iv_id[cmd2]]) f = pbMessageChooseNumber("\\ts[]" + _INTL("Set the IV for {1} (max. 31).", - GameData::Stat.get(iv_id[cmd2]).name), params) + GameData::Stat.get(iv_id[cmd2]).name), params) if f != pkmn.iv[iv_id[cmd2]] pkmn.iv[iv_id[cmd2]] = f pkmn.calc_stats @@ -434,7 +439,7 @@ BattlerDebugMenuCommands.register("teachmove", { "effect" => proc { |battler, pkmn, battle| if pkmn.numMoves >= Pokemon::MAX_MOVES pbMessage("\\ts[]" + _INTL("{1} already knows {2} moves. It needs to forget one first.", - pkmn.name, pkmn.numMoves)) + pkmn.name, pkmn.numMoves)) next end new_move = pbChooseMoveList @@ -514,7 +519,8 @@ BattlerDebugMenuCommands.register("setmovepp", { params.setRange(0, move.total_pp) params.setDefaultValue(move.pp) h = pbMessageChooseNumber( - "\\ts[]" + _INTL("Set PP of {1} (max. {2}).", move_name, move.total_pp), params) + "\\ts[]" + _INTL("Set PP of {1} (max. {2}).", move_name, move.total_pp), params + ) move.pp = h if battler && battler.moves[move_indices[cmd]].id == move.id battler.moves[move_indices[cmd]].pp = move.pp @@ -529,7 +535,8 @@ BattlerDebugMenuCommands.register("setmovepp", { params.setRange(0, 3) params.setDefaultValue(move.ppup) h = pbMessageChooseNumber( - "\\ts[]" + _INTL("Set PP Up of {1} (max. 3).", move_name), params) + "\\ts[]" + _INTL("Set PP Up of {1} (max. 3).", move_name), params + ) move.ppup = h move.pp = move.total_pp if move.pp > move.total_pp if battler && battler.moves[move_indices[cmd]].id == move.id @@ -599,7 +606,7 @@ BattlerDebugMenuCommands.register("setability", { ] loop do msg = _INTL("Battler's ability is {1}. Pokémon's ability is {2}.", - battler.abilityName, pkmn.ability.name) + battler.abilityName, pkmn.ability.name) cmd = pbMessage("\\ts[]" + msg, commands, -1, nil, cmd) break if cmd < 0 case cmd diff --git a/Data/Scripts/020_Debug/003_Editor_Listers.rb b/Data/Scripts/020_Debug/003_Editor_Listers.rb index 43a55e1f3..c0232e9fb 100644 --- a/Data/Scripts/020_Debug/003_Editor_Listers.rb +++ b/Data/Scripts/020_Debug/003_Editor_Listers.rb @@ -16,8 +16,9 @@ def pbListScreen(title, lister) list = pbListWindow([]) list.viewport = viewport list.z = 2 - title = Window_UnformattedTextPokemon.newWithSize(title, - Graphics.width / 2, 0, Graphics.width / 2, 64, viewport) + title = Window_UnformattedTextPokemon.newWithSize( + title, Graphics.width / 2, 0, Graphics.width / 2, 64, viewport + ) title.z = 2 lister.setViewport(viewport) selectedmap = -1 @@ -63,8 +64,9 @@ def pbListScreenBlock(title, lister) list = pbListWindow([], Graphics.width / 2) list.viewport = viewport list.z = 2 - title = Window_UnformattedTextPokemon.newWithSize(title, - Graphics.width / 2, 0, Graphics.width / 2, 64, viewport) + title = Window_UnformattedTextPokemon.newWithSize( + title, Graphics.width / 2, 0, Graphics.width / 2, 64, viewport + ) title.z = 2 lister.setViewport(viewport) selectedmap = -1 @@ -552,8 +554,9 @@ class TrainerBattleLister def initialize(selection, includeNew) @sprite = IconSprite.new(Graphics.width * 3 / 4, (Graphics.height / 2) + 32) @sprite.z = 2 - @pkmnList = Window_UnformattedTextPokemon.newWithSize("", - Graphics.width / 2, Graphics.height - 64, Graphics.width / 2, 64) + @pkmnList = Window_UnformattedTextPokemon.newWithSize( + "", Graphics.width / 2, Graphics.height - 64, Graphics.width / 2, 64 + ) @pkmnList.z = 3 @selection = selection @commands = [] @@ -604,12 +607,12 @@ class TrainerBattleLister for t in cmds if t[3] > 0 @commands.push(_INTL("{1} {2} ({3}) x{4}", - GameData::TrainerType.get(t[1]).name, t[2], t[3], - GameData::Trainer.get(t[1], t[2], t[3]).pokemon.length)) + GameData::TrainerType.get(t[1]).name, t[2], t[3], + GameData::Trainer.get(t[1], t[2], t[3]).pokemon.length)) else @commands.push(_INTL("{1} {2} x{3}", - GameData::TrainerType.get(t[1]).name, t[2], - GameData::Trainer.get(t[1], t[2], t[3]).pokemon.length)) + GameData::TrainerType.get(t[1]).name, t[2], + GameData::Trainer.get(t[1], t[2], t[3]).pokemon.length)) end @ids.push([t[1], t[2], t[3]]) end diff --git a/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb b/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb index 49aced8e2..308ee6dba 100644 --- a/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb +++ b/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb @@ -349,10 +349,9 @@ module Compiler end # Parse move line = pbGetCsvRecord(line, line_no, - [0, "snssueeuuueiss", - nil, nil, nil, nil, nil, :Type, ["Physical", "Special", "Status"], - nil, nil, nil, :Target, nil, nil, nil] - ) + [0, "snssueeuuueiss", + nil, nil, nil, nil, nil, :Type, ["Physical", "Special", "Status"], + nil, nil, nil, :Target, nil, nil, nil]) move_id = line[1].to_sym if GameData::Move::DATA[move_id] raise _INTL("Move ID '{1}' is used twice.\r\n{2}", move_id, FileLineData.linereport) @@ -470,9 +469,8 @@ module Compiler GameData::Item.register(item_hash) if item_hash # Parse item line = pbGetCsvRecord(line, line_no, - [0, "snssvusuuUE", nil, nil, nil, - nil, nil, nil, nil, nil, nil, nil, :Move] - ) + [0, "snssvusuuUE", nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, :Move]) item_id = line[1].to_sym if GameData::Item.exists?(item_id) raise _INTL("Item ID '{1}' is used twice.\r\n{2}", item_id, FileLineData.linereport) @@ -1213,7 +1211,7 @@ module Compiler values = line.split(',').collect! { |v| v.strip } if !values || values.length < 3 raise _INTL("Expected a species entry line for encounter type {1} for map '{2}', got \"{3}\" instead.\r\n{4}", - GameData::EncounterType.get(current_type).real_name, encounter_hash[:map], line, FileLineData.linereport) + GameData::EncounterType.get(current_type).real_name, encounter_hash[:map], line, FileLineData.linereport) end values = pbGetCsvRecord(line, line_no, [0, "vevV", nil, :Species]) values[3] = values[2] if !values[3] @@ -1275,7 +1273,7 @@ module Compiler encounter_hash[:types][current_type] = [] else raise _INTL("Undefined encounter type \"{1}\" for map '{2}'.\r\n{3}", - line, encounter_hash[:map], FileLineData.linereport) + line, encounter_hash[:map], FileLineData.linereport) end end } @@ -1342,13 +1340,12 @@ module Compiler GameData::TrainerType.register(tr_type_hash) if tr_type_hash # Parse trainer type line = pbGetCsvRecord(line, line_no, - [0, "snsUSSSeUS", - nil, nil, nil, nil, nil, nil, nil, - { "Male" => 0, "M" => 0, "0" => 0, - "Female" => 1, "F" => 1, "1" => 1, - "Mixed" => 2, "X" => 2, "2" => 2, "" => 2 }, - nil, nil] - ) + [0, "snsUSSSeUS", + nil, nil, nil, nil, nil, nil, nil, + { "Male" => 0, "M" => 0, "0" => 0, + "Female" => 1, "F" => 1, "1" => 1, + "Mixed" => 2, "X" => 2, "2" => 2, "" => 2 }, + nil, nil]) tr_type_id = line[1].to_sym if GameData::TrainerType.exists?(tr_type_id) raise _INTL("Trainer Type ID '{1}' is used twice.\r\n{2}", tr_type_id, FileLineData.linereport) diff --git a/Data/Scripts/021_Compiler/003_Compiler_WritePBS.rb b/Data/Scripts/021_Compiler/003_Compiler_WritePBS.rb index d1f257b83..d8e7ac92f 100644 --- a/Data/Scripts/021_Compiler/003_Compiler_WritePBS.rb +++ b/Data/Scripts/021_Compiler/003_Compiler_WritePBS.rb @@ -28,8 +28,8 @@ module Compiler f.write(sprintf("[%d]\r\n", i)) rname = pbGetMessage(MessageTypes::RegionNames, i) f.write(sprintf("Name = %s\r\nFilename = %s\r\n", - (rname && rname != "") ? rname : _INTL("Unnamed"), - csvQuote((map[1].is_a?(Array)) ? map[1][0] : map[1]))) + (rname && rname != "") ? rname : _INTL("Unnamed"), + csvQuote((map[1].is_a?(Array)) ? map[1][0] : map[1]))) for loc in map[2] f.write("Point = ") pbWriteCsvRecord(loc, f, [nil, "uussUUUU"]) @@ -84,12 +84,12 @@ module Compiler # Skip if map no longer exists next if !mapinfos[conn[0]] || !mapinfos[conn[3]] f.write(sprintf("# %s (%d) - %s (%d)\r\n", - (mapinfos[conn[0]]) ? mapinfos[conn[0]].name : "???", conn[0], - (mapinfos[conn[3]]) ? mapinfos[conn[3]].name : "???", conn[3])) + (mapinfos[conn[0]]) ? mapinfos[conn[0]].name : "???", conn[0], + (mapinfos[conn[3]]) ? mapinfos[conn[3]].name : "???", conn[3])) end if conn[1].is_a?(String) || conn[4].is_a?(String) f.write(sprintf("%d,%s,%d,%d,%s,%d", conn[0], conn[1], conn[2], - conn[3], conn[4], conn[5])) + conn[3], conn[4], conn[5])) else ret = normalize_connection(conn) f.write(get_connection_text(ret[0], ret[1], ret[2], ret[3], ret[4], ret[5])) diff --git a/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb b/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb index 8f0b87764..545654b5e 100644 --- a/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb +++ b/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb @@ -119,7 +119,8 @@ module Compiler for i in 0...route.list.length list.push(RPG::EventCommand.new( (i == 0) ? 209 : 509, indent, - (i == 0) ? [character, route] : [route.list[i - 1]])) + (i == 0) ? [character, route] : [route.list[i - 1]] + )) end end @@ -582,8 +583,8 @@ module Compiler push_branch(firstpage.list, battleString) if battles.length > 1 # Has rematches push_script(firstpage.list, - sprintf("pbPhoneRegisterBattle(_I(\"%s\"),get_self,%s,%d)", - regspeech, safetrcombo, battles.length), 1) + sprintf("pbPhoneRegisterBattle(_I(\"%s\"),get_self,%s,%d)", + regspeech, safetrcombo, battles.length), 1) end push_self_switch(firstpage.list, "A", true, 1) push_branch_end(firstpage.list, 1) @@ -640,8 +641,8 @@ module Compiler push_text(lastpage.list, ebattle, 1) end push_script(lastpage.list, - sprintf("pbPhoneRegisterBattle(_I(\"%s\"),get_self,%s,%d)", - regspeech, safetrcombo, battles.length), 1) + sprintf("pbPhoneRegisterBattle(_I(\"%s\"),get_self,%s,%d)", + regspeech, safetrcombo, battles.length), 1) push_exit(lastpage.list, 1) # Exit Event Processing push_branch_end(lastpage.list, 1) end @@ -652,8 +653,8 @@ module Compiler push_text(lastpage.list, ebattle) if battles.length > 1 push_script(lastpage.list, - sprintf("pbPhoneRegisterBattle(_I(\"%s\"),get_self,%s,%d)", - regspeech, safetrcombo, battles.length)) + sprintf("pbPhoneRegisterBattle(_I(\"%s\"),get_self,%s,%d)", + regspeech, safetrcombo, battles.length)) end push_end(lastpage.list) # Add pages to the new event @@ -946,20 +947,20 @@ module Compiler list.delete_at(i) end list.insert(i, - RPG::EventCommand.new(314, list[i].indent, [0]) # Recover All - ) + RPG::EventCommand.new(314, list[i].indent, [0])) # Recover All changed = true when "pbFadeOutIn(99999){foriin$player.partyi.healend}" oldIndent = list[i].indent for j in i..lastScript list.delete_at(i) end - list.insert(i, - RPG::EventCommand.new(223, oldIndent, [Tone.new(-255, -255, -255), 6]), # Fade to black - RPG::EventCommand.new(106, oldIndent, [6]), # Wait - RPG::EventCommand.new(314, oldIndent, [0]), # Recover All - RPG::EventCommand.new(223, oldIndent, [Tone.new(0, 0, 0), 6]), # Fade to normal - RPG::EventCommand.new(106, oldIndent, [6]) # Wait + list.insert( + i, + RPG::EventCommand.new(223, oldIndent, [Tone.new(-255, -255, -255), 6]), # Fade to black + RPG::EventCommand.new(106, oldIndent, [6]), # Wait + RPG::EventCommand.new(314, oldIndent, [0]), # Recover All + RPG::EventCommand.new(223, oldIndent, [Tone.new(0, 0, 0), 6]), # Fade to normal + RPG::EventCommand.new(106, oldIndent, [6]) # Wait ) changed = true end @@ -1175,12 +1176,13 @@ module Compiler fullTransfer = list[i] indent = list[i].indent (list.length - 1).times { list.delete_at(0) } - list.insert(0, - RPG::EventCommand.new(250, indent, [RPG::AudioFile.new("Exit Door", 80, 100)]), # Play SE - RPG::EventCommand.new(223, indent, [Tone.new(-255, -255, -255), 6]), # Fade to black - RPG::EventCommand.new(106, indent, [8]), # Wait - fullTransfer, # Transfer event - RPG::EventCommand.new(223, indent, [Tone.new(0, 0, 0), 6]) # Fade to normal + list.insert( + 0, + RPG::EventCommand.new(250, indent, [RPG::AudioFile.new("Exit Door", 80, 100)]), # Play SE + RPG::EventCommand.new(223, indent, [Tone.new(-255, -255, -255), 6]), # Fade to black + RPG::EventCommand.new(106, indent, [8]), # Wait + fullTransfer, # Transfer event + RPG::EventCommand.new(223, indent, [Tone.new(0, 0, 0), 6]) # Fade to normal ) changed = true end @@ -1324,14 +1326,16 @@ module Compiler end if isempty if elseIndex >= 0 - list.insert(elseIndex + 1, - RPG::EventCommand.new(115, list[i].indent + 1, []) # Exit Event Processing + list.insert( + elseIndex + 1, + RPG::EventCommand.new(115, list[i].indent + 1, []) # Exit Event Processing ) else - list.insert(i + 1, - RPG::EventCommand.new(0, list[i].indent + 1, []), # Empty Event - RPG::EventCommand.new(411, list[i].indent, []), # Else - RPG::EventCommand.new(115, list[i].indent + 1, []) # Exit Event Processing + list.insert( + i + 1, + RPG::EventCommand.new(0, list[i].indent + 1, []), # Empty Event + RPG::EventCommand.new(411, list[i].indent, []), # Else + RPG::EventCommand.new(115, list[i].indent + 1, []) # Exit Event Processing ) end changed = true