From 2480ab0f9e9d4356baf112cc1832e579f224327a Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Sat, 18 Dec 2021 01:56:10 +0000 Subject: [PATCH] Applied most Rubocop-suggested layout fixes --- .../001_Debugging/001_PBDebug.rb | 10 +- .../001_Debugging/004_Validation.rb | 2 +- .../001_Technical/002_Files/001_FileTests.rb | 18 +- .../001_Technical/003_Intl_Messages.rb | 10 +- Data/Scripts/001_Technical/006_RPG_Sprite.rb | 4 +- .../004_Game classes/001_Game_Screen.rb | 1 + .../004_Game classes/003_Game_Picture.rb | 1 + Data/Scripts/004_Game classes/004_Game_Map.rb | 4 +- .../005_Game_Map_Autoscroll.rb | 8 +- .../004_Game classes/006_Game_MapFactory.rb | 2 +- .../012_Game_FollowerFactory.rb | 2 +- .../005_Sprites/006_Spriteset_Global.rb | 1 + Data/Scripts/005_Sprites/007_Spriteset_Map.rb | 1 + .../005_Sprites/009_Sprite_DynamicShadows.rb | 30 +-- .../Scripts/005_Sprites/010_ParticleEngine.rb | 30 +-- Data/Scripts/005_Sprites/012_Interpolators.rb | 21 +- .../006_Map renderer/004_TileDrawingHelper.rb | 28 +-- .../002_MessageConfig.rb | 14 +- .../007_Objects and windows/003_Window.rb | 31 ++- .../004_SpriteWindow.rb | 12 +- .../005_SpriteWindow_text.rb | 29 ++- .../007_Objects and windows/010_DrawText.rb | 54 ++-- .../001_Hardcoded data/001_GrowthRate.rb | 120 ++++----- .../Scripts/010_Data/002_PBS data/006_Item.rb | 8 +- .../002_PBS data/010_SpeciesMetrics.rb | 4 +- .../010_Data/002_PBS data/014_TrainerType.rb | 4 +- .../001_Battle/009_Battle_CommandPhase.rb | 4 +- .../002_Battler/005_Battler_StatStages.rb | 18 +- .../002_Battler/007_Battler_UseMove.rb | 10 +- .../011_Battle/003_Move/002_Move_Usage.rb | 2 +- .../003_Move/003_Move_UsageCalculations.rb | 3 +- .../008_MoveEffects_MoveAttributes.rb | 2 +- .../003_Move/009_MoveEffects_MultiHit.rb | 3 +- .../003_Move/011_MoveEffects_Items.rb | 36 +-- .../004_Scene/005_Battle_Scene_Menus.rb | 4 +- .../004_Scene/006_Battle_Scene_Objects.rb | 6 +- .../007_Battle_Scene_BaseAnimation.rb | 2 +- .../005_AI/005_AI_Move_EffectScores.rb | 34 +-- .../005_AI/006_AI_Move_Utilities.rb | 3 +- .../005_Battle_CatchAndStoreMixin.rb | 2 +- .../007_BattleAnimationPlayer.rb | 2 + .../008_Battle_AbilityEffects.rb | 2 +- .../003_BattlePalaceBattle.rb | 4 +- .../004_BattleArenaBattle.rb | 40 +-- .../001_Overworld_Weather.rb | 1 + .../002_Overworld_BattleIntroAnim.rb | 6 +- .../003_Overworld_WildEncounters.rb | 2 +- .../005_Overworld_RoamingPokemon.rb | 2 +- .../012_Overworld/003_Overworld_Time.rb | 9 +- .../012_Overworld/004_Overworld_FieldMoves.rb | 44 ++-- .../006_Overworld_BerryPlants.rb | 4 +- .../008_Overworld_RandomDungeons.rb | 28 ++- Data/Scripts/013_Items/007_Item_Sprites.rb | 1 + .../001_Pokemon-related/004_PokemonStorage.rb | 1 + .../002_Trainer_LoadAndNew.rb | 2 +- .../006_UI_HallOfFame.rb | 8 +- Data/Scripts/016_UI/003_UI_Pokedex_Main.rb | 16 +- Data/Scripts/016_UI/004_UI_Pokedex_Entry.rb | 8 +- Data/Scripts/016_UI/005_UI_Party.rb | 10 +- Data/Scripts/016_UI/006_UI_Summary.rb | 43 ++-- Data/Scripts/016_UI/007_UI_Bag.rb | 4 +- Data/Scripts/016_UI/016_UI_ReadyMenu.rb | 4 +- Data/Scripts/016_UI/017_UI_PokemonStorage.rb | 1 + Data/Scripts/016_UI/019_UI_PC.rb | 24 +- Data/Scripts/016_UI/020_UI_PokeMart.rb | 4 +- Data/Scripts/016_UI/021_UI_MoveRelearner.rb | 10 +- Data/Scripts/016_UI/022_UI_PurifyChamber.rb | 116 ++++----- Data/Scripts/016_UI/024_UI_TextEntry.rb | 14 +- .../017_Minigames/001_Minigame_Duel.rb | 111 +++++--- .../017_Minigames/003_Minigame_SlotMachine.rb | 7 +- .../017_Minigames/004_Minigame_VoltorbFlip.rb | 2 +- .../017_Minigames/006_Minigame_Mining.rb | 1 + .../002_BugContest.rb | 1 + .../002_ChallengeGenerator_Pokemon.rb | 10 +- .../003_ChallengeGenerator_Trainers.rb | 6 +- .../004_ChallengeGenerator_BattleSim.rb | 1 + Data/Scripts/019_Utilities/001_Utilities.rb | 42 ++-- .../001_Editor screens/001_EditorScreens.rb | 15 +- .../001_AnimEditor_SceneElements.rb | 11 +- .../002_AnimEditor_ControlsButtons.rb | 2 +- .../003_AnimEditor_Interpolation.rb | 2 +- .../004_AnimEditor_ExportImport.rb | 2 +- .../005_AnimEditor_Functions.rb | 20 +- .../003_Debug_MenuExtraCode.rb | 25 +- .../005_Debug_PokemonCommands.rb | 88 ++++--- .../009_Debug_BattleExtraCode.rb | 236 +++++++++--------- .../021_Compiler/002_Compiler_CompilePBS.rb | 29 ++- .../004_Compiler_MapsAndEvents.rb | 23 +- 88 files changed, 839 insertions(+), 783 deletions(-) diff --git a/Data/Scripts/001_Technical/001_Debugging/001_PBDebug.rb b/Data/Scripts/001_Technical/001_Debugging/001_PBDebug.rb index dc7e7e91d..5b8c230cb 100644 --- a/Data/Scripts/001_Technical/001_Debugging/001_PBDebug.rb +++ b/Data/Scripts/001_Technical/001_Debugging/001_PBDebug.rb @@ -9,16 +9,14 @@ module PBDebug PBDebug.log("**Exception: #{$!.message}") PBDebug.log("#{$!.backtrace.inspect}") PBDebug.log("") -# if $INTERNAL - pbPrintException($!) -# end + pbPrintException($!) # if $INTERNAL PBDebug.flush end end def self.flush if $DEBUG && $INTERNAL && @@log.length>0 - File.open("Data/debuglog.txt", "a+b") { |f| f.write("#{@@log}") } + File.open("Data/debuglog.txt", "a+b") { |f| f.write(@@log.to_s) } end @@log.clear end @@ -26,9 +24,7 @@ module PBDebug def self.log(msg) if $DEBUG && $INTERNAL @@log.push("#{msg}\r\n") -# if @@log.length>1024 - PBDebug.flush -# end + PBDebug.flush # if @@log.length > 1024 end end diff --git a/Data/Scripts/001_Technical/001_Debugging/004_Validation.rb b/Data/Scripts/001_Technical/001_Debugging/004_Validation.rb index e3c23ccca..779f9b428 100644 --- a/Data/Scripts/001_Technical/001_Debugging/004_Validation.rb +++ b/Data/Scripts/001_Technical/001_Debugging/004_Validation.rb @@ -1,7 +1,7 @@ # The Kernel module is extended to include the validate method. module Kernel private - + # Used to check whether method arguments are of a given class or respond to a method. # @param value_pairs [Hash{Object => Class, Array, Symbol}] value pairs to validate # @example Validate a class or method diff --git a/Data/Scripts/001_Technical/002_Files/001_FileTests.rb b/Data/Scripts/001_Technical/002_Files/001_FileTests.rb index 63182aa92..a39456647 100644 --- a/Data/Scripts/001_Technical/002_Files/001_FileTests.rb +++ b/Data/Scripts/001_Technical/002_Files/001_FileTests.rb @@ -10,7 +10,7 @@ class Dir filters = [filters] if !filters.is_a?(Array) self.chdir(dir) do for filter in filters - self.glob(filter){ |f| files.push(full ? (dir + "/" + f) : f) } + self.glob(filter) { |f| files.push(full ? (dir + "/" + f) : f) } end end return files.sort @@ -294,7 +294,7 @@ end # NOTE: load_data checks anything added in MKXP's RTP setting, # and matching mount points added through System.mount def pbRgssOpen(file,mode=nil) - #File.open("debug.txt","ab") { |fw| fw.write([file,mode,Time.now.to_f].inspect+"\r\n") } + # File.open("debug.txt","ab") { |fw| fw.write([file,mode,Time.now.to_f].inspect+"\r\n") } if !safeExists?("./Game.rgssad") if block_given? File.open(file,mode) { |f| yield f } @@ -374,7 +374,7 @@ class StringInput include Enumerable class << self - def new( str ) + def new(str) if block_given? begin f = super @@ -389,7 +389,7 @@ class StringInput alias open new end - def initialize( str ) + def initialize(str) @string = str @pos = 0 @closed = false @@ -440,7 +440,7 @@ class StringInput @pos > @string.size end - def each( &block ) + def each(&block) raise IOError, 'closed stream' if @closed begin @string.each(&block) @@ -453,11 +453,11 @@ class StringInput raise IOError, 'closed stream' if @closed if idx = @string.index(?\n, @pos) idx += 1 # "\n".size - line = @string[ @pos ... idx ] + line = @string[@pos...idx] @pos = idx @pos += 1 if @pos == @string.size else - line = @string[ @pos .. -1 ] + line = @string[@pos..-1] @pos = @string.size + 1 end @lineno += 1 @@ -472,11 +472,11 @@ class StringInput ch end - def read( len = nil ) + def read(len = nil) raise IOError, 'closed stream' if @closed if !len return nil if eof? - rest = @string[@pos ... @string.size] + rest = @string[@pos...@string.size] @pos = @string.size + 1 return rest end diff --git a/Data/Scripts/001_Technical/003_Intl_Messages.rb b/Data/Scripts/001_Technical/003_Intl_Messages.rb index 77d092f82..7df576b41 100644 --- a/Data/Scripts/001_Technical/003_Intl_Messages.rb +++ b/Data/Scripts/001_Technical/003_Intl_Messages.rb @@ -373,11 +373,11 @@ class Messages def self.stringToKey(str) if str && str[/[\r\n\t\1]|^\s+|\s+$|\s{2,}/] - key=str.clone - key.gsub!(/^\s+/,"") - key.gsub!(/\s+$/,"") - key.gsub!(/\s{2,}/," ") - return key + key = str.clone + key.gsub!(/^\s+/, "") + key.gsub!(/\s+$/, "") + key.gsub!(/\s{2,}/, " ") + return key end return str end diff --git a/Data/Scripts/001_Technical/006_RPG_Sprite.rb b/Data/Scripts/001_Technical/006_RPG_Sprite.rb index 7f5e36a3e..261631064 100644 --- a/Data/Scripts/001_Technical/006_RPG_Sprite.rb +++ b/Data/Scripts/001_Technical/006_RPG_Sprite.rb @@ -9,13 +9,13 @@ class SpriteAnimation %w[ x y ox oy viewport flash src_rect opacity tone ].each_with_index do |s, _i| - eval <<-__END__ + eval <<-__END__ def #{s}(*arg) @sprite.#{s}(*arg) end - __END__ + __END__ end def self.clear diff --git a/Data/Scripts/004_Game classes/001_Game_Screen.rb b/Data/Scripts/004_Game classes/001_Game_Screen.rb index 417cc2fdb..500ce3afa 100644 --- a/Data/Scripts/004_Game classes/001_Game_Screen.rb +++ b/Data/Scripts/004_Game classes/001_Game_Screen.rb @@ -17,6 +17,7 @@ class Game_Screen attr_reader :weather_type # weather type attr_reader :weather_max # max number of weather sprites attr_accessor :weather_duration # ticks in which the weather should fade in + #----------------------------------------------------------------------------- # * Object Initialization #----------------------------------------------------------------------------- diff --git a/Data/Scripts/004_Game classes/003_Game_Picture.rb b/Data/Scripts/004_Game classes/003_Game_Picture.rb index 6fe8ba678..cd39dfdf9 100644 --- a/Data/Scripts/004_Game classes/003_Game_Picture.rb +++ b/Data/Scripts/004_Game classes/003_Game_Picture.rb @@ -20,6 +20,7 @@ class Game_Picture attr_reader :blend_type # blend method attr_reader :tone # color tone attr_reader :angle # rotation angle + #----------------------------------------------------------------------------- # * Object Initialization # number : picture number diff --git a/Data/Scripts/004_Game classes/004_Game_Map.rb b/Data/Scripts/004_Game classes/004_Game_Map.rb index 3d9ca2837..0e36302e7 100644 --- a/Data/Scripts/004_Game classes/004_Game_Map.rb +++ b/Data/Scripts/004_Game classes/004_Game_Map.rb @@ -138,11 +138,11 @@ class Game_Map end def valid?(x, y) - return x>=0 && x=0 && y= 0 && x < width && y >= 0 && y < height end def validLax?(x, y) - return x>=-10 && x<=width+10 && y>=-10 && y<=height+10 + return x >= -10 && x <= width + 10 && y >= -10 && y <= height + 10 end def passable?(x, y, d, self_event = nil) diff --git a/Data/Scripts/004_Game classes/005_Game_Map_Autoscroll.rb b/Data/Scripts/004_Game classes/005_Game_Map_Autoscroll.rb index 3af3ea189..cf6605e37 100644 --- a/Data/Scripts/004_Game classes/005_Game_Map_Autoscroll.rb +++ b/Data/Scripts/004_Game classes/005_Game_Map_Autoscroll.rb @@ -148,20 +148,20 @@ end class Game_Map def scroll_downright(distance) @display_x = [@display_x + distance, - (self.width - Graphics.width*1.0/TILE_WIDTH) * REAL_RES_X].min + (self.width - Graphics.width*1.0/TILE_WIDTH) * REAL_RES_X].min @display_y = [@display_y + distance, - (self.height - Graphics.height*1.0/TILE_HEIGHT) * REAL_RES_Y].min + (self.height - Graphics.height*1.0/TILE_HEIGHT) * REAL_RES_Y].min end def scroll_downleft(distance) @display_x = [@display_x - distance, 0].max @display_y = [@display_y + distance, - (self.height - Graphics.height*1.0/TILE_HEIGHT) * REAL_RES_Y].min + (self.height - Graphics.height*1.0/TILE_HEIGHT) * REAL_RES_Y].min end def scroll_upright(distance) @display_x = [@display_x + distance, - (self.width - Graphics.width*1.0/TILE_WIDTH) * REAL_RES_X].min + (self.width - Graphics.width*1.0/TILE_WIDTH) * REAL_RES_X].min @display_y = [@display_y - distance, 0].max end diff --git a/Data/Scripts/004_Game classes/006_Game_MapFactory.rb b/Data/Scripts/004_Game classes/006_Game_MapFactory.rb index 28818fbe7..b2d50c87f 100644 --- a/Data/Scripts/004_Game classes/006_Game_MapFactory.rb +++ b/Data/Scripts/004_Game classes/006_Game_MapFactory.rb @@ -175,7 +175,7 @@ class PokemonMapFactory # Check passability of tile if thisEvent.is_a?(Game_Player) return false unless ($DEBUG && Input.press?(Input::CTRL)) || - map.passable?(x, y, 0, thisEvent) + map.passable?(x, y, 0, thisEvent) else return false unless map.passable?(x, y, 0, thisEvent) end diff --git a/Data/Scripts/004_Game classes/012_Game_FollowerFactory.rb b/Data/Scripts/004_Game classes/012_Game_FollowerFactory.rb index 8d72972b1..6669ea3a6 100644 --- a/Data/Scripts/004_Game classes/012_Game_FollowerFactory.rb +++ b/Data/Scripts/004_Game classes/012_Game_FollowerFactory.rb @@ -253,7 +253,7 @@ class Game_FollowerFactory if event.at_coordinate?($game_player.x, $game_player.y) # Underneath player next if !event.over_trigger? elsif facing_tile && event.map.map_id == facing_tile[0] && - event.at_coordinate?(facing_tile[1], facing_tile[2]) # On facing tile + event.at_coordinate?(facing_tile[1], facing_tile[2]) # On facing tile next if event.over_trigger? else # Somewhere else next diff --git a/Data/Scripts/005_Sprites/006_Spriteset_Global.rb b/Data/Scripts/005_Sprites/006_Spriteset_Global.rb index 9837a6219..84148a834 100644 --- a/Data/Scripts/005_Sprites/006_Spriteset_Global.rb +++ b/Data/Scripts/005_Sprites/006_Spriteset_Global.rb @@ -1,5 +1,6 @@ class Spriteset_Global attr_reader :playersprite + @@viewport2 = Viewport.new(0, 0, Settings::SCREEN_WIDTH, Settings::SCREEN_HEIGHT) @@viewport2.z = 200 diff --git a/Data/Scripts/005_Sprites/007_Spriteset_Map.rb b/Data/Scripts/005_Sprites/007_Spriteset_Map.rb index 505be30f6..ec88e5d8e 100644 --- a/Data/Scripts/005_Sprites/007_Spriteset_Map.rb +++ b/Data/Scripts/005_Sprites/007_Spriteset_Map.rb @@ -33,6 +33,7 @@ end class Spriteset_Map attr_reader :map + @@viewport0 = Viewport.new(0, 0, Settings::SCREEN_WIDTH, Settings::SCREEN_HEIGHT) # Panorama @@viewport0.z = -100 @@viewport1 = Viewport.new(0, 0, Settings::SCREEN_WIDTH, Settings::SCREEN_HEIGHT) # Map, events, player, fog diff --git a/Data/Scripts/005_Sprites/009_Sprite_DynamicShadows.rb b/Data/Scripts/005_Sprites/009_Sprite_DynamicShadows.rb index 7ac04ed7a..f170ef521 100644 --- a/Data/Scripts/005_Sprites/009_Sprite_DynamicShadows.rb +++ b/Data/Scripts/005_Sprites/009_Sprite_DynamicShadows.rb @@ -231,28 +231,28 @@ end def XPML_read(map,markup,event,max_param_number=0) parameter_list = nil return nil if !event || event.list == nil - for i in 0...event.list.size - if event.list[i].code == 108 && - event.list[i].parameters[0].downcase == "begin " + markup.downcase - parameter_list = [] if parameter_list == nil - for j in i+1...event.list.size - if event.list[j].code == 108 - parts = event.list[j].parameters[0].split - if parts.size != 1 && parts[0].downcase != "begin" - if parts[1].to_i != 0 || parts[1] == "0" - parameter_list.push(parts[1].to_i) - else - parameter_list.push(parts[1]) - end + for i in 0...event.list.size + if event.list[i].code == 108 && + event.list[i].parameters[0].downcase == "begin " + markup.downcase + parameter_list = [] if parameter_list == nil + for j in i+1...event.list.size + if event.list[j].code == 108 + parts = event.list[j].parameters[0].split + if parts.size != 1 && parts[0].downcase != "begin" + if parts[1].to_i != 0 || parts[1] == "0" + parameter_list.push(parts[1].to_i) else - return parameter_list + parameter_list.push(parts[1]) end else return parameter_list end - return parameter_list if max_param_number != 0 && j == i + max_param_number + else + return parameter_list end + return parameter_list if max_param_number != 0 && j == i + max_param_number end end + end return parameter_list end diff --git a/Data/Scripts/005_Sprites/010_ParticleEngine.rb b/Data/Scripts/005_Sprites/010_ParticleEngine.rb index fca95b724..37faeceaf 100644 --- a/Data/Scripts/005_Sprites/010_ParticleEngine.rb +++ b/Data/Scripts/005_Sprites/010_ParticleEngine.rb @@ -366,7 +366,7 @@ class Particle_Engine::Fire < ParticleEffect_Event def initialize(event,viewport) super setParameters([0,0,1,20,40,0.5,-64, - Graphics.height,-64,Graphics.width,0.5,0.10,-5,-13,30,0]) + Graphics.height,-64,Graphics.width,0.5,0.10,-5,-13,30,0]) initParticles("particle",250) end end @@ -377,7 +377,7 @@ class Particle_Engine::Smoke < ParticleEffect_Event def initialize(event,viewport) super setParameters([0,0,0,80,20,0.5,-64, - Graphics.height,-64,Graphics.width,0.5,0.10,-5,-15,5,80]) + Graphics.height,-64,Graphics.width,0.5,0.10,-5,-15,5,80]) initParticles("smoke",250) end end @@ -388,7 +388,7 @@ class Particle_Engine::Teleport < ParticleEffect_Event def initialize(event,viewport) super setParameters([1,1,1,10,rand(360),1,-64, - Graphics.height,-64,Graphics.width,0,3,-8,-15,20,0]) + Graphics.height,-64,Graphics.width,0,3,-8,-15,20,0]) initParticles("wideportal",250) for i in 0...@maxparticless @particles[i].ox = 16 @@ -403,7 +403,7 @@ class Particle_Engine::Spirit < ParticleEffect_Event def initialize(event,viewport) super setParameters([1,0,1,20,rand(360),0.5,-64, - Graphics.height,-64,Graphics.width,0.5,0.10,-5,-13,30,0]) + Graphics.height,-64,Graphics.width,0.5,0.10,-5,-13,30,0]) initParticles("particle",250) end end @@ -413,8 +413,8 @@ end class Particle_Engine::Explosion < ParticleEffect_Event def initialize(event,viewport) super - setParameters([0,0,1,20,0,0.5,-64, - Graphics.height,-64,Graphics.width,0.5,0.10,-5,-13,30,0]) + setParameters([0,0,1,20,0,0.5,-64, + Graphics.height,-64,Graphics.width,0.5,0.10,-5,-13,30,0]) initParticles("explosion",250) end end @@ -425,7 +425,7 @@ class Particle_Engine::Aura < ParticleEffect_Event def initialize(event,viewport) super setParameters([0,0,1,20,0,1,-64, - Graphics.height,-64,Graphics.width,2,2,-5,-13,30,0]) + Graphics.height,-64,Graphics.width,2,2,-5,-13,30,0]) initParticles("particle",250) end end @@ -436,7 +436,7 @@ class Particle_Engine::Soot < ParticleEffect_Event def initialize(event,viewport) super setParameters([0,0,0,20,0,0.5,-64, - Graphics.height,-64,Graphics.width,0.5,0.10,-5,-15,5,80]) + Graphics.height,-64,Graphics.width,0.5,0.10,-5,-15,5,80]) initParticles("smoke",100,0,2) end end @@ -447,7 +447,7 @@ class Particle_Engine::SootSmoke < ParticleEffect_Event def initialize(event,viewport) super setParameters([0,0,0,30,0,0.5,-64, - Graphics.height,-64,Graphics.width,0.5,0.10,-5,-15,5,80]) + Graphics.height,-64,Graphics.width,0.5,0.10,-5,-15,5,80]) initParticles("smoke",100,0) for i in 0...@maxparticless @particles[i].blend_type = rand(6) < 3 ? 1 : 2 @@ -461,7 +461,7 @@ class Particle_Engine::Rocket < ParticleEffect_Event def initialize(event,viewport) super setParameters([0,0,0,60,0,0.5,-64, - Graphics.height,-64,Graphics.width,0.5,0,-5,-15,5,80]) + Graphics.height,-64,Graphics.width,0.5,0,-5,-15,5,80]) initParticles("smoke",100,-1) end end @@ -472,7 +472,7 @@ class Particle_Engine::FixedTeleport < ParticleEffect_Event def initialize(event,viewport) super setParameters([1,0,1,10,rand(360),1, - -Graphics.height,Graphics.height,0,Graphics.width,0,3,-8,-15,20,0]) + -Graphics.height,Graphics.height,0,Graphics.width,0,3,-8,-15,20,0]) initParticles("wideportal",250) for i in 0...@maxparticless @particles[i].ox = 16 @@ -488,7 +488,7 @@ class Particle_Engine::StarTeleport < ParticleEffect_Event def initialize(event,viewport) super setParameters([0,0,1,10,0,1, - -Graphics.height,Graphics.height,0,Graphics.width,0,3,-8,-15,10,0]) + -Graphics.height,Graphics.height,0,Graphics.width,0,3,-8,-15,10,0]) initParticles("star",250) for i in 0...@maxparticless @particles[i].ox = 48 @@ -503,7 +503,7 @@ class Particle_Engine::Smokescreen < ParticleEffect_Event def initialize(event,viewport) super setParameters([0,0,0,250,0,0.2,-64, - Graphics.height,-64,Graphics.width,0.8,0.8,-5,-15,5,80]) + Graphics.height,-64,Graphics.width,0.8,0.8,-5,-15,5,80]) initParticles(nil,100) for i in 0...@maxparticless rnd = rand(3) @@ -540,7 +540,7 @@ class Particle_Engine::Flare < ParticleEffect_Event def initialize(event,viewport) super setParameters([0,0,1,30,10,1,-64, - Graphics.height,-64,Graphics.width,2,2,-5,-12,30,0]) + Graphics.height,-64,Graphics.width,2,2,-5,-12,30,0]) initParticles("particle",255) end end @@ -551,7 +551,7 @@ class Particle_Engine::Splash < ParticleEffect_Event def initialize(event,viewport) super setParameters([0,0,1,30,255,1,-64, - Graphics.height,-64,Graphics.width,4,2,-5,-12,30,0]) + Graphics.height,-64,Graphics.width,4,2,-5,-12,30,0]) initParticles("smoke",50) end diff --git a/Data/Scripts/005_Sprites/012_Interpolators.rb b/Data/Scripts/005_Sprites/012_Interpolators.rb index 567defb50..420d9f087 100644 --- a/Data/Scripts/005_Sprites/012_Interpolators.rb +++ b/Data/Scripts/005_Sprites/012_Interpolators.rb @@ -38,12 +38,11 @@ class Interpolator when OPACITY @tweensteps[item[0]] = [sprite.opacity,item[1]-sprite.opacity] when COLOR - @tweensteps[item[0]] = [sprite.color.clone,Color.new( - item[1].red-sprite.color.red, - item[1].green-sprite.color.green, - item[1].blue-sprite.color.blue, - item[1].alpha-sprite.color.alpha - )] + @tweensteps[item[0]] = [sprite.color.clone, + Color.new(item[1].red - sprite.color.red, + item[1].green - sprite.color.green, + item[1].blue - sprite.color.blue, + item[1].alpha - sprite.color.alpha)] end end @tweening = true @@ -68,12 +67,10 @@ class Interpolator when OPACITY @sprite.opacity = item[0]+item[1]*t when COLOR - @sprite.color = Color.new( - item[0].red+item[1].red*t, - item[0].green+item[1].green*t, - item[0].blue+item[1].blue*t, - item[0].alpha+item[1].alpha*t - ) + @sprite.color = Color.new(item[0].red + item[1].red * t, + item[0].green + item[1].green * t, + item[0].blue + item[1].blue * t, + item[0].alpha + item[1].alpha * t) end end @step += 1 diff --git a/Data/Scripts/006_Map renderer/004_TileDrawingHelper.rb b/Data/Scripts/006_Map renderer/004_TileDrawingHelper.rb index 91e51d0a2..443304e15 100644 --- a/Data/Scripts/006_Map renderer/004_TileDrawingHelper.rb +++ b/Data/Scripts/006_Map renderer/004_TileDrawingHelper.rb @@ -3,18 +3,18 @@ class TileDrawingHelper attr_accessor :autotiles AUTOTILE_PATTERNS = [ - [ [27, 28, 33, 34], [ 5, 28, 33, 34], [27, 6, 33, 34], [ 5, 6, 33, 34], - [27, 28, 33, 12], [ 5, 28, 33, 12], [27, 6, 33, 12], [ 5, 6, 33, 12] ], - [ [27, 28, 11, 34], [ 5, 28, 11, 34], [27, 6, 11, 34], [ 5, 6, 11, 34], - [27, 28, 11, 12], [ 5, 28, 11, 12], [27, 6, 11, 12], [ 5, 6, 11, 12] ], - [ [25, 26, 31, 32], [25, 6, 31, 32], [25, 26, 31, 12], [25, 6, 31, 12], - [15, 16, 21, 22], [15, 16, 21, 12], [15, 16, 11, 22], [15, 16, 11, 12] ], - [ [29, 30, 35, 36], [29, 30, 11, 36], [ 5, 30, 35, 36], [ 5, 30, 11, 36], - [39, 40, 45, 46], [ 5, 40, 45, 46], [39, 6, 45, 46], [ 5, 6, 45, 46] ], - [ [25, 30, 31, 36], [15, 16, 45, 46], [13, 14, 19, 20], [13, 14, 19, 12], - [17, 18, 23, 24], [17, 18, 11, 24], [41, 42, 47, 48], [ 5, 42, 47, 48] ], - [ [37, 38, 43, 44], [37, 6, 43, 44], [13, 18, 19, 24], [13, 14, 43, 44], - [37, 42, 43, 48], [17, 18, 47, 48], [13, 18, 43, 48], [ 1, 2, 7, 8] ] + [[27, 28, 33, 34], [5, 28, 33, 34], [27, 6, 33, 34], [5, 6, 33, 34], + [27, 28, 33, 12], [5, 28, 33, 12], [27, 6, 33, 12], [5, 6, 33, 12]], + [[27, 28, 11, 34], [5, 28, 11, 34], [27, 6, 11, 34], [5, 6, 11, 34], + [27, 28, 11, 12], [5, 28, 11, 12], [27, 6, 11, 12], [5, 6, 11, 12]], + [[25, 26, 31, 32], [25, 6, 31, 32], [25, 26, 31, 12], [25, 6, 31, 12], + [15, 16, 21, 22], [15, 16, 21, 12], [15, 16, 11, 22], [15, 16, 11, 12]], + [[29, 30, 35, 36], [29, 30, 11, 36], [5, 30, 35, 36], [5, 30, 11, 36], + [39, 40, 45, 46], [5, 40, 45, 46], [39, 6, 45, 46], [5, 6, 45, 46]], + [[25, 30, 31, 36], [15, 16, 45, 46], [13, 14, 19, 20], [13, 14, 19, 12], + [17, 18, 23, 24], [17, 18, 11, 24], [41, 42, 47, 48], [5, 42, 47, 48]], + [[37, 38, 43, 44], [37, 6, 43, 44], [13, 18, 19, 24], [13, 14, 43, 44], + [37, 42, 43, 48], [17, 18, 47, 48], [13, 18, 43, 48], [1, 2, 7, 8]] ] # converts neighbors returned from tableNeighbors to tile indexes @@ -46,11 +46,11 @@ class TileDrawingHelper xm1 = [x - 1, 0].max ym1 = [y - 1, 0].max i = 0 - i |= 0x01 if data[ x, ym1] == t # N + i |= 0x01 if data[x, ym1] == t # N i |= 0x02 if data[xp1, ym1] == t # NE i |= 0x04 if data[xp1, y] == t # E i |= 0x08 if data[xp1, yp1] == t # SE - i |= 0x10 if data[ x, yp1] == t # S + i |= 0x10 if data[x, yp1] == t # S i |= 0x20 if data[xm1, yp1] == t # SW i |= 0x40 if data[xm1, y] == t # W i |= 0x80 if data[xm1, ym1] == t # NW diff --git a/Data/Scripts/007_Objects and windows/002_MessageConfig.rb b/Data/Scripts/007_Objects and windows/002_MessageConfig.rb index 3eec6c873..5c060db1d 100644 --- a/Data/Scripts/007_Objects and windows/002_MessageConfig.rb +++ b/Data/Scripts/007_Objects and windows/002_MessageConfig.rb @@ -239,7 +239,7 @@ def pbRepositionMessageWindow(msgwindow, linecount=2) when 1 # middle msgwindow.y=(Graphics.height/2)-(msgwindow.height/2) when 2 - msgwindow.y=(Graphics.height)-(msgwindow.height) + msgwindow.y=(Graphics.height)-(msgwindow.height) end msgwindow.opacity = 0 if $game_system.message_frame != 0 end @@ -339,9 +339,9 @@ def getSkinColor(windowskin,color,isDarkSkin) "9040E8","B8A8E0", # 9 Purple "F89818","F8C898", # 10 Orange colorToRgb32(MessageConfig::DARK_TEXT_MAIN_COLOR), - colorToRgb32(MessageConfig::DARK_TEXT_SHADOW_COLOR), # 11 Dark default + colorToRgb32(MessageConfig::DARK_TEXT_SHADOW_COLOR), # 11 Dark default colorToRgb32(MessageConfig::LIGHT_TEXT_MAIN_COLOR), - colorToRgb32(MessageConfig::LIGHT_TEXT_SHADOW_COLOR) # 12 Light default + colorToRgb32(MessageConfig::LIGHT_TEXT_SHADOW_COLOR) # 12 Light default ] if color==0 || color>textcolors.length/2 # No special colour, use default if isDarkSkin # Dark background, light text @@ -616,10 +616,10 @@ def pbFadeOutInWithMusic(zViewport=99999) $game_system.bgs_pause(1.0) pos = $game_system.bgm_position pbFadeOutIn(zViewport) { - yield - $game_system.bgm_position = pos - $game_system.bgm_resume(playingBGM) - $game_system.bgs_resume(playingBGS) + yield + $game_system.bgm_position = pos + $game_system.bgm_resume(playingBGM) + $game_system.bgs_resume(playingBGS) } end diff --git a/Data/Scripts/007_Objects and windows/003_Window.rb b/Data/Scripts/007_Objects and windows/003_Window.rb index 03775c0f5..db62d0247 100644 --- a/Data/Scripts/007_Objects and windows/003_Window.rb +++ b/Data/Scripts/007_Objects and windows/003_Window.rb @@ -322,8 +322,8 @@ class Window def ensureBitmap(bitmap,dwidth,dheight) if !bitmap||bitmap.disposed?||bitmap.width 0 @sprites["scroll1"].visible = @visible && hascontents && @ox > 0 @sprites["scroll2"].visible = @visible && hascontents && - (@contents.width - @ox) > @width-32 + (@contents.width - @ox) > @width-32 @sprites["scroll3"].visible = @visible && hascontents && - (@contents.height - @oy) > @height-32 + (@contents.height - @oy) > @height-32 else for i in 0...4 @sprites["corner#{i}"].visible=false @@ -454,19 +454,18 @@ class Window else @sprites["contents"].src_rect.set(0,0,0,0) end - pauseRects=[ - trimX+32,trimY+64, - trimX+48,trimY+64, - trimX+32,trimY+80, - trimX+48,trimY+80, + pauseRects = [ + trimX + 32, trimY + 64, + trimX + 48, trimY + 64, + trimX + 32, trimY + 80, + trimX + 48, trimY + 80 ] pauseWidth=16 pauseHeight=16 - @sprites["pause"].src_rect.set( - pauseRects[@pauseframe*2], - pauseRects[@pauseframe*2+1], - pauseWidth,pauseHeight - ) + @sprites["pause"].src_rect.set(pauseRects[@pauseframe * 2], + pauseRects[@pauseframe * 2 + 1], + pauseWidth, + pauseHeight) @sprites["pause"].x=@x+(@width/2)-(pauseWidth/2) @sprites["pause"].y=@y+@height-16 # 16 refers to skin margin @sprites["contents"].x=@x+16 @@ -547,8 +546,8 @@ class Window @sprites["cursor"].src_rect.set(0,0,0,0) end for i in 0...4 - dwidth = (i==0 || i==3) ? @width-32 : 16 - dheight = (i==0 || i==3) ? 16 : @height-32 + dwidth = [0, 3].include?(i) ? @width - 32 : 16 + dheight = [0, 3].include?(i) ? 16 : @height - 32 @sidebitmaps[i]=ensureBitmap(@sidebitmaps[i],dwidth,dheight) @sprites["side#{i}"].bitmap=@sidebitmaps[i] @sprites["side#{i}"].src_rect.set(0,0,dwidth,dheight) diff --git a/Data/Scripts/007_Objects and windows/004_SpriteWindow.rb b/Data/Scripts/007_Objects and windows/004_SpriteWindow.rb index 3ca6b2c2c..63fccb92c 100644 --- a/Data/Scripts/007_Objects and windows/004_SpriteWindow.rb +++ b/Data/Scripts/007_Objects and windows/004_SpriteWindow.rb @@ -186,8 +186,8 @@ class SpriteWindow < Window end def active=(value) - @active=value - privRefresh(true) + @active=value + privRefresh(true) end def cursor_rect=(value) @@ -519,9 +519,9 @@ class SpriteWindow < Window @sprites["back"].visible=@visible @sprites["contents"].visible=@visible && @openness==255 @sprites["pause"].visible=supported && @visible && @pause && - (@combat & CompatBits::ShowPause) + (@combat & CompatBits::ShowPause) @sprites["cursor"].visible=supported && @visible && @openness==255 && - (@combat & CompatBits::ShowCursor) + (@combat & CompatBits::ShowCursor) @sprites["scroll0"].visible = false @sprites["scroll1"].visible = false @sprites["scroll2"].visible = false @@ -599,7 +599,7 @@ class SpriteWindow < Window pauseRects[@pauseframe*2], pauseRects[@pauseframe*2+1], pauseWidth,pauseHeight - ) + ) end else trimStartX=@trim[0] @@ -850,7 +850,7 @@ class SpriteWindow_Base < SpriteWindow def __setWindowskin(skin) if skin && (skin.width==192 && skin.height==128) || # RPGXP Windowskin - (skin.width==128 && skin.height==128) # RPGVX Windowskin + (skin.width==128 && skin.height==128) # RPGVX Windowskin self.skinformat=0 else self.skinformat=1 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 913d91142..7d6461919 100644 --- a/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb +++ b/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb @@ -134,7 +134,7 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base @lastDrawnChar = -1 @fmtchars = [] @frameskipChanged = false - @frameskip = MessageConfig.pbGetTextSpeed() + @frameskip = MessageConfig.pbGetTextSpeed super(0,0,33,33) @pausesprite = nil @text = "" @@ -679,7 +679,7 @@ class Window_InputNumberPokemon < SpriteWindow_Base refresh if @frame%15==0 if self.active if Input.repeat?(Input::UP) || Input.repeat?(Input::DOWN) - pbPlayCursorSE() + pbPlayCursorSE if @index==0 && @sign @negative=!@negative else @@ -696,14 +696,14 @@ class Window_InputNumberPokemon < SpriteWindow_Base refresh elsif Input.repeat?(Input::RIGHT) if digits >= 2 - pbPlayCursorSE() + pbPlayCursorSE @index = (@index + 1) % digits @frame=0 refresh end elsif Input.repeat?(Input::LEFT) if digits >= 2 - pbPlayCursorSE() + pbPlayCursorSE @index = (@index + digits - 1) % digits @frame=0 refresh @@ -847,7 +847,7 @@ class SpriteWindow_Selectable < SpriteWindow_Base oldindex = @index @index = (@index - @column_max + @item_max) % @item_max if @index!=oldindex - pbPlayCursorSE() + pbPlayCursorSE update_cursor_rect end end @@ -857,7 +857,7 @@ class SpriteWindow_Selectable < SpriteWindow_Base oldindex = @index @index = (@index + @column_max) % @item_max if @index!=oldindex - pbPlayCursorSE() + pbPlayCursorSE update_cursor_rect end end @@ -866,7 +866,7 @@ class SpriteWindow_Selectable < SpriteWindow_Base oldindex = @index @index -= 1 if @index!=oldindex - pbPlayCursorSE() + pbPlayCursorSE update_cursor_rect end end @@ -875,7 +875,7 @@ class SpriteWindow_Selectable < SpriteWindow_Base oldindex = @index @index += 1 if @index!=oldindex - pbPlayCursorSE() + pbPlayCursorSE update_cursor_rect end end @@ -884,7 +884,7 @@ class SpriteWindow_Selectable < SpriteWindow_Base oldindex = @index @index = [self.index-self.page_item_max, 0].max if @index!=oldindex - pbPlayCursorSE() + pbPlayCursorSE self.top_row -= self.page_row_max update_cursor_rect end @@ -894,7 +894,7 @@ class SpriteWindow_Selectable < SpriteWindow_Base oldindex = @index @index = [self.index+self.page_item_max, @item_max-1].min if @index!=oldindex - pbPlayCursorSE() + pbPlayCursorSE self.top_row += self.page_row_max update_cursor_rect end @@ -1092,8 +1092,8 @@ class Window_DrawableCommand < SpriteWindow_SelectableEx tmpbitmap.dispose end # Store suggested width and height of window - dims[0] = [self.borderX+1,(width*self.columns)+self.borderX+ - (self.columns-1)*self.columnSpacing].max + dims[0] = [self.borderX + 1, + (width * self.columns) + self.borderX + (self.columns - 1) * self.columnSpacing].max dims[1] = [self.borderY+1,windowheight].max dims[1] = [dims[1],Graphics.height].min end @@ -1117,11 +1117,10 @@ class Window_DrawableCommand < SpriteWindow_SelectableEx return 0 end - def drawItem(index,count,rect) # to be implemented by derived classes - end + def drawItem(index, count, rect); end # to be implemented by derived classes def refresh - @item_max = itemCount() + @item_max = itemCount dwidth = self.width-self.borderX dheight = self.height-self.borderY self.contents = pbDoEnsureBitmap(self.contents,dwidth,dheight) diff --git a/Data/Scripts/007_Objects and windows/010_DrawText.rb b/Data/Scripts/007_Objects and windows/010_DrawText.rb index 87625611e..ff2de575a 100644 --- a/Data/Scripts/007_Objects and windows/010_DrawText.rb +++ b/Data/Scripts/007_Objects and windows/010_DrawText.rb @@ -65,18 +65,18 @@ def rgbToColor(param) ((baseint>>10)&0x1F)<<3 ) elsif param.length==1 # Color number - i=param.to_i - return Font.default_color if i>=8 - return [ - Color.new(255, 255, 255, 255), - Color.new(128, 128, 255, 255), - Color.new(255, 128, 128, 255), - Color.new(128, 255, 128, 255), - Color.new(128, 255, 255, 255), - Color.new(255, 128, 255, 255), - Color.new(255, 255, 128, 255), - Color.new(192, 192, 192, 255) - ][i] + i=param.to_i + return Font.default_color if i>=8 + return [ + Color.new(255, 255, 255, 255), + Color.new(128, 128, 255, 255), + Color.new(255, 128, 128, 255), + Color.new(128, 255, 128, 255), + Color.new(128, 255, 255, 255), + Color.new(255, 128, 255, 255), + Color.new(255, 255, 128, 255), + Color.new(192, 192, 192, 255) + ][i] else return Font.default_color end @@ -199,7 +199,7 @@ def getFormattedTextFast(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight, if newlineBreaks # treat newline as break havenl=true characters.push(["\n",x,y*lineheight+yDst,0,lineheight,false,false, - false,colorclone,nil,false,false,"",8,position,nil,0]) + false,colorclone,nil,false,false,"",8,position,nil,0]) y+=1 x=0 hadspace=true @@ -228,14 +228,15 @@ def getFormattedTextFast(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight, textchars[position], x+xStart,texty,width+2,lineheight, false,bold,italic,colorclone,nil,false,false, - defaultfontname,bitmap.font.size,position,nil,0]) + defaultfontname,bitmap.font.size,position,nil,0 + ]) end x+=width if !explicitBreaksOnly && x+2>widthDst && lastword[1]!=0 && (!hadnonspace || !hadspace) havenl=true characters.insert(lastword[0],["\n",x,y*lineheight+yDst,0,lineheight, - false,false,false,colorclone,nil,false,false,"",8,position]) + false,false,false,colorclone,nil,false,false,"",8,position]) lastword[0]+=1 y+=1 x=0 @@ -256,7 +257,7 @@ def getFormattedTextFast(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight, if characters[i][5]!=false # If not a character firstspace=-1 elsif (characters[i][0]=="\n" || isWaitChar(characters[i][0])) && - firstspace>=0 + firstspace>=0 for j in firstspace...i characters[j]=nil end @@ -306,10 +307,10 @@ def getLastColors(colorstack,opacitystack,defaultcolors) colors=getLastParam(colorstack,defaultcolors) opacity=getLastParam(opacitystack,255) if opacity!=255 - colors=[Color.new(colors[0].red,colors[0].green,colors[0].blue, - colors[0].alpha*opacity/255), - colors[1] ? Color.new(colors[1].red,colors[1].green,colors[1].blue, - colors[1].alpha*opacity/255) : nil] + colors = [ + Color.new(colors[0].red, colors[0].green, colors[0].blue, colors[0].alpha * opacity / 255), + colors[1] ? Color.new(colors[1].red, colors[1].green, colors[1].blue, colors[1].alpha * opacity / 255) : nil + ] end return colors end @@ -629,7 +630,7 @@ def getFormattedText(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight=32, nextline.times do havenl=true characters.push(["\n",x,y*lineheight+yDst,0,lineheight,false,false,false, - defaultcolors[0],defaultcolors[1],false,false,"",8,position,nil,0]) + defaultcolors[0],defaultcolors[1],false,false,"",8,position,nil,0]) charactersInternal.push([alignment,y,0]) y+=1 x=0 @@ -643,7 +644,7 @@ def getFormattedText(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight=32, if nextline==0 havenl=true characters.push(["\n",x,y*lineheight+yDst,0,lineheight,false,false,false, - defaultcolors[0],defaultcolors[1],false,false,"",8,position,nil,0]) + defaultcolors[0],defaultcolors[1],false,false,"",8,position,nil,0]) charactersInternal.push([alignment,y,0]) y+=1 x=0 @@ -692,9 +693,10 @@ def getFormattedText(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight=32, if !explicitBreaksOnly && x+2>widthDst && lastword[1]!=0 && (!hadnonspace || !hadspace) havenl=true - characters.insert(lastword[0],["\n",x,y*lineheight+yDst,0,lineheight,false, - false,false,defaultcolors[0],defaultcolors[1],false,false,"",8,position, - nil]) + characters.insert(lastword[0], ["\n", x, y * lineheight + yDst, 0, lineheight, + false, false, false, + defaultcolors[0], defaultcolors[1], + false, false, "", 8, position, nil]) charactersInternal.insert(lastword[0],[alignment,y,0]) lastword[0]+=1 y+=1 @@ -763,7 +765,7 @@ def getFormattedText(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight=32, if characters[i][5]!=false # If not a character firstspace=-1 elsif (characters[i][0]=="\n" || isWaitChar(characters[i][0])) && - firstspace>=0 + firstspace>=0 for j in firstspace...i characters[j]=nil charactersInternal[j]=nil diff --git a/Data/Scripts/010_Data/001_Hardcoded data/001_GrowthRate.rb b/Data/Scripts/010_Data/001_Hardcoded data/001_GrowthRate.rb index 9df096a61..b0ffc28c6 100644 --- a/Data/Scripts/010_Data/001_Hardcoded data/001_GrowthRate.rb +++ b/Data/Scripts/010_Data/001_Hardcoded data/001_GrowthRate.rb @@ -78,16 +78,16 @@ GameData::GrowthRate.register({ :id => :Medium, # Also known as Medium Fast :name => _INTL("Medium"), :exp_values => [-1, - 0, 8, 27, 64, 125, 216, 343, 512, 729, 1000, - 1331, 1728, 2197, 2744, 3375, 4096, 4913, 5832, 6859, 8000, - 9261, 10648, 12167, 13824, 15625, 17576, 19683, 21952, 24389, 27000, - 29791, 32768, 35937, 39304, 42875, 46656, 50653, 54872, 59319, 64000, - 68921, 74088, 79507, 85184, 91125, 97336, 103823, 110592, 117649, 125000, - 132651, 140608, 148877, 157464, 166375, 175616, 185193, 195112, 205379, 216000, - 226981, 238328, 250047, 262144, 274625, 287496, 300763, 314432, 328509, 343000, - 357911, 373248, 389017, 405224, 421875, 438976, 456533, 474552, 493039, 512000, - 531441, 551368, 571787, 592704, 614125, 636056, 658503, 681472, 704969, 729000, - 753571, 778688, 804357, 830584, 857375, 884736, 912673, 941192, 970299, 1000000], + 0, 8, 27, 64, 125, 216, 343, 512, 729, 1000, + 1331, 1728, 2197, 2744, 3375, 4096, 4913, 5832, 6859, 8000, + 9261, 10648, 12167, 13824, 15625, 17576, 19683, 21952, 24389, 27000, + 29791, 32768, 35937, 39304, 42875, 46656, 50653, 54872, 59319, 64000, + 68921, 74088, 79507, 85184, 91125, 97336, 103823, 110592, 117649, 125000, + 132651, 140608, 148877, 157464, 166375, 175616, 185193, 195112, 205379, 216000, + 226981, 238328, 250047, 262144, 274625, 287496, 300763, 314432, 328509, 343000, + 357911, 373248, 389017, 405224, 421875, 438976, 456533, 474552, 493039, 512000, + 531441, 551368, 571787, 592704, 614125, 636056, 658503, 681472, 704969, 729000, + 753571, 778688, 804357, 830584, 857375, 884736, 912673, 941192, 970299, 1000000], :exp_formula => proc { |level| next level ** 3 } }) @@ -101,16 +101,16 @@ GameData::GrowthRate.register({ :id => :Erratic, :name => _INTL("Erratic"), :exp_values => [-1, - 0, 15, 52, 122, 237, 406, 637, 942, 1326, 1800, - 2369, 3041, 3822, 4719, 5737, 6881, 8155, 9564, 11111, 12800, - 14632, 16610, 18737, 21012, 23437, 26012, 28737, 31610, 34632, 37800, - 41111, 44564, 48155, 51881, 55737, 59719, 63822, 68041, 72369, 76800, - 81326, 85942, 90637, 95406, 100237, 105122, 110052, 115015, 120001, 125000, - 131324, 137795, 144410, 151165, 158056, 165079, 172229, 179503, 186894, 194400, - 202013, 209728, 217540, 225443, 233431, 241496, 249633, 257834, 267406, 276458, - 286328, 296358, 305767, 316074, 326531, 336255, 346965, 357812, 367807, 378880, - 390077, 400293, 411686, 423190, 433572, 445239, 457001, 467489, 479378, 491346, - 501878, 513934, 526049, 536557, 548720, 560922, 571333, 583539, 591882, 600000], + 0, 15, 52, 122, 237, 406, 637, 942, 1326, 1800, + 2369, 3041, 3822, 4719, 5737, 6881, 8155, 9564, 11111, 12800, + 14632, 16610, 18737, 21012, 23437, 26012, 28737, 31610, 34632, 37800, + 41111, 44564, 48155, 51881, 55737, 59719, 63822, 68041, 72369, 76800, + 81326, 85942, 90637, 95406, 100237, 105122, 110052, 115015, 120001, 125000, + 131324, 137795, 144410, 151165, 158056, 165079, 172229, 179503, 186894, 194400, + 202013, 209728, 217540, 225443, 233431, 241496, 249633, 257834, 267406, 276458, + 286328, 296358, 305767, 316074, 326531, 336255, 346965, 357812, 367807, 378880, + 390077, 400293, 411686, 423190, 433572, 445239, 457001, 467489, 479378, 491346, + 501878, 513934, 526049, 536557, 548720, 560922, 571333, 583539, 591882, 600000], :exp_formula => proc { |level| next (level ** 4) * 3 / 500 } }) @@ -122,16 +122,16 @@ GameData::GrowthRate.register({ :id => :Fluctuating, :name => _INTL("Fluctuating"), :exp_values => [-1, - 0, 4, 13, 32, 65, 112, 178, 276, 393, 540, - 745, 967, 1230, 1591, 1957, 2457, 3046, 3732, 4526, 5440, - 6482, 7666, 9003, 10506, 12187, 14060, 16140, 18439, 20974, 23760, - 26811, 30146, 33780, 37731, 42017, 46656, 50653, 55969, 60505, 66560, - 71677, 78533, 84277, 91998, 98415, 107069, 114205, 123863, 131766, 142500, - 151222, 163105, 172697, 185807, 196322, 210739, 222231, 238036, 250562, 267840, - 281456, 300293, 315059, 335544, 351520, 373744, 390991, 415050, 433631, 459620, - 479600, 507617, 529063, 559209, 582187, 614566, 639146, 673863, 700115, 737280, - 765275, 804997, 834809, 877201, 908905, 954084, 987754, 1035837, 1071552, 1122660, - 1160499, 1214753, 1254796, 1312322, 1354652, 1415577, 1460276, 1524731, 1571884, 1640000], + 0, 4, 13, 32, 65, 112, 178, 276, 393, 540, + 745, 967, 1230, 1591, 1957, 2457, 3046, 3732, 4526, 5440, + 6482, 7666, 9003, 10506, 12187, 14060, 16140, 18439, 20974, 23760, + 26811, 30146, 33780, 37731, 42017, 46656, 50653, 55969, 60505, 66560, + 71677, 78533, 84277, 91998, 98415, 107069, 114205, 123863, 131766, 142500, + 151222, 163105, 172697, 185807, 196322, 210739, 222231, 238036, 250562, 267840, + 281456, 300293, 315059, 335544, 351520, 373744, 390991, 415050, 433631, 459620, + 479600, 507617, 529063, 559209, 582187, 614566, 639146, 673863, 700115, 737280, + 765275, 804997, 834809, 877201, 908905, 954084, 987754, 1035837, 1071552, 1122660, + 1160499, 1214753, 1254796, 1312322, 1354652, 1415577, 1460276, 1524731, 1571884, 1640000], :exp_formula => proc { |level| rate = [82 - (level - 100) / 2.0, 40].max next (level ** 4) * rate / 5000 @@ -142,16 +142,16 @@ GameData::GrowthRate.register({ :id => :Parabolic, # Also known as Medium Slow :name => _INTL("Parabolic"), :exp_values => [-1, - 0, 9, 57, 96, 135, 179, 236, 314, 419, 560, - 742, 973, 1261, 1612, 2035, 2535, 3120, 3798, 4575, 5460, - 6458, 7577, 8825, 10208, 11735, 13411, 15244, 17242, 19411, 21760, - 24294, 27021, 29949, 33084, 36435, 40007, 43808, 47846, 52127, 56660, - 61450, 66505, 71833, 77440, 83335, 89523, 96012, 102810, 109923, 117360, - 125126, 133229, 141677, 150476, 159635, 169159, 179056, 189334, 199999, 211060, - 222522, 234393, 246681, 259392, 272535, 286115, 300140, 314618, 329555, 344960, - 360838, 377197, 394045, 411388, 429235, 447591, 466464, 485862, 505791, 526260, - 547274, 568841, 590969, 613664, 636935, 660787, 685228, 710266, 735907, 762160, - 789030, 816525, 844653, 873420, 902835, 932903, 963632, 995030, 1027103, 1059860], + 0, 9, 57, 96, 135, 179, 236, 314, 419, 560, + 742, 973, 1261, 1612, 2035, 2535, 3120, 3798, 4575, 5460, + 6458, 7577, 8825, 10208, 11735, 13411, 15244, 17242, 19411, 21760, + 24294, 27021, 29949, 33084, 36435, 40007, 43808, 47846, 52127, 56660, + 61450, 66505, 71833, 77440, 83335, 89523, 96012, 102810, 109923, 117360, + 125126, 133229, 141677, 150476, 159635, 169159, 179056, 189334, 199999, 211060, + 222522, 234393, 246681, 259392, 272535, 286115, 300140, 314618, 329555, 344960, + 360838, 377197, 394045, 411388, 429235, 447591, 466464, 485862, 505791, 526260, + 547274, 568841, 590969, 613664, 636935, 660787, 685228, 710266, 735907, 762160, + 789030, 816525, 844653, 873420, 902835, 932903, 963632, 995030, 1027103, 1059860], :exp_formula => proc { |level| next ((level ** 3) * 6 / 5) - 15 * (level ** 2) + 100 * level - 140 } }) @@ -159,16 +159,16 @@ GameData::GrowthRate.register({ :id => :Fast, :name => _INTL("Fast"), :exp_values => [-1, - 0, 6, 21, 51, 100, 172, 274, 409, 583, 800, - 1064, 1382, 1757, 2195, 2700, 3276, 3930, 4665, 5487, 6400, - 7408, 8518, 9733, 11059, 12500, 14060, 15746, 17561, 19511, 21600, - 23832, 26214, 28749, 31443, 34300, 37324, 40522, 43897, 47455, 51200, - 55136, 59270, 63605, 68147, 72900, 77868, 83058, 88473, 94119, 100000, - 106120, 112486, 119101, 125971, 133100, 140492, 148154, 156089, 164303, 172800, - 181584, 190662, 200037, 209715, 219700, 229996, 240610, 251545, 262807, 274400, - 286328, 298598, 311213, 324179, 337500, 351180, 365226, 379641, 394431, 409600, - 425152, 441094, 457429, 474163, 491300, 508844, 526802, 545177, 563975, 583200, - 602856, 622950, 643485, 664467, 685900, 707788, 730138, 752953, 776239, 800000], + 0, 6, 21, 51, 100, 172, 274, 409, 583, 800, + 1064, 1382, 1757, 2195, 2700, 3276, 3930, 4665, 5487, 6400, + 7408, 8518, 9733, 11059, 12500, 14060, 15746, 17561, 19511, 21600, + 23832, 26214, 28749, 31443, 34300, 37324, 40522, 43897, 47455, 51200, + 55136, 59270, 63605, 68147, 72900, 77868, 83058, 88473, 94119, 100000, + 106120, 112486, 119101, 125971, 133100, 140492, 148154, 156089, 164303, 172800, + 181584, 190662, 200037, 209715, 219700, 229996, 240610, 251545, 262807, 274400, + 286328, 298598, 311213, 324179, 337500, 351180, 365226, 379641, 394431, 409600, + 425152, 441094, 457429, 474163, 491300, 508844, 526802, 545177, 563975, 583200, + 602856, 622950, 643485, 664467, 685900, 707788, 730138, 752953, 776239, 800000], :exp_formula => proc { |level| (level ** 3) * 4 / 5 } }) @@ -176,15 +176,15 @@ GameData::GrowthRate.register({ :id => :Slow, :name => _INTL("Slow"), :exp_values => [-1, - 0, 10, 33, 80, 156, 270, 428, 640, 911, 1250, - 1663, 2160, 2746, 3430, 4218, 5120, 6141, 7290, 8573, 10000, - 11576, 13310, 15208, 17280, 19531, 21970, 24603, 27440, 30486, 33750, - 37238, 40960, 44921, 49130, 53593, 58320, 63316, 68590, 74148, 80000, - 86151, 92610, 99383, 106480, 113906, 121670, 129778, 138240, 147061, 156250, - 165813, 175760, 186096, 196830, 207968, 219520, 231491, 243890, 256723, 270000, - 283726, 297910, 312558, 327680, 343281, 359370, 375953, 393040, 410636, 428750, - 447388, 466560, 486271, 506530, 527343, 548720, 570666, 593190, 616298, 640000, - 664301, 689210, 714733, 740880, 767656, 795070, 823128, 851840, 881211, 911250, - 941963, 973360, 1005446, 1038230, 1071718, 1105920, 1140841, 1176490, 1212873, 1250000], + 0, 10, 33, 80, 156, 270, 428, 640, 911, 1250, + 1663, 2160, 2746, 3430, 4218, 5120, 6141, 7290, 8573, 10000, + 11576, 13310, 15208, 17280, 19531, 21970, 24603, 27440, 30486, 33750, + 37238, 40960, 44921, 49130, 53593, 58320, 63316, 68590, 74148, 80000, + 86151, 92610, 99383, 106480, 113906, 121670, 129778, 138240, 147061, 156250, + 165813, 175760, 186096, 196830, 207968, 219520, 231491, 243890, 256723, 270000, + 283726, 297910, 312558, 327680, 343281, 359370, 375953, 393040, 410636, 428750, + 447388, 466560, 486271, 506530, 527343, 548720, 570666, 593190, 616298, 640000, + 664301, 689210, 714733, 740880, 767656, 795070, 823128, 851840, 881211, 911250, + 941963, 973360, 1005446, 1038230, 1071718, 1105920, 1140841, 1176490, 1212873, 1250000], :exp_formula => proc { |level| (level ** 3) * 5 / 4 } }) diff --git a/Data/Scripts/010_Data/002_PBS data/006_Item.rb b/Data/Scripts/010_Data/002_PBS data/006_Item.rb index 750101b53..b5aae5cdb 100644 --- a/Data/Scripts/010_Data/002_PBS data/006_Item.rb +++ b/Data/Scripts/010_Data/002_PBS data/006_Item.rb @@ -23,12 +23,12 @@ module GameData "Price" => [:price, "u"], "SellPrice" => [:sell_price, "u"], "Description" => [:description, "q"], - "FieldUse" => [:field_use, "e", {"OnPokemon" => 1, "Direct" => 2, "TM" => 3, - "HM" => 4, "OnPokemonReusable" => 1, "TR" => 6}], - "BattleUse" => [:battle_use, "e", {"OnPokemon" => 1, "OnMove" => 2, "OnBattler" => 3, + "FieldUse" => [:field_use, "e", { "OnPokemon" => 1, "Direct" => 2, "TM" => 3, + "HM" => 4, "OnPokemonReusable" => 1, "TR" => 6 }], + "BattleUse" => [:battle_use, "e", { "OnPokemon" => 1, "OnMove" => 2, "OnBattler" => 3, "OnFoe" => 4, "Direct" => 5, "OnPokemonReusable" => 1, "OnMoveReusable" => 2, "OnBattlerReusable" => 3, - "OnFoeReusable" => 4, "DirectReusable" => 5}], + "OnFoeReusable" => 4, "DirectReusable" => 5 }], "Consumable" => [:consumable, "b"], "Flags" => [:flags, "*s"], "Move" => [:move, "e", :Move] diff --git a/Data/Scripts/010_Data/002_PBS data/010_SpeciesMetrics.rb b/Data/Scripts/010_Data/002_PBS data/010_SpeciesMetrics.rb index 3455ca8da..d17c51c51 100644 --- a/Data/Scripts/010_Data/002_PBS data/010_SpeciesMetrics.rb +++ b/Data/Scripts/010_Data/002_PBS data/010_SpeciesMetrics.rb @@ -35,7 +35,7 @@ module GameData if form > 0 trial = sprintf("%s_%d", species, form).to_sym if !DATA.has_key?(trial) - self.register({:id => species}) if !DATA[species] + self.register({ :id => species }) if !DATA[species] self.register({ :id => trial, :species => species, @@ -49,7 +49,7 @@ module GameData end return DATA[trial] end - self.register({:id => species}) if !DATA[species] + self.register({ :id => species }) if !DATA[species] return DATA[species] end diff --git a/Data/Scripts/010_Data/002_PBS data/014_TrainerType.rb b/Data/Scripts/010_Data/002_PBS data/014_TrainerType.rb index 07ae08512..37d81867e 100644 --- a/Data/Scripts/010_Data/002_PBS data/014_TrainerType.rb +++ b/Data/Scripts/010_Data/002_PBS data/014_TrainerType.rb @@ -15,10 +15,10 @@ module GameData SCHEMA = { "Name" => [:name, "s"], - "Gender" => [:gender, "e", {"Male" => 0, "male" => 0, "M" => 0, "m" => 0, "0" => 0, + "Gender" => [:gender, "e", { "Male" => 0, "male" => 0, "M" => 0, "m" => 0, "0" => 0, "Female" => 1, "female" => 1, "F" => 1, "f" => 1, "1" => 1, "Unknown" => 2, "unknown" => 2, "Other" => 2, "other" => 2, - "Mixed" => 2, "mixed" => 2, "X" => 2, "x" => 2, "2" => 2}], + "Mixed" => 2, "mixed" => 2, "X" => 2, "x" => 2, "2" => 2 }], "BaseMoney" => [:base_money, "u"], "SkillLevel" => [:skill_level, "u"], "Flags" => [:flags, "*s"], 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 00c6e2438..729e57721 100644 --- a/Data/Scripts/011_Battle/001_Battle/009_Battle_CommandPhase.rb +++ b/Data/Scripts/011_Battle/001_Battle/009_Battle_CommandPhase.rb @@ -76,10 +76,10 @@ class Battle ret = true else # Chose a move to use next false if cmd<0 || !@battlers[idxBattler].moves[cmd] || - !@battlers[idxBattler].moves[cmd].id + !@battlers[idxBattler].moves[cmd].id next false if !pbRegisterMove(idxBattler,cmd) next false if !singleBattle? && - !pbChooseTarget(@battlers[idxBattler],@battlers[idxBattler].moves[cmd]) + !pbChooseTarget(@battlers[idxBattler],@battlers[idxBattler].moves[cmd]) ret = true end next true 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 7f9500cc0..c6edef241 100644 --- a/Data/Scripts/011_Battle/002_Battler/005_Battler_StatStages.rb +++ b/Data/Scripts/011_Battle/002_Battler/005_Battler_StatStages.rb @@ -55,7 +55,8 @@ class Battle::Battler arrStatTexts = [ _INTL("{1}'s {2} rose!",pbThis,GameData::Stat.get(stat).name), _INTL("{1}'s {2} rose sharply!",pbThis,GameData::Stat.get(stat).name), - _INTL("{1}'s {2} rose drastically!",pbThis,GameData::Stat.get(stat).name)] + _INTL("{1}'s {2} rose drastically!",pbThis,GameData::Stat.get(stat).name) + ] @battle.pbDisplay(arrStatTexts[[increment-1,2].min]) # Trigger abilities upon stat gain if abilityActive? @@ -78,12 +79,14 @@ class Battle::Battler arrStatTexts = [ _INTL("{1}'s {2} raised its {3}!",pbThis,cause,GameData::Stat.get(stat).name), _INTL("{1}'s {2} sharply raised its {3}!",pbThis,cause,GameData::Stat.get(stat).name), - _INTL("{1}'s {2} drastically raised its {3}!",pbThis,cause,GameData::Stat.get(stat).name)] + _INTL("{1}'s {2} drastically raised its {3}!",pbThis,cause,GameData::Stat.get(stat).name) + ] else arrStatTexts = [ _INTL("{1}'s {2} raised {3}'s {4}!",user.pbThis,cause,pbThis(true),GameData::Stat.get(stat).name), _INTL("{1}'s {2} sharply raised {3}'s {4}!",user.pbThis,cause,pbThis(true),GameData::Stat.get(stat).name), - _INTL("{1}'s {2} drastically raised {3}'s {4}!",user.pbThis,cause,pbThis(true),GameData::Stat.get(stat).name)] + _INTL("{1}'s {2} drastically raised {3}'s {4}!",user.pbThis,cause,pbThis(true),GameData::Stat.get(stat).name) + ] end @battle.pbDisplay(arrStatTexts[[increment-1,2].min]) # Trigger abilities upon stat gain @@ -214,7 +217,8 @@ class Battle::Battler arrStatTexts = [ _INTL("{1}'s {2} fell!",pbThis,GameData::Stat.get(stat).name), _INTL("{1}'s {2} harshly fell!",pbThis,GameData::Stat.get(stat).name), - _INTL("{1}'s {2} severely fell!",pbThis,GameData::Stat.get(stat).name)] + _INTL("{1}'s {2} severely fell!",pbThis,GameData::Stat.get(stat).name) + ] @battle.pbDisplay(arrStatTexts[[increment-1,2].min]) # Trigger abilities upon stat loss if abilityActive? @@ -254,12 +258,14 @@ class Battle::Battler arrStatTexts = [ _INTL("{1}'s {2} lowered its {3}!",pbThis,cause,GameData::Stat.get(stat).name), _INTL("{1}'s {2} harshly lowered its {3}!",pbThis,cause,GameData::Stat.get(stat).name), - _INTL("{1}'s {2} severely lowered its {3}!",pbThis,cause,GameData::Stat.get(stat).name)] + _INTL("{1}'s {2} severely lowered its {3}!",pbThis,cause,GameData::Stat.get(stat).name) + ] else arrStatTexts = [ _INTL("{1}'s {2} lowered {3}'s {4}!",user.pbThis,cause,pbThis(true),GameData::Stat.get(stat).name), _INTL("{1}'s {2} harshly lowered {3}'s {4}!",user.pbThis,cause,pbThis(true),GameData::Stat.get(stat).name), - _INTL("{1}'s {2} severely lowered {3}'s {4}!",user.pbThis,cause,pbThis(true),GameData::Stat.get(stat).name)] + _INTL("{1}'s {2} severely lowered {3}'s {4}!",user.pbThis,cause,pbThis(true),GameData::Stat.get(stat).name) + ] end @battle.pbDisplay(arrStatTexts[[increment-1,2].min]) # Trigger abilities upon stat loss 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 283a680f4..2d47a2652 100644 --- a/Data/Scripts/011_Battle/002_Battler/007_Battler_UseMove.rb +++ b/Data/Scripts/011_Battle/002_Battler/007_Battler_UseMove.rb @@ -56,7 +56,7 @@ class Battle::Battler end # Use the move PBDebug.log("[Move usage] #{pbThis} started using #{choice[2].name}") - PBDebug.logonerr{ + PBDebug.logonerr { pbUseMove(choice,choice[2]==@battle.struggle) } @battle.pbJudge @@ -173,7 +173,7 @@ class Battle::Battler choice[2] = Battle::Move.from_pokemon_move(@battle, Pokemon::Move.new(@currentMove)) specialUsage = true elsif @effects[PBEffects::Encore]>0 && choice[1]>=0 && - @battle.pbCanShowCommands?(@index) + @battle.pbCanShowCommands?(@index) idxEncoredMove = pbEncoredMoveIndex if idxEncoredMove>=0 && @battle.pbCanChooseMove?(@index,idxEncoredMove,false) if choice[1]!=idxEncoredMove # Change move if battler was Encored mid-round @@ -403,7 +403,7 @@ class Battle::Battler b.effects[PBEffects::MagicCoat] = false break elsif b.hasActiveAbility?(:MAGICBOUNCE) && !@battle.moldBreaker && - !b.effects[PBEffects::MagicBounce] + !b.effects[PBEffects::MagicBounce] magicBouncer = b.index b.effects[PBEffects::MagicBounce] = true break @@ -525,7 +525,7 @@ class Battle::Battler @battle.pbDisplay(_INTL("{1} used the move instructed by {2}!",b.pbThis,user.pbThis(true))) b.effects[PBEffects::Instructed] = true if b.pbCanChooseMove?(@moves[idxMove], false) - PBDebug.logonerr{ + PBDebug.logonerr { b.pbUseMoveSimple(b.lastMoveUsed,b.lastRegularMoveTarget,idxMove,false) } b.lastRoundMoved = oldLastRoundMoved @@ -561,7 +561,7 @@ class Battle::Battler end nextUser.effects[PBEffects::Dancer] = true if nextUser.pbCanChooseMove?(move, false) - PBDebug.logonerr{ + PBDebug.logonerr { nextUser.pbUseMoveSimple(move.id,preTarget) } nextUser.lastRoundMoved = oldLastRoundMoved 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 bcb3125a4..96920ca39 100644 --- a/Data/Scripts/011_Battle/003_Move/002_Move_Usage.rb +++ b/Data/Scripts/011_Battle/003_Move/002_Move_Usage.rb @@ -209,7 +209,7 @@ class Battle::Move target.damageState.focusBand = true damage -= 1 elsif Settings::AFFECTION_EFFECTS && @battle.internalBattle && - target.pbOwnedByPlayer? && !target.mega? + target.pbOwnedByPlayer? && !target.mega? chance = [0, 0, 0, 10, 15, 25][target.affection_level] if chance > 0 && @battle.pbRandom(100) < chance target.damageState.affection_endured = true 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 cef9f043d..59b6bcf7d 100644 --- a/Data/Scripts/011_Battle/003_Move/003_Move_UsageCalculations.rb +++ b/Data/Scripts/011_Battle/003_Move/003_Move_UsageCalculations.rb @@ -60,7 +60,8 @@ class Battle::Move def pbCalcTypeMod(moveType,user,target) return Effectiveness::NORMAL_EFFECTIVE if !moveType return Effectiveness::NORMAL_EFFECTIVE if moveType == :GROUND && - target.pbHasType?(:FLYING) && target.hasActiveItem?(:IRONBALL) + target.pbHasType?(:FLYING) && + target.hasActiveItem?(:IRONBALL) # Determine types tTypes = target.pbTypes(true) # Get effectivenesses 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 0edba488c..2909c6a5d 100644 --- a/Data/Scripts/011_Battle/003_Move/008_MoveEffects_MoveAttributes.rb +++ b/Data/Scripts/011_Battle/003_Move/008_MoveEffects_MoveAttributes.rb @@ -631,7 +631,7 @@ end class Battle::Move::DoublePowerIfTargetNotActed < Battle::Move def pbBaseDamage(baseDmg, user, target) if @battle.choices[target.index][0] == :None || # Switched in - ([:UseMove, :Shift].include?(@battle.choices[target.index][0]) && !target.movedThisRound?) + ([:UseMove, :Shift].include?(@battle.choices[target.index][0]) && !target.movedThisRound?) baseDmg *= 2 end return baseDmg diff --git a/Data/Scripts/011_Battle/003_Move/009_MoveEffects_MultiHit.rb b/Data/Scripts/011_Battle/003_Move/009_MoveEffects_MultiHit.rb index 023d73414..898bb35ab 100644 --- a/Data/Scripts/011_Battle/003_Move/009_MoveEffects_MultiHit.rb +++ b/Data/Scripts/011_Battle/003_Move/009_MoveEffects_MultiHit.rb @@ -144,7 +144,8 @@ class Battle::Move::HitTwoToFiveTimesRaiseUserSpd1LowerUserDef1 < Battle::Move 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, - 5, 5, 5] + 5, 5, 5 + ] r = @battle.pbRandom(hitChances.length) r = hitChances.length - 1 if user.hasActiveAbility?(:SKILLLINK) return hitChances[r] 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 f711adc23..d86a4de87 100644 --- a/Data/Scripts/011_Battle/003_Move/011_MoveEffects_Items.rb +++ b/Data/Scripts/011_Battle/003_Move/011_MoveEffects_Items.rb @@ -396,45 +396,37 @@ class Battle::Move::ThrowUserItemAtTarget < Battle::Move # 80 => all Mega Stones # 10 => all Berries @flingPowers = { - 130 => [:IRONBALL - ], + 130 => [:IRONBALL], 100 => [:HARDSTONE,:RAREBONE, # Fossils :ARMORFOSSIL,:CLAWFOSSIL,:COVERFOSSIL,:DOMEFOSSIL,:HELIXFOSSIL, :JAWFOSSIL,:OLDAMBER,:PLUMEFOSSIL,:ROOTFOSSIL,:SAILFOSSIL, - :SKULLFOSSIL - ], + :SKULLFOSSIL], 90 => [:DEEPSEATOOTH,:GRIPCLAW,:THICKCLUB, # Plates :DRACOPLATE,:DREADPLATE,:EARTHPLATE,:FISTPLATE,:FLAMEPLATE, :ICICLEPLATE,:INSECTPLATE,:IRONPLATE,:MEADOWPLATE,:MINDPLATE, :PIXIEPLATE,:SKYPLATE,:SPLASHPLATE,:SPOOKYPLATE,:STONEPLATE, - :TOXICPLATE,:ZAPPLATE - ], + :TOXICPLATE,:ZAPPLATE], 80 => [:ASSAULTVEST,:CHIPPEDPOT,:CRACKEDPOT,:DAWNSTONE,:DUSKSTONE, :ELECTIRIZER,:HEAVYDUTYBOOTS,:MAGMARIZER,:ODDKEYSTONE,:OVALSTONE, :PROTECTOR,:QUICKCLAW,:RAZORCLAW,:SACHET,:SAFETYGOGGLES, - :SHINYSTONE,:STICKYBARB,:WEAKNESSPOLICY,:WHIPPEDDREAM - ], + :SHINYSTONE,:STICKYBARB,:WEAKNESSPOLICY,:WHIPPEDDREAM], 70 => [:DRAGONFANG,:POISONBARB, # EV-training items (Macho Brace is 60) :POWERANKLET,:POWERBAND,:POWERBELT,:POWERBRACER,:POWERLENS, :POWERWEIGHT, # Drives - :BURNDRIVE,:CHILLDRIVE,:DOUSEDRIVE,:SHOCKDRIVE - ], + :BURNDRIVE,:CHILLDRIVE,:DOUSEDRIVE,:SHOCKDRIVE], 60 => [:ADAMANTORB,:DAMPROCK,:GRISEOUSORB,:HEATROCK,:LEEK,:LUSTROUSORB, - :MACHOBRACE,:ROCKYHELMET,:STICK,:TERRAINEXTENDER - ], + :MACHOBRACE,:ROCKYHELMET,:STICK,:TERRAINEXTENDER], 50 => [:DUBIOUSDISC,:SHARPBEAK, # Memories :BUGMEMORY,:DARKMEMORY,:DRAGONMEMORY,:ELECTRICMEMORY,:FAIRYMEMORY, :FIGHTINGMEMORY,:FIREMEMORY,:FLYINGMEMORY,:GHOSTMEMORY, :GRASSMEMORY,:GROUNDMEMORY,:ICEMEMORY,:POISONMEMORY, - :PSYCHICMEMORY,:ROCKMEMORY,:STEELMEMORY,:WATERMEMORY - ], - 40 => [:EVIOLITE,:ICYROCK,:LUCKYPUNCH - ], + :PSYCHICMEMORY,:ROCKMEMORY,:STEELMEMORY,:WATERMEMORY], + 40 => [:EVIOLITE,:ICYROCK,:LUCKYPUNCH], 30 => [:ABSORBBULB,:ADRENALINEORB,:AMULETCOIN,:BINDINGBAND,:BLACKBELT, :BLACKGLASSES,:BLACKSLUDGE,:BOTTLECAP,:CELLBATTERY,:CHARCOAL, :CLEANSETAG,:DEEPSEASCALE,:DRAGONSCALE,:EJECTBUTTON,:ESCAPEROPE, @@ -486,15 +478,12 @@ class Battle::Move::ThrowUserItemAtTarget < Battle::Move :RELICGOLD,:RELICSILVER,:RELICSTATUE,:RELICVASE,:STARDUST, :STARPIECE,:STRANGESOUVENIR,:TINYMUSHROOM, # Exp Candies - :EXPCANDYXS, :EXPCANDYS, :EXPCANDYM, :EXPCANDYL, :EXPCANDYXL - ], - 20 => [ - # Feathers + :EXPCANDYXS, :EXPCANDYS, :EXPCANDYM, :EXPCANDYL, :EXPCANDYXL], + 20 => [ # Feathers :CLEVERFEATHER,:GENIUSFEATHER,:HEALTHFEATHER,:MUSCLEFEATHER, :PRETTYFEATHER,:RESISTFEATHER,:SWIFTFEATHER, :CLEVERWING,:GENIUSWING,:HEALTHWING,:MUSCLEWING,:PRETTYWING, - :RESISTWING,:SWIFTWING - ], + :RESISTWING,:SWIFTWING], 10 => [:AIRBALLOON,:BIGROOT,:BRIGHTPOWDER,:CHOICEBAND,:CHOICESCARF, :CHOICESPECS,:DESTINYKNOT,:DISCOUNTCOUPON,:EXPERTBELT,:FOCUSBAND, :FOCUSSASH,:LAGGINGTAIL,:LEFTOVERS,:MENTALHERB,:METALPOWDER, @@ -518,8 +507,7 @@ class Battle::Move::ThrowUserItemAtTarget < Battle::Move :SERIOUSMINT, # Sweets :STRAWBERRYSWEET, :LOVESWEET, :BERRYSWEET, :CLOVERSWEET, - :FLOWERSWEET, :STARSWEET, :RIBBONSWEET - ] + :FLOWERSWEET, :STARSWEET, :RIBBONSWEET] } end 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 2de395e6c..ee02532ef 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 @@ -9,6 +9,7 @@ class Battle::Scene::MenuBase attr_reader :color attr_reader :index attr_reader :mode + # NOTE: Button width is half the width of the graphic containing them all. BUTTON_HEIGHT = 46 TEXT_BASE_COLOR = Battle::Scene::MESSAGE_BASE_COLOR @@ -202,6 +203,7 @@ end class Battle::Scene::FightMenu < Battle::Scene::MenuBase attr_reader :battler attr_reader :shiftMode + GET_MOVE_TEXT_COLOR_FROM_MOVE_BUTTON = true # If true, displays graphics from Graphics/Pictures/Battle/overlay_fight.png @@ -408,7 +410,7 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase ppFraction = [(4.0*move.pp/move.total_pp).ceil,3].min textPos = [] textPos.push([_INTL("PP: {1}/{2}",move.pp,move.total_pp), - 448,44,2,PP_COLORS[ppFraction*2],PP_COLORS[ppFraction*2+1]]) + 448,44,2,PP_COLORS[ppFraction*2],PP_COLORS[ppFraction*2+1]]) pbDrawTextPositions(@infoOverlay.bitmap,textPos) end end diff --git a/Data/Scripts/011_Battle/004_Scene/006_Battle_Scene_Objects.rb b/Data/Scripts/011_Battle/004_Scene/006_Battle_Scene_Objects.rb index 17826dfa2..e5836b871 100644 --- a/Data/Scripts/011_Battle/004_Scene/006_Battle_Scene_Objects.rb +++ b/Data/Scripts/011_Battle/004_Scene/006_Battle_Scene_Objects.rb @@ -256,7 +256,7 @@ class Battle::Scene::PokemonDataBox < SpriteWrapper s = GameData::Status.get(@battler.status).icon_position end imagePos.push(["Graphics/Pictures/Battle/icon_statuses",@spriteBaseX+24,36, - 0, s * STATUS_ICON_HEIGHT, -1, STATUS_ICON_HEIGHT]) if s >= 0 + 0, s * STATUS_ICON_HEIGHT, -1, STATUS_ICON_HEIGHT]) if s >= 0 end pbDrawImagePositions(self.bitmap,imagePos) refreshHP @@ -456,10 +456,10 @@ class Battle::Scene::AbilitySplashBar < SpriteWrapper textX = (@side==0) ? 10 : self.bitmap.width-8 # Draw Pokémon's name textPos.push([_INTL("{1}'s",@battler.name),textX,-4,@side==1, - TEXT_BASE_COLOR,TEXT_SHADOW_COLOR,true]) + TEXT_BASE_COLOR,TEXT_SHADOW_COLOR,true]) # Draw Pokémon's ability textPos.push([@battler.abilityName,textX,26,@side==1, - TEXT_BASE_COLOR,TEXT_SHADOW_COLOR,true]) + TEXT_BASE_COLOR,TEXT_SHADOW_COLOR,true]) pbDrawTextPositions(self.bitmap,textPos) end diff --git a/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb b/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb index fd3fb9c9f..c0f3908ed 100644 --- a/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb +++ b/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb @@ -71,7 +71,7 @@ module Battle::Scene::Animation::BallAnimationMixin when :ULTRABALL then return Color.new(255, 255, 123) when :MASTERBALL then return Color.new(189, 165, 231) when :NETBALL then return Color.new(173, 255, 206) - when :DIVEBALL then return Color.new( 99, 206, 247) + when :DIVEBALL then return Color.new(99, 206, 247) when :NESTBALL then return Color.new(247, 222, 82) when :REPEATBALL then return Color.new(255, 198, 132) when :TIMERBALL then return Color.new(239, 247, 247) diff --git a/Data/Scripts/011_Battle/005_AI/005_AI_Move_EffectScores.rb b/Data/Scripts/011_Battle/005_AI/005_AI_Move_EffectScores.rb index 1538c3dca..36192b159 100644 --- a/Data/Scripts/011_Battle/005_AI/005_AI_Move_EffectScores.rb +++ b/Data/Scripts/011_Battle/005_AI/005_AI_Move_EffectScores.rb @@ -78,8 +78,8 @@ class Battle::AI Effectiveness.ineffective?(pbCalcTypeMod(move.type,user,target))) score += 30 if skill>=PBTrainerAI.mediumSkill - aspeed = pbRoughStat(user,:SPEED,skill) - ospeed = pbRoughStat(target,:SPEED,skill) + aspeed = pbRoughStat(user,:SPEED,skill) + ospeed = pbRoughStat(target,:SPEED,skill) if aspeedospeed @@ -197,7 +197,7 @@ class Battle::AI if user.hp=PBTrainerAI.highSkill && - user.hp<(user.effects[PBEffects::Toxic]+1)*user.totalhp/16 + user.hp<(user.effects[PBEffects::Toxic]+1)*user.totalhp/16 score += 60 end end @@ -1353,7 +1353,7 @@ class Battle::AI if !user.canChangeType? score -= 90 elsif !target.lastMoveUsed || !target.lastMoveUsedType || - GameData::Type.get(target.lastMoveUsedType).pseudo_type + GameData::Type.get(target.lastMoveUsedType).pseudo_type score -= 90 else aType = nil @@ -1431,7 +1431,7 @@ class Battle::AI if !user.canChangeType? || target.pbTypes(true).length == 0 score -= 90 elsif user.pbTypes == target.pbTypes && - user.effects[PBEffects::Type3] == target.effects[PBEffects::Type3] + user.effects[PBEffects::Type3] == target.effects[PBEffects::Type3] score -= 90 end #--------------------------------------------------------------------------- @@ -1477,9 +1477,9 @@ class Battle::AI score -= 90 elsif skill>=PBTrainerAI.mediumSkill if !user.ability || user.ability==target.ability || - [:MULTITYPE, :RKSSYSTEM, :TRUANT].include?(target.ability_id) || - [:FLOWERGIFT, :FORECAST, :ILLUSION, :IMPOSTER, :MULTITYPE, :RKSSYSTEM, - :TRACE, :ZENMODE].include?(user.ability_id) + [:MULTITYPE, :RKSSYSTEM, :TRUANT].include?(target.ability_id) || + [:FLOWERGIFT, :FORECAST, :ILLUSION, :IMPOSTER, :MULTITYPE, :RKSSYSTEM, + :TRACE, :ZENMODE].include?(user.ability_id) score -= 90 end if skill>=PBTrainerAI.highSkill @@ -1547,7 +1547,7 @@ class Battle::AI when "FixedDamageUserLevelRandom" score += 30 if target.hp<=user.level #--------------------------------------------------------------------------- - when "OHKO", "OHKOIce", "OHKOHitsUndergroundTarget" + when "OHKO", "OHKOIce", "OHKOHitsUndergroundTarget" score -= 90 if target.hasActiveAbility?(:STURDY) score -= 90 if target.level>user.level #--------------------------------------------------------------------------- @@ -1764,7 +1764,7 @@ class Battle::AI score -= 40 if skill>=PBTrainerAI.highSkill score -= 100 if !target.lastRegularMoveUsed || - !GameData::Move.get(target.lastRegularMoveUsed).flags.any? { |f| f[/^CanMirrorMove$/i] } + !GameData::Move.get(target.lastRegularMoveUsed).flags.any? { |f| f[/^CanMirrorMove$/i] } end #--------------------------------------------------------------------------- when "UseLastMoveUsed" @@ -1817,8 +1817,8 @@ class Battle::AI [:User, :BothSides].include?(moveData.target) score += 60 elsif moveData.category != 2 && # Damaging move - moveData.target == :NearOther && - Effectiveness.ineffective?(pbCalcTypeMod(moveData.type, target, user)) + moveData.target == :NearOther && + Effectiveness.ineffective?(pbCalcTypeMod(moveData.type, target, user)) score += 60 end end @@ -2184,8 +2184,8 @@ class Battle::AI if target.pbCanParalyze?(user,false) score += 30 if skill>=PBTrainerAI.mediumSkill - aspeed = pbRoughStat(user,:SPEED,skill) - ospeed = pbRoughStat(target,:SPEED,skill) + aspeed = pbRoughStat(user,:SPEED,skill) + ospeed = pbRoughStat(target,:SPEED,skill) if aspeedospeed @@ -2874,8 +2874,8 @@ class Battle::AI #--------------------------------------------------------------------------- when "NegateTargetAbilityIfTargetActed" if skill>=PBTrainerAI.mediumSkill - userSpeed = pbRoughStat(user,:SPEED,skill) - targetSpeed = pbRoughStat(target,:SPEED,skill) + userSpeed = pbRoughStat(user,:SPEED,skill) + targetSpeed = pbRoughStat(target,:SPEED,skill) if userSpeed 0 score -= 90 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 32130f21f..51110a2c6 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 @@ -57,7 +57,8 @@ class Battle::AI def pbCalcTypeMod(moveType,user,target) return Effectiveness::NORMAL_EFFECTIVE if !moveType return Effectiveness::NORMAL_EFFECTIVE if moveType == :GROUND && - target.pbHasType?(:FLYING) && target.hasActiveItem?(:IRONBALL) + target.pbHasType?(:FLYING) && + target.hasActiveItem?(:IRONBALL) # Determine types tTypes = target.pbTypes(true) # Get effectivenesses diff --git a/Data/Scripts/011_Battle/006_Other battle code/005_Battle_CatchAndStoreMixin.rb b/Data/Scripts/011_Battle/006_Other battle code/005_Battle_CatchAndStoreMixin.rb index e38e625f4..aec8af49b 100644 --- a/Data/Scripts/011_Battle/006_Other battle code/005_Battle_CatchAndStoreMixin.rb +++ b/Data/Scripts/011_Battle/006_Other battle code/005_Battle_CatchAndStoreMixin.rb @@ -166,7 +166,7 @@ module Battle::CatchAndStoreMixin # Definite capture, no need to perform randomness checks return 4 if x>=255 || Battle::PokeBallEffects.isUnconditional?(ball, self, battler) # Second half of the shakes calculation - y = ( 65536 / ((255.0/x)**0.1875) ).floor + y = (65536 / ((255.0/x)**0.1875)).floor # Critical capture check if Settings::ENABLE_CRITICAL_CAPTURES dex_modifier = 0 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 a620983a5..85aee4166 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 @@ -426,6 +426,7 @@ class PBAnimation < Array attr_writer :speed attr_reader :array attr_reader :timing + MAX_SPRITES = 60 def speed @@ -698,6 +699,7 @@ end #=============================================================================== class PBAnimationPlayerX attr_accessor :looping + MAX_SPRITES = 60 def initialize(animation,user,target,scene=nil,oppMove=false,inEditor=false) diff --git a/Data/Scripts/011_Battle/006_Other battle code/008_Battle_AbilityEffects.rb b/Data/Scripts/011_Battle/006_Other battle code/008_Battle_AbilityEffects.rb index 58b6e52dd..2666e2d33 100644 --- a/Data/Scripts/011_Battle/006_Other battle code/008_Battle_AbilityEffects.rb +++ b/Data/Scripts/011_Battle/006_Other battle code/008_Battle_AbilityEffects.rb @@ -198,7 +198,7 @@ module Battle::AbilityEffects end def self.triggerDamageCalcFromTargetNonIgnorable(ability, user, target, move, mults, base_damage, type) - DamageCalcFromTargetNonIgnorable.trigger(ability, user, target, move, mults, base_damage, type) + DamageCalcFromTargetNonIgnorable.trigger(ability, user, target, move, mults, base_damage, type) end def self.triggerDamageCalcFromTargetAlly(ability, user, target, move, mults, base_damage, type) diff --git a/Data/Scripts/011_Battle/007_Other battle types/003_BattlePalaceBattle.rb b/Data/Scripts/011_Battle/007_Other battle types/003_BattlePalaceBattle.rb index ffb5cec3d..ff29ee407 100644 --- a/Data/Scripts/011_Battle/007_Other battle types/003_BattlePalaceBattle.rb +++ b/Data/Scripts/011_Battle/007_Other battle types/003_BattlePalaceBattle.rb @@ -68,7 +68,7 @@ class BattlePalaceBattle < Battle if move.target == :User || move.function == "MultiTurnAttackBideThenReturnDoubleDamage" return 1 elsif move.statusMove? || - move.function == "CounterPhysicalDamage" || move.function == "CounterSpecialDamage" + move.function == "CounterPhysicalDamage" || move.function == "CounterSpecialDamage" return 2 else return 0 @@ -194,7 +194,7 @@ class Battle::AI if thispkmn.effects[PBEffects::PerishSong]==1 shouldswitch = true elsif !@battle.pbCanChooseAnyMove?(idxBattler) && - thispkmn.turnCount && thispkmn.turnCount>5 + thispkmn.turnCount && thispkmn.turnCount>5 shouldswitch = true else hppercent = thispkmn.hp*100/thispkmn.totalhp 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 7abeb2e8f..5b3f11e3c 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 @@ -277,8 +277,8 @@ class Battle::Scene 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]")) { - pbBattleArenaUpdate - dimmingvp.update + pbBattleArenaUpdate + dimmingvp.update } dimmingvp.z = 99999 infowindow = SpriteWindow_Base.new(80,0,320,224) @@ -305,23 +305,23 @@ class Battle::Scene updateJudgment(infowindow,1,battler1,battler2,ratings1,ratings2) pbMessageDisplay(msgwindow, _INTL("REFEREE: Judging category 1, Mind!\nThe Pokémon showing the most guts!\\wtnp[40]")) { - pbBattleArenaUpdate - dimmingvp.update - infowindow.update + 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]")) { - pbBattleArenaUpdate - dimmingvp.update - infowindow.update + 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]")) { - pbBattleArenaUpdate - dimmingvp.update - infowindow.update + pbBattleArenaUpdate + dimmingvp.update + infowindow.update } total1 = 0 total2 = 0 @@ -332,25 +332,25 @@ class Battle::Scene if total1==total2 pbMessageDisplay(msgwindow, _INTL("REFEREE: Judgment: {1} to {2}!\nWe have a draw!\\wtnp[40]",total1,total2)) { - pbBattleArenaUpdate - dimmingvp.update - infowindow.update + 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)) { - pbBattleArenaUpdate - dimmingvp.update - infowindow.update + pbBattleArenaUpdate + dimmingvp.update + infowindow.update } else pbMessageDisplay(msgwindow, _INTL("REFEREE: Judgment: {1} to {2}!\nThe winner is {3}!\\wtnp[40]", total1,total2,battler2.name)) { - pbBattleArenaUpdate - dimmingvp.update - infowindow.update + pbBattleArenaUpdate + dimmingvp.update + infowindow.update } end infowindow.visible = false diff --git a/Data/Scripts/012_Overworld/001_Overworld visuals/001_Overworld_Weather.rb b/Data/Scripts/012_Overworld/001_Overworld visuals/001_Overworld_Weather.rb index c385685ea..3f0cf2749 100644 --- a/Data/Scripts/012_Overworld/001_Overworld visuals/001_Overworld_Weather.rb +++ b/Data/Scripts/012_Overworld/001_Overworld visuals/001_Overworld_Weather.rb @@ -7,6 +7,7 @@ module RPG attr_reader :max attr_reader :ox attr_reader :oy + MAX_SPRITES = 60 FADE_OLD_TILES_START = 0 FADE_OLD_TILES_END = 1 diff --git a/Data/Scripts/012_Overworld/002_Battle triggering/002_Overworld_BattleIntroAnim.rb b/Data/Scripts/012_Overworld/002_Battle triggering/002_Overworld_BattleIntroAnim.rb index 932bc5a3e..05f47371a 100644 --- a/Data/Scripts/012_Overworld/002_Battle triggering/002_Overworld_BattleIntroAnim.rb +++ b/Data/Scripts/012_Overworld/002_Battle triggering/002_Overworld_BattleIntroAnim.rb @@ -72,7 +72,7 @@ def pbBattleAnimation(bgm=nil,battletype=0,foe=nil) if $PokemonGlobal.surfing || $PokemonGlobal.diving location = 3 elsif $game_temp.encounter_type && - GameData::EncounterType.get($game_temp.encounter_type).type == :fishing + GameData::EncounterType.get($game_temp.encounter_type).type == :fishing location = 3 elsif $PokemonEncounters.has_cave_encounters? location = 2 @@ -284,9 +284,9 @@ SpecialBattleIntroAnimations.register("vs_animation", 50, # Priority 50 trainername = foe[0].name textpos = [ [$player.name, Graphics.width / 4, (Graphics.height / 1.5) + 4, 2, - Color.new(248, 248, 248), Color.new(72, 72, 72)], + Color.new(248, 248, 248), Color.new(72, 72, 72)], [trainername, (Graphics.width / 4) + (Graphics.width / 2), (Graphics.height / 1.5) + 4, 2, - Color.new(248, 248, 248), Color.new(72, 72, 72)] + Color.new(248, 248, 248), Color.new(72, 72, 72)] ] pbDrawTextPositions(overlay.bitmap, textpos) # Fade out flash, shudder Vs logo and expand it, and then fade to black diff --git a/Data/Scripts/012_Overworld/002_Battle triggering/003_Overworld_WildEncounters.rb b/Data/Scripts/012_Overworld/002_Battle triggering/003_Overworld_WildEncounters.rb index c333082f5..4b30ae311 100644 --- a/Data/Scripts/012_Overworld/002_Battle triggering/003_Overworld_WildEncounters.rb +++ b/Data/Scripts/012_Overworld/002_Battle triggering/003_Overworld_WildEncounters.rb @@ -469,7 +469,7 @@ def pbEncounter(enc_type) else pbWildBattle(encounter1[0], encounter1[1]) end - $game_temp.encounter_type = nil + $game_temp.encounter_type = nil $game_temp.force_single_battle = false EncounterModifier.triggerEncounterEnd return true diff --git a/Data/Scripts/012_Overworld/002_Battle triggering/005_Overworld_RoamingPokemon.rb b/Data/Scripts/012_Overworld/002_Battle triggering/005_Overworld_RoamingPokemon.rb index edfd865da..f9778731a 100644 --- a/Data/Scripts/012_Overworld/002_Battle triggering/005_Overworld_RoamingPokemon.rb +++ b/Data/Scripts/012_Overworld/002_Battle triggering/005_Overworld_RoamingPokemon.rb @@ -98,7 +98,7 @@ Events.onMapChange += proc { |_sender,e| # Get and compare map names mapInfos = pbLoadMapInfos next if mapInfos && oldMapID>0 && mapInfos[oldMapID] && - mapInfos[oldMapID].name && $game_map.name==mapInfos[oldMapID].name + mapInfos[oldMapID].name && $game_map.name==mapInfos[oldMapID].name # Make roaming Pokémon roam pbRoamPokemon $PokemonGlobal.roamedAlready = false diff --git a/Data/Scripts/012_Overworld/003_Overworld_Time.rb b/Data/Scripts/012_Overworld/003_Overworld_Time.rb index aafd7d69e..9065c34de 100644 --- a/Data/Scripts/012_Overworld/003_Overworld_Time.rb +++ b/Data/Scripts/012_Overworld/003_Overworld_Time.rb @@ -147,7 +147,8 @@ def moonphase(time=nil) # in UTC 16.6109562298125, 20.3022798364375, 23.9936034430625, - 27.6849270496875] + 27.6849270496875 + ] yy = time.year-((12-time.mon)/10.0).floor j = (365.25*(4712+yy)).floor + (((time.mon+9)%12)*30.6+0.5).floor + time.day+59 j -= (((yy/100.0)+49).floor*0.75).floor-38 if j>2299160 @@ -219,7 +220,8 @@ def pbIsWeekday(wdayVariable,*arg) _INTL("Wednesday"), _INTL("Thursday"), _INTL("Friday"), - _INTL("Saturday")][wday] + _INTL("Saturday") + ][wday] $game_map.need_refresh = true if $game_map end return ret @@ -291,7 +293,8 @@ def pbIsSeason(seasonVariable,*arg) _INTL("Spring"), _INTL("Summer"), _INTL("Autumn"), - _INTL("Winter")][thisseason] + _INTL("Winter") + ][thisseason] $game_map.need_refresh = true if $game_map end return ret diff --git a/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb b/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb index 5b4172d9b..4a0f4ee87 100644 --- a/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb +++ b/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb @@ -312,17 +312,17 @@ def pbDive pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name)) pbHiddenMoveAnimation(movefinder) pbFadeOutIn { - $game_temp.player_new_map_id = map_metadata.dive_map_id - $game_temp.player_new_x = $game_player.x - $game_temp.player_new_y = $game_player.y - $game_temp.player_new_direction = $game_player.direction - $PokemonGlobal.surfing = false - $PokemonGlobal.diving = true - $stats.dive_count += 1 - pbUpdateVehicle - $scene.transfer_player(false) - $game_map.autoplay - $game_map.refresh + $game_temp.player_new_map_id = map_metadata.dive_map_id + $game_temp.player_new_x = $game_player.x + $game_temp.player_new_y = $game_player.y + $game_temp.player_new_direction = $game_player.direction + $PokemonGlobal.surfing = false + $PokemonGlobal.diving = true + $stats.dive_count += 1 + pbUpdateVehicle + $scene.transfer_player(false) + $game_map.autoplay + $game_map.refresh } return true end @@ -350,17 +350,17 @@ def pbSurfacing pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name)) pbHiddenMoveAnimation(movefinder) pbFadeOutIn { - $game_temp.player_new_map_id = surface_map_id - $game_temp.player_new_x = $game_player.x - $game_temp.player_new_y = $game_player.y - $game_temp.player_new_direction = $game_player.direction - $PokemonGlobal.surfing = true - $PokemonGlobal.diving = false - pbUpdateVehicle - $scene.transfer_player(false) - surfbgm = GameData::Metadata.get.surf_BGM - (surfbgm) ? pbBGMPlay(surfbgm) : $game_map.autoplayAsCue - $game_map.refresh + $game_temp.player_new_map_id = surface_map_id + $game_temp.player_new_x = $game_player.x + $game_temp.player_new_y = $game_player.y + $game_temp.player_new_direction = $game_player.direction + $PokemonGlobal.surfing = true + $PokemonGlobal.diving = false + pbUpdateVehicle + $scene.transfer_player(false) + surfbgm = GameData::Metadata.get.surf_BGM + (surfbgm) ? pbBGMPlay(surfbgm) : $game_map.autoplayAsCue + $game_map.refresh } return true end diff --git a/Data/Scripts/012_Overworld/006_Overworld_BerryPlants.rb b/Data/Scripts/012_Overworld/006_Overworld_BerryPlants.rb index c99aa389a..221dffd18 100644 --- a/Data/Scripts/012_Overworld/006_Overworld_BerryPlants.rb +++ b/Data/Scripts/012_Overworld/006_Overworld_BerryPlants.rb @@ -375,8 +375,8 @@ def pbBerryPlant if berry_plant.mulch_id 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) + case pbMessage(_INTL("It's soft, earthy soil."), + [_INTL("Fertilize"), _INTL("Plant Berry"), _INTL("Exit")], -1) when 0 # Fertilize mulch = nil pbFadeOutIn { diff --git a/Data/Scripts/012_Overworld/008_Overworld_RandomDungeons.rb b/Data/Scripts/012_Overworld/008_Overworld_RandomDungeons.rb index 329698557..7929fe489 100644 --- a/Data/Scripts/012_Overworld/008_Overworld_RandomDungeons.rb +++ b/Data/Scripts/012_Overworld/008_Overworld_RandomDungeons.rb @@ -154,7 +154,7 @@ module RandomDungeonGenerator end # Draws a cell's contents, which is an underlying pattern based on tile - #_layout and a rotation (the corridors), and possibly a room on top of that. + # _layout and a rotation (the corridors), and possibly a room on top of that. def paint_cell_contents(dungeon, xDst, yDst, tile_layout, rotation) return false if !tile_layout # Draw the corridors @@ -224,6 +224,7 @@ module RandomDungeonGenerator #============================================================================= class Maze attr_accessor :cellWidth, :cellHeight, :nodeWidth, :nodeHeight + DIRECTIONS = [EdgeMasks::North, EdgeMasks::South, EdgeMasks::East, EdgeMasks::West] def initialize(cw, ch) @@ -438,7 +439,7 @@ module RandomDungeonGenerator class Dungeon class DungeonTable def initialize(dungeon) - @dungeon = dungeon + @dungeon = dungeon end def xsize; @dungeon.width; end @@ -452,6 +453,7 @@ module RandomDungeonGenerator end attr_accessor :width, :height + BUFFER_X = 8 BUFFER_Y = 6 @@ -501,15 +503,15 @@ module RandomDungeonGenerator # Unused def intersects?(r1, r2) - return !(((r2[0] + r2[2] <= r1[0]) || - (r2[0] >= r1[0] + r1[2]) || - (r2[1] + r2[3] <= r1[1]) || - (r2[1] >= r1[1] + r1[3])) && - ((r1[0] <= r2[0] + r2[2])|| - (r1[0] >= r2[0] + r2[2]) || - (r1[1] + r1[3] <= r2[1]) || - (r1[1] >= r2[1] + r2[3])) - ) + return !(((r2[0] + r2[2] <= r1[0]) || + (r2[0] >= r1[0] + r1[2]) || + (r2[1] + r2[3] <= r1[1]) || + (r2[1] >= r1[1] + r1[3])) && + ((r1[0] <= r2[0] + r2[2])|| + (r1[0] >= r2[0] + r2[2]) || + (r1[1] + r1[3] <= r2[1]) || + (r1[1] >= r2[1] + r2[3])) + ) end # Returns whether the given coordinates are a room floor that isn't too close @@ -532,10 +534,10 @@ module RandomDungeonGenerator def isWall?(x, y) if value(x, y) == DungeonTile::VOID v1 = value(x, y + 1) - return true if v1 == DungeonTile::ROOM || v1 == DungeonTile::CORRIDOR + return true if [DungeonTile::ROOM, DungeonTile::CORRIDOR].include?(v1) if v1 == DungeonTile::VOID # The tile below is void v1 = value(x, y + 2) - return true if v1 == DungeonTile::ROOM || v1 == DungeonTile::CORRIDOR + return true if [DungeonTile::ROOM, DungeonTile::CORRIDOR].include?(v1) end end return false diff --git a/Data/Scripts/013_Items/007_Item_Sprites.rb b/Data/Scripts/013_Items/007_Item_Sprites.rb index 0693d6ec3..34bfa8a92 100644 --- a/Data/Scripts/013_Items/007_Item_Sprites.rb +++ b/Data/Scripts/013_Items/007_Item_Sprites.rb @@ -3,6 +3,7 @@ #=============================================================================== class ItemIconSprite < SpriteWrapper attr_reader :item + ANIM_ICON_SIZE = 48 FRAMES_PER_CYCLE = Graphics.frame_rate diff --git a/Data/Scripts/014_Pokemon/001_Pokemon-related/004_PokemonStorage.rb b/Data/Scripts/014_Pokemon/001_Pokemon-related/004_PokemonStorage.rb index 695874e9c..4a2d764d3 100644 --- a/Data/Scripts/014_Pokemon/001_Pokemon-related/004_PokemonStorage.rb +++ b/Data/Scripts/014_Pokemon/001_Pokemon-related/004_PokemonStorage.rb @@ -57,6 +57,7 @@ class PokemonStorage attr_reader :boxes attr_accessor :currentBox attr_writer :unlockedWallpapers + BASICWALLPAPERQTY = 16 def initialize(maxBoxes = Settings::NUM_STORAGE_BOXES, maxPokemon = PokemonBox::BOX_SIZE) 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 b3132d782..178c04d8e 100644 --- a/Data/Scripts/015_Trainers and player/002_Trainer_LoadAndNew.rb +++ b/Data/Scripts/015_Trainers and player/002_Trainer_LoadAndNew.rb @@ -110,7 +110,7 @@ def pbMissingTrainer(tr_type, tr_name, tr_version) if !$DEBUG raise _INTL("Can't find trainer ({1}, {2}, ID {3})", tr_type.to_s, tr_name, tr_version) end - message = "" + message = "" if tr_version != 0 message = _INTL("Add new trainer ({1}, {2}, ID {3})?", tr_type.to_s, tr_name, tr_version) else 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 fd00b961d..eb8635731 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 @@ -131,7 +131,7 @@ class HallOfFame_Scene $PokemonGlobal.hallOfFame.push(@hallEntry) $PokemonGlobal.hallOfFameLastNumber+=1 $PokemonGlobal.hallOfFame.delete_at(0) if HALLLIMIT>-1 && - $PokemonGlobal.hallOfFame.size>HALLLIMIT + $PokemonGlobal.hallOfFame.size>HALLLIMIT end # Return the x/y point position in screen for battler index number @@ -314,9 +314,9 @@ class HallOfFame_Scene [dexnumber,32,Graphics.height-86,0,BASECOLOR,SHADOWCOLOR], [pokename,Graphics.width-192,Graphics.height-86,2,BASECOLOR,SHADOWCOLOR], [_INTL("Lv. {1}",pokemon.egg? ? "?" : pokemon.level), - 64,Graphics.height-54,0,BASECOLOR,SHADOWCOLOR], + 64,Graphics.height-54,0,BASECOLOR,SHADOWCOLOR], [_INTL("IDNo.{1}",pokemon.egg? ? "?????" : idno), - Graphics.width-192,Graphics.height-54,2,BASECOLOR,SHADOWCOLOR] + Graphics.width-192,Graphics.height-54,2,BASECOLOR,SHADOWCOLOR] ] if (hallNumber>-1) textPositions.push([_INTL("Hall of Fame No."),Graphics.width/2-104,-6,0,BASECOLOR,SHADOWCOLOR]) @@ -329,7 +329,7 @@ class HallOfFame_Scene overlay=@sprites["overlay"].bitmap overlay.clear pbDrawTextPositions(overlay,[[_INTL("Welcome to the Hall of Fame!"), - Graphics.width/2,Graphics.height-80,2,BASECOLOR,SHADOWCOLOR]]) + Graphics.width/2,Graphics.height-80,2,BASECOLOR,SHADOWCOLOR]]) end def pbAnimationLoop diff --git a/Data/Scripts/016_UI/003_UI_Pokedex_Main.rb b/Data/Scripts/016_UI/003_UI_Pokedex_Main.rb index a04062975..009b294d2 100644 --- a/Data/Scripts/016_UI/003_UI_Pokedex_Main.rb +++ b/Data/Scripts/016_UI/003_UI_Pokedex_Main.rb @@ -715,7 +715,7 @@ class PokemonPokedex_Scene end if mode!=0 textpos.push([(mode==1) ? "-" : "----", - xstart+halfwidth+(cols-1)*xgap,ystart+6+(cmds.length/cols).floor*ygap,2,base,shadow,1]) + xstart+halfwidth+(cols-1)*xgap,ystart+6+(cmds.length/cols).floor*ygap,2,base,shadow,1]) end when 2 # Type typerect = Rect.new(0,0,96,32) @@ -724,7 +724,7 @@ class PokemonPokedex_Scene overlay.blt(xstart+14+(i%cols)*xgap,ystart+6+(i/cols).floor*ygap,@typebitmap.bitmap,typerect) end textpos.push(["----", - xstart+halfwidth+(cols-1)*xgap,ystart+6+(cmds.length/cols).floor*ygap,2,base,shadow,1]) + xstart+halfwidth+(cols-1)*xgap,ystart+6+(cmds.length/cols).floor*ygap,2,base,shadow,1]) when 5 # Color for i in 0...cmds.length x = xstart+halfwidth+(i%cols)*xgap @@ -732,7 +732,7 @@ class PokemonPokedex_Scene textpos.push([cmds[i].name,x,y,2,base,shadow,1]) end textpos.push(["----", - xstart+halfwidth+(cols-1)*xgap,ystart+6+(cmds.length/cols).floor*ygap,2,base,shadow,1]) + xstart+halfwidth+(cols-1)*xgap,ystart+6+(cmds.length/cols).floor*ygap,2,base,shadow,1]) when 6 # Shape shaperect = Rect.new(0, 0, 60, 60) for i in 0...cmds.length @@ -1085,11 +1085,11 @@ class PokemonPokedex_Scene @orderCommands[MODETALLEST] = _INTL("Tallest") @orderCommands[MODESMALLEST] = _INTL("Smallest") @nameCommands = [_INTL("A"),_INTL("B"),_INTL("C"),_INTL("D"),_INTL("E"), - _INTL("F"),_INTL("G"),_INTL("H"),_INTL("I"),_INTL("J"), - _INTL("K"),_INTL("L"),_INTL("M"),_INTL("N"),_INTL("O"), - _INTL("P"),_INTL("Q"),_INTL("R"),_INTL("S"),_INTL("T"), - _INTL("U"),_INTL("V"),_INTL("W"),_INTL("X"),_INTL("Y"), - _INTL("Z")] + _INTL("F"),_INTL("G"),_INTL("H"),_INTL("I"),_INTL("J"), + _INTL("K"),_INTL("L"),_INTL("M"),_INTL("N"),_INTL("O"), + _INTL("P"),_INTL("Q"),_INTL("R"),_INTL("S"),_INTL("T"), + _INTL("U"),_INTL("V"),_INTL("W"),_INTL("X"),_INTL("Y"), + _INTL("Z")] @typeCommands = [] GameData::Type.each { |t| @typeCommands.push(t) if !t.pseudo_type } @heightCommands = [1,2,3,4,5,6,7,8,9,10, diff --git a/Data/Scripts/016_UI/004_UI_Pokedex_Entry.rb b/Data/Scripts/016_UI/004_UI_Pokedex_Entry.rb index 0cd5c4e71..f418675be 100644 --- a/Data/Scripts/016_UI/004_UI_Pokedex_Entry.rb +++ b/Data/Scripts/016_UI/004_UI_Pokedex_Entry.rb @@ -30,8 +30,8 @@ class PokemonPokedexInfo_Scene if hidden[0]==@region && hidden[1]>0 && $game_switches[hidden[1]] pbDrawImagePositions(@sprites["areamap"].bitmap,[ ["Graphics/Pictures/#{hidden[4]}", - hidden[2]*PokemonRegionMap_Scene::SQUARE_WIDTH, - hidden[3]*PokemonRegionMap_Scene::SQUARE_HEIGHT] + hidden[2]*PokemonRegionMap_Scene::SQUARE_WIDTH, + hidden[3]*PokemonRegionMap_Scene::SQUARE_HEIGHT] ]) end end @@ -219,7 +219,7 @@ class PokemonPokedexInfo_Scene end textpos = [ [_INTL("{1}{2} {3}", indexText, " ", species_data.name), - 246, 36, 0, Color.new(248, 248, 248), Color.new(0, 0, 0)] + 246, 36, 0, Color.new(248, 248, 248), Color.new(0, 0, 0)] ] if @show_battled_count textpos.push([_INTL("Number Battled"), 314, 152, 0, base, shadow]) @@ -364,7 +364,7 @@ class PokemonPokedexInfo_Scene end textpos.push([pbGetMessage(MessageTypes::RegionNames,@region),414,38,2,base,shadow]) textpos.push([_INTL("{1}'s area",GameData::Species.get(@species).name), - Graphics.width/2,346,2,base,shadow]) + Graphics.width/2,346,2,base,shadow]) pbDrawTextPositions(overlay,textpos) end diff --git a/Data/Scripts/016_UI/005_UI_Party.rb b/Data/Scripts/016_UI/005_UI_Party.rb index 40d510069..d7e837744 100644 --- a/Data/Scripts/016_UI/005_UI_Party.rb +++ b/Data/Scripts/016_UI/005_UI_Party.rb @@ -405,15 +405,17 @@ class PokemonPartyPanel < SpriteWrapper end # Draw shiny icon if @pokemon.shiny? - pbDrawImagePositions(@overlaysprite.bitmap,[[ - "Graphics/Pictures/shiny",80,48,0,0,16,16]]) + pbDrawImagePositions(@overlaysprite.bitmap, + [["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]]) + pbDrawImagePositions(@overlaysprite.bitmap, + [["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] diff --git a/Data/Scripts/016_UI/006_UI_Summary.rb b/Data/Scripts/016_UI/006_UI_Summary.rb index 058ae6a33..a1ef58cae 100644 --- a/Data/Scripts/016_UI/006_UI_Summary.rb +++ b/Data/Scripts/016_UI/006_UI_Summary.rb @@ -262,24 +262,24 @@ class PokemonSummary_Scene def pbShowCommands(commands,index=0) ret = -1 using(cmdwindow = Window_CommandPokemon.new(commands)) { - cmdwindow.z = @viewport.z+1 - cmdwindow.index = index - pbBottomRight(cmdwindow) - loop do - Graphics.update - Input.update - cmdwindow.update - pbUpdate - if Input.trigger?(Input::BACK) - pbPlayCancelSE - ret = -1 - break - elsif Input.trigger?(Input::USE) - pbPlayDecisionSE - ret = cmdwindow.index - break - end - end + cmdwindow.z = @viewport.z+1 + cmdwindow.index = index + pbBottomRight(cmdwindow) + loop do + Graphics.update + Input.update + cmdwindow.update + pbUpdate + if Input.trigger?(Input::BACK) + pbPlayCancelSE + ret = -1 + break + elsif Input.trigger?(Input::USE) + pbPlayDecisionSE + ret = cmdwindow.index + break + end + end } return ret end @@ -556,8 +556,7 @@ class PokemonSummary_Scene _INTL("Egg received."), _INTL("Traded at Lv. {1}.",@pokemon.obtain_level), "", - _INTL("Had a fateful encounter at Lv. {1}.",@pokemon.obtain_level) - ][@pokemon.obtain_method] + _INTL("Had a fateful encounter at Lv. {1}.",@pokemon.obtain_level)][@pokemon.obtain_method] memo += sprintf("%s\n",mettext) if mettext && mettext!="" # If Pokémon was hatched, write when and where it hatched if @pokemon.obtain_method == 1 @@ -849,8 +848,8 @@ class PokemonSummary_Scene ribbon_data = GameData::Ribbon.get(@pokemon.ribbons[i]) ribn = ribbon_data.icon_position imagepos.push(["Graphics/Pictures/ribbons", - 230 + 68 * (coord % 4), 78 + 68 * (coord / 4).floor, - 64 * (ribn % 8), 64 * (ribn / 8).floor, 64, 64]) + 230 + 68 * (coord % 4), 78 + 68 * (coord / 4).floor, + 64 * (ribn % 8), 64 * (ribn / 8).floor, 64, 64]) coord += 1 end # Draw all images diff --git a/Data/Scripts/016_UI/007_UI_Bag.rb b/Data/Scripts/016_UI/007_UI_Bag.rb index a73a62b12..9b250a7d9 100644 --- a/Data/Scripts/016_UI/007_UI_Bag.rb +++ b/Data/Scripts/016_UI/007_UI_Bag.rb @@ -99,7 +99,7 @@ class Window_PokemonBag < Window_DrawableCommand end def refresh - @item_max = itemCount() + @item_max = itemCount self.update_cursor_rect dwidth = self.width-self.borderX dheight = self.height-self.borderY @@ -320,7 +320,7 @@ class PokemonBag_Scene @sprites["itemicon"].item = itemlist.item # Set the selected item's description @sprites["itemtext"].text = - (itemlist.item) ? GameData::Item.get(itemlist.item).description : _INTL("Close bag.") + (itemlist.item) ? GameData::Item.get(itemlist.item).description : _INTL("Close bag.") end def pbRefreshFilter diff --git a/Data/Scripts/016_UI/016_UI_ReadyMenu.rb b/Data/Scripts/016_UI/016_UI_ReadyMenu.rb index dabe9e050..73b25a52e 100644 --- a/Data/Scripts/016_UI/016_UI_ReadyMenu.rb +++ b/Data/Scripts/016_UI/016_UI_ReadyMenu.rb @@ -78,10 +78,10 @@ class ReadyMenuButton < SpriteWrapper qty = $bag.quantity(@command[0]) if qty>99 textpos.push([_INTL(">99"),230,16,1, - Color.new(248,248,248),Color.new(40,40,40),1]) + Color.new(248,248,248),Color.new(40,40,40),1]) else textpos.push([_INTL("x{1}",qty),230,16,1, - Color.new(248,248,248),Color.new(40,40,40),1]) + Color.new(248,248,248),Color.new(40,40,40),1]) end end end diff --git a/Data/Scripts/016_UI/017_UI_PokemonStorage.rb b/Data/Scripts/016_UI/017_UI_PokemonStorage.rb index 50bdc49af..50f716ee9 100644 --- a/Data/Scripts/016_UI/017_UI_PokemonStorage.rb +++ b/Data/Scripts/016_UI/017_UI_PokemonStorage.rb @@ -564,6 +564,7 @@ end #=============================================================================== class PokemonStorageScene attr_reader :quickswap + MARK_WIDTH = 16 MARK_HEIGHT = 16 diff --git a/Data/Scripts/016_UI/019_UI_PC.rb b/Data/Scripts/016_UI/019_UI_PC.rb index 9bd973035..3694ab87c 100644 --- a/Data/Scripts/016_UI/019_UI_PC.rb +++ b/Data/Scripts/016_UI/019_UI_PC.rb @@ -38,13 +38,13 @@ class StorageSystemPC loop do command = pbShowCommandsWithHelp(nil, [_INTL("Organize Boxes"), - _INTL("Withdraw Pokémon"), - _INTL("Deposit Pokémon"), - _INTL("See ya!")], + _INTL("Withdraw Pokémon"), + _INTL("Deposit Pokémon"), + _INTL("See ya!")], [_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("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 ) if command>=0 && command<3 if command==1 # Withdraw @@ -116,13 +116,13 @@ def pbPCItemStorage loop do command = pbShowCommandsWithHelp(nil, [_INTL("Withdraw Item"), - _INTL("Deposit Item"), - _INTL("Toss Item"), - _INTL("Exit")], + _INTL("Deposit Item"), + _INTL("Toss Item"), + _INTL("Exit")], [_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("Store items in the PC."), + _INTL("Throw away items stored in the PC."), + _INTL("Go back to the previous menu.")],-1,command ) case command when 0 # Withdraw Item diff --git a/Data/Scripts/016_UI/020_UI_PokeMart.rb b/Data/Scripts/016_UI/020_UI_PokeMart.rb index 92903e7ec..44c7c3bc3 100644 --- a/Data/Scripts/016_UI/020_UI_PokeMart.rb +++ b/Data/Scripts/016_UI/020_UI_PokeMart.rb @@ -185,7 +185,7 @@ class PokemonMart_Scene itemwindow = @sprites["itemwindow"] @sprites["icon"].item = itemwindow.item @sprites["itemtextwindow"].text = - (itemwindow.item) ? @adapter.getDescription(itemwindow.item) : _INTL("Quit shopping.") + (itemwindow.item) ? @adapter.getDescription(itemwindow.item) : _INTL("Quit shopping.") itemwindow.refresh end @sprites["moneywindow"].text = _INTL("Money:\r\n{1}", @adapter.getMoneyString) @@ -491,7 +491,7 @@ class PokemonMart_Scene if itemwindow.item != olditem @sprites["icon"].item = itemwindow.item @sprites["itemtextwindow"].text = - (itemwindow.item) ? @adapter.getDescription(itemwindow.item) : _INTL("Quit shopping.") + (itemwindow.item) ? @adapter.getDescription(itemwindow.item) : _INTL("Quit shopping.") end if Input.trigger?(Input::BACK) pbPlayCloseMenuSE diff --git a/Data/Scripts/016_UI/021_UI_MoveRelearner.rb b/Data/Scripts/016_UI/021_UI_MoveRelearner.rb index bbb2665a3..c2600c4a3 100644 --- a/Data/Scripts/016_UI/021_UI_MoveRelearner.rb +++ b/Data/Scripts/016_UI/021_UI_MoveRelearner.rb @@ -73,7 +73,7 @@ class MoveRelearner_Scene if moveData.total_pp>0 textpos.push([_INTL("PP"),112,yPos+32,0,Color.new(64,64,64),Color.new(176,176,176)]) textpos.push([_INTL("{1}/{1}",moveData.total_pp),230,yPos+32,1, - Color.new(64,64,64),Color.new(176,176,176)]) + Color.new(64,64,64),Color.new(176,176,176)]) else textpos.push(["-",80,yPos,0,Color.new(64,64,64),Color.new(176,176,176)]) textpos.push(["--",228,yPos+32,1,Color.new(64,64,64),Color.new(176,176,176)]) @@ -82,8 +82,8 @@ class MoveRelearner_Scene yPos+=64 end imagepos.push(["Graphics/Pictures/reminderSel", - 0,78+(@sprites["commands"].index-@sprites["commands"].top_item)*64, - 0,0,258,72]) + 0,78+(@sprites["commands"].index-@sprites["commands"].top_item)*64, + 0,0,258,72]) selMoveData=GameData::Move.get(@moves[@sprites["commands"].index]) basedamage = selMoveData.display_damage(@pokemon) category = selMoveData.display_category(@pokemon) @@ -91,10 +91,10 @@ class MoveRelearner_Scene textpos.push([_INTL("CATEGORY"),272,108,0,Color.new(248,248,248),Color.new(0,0,0)]) textpos.push([_INTL("POWER"),272,140,0,Color.new(248,248,248),Color.new(0,0,0)]) textpos.push([basedamage<=1 ? basedamage==1 ? "???" : "---" : sprintf("%d",basedamage), - 468,140,2,Color.new(64,64,64),Color.new(176,176,176)]) + 468,140,2,Color.new(64,64,64),Color.new(176,176,176)]) textpos.push([_INTL("ACCURACY"),272,172,0,Color.new(248,248,248),Color.new(0,0,0)]) textpos.push([accuracy==0 ? "---" : "#{accuracy}%", - 468,172,2,Color.new(64,64,64),Color.new(176,176,176)]) + 468,172,2,Color.new(64,64,64),Color.new(176,176,176)]) pbDrawTextPositions(overlay,textpos) imagepos.push(["Graphics/Pictures/category",436,116,0,category*28,64,28]) if @sprites["commands"].index<@moves.length-1 diff --git a/Data/Scripts/016_UI/022_UI_PurifyChamber.rb b/Data/Scripts/016_UI/022_UI_PurifyChamber.rb index 3cfc45ee4..077cf045b 100644 --- a/Data/Scripts/016_UI/022_UI_PurifyChamber.rb +++ b/Data/Scripts/016_UI/022_UI_PurifyChamber.rb @@ -17,7 +17,7 @@ class PokemonGlobalMetadata attr_writer :purifyChamber def purifyChamber - @purifyChamber = PurifyChamber.new() if !@purifyChamber + @purifyChamber = PurifyChamber.new if !@purifyChamber return @purifyChamber end end @@ -157,10 +157,11 @@ end class PurifyChamber attr_reader :sets attr_reader :currentSet + NUMSETS = 9 SETSIZE = 4 - def self.maximumTempo() # Calculates the maximum possible tempo + def self.maximumTempo # Calculates the maximum possible tempo x=SETSIZE+1 return ((x*x+x)/2)-1 end @@ -233,7 +234,7 @@ class PurifyChamber return false if shadow.heart_gauge != 0 # Define an exception for Lugia if shadow.isSpecies?(:LUGIA) - maxtempo=PurifyChamber.maximumTempo() + maxtempo=PurifyChamber.maximumTempo for i in 0...NUMSETS return false if @sets[i].tempo!=maxtempo end @@ -423,13 +424,13 @@ class PurifyChamberScreen # array[0]==0 - a position was chosen # array[0]==1 - a new set was chosen # array[0]==2 - choose Pokemon command - cmd=@scene.pbSetScreen() + cmd=@scene.pbSetScreen if cmd[0]==0 # Place Pokemon in the set curpkmn=PurifyChamberHelper.pbGetPokemon(@chamber,cmd[1]) if curpkmn || heldpkmn commands=[_INTL("MOVE"),_INTL("SUMMARY"), - _INTL("WITHDRAW")] + _INTL("WITHDRAW")] if curpkmn && heldpkmn commands[0]=_INTL("EXCHANGE") elsif heldpkmn @@ -519,7 +520,7 @@ class PurifyChamberScreen @scene.pbChangeSet(cmd[1]) chamber.currentSet=cmd[1] elsif cmd[0]==2 # Choose a Pokemon - pos=@scene.pbChoosePokemon() + pos=@scene.pbChoosePokemon pkmn=pos ? $PokemonStorage[pos[0],pos[1]] : nil heldpkmn=pkmn if pkmn else # cancel @@ -532,13 +533,13 @@ class PurifyChamberScreen end end end - if pbCheckPurify() + if pbCheckPurify @scene.pbDisplay(_INTL("There is a Pokémon that is ready to open its heart!\1")) - @scene.pbCloseSetDetail() - pbDoPurify() + @scene.pbCloseSetDetail + pbDoPurify return false else - @scene.pbCloseSetDetail() + @scene.pbCloseSetDetail return true end end @@ -576,27 +577,27 @@ class PurifyChamberScreen set=purifiables[i] @chamber.currentSet=set @scene.pbOpenSet(set) - @scene.pbPurify() + @scene.pbPurify pbPurify(@chamber[set].shadow,self) pbStorePokemon(@chamber[set].shadow) @chamber.setShadow(set,nil) # Remove shadow Pokemon from set if (i+1)!=purifiables.length @scene.pbDisplay(_INTL("There is another Pokémon that is ready to open its heart!")) if !@scene.pbConfirm("Would you like to switch sets?") - @scene.pbCloseSet() + @scene.pbCloseSet break end end - @scene.pbCloseSet() + @scene.pbCloseSet end end def pbStartPurify chamber=@chamber @scene.pbStart(chamber) - if pbCheckPurify() - pbDoPurify() - @scene.pbEnd() + if pbCheckPurify + pbDoPurify + @scene.pbEnd return end @scene.pbOpenSet(chamber.currentSet) @@ -609,23 +610,24 @@ class PurifyChamberScreen else chamber.currentSet=set cmd=@scene.pbShowCommands( - _INTL("What do you want to do?"),[ - _INTL("EDIT"),_INTL("SWITCH"),_INTL("CANCEL")]) - if cmd==0 # edit - if !pbOpenSetDetail() + _INTL("What do you want to do?"), + [_INTL("EDIT"), _INTL("SWITCH"), _INTL("CANCEL")] + ) + if cmd==0 # edit + if !pbOpenSetDetail break end - elsif cmd==1 # switch + elsif cmd==1 # switch chamber.currentSet=set newSet=@scene.pbSwitch(set) chamber.switch(set,newSet) chamber.currentSet=newSet - @scene.pbRefresh() + @scene.pbRefresh end end end - @scene.pbCloseSet() - @scene.pbEnd() + @scene.pbCloseSet + @scene.pbEnd end end @@ -655,14 +657,14 @@ class Window_PurifyChamberSets < Window_DrawableCommand rect=drawCursor(index,rect) if index==@switching textpos.push([(index+1).to_s,rect.x, - rect.y-6,false,Color.new(248,0,0),self.shadowColor]) + rect.y-6,false,Color.new(248,0,0),self.shadowColor]) else textpos.push([(index+1).to_s,rect.x, - rect.y-6,false,self.baseColor,self.shadowColor]) + rect.y-6,false,self.baseColor,self.shadowColor]) 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), @@ -792,7 +794,7 @@ class FlowDiagram def withinRange(angle,startAngle,endAngle) if startAngle>endAngle return (angle>=startAngle || angle<=endAngle) && - (angle>=0 && angle<=360) + (angle>=0 && angle<=360) else return (angle>=startAngle && angle<=endAngle) end @@ -822,7 +824,7 @@ class FlowDiagram def color=(value) for point in @points - point.color=value + point.color=value end end @@ -867,7 +869,7 @@ class PurifyChamberSetView < SpriteWrapper refresh end - def refreshFlows() + def refreshFlows for flow in @flows flow.setFlowStrength(0) end @@ -947,15 +949,15 @@ class PurifyChamberSetView < SpriteWrapper if pkmn.types.length == 1 textpos.push([_INTL("{1} Lv.{2} {3}", pkmn.name, pkmn.level, GameData::Type.get(pkmn.types[0]).name), - 2, -6, 0, Color.new(248, 248, 248), Color.new(128, 128, 128)]) + 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), - 2, -6, 0, Color.new(248, 248, 248), Color.new(128, 128, 128)]) + 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, - Color.new(248,248,248),Color.new(128,128,128)]) + Color.new(248,248,248),Color.new(128,128,128)]) # draw heart gauge pbDrawGauge(@info.bitmap, Rect.new(@info.bitmap.width*3/4,8,@info.bitmap.width*1/4,8), Color.new(192,0,256), pkmn.heart_gauge, pkmn.max_gauge_size) @@ -965,11 +967,11 @@ class PurifyChamberSetView < SpriteWrapper end if @chamber.setCount(@set)>0 textpos.push([_INTL("TEMPO"),2,18,0, - Color.new(248,248,248),Color.new(128,128,128)]) + 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()) + PurifyChamber.maximumTempo) end pbDrawTextPositions(@info.bitmap,textpos) @info.x=Graphics.width-@info.bitmap.width @@ -983,7 +985,7 @@ class PurifyChamberSetView < SpriteWrapper checkCursor(0) points=[@chamber.setCount(@set)*2,1].max setList=@chamber.setList(@set) - refreshFlows() + refreshFlows for i in 0...PurifyChamber::SETSIZE*2 pkmn=(i%2==1 || i>=points) ? nil : setList[i/2] angle=360-(i*360/points) @@ -1083,11 +1085,11 @@ end # #=============================================================================== class PurifyChamberScene - def pbUpdate() + def pbUpdate pbUpdateSpriteHash(@sprites) end - def pbRefresh() + def pbRefresh if @sprites["setview"] @sprites["setview"].refresh @sprites["setwindow"].refresh @@ -1098,7 +1100,7 @@ class PurifyChamberScene @chamber=chamber end - def pbEnd() + def pbEnd end def pbOpenSet(set) @@ -1120,7 +1122,7 @@ class PurifyChamberScene pbFadeInAndShow(@sprites) { pbUpdate } end - def pbCloseSet() + def pbCloseSet pbFadeOutAndHide(@sprites) { pbUpdate } pbDisposeSpriteHash(@sprites) @viewport.dispose @@ -1133,20 +1135,20 @@ class PurifyChamberScene @sprites["setview"].cursor=0 end - def pbCloseSetDetail() + def pbCloseSetDetail end - def pbPurify() + def pbPurify pbRefresh end def pbMove(_pos) - @sprites["setview"].heldpkmn=@sprites["setview"].getCurrent() + @sprites["setview"].heldpkmn=@sprites["setview"].getCurrent pbRefresh end def pbShift(_pos,_heldpoke) - @sprites["setview"].heldpkmn=@sprites["setview"].getCurrent() + @sprites["setview"].heldpkmn=@sprites["setview"].getCurrent pbRefresh end @@ -1191,29 +1193,29 @@ class PurifyChamberScene btn=Input::RIGHT if Input.repeat?(Input::RIGHT) btn=Input::LEFT if Input.repeat?(Input::LEFT) if btn!=0 - pbPlayCursorSE() + pbPlayCursorSE @sprites["setview"].moveCursor(btn) end if Input.repeat?(Input::JUMPUP) nextset=(@sprites["setview"].set==0) ? PurifyChamber::NUMSETS-1 : @sprites["setview"].set-1 - pbPlayCursorSE() + pbPlayCursorSE return [1,nextset] elsif Input.repeat?(Input::JUMPDOWN) nextset=(@sprites["setview"].set==PurifyChamber::NUMSETS-1) ? 0 : @sprites["setview"].set+1 - pbPlayCursorSE() + pbPlayCursorSE return [1,nextset] elsif Input.trigger?(Input::USE) - pbPlayDecisionSE() + pbPlayDecisionSE return [0,@sprites["setview"].cursor] elsif Input.trigger?(Input::BACK) - pbPlayCancelSE() + pbPlayCancelSE return [3,0] end end } end - def pbChooseSet() + def pbChooseSet pbActivateWindow(@sprites,"setwindow") { oldindex=@sprites["setwindow"].index loop do @@ -1225,11 +1227,11 @@ class PurifyChamberScene Input.update pbUpdate if Input.trigger?(Input::USE) - pbPlayDecisionSE() + pbPlayDecisionSE return @sprites["setwindow"].index end if Input.trigger?(Input::BACK) - pbPlayCancelSE() + pbPlayCancelSE return -1 end end @@ -1238,7 +1240,7 @@ class PurifyChamberScene def pbSwitch(set) @sprites["setwindow"].switching=set - ret=pbChooseSet() + ret=pbChooseSet @sprites["setwindow"].switching=-1 return ret<0 ? set : ret end @@ -1285,11 +1287,11 @@ class PurifyChamberScene pbRefresh end - def pbChoosePokemon() + def pbChoosePokemon visible=pbFadeOutAndHide(@sprites) - scene=PokemonStorageScene.new() + scene=PokemonStorageScene.new screen=PokemonStorageScreen.new(scene,$PokemonStorage) - pos=screen.pbChoosePokemon() + pos=screen.pbChoosePokemon pbRefresh pbFadeInAndShow(@sprites,visible) return pos @@ -1322,7 +1324,7 @@ class PurifyChamberPC def access pbMessage(_INTL("\\se[PC access]Accessed the Purify Chamber.")) - pbPurifyChamber() + pbPurifyChamber end end diff --git a/Data/Scripts/016_UI/024_UI_TextEntry.rb b/Data/Scripts/016_UI/024_UI_TextEntry.rb index d6376f255..f322ad630 100644 --- a/Data/Scripts/016_UI/024_UI_TextEntry.rb +++ b/Data/Scripts/016_UI/024_UI_TextEntry.rb @@ -389,7 +389,7 @@ class PokemonEntryScene2 for x in 0...ROWS pos = y * ROWS + x textPos.push([@@Characters[i][0][pos], 44 + x * 32, 12 + y * 38, 2, - Color.new(16, 24, 32), Color.new(160, 160, 160)]) + Color.new(16, 24, 32), Color.new(160, 160, 160)]) end end pbDrawTextPositions(b, textPos) @@ -773,15 +773,15 @@ def pbEnterText(helptext,minlength,maxlength,initialText="",mode=0,pokemon=nil,n ret="" if ($PokemonSystem.textinput==1 rescue false) # Keyboard pbFadeOutIn(99999,nofadeout) { - sscene=PokemonEntryScene.new - sscreen=PokemonEntry.new(sscene) - ret=sscreen.pbStartScreen(helptext,minlength,maxlength,initialText,mode,pokemon) + sscene=PokemonEntryScene.new + sscreen=PokemonEntry.new(sscene) + ret=sscreen.pbStartScreen(helptext,minlength,maxlength,initialText,mode,pokemon) } else # Cursor pbFadeOutIn(99999,nofadeout) { - sscene=PokemonEntryScene2.new - sscreen=PokemonEntry.new(sscene) - ret=sscreen.pbStartScreen(helptext,minlength,maxlength,initialText,mode,pokemon) + sscene=PokemonEntryScene2.new + sscreen=PokemonEntry.new(sscene) + ret=sscreen.pbStartScreen(helptext,minlength,maxlength,initialText,mode,pokemon) } end return ret diff --git a/Data/Scripts/017_Minigames/001_Minigame_Duel.rb b/Data/Scripts/017_Minigames/001_Minigame_Duel.rb index 382d35c94..0e3a4bc80 100644 --- a/Data/Scripts/017_Minigames/001_Minigame_Duel.rb +++ b/Data/Scripts/017_Minigames/001_Minigame_Duel.rb @@ -73,10 +73,12 @@ class PokemonDuel @oldeventspeed = event.move_speed pbMoveRoute($game_player, [ PBMoveRoute::ChangeSpeed, 2, - PBMoveRoute::DirectionFixOn]) + PBMoveRoute::DirectionFixOn + ]) pbMoveRoute(event, [ PBMoveRoute::ChangeSpeed, 2, - PBMoveRoute::DirectionFixOn]) + PBMoveRoute::DirectionFixOn + ]) pbWait(Graphics.frame_rate * 3 / 4) end @@ -129,84 +131,101 @@ class PokemonDuel PBMoveRoute::ScriptAsync, "moveRight90", PBMoveRoute::ScriptAsync, "moveLeft90", PBMoveRoute::ScriptAsync, "moveLeft90", - PBMoveRoute::ScriptAsync, "moveRight90"]) + PBMoveRoute::ScriptAsync, "moveRight90" + ]) pbMoveRoute(event, [ PBMoveRoute::ScriptAsync, "moveLeft90", PBMoveRoute::ScriptAsync, "moveRight90", PBMoveRoute::ScriptAsync, "moveRight90", - PBMoveRoute::ScriptAsync, "moveLeft90"]) + PBMoveRoute::ScriptAsync, "moveLeft90" + ]) pbWait(Graphics.frame_rate / 2) pbMessage(_INTL("You study each other's movements...")) elsif action == 0 && command == 1 pbMoveRoute($game_player, [ PBMoveRoute::ChangeSpeed, 4, - PBMoveRoute::Forward]) + PBMoveRoute::Forward + ]) pbWait(Graphics.frame_rate * 4 / 10) pbShake(9, 9, 8) pbFlashScreens(false, true) pbMoveRoute($game_player, [ PBMoveRoute::ChangeSpeed, 2, - PBMoveRoute::Backward]) + PBMoveRoute::Backward + ]) @hp[1] -= 1 pbMessage(_INTL("Your attack was not blocked!")) elsif action == 0 && command == 2 pbMoveRoute($game_player, [ PBMoveRoute::ChangeSpeed, 4, - PBMoveRoute::ScriptAsync, "jumpForward"]) + PBMoveRoute::ScriptAsync, "jumpForward" + ]) pbMoveRoute(event, [ PBMoveRoute::ChangeSpeed, 4, - PBMoveRoute::Backward]) + PBMoveRoute::Backward + ]) pbWait(Graphics.frame_rate) pbMoveRoute($game_player, [ PBMoveRoute::ChangeSpeed, 2, - PBMoveRoute::Backward]) + PBMoveRoute::Backward + ]) pbMoveRoute(event, [ PBMoveRoute::ChangeSpeed, 2, - PBMoveRoute::Forward]) + PBMoveRoute::Forward + ]) pbMessage(_INTL("Your attack was evaded!")) elsif (action == 0 || action == 1 || action == 2) && command == 3 pbMoveRoute($game_player, [ PBMoveRoute::ChangeSpeed, 4, - PBMoveRoute::ScriptAsync, "jumpForward"]) + PBMoveRoute::ScriptAsync, "jumpForward" + ]) pbWait(Graphics.frame_rate * 4 / 10) pbMoveRoute(event, [ PBMoveRoute::ChangeSpeed, 5, PBMoveRoute::Backward, - PBMoveRoute::ChangeSpeed, 2]) + PBMoveRoute::ChangeSpeed, 2 + ]) pbWait(Graphics.frame_rate / 2) pbShake(9, 9, 8) pbFlashScreens(false, true) pbMoveRoute($game_player, [ PBMoveRoute::ChangeSpeed, 2, - PBMoveRoute::Backward]) + PBMoveRoute::Backward + ]) pbMoveRoute(event, [ PBMoveRoute::ChangeSpeed, 2, - PBMoveRoute::Forward]) + PBMoveRoute::Forward + ]) @hp[1] -= 3 pbMessage(_INTL("You pierce through the opponent's defenses!")) elsif action == 1 && command == 0 pbMoveRoute(event, [ PBMoveRoute::ChangeSpeed, 4, - PBMoveRoute::Forward]) + PBMoveRoute::Forward + ]) pbWait(Graphics.frame_rate * 4 / 10) pbShake(9, 9, 8) pbFlashScreens(true, false) pbMoveRoute(event, [ PBMoveRoute::ChangeSpeed, 2, - PBMoveRoute::Backward]) + PBMoveRoute::Backward + ]) @hp[0] -= 1 pbMessage(_INTL("You fail to block the opponent's attack!")) elsif action == 1 && command == 1 pbMoveRoute($game_player, [ PBMoveRoute::ChangeSpeed, 4, - PBMoveRoute::Forward]) + PBMoveRoute::Forward + ]) pbWait(Graphics.frame_rate * 6 / 10) pbMoveRoute($game_player, [ PBMoveRoute::ChangeSpeed, 2, - PBMoveRoute::Backward]) + PBMoveRoute::Backward + ]) pbMoveRoute(event, [ PBMoveRoute::ChangeSpeed, 2, - PBMoveRoute::Forward]) + PBMoveRoute::Forward + ]) pbWait(Graphics.frame_rate * 6 / 10) pbMoveRoute(event, [PBMoveRoute::Backward]) pbMoveRoute($game_player, [PBMoveRoute::Forward]) @@ -219,21 +238,25 @@ class PokemonDuel pbMoveRoute($game_player, [ PBMoveRoute::Backward, PBMoveRoute::ChangeSpeed, 4, - PBMoveRoute::ScriptAsync, "jumpForward"]) + PBMoveRoute::ScriptAsync, "jumpForward" + ]) pbWait(Graphics.frame_rate * 8 / 10) pbMoveRoute(event, [ PBMoveRoute::ChangeSpeed, 4, - PBMoveRoute::Forward]) + PBMoveRoute::Forward + ]) pbWait(Graphics.frame_rate * 9 / 10) pbShake(9, 9, 8) pbFlashScreens(true, true) pbMoveRoute($game_player, [ PBMoveRoute::Backward, - PBMoveRoute::ChangeSpeed, 2]) + PBMoveRoute::ChangeSpeed, 2 + ]) pbMoveRoute(event, [ PBMoveRoute::Backward, PBMoveRoute::Backward, - PBMoveRoute::ChangeSpeed, 2]) + PBMoveRoute::ChangeSpeed, 2 + ]) pbWait(Graphics.frame_rate) pbMoveRoute(event, [PBMoveRoute::Forward]) pbMoveRoute($game_player, [PBMoveRoute::Forward]) @@ -243,56 +266,68 @@ class PokemonDuel elsif action == 2 && command == 0 pbMoveRoute(event, [ PBMoveRoute::ChangeSpeed, 4, - PBMoveRoute::Forward]) + PBMoveRoute::Forward + ]) pbMoveRoute($game_player, [ PBMoveRoute::ChangeSpeed, 4, - PBMoveRoute::ScriptAsync, "jumpBackward"]) + PBMoveRoute::ScriptAsync, "jumpBackward" + ]) pbWait(Graphics.frame_rate) pbMoveRoute($game_player, [ PBMoveRoute::ChangeSpeed, 2, - PBMoveRoute::Forward]) + PBMoveRoute::Forward + ]) pbMoveRoute(event, [ PBMoveRoute::ChangeSpeed, 2, - PBMoveRoute::Backward]) + PBMoveRoute::Backward + ]) pbMessage(_INTL("You evade the opponent's attack!")) elsif action == 3 && (command == 0 || command == 1 || command == 2) pbMoveRoute(event, [ PBMoveRoute::ChangeSpeed, 4, - PBMoveRoute::ScriptAsync, "jumpForward"]) + PBMoveRoute::ScriptAsync, "jumpForward" + ]) pbWait(Graphics.frame_rate * 4 / 10) pbMoveRoute($game_player, [ PBMoveRoute::ChangeSpeed, 5, PBMoveRoute::Backward, - PBMoveRoute::ChangeSpeed, 2]) + PBMoveRoute::ChangeSpeed, 2 + ]) pbWait(Graphics.frame_rate / 2) pbShake(9, 9, 8) pbFlashScreens(true, false) pbMoveRoute($game_player, [ PBMoveRoute::ChangeSpeed, 2, - PBMoveRoute::Forward]) + PBMoveRoute::Forward + ]) pbMoveRoute(event, [ PBMoveRoute::ChangeSpeed, 2, - PBMoveRoute::Backward]) + PBMoveRoute::Backward + ]) @hp[0] -= 3 pbMessage(_INTL("The opponent pierces through your defenses!")) elsif action == 3 && command == 3 pbMoveRoute($game_player, [PBMoveRoute::Backward]) pbMoveRoute($game_player, [ PBMoveRoute::ChangeSpeed, 4, - PBMoveRoute::ScriptAsync, "jumpForward"]) + PBMoveRoute::ScriptAsync, "jumpForward" + ]) pbMoveRoute(event, [ PBMoveRoute::Wait, 15, PBMoveRoute::ChangeSpeed, 4, - PBMoveRoute::ScriptAsync, "jumpForward"]) + PBMoveRoute::ScriptAsync, "jumpForward" + ]) pbWait(Graphics.frame_rate) pbMoveRoute(event, [ PBMoveRoute::ChangeSpeed, 5, PBMoveRoute::Backward, - PBMoveRoute::ChangeSpeed, 2]) + PBMoveRoute::ChangeSpeed, 2 + ]) pbMoveRoute($game_player, [ PBMoveRoute::ChangeSpeed, 5, PBMoveRoute::Backward, - PBMoveRoute::ChangeSpeed, 2]) + PBMoveRoute::ChangeSpeed, 2 + ]) pbShake(9, 9, 8) pbFlash(Color.new(255, 255, 255, 255), 20) pbFlashScreens(true, true) @@ -310,10 +345,12 @@ class PokemonDuel pbWait(Graphics.frame_rate * 3 / 4) pbMoveRoute($game_player, [ PBMoveRoute::DirectionFixOff, - PBMoveRoute::ChangeSpeed, @oldmovespeed]) + PBMoveRoute::ChangeSpeed, @oldmovespeed + ]) pbMoveRoute(@event, [ PBMoveRoute::DirectionFixOff, - PBMoveRoute::ChangeSpeed, @oldeventspeed]) + PBMoveRoute::ChangeSpeed, @oldeventspeed + ]) fade_time = Graphics.frame_rate * 4 / 10 alpha_diff = (255.0 / fade_time).ceil fade_time.times do diff --git a/Data/Scripts/017_Minigames/003_Minigame_SlotMachine.rb b/Data/Scripts/017_Minigames/003_Minigame_SlotMachine.rb index c89b29e8b..f0434e37e 100644 --- a/Data/Scripts/017_Minigames/003_Minigame_SlotMachine.rb +++ b/Data/Scripts/017_Minigames/003_Minigame_SlotMachine.rb @@ -11,11 +11,11 @@ class SlotMachineReel < BitmapSprite attr_accessor :spinning attr_accessor :stopping attr_accessor :slipping + SCROLLSPEED = 16 # Must be a divisor of 48 ICONSPOOL = [[0,0,0,0,1,1,2,2,3,3,3,4,4,4,5,5,6,6,7], # 0 - Easy [0,0,0,0,1,1,1,2,2,2,3,3,4,4,5,6,7], # 1 - Medium (default) - [0,0,1,1,1,2,2,2,3,3,4,4,5,6,7] # 2 - Hard - ] + [0,0,1,1,1,2,2,2,3,3,4,4,5,6,7]] # 2 - Hard SLIPPING = [0,0,0,0,0,0,1,1,1,2,2,3] def initialize(x,y,difficulty=1) @@ -132,8 +132,7 @@ class SlotMachineScene [reel1[0],reel2[0],reel3[0]], # Top row [reel1[2],reel2[2],reel3[2]], # Bottom row [reel1[0],reel2[1],reel3[2]], # Diagonal top left -> bottom right - [reel1[2],reel2[1],reel3[0]], # Diagonal bottom left -> top right - ] + [reel1[2],reel2[1],reel3[0]]] # Diagonal bottom left -> top right for i in 0...combinations.length break if i>=1 && @wager<=1 # One coin = centre row only break if i>=3 && @wager<=2 # Two coins = three rows only diff --git a/Data/Scripts/017_Minigames/004_Minigame_VoltorbFlip.rb b/Data/Scripts/017_Minigames/004_Minigame_VoltorbFlip.rb index 63064a2d0..8d233ce8f 100644 --- a/Data/Scripts/017_Minigames/004_Minigame_VoltorbFlip.rb +++ b/Data/Scripts/017_Minigames/004_Minigame_VoltorbFlip.rb @@ -13,7 +13,7 @@ class VoltorbFlip # Set initial level @level=1 # Maximum and minimum total point values for each level - @levelRanges=[[ 20, 50],[ 50, 100],[ 100, 200],[ 200, 350], + @levelRanges=[[20, 50],[50, 100],[100, 200],[200, 350], [350,600],[600,1000],[1000,2000],[2000,3500]] @firstRound=true pbNewGame diff --git a/Data/Scripts/017_Minigames/006_Minigame_Mining.rb b/Data/Scripts/017_Minigames/006_Minigame_Mining.rb index 6d5823710..55aacda9c 100644 --- a/Data/Scripts/017_Minigames/006_Minigame_Mining.rb +++ b/Data/Scripts/017_Minigames/006_Minigame_Mining.rb @@ -77,6 +77,7 @@ class MiningGameCursor < BitmapSprite attr_accessor :position attr_accessor :hit attr_accessor :counter + ToolPositions = [[1,0],[1,1],[1,1],[0,0],[0,0], [0,2],[0,2],[0,0],[0,0],[0,2],[0,2]] # Graphic, position diff --git a/Data/Scripts/018_Alternate battle modes/002_BugContest.rb b/Data/Scripts/018_Alternate battle modes/002_BugContest.rb index 705e8d2f4..8b7bfe757 100644 --- a/Data/Scripts/018_Alternate battle modes/002_BugContest.rb +++ b/Data/Scripts/018_Alternate battle modes/002_BugContest.rb @@ -3,6 +3,7 @@ class BugContestState attr_accessor :decision attr_accessor :lastPokemon attr_reader :timer + ContestantNames = [ _INTL("Bug Catcher Ed"), _INTL("Bug Catcher Benny"), diff --git a/Data/Scripts/018_Alternate battle modes/003_Battle Frontier generator/002_ChallengeGenerator_Pokemon.rb b/Data/Scripts/018_Alternate battle modes/003_Battle Frontier generator/002_ChallengeGenerator_Pokemon.rb index 762959c53..a28a063f4 100644 --- a/Data/Scripts/018_Alternate battle modes/003_Battle Frontier generator/002_ChallengeGenerator_Pokemon.rb +++ b/Data/Scripts/018_Alternate battle modes/003_Battle Frontier generator/002_ChallengeGenerator_Pokemon.rb @@ -81,7 +81,7 @@ def pbGetLegalMoves2(species, maxlevel) # If we have two status moves that have the same function code, delete the # one with lower accuracy (Supersonic vs. Confuse Ray, etc.) elsif md.function_code == move2[1].function_code && md.base_damage == 0 && - move2[1].base_damage == 0 && md.accuracy > move2[1].accuracy + move2[1].base_damage == 0 && md.accuracy > move2[1].accuracy deleteAll.call(moves, move2[0]) # Delete poison-causing moves if we have a move that causes toxic elsif md.function_code == "BadPoisonTarget" && move2[1].function_code == "PoisonTarget" @@ -91,10 +91,10 @@ def pbGetLegalMoves2(species, maxlevel) # does more damage than the other move OR does the same damage but is more # accurate, delete the other move (Surf, Flamethrower, Thunderbolt, etc.) elsif md.function_code == move2[1].function_code && md.base_damage != 0 && - md.type == move2[1].type && - (md.total_pp == 15 || md.total_pp == 10 || md.total_pp == move2[1].total_pp) && - (md.base_damage > move2[1].base_damage || - (md.base_damage == move2[1].base_damage && md.accuracy > move2[1].accuracy)) + md.type == move2[1].type && + (md.total_pp == 15 || md.total_pp == 10 || md.total_pp == move2[1].total_pp) && + (md.base_damage > move2[1].base_damage || + (md.base_damage == move2[1].base_damage && md.accuracy > move2[1].accuracy)) deleteAll.call(moves, move2[0]) end end diff --git a/Data/Scripts/018_Alternate battle modes/003_Battle Frontier generator/003_ChallengeGenerator_Trainers.rb b/Data/Scripts/018_Alternate battle modes/003_Battle Frontier generator/003_ChallengeGenerator_Trainers.rb index 8fbb60aac..546264527 100644 --- a/Data/Scripts/018_Alternate battle modes/003_Battle Frontier generator/003_ChallengeGenerator_Trainers.rb +++ b/Data/Scripts/018_Alternate battle modes/003_Battle Frontier generator/003_ChallengeGenerator_Trainers.rb @@ -36,7 +36,7 @@ def pbTrainerInfo(pokemonlist, trfile, rules) randomName = getRandomNameEx(gender, nil, 0, 12) # Add the trainer to bttrainers tr = [trainerid, randomName, _INTL("Here I come!"), _INTL("Yes, I won!"), - _INTL("Man, I lost!"), []] + _INTL("Man, I lost!"), []] bttrainers.push(tr) end # Sort all the randomly chosen trainers by their base money (smallest first) @@ -160,7 +160,7 @@ def pbTrainerInfo(pokemonlist, trfile, rules) # until a valid team can be formed from what's in numbers if numbers.length < Settings::MAX_PARTY_SIZE || !rules.ruleset.hasValidTeam?(numbersPokemon) while numbers.length < pokemonlist.length && - (numbers.length < Settings::MAX_PARTY_SIZE || !rules.ruleset.hasValidTeam?(numbersPokemon)) + (numbers.length < Settings::MAX_PARTY_SIZE || !rules.ruleset.hasValidTeam?(numbersPokemon)) index = rand(pokemonlist.length) if !numbers.include?(index) numbers.push(index) @@ -202,7 +202,7 @@ def pbTrainerInfo(pokemonlist, trfile, rules) yield(nil) if block_given? if trIndex < 0 info = [newbttrainers, pbpokemonlist, [trfile], - trfile + "tr.txt", trfile + "pm.txt", !hasDefault] + trfile + "tr.txt", trfile + "pm.txt", !hasDefault] trlists.push(info) end yield(nil) if block_given? 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 f836417df..c91df467f 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 @@ -134,6 +134,7 @@ end #=============================================================================== class PlayerRatingElo attr_reader :rating + K_VALUE = 16 def initialize diff --git a/Data/Scripts/019_Utilities/001_Utilities.rb b/Data/Scripts/019_Utilities/001_Utilities.rb index 9e814c19b..8754fc7bc 100644 --- a/Data/Scripts/019_Utilities/001_Utilities.rb +++ b/Data/Scripts/019_Utilities/001_Utilities.rb @@ -271,57 +271,57 @@ def getRandomNameEx(type,variable,upper,maxLength=100) name = "" formats = [] case type - when 0 then formats = %w( F5 BvE FE FE5 FEvE ) # Names for males - when 1 then formats = %w( vE6 vEvE6 BvE6 B4 v3 vEv3 Bv3 ) # Names for females - when 2 then formats = %w( WE WEU WEvE BvE BvEU BvEvE ) # Neutral gender names + when 0 then formats = %w[F5 BvE FE FE5 FEvE] # Names for males + when 1 then formats = %w[vE6 vEvE6 BvE6 B4 v3 vEv3 Bv3] # Names for females + when 2 then formats = %w[WE WEU WEvE BvE BvEU BvEvE] # Neutral gender names else return "" end format = formats[rand(formats.length)] format.scan(/./) { |c| case c when "c" # consonant - set = %w( b c d f g h j k l m n p r s t v w x z ) + set = %w[b c d f g h j k l m n p r s t v w x z] name += set[rand(set.length)] when "v" # vowel - set = %w( a a a e e e i i i o o o u u u ) + set = %w[a a a e e e i i i o o o u u u] name += set[rand(set.length)] when "W" # beginning vowel - set = %w( a a a e e e i i i o o o u u u au au ay ay ea ea ee ee oo oo ou ou ) + set = %w[a a a e e e i i i o o o u u u au au ay ay ea ea ee ee oo oo ou ou] name += set[rand(set.length)] when "U" # ending vowel - set = %w( a a a a a e e e i i i o o o o o u u ay ay ie ie ee ue oo ) + set = %w[a a a a a e e e i i i o o o o o u u ay ay ie ie ee ue oo] name += set[rand(set.length)] when "B" # beginning consonant - set1 = %w( b c d f g h j k l l m n n p r r s s t t v w y z ) - set2 = %w( bl br ch cl cr dr fr fl gl gr kh kl kr ph pl pr sc sk sl - sm sn sp st sw th tr tw vl zh ) + set1 = %w[b c d f g h j k l l m n n p r r s s t t v w y z] + set2 = %w[bl br ch cl cr dr fr fl gl gr kh kl kr ph pl pr sc sk sl + sm sn sp st sw th tr tw vl zh] name += (rand(3)>0) ? set1[rand(set1.length)] : set2[rand(set2.length)] when "E" # ending consonant - set1 = %w( b c d f g h j k k l l m n n p r r s s t t v z ) - set2 = %w( bb bs ch cs ds fs ft gs gg ld ls nd ng nk rn kt ks - ms ns ph pt ps sk sh sp ss st rd rn rp rm rt rk ns th zh) + set1 = %w[b c d f g h j k k l l m n n p r r s s t t v z] + set2 = %w[bb bs ch cs ds fs ft gs gg ld ls nd ng nk rn kt ks + ms ns ph pt ps sk sh sp ss st rd rn rp rm rt rk ns th zh] name += (rand(3)>0) ? set1[rand(set1.length)] : set2[rand(set2.length)] when "f" # consonant and vowel - set = %w( iz us or ) + set = %w[iz us or] name += set[rand(set.length)] when "F" # consonant and vowel - set = %w( bo ba be bu re ro si mi zho se nya gru gruu glee gra glo ra do zo ri - di ze go ga pree pro po pa ka ki ku de da ma mo le la li ) + set = %w[bo ba be bu re ro si mi zho se nya gru gruu glee gra glo ra do zo ri + di ze go ga pree pro po pa ka ki ku de da ma mo le la li] name += set[rand(set.length)] when "2" - set = %w( c f g k l p r s t ) + set = %w[c f g k l p r s t] name += set[rand(set.length)] when "3" - set = %w( nka nda la li ndra sta cha chie ) + set = %w[nka nda la li ndra sta cha chie] name += set[rand(set.length)] when "4" - set = %w( una ona ina ita ila ala ana ia iana ) + set = %w[una ona ina ita ila ala ana ia iana] name += set[rand(set.length)] when "5" - set = %w( e e o o ius io u u ito io ius us ) + set = %w[e e o o ius io u u ito io ius us] name += set[rand(set.length)] when "6" - set = %w( a a a elle ine ika ina ita ila ala ana ) + set = %w[a a a elle ine ika ina ita ila ala ana] name += set[rand(set.length)] end } 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 e776c58bf..4a9d76b26 100644 --- a/Data/Scripts/020_Debug/001_Editor screens/001_EditorScreens.rb +++ b/Data/Scripts/020_Debug/001_Editor screens/001_EditorScreens.rb @@ -435,8 +435,8 @@ def pbTrainerTypeEditorNew(default_name) return nil end # Choose a gender - gender = pbMessage(_INTL("Is the Trainer male, female or unknown?"), [ - _INTL("Male"), _INTL("Female"), _INTL("Unknown")], 0) + gender = pbMessage(_INTL("Is the Trainer male, female or unknown?"), + [_INTL("Male"), _INTL("Female"), _INTL("Unknown")], 0) # Choose a base money value params = ChooseNumberParams.new params.setRange(0, 255) @@ -564,7 +564,8 @@ def pbTrainerBattleEditor ret = pbMessage(_INTL("First, define the new trainer's type."), [ _INTL("Use existing type"), _INTL("Create new type"), - _INTL("Cancel")], 3) + _INTL("Cancel") + ], 3) case ret when 0 tr_type = pbListScreen(_INTL("TRAINER TYPE"), TrainerTypeLister.new(0, false)) @@ -620,7 +621,7 @@ end #=============================================================================== module TrainerPokemonProperty def self.set(settingname,initsetting) - initsetting = {:species => nil, :level => 10} if !initsetting + initsetting = { :species => nil, :level => 10 } if !initsetting oldsetting = [ initsetting[:species], initsetting[:level], @@ -657,7 +658,7 @@ module TrainerPokemonProperty ] Pokemon::MAX_MOVES.times do |i| pkmn_properties.push([_INTL("Move {1}", i + 1), - MovePropertyForSpecies.new(oldsetting), _INTL("A move known by the Pokémon. Leave all moves blank (use Z key to delete) for a wild moveset.")]) + MovePropertyForSpecies.new(oldsetting), _INTL("A move known by the Pokémon. Leave all moves blank (use Z key to delete) for a wild moveset.")]) end pkmn_properties.concat([ [_INTL("Ability"), AbilityProperty, _INTL("Ability of the Pokémon. Overrides the ability index.")], @@ -766,7 +767,7 @@ def pbEditPlayerMetadata(player_id = 1) player_id = i break end - metadata = GameData::PlayerMetadata.new({:id => player_id}) + metadata = GameData::PlayerMetadata.new({ :id => player_id }) elsif !GameData::PlayerMetadata.exists?(player_id) pbMessage(_INTL("Metadata for player character {1} was not found.", player_id)) return @@ -815,7 +816,7 @@ def pbEditMapMetadata(map_id) data = [] map_name = mapinfos[map_id].name metadata = GameData::MapMetadata.try_get(map_id) - metadata = GameData::MapMetadata.new({:id => map_id}) if !metadata + metadata = GameData::MapMetadata.new({ :id => map_id }) if !metadata properties = GameData::MapMetadata.editor_properties properties.each do |property| data.push(metadata.property_from_string(property[0])) 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 2a01ef6e6..67aae3105 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 @@ -167,6 +167,7 @@ class AnimationWindow < SpriteWrapper attr_reader :animbitmap attr_reader :start attr_reader :selected + NUMFRAMES=5 def initialize(x,y,width,height,viewport=nil) @@ -358,6 +359,7 @@ class SpriteFrame < InvalidatableSprite attr_reader :locked attr_reader :selected attr_reader :sprite + NUM_ROWS = (PBAnimation::MAX_SPRITES.to_f/10).ceil # 10 frame number icons in each row def initialize(id,sprite,viewport,previous=false) @@ -431,6 +433,7 @@ class AnimationCanvas < Sprite attr_reader :animation # Currently selected animation attr_reader :animbitmap # Currently selected animation bitmap attr_accessor :pattern # Currently selected pattern + BORDERSIZE=64 def initialize(animation,viewport=nil) @@ -822,11 +825,11 @@ class AnimationCanvas < Sprite end currentFrame=getCurrentFrame if currentFrame && !@selecting && - (Input.triggerex?(:TAB) || Input.repeatex?(:TAB)) + (Input.triggerex?(:TAB) || Input.repeatex?(:TAB)) currentFrame.length.times { - @currentcel+=1 - @currentcel=0 if @currentcel>=currentFrame.length - break if currentFrame[@currentcel] + @currentcel+=1 + @currentcel=0 if @currentcel>=currentFrame.length + break if currentFrame[@currentcel] } invalidate return 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 321e29d56..2da0927d9 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 @@ -412,7 +412,7 @@ class Slider < UIControl self.changed=(self.curvalue!=oldvalue) self.invalidate end - #Right arrow + # Right arrow if right.contains(mousepos[0],mousepos[1]) if repeattime>2500 self.curvalue+=10 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 dc1cb216f..ae1dbb1a9 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 @@ -108,7 +108,7 @@ class PointPath return false if @points.length==0 index=@points.length-1 return @points[index][0]==x && - @points[index][1]==y + @points[index][1]==y end def addPoint(x,y) diff --git a/Data/Scripts/020_Debug/002_Animation editor/004_AnimEditor_ExportImport.rb b/Data/Scripts/020_Debug/002_Animation editor/004_AnimEditor_ExportImport.rb index 550bf9a75..3c07ffd2a 100644 --- a/Data/Scripts/020_Debug/002_Animation editor/004_AnimEditor_ExportImport.rb +++ b/Data/Scripts/020_Debug/002_Animation editor/004_AnimEditor_ExportImport.rb @@ -44,7 +44,7 @@ end def pbImportAnim(animations,canvas,animwin) animfiles=[] pbRgssChdir(".") { - animfiles.concat(Dir.glob("*.anm")) + animfiles.concat(Dir.glob("*.anm")) } cmdwin=pbListWindow(animfiles,320) cmdwin.opacity=200 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 83083143f..bf06b9042 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 @@ -29,7 +29,7 @@ end def pbSelectAnim(canvas,animwin) animfiles=[] pbRgssChdir(File.join("Graphics", "Animations")) { - animfiles.concat(Dir.glob("*.png")) + animfiles.concat(Dir.glob("*.png")) } cmdwin=pbListWindow(animfiles,320) cmdwin.opacity=200 @@ -518,10 +518,10 @@ def pbSelectSE(canvas,audio) animfiles=[] ret=false pbRgssChdir(File.join("Audio", "SE", "Anim")) { - animfiles.concat(Dir.glob("*.wav")) -# animfiles.concat(Dir.glob("*.mp3")) - animfiles.concat(Dir.glob("*.ogg")) - animfiles.concat(Dir.glob("*.wma")) + animfiles.concat(Dir.glob("*.wav")) +# animfiles.concat(Dir.glob("*.mp3")) + animfiles.concat(Dir.glob("*.ogg")) + animfiles.concat(Dir.glob("*.wma")) } animfiles.sort! { |a,b| a.upcase<=>b.upcase } animfiles=[_INTL("[Play user's cry]")]+animfiles @@ -950,11 +950,11 @@ end def pbAnimEditorHelpWindow helptext=""+ - "To add a cel to the scene, click on the canvas. The selected cel will have a black "+ - "frame. After a cel is selected, you can modify its properties using the keyboard:\n"+ - "E, R - Rotate left/right.\nP - Open properties screen.\nArrow keys - Move cel 8 pixels "+ - "(hold ALT for 2 pixels).\n+/- : Zoom in/out.\nL - Lock a cel. Locking a cel prevents it "+ - "from being moved or deleted.\nDEL - Deletes the cel.\nAlso press TAB to switch the selected cel." + "To add a cel to the scene, click on the canvas. The selected cel will have a black "+ + "frame. After a cel is selected, you can modify its properties using the keyboard:\n"+ + "E, R - Rotate left/right.\nP - Open properties screen.\nArrow keys - Move cel 8 pixels "+ + "(hold ALT for 2 pixels).\n+/- : Zoom in/out.\nL - Lock a cel. Locking a cel prevents it "+ + "from being moved or deleted.\nDEL - Deletes the cel.\nAlso press TAB to switch the selected cel." cmdwin=Window_UnformattedTextPokemon.newWithSize("",0,0,640,512) cmdwin.opacity=224 cmdwin.z=99999 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 eb1b8a43d..bd2c4bfb0 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 @@ -251,8 +251,8 @@ def pbDebugDayCare msg = _INTL("Pokémon can breed (compatibility = {1}).", compat) # Show compatibility if day_care.egg_generated - case pbMessage("\\ts[]" + msg, [ - _INTL("Collect egg"), _INTL("Clear egg"), _INTL("Cancel")], 3) + case pbMessage("\\ts[]" + msg, + [_INTL("Collect egg"), _INTL("Clear egg"), _INTL("Cancel")], 3) when 0 # Collect egg if $player.party_full? pbMessage(_INTL("Party is full, can't collect the egg.")) @@ -274,8 +274,8 @@ def pbDebugDayCare end end elsif cmd == commands.length - 1 # Steps to next cycle - case pbMessage("\\ts[]" + _INTL("Change number of steps to next cycle?"), [ - _INTL("Set to 1"), _INTL("Set to 256"), _INTL("Set to other value"), _INTL("Cancel")], 4) + case pbMessage("\\ts[]" + _INTL("Change number of steps to next cycle?"), + [_INTL("Set to 1"), _INTL("Set to 256"), _INTL("Set to other value"), _INTL("Cancel")], 4) when 0 # Set to 1 day_care.step_counter = 255 need_refresh = true @@ -302,8 +302,8 @@ def pbDebugDayCare msg += "\\n" + _INTL("Steps to next level: {1}", end_exp - pkmn.exp) end # Show level change and cost - case pbMessage("\\ts[]" + msg, [ - _INTL("Summary"), _INTL("Withdraw"), _INTL("Cancel")], 3) + case pbMessage("\\ts[]" + msg, + [_INTL("Summary"), _INTL("Withdraw"), _INTL("Cancel")], 3) when 0 # Summary pbFadeOutIn { scene = PokemonSummary_Scene.new @@ -322,8 +322,8 @@ def pbDebugDayCare end end else - case pbMessage("\\ts[]" + _INTL("This slot is empty."), [ - _INTL("Deposit"), _INTL("Cancel")], 2) + case pbMessage("\\ts[]" + _INTL("This slot is empty."), + [_INTL("Deposit"), _INTL("Cancel")], 2) when 0 # Deposit if $player.party.empty? pbMessage(_INTL("Party is empty, can't deposit Pokémon.")) @@ -449,7 +449,6 @@ def pbDebugRoamers else $PokemonGlobal.roamPosition[cmdwindow.index] = pbDefaultMap end - cmdwindow.refresh else # Roam to a random other map oldmap = $PokemonGlobal.roamPosition[cmdwindow.index] pbRoamPokemonOne(cmdwindow.index) @@ -458,8 +457,8 @@ def pbDebugRoamers pbRoamPokemonOne(cmdwindow.index) end $PokemonGlobal.roamedAlready = false - cmdwindow.refresh end + cmdwindow.refresh elsif Input.trigger?(Input::BACK) pbPlayCancelSE break @@ -476,7 +475,7 @@ def pbDebugRoamers $PokemonGlobal.roamPokemon[cmdwindow.index] = true $PokemonGlobal.roamPokemonCaught[cmdwindow.index] = false elsif $PokemonGlobal.roamPokemon[cmdwindow.index] == true && - !$PokemonGlobal.roamPokemonCaught[cmdwindow.index] + !$PokemonGlobal.roamPokemonCaught[cmdwindow.index] # defeated -> caught $PokemonGlobal.roamPokemonCaught[cmdwindow.index] = true elsif pkmn[2]>0 @@ -614,7 +613,7 @@ def pbImportAllAnimations Graphics.update audios = [] files = Dir.glob(folder+"/*.*") - %w( wav ogg mid wma ).each { |ext| # mp3 + %w[wav ogg mid wma].each { |ext| # mp3 upext = ext.upcase audios.concat(files.find_all { |f| f[f.length-3,3]==ext }) audios.concat(files.find_all { |f| f[f.length-3,3]==upext }) @@ -623,7 +622,7 @@ def pbImportAllAnimations pbSafeCopyFile(audio,RTP.getAudioPath("Audio/SE/Anim/"+File.basename(audio)),"Audio/SE/Anim/"+File.basename(audio)) end images = [] - %w( png gif ).each { |ext| # jpg jpeg bmp + %w[png gif].each { |ext| # jpg jpeg bmp upext = ext.upcase images.concat(files.find_all { |f| f[f.length-3,3]==ext }) images.concat(files.find_all { |f| f[f.length-3,3]==upext }) 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 f4e4e2593..5af51f606 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 @@ -163,10 +163,10 @@ PokemonDebugMenuCommands.register("setpokerus", { msg = [_INTL("{1} doesn't have Pokérus.", pkmn.name), _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) + cmd = screen.pbShowCommands(msg, + [_INTL("Give random strain"), + _INTL("Make not infectious"), + _INTL("Clear Pokérus")], cmd) break if cmd < 0 case cmd when 0 # Give random strain @@ -257,10 +257,10 @@ PokemonDebugMenuCommands.register("hiddenvalues", { cmd = 0 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) + cmd = screen.pbShowCommands(_INTL("Personal ID is {1}.", persid), + [_INTL("Set EVs"), + _INTL("Set IVs"), + _INTL("Randomise pID")], cmd) break if cmd < 0 case cmd when 0 # Set EVs @@ -574,10 +574,10 @@ PokemonDebugMenuCommands.register("setmovepp", { cmd2 = 0 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) + cmd2 = screen.pbShowCommands(msg, + [_INTL("Set PP"), + _INTL("Full PP"), + _INTL("Set PP Up")], cmd2) break if cmd2 < 0 case cmd2 when 0 # Change PP @@ -764,10 +764,10 @@ PokemonDebugMenuCommands.register("setgender", { cmd = 0 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) + cmd = screen.pbShowCommands(msg, + [_INTL("Make male"), + _INTL("Make female"), + _INTL("Reset")], cmd) break if cmd < 0 case cmd when 0 # Make male @@ -800,10 +800,10 @@ PokemonDebugMenuCommands.register("speciesform", { loop do 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) + cmd = screen.pbShowCommands(msg, + [_INTL("Set species"), + _INTL("Set form"), + _INTL("Remove form override")], cmd) break if cmd < 0 case cmd when 0 # Set species @@ -869,11 +869,11 @@ 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 @@ -969,9 +969,7 @@ PokemonDebugMenuCommands.register("setnickname", { speciesname = pkmn.speciesName msg = [_INTL("{1} has the nickname {2}.", speciesname, pkmn.name), _INTL("{1} has no nickname.", speciesname)][pkmn.nicknamed? ? 0 : 1] - cmd = screen.pbShowCommands(msg, [ - _INTL("Rename"), - _INTL("Erase name")], cmd) + cmd = screen.pbShowCommands(msg, [_INTL("Rename"), _INTL("Erase name")], cmd) break if cmd < 0 case cmd when 0 # Rename @@ -997,15 +995,16 @@ PokemonDebugMenuCommands.register("ownership", { cmd = 0 loop do gender = [_INTL("Male"), _INTL("Female"), _INTL("Unknown")][pkmn.owner.gender] - msg = [_INTL("Player's Pokémon\n{1}\n{2}\n{3} ({4})", pkmn.owner.name, gender, pkmn.owner.public_id, pkmn.owner.id), - _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) + msg = [_INTL("Player's Pokémon\n{1}\n{2}\n{3} ({4})", + pkmn.owner.name, gender, pkmn.owner.public_id, pkmn.owner.id), + _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) break if cmd < 0 case cmd when 0 # Make player's @@ -1073,10 +1072,10 @@ PokemonDebugMenuCommands.register("setegg", { loop do 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) + cmd = screen.pbShowCommands(msg, + [_INTL("Make egg"), + _INTL("Make Pokémon"), + _INTL("Set steps left to 1")], cmd) break if cmd < 0 case cmd when 0 # Make egg @@ -1114,11 +1113,8 @@ PokemonDebugMenuCommands.register("shadowpkmn", { cmd = 0 loop do msg = [_INTL("Not a Shadow Pokémon."), - _INTL("Heart gauge is {1} (stage {2}).", pkmn.heart_gauge, pkmn.heartStage) - ][pkmn.shadowPokemon? ? 1 : 0] - cmd = screen.pbShowCommands(msg, [ - _INTL("Make Shadow"), - _INTL("Set heart gauge")], cmd) + _INTL("Heart gauge is {1} (stage {2}).", pkmn.heart_gauge, pkmn.heartStage)][pkmn.shadowPokemon? ? 1 : 0] + cmd = screen.pbShowCommands(msg, [_INTL("Make Shadow"), _INTL("Set heart gauge")], cmd) break if cmd < 0 case cmd when 0 # Make Shadow diff --git a/Data/Scripts/020_Debug/003_Debug menus/009_Debug_BattleExtraCode.rb b/Data/Scripts/020_Debug/003_Debug menus/009_Debug_BattleExtraCode.rb index 75ead9818..4fceea3a7 100644 --- a/Data/Scripts/020_Debug/003_Debug menus/009_Debug_BattleExtraCode.rb +++ b/Data/Scripts/020_Debug/003_Debug menus/009_Debug_BattleExtraCode.rb @@ -3,165 +3,165 @@ #=============================================================================== module Battle::DebugVariables BATTLER_EFFECTS = { - PBEffects::AquaRing => {name: "Aqua Ring applies", default: false}, - PBEffects::Attract => {name: "Battler that self is attracted to", default: -1}, # Battler index - PBEffects::BanefulBunker => {name: "Baneful Bunker applies this round", default: false}, + PBEffects::AquaRing => { name: "Aqua Ring applies", default: false }, + PBEffects::Attract => { name: "Battler that self is attracted to", default: -1 }, # Battler index + PBEffects::BanefulBunker => { name: "Baneful Bunker applies this round", default: false }, # PBEffects::BeakBlast - only applies to use of specific move, not suitable for setting via debug - PBEffects::Bide => {name: "Bide number of rounds remaining", default: 0}, - PBEffects::BideDamage => {name: "Bide damage accumulated", default: 0, max: 999}, - PBEffects::BideTarget => {name: "Bide last battler to hurt self", default: -1}, # Battler index - PBEffects::BurnUp => {name: "Burn Up has removed self's Fire type", default: false}, - PBEffects::Charge => {name: "Charge number of rounds remaining", default: 0}, - PBEffects::ChoiceBand => {name: "Move locked into by Choice items", default: nil, type: :move}, - PBEffects::Confusion => {name: "Confusion number of rounds remaining", default: 0}, + PBEffects::Bide => { name: "Bide number of rounds remaining", default: 0 }, + PBEffects::BideDamage => { name: "Bide damage accumulated", default: 0, max: 999 }, + PBEffects::BideTarget => { name: "Bide last battler to hurt self", default: -1 }, # Battler index + PBEffects::BurnUp => { name: "Burn Up has removed self's Fire type", default: false }, + PBEffects::Charge => { name: "Charge number of rounds remaining", default: 0 }, + PBEffects::ChoiceBand => { name: "Move locked into by Choice items", default: nil, type: :move }, + PBEffects::Confusion => { name: "Confusion number of rounds remaining", default: 0 }, # PBEffects::Counter - not suitable for setting via debug # PBEffects::CounterTarget - not suitable for setting via debug - PBEffects::Curse => {name: "Curse damaging applies", default: false}, + PBEffects::Curse => { name: "Curse damaging applies", default: false }, # PBEffects::Dancer - only used while Dancer is running, not suitable for setting via debug - PBEffects::DefenseCurl => {name: "Used Defense Curl", default: false}, + PBEffects::DefenseCurl => { name: "Used Defense Curl", default: false }, # PBEffects::DestinyBond - not suitable for setting via debug # PBEffects::DestinyBondPrevious - not suitable for setting via debug # PBEffects::DestinyBondTarget - not suitable for setting via debug - PBEffects::Disable => {name: "Disable number of rounds remaining", default: 0}, - PBEffects::DisableMove => {name: "Disabled move", default: nil, type: :move}, - PBEffects::Electrify => {name: "Electrify making moves Electric", default: false}, - PBEffects::Embargo => {name: "Embargo number of rounds remaining", default: 0}, - PBEffects::Encore => {name: "Encore number of rounds remaining", default: 0}, - PBEffects::EncoreMove => {name: "Encored move", default: nil, type: :move}, - PBEffects::Endure => {name: "Endures all lethal damage this round", default: false}, + PBEffects::Disable => { name: "Disable number of rounds remaining", default: 0 }, + PBEffects::DisableMove => { name: "Disabled move", default: nil, type: :move }, + PBEffects::Electrify => { name: "Electrify making moves Electric", default: false }, + PBEffects::Embargo => { name: "Embargo number of rounds remaining", default: 0 }, + PBEffects::Encore => { name: "Encore number of rounds remaining", default: 0 }, + PBEffects::EncoreMove => { name: "Encored move", default: nil, type: :move }, + PBEffects::Endure => { name: "Endures all lethal damage this round", default: false }, # PBEffects::FirstPledge - only applies to use of specific move, not suitable for setting via debug - PBEffects::FlashFire => {name: "Flash Fire powering up Fire moves", default: false}, - PBEffects::Flinch => {name: "Will flinch this round", default: false}, - PBEffects::FocusEnergy => {name: "Focus Energy critical hit stages (0-4)", default: 0, max: 4}, + PBEffects::FlashFire => { name: "Flash Fire powering up Fire moves", default: false }, + PBEffects::Flinch => { name: "Will flinch this round", default: false }, + PBEffects::FocusEnergy => { name: "Focus Energy critical hit stages (0-4)", default: 0, max: 4 }, # PBEffects::FocusPunch - only applies to use of specific move, not suitable for setting via debug - PBEffects::FollowMe => {name: "Follow Me drawing in attacks (if 1+)", default: 0}, # Order of use, lowest takes priority - PBEffects::RagePowder => {name: "Rage Powder applies (use with Follow Me)", default: false}, - PBEffects::Foresight => {name: "Foresight applies (Ghost loses immunities)", default: false}, - PBEffects::FuryCutter => {name: "Fury Cutter power multiplier 2**x (0-4)", default: 0, max: 4}, - PBEffects::GastroAcid => {name: "Gastro Acid is negating self's ability", default: false}, + PBEffects::FollowMe => { name: "Follow Me drawing in attacks (if 1+)", default: 0 }, # Order of use, lowest takes priority + PBEffects::RagePowder => { name: "Rage Powder applies (use with Follow Me)", default: false }, + PBEffects::Foresight => { name: "Foresight applies (Ghost loses immunities)", default: false }, + PBEffects::FuryCutter => { name: "Fury Cutter power multiplier 2**x (0-4)", default: 0, max: 4 }, + PBEffects::GastroAcid => { name: "Gastro Acid is negating self's ability", default: false }, # PBEffects::GemConsumed - only applies during use of move, not suitable for setting via debug - PBEffects::Grudge => {name: "Grudge will apply if self faints", default: false}, - PBEffects::HealBlock => {name: "Heal Block number of rounds remaining", default: 0}, - PBEffects::HelpingHand => {name: "Helping Hand will power up self's move", default: false}, - PBEffects::HyperBeam => {name: "Hyper Beam recharge rounds remaining", default: 0}, + PBEffects::Grudge => { name: "Grudge will apply if self faints", default: false }, + PBEffects::HealBlock => { name: "Heal Block number of rounds remaining", default: 0 }, + PBEffects::HelpingHand => { name: "Helping Hand will power up self's move", default: false }, + PBEffects::HyperBeam => { name: "Hyper Beam recharge rounds remaining", default: 0 }, # PBEffects::Illusion - is a Pokémon object, too complex to be worth bothering with - PBEffects::Imprison => {name: "Imprison disables others' moves known by self", default: false}, - PBEffects::Ingrain => {name: "Ingrain applies", default: false}, + PBEffects::Imprison => { name: "Imprison disables others' moves known by self", default: false }, + PBEffects::Ingrain => { name: "Ingrain applies", default: false }, # PBEffects::Instruct - only used while Instruct is running, not suitable for setting via debug # PBEffects::Instructed - only used while Instruct is running, not suitable for setting via debug - PBEffects::JawLock => {name: "Battler trapping self with Jaw Lock", default: -1}, # Battler index - PBEffects::KingsShield => {name: "King's Shield applies this round", default: false}, - PBEffects::LaserFocus => {name: "Laser Focus certain critial hit duration", default: 0}, - PBEffects::LeechSeed => {name: "Battler that used Leech Seed on self", default: -1}, # Battler index - PBEffects::LockOn => {name: "Lock-On number of rounds remaining", default: 0}, - PBEffects::LockOnPos => {name: "Battler that self is targeting with Lock-On", default: -1}, # Battler index + PBEffects::JawLock => { name: "Battler trapping self with Jaw Lock", default: -1 }, # Battler index + PBEffects::KingsShield => { name: "King's Shield applies this round", default: false }, + PBEffects::LaserFocus => { name: "Laser Focus certain critial hit duration", default: 0 }, + PBEffects::LeechSeed => { name: "Battler that used Leech Seed on self", default: -1 }, # Battler index + PBEffects::LockOn => { name: "Lock-On number of rounds remaining", default: 0 }, + PBEffects::LockOnPos => { name: "Battler that self is targeting with Lock-On", default: -1 }, # Battler index # PBEffects::MagicBounce - only applies during use of move, not suitable for setting via debug # PBEffects::MagicCoat - only applies to use of specific move, not suitable for setting via debug - PBEffects::MagnetRise => {name: "Magnet Rise number of rounds remaining", default: 0}, - PBEffects::MeanLook => {name: "Battler trapping self with Mean Look, etc.", default: -1}, # Battler index + PBEffects::MagnetRise => { name: "Magnet Rise number of rounds remaining", default: 0 }, + PBEffects::MeanLook => { name: "Battler trapping self with Mean Look, etc.", default: -1 }, # Battler index # PBEffects::MeFirst - only applies to use of specific move, not suitable for setting via debug - PBEffects::Metronome => {name: "Metronome item power multiplier 1 + 0.2*x (0-5)", default: 0, max: 5}, - PBEffects::MicleBerry => {name: "Micle Berry boosting next move's accuracy", default: false}, - PBEffects::Minimize => {name: "Used Minimize", default: false}, - PBEffects::MiracleEye => {name: "Miracle Eye applies (Dark loses immunities)", default: false}, + PBEffects::Metronome => { name: "Metronome item power multiplier 1 + 0.2*x (0-5)", default: 0, max: 5 }, + PBEffects::MicleBerry => { name: "Micle Berry boosting next move's accuracy", default: false }, + PBEffects::Minimize => { name: "Used Minimize", default: false }, + PBEffects::MiracleEye => { name: "Miracle Eye applies (Dark loses immunities)", default: false }, # PBEffects::MirrorCoat - not suitable for setting via debug # PBEffects::MirrorCoatTarget - not suitable for setting via debug # PBEffects::MoveNext - not suitable for setting via debug - PBEffects::MudSport => {name: "Used Mud Sport (Gen 5 and older)", default: false}, - PBEffects::Nightmare => {name: "Taking Nightmare damage", default: false}, - PBEffects::NoRetreat => {name: "No Retreat trapping self in battle", default: false}, - PBEffects::Obstruct => {name: "Obstruct applies this round", default: false}, - PBEffects::Octolock => {name: "Battler trapping self with Octolock", default: -1}, # Battler index - PBEffects::Outrage => {name: "Outrage number of rounds remaining", default: 0}, + PBEffects::MudSport => { name: "Used Mud Sport (Gen 5 and older)", default: false }, + PBEffects::Nightmare => { name: "Taking Nightmare damage", default: false }, + PBEffects::NoRetreat => { name: "No Retreat trapping self in battle", default: false }, + PBEffects::Obstruct => { name: "Obstruct applies this round", default: false }, + PBEffects::Octolock => { name: "Battler trapping self with Octolock", default: -1 }, # Battler index + PBEffects::Outrage => { name: "Outrage number of rounds remaining", default: 0 }, # PBEffects::ParentalBond - only applies during use of move, not suitable for setting via debug - PBEffects::PerishSong => {name: "Perish Song number of rounds remaining", default: 0}, - PBEffects::PerishSongUser => {name: "Battler that used Perish Song on self", default: -1}, # Battler index - PBEffects::PickupItem => {name: "Item retrievable by Pickup", default: nil, type: :item}, - PBEffects::PickupUse => {name: "Pickup item consumed time (higher=more recent)", default: 0}, - PBEffects::Pinch => {name: "(Battle Palace) Behavior changed at <50% HP", default: false}, - PBEffects::Powder => {name: "Powder will explode self's Fire move this round", default: false}, + PBEffects::PerishSong => { name: "Perish Song number of rounds remaining", default: 0 }, + PBEffects::PerishSongUser => { name: "Battler that used Perish Song on self", default: -1 }, # Battler index + PBEffects::PickupItem => { name: "Item retrievable by Pickup", default: nil, type: :item }, + PBEffects::PickupUse => { name: "Pickup item consumed time (higher=more recent)", default: 0 }, + PBEffects::Pinch => { name: "(Battle Palace) Behavior changed at <50% HP", default: false }, + PBEffects::Powder => { name: "Powder will explode self's Fire move this round", default: false }, # PBEffects::PowerTrick - doesn't actually swap the stats therefore does nothing, not suitable for setting via debug # PBEffects::Prankster - not suitable for setting via debug # PBEffects::PriorityAbility - not suitable for setting via debug # PBEffects::PriorityItem - not suitable for setting via debug - PBEffects::Protect => {name: "Protect applies this round", default: false}, - PBEffects::ProtectRate => {name: "Protect success chance 1/x", default: 1, max: 999}, + PBEffects::Protect => { name: "Protect applies this round", default: false }, + PBEffects::ProtectRate => { name: "Protect success chance 1/x", default: 1, max: 999 }, # PBEffects::Pursuit - not suitable for setting via debug # PBEffects::Quash - not suitable for setting via debug # PBEffects::Rage - only applies to use of specific move, not suitable for setting via debug - PBEffects::Rollout => {name: "Rollout rounds remaining (lower=stronger)", default: 0}, - PBEffects::Roost => {name: "Roost removing Flying type this round", default: false}, + PBEffects::Rollout => { name: "Rollout rounds remaining (lower=stronger)", default: 0 }, + PBEffects::Roost => { name: "Roost removing Flying type this round", default: false }, # PBEffects::ShellTrap - only applies to use of specific move, not suitable for setting via debug # PBEffects::SkyDrop - only applies to use of specific move, not suitable for setting via debug - PBEffects::SlowStart => {name: "Slow Start rounds remaining", default: 0}, - PBEffects::SmackDown => {name: "Smack Down is grounding self", default: false}, + PBEffects::SlowStart => { name: "Slow Start rounds remaining", default: 0 }, + PBEffects::SmackDown => { name: "Smack Down is grounding self", default: false }, # PBEffects::Snatch - only applies to use of specific move, not suitable for setting via debug - PBEffects::SpikyShield => {name: "Spiky Shield applies this round", default: false}, - PBEffects::Spotlight => {name: "Spotlight drawing in attacks (if 1+)", default: 0}, - PBEffects::Stockpile => {name: "Stockpile count (0-3)", default: 0, max: 3}, - PBEffects::StockpileDef => {name: "Def stages gained by Stockpile (0-12)", default: 0, max: 12}, - PBEffects::StockpileSpDef => {name: "Sp. Def stages gained by Stockpile (0-12)", default: 0, max: 12}, - PBEffects::Substitute => {name: "Substitute's HP", default: 0, max: 999}, - PBEffects::TarShot => {name: "Tar Shot weakening self to Fire", default: false}, - PBEffects::Taunt => {name: "Taunt number of rounds remaining", default: 0}, - PBEffects::Telekinesis => {name: "Telekinesis number of rounds remaining", default: 0}, - PBEffects::ThroatChop => {name: "Throat Chop number of rounds remaining", default: 0}, - PBEffects::Torment => {name: "Torment preventing repeating moves", default: false}, + PBEffects::SpikyShield => { name: "Spiky Shield applies this round", default: false }, + PBEffects::Spotlight => { name: "Spotlight drawing in attacks (if 1+)", default: 0 }, + PBEffects::Stockpile => { name: "Stockpile count (0-3)", default: 0, max: 3 }, + PBEffects::StockpileDef => { name: "Def stages gained by Stockpile (0-12)", default: 0, max: 12 }, + PBEffects::StockpileSpDef => { name: "Sp. Def stages gained by Stockpile (0-12)", default: 0, max: 12 }, + PBEffects::Substitute => { name: "Substitute's HP", default: 0, max: 999 }, + PBEffects::TarShot => { name: "Tar Shot weakening self to Fire", default: false }, + PBEffects::Taunt => { name: "Taunt number of rounds remaining", default: 0 }, + PBEffects::Telekinesis => { name: "Telekinesis number of rounds remaining", default: 0 }, + PBEffects::ThroatChop => { name: "Throat Chop number of rounds remaining", default: 0 }, + PBEffects::Torment => { name: "Torment preventing repeating moves", default: false }, # PBEffects::Toxic - set elsewhere # PBEffects::Transform - too complex to be worth bothering with # PBEffects::TransformSpecies - too complex to be worth bothering with - PBEffects::Trapping => {name: "Trapping number of rounds remaining", default: 0}, - PBEffects::TrappingMove => {name: "Move that is trapping self", default: nil, type: :move}, - PBEffects::TrappingUser => {name: "Battler trapping self (for Binding Band)", default: -1}, # Battler index - PBEffects::Truant => {name: "Truant will loaf around this round", default: false}, + PBEffects::Trapping => { name: "Trapping number of rounds remaining", default: 0 }, + PBEffects::TrappingMove => { name: "Move that is trapping self", default: nil, type: :move }, + PBEffects::TrappingUser => { name: "Battler trapping self (for Binding Band)", default: -1 }, # Battler index + PBEffects::Truant => { name: "Truant will loaf around this round", default: false }, # PBEffects::TwoTurnAttack - only applies to use of specific moves, not suitable for setting via debug # PBEffects::Type3 - set elsewhere - PBEffects::Unburden => {name: "Self lost its item (for Unburden)", default: false}, - PBEffects::Uproar => {name: "Uproar number of rounds remaining", default: 0}, - PBEffects::WaterSport => {name: "Used Water Sport (Gen 5 and older)", default: false}, - PBEffects::WeightChange => {name: "Weight change +0.1*x kg", default: 0, min: -99999, max: 99999}, - PBEffects::Yawn => {name: "Yawn rounds remaining until falling asleep", default: 0} + PBEffects::Unburden => { name: "Self lost its item (for Unburden)", default: false }, + PBEffects::Uproar => { name: "Uproar number of rounds remaining", default: 0 }, + PBEffects::WaterSport => { name: "Used Water Sport (Gen 5 and older)", default: false }, + PBEffects::WeightChange => { name: "Weight change +0.1*x kg", default: 0, min: -99999, max: 99999 }, + PBEffects::Yawn => { name: "Yawn rounds remaining until falling asleep", default: 0 } } SIDE_EFFECTS = { - PBEffects::AuroraVeil => {name: "Aurora Veil duration", default: 0}, - PBEffects::CraftyShield => {name: "Crafty Shield applies this round", default: false}, - PBEffects::EchoedVoiceCounter => {name: "Echoed Voice rounds used (max. 5)", default: 0, max: 5}, - PBEffects::EchoedVoiceUsed => {name: "Echoed Voice used this round", default: false}, - PBEffects::LastRoundFainted => {name: "Round when side's battler last fainted", default: -2}, # Treated as -1, isn't a battler index - PBEffects::LightScreen => {name: "Light Screen duration", default: 0}, - PBEffects::LuckyChant => {name: "Lucky Chant duration", default: 0}, - PBEffects::MatBlock => {name: "Mat Block applies this round", default: false}, - PBEffects::Mist => {name: "Mist duration", default: 0}, - PBEffects::QuickGuard => {name: "Quick Guard applies this round", default: false}, - PBEffects::Rainbow => {name: "Rainbow duration", default: 0}, - PBEffects::Reflect => {name: "Reflect duration", default: 0}, - PBEffects::Round => {name: "Round was used this round", default: false}, - PBEffects::Safeguard => {name: "Safeguard duration", default: 0}, - PBEffects::SeaOfFire => {name: "Sea Of Fire duration", default: 0}, - PBEffects::Spikes => {name: "Spikes layers (0-3)", default: 0, max: 3}, - PBEffects::StealthRock => {name: "Stealth Rock exists", default: false}, - PBEffects::StickyWeb => {name: "Sticky Web exists", default: false}, - PBEffects::Swamp => {name: "Swamp duration", default: 0}, - PBEffects::Tailwind => {name: "Tailwind duration", default: 0}, - PBEffects::ToxicSpikes => {name: "Toxic Spikes layers (0-2)", default: 0, max: 2}, - PBEffects::WideGuard => {name: "Wide Guard applies this round", default: false} + PBEffects::AuroraVeil => { name: "Aurora Veil duration", default: 0 }, + PBEffects::CraftyShield => { name: "Crafty Shield applies this round", default: false }, + PBEffects::EchoedVoiceCounter => { name: "Echoed Voice rounds used (max. 5)", default: 0, max: 5 }, + PBEffects::EchoedVoiceUsed => { name: "Echoed Voice used this round", default: false }, + PBEffects::LastRoundFainted => { name: "Round when side's battler last fainted", default: -2 }, # Treated as -1, isn't a battler index + PBEffects::LightScreen => { name: "Light Screen duration", default: 0 }, + PBEffects::LuckyChant => { name: "Lucky Chant duration", default: 0 }, + PBEffects::MatBlock => { name: "Mat Block applies this round", default: false }, + PBEffects::Mist => { name: "Mist duration", default: 0 }, + PBEffects::QuickGuard => { name: "Quick Guard applies this round", default: false }, + PBEffects::Rainbow => { name: "Rainbow duration", default: 0 }, + PBEffects::Reflect => { name: "Reflect duration", default: 0 }, + PBEffects::Round => { name: "Round was used this round", default: false }, + PBEffects::Safeguard => { name: "Safeguard duration", default: 0 }, + PBEffects::SeaOfFire => { name: "Sea Of Fire duration", default: 0 }, + PBEffects::Spikes => { name: "Spikes layers (0-3)", default: 0, max: 3 }, + PBEffects::StealthRock => { name: "Stealth Rock exists", default: false }, + PBEffects::StickyWeb => { name: "Sticky Web exists", default: false }, + PBEffects::Swamp => { name: "Swamp duration", default: 0 }, + PBEffects::Tailwind => { name: "Tailwind duration", default: 0 }, + PBEffects::ToxicSpikes => { name: "Toxic Spikes layers (0-2)", default: 0, max: 2 }, + PBEffects::WideGuard => { name: "Wide Guard applies this round", default: false } } FIELD_EFFECTS = { - PBEffects::AmuletCoin => {name: "Amulet Coin doubling prize money", default: false}, - PBEffects::FairyLock => {name: "Fairy Lock trapping duration", default: 0}, - PBEffects::FusionBolt => {name: "Fusion Bolt was used", default: false}, - PBEffects::FusionFlare => {name: "Fusion Flare was used", default: false}, - PBEffects::Gravity => {name: "Gravity duration", default: 0}, - PBEffects::HappyHour => {name: "Happy Hour doubling prize money", default: false}, - PBEffects::IonDeluge => {name: "Ion Deluge making moves Electric", default: false}, - PBEffects::MagicRoom => {name: "Magic Room duration", default: 0}, - PBEffects::MudSportField => {name: "Mud Sport duration (Gen 6+)", default: 0}, - PBEffects::PayDay => {name: "Pay Day additional prize money", default: 0, max: Settings::MAX_MONEY}, - PBEffects::TrickRoom => {name: "Trick Room duration", default: 0}, - PBEffects::WaterSportField => {name: "Water Sport duration (Gen 6+)", default: 0}, - PBEffects::WonderRoom => {name: "Wonder Room duration", default: 0} + PBEffects::AmuletCoin => { name: "Amulet Coin doubling prize money", default: false }, + PBEffects::FairyLock => { name: "Fairy Lock trapping duration", default: 0 }, + PBEffects::FusionBolt => { name: "Fusion Bolt was used", default: false }, + PBEffects::FusionFlare => { name: "Fusion Flare was used", default: false }, + PBEffects::Gravity => { name: "Gravity duration", default: 0 }, + PBEffects::HappyHour => { name: "Happy Hour doubling prize money", default: false }, + PBEffects::IonDeluge => { name: "Ion Deluge making moves Electric", default: false }, + PBEffects::MagicRoom => { name: "Magic Room duration", default: 0 }, + PBEffects::MudSportField => { name: "Mud Sport duration (Gen 6+)", default: 0 }, + PBEffects::PayDay => { name: "Pay Day additional prize money", default: 0, max: Settings::MAX_MONEY }, + PBEffects::TrickRoom => { name: "Trick Room duration", default: 0 }, + PBEffects::WaterSportField => { name: "Water Sport duration (Gen 6+)", default: 0 }, + PBEffects::WonderRoom => { name: "Wonder Room duration", default: 0 } } end diff --git a/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb b/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb index 223eca378..4622edcf9 100644 --- a/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb +++ b/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb @@ -347,10 +347,11 @@ module Compiler GameData::Move.register(move_hash) 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 - ]) + line = pbGetCsvRecord(line, line_no, + [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) @@ -467,8 +468,10 @@ module Compiler # Add previous item's data to records 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]) + line = pbGetCsvRecord(line, line_no, + [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) @@ -1337,12 +1340,14 @@ module Compiler # Add previous trainer type's data to records 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]) + 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] + ) 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/004_Compiler_MapsAndEvents.rb b/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb index 8ebe560cd..327819d6e 100644 --- a/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb +++ b/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb @@ -786,16 +786,18 @@ module Compiler PBMoveRoute::PlaySE,RPG::AudioFile.new("Door enter"),PBMoveRoute::Wait,2, PBMoveRoute::TurnLeft,PBMoveRoute::Wait,2, PBMoveRoute::TurnRight,PBMoveRoute::Wait,2, - PBMoveRoute::TurnUp,PBMoveRoute::Wait,2]) + PBMoveRoute::TurnUp,PBMoveRoute::Wait,2 + ]) push_move_route_and_wait(list,-1,[ # Move Route for player entering door - PBMoveRoute::ThroughOn,PBMoveRoute::Up,PBMoveRoute::ThroughOff]) + PBMoveRoute::ThroughOn,PBMoveRoute::Up,PBMoveRoute::ThroughOff + ]) push_event(list,208,[0]) # Change Transparent Flag (invisible) push_script(list, "Followers.follow_into_door") push_event(list, 210, [], indent) # Wait for Move's Completion push_move_route_and_wait(list,0,[PBMoveRoute::Wait,2, # Move Route for door closing - PBMoveRoute::TurnRight,PBMoveRoute::Wait,2, - PBMoveRoute::TurnLeft,PBMoveRoute::Wait,2, - PBMoveRoute::TurnDown,PBMoveRoute::Wait,2]) + PBMoveRoute::TurnRight,PBMoveRoute::Wait,2, + PBMoveRoute::TurnLeft,PBMoveRoute::Wait,2, + PBMoveRoute::TurnDown,PBMoveRoute::Wait,2]) push_event(list,223,[Tone.new(-255,-255,-255),6]) # Change Screen Color Tone push_wait(list,8) # Wait push_event(list,208,[1]) # Change Transparent Flag (visible) @@ -809,14 +811,16 @@ module Compiler push_event(list,208,[0],1) # Change Transparent Flag (invisible) push_script(list, "Followers.hide_followers", 1) push_move_route_and_wait(list,0,[ # Move Route for setting door to open - PBMoveRoute::TurnLeft,PBMoveRoute::Wait,6],1) + PBMoveRoute::TurnLeft,PBMoveRoute::Wait,6 + ],1) push_event(list,208,[1],1) # Change Transparent Flag (visible) push_move_route_and_wait(list,-1,[PBMoveRoute::Down],1) # Move Route for player exiting door push_script(list, "Followers.put_followers_on_player", 1) push_move_route_and_wait(list,0,[ # Move Route for door closing PBMoveRoute::TurnUp,PBMoveRoute::Wait,2, PBMoveRoute::TurnRight,PBMoveRoute::Wait,2, - PBMoveRoute::TurnDown,PBMoveRoute::Wait,2],1) + PBMoveRoute::TurnDown,PBMoveRoute::Wait,2 + ],1) push_branch_end(list,1) push_script(list,"setTempSwitchOn(\"A\")") push_end(list) @@ -973,7 +977,6 @@ module Compiler push_script(newEvents,"pbReceiveItem(:#{itemname})",oldIndent+1) push_else(newEvents,oldIndent+1) push_text(newEvents,_INTL("You have no room left in the Bag."),oldIndent+1) - push_branch_end(newEvents,oldIndent+1) else push_event(newEvents,111,[7,cost,0],oldIndent) push_branch(newEvents,"$bag.can_add?(:#{itemname})",oldIndent+1) @@ -985,8 +988,8 @@ module Compiler push_branch_end(newEvents,oldIndent+2) push_else(newEvents,oldIndent+1) push_text(newEvents,_INTL("\\GYou don't have enough money."),oldIndent+1) - push_branch_end(newEvents,oldIndent+1) end + push_branch_end(newEvents,oldIndent+1) list[i,0] = newEvents # insert 'newEvents' at index 'i' changed = true end @@ -1238,7 +1241,7 @@ module Compiler end # Find a punctuation mark to split at punct = [message.rindex(". "),message.rindex(".\n"), - message.rindex("!"),message.rindex("?"),-1].compact.max + message.rindex("!"),message.rindex("?"),-1].compact.max if punct==-1 punct = [message.rindex(", "),message.rindex(",\n"),-1].compact.max end