From b0b6e675c327aca5401b7d447a189ceebf413b8a Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Mon, 23 Jan 2023 22:27:04 +0000 Subject: [PATCH] Fixed previous commit always causing recompiling if shadow_pokemon.dat doesn't exist, also rubocopping --- .rubocop.yml | 18 ++ .../001_Technical/002_Files/001_FileTests.rb | 93 +++---- .../001_Technical/002_RubyUtilities.rb | 24 +- .../001_Technical/003_Intl_Messages.rb | 12 +- .../001_Technical/005_PluginManager.rb | 59 ++--- Data/Scripts/001_Technical/006_RPG_Sprite.rb | 8 +- .../003_Game processing/003_Interpreter.rb | 40 +-- .../004_Interpreter_Commands.rb | 69 +++++ .../004_Game classes/001_Game_Screen.rb | 36 +-- .../002_Game_Switches.rb | 13 +- .../003_Game_Variables.rb | 13 +- .../004_Game_SelfSwitches.rb | 13 +- .../004_Game classes/003_Game_Picture.rb | 38 +-- Data/Scripts/004_Game classes/004_Game_Map.rb | 18 +- .../005_Game_Map_Autoscroll.rb | 16 +- .../004_Game classes/006_Game_MapFactory.rb | 2 +- .../004_Game classes/009_Game_Player.rb | 42 +-- .../004_Game classes/010_Game_CommonEvent.rb | 32 +-- .../012_Game_FollowerFactory.rb | 3 +- .../005_Sprites/003_Sprite_Character.rb | 8 +- .../005_Sprites/005_Sprite_SurfBase.rb | 2 +- Data/Scripts/005_Sprites/007_Spriteset_Map.rb | 9 +- .../005_Sprites/008_Sprite_AnimationSprite.rb | 16 +- .../005_Sprites/009_Sprite_DynamicShadows.rb | 24 +- .../Scripts/005_Sprites/010_ParticleEngine.rb | 91 ++++--- Data/Scripts/005_Sprites/011_PictureEx.rb | 17 +- Data/Scripts/005_Sprites/012_Interpolators.rb | 13 +- .../007_Objects and windows/001_RPG_Cache.rb | 13 +- .../002_MessageConfig.rb | 14 +- .../007_Objects and windows/003_Window.rb | 7 +- .../004_SpriteWindow.rb | 11 +- .../005_SpriteWindow_text.rb | 22 +- .../006_SpriteWindow_pictures.rb | 2 - .../007_SpriteWrapper.rb | 8 - .../007_Objects and windows/010_DrawText.rb | 9 - .../007_Objects and windows/011_Messages.rb | 19 +- .../007_Objects and windows/012_TextEntry.rb | 6 - Data/Scripts/009_Scenes/002_EventScene.rb | 11 +- .../010_Data/002_PBS data/004_Ability.rb | 8 +- .../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 | 8 +- .../010_Data/002_PBS data/015_Trainer.rb | 4 +- .../010_Data/002_PBS data/021_PhoneMessage.rb | 2 +- .../011_Battle/001_Battle/001_Battle.rb | 6 +- .../002_Battler/003_Battler_ChangeSelf.rb | 2 +- .../008_MoveEffects_MoveAttributes.rb | 2 - .../004_Scene/005_Battle_Scene_Menus.rb | 6 - .../004_Scene/006_Battle_Scene_Objects.rb | 6 - .../004_Scene/008_Battle_Scene_Animations.rb | 32 --- .../004_Scene/009_Battle_DebugScene.rb | 3 +- .../006_Battle_Clauses.rb | 76 +++--- .../007_BattleAnimationPlayer.rb | 14 - .../008_Battle_AbilityEffects.rb | 5 +- .../001_SafariBattle.rb | 40 +-- .../002_BugContestBattle.rb | 2 - .../003_BattlePalaceBattle.rb | 2 - .../004_BattleArenaBattle.rb | 6 - .../002_Overworld_Overlays.rb | 24 +- .../003_Overworld_MapTransitionAnims.rb | 2 - Data/Scripts/012_Overworld/001_Overworld.rb | 48 +--- .../001_Overworld_BattleStarting.rb | 10 +- .../003_Overworld_WildEncounters.rb | 8 +- .../005_Overworld_RoamingPokemon.rb | 12 +- .../012_Overworld/002_Overworld_Metadata.rb | 2 - .../012_Overworld/003_Overworld_Time.rb | 166 ++++++------ .../012_Overworld/004_Overworld_FieldMoves.rb | 31 +-- .../008_Overworld_RandomDungeons.rb | 14 +- Data/Scripts/013_Items/001_Item_Utilities.rb | 7 +- Data/Scripts/013_Items/005_Item_PokeRadar.rb | 22 +- Data/Scripts/013_Items/006_Item_Mail.rb | 7 +- Data/Scripts/013_Items/007_Item_Sprites.rb | 2 - Data/Scripts/013_Items/008_PokemonBag.rb | 20 +- .../001_Pokemon-related/001_FormHandlers.rb | 9 +- .../002_ShadowPokemon_Other.rb | 38 +-- .../003_Pokemon_Sprites.rb | 4 - .../001_Pokemon-related/004_PokemonStorage.rb | 12 +- .../001_UI_SplashesAndTitleScreen.rb | 8 +- Data/Scripts/016_UI/001_UI_PauseMenu.rb | 5 +- Data/Scripts/016_UI/010_UI_Phone.rb | 2 +- Data/Scripts/016_UI/015_UI_Options.rb | 2 +- ...PointShop.rb => 021_UI_BattlePointShop.rb} | 2 +- Data/Scripts/016_UI/023_UI_PurifyChamber.rb | 2 +- Data/Scripts/016_UI/025_UI_TextEntry.rb | 10 - .../017_Minigames/002_Minigame_TripleTriad.rb | 19 +- .../017_Minigames/003_Minigame_SlotMachine.rb | 24 +- .../017_Minigames/004_Minigame_VoltorbFlip.rb | 10 +- .../017_Minigames/006_Minigame_Mining.rb | 29 ++- .../017_Minigames/007_Minigame_TilePuzzles.rb | 19 +- .../001_Battle Frontier/005_UI_BattleSwap.rb | 8 +- .../001_Editor screens/001_EditorScreens.rb | 29 +-- .../Scripts/020_Debug/001_Editor_Utilities.rb | 6 +- .../001_AnimEditor_SceneElements.rb | 72 +++--- .../002_AnimEditor_ControlsButtons.rb | 67 +++-- .../003_AnimEditor_Interpolation.rb | 19 +- .../005_AnimEditor_Functions.rb | 31 ++- .../Scripts/020_Debug/002_Editor_DataTypes.rb | 240 ++++++++++-------- .../003_Debug_MenuExtraCode.rb | 22 +- .../004_Debug_BattleCommands.rb | 4 +- .../006_Debug_BattleExtraCode.rb | 240 +++++++++--------- Data/Scripts/021_Compiler/001_Compiler.rb | 2 +- .../021_Compiler/002_Compiler_CompilePBS.rb | 2 +- .../021_Compiler/003_Compiler_WritePBS.rb | 2 +- 103 files changed, 1099 insertions(+), 1302 deletions(-) rename Data/Scripts/016_UI/{021_BattlePointShop.rb => 021_UI_BattlePointShop.rb} (99%) diff --git a/.rubocop.yml b/.rubocop.yml index 53df72f85..9ad1f5ac4 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -21,6 +21,10 @@ Layout/HashAlignment: EnforcedHashRocketStyle: table EnforcedColonStyle: table +# This interferes with the presentation of some code, notably registered procs. +Layout/MultilineMethodCallBraceLayout: + Enabled: false + # This means hashes and arrays are written the same way, rather than hashes # needing to be written like { foo => bar } while arrays are like [foo, bar]. Layout/SpaceInsideHashLiteralBraces: @@ -106,6 +110,11 @@ Style/GlobalVars: Style/HashSyntax: EnforcedStyle: no_mixed_keys +# The alernative is ->(x) { x } which is less English than "lambda". This style +# makes lambda definitions require the word "lambda". +Style/Lambda: + EnforcedStyle: lambda + # unless just adds mental gymnastics trying to figure out what it actually # means. I much prefer if !something. Style/NegatedIf: @@ -139,6 +148,11 @@ Style/SingleLineBlockParams: Style/SingleLineMethods: Enabled: false +# This requires writing array[n..] instead of array[n..-1], and I think endless +# ranges look bad. +Style/SlicingWithRange: + Enabled: false + # Single quotes being faster is hardly measurable and only affects parse time. # Enforcing double quotes reduces the times where you need to change them # when introducing an interpolation or an apostrophe. Use single quotes only if @@ -154,6 +168,10 @@ Style/SymbolArray: Style/WordArray: EnforcedStyle: brackets +# Allows procs to be written like { |obj| obj.something } which is clearer. +Style/SymbolProc: + AllowMethodsWithArguments: true + # Parentheses around the condition in a ternary operator helps to differentiate # it from the true/false results. Style/TernaryParentheses: diff --git a/Data/Scripts/001_Technical/002_Files/001_FileTests.rb b/Data/Scripts/001_Technical/002_Files/001_FileTests.rb index 417225a47..e657e22c9 100644 --- a/Data/Scripts/001_Technical/002_Files/001_FileTests.rb +++ b/Data/Scripts/001_Technical/002_Files/001_FileTests.rb @@ -2,9 +2,7 @@ # Reads files of certain format from a directory #=============================================================================== class Dir - #----------------------------------------------------------------------------- - # Reads all files in a directory - #----------------------------------------------------------------------------- + # Reads all files in a directory def self.get(dir, filters = "*", full = true) files = [] filters = [filters] if !filters.is_a?(Array) @@ -15,9 +13,8 @@ class Dir end return files.sort end - #----------------------------------------------------------------------------- - # Generates entire file/folder tree from a certain directory - #----------------------------------------------------------------------------- + + # Generates entire file/folder tree from a certain directory def self.all(dir, filters = "*", full = true) # sets variables for starting files = [] @@ -33,18 +30,16 @@ class Dir # returns all found files return files + subfolders end - #----------------------------------------------------------------------------- - # Checks for existing directory, gets around accents - #----------------------------------------------------------------------------- + + # Checks for existing directory, gets around accents def self.safe?(dir) return false if !FileTest.directory?(dir) ret = false self.chdir(dir) { ret = true } rescue nil return ret end - #----------------------------------------------------------------------------- - # Creates all the required directories for filename path - #----------------------------------------------------------------------------- + + # Creates all the required directories for filename path def self.create(path) path.gsub!("\\", "/") # Windows compatibility # get path tree @@ -56,9 +51,8 @@ class Dir self.mkdir(full) if !self.safe?(full) end end - #----------------------------------------------------------------------------- - # Generates entire folder tree from a certain directory - #----------------------------------------------------------------------------- + + # Generates entire folder tree from a certain directory def self.all_dirs(dir) # sets variables for starting dirs = [] @@ -69,45 +63,35 @@ class Dir # returns all found directories return dirs.length > 0 ? (dirs + [dir]) : [dir] end - #----------------------------------------------------------------------------- - # Deletes all the files in a directory and all the sub directories (allows for non-empty dirs) - #----------------------------------------------------------------------------- + + # Deletes all the files in a directory and all the sub directories (allows for non-empty dirs) def self.delete_all(dir) # delete all files in dir self.all(dir).each { |f| File.delete(f) } # delete all dirs in dir self.all_dirs(dir).each { |f| Dir.delete(f) } end - #----------------------------------------------------------------------------- end - - #=============================================================================== -# extensions for file class +# Extensions for file class #=============================================================================== class File - #----------------------------------------------------------------------------- - # Checks for existing file, gets around accents - #----------------------------------------------------------------------------- + # Checks for existing file, gets around accents def self.safe?(file) ret = false self.open(file, "rb") { ret = true } rescue nil return ret end - #----------------------------------------------------------------------------- - # Checks for existing .rxdata file - #----------------------------------------------------------------------------- + + # Checks for existing .rxdata file def self.safeData?(file) ret = false ret = (load_data(file) ? true : false) rescue false return ret end - #----------------------------------------------------------------------------- end - - #=============================================================================== # Checking for files and directories #=============================================================================== @@ -219,8 +203,9 @@ def canonicalize(c) return retstr end - - +#=============================================================================== +# +#=============================================================================== module RTP @rtpPaths = nil @@ -255,7 +240,7 @@ module RTP return filename end - # Gets the absolute RGSS paths for the given file name + # Gets the absolute RGSS paths for the given file name def self.eachPathFor(filename) return if !filename if filename[/^[A-Za-z]\:[\/\\]/] || filename[/^[\/\\]/] @@ -299,8 +284,9 @@ module RTP end end - - +#=============================================================================== +# +#=============================================================================== module FileTest IMAGE_EXTENSIONS = [".png", ".gif"] # ".jpg", ".jpeg", ".bmp", AUDIO_EXTENSIONS = [".mid", ".midi", ".ogg", ".wav", ".wma"] # ".mp3" @@ -314,27 +300,23 @@ module FileTest end end - - +#=============================================================================== +# +#=============================================================================== # Used to determine whether a data file exists (rather than a graphics or # audio file). Doesn't check RTP, but does check encrypted archives. - -# NOTE: pbGetFileChar checks anything added in MKXP's RTP setting, -# and matching mount points added through System.mount +# NOTE: pbGetFileChar checks anything added in MKXP's RTP setting, and matching +# mount points added through System.mount. def pbRgssExists?(filename) - if safeExists?("./Game.rgssad") - return pbGetFileChar(filename) != nil - else - filename = canonicalize(filename) - return safeExists?(filename) - end + return pbGetFileChar(filename) != nil if safeExists?("./Game.rgssad") + filename = canonicalize(filename) + return safeExists?(filename) end # Opens an IO, even if the file is in an encrypted archive. # Doesn't check RTP for the file. - -# NOTE: load_data checks anything added in MKXP's RTP setting, -# and matching mount points added through System.mount +# 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") } if !safeExists?("./Game.rgssad") @@ -385,9 +367,8 @@ end # Gets the contents of a file. Doesn't check RTP, but does check # encrypted archives. - -# NOTE: load_data will check anything added in MKXP's RTP setting, -# and matching mount points added through System.mount +# NOTE: load_data will check anything added in MKXP's RTP setting, and matching +# mount points added through System.mount. def pbGetFileString(file) file = canonicalize(file) if !safeExists?("./Game.rgssad") @@ -407,14 +388,14 @@ def pbGetFileString(file) return str end - - #=============================================================================== # #=============================================================================== class StringInput include Enumerable + attr_reader :lineno, :string + class << self def new(str) if block_given? @@ -438,8 +419,6 @@ class StringInput @lineno = 0 end - attr_reader :lineno, :string - def inspect return "#<#{self.class}:#{@closed ? 'closed' : 'open'},src=#{@string[0, 30].inspect}>" end diff --git a/Data/Scripts/001_Technical/002_RubyUtilities.rb b/Data/Scripts/001_Technical/002_RubyUtilities.rb index 3965cfcd3..8d9a911f2 100644 --- a/Data/Scripts/001_Technical/002_RubyUtilities.rb +++ b/Data/Scripts/001_Technical/002_RubyUtilities.rb @@ -168,8 +168,8 @@ class Color # New constructor, accepts RGB values as well as a hex number or string value. def initialize(*args) - pbPrintException("Wrong number of arguments! At least 1 is needed!") if args.length < 1 - if args.length == 1 + pbPrintException("Wrong number of arguments! At least 1 is needed!") if args.length < 1 + if args.length == 1 if args.first.is_a?(Fixnum) hex = args.first.to_s(16) elsif args.first.is_a?(String) @@ -181,11 +181,11 @@ class Color r = hex[0...2].to_i(16) g = hex[2...4].to_i(16) b = hex[4...6].to_i(16) - elsif args.length == 3 + elsif args.length == 3 r, g, b = *args - end - return init_original(r, g, b) if r && g && b - return init_original(*args) + end + return init_original(r, g, b) if r && g && b + return init_original(*args) end def self.new_from_rgb(param) @@ -253,7 +253,7 @@ class Color # @return [Integer] this color in RGB format converted to an integer def to_i - return self.to_rgb24.to_i(16) + return self.to_rgb24.to_i(16) end # @return [Color] the contrasting color to this one @@ -282,11 +282,11 @@ class Color # Converts the provided hex string/24-bit integer to RGB values. def self.hex_to_rgb(hex) hex = hex.delete("#") if hex.is_a?(String) - hex = hex.to_s(16) if hex.is_a?(Numeric) - r = hex[0...2].to_i(16) - g = hex[2...4].to_i(16) - b = hex[4...6].to_i(16) - return r, g, b + hex = hex.to_s(16) if hex.is_a?(Numeric) + r = hex[0...2].to_i(16) + g = hex[2...4].to_i(16) + b = hex[4...6].to_i(16) + return r, g, b end # Parses the input as a Color and returns a Color object made from it. diff --git a/Data/Scripts/001_Technical/003_Intl_Messages.rb b/Data/Scripts/001_Technical/003_Intl_Messages.rb index 3bffc7ba5..0dceb744b 100644 --- a/Data/Scripts/001_Technical/003_Intl_Messages.rb +++ b/Data/Scripts/001_Technical/003_Intl_Messages.rb @@ -267,7 +267,10 @@ module Translator # existing destination folder if Dir.safe?(dir_name) has_files = false - Dir.all(dir_name).each { |f| has_files = true; break } + Dir.all(dir_name).each do |f| + has_files = true + break + end if has_files && !pbConfirmMessageSerious(_INTL("Replace all text files in folder '{1}'?", dir_name)) pbDisposeMessageWindow(msg_window) return @@ -568,14 +571,15 @@ class Translation def setMapMessagesAsHash(map_id, array) load_default_messages @default_game_messages[MessageTypes::EventTexts] ||= [] - @default_game_messages[MessageTypes::EventTexts][map_id] = priv_add_to_hash(MessageTypes::EventTexts, array, nil, map_id) + @default_game_messages[MessageTypes::EventTexts][map_id] = priv_add_to_hash(MessageTypes::EventTexts, + array, nil, map_id) end def addMapMessagesAsHash(map_id, array) load_default_messages @default_game_messages[MessageTypes::EventTexts] ||= [] - @default_game_messages[MessageTypes::EventTexts][map_id] = priv_add_to_hash( - MessageTypes::EventTexts, array, @default_game_messages[MessageTypes::EventTexts][map_id], map_id) + @default_game_messages[MessageTypes::EventTexts][map_id] = priv_add_to_hash(MessageTypes::EventTexts, + array, @default_game_messages[MessageTypes::EventTexts][map_id], map_id) end def get(type, id) diff --git a/Data/Scripts/001_Technical/005_PluginManager.rb b/Data/Scripts/001_Technical/005_PluginManager.rb index 7eca8c3fd..5852c390e 100644 --- a/Data/Scripts/001_Technical/005_PluginManager.rb +++ b/Data/Scripts/001_Technical/005_PluginManager.rb @@ -106,9 +106,8 @@ module PluginManager # Holds all registered plugin data. @@Plugins = {} - #----------------------------------------------------------------------------- + # Registers a plugin and tests its dependencies and incompatibilities. - #----------------------------------------------------------------------------- def self.register(options) name = nil version = nil @@ -289,9 +288,8 @@ module PluginManager :credits => credits } end - #----------------------------------------------------------------------------- + # Throws a pure error message without stack trace or any other useless info. - #----------------------------------------------------------------------------- def self.error(msg) Graphics.update t = Thread.new do @@ -304,11 +302,10 @@ module PluginManager end Kernel.exit! true end - #----------------------------------------------------------------------------- + # Returns true if the specified plugin is installed. # If the version is specified, this version is taken into account. # If mustequal is true, the version must be a match with the specified version. - #----------------------------------------------------------------------------- def self.installed?(plugin_name, plugin_version = nil, mustequal = false) plugin = @@Plugins[plugin_name] return false if plugin.nil? @@ -317,41 +314,36 @@ module PluginManager return true if !mustequal && comparison >= 0 return true if mustequal && comparison == 0 end - #----------------------------------------------------------------------------- + # Returns the string names of all installed plugins. - #----------------------------------------------------------------------------- def self.plugins return @@Plugins.keys end - #----------------------------------------------------------------------------- + # Returns the installed version of the specified plugin. - #----------------------------------------------------------------------------- def self.version(plugin_name) return if !installed?(plugin_name) return @@Plugins[plugin_name][:version] end - #----------------------------------------------------------------------------- + # Returns the link of the specified plugin. - #----------------------------------------------------------------------------- def self.link(plugin_name) return if !installed?(plugin_name) return @@Plugins[plugin_name][:link] end - #----------------------------------------------------------------------------- + # Returns the credits of the specified plugin. - #----------------------------------------------------------------------------- def self.credits(plugin_name) return if !installed?(plugin_name) return @@Plugins[plugin_name][:credits] end - #----------------------------------------------------------------------------- + # Compares two versions given in string form. v1 should be the plugin version # you actually have, and v2 should be the minimum/desired plugin version. # Return values: # 1 if v1 is higher than v2 # 0 if v1 is equal to v2 # -1 if v1 is lower than v2 - #----------------------------------------------------------------------------- def self.compare_versions(v1, v2) d1 = v1.chars d1.insert(0, "0") if d1[0] == "." # Turn ".123" into "0.123" @@ -376,9 +368,8 @@ module PluginManager end return 0 end - #----------------------------------------------------------------------------- - # formats the error message - #----------------------------------------------------------------------------- + + # Formats the error message def self.pluginErrorMsg(name, script) e = $! # begin message formatting @@ -415,9 +406,8 @@ module PluginManager end end end - #----------------------------------------------------------------------------- + # Used to read the metadata file - #----------------------------------------------------------------------------- def self.readMeta(dir, file) filename = "#{dir}/#{file}" meta = {} @@ -480,9 +470,8 @@ module PluginManager # return meta hash return meta end - #----------------------------------------------------------------------------- + # Get a list of all the plugin directories to inspect - #----------------------------------------------------------------------------- def self.listAll return [] if !$DEBUG || safeExists?("Game.rgssad") || !Dir.safe?("Plugins") # get a list of all directories in the `Plugins/` folder @@ -491,9 +480,8 @@ module PluginManager # return all plugins return dirs end - #----------------------------------------------------------------------------- + # Catch any potential loop with dependencies and raise an error - #----------------------------------------------------------------------------- def self.validateDependencies(name, meta, og = nil) # exit if no registered dependency return nil if !meta[name] || !meta[name][:dependencies] @@ -511,9 +499,8 @@ module PluginManager end return name end - #----------------------------------------------------------------------------- + # Sort load order based on dependencies (this ends up in reverse order) - #----------------------------------------------------------------------------- def self.sortLoadOrder(order, plugins) # go through the load order order.each do |o| @@ -540,9 +527,8 @@ module PluginManager end return order end - #----------------------------------------------------------------------------- + # Get the order in which to load plugins - #----------------------------------------------------------------------------- def self.getPluginOrder plugins = {} order = [] @@ -568,9 +554,8 @@ module PluginManager # sort the load order return self.sortLoadOrder(order, plugins).reverse, plugins end - #----------------------------------------------------------------------------- + # Check if plugins need compiling - #----------------------------------------------------------------------------- def self.needCompiling?(order, plugins) # fixed actions return false if !$DEBUG || safeExists?("Game.rgssad") @@ -590,9 +575,8 @@ module PluginManager end return false end - #----------------------------------------------------------------------------- + # Check if plugins need compiling - #----------------------------------------------------------------------------- def self.compilePlugins(order, plugins) Console.echo_li("Compiling plugin scripts...") scripts = [] @@ -618,9 +602,8 @@ module PluginManager GC.start Console.echo_done(true) end - #----------------------------------------------------------------------------- + # Check if plugins need compiling - #----------------------------------------------------------------------------- def self.runPlugins Console.echo_h1("Checking plugins") # get the order of plugins to interpret @@ -668,9 +651,8 @@ module PluginManager Console.echoln_li_done("No plugins found") end end - #----------------------------------------------------------------------------- - # Get plugin dir from name based on meta entries - #----------------------------------------------------------------------------- + + # Get plugin dir from name based on meta entries def self.findDirectory(name) # go through the plugins folder Dir.get("Plugins").each do |dir| @@ -683,5 +665,4 @@ module PluginManager # return nil if no plugin dir found return nil end - #----------------------------------------------------------------------------- end diff --git a/Data/Scripts/001_Technical/006_RPG_Sprite.rb b/Data/Scripts/001_Technical/006_RPG_Sprite.rb index ae6f0efa1..edfd0dd64 100644 --- a/Data/Scripts/001_Technical/006_RPG_Sprite.rb +++ b/Data/Scripts/001_Technical/006_RPG_Sprite.rb @@ -1,3 +1,6 @@ +#=============================================================================== +# +#=============================================================================== class SpriteAnimation @@_animations = [] @@_reference_count = {} @@ -262,8 +265,9 @@ class SpriteAnimation end end - - +#=============================================================================== +# +#=============================================================================== module RPG class Sprite < ::Sprite def initialize(viewport = nil) diff --git a/Data/Scripts/003_Game processing/003_Interpreter.rb b/Data/Scripts/003_Game processing/003_Interpreter.rb index 29869dcf3..07858f00e 100644 --- a/Data/Scripts/003_Game processing/003_Interpreter.rb +++ b/Data/Scripts/003_Game processing/003_Interpreter.rb @@ -5,11 +5,9 @@ # Game_System class and the Game_Event class. #=============================================================================== class Interpreter - #----------------------------------------------------------------------------- - # * Object Initialization + # Object Initialization # depth : nest depth # main : main flag - #----------------------------------------------------------------------------- def initialize(depth = 0, main = false) @depth = depth @main = main @@ -39,11 +37,10 @@ class Interpreter @renamed_choices = [] end_follower_overrides end - #----------------------------------------------------------------------------- - # * Event Setup + + # Event Setup # list : list of event commands # event_id : event ID - #----------------------------------------------------------------------------- def setup(list, event_id, map_id = nil) clear @map_id = map_id || $game_map.map_id @@ -82,9 +79,7 @@ class Interpreter def running? return !@list.nil? end - #----------------------------------------------------------------------------- - # * Frame Update - #----------------------------------------------------------------------------- + def update @loop_count = 0 loop do @@ -135,9 +130,7 @@ class Interpreter @index += 1 end end - #----------------------------------------------------------------------------- - # * Execute script - #----------------------------------------------------------------------------- + def execute_script(script) begin result = eval(script) @@ -182,10 +175,7 @@ class Interpreter raise EventScriptError.new(err) end end - #----------------------------------------------------------------------------- - # * Get Character - # parameter : parameter - #----------------------------------------------------------------------------- + def get_character(parameter = 0) case parameter when -1 # player @@ -210,21 +200,18 @@ class Interpreter def get_event(parameter) return get_character(parameter) end - #----------------------------------------------------------------------------- - # * Freezes all events on the map (for use at the beginning of common events) - #----------------------------------------------------------------------------- + + # Freezes all events on the map (for use at the beginning of common events) def pbGlobalLock $game_map.events.each_value { |event| event.minilock } end - #----------------------------------------------------------------------------- - # * Unfreezes all events on the map (for use at the end of common events) - #----------------------------------------------------------------------------- + + # Unfreezes all events on the map (for use at the end of common events) def pbGlobalUnlock $game_map.events.each_value { |event| event.unlock } end - #----------------------------------------------------------------------------- - # * Gets the next index in the interpreter, ignoring certain commands between messages - #----------------------------------------------------------------------------- + + # Gets the next index in the interpreter, ignoring certain commands between messages def pbNextIndex(index) return -1 if !@list || @list.length == 0 i = index + 1 @@ -292,9 +279,6 @@ class Interpreter @follower_animation_id = nil end - #----------------------------------------------------------------------------- - # * Various methods to be used in a script event command. - #----------------------------------------------------------------------------- # Helper function that shows a picture in a script. def pbShowPicture(number, name, origin, x, y, zoomX = 100, zoomY = 100, opacity = 255, blendType = 0) number += ($game_temp.in_battle ? 50 : 0) diff --git a/Data/Scripts/003_Game processing/004_Interpreter_Commands.rb b/Data/Scripts/003_Game processing/004_Interpreter_Commands.rb index 2d573754d..923611962 100644 --- a/Data/Scripts/003_Game processing/004_Interpreter_Commands.rb +++ b/Data/Scripts/003_Game processing/004_Interpreter_Commands.rb @@ -121,6 +121,7 @@ class Interpreter def command_dummy return true end + #----------------------------------------------------------------------------- # * End Event #----------------------------------------------------------------------------- @@ -132,6 +133,7 @@ class Interpreter $game_map.events[@event_id].unlock end end + #----------------------------------------------------------------------------- # * Command Skip #----------------------------------------------------------------------------- @@ -142,6 +144,7 @@ class Interpreter @index += 1 end end + #----------------------------------------------------------------------------- # * Command If #----------------------------------------------------------------------------- @@ -152,6 +155,7 @@ class Interpreter end return command_skip end + #----------------------------------------------------------------------------- # * Show Text #----------------------------------------------------------------------------- @@ -203,6 +207,7 @@ class Interpreter @message_waiting = false return true end + #----------------------------------------------------------------------------- # * Show Choices #----------------------------------------------------------------------------- @@ -289,6 +294,7 @@ class Interpreter return if !condition || nil_or_empty?(new_name) @renamed_choices[number - 1] = new_name end + #----------------------------------------------------------------------------- # * When [**] #----------------------------------------------------------------------------- @@ -300,6 +306,7 @@ class Interpreter end return command_skip end + #----------------------------------------------------------------------------- # * When Cancel #----------------------------------------------------------------------------- @@ -311,6 +318,7 @@ class Interpreter end return command_skip end + #----------------------------------------------------------------------------- # * Input Number #----------------------------------------------------------------------------- @@ -325,6 +333,7 @@ class Interpreter @message_waiting = false return true end + #----------------------------------------------------------------------------- # * Change Text Options #----------------------------------------------------------------------------- @@ -334,6 +343,7 @@ class Interpreter $game_system.message_frame = @parameters[1] return true end + #----------------------------------------------------------------------------- # * Button Input Processing #----------------------------------------------------------------------------- @@ -371,6 +381,7 @@ class Interpreter @index += 1 return true end + #----------------------------------------------------------------------------- # * Wait #----------------------------------------------------------------------------- @@ -378,6 +389,7 @@ class Interpreter @wait_count = @parameters[0] * Graphics.frame_rate / 20 return true end + #----------------------------------------------------------------------------- # * Conditional Branch #----------------------------------------------------------------------------- @@ -433,6 +445,7 @@ class Interpreter end return command_skip end + #----------------------------------------------------------------------------- # * Else #----------------------------------------------------------------------------- @@ -443,12 +456,14 @@ class Interpreter end return command_skip end + #----------------------------------------------------------------------------- # * Loop #----------------------------------------------------------------------------- def command_112 return true end + #----------------------------------------------------------------------------- # * Repeat Above #----------------------------------------------------------------------------- @@ -459,6 +474,7 @@ class Interpreter return true if @list[@index].indent == indent end end + #----------------------------------------------------------------------------- # * Break Loop #----------------------------------------------------------------------------- @@ -475,6 +491,7 @@ class Interpreter end end end + #----------------------------------------------------------------------------- # * Exit Event Processing #----------------------------------------------------------------------------- @@ -482,6 +499,7 @@ class Interpreter command_end return true end + #----------------------------------------------------------------------------- # * Erase Event #----------------------------------------------------------------------------- @@ -493,6 +511,7 @@ class Interpreter @index += 1 return false end + #----------------------------------------------------------------------------- # * Call Common Event #----------------------------------------------------------------------------- @@ -504,12 +523,14 @@ class Interpreter end return true end + #----------------------------------------------------------------------------- # * Label #----------------------------------------------------------------------------- def command_118 return true end + #----------------------------------------------------------------------------- # * Jump to Label #----------------------------------------------------------------------------- @@ -528,6 +549,7 @@ class Interpreter temp_index += 1 end end + #----------------------------------------------------------------------------- # * Control Switches #----------------------------------------------------------------------------- @@ -542,6 +564,7 @@ class Interpreter $game_map.need_refresh = true if should_refresh return true end + #----------------------------------------------------------------------------- # * Control Variables #----------------------------------------------------------------------------- @@ -606,6 +629,7 @@ class Interpreter end return true end + #----------------------------------------------------------------------------- # * Control Self Switch #----------------------------------------------------------------------------- @@ -620,6 +644,7 @@ class Interpreter end return true end + #----------------------------------------------------------------------------- # * Control Timer #----------------------------------------------------------------------------- @@ -628,6 +653,7 @@ class Interpreter $game_system.timer = @parameters[1] * Graphics.frame_rate if @parameters[0] == 0 return true end + #----------------------------------------------------------------------------- # * Change Gold #----------------------------------------------------------------------------- @@ -642,6 +668,7 @@ class Interpreter def command_127; command_dummy; end # Change Weapons def command_128; command_dummy; end # Change Armor def command_129; command_dummy; end # Change Party Member + #----------------------------------------------------------------------------- # * Change Windowskin #----------------------------------------------------------------------------- @@ -654,6 +681,7 @@ class Interpreter end return true end + #----------------------------------------------------------------------------- # * Change Battle BGM #----------------------------------------------------------------------------- @@ -661,10 +689,12 @@ class Interpreter ($PokemonGlobal.nextBattleBGM = @parameters[0]) ? @parameters[0].clone : nil return true end + #----------------------------------------------------------------------------- # * Change Battle End ME #----------------------------------------------------------------------------- def command_133; command_dummy; end + #----------------------------------------------------------------------------- # * Change Save Access #----------------------------------------------------------------------------- @@ -672,6 +702,7 @@ class Interpreter $game_system.save_disabled = (@parameters[0] == 0) return true end + #----------------------------------------------------------------------------- # * Change Menu Access #----------------------------------------------------------------------------- @@ -679,6 +710,7 @@ class Interpreter $game_system.menu_disabled = (@parameters[0] == 0) return true end + #----------------------------------------------------------------------------- # * Change Encounter #----------------------------------------------------------------------------- @@ -687,6 +719,7 @@ class Interpreter $game_player.make_encounter_count return true end + #----------------------------------------------------------------------------- # * Transfer Player #----------------------------------------------------------------------------- @@ -716,6 +749,7 @@ class Interpreter end return false end + #----------------------------------------------------------------------------- # * Set Event Location #----------------------------------------------------------------------------- @@ -747,6 +781,7 @@ class Interpreter end return true end + #----------------------------------------------------------------------------- # * Scroll Map #----------------------------------------------------------------------------- @@ -756,6 +791,7 @@ class Interpreter $game_map.start_scroll(@parameters[0], @parameters[1], @parameters[2]) return true end + #----------------------------------------------------------------------------- # * Change Map Settings #----------------------------------------------------------------------------- @@ -778,6 +814,7 @@ class Interpreter end return true end + #----------------------------------------------------------------------------- # * Change Fog Color Tone #----------------------------------------------------------------------------- @@ -785,6 +822,7 @@ class Interpreter $game_map.start_fog_tone_change(@parameters[0], @parameters[1] * Graphics.frame_rate / 20) return true end + #----------------------------------------------------------------------------- # * Change Fog Opacity #----------------------------------------------------------------------------- @@ -792,6 +830,7 @@ class Interpreter $game_map.start_fog_opacity_change(@parameters[0], @parameters[1] * Graphics.frame_rate / 20) return true end + #----------------------------------------------------------------------------- # * Show Animation #----------------------------------------------------------------------------- @@ -806,6 +845,7 @@ class Interpreter character.animation_id = @parameters[1] return true end + #----------------------------------------------------------------------------- # * Change Transparent Flag #----------------------------------------------------------------------------- @@ -813,6 +853,7 @@ class Interpreter $game_player.transparent = (@parameters[0] == 0) return true end + #----------------------------------------------------------------------------- # * Set Move Route #----------------------------------------------------------------------------- @@ -827,6 +868,7 @@ class Interpreter character.force_move_route(@parameters[1]) return true end + #----------------------------------------------------------------------------- # * Wait for Move's Completion #----------------------------------------------------------------------------- @@ -834,6 +876,7 @@ class Interpreter @move_route_waiting = true if !$game_temp.in_battle return true end + #----------------------------------------------------------------------------- # * Prepare for Transition #----------------------------------------------------------------------------- @@ -842,6 +885,7 @@ class Interpreter Graphics.freeze return true end + #----------------------------------------------------------------------------- # * Execute Transition #----------------------------------------------------------------------------- @@ -852,6 +896,7 @@ class Interpreter @index += 1 return false end + #----------------------------------------------------------------------------- # * Change Screen Color Tone #----------------------------------------------------------------------------- @@ -859,6 +904,7 @@ class Interpreter $game_screen.start_tone_change(@parameters[0], @parameters[1] * Graphics.frame_rate / 20) return true end + #----------------------------------------------------------------------------- # * Screen Flash #----------------------------------------------------------------------------- @@ -866,6 +912,7 @@ class Interpreter $game_screen.start_flash(@parameters[0], @parameters[1] * Graphics.frame_rate / 20) return true end + #----------------------------------------------------------------------------- # * Screen Shake #----------------------------------------------------------------------------- @@ -873,6 +920,7 @@ class Interpreter $game_screen.start_shake(@parameters[0], @parameters[1], @parameters[2] * Graphics.frame_rate / 20) return true end + #----------------------------------------------------------------------------- # * Show Picture #----------------------------------------------------------------------------- @@ -889,6 +937,7 @@ class Interpreter x, y, @parameters[6], @parameters[7], @parameters[8], @parameters[9]) return true end + #----------------------------------------------------------------------------- # * Move Picture #----------------------------------------------------------------------------- @@ -905,6 +954,7 @@ class Interpreter @parameters[2], x, y, @parameters[6], @parameters[7], @parameters[8], @parameters[9]) return true end + #----------------------------------------------------------------------------- # * Rotate Picture #----------------------------------------------------------------------------- @@ -913,6 +963,7 @@ class Interpreter $game_screen.pictures[number].rotate(@parameters[1]) return true end + #----------------------------------------------------------------------------- # * Change Picture Color Tone #----------------------------------------------------------------------------- @@ -922,6 +973,7 @@ class Interpreter @parameters[2] * Graphics.frame_rate / 20) return true end + #----------------------------------------------------------------------------- # * Erase Picture #----------------------------------------------------------------------------- @@ -930,6 +982,7 @@ class Interpreter $game_screen.pictures[number].erase return true end + #----------------------------------------------------------------------------- # * Set Weather Effects #----------------------------------------------------------------------------- @@ -937,6 +990,7 @@ class Interpreter $game_screen.weather(@parameters[0], @parameters[1], @parameters[2]) return true end + #----------------------------------------------------------------------------- # * Play BGM #----------------------------------------------------------------------------- @@ -944,6 +998,7 @@ class Interpreter pbBGMPlay(@parameters[0]) return true end + #----------------------------------------------------------------------------- # * Fade Out BGM #----------------------------------------------------------------------------- @@ -951,6 +1006,7 @@ class Interpreter pbBGMFade(@parameters[0]) return true end + #----------------------------------------------------------------------------- # * Play BGS #----------------------------------------------------------------------------- @@ -958,6 +1014,7 @@ class Interpreter pbBGSPlay(@parameters[0]) return true end + #----------------------------------------------------------------------------- # * Fade Out BGS #----------------------------------------------------------------------------- @@ -965,6 +1022,7 @@ class Interpreter pbBGSFade(@parameters[0]) return true end + #----------------------------------------------------------------------------- # * Memorize BGM/BGS #----------------------------------------------------------------------------- @@ -973,6 +1031,7 @@ class Interpreter $game_system.bgs_memorize return true end + #----------------------------------------------------------------------------- # * Restore BGM/BGS #----------------------------------------------------------------------------- @@ -981,6 +1040,7 @@ class Interpreter $game_system.bgs_restore return true end + #----------------------------------------------------------------------------- # * Play ME #----------------------------------------------------------------------------- @@ -988,6 +1048,7 @@ class Interpreter pbMEPlay(@parameters[0]) return true end + #----------------------------------------------------------------------------- # * Play SE #----------------------------------------------------------------------------- @@ -995,6 +1056,7 @@ class Interpreter pbSEPlay(@parameters[0]) return true end + #----------------------------------------------------------------------------- # * Stop SE #----------------------------------------------------------------------------- @@ -1008,6 +1070,7 @@ class Interpreter def command_602; command_if(1); end # If Escape def command_603; command_if(2); end # If Lose def command_302; command_dummy; end # Shop Processing + #----------------------------------------------------------------------------- # * Name Input Processing #----------------------------------------------------------------------------- @@ -1033,6 +1096,7 @@ class Interpreter def command_311; command_dummy; end # Change HP def command_312; command_dummy; end # Change SP def command_313; command_dummy; end # Change State + #----------------------------------------------------------------------------- # * Recover All #----------------------------------------------------------------------------- @@ -1065,6 +1129,7 @@ class Interpreter def command_338; command_dummy; end # Deal Damage def command_339; command_dummy; end # Force Action def command_340; command_dummy; end # Abort Battle + #----------------------------------------------------------------------------- # * Call Menu Screen #----------------------------------------------------------------------------- @@ -1073,6 +1138,7 @@ class Interpreter @index += 1 return false end + #----------------------------------------------------------------------------- # * Call Save Screen #----------------------------------------------------------------------------- @@ -1082,6 +1148,7 @@ class Interpreter screen.pbSaveScreen return true end + #----------------------------------------------------------------------------- # * Game Over #----------------------------------------------------------------------------- @@ -1090,6 +1157,7 @@ class Interpreter pbBGSFade(1.0) pbFadeOutIn { pbStartOver(true) } end + #----------------------------------------------------------------------------- # * Return to Title Screen #----------------------------------------------------------------------------- @@ -1097,6 +1165,7 @@ class Interpreter $game_temp.title_screen_calling = true return false end + #----------------------------------------------------------------------------- # * Script #----------------------------------------------------------------------------- diff --git a/Data/Scripts/004_Game classes/001_Game_Screen.rb b/Data/Scripts/004_Game classes/001_Game_Screen.rb index e93cc76ce..641644a22 100644 --- a/Data/Scripts/004_Game classes/001_Game_Screen.rb +++ b/Data/Scripts/004_Game classes/001_Game_Screen.rb @@ -5,9 +5,6 @@ # flashing, etc. Refer to "$game_screen" for the instance of this class. #=============================================================================== class Game_Screen - #----------------------------------------------------------------------------- - # * Public Instance Variables - #----------------------------------------------------------------------------- attr_reader :brightness # brightness attr_reader :tone # color tone attr_reader :flash_color # flash color @@ -17,9 +14,6 @@ class Game_Screen attr_reader :weather_max # max number of weather sprites attr_accessor :weather_duration # ticks in which the weather should fade in - #----------------------------------------------------------------------------- - # * Object Initialization - #----------------------------------------------------------------------------- def initialize @brightness = 255 @fadeout_duration = 0 @@ -42,11 +36,7 @@ class Game_Screen @weather_max = 0.0 @weather_duration = 0 end - #----------------------------------------------------------------------------- - # * Start Changing Color Tone - # tone : color tone - # duration : time - #----------------------------------------------------------------------------- + def start_tone_change(tone, duration) @tone_target = tone.clone @tone_duration = duration @@ -54,40 +44,24 @@ class Game_Screen @tone = @tone_target.clone end end - #----------------------------------------------------------------------------- - # * Start Flashing - # color : color - # duration : time - #----------------------------------------------------------------------------- + def start_flash(color, duration) @flash_color = color.clone @flash_duration = duration end - #----------------------------------------------------------------------------- - # * Start Shaking - # power : strength - # speed : speed - # duration : time - #----------------------------------------------------------------------------- + def start_shake(power, speed, duration) @shake_power = power @shake_speed = speed @shake_duration = duration end - #----------------------------------------------------------------------------- - # * Set Weather - # type : type - # power : strength - # duration : time - #----------------------------------------------------------------------------- + def weather(type, power, duration) @weather_type = GameData::Weather.get(type).id @weather_max = (power + 1) * RPG::Weather::MAX_SPRITES / 10 @weather_duration = duration # In 1/20ths of a seconds end - #----------------------------------------------------------------------------- - # * Frame Update - #----------------------------------------------------------------------------- + def update if @fadeout_duration && @fadeout_duration >= 1 d = @fadeout_duration diff --git a/Data/Scripts/004_Game classes/001_Switches and Variables/002_Game_Switches.rb b/Data/Scripts/004_Game classes/001_Switches and Variables/002_Game_Switches.rb index 7f09ba2d2..919b698cb 100644 --- a/Data/Scripts/004_Game classes/001_Switches and Variables/002_Game_Switches.rb +++ b/Data/Scripts/004_Game classes/001_Switches and Variables/002_Game_Switches.rb @@ -5,25 +5,20 @@ # Refer to "$game_switches" for the instance of this class. #=============================================================================== class Game_Switches - #----------------------------------------------------------------------------- - # * Object Initialization - #----------------------------------------------------------------------------- def initialize @data = [] end - #----------------------------------------------------------------------------- - # * Get Switch + + # Get Switch # switch_id : switch ID - #----------------------------------------------------------------------------- def [](switch_id) return @data[switch_id] if switch_id <= 5000 && @data[switch_id] return false end - #----------------------------------------------------------------------------- - # * Set Switch + + # Set Switch # switch_id : switch ID # value : ON (true) / OFF (false) - #----------------------------------------------------------------------------- def []=(switch_id, value) @data[switch_id] = value if switch_id <= 5000 end diff --git a/Data/Scripts/004_Game classes/001_Switches and Variables/003_Game_Variables.rb b/Data/Scripts/004_Game classes/001_Switches and Variables/003_Game_Variables.rb index 70d16f90e..20528bd0c 100644 --- a/Data/Scripts/004_Game classes/001_Switches and Variables/003_Game_Variables.rb +++ b/Data/Scripts/004_Game classes/001_Switches and Variables/003_Game_Variables.rb @@ -5,25 +5,20 @@ # Refer to "$game_variables" for the instance of this class. #=============================================================================== class Game_Variables - #----------------------------------------------------------------------------- - # * Object Initialization - #----------------------------------------------------------------------------- def initialize @data = [] end - #----------------------------------------------------------------------------- - # * Get Variable + + # Get Variable # variable_id : variable ID - #----------------------------------------------------------------------------- def [](variable_id) return @data[variable_id] if variable_id <= 5000 && !@data[variable_id].nil? return 0 end - #----------------------------------------------------------------------------- - # * Set Variable + + # Set Variable # variable_id : variable ID # value : the variable's value - #----------------------------------------------------------------------------- def []=(variable_id, value) @data[variable_id] = value if variable_id <= 5000 end diff --git a/Data/Scripts/004_Game classes/001_Switches and Variables/004_Game_SelfSwitches.rb b/Data/Scripts/004_Game classes/001_Switches and Variables/004_Game_SelfSwitches.rb index f5a3ccdec..18471d17f 100644 --- a/Data/Scripts/004_Game classes/001_Switches and Variables/004_Game_SelfSwitches.rb +++ b/Data/Scripts/004_Game classes/001_Switches and Variables/004_Game_SelfSwitches.rb @@ -5,24 +5,19 @@ # "Hash." Refer to "$game_self_switches" for the instance of this class. #=============================================================================== class Game_SelfSwitches - #----------------------------------------------------------------------------- - # * Object Initialization - #----------------------------------------------------------------------------- def initialize @data = {} end - #----------------------------------------------------------------------------- - # * Get Self Switch + + # Get Self Switch # key : key - #----------------------------------------------------------------------------- def [](key) return @data[key] == true end - #----------------------------------------------------------------------------- - # * Set Self Switch + + # Set Self Switch # key : key # value : ON (true) / OFF (false) - #----------------------------------------------------------------------------- def []=(key, value) @data[key] = value end diff --git a/Data/Scripts/004_Game classes/003_Game_Picture.rb b/Data/Scripts/004_Game classes/003_Game_Picture.rb index d02d1950e..eda83d545 100644 --- a/Data/Scripts/004_Game classes/003_Game_Picture.rb +++ b/Data/Scripts/004_Game classes/003_Game_Picture.rb @@ -4,11 +4,7 @@ # This class handles the picture. It's used within the Game_Screen class # ($game_screen). #=============================================================================== - class Game_Picture - #----------------------------------------------------------------------------- - # * Public Instance Variables - #----------------------------------------------------------------------------- attr_reader :number # picture number attr_reader :name # file name attr_reader :origin # starting point @@ -21,10 +17,6 @@ class Game_Picture attr_reader :tone # color tone attr_reader :angle # rotation angle - #----------------------------------------------------------------------------- - # * Object Initialization - # number : picture number - #----------------------------------------------------------------------------- def initialize(number) @number = number @name = "" @@ -47,8 +39,8 @@ class Game_Picture @angle = 0 @rotate_speed = 0 end - #----------------------------------------------------------------------------- - # * Show Picture + + # Show Picture # name : file name # origin : starting point # x : x-coordinate @@ -57,7 +49,6 @@ class Game_Picture # zoom_y : y directional zoom rate # opacity : opacity level # blend_type : blend method - #----------------------------------------------------------------------------- def show(name, origin, x, y, zoom_x, zoom_y, opacity, blend_type) @name = name @origin = origin @@ -79,8 +70,8 @@ class Game_Picture @angle = 0 @rotate_speed = 0 end - #----------------------------------------------------------------------------- - # * Move Picture + + # Move Picture # duration : time # origin : starting point # x : x-coordinate @@ -89,7 +80,6 @@ class Game_Picture # zoom_y : y directional zoom rate # opacity : opacity level # blend_type : blend method - #----------------------------------------------------------------------------- def move(duration, origin, x, y, zoom_x, zoom_y, opacity, blend_type) @duration = duration @origin = origin @@ -100,18 +90,16 @@ class Game_Picture @target_opacity = opacity.to_f @blend_type = blend_type || 0 end - #----------------------------------------------------------------------------- - # * Change Rotation Speed + + # Change Rotation Speed # speed : rotation speed - #----------------------------------------------------------------------------- def rotate(speed) @rotate_speed = speed end - #----------------------------------------------------------------------------- - # * Start Change of Color Tone + + # Start Change of Color Tone # tone : color tone # duration : time - #----------------------------------------------------------------------------- def start_tone_change(tone, duration) @tone_target = tone.clone @tone_duration = duration @@ -119,15 +107,13 @@ class Game_Picture @tone = @tone_target.clone end end - #----------------------------------------------------------------------------- - # * Erase Picture - #----------------------------------------------------------------------------- + + # Erase Picture def erase @name = "" end - #----------------------------------------------------------------------------- - # * Frame Update - #----------------------------------------------------------------------------- + + # Frame Update def update if @duration >= 1 d = @duration diff --git a/Data/Scripts/004_Game classes/004_Game_Map.rb b/Data/Scripts/004_Game classes/004_Game_Map.rb index dc99b8bf8..304bc61ab 100644 --- a/Data/Scripts/004_Game classes/004_Game_Map.rb +++ b/Data/Scripts/004_Game classes/004_Game_Map.rb @@ -106,28 +106,24 @@ class Game_Map return GameData::MapMetadata.try_get(@map_id) end - #----------------------------------------------------------------------------- # Returns the name of this map's BGM. If it's night time, returns the night # version of the BGM (if it exists). - #----------------------------------------------------------------------------- def bgm_name if PBDayNight.isNight? && FileTest.audio_exist?("Audio/BGM/" + @map.bgm.name + "_n") return @map.bgm.name + "_n" end return @map.bgm.name end - #----------------------------------------------------------------------------- - # * Autoplays background music - # Plays music called "[normal BGM]_n" if it's night time and it exists - #----------------------------------------------------------------------------- + + # Autoplays background music + # Plays music called "[normal BGM]_n" if it's night time and it exists def autoplayAsCue pbCueBGM(bgm_name, 1.0, @map.bgm.volume, @map.bgm.pitch) if @map.autoplay_bgm pbBGSPlay(@map.bgs) if @map.autoplay_bgs end - #----------------------------------------------------------------------------- - # * Plays background music - # Plays music called "[normal BGM]_n" if it's night time and it exists - #----------------------------------------------------------------------------- + + # Plays background music + # Plays music called "[normal BGM]_n" if it's night time and it exists def autoplay pbBGMPlay(bgm_name, @map.bgm.volume, @map.bgm.pitch) if @map.autoplay_bgm pbBGSPlay(@map.bgs) if @map.autoplay_bgs @@ -249,7 +245,7 @@ class Game_Map end # Returns whether the position x,y is fully passable (there is no blocking - # event there, and the tile is fully passable in all directions) + # event there, and the tile is fully passable in all directions). def passableStrict?(x, y, d, self_event = nil) return false if !valid?(x, y) events.each_value do |event| 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 76cea20e3..a1c274945 100644 --- a/Data/Scripts/004_Game classes/005_Game_Map_Autoscroll.rb +++ b/Data/Scripts/004_Game classes/005_Game_Map_Autoscroll.rb @@ -69,14 +69,15 @@ =end +#=============================================================================== +# +#=============================================================================== class Interpreter SCROLL_SPEED_DEFAULT = 4 - #----------------------------------------------------------------------------- - # * Map Autoscroll to Coordinates + # Map Autoscroll to Coordinates # x : x coordinate to scroll to and center on # y : y coordinate to scroll to and center on # speed : (optional) scroll speed (from 1-6, default being 4) - #----------------------------------------------------------------------------- def autoscroll(x, y, speed = SCROLL_SPEED_DEFAULT) if $game_map.scrolling? return false @@ -130,17 +131,16 @@ class Interpreter return !@diag end - #----------------------------------------------------------------------------- - # * Map Autoscroll (to Player) + # Map Autoscroll (to Player) # speed : (optional) scroll speed (from 1-6, default being 4) - #----------------------------------------------------------------------------- def autoscroll_player(speed = SCROLL_SPEED_DEFAULT) autoscroll($game_player.x, $game_player.y, speed) end end - - +#=============================================================================== +# +#=============================================================================== class Game_Map def scroll_downright(distance) @display_x = [@display_x + distance, diff --git a/Data/Scripts/004_Game classes/006_Game_MapFactory.rb b/Data/Scripts/004_Game classes/006_Game_MapFactory.rb index 8222c662f..d879568db 100644 --- a/Data/Scripts/004_Game classes/006_Game_MapFactory.rb +++ b/Data/Scripts/004_Game classes/006_Game_MapFactory.rb @@ -355,7 +355,7 @@ class PokemonMapFactory def updateMaps(scene) updateMapsInternal - $map_factory.setSceneStarted(scene) if @mapChanged + setSceneStarted(scene) if @mapChanged end def updateMapsInternal diff --git a/Data/Scripts/004_Game classes/009_Game_Player.rb b/Data/Scripts/004_Game classes/009_Game_Player.rb index c38be6037..18865a31d 100644 --- a/Data/Scripts/004_Game classes/009_Game_Player.rb +++ b/Data/Scripts/004_Game classes/009_Game_Player.rb @@ -267,13 +267,11 @@ class Game_Player < Game_Character return $game_map.terrain_tag(facing[1], facing[2]) end - #----------------------------------------------------------------------------- - # * Passable Determinants + # Passable Determinants # x : x-coordinate # y : y-coordinate - # d : direction (0,2,4,6,8) + # d : direction (0, 2, 4, 6, 8) # * 0 = Determines if all directions are impassable (for jumping) - #----------------------------------------------------------------------------- def passable?(x, y, d, strict = false) # Get new coordinates new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0) @@ -289,28 +287,22 @@ class Game_Player < Game_Character return super end - #----------------------------------------------------------------------------- - # * Set Map Display Position to Center of Screen - #----------------------------------------------------------------------------- + # Set Map Display Position to Center of Screen def center(x, y) self.map.display_x = (x * Game_Map::REAL_RES_X) - SCREEN_CENTER_X self.map.display_y = (y * Game_Map::REAL_RES_Y) - SCREEN_CENTER_Y end - #----------------------------------------------------------------------------- - # * Move to Designated Position + # Move to Designated Position # x : x-coordinate # y : y-coordinate - #----------------------------------------------------------------------------- def moveto(x, y) super center(x, y) make_encounter_count end - #----------------------------------------------------------------------------- - # * Make Encounter Count - #----------------------------------------------------------------------------- + # Make Encounter Count def make_encounter_count # Image of two dice rolling if $game_map.map_id != 0 @@ -319,18 +311,13 @@ class Game_Player < Game_Character end end - #----------------------------------------------------------------------------- - # * Refresh - #----------------------------------------------------------------------------- def refresh @opacity = 255 @blend_type = 0 end - #----------------------------------------------------------------------------- - # * Trigger event(s) at the same coordinates as self with the appropriate - # trigger(s) that can be triggered - #----------------------------------------------------------------------------- + # Trigger event(s) at the same coordinates as self with the appropriate + # trigger(s) that can be triggered def check_event_trigger_here(triggers) result = false # If event is running @@ -348,9 +335,7 @@ class Game_Player < Game_Character return result end - #----------------------------------------------------------------------------- - # * Front Event Starting Determinant - #----------------------------------------------------------------------------- + # Front Event Starting Determinant def check_event_trigger_there(triggers) result = false # If event is running @@ -389,9 +374,7 @@ class Game_Player < Game_Character return result end - #----------------------------------------------------------------------------- - # * Touch Event Starting Determinant - #----------------------------------------------------------------------------- + # Touch Event Starting Determinant def check_event_trigger_touch(dir) result = false return result if $game_system.map_interpreter.running? @@ -417,9 +400,6 @@ class Game_Player < Game_Character return result end - #----------------------------------------------------------------------------- - # * Frame Update - #----------------------------------------------------------------------------- def update last_real_x = @real_x last_real_y = @real_y @@ -531,7 +511,7 @@ class Game_Player < Game_Character end end - # Track the player on-screen as they move + # Track the player on-screen as they move. def update_screen_position(last_real_x, last_real_y) return if self.map.scrolling? || !(@moved_last_frame || @moved_this_frame) if (@real_x < last_real_x && @real_x - $game_map.display_x < SCREEN_CENTER_X) || @@ -564,8 +544,6 @@ class Game_Player < Game_Character end end - - #=============================================================================== # #=============================================================================== diff --git a/Data/Scripts/004_Game classes/010_Game_CommonEvent.rb b/Data/Scripts/004_Game classes/010_Game_CommonEvent.rb index 1917758f2..dfa5e21b8 100644 --- a/Data/Scripts/004_Game classes/010_Game_CommonEvent.rb +++ b/Data/Scripts/004_Game classes/010_Game_CommonEvent.rb @@ -5,42 +5,28 @@ # event. This class is used within the Game_Map class ($game_map). #=============================================================================== class Game_CommonEvent - #----------------------------------------------------------------------------- - # * Object Initialization - # common_event_id : common event ID - #----------------------------------------------------------------------------- def initialize(common_event_id) @common_event_id = common_event_id @interpreter = nil refresh end - #----------------------------------------------------------------------------- - # * Get Name - #----------------------------------------------------------------------------- + def name return $data_common_events[@common_event_id].name end - #----------------------------------------------------------------------------- - # * Get Trigger - #----------------------------------------------------------------------------- + def trigger return $data_common_events[@common_event_id].trigger end - #----------------------------------------------------------------------------- - # * Get Condition Switch ID - #----------------------------------------------------------------------------- + def switch_id return $data_common_events[@common_event_id].switch_id end - #----------------------------------------------------------------------------- - # * Get List of Event Commands - #----------------------------------------------------------------------------- + def list return $data_common_events[@common_event_id].list end - #----------------------------------------------------------------------------- - # * Checks if switch is on - #----------------------------------------------------------------------------- + def switchIsOn?(id) switchName = $data_system.switches[id] return false if !switchName @@ -50,9 +36,7 @@ class Game_CommonEvent return $game_switches[id] end end - #----------------------------------------------------------------------------- - # * Refresh - #----------------------------------------------------------------------------- + def refresh # Create an interpreter for parallel process if necessary if self.trigger == 2 && switchIsOn?(self.switch_id) @@ -63,9 +47,7 @@ class Game_CommonEvent @interpreter = nil end end - #----------------------------------------------------------------------------- - # * Frame Update - #----------------------------------------------------------------------------- + def update return if !@interpreter # Set up event if interpreter is not running diff --git a/Data/Scripts/004_Game classes/012_Game_FollowerFactory.rb b/Data/Scripts/004_Game classes/012_Game_FollowerFactory.rb index 5d76476d7..176770a8a 100644 --- a/Data/Scripts/004_Game classes/012_Game_FollowerFactory.rb +++ b/Data/Scripts/004_Game classes/012_Game_FollowerFactory.rb @@ -77,7 +77,7 @@ class Game_FollowerFactory attr_reader :last_update def initialize - @events = [] + @events = [] $PokemonGlobal.followers.each do |follower| @events.push(create_follower_object(follower)) end @@ -388,7 +388,6 @@ module Followers end end - #=============================================================================== # Deprecated methods #=============================================================================== diff --git a/Data/Scripts/005_Sprites/003_Sprite_Character.rb b/Data/Scripts/005_Sprites/003_Sprite_Character.rb index a617c89a9..c5cc6643a 100644 --- a/Data/Scripts/005_Sprites/003_Sprite_Character.rb +++ b/Data/Scripts/005_Sprites/003_Sprite_Character.rb @@ -1,3 +1,6 @@ +#=============================================================================== +# +#=============================================================================== class BushBitmap def initialize(bitmap, isTile, depth) @bitmaps = [] @@ -53,8 +56,9 @@ class BushBitmap end end - - +#=============================================================================== +# +#=============================================================================== class Sprite_Character < RPG::Sprite attr_accessor :character diff --git a/Data/Scripts/005_Sprites/005_Sprite_SurfBase.rb b/Data/Scripts/005_Sprites/005_Sprite_SurfBase.rb index 094d0277a..33f6fb941 100644 --- a/Data/Scripts/005_Sprites/005_Sprite_SurfBase.rb +++ b/Data/Scripts/005_Sprites/005_Sprite_SurfBase.rb @@ -22,7 +22,7 @@ class Sprite_SurfBase def dispose return if @disposed @sprite&.dispose - @sprite = nil + @sprite = nil @surfbitmap.dispose @divebitmap.dispose @disposed = true diff --git a/Data/Scripts/005_Sprites/007_Spriteset_Map.rb b/Data/Scripts/005_Sprites/007_Spriteset_Map.rb index 09fc2bc11..b171ff793 100644 --- a/Data/Scripts/005_Sprites/007_Spriteset_Map.rb +++ b/Data/Scripts/005_Sprites/007_Spriteset_Map.rb @@ -1,4 +1,6 @@ -# Unused +#=============================================================================== +# Unused. +#=============================================================================== class ClippableSprite < Sprite_Character def initialize(viewport, event, tilemap) @tilemap = tilemap @@ -29,8 +31,9 @@ class ClippableSprite < Sprite_Character end end - - +#=============================================================================== +# +#=============================================================================== class Spriteset_Map attr_reader :map diff --git a/Data/Scripts/005_Sprites/008_Sprite_AnimationSprite.rb b/Data/Scripts/005_Sprites/008_Sprite_AnimationSprite.rb index 3ab4c5edf..c8fab9dff 100644 --- a/Data/Scripts/005_Sprites/008_Sprite_AnimationSprite.rb +++ b/Data/Scripts/005_Sprites/008_Sprite_AnimationSprite.rb @@ -1,9 +1,8 @@ -=begin -A sprite whose sole purpose is to display an animation. This sprite -can be displayed anywhere on the map and is disposed -automatically when its animation is finished. -Used for grass rustling and so forth. -=end +#=============================================================================== +# A sprite whose sole purpose is to display an animation. This sprite can be +# displayed anywhere on the map and is disposed automatically when its animation +# is finished. Used for grass rustling and so forth. +#=============================================================================== class AnimationSprite < RPG::Sprite def initialize(animID, map, tileX, tileY, viewport = nil, tinting = false, height = 3) super(viewport) @@ -38,8 +37,9 @@ class AnimationSprite < RPG::Sprite end end - - +#=============================================================================== +# +#=============================================================================== class Spriteset_Map alias _animationSprite_initialize initialize unless private_method_defined?(:_animationSprite_initialize) alias _animationSprite_update update unless method_defined?(:_animationSprite_update) diff --git a/Data/Scripts/005_Sprites/009_Sprite_DynamicShadows.rb b/Data/Scripts/005_Sprites/009_Sprite_DynamicShadows.rb index 4fe30c145..2d31f812b 100644 --- a/Data/Scripts/005_Sprites/009_Sprite_DynamicShadows.rb +++ b/Data/Scripts/005_Sprites/009_Sprite_DynamicShadows.rb @@ -117,11 +117,9 @@ class Sprite_Shadow < RPG::Sprite end end - - -#=================================================== +#=============================================================================== # ? CLASS Sprite_Character edit -#=================================================== +#=============================================================================== class Sprite_Character < RPG::Sprite alias shadow_initialize initialize unless private_method_defined?(:shadow_initialize) @@ -161,20 +159,16 @@ class Sprite_Character < RPG::Sprite end end - - -#=================================================== +#=============================================================================== # ? CLASS Game_Event edit -#=================================================== +#=============================================================================== class Game_Event attr_accessor :id end - - -#=================================================== +#=============================================================================== # ? CLASS Spriteset_Map edit -#=================================================== +#=============================================================================== class Spriteset_Map attr_accessor :shadows @@ -202,9 +196,7 @@ class Spriteset_Map end end - - -#=================================================== +#=============================================================================== # ? XPML Definition, by Rataime, using ideas from Near Fantastica # # Returns nil if the markup wasn't present at all, @@ -222,7 +214,7 @@ end # p XPML_read("second", event_id) -> [1, "two"] # p XPML_read("third", event_id) -> [3] # p XPML_read("forth", event_id) -> nil -#=================================================== +#=============================================================================== def XPML_read(map, markup, event, max_param_number = 0) parameter_list = nil return nil if !event || event.list.nil? diff --git a/Data/Scripts/005_Sprites/010_ParticleEngine.rb b/Data/Scripts/005_Sprites/010_ParticleEngine.rb index 8f4d7255a..c218fcd87 100644 --- a/Data/Scripts/005_Sprites/010_ParticleEngine.rb +++ b/Data/Scripts/005_Sprites/010_ParticleEngine.rb @@ -1,6 +1,8 @@ +#=============================================================================== # Particle Engine, Peter O., 2007-11-03 # Based on version 2 by Near Fantastica, 04.01.06 # In turn based on the Particle Engine designed by PinkMan +#=============================================================================== class Particle_Engine def initialize(viewport = nil, map = nil) @map = (map) ? map : $game_map @@ -98,8 +100,9 @@ class Particle_Engine end end - - +#=============================================================================== +# +#=============================================================================== class ParticleEffect attr_accessor :x, :y, :z @@ -113,8 +116,9 @@ class ParticleEffect def dispose; end end - - +#=============================================================================== +# +#=============================================================================== class ParticleSprite attr_accessor :x, :y, :z, :ox, :oy, :opacity, :blend_type attr_reader :bitmap @@ -171,8 +175,9 @@ class ParticleSprite end end - - +#=============================================================================== +# +#=============================================================================== class ParticleEffect_Event < ParticleEffect attr_accessor :event @@ -357,8 +362,9 @@ class ParticleEffect_Event < ParticleEffect end end - - +#=============================================================================== +# +#=============================================================================== class Particle_Engine::Fire < ParticleEffect_Event def initialize(event, viewport) super @@ -368,8 +374,9 @@ class Particle_Engine::Fire < ParticleEffect_Event end end - - +#=============================================================================== +# +#=============================================================================== class Particle_Engine::Smoke < ParticleEffect_Event def initialize(event, viewport) super @@ -379,8 +386,9 @@ class Particle_Engine::Smoke < ParticleEffect_Event end end - - +#=============================================================================== +# +#=============================================================================== class Particle_Engine::Teleport < ParticleEffect_Event def initialize(event, viewport) super @@ -394,8 +402,9 @@ class Particle_Engine::Teleport < ParticleEffect_Event end end - - +#=============================================================================== +# +#=============================================================================== class Particle_Engine::Spirit < ParticleEffect_Event def initialize(event, viewport) super @@ -405,8 +414,9 @@ class Particle_Engine::Spirit < ParticleEffect_Event end end - - +#=============================================================================== +# +#=============================================================================== class Particle_Engine::Explosion < ParticleEffect_Event def initialize(event, viewport) super @@ -416,8 +426,9 @@ class Particle_Engine::Explosion < ParticleEffect_Event end end - - +#=============================================================================== +# +#=============================================================================== class Particle_Engine::Aura < ParticleEffect_Event def initialize(event, viewport) super @@ -427,8 +438,9 @@ class Particle_Engine::Aura < ParticleEffect_Event end end - - +#=============================================================================== +# +#=============================================================================== class Particle_Engine::Soot < ParticleEffect_Event def initialize(event, viewport) super @@ -438,8 +450,9 @@ class Particle_Engine::Soot < ParticleEffect_Event end end - - +#=============================================================================== +# +#=============================================================================== class Particle_Engine::SootSmoke < ParticleEffect_Event def initialize(event, viewport) super @@ -452,8 +465,9 @@ class Particle_Engine::SootSmoke < ParticleEffect_Event end end - - +#=============================================================================== +# +#=============================================================================== class Particle_Engine::Rocket < ParticleEffect_Event def initialize(event, viewport) super @@ -463,8 +477,9 @@ class Particle_Engine::Rocket < ParticleEffect_Event end end - - +#=============================================================================== +# +#=============================================================================== class Particle_Engine::FixedTeleport < ParticleEffect_Event def initialize(event, viewport) super @@ -478,9 +493,9 @@ class Particle_Engine::FixedTeleport < ParticleEffect_Event end end - - +#=============================================================================== # By Peter O. +#=============================================================================== class Particle_Engine::StarTeleport < ParticleEffect_Event def initialize(event, viewport) super @@ -494,8 +509,9 @@ class Particle_Engine::StarTeleport < ParticleEffect_Event end end - - +#=============================================================================== +# +#=============================================================================== class Particle_Engine::Smokescreen < ParticleEffect_Event def initialize(event, viewport) super @@ -531,8 +547,9 @@ class Particle_Engine::Smokescreen < ParticleEffect_Event end end - - +#=============================================================================== +# +#=============================================================================== class Particle_Engine::Flare < ParticleEffect_Event def initialize(event, viewport) super @@ -542,8 +559,9 @@ class Particle_Engine::Flare < ParticleEffect_Event end end - - +#=============================================================================== +# +#=============================================================================== class Particle_Engine::Splash < ParticleEffect_Event def initialize(event, viewport) super @@ -561,8 +579,9 @@ class Particle_Engine::Splash < ParticleEffect_Event end end - - +#=============================================================================== +# +#=============================================================================== class Game_Event < Game_Character attr_accessor :pe_refresh diff --git a/Data/Scripts/005_Sprites/011_PictureEx.rb b/Data/Scripts/005_Sprites/011_PictureEx.rb index db7c58848..b3c69df0d 100644 --- a/Data/Scripts/005_Sprites/011_PictureEx.rb +++ b/Data/Scripts/005_Sprites/011_PictureEx.rb @@ -1,3 +1,6 @@ +#=============================================================================== +# +#=============================================================================== class PictureOrigin TOP_LEFT = 0 CENTER = 1 @@ -12,8 +15,9 @@ class PictureOrigin RIGHT = 8 end - - +#=============================================================================== +# +#=============================================================================== class Processes XY = 0 DELTA_XY = 1 @@ -35,8 +39,9 @@ class Processes CROP_BOTTOM = 17 end - - +#=============================================================================== +# +#=============================================================================== def getCubicPoint2(src, t) x0 = src[0] y0 = src[1] @@ -72,8 +77,6 @@ def getCubicPoint2(src, t) return [cx, cy] end - - #=============================================================================== # PictureEx #=============================================================================== @@ -456,8 +459,6 @@ class PictureEx end end - - #=============================================================================== # #=============================================================================== diff --git a/Data/Scripts/005_Sprites/012_Interpolators.rb b/Data/Scripts/005_Sprites/012_Interpolators.rb index 358aa0fd3..4399b1be5 100644 --- a/Data/Scripts/005_Sprites/012_Interpolators.rb +++ b/Data/Scripts/005_Sprites/012_Interpolators.rb @@ -1,3 +1,6 @@ +#=============================================================================== +# +#=============================================================================== class Interpolator ZOOM_X = 1 ZOOM_Y = 2 @@ -83,8 +86,9 @@ class Interpolator end end - - +#=============================================================================== +# +#=============================================================================== class RectInterpolator def initialize(oldrect, newrect, frames) restart(oldrect, newrect, frames) @@ -130,8 +134,9 @@ class RectInterpolator end end - - +#=============================================================================== +# +#=============================================================================== class PointInterpolator attr_reader :x attr_reader :y diff --git a/Data/Scripts/007_Objects and windows/001_RPG_Cache.rb b/Data/Scripts/007_Objects and windows/001_RPG_Cache.rb index d42452c43..3da5779d0 100644 --- a/Data/Scripts/007_Objects and windows/001_RPG_Cache.rb +++ b/Data/Scripts/007_Objects and windows/001_RPG_Cache.rb @@ -1,7 +1,11 @@ +#=============================================================================== +# +#=============================================================================== class Hangup < Exception; end - - +#=============================================================================== +# +#=============================================================================== module RPG module Cache def self.debug @@ -106,8 +110,9 @@ module RPG end end - - +#=============================================================================== +# +#=============================================================================== class BitmapWrapper < Bitmap attr_reader :refcount attr_accessor :never_dispose diff --git a/Data/Scripts/007_Objects and windows/002_MessageConfig.rb b/Data/Scripts/007_Objects and windows/002_MessageConfig.rb index db1d6c8f5..c33a4db8e 100644 --- a/Data/Scripts/007_Objects and windows/002_MessageConfig.rb +++ b/Data/Scripts/007_Objects and windows/002_MessageConfig.rb @@ -1,3 +1,6 @@ +#=============================================================================== +# +#=============================================================================== module MessageConfig LIGHT_TEXT_MAIN_COLOR = Color.new(248, 248, 248) LIGHT_TEXT_SHADOW_COLOR = Color.new(72, 80, 88) @@ -163,8 +166,6 @@ module MessageConfig end end - - #=============================================================================== # Position a window #=============================================================================== @@ -759,10 +760,8 @@ def addBackgroundOrColoredPlane(sprites, planename, background, color, viewport end end - - #=============================================================================== -# Ensure required method definitions +# Ensure required method definitions. #=============================================================================== module Graphics if !self.respond_to?("width") @@ -773,8 +772,9 @@ module Graphics end end - - +#=============================================================================== +# Ensure required method definitions. +#=============================================================================== if !defined?(_INTL) def _INTL(*args) string = args[0].clone diff --git a/Data/Scripts/007_Objects and windows/003_Window.rb b/Data/Scripts/007_Objects and windows/003_Window.rb index 1de8100fb..3a20b9d7c 100644 --- a/Data/Scripts/007_Objects and windows/003_Window.rb +++ b/Data/Scripts/007_Objects and windows/003_Window.rb @@ -1,3 +1,6 @@ +#=============================================================================== +# +#=============================================================================== class WindowCursorRect < Rect def initialize(window) super(0, 0, 0, 0) @@ -46,7 +49,9 @@ class WindowCursorRect < Rect end end - +#=============================================================================== +# +#=============================================================================== class Window attr_reader :tone attr_reader :color diff --git a/Data/Scripts/007_Objects and windows/004_SpriteWindow.rb b/Data/Scripts/007_Objects and windows/004_SpriteWindow.rb index dfd57fa56..e726b3613 100644 --- a/Data/Scripts/007_Objects and windows/004_SpriteWindow.rb +++ b/Data/Scripts/007_Objects and windows/004_SpriteWindow.rb @@ -46,6 +46,8 @@ class SpriteWindow < Window end attr_reader :compat + attr_reader :skinformat + attr_reader :skinrect def compat=(value) @compat = value @@ -324,10 +326,6 @@ class SpriteWindow < Window end end - ############# - attr_reader :skinformat - attr_reader :skinrect - def loadSkinFile(_file) if (self.windowskin.width == 80 || self.windowskin.width == 96) && self.windowskin.height == 48 @@ -437,7 +435,8 @@ class SpriteWindow < Window privRefresh end - ############# + #=============================================================================== + private def ensureBitmap(bitmap, dwidth, dheight) @@ -813,8 +812,6 @@ class SpriteWindow < Window end end - - #=============================================================================== # #=============================================================================== diff --git a/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb b/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb index 3420d5c93..9859c8843 100644 --- a/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb +++ b/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb @@ -1,8 +1,7 @@ #=============================================================================== -# -#=============================================================================== # Represents a window with no formatting capabilities. Its text color can be set, # though, and line breaks are supported, but the text is generally unformatted. +#=============================================================================== class Window_UnformattedTextPokemon < SpriteWindow_Base attr_reader :text attr_reader :baseColor @@ -106,8 +105,6 @@ class Window_UnformattedTextPokemon < SpriteWindow_Base end end - - #=============================================================================== # #=============================================================================== @@ -602,8 +599,6 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base end end - - #=============================================================================== # #=============================================================================== @@ -723,8 +718,6 @@ class Window_InputNumberPokemon < SpriteWindow_Base end end - - #=============================================================================== # #=============================================================================== @@ -951,8 +944,6 @@ class SpriteWindow_Selectable < SpriteWindow_Base end end - - #=============================================================================== # #=============================================================================== @@ -1016,8 +1007,6 @@ module UpDownArrowMixin end end - - #=============================================================================== # #=============================================================================== @@ -1030,8 +1019,6 @@ class SpriteWindow_SelectableEx < SpriteWindow_Selectable end end - - #=============================================================================== # #=============================================================================== @@ -1137,8 +1124,6 @@ class Window_DrawableCommand < SpriteWindow_SelectableEx end end - - #=============================================================================== # #=============================================================================== @@ -1229,15 +1214,12 @@ class Window_CommandPokemon < Window_DrawableCommand end end - - #=============================================================================== # #=============================================================================== class Window_CommandPokemonEx < Window_CommandPokemon end - #=============================================================================== # #=============================================================================== @@ -1350,8 +1332,6 @@ class Window_AdvancedCommandPokemon < Window_DrawableCommand end end - - #=============================================================================== # #=============================================================================== diff --git a/Data/Scripts/007_Objects and windows/006_SpriteWindow_pictures.rb b/Data/Scripts/007_Objects and windows/006_SpriteWindow_pictures.rb index a5e248da0..47dada3ef 100644 --- a/Data/Scripts/007_Objects and windows/006_SpriteWindow_pictures.rb +++ b/Data/Scripts/007_Objects and windows/006_SpriteWindow_pictures.rb @@ -51,8 +51,6 @@ class IconWindow < SpriteWindow_Base end end - - #=============================================================================== # Displays an icon bitmap in a window. Supports animated images. # Accepts bitmaps and paths to bitmap files in its constructor. diff --git a/Data/Scripts/007_Objects and windows/007_SpriteWrapper.rb b/Data/Scripts/007_Objects and windows/007_SpriteWrapper.rb index f6de79b70..c3c656f4a 100644 --- a/Data/Scripts/007_Objects and windows/007_SpriteWrapper.rb +++ b/Data/Scripts/007_Objects and windows/007_SpriteWrapper.rb @@ -88,8 +88,6 @@ class SpriteWrapper end end - - #=============================================================================== # Sprite class that maintains a bitmap of its own. # This bitmap can't be changed to a different one. @@ -111,8 +109,6 @@ class BitmapSprite < Sprite end end - - #=============================================================================== # #=============================================================================== @@ -237,8 +233,6 @@ class AnimatedSprite < Sprite end end - - #=============================================================================== # Displays an icon bitmap in a sprite. Supports animated images. #=============================================================================== @@ -310,8 +304,6 @@ class IconSprite < Sprite end end - - #=============================================================================== # Sprite class that stores multiple bitmaps, and displays only one at once. #=============================================================================== diff --git a/Data/Scripts/007_Objects and windows/010_DrawText.rb b/Data/Scripts/007_Objects and windows/010_DrawText.rb index 13ddc6d57..b3e217c26 100644 --- a/Data/Scripts/007_Objects and windows/010_DrawText.rb +++ b/Data/Scripts/007_Objects and windows/010_DrawText.rb @@ -54,8 +54,6 @@ def getContrastColor(color) return color.get_contrast_color end - - #=============================================================================== # Format text #=============================================================================== @@ -248,8 +246,6 @@ def getLastColors(colorstack, opacitystack, defaultcolors) return colors end - - #=============================================================================== # Formats a string of text and returns an array containing a list of formatted # characters. @@ -317,7 +313,6 @@ In addition, the syntax supports the following: To draw the characters, pass the returned array to the _drawFormattedChars_ function. =end - def getFormattedText(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight = 32, newlineBreaks = true, explicitBreaksOnly = false, collapseAlignments = false) @@ -774,8 +769,6 @@ def getFormattedText(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight = return characters end - - #=============================================================================== # Draw text and images on a bitmap #=============================================================================== @@ -1109,8 +1102,6 @@ def pbDrawTextPositions(bitmap, textpos) end end - - #=============================================================================== # Draw images on a bitmap #=============================================================================== diff --git a/Data/Scripts/007_Objects and windows/011_Messages.rb b/Data/Scripts/007_Objects and windows/011_Messages.rb index f73d438e9..ed4a570d3 100644 --- a/Data/Scripts/007_Objects and windows/011_Messages.rb +++ b/Data/Scripts/007_Objects and windows/011_Messages.rb @@ -49,8 +49,6 @@ def pbCurrentEventCommentInput(elements, trigger) return pbEventCommentInput(event, elements, trigger) end - - #=============================================================================== # #=============================================================================== @@ -164,8 +162,9 @@ class ChooseNumberParams end end - - +#=============================================================================== +# +#=============================================================================== def pbChooseNumber(msgwindow, params) return 0 if !params ret = 0 @@ -208,8 +207,6 @@ def pbChooseNumber(msgwindow, params) return ret end - - #=============================================================================== # #=============================================================================== @@ -244,8 +241,6 @@ class FaceWindowVX < SpriteWindow_Base end end - - #=============================================================================== # #=============================================================================== @@ -311,8 +306,6 @@ def pbCsvPosInt!(str) return ret.to_i end - - #=============================================================================== # Money and coins windows #=============================================================================== @@ -368,8 +361,6 @@ def pbDisplayBattlePointsWindow(msgwindow) return pointswindow end - - #=============================================================================== # #=============================================================================== @@ -410,8 +401,6 @@ def pbDisposeMessageWindow(msgwindow) msgwindow.dispose end - - #=============================================================================== # Main message-displaying function #=============================================================================== @@ -701,8 +690,6 @@ def pbMessageDisplay(msgwindow, message, letterbyletter = true, commandProc = ni return ret end - - #=============================================================================== # Message-displaying functions #=============================================================================== diff --git a/Data/Scripts/007_Objects and windows/012_TextEntry.rb b/Data/Scripts/007_Objects and windows/012_TextEntry.rb index 4fb42630a..2d8699cfa 100644 --- a/Data/Scripts/007_Objects and windows/012_TextEntry.rb +++ b/Data/Scripts/007_Objects and windows/012_TextEntry.rb @@ -81,8 +81,6 @@ class CharacterEntryHelper end end - - #=============================================================================== # #=============================================================================== @@ -217,8 +215,6 @@ class Window_TextEntry < SpriteWindow_Base end end - - #=============================================================================== # #=============================================================================== @@ -253,8 +249,6 @@ class Window_TextEntry_Keyboard < Window_TextEntry end end - - #=============================================================================== # #=============================================================================== diff --git a/Data/Scripts/009_Scenes/002_EventScene.rb b/Data/Scripts/009_Scenes/002_EventScene.rb index 13f0c4aec..a50c12906 100644 --- a/Data/Scripts/009_Scenes/002_EventScene.rb +++ b/Data/Scripts/009_Scenes/002_EventScene.rb @@ -1,3 +1,6 @@ +#=============================================================================== +# +#=============================================================================== class PictureSprite < Sprite def initialize(viewport, picture) super(viewport) @@ -50,8 +53,6 @@ class PictureSprite < Sprite end end - - def pbTextBitmap(text, maxwidth = Graphics.width) tmp = Bitmap.new(maxwidth, Graphics.height) pbSetSystemFont(tmp) @@ -59,10 +60,8 @@ def pbTextBitmap(text, maxwidth = Graphics.width) return tmp end - - #=============================================================================== -# EventScene +# #=============================================================================== class EventScene attr_accessor :onCTrigger, :onBTrigger, :onUpdate @@ -181,8 +180,6 @@ class EventScene end end - - #=============================================================================== # #=============================================================================== diff --git a/Data/Scripts/010_Data/002_PBS data/004_Ability.rb b/Data/Scripts/010_Data/002_PBS data/004_Ability.rb index c3d59d7b4..d21feb70a 100644 --- a/Data/Scripts/010_Data/002_PBS data/004_Ability.rb +++ b/Data/Scripts/010_Data/002_PBS data/004_Ability.rb @@ -14,10 +14,10 @@ module GameData include InstanceMethods SCHEMA = { - "SectionName" => [:id, "m"], - "Name" => [:real_name, "s"], - "Description" => [:real_description, "q"], - "Flags" => [:flags, "*s"] + "SectionName" => [:id, "m"], + "Name" => [:real_name, "s"], + "Description" => [:real_description, "q"], + "Flags" => [:flags, "*s"] } def initialize(hash) 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 af01994b7..8a1094b08 100644 --- a/Data/Scripts/010_Data/002_PBS data/006_Item.rb +++ b/Data/Scripts/010_Data/002_PBS data/006_Item.rb @@ -31,10 +31,10 @@ module GameData "Price" => [:price, "u"], "SellPrice" => [:sell_price, "u"], "BPPrice" => [:bp_price, "u"], - "FieldUse" => [:field_use, "e", { "OnPokemon" => 1, "Direct" => 2, - "TM" => 3, "HM" => 4, "TR" => 5 }], - "BattleUse" => [:battle_use, "e", { "OnPokemon" => 1, "OnMove" => 2, - "OnBattler" => 3, "OnFoe" => 4, "Direct" => 5 }], + "FieldUse" => [:field_use, "e", {"OnPokemon" => 1, "Direct" => 2, + "TM" => 3, "HM" => 4, "TR" => 5}], + "BattleUse" => [:battle_use, "e", {"OnPokemon" => 1, "OnMove" => 2, + "OnBattler" => 3, "OnFoe" => 4, "Direct" => 5}], "Flags" => [:flags, "*s"], "Consumable" => [:consumable, "b"], "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 87428a7fe..79b882a40 100644 --- a/Data/Scripts/010_Data/002_PBS data/010_SpeciesMetrics.rb +++ b/Data/Scripts/010_Data/002_PBS data/010_SpeciesMetrics.rb @@ -38,7 +38,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, @@ -52,7 +52,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 1bad519db..7b12c201a 100644 --- a/Data/Scripts/010_Data/002_PBS data/014_TrainerType.rb +++ b/Data/Scripts/010_Data/002_PBS data/014_TrainerType.rb @@ -18,10 +18,10 @@ module GameData SCHEMA = { "SectionName" => [:id, "m"], "Name" => [:real_name, "s"], - "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 }], + "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}], "BaseMoney" => [:base_money, "u"], "SkillLevel" => [:skill_level, "u"], "Flags" => [:flags, "*s"], diff --git a/Data/Scripts/010_Data/002_PBS data/015_Trainer.rb b/Data/Scripts/010_Data/002_PBS data/015_Trainer.rb index 0d206b36f..083eaf750 100644 --- a/Data/Scripts/010_Data/002_PBS data/015_Trainer.rb +++ b/Data/Scripts/010_Data/002_PBS data/015_Trainer.rb @@ -30,8 +30,8 @@ module GameData "Ability" => [:ability, "e", :Ability], "AbilityIndex" => [:ability_index, "u"], "Item" => [:item, "e", :Item], - "Gender" => [:gender, "e", { "M" => 0, "m" => 0, "Male" => 0, "male" => 0, "0" => 0, - "F" => 1, "f" => 1, "Female" => 1, "female" => 1, "1" => 1 }], + "Gender" => [:gender, "e", {"M" => 0, "m" => 0, "Male" => 0, "male" => 0, "0" => 0, + "F" => 1, "f" => 1, "Female" => 1, "female" => 1, "1" => 1}], "Nature" => [:nature, "e", :Nature], "IV" => [:iv, "uUUUUU"], "EV" => [:ev, "uUUUUU"], diff --git a/Data/Scripts/010_Data/002_PBS data/021_PhoneMessage.rb b/Data/Scripts/010_Data/002_PBS data/021_PhoneMessage.rb index 5c1b7bda1..adb8856ff 100644 --- a/Data/Scripts/010_Data/002_PBS data/021_PhoneMessage.rb +++ b/Data/Scripts/010_Data/002_PBS data/021_PhoneMessage.rb @@ -42,7 +42,7 @@ module GameData validate tr_type => [Symbol, String] validate tr_name => [String, NilClass] key = [tr_type.to_sym, tr_name, tr_version] - key = key[0] if key[1] == nil + key = key[0] if key[1].nil? return !self::DATA[key].nil? end diff --git a/Data/Scripts/011_Battle/001_Battle/001_Battle.rb b/Data/Scripts/011_Battle/001_Battle/001_Battle.rb index a249903a4..2c6944c9a 100644 --- a/Data/Scripts/011_Battle/001_Battle/001_Battle.rb +++ b/Data/Scripts/011_Battle/001_Battle/001_Battle.rb @@ -164,11 +164,11 @@ class Battle @runCommand = 0 @nextPickupUse = 0 if GameData::Move.exists?(:STRUGGLE) - @struggle = Move.from_pokemon_move(self, Pokemon::Move.new(:STRUGGLE)) + @struggle = Move.from_pokemon_move(self, Pokemon::Move.new(:STRUGGLE)) else - @struggle = Move::Struggle.new(self, nil) + @struggle = Move::Struggle.new(self, nil) end - @mega_rings = [] + @mega_rings = [] GameData::Item.each { |item| @mega_rings.push(item.id) if item.has_flag?("MegaRing") } @battleAI = AI.new(self) end diff --git a/Data/Scripts/011_Battle/002_Battler/003_Battler_ChangeSelf.rb b/Data/Scripts/011_Battle/002_Battler/003_Battler_ChangeSelf.rb index 36e9efbd8..e90b37d09 100644 --- a/Data/Scripts/011_Battle/002_Battler/003_Battler_ChangeSelf.rb +++ b/Data/Scripts/011_Battle/002_Battler/003_Battler_ChangeSelf.rb @@ -144,7 +144,7 @@ class Battle::Battler def pbResetTypes @types = @pokemon.types - @effects[PBEffects::ExtraType] = nil + @effects[PBEffects::ExtraType] = nil @effects[PBEffects::BurnUp] = false @effects[PBEffects::Roost] = false end diff --git a/Data/Scripts/011_Battle/003_Move/008_MoveEffects_MoveAttributes.rb b/Data/Scripts/011_Battle/003_Move/008_MoveEffects_MoveAttributes.rb index 40b25b8f7..1afa61381 100644 --- a/Data/Scripts/011_Battle/003_Move/008_MoveEffects_MoveAttributes.rb +++ b/Data/Scripts/011_Battle/003_Move/008_MoveEffects_MoveAttributes.rb @@ -453,8 +453,6 @@ class Battle::Move::DoublePowerIfTargetPoisoned < Battle::Move end end - - #=============================================================================== # Power is doubled if the target is paralyzed. Cures the target of paralysis. # (Smelling Salts) 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 7761aeb59..09d1ec5b9 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 @@ -91,8 +91,6 @@ class Battle::Scene::MenuBase end end - - #=============================================================================== # Command menu (Fight/Pokémon/Bag/Run) #=============================================================================== @@ -194,8 +192,6 @@ class Battle::Scene::CommandMenu < Battle::Scene::MenuBase end end - - #=============================================================================== # Fight menu (choose a move) #=============================================================================== @@ -440,8 +436,6 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase end end - - #=============================================================================== # Target menu (choose a move's target) # NOTE: Unlike the command and fight menus, this one doesn't have a textbox-only 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 5081eec34..eb9ec8dd7 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 @@ -402,8 +402,6 @@ class Battle::Scene::PokemonDataBox < Sprite end end - - #=============================================================================== # Splash bar to announce a triggered ability #=============================================================================== @@ -496,8 +494,6 @@ class Battle::Scene::AbilitySplashBar < Sprite end end - - #=============================================================================== # Pokémon sprite (used in battle) #=============================================================================== @@ -624,8 +620,6 @@ class Battle::Scene::BattlerSprite < RPG::Sprite end end - - #=============================================================================== # Shadow sprite for Pokémon (used in battle) #=============================================================================== diff --git a/Data/Scripts/011_Battle/004_Scene/008_Battle_Scene_Animations.rb b/Data/Scripts/011_Battle/004_Scene/008_Battle_Scene_Animations.rb index a8a07cf0e..aa2c13f8d 100644 --- a/Data/Scripts/011_Battle/004_Scene/008_Battle_Scene_Animations.rb +++ b/Data/Scripts/011_Battle/004_Scene/008_Battle_Scene_Animations.rb @@ -57,8 +57,6 @@ class Battle::Scene::Animation::Intro < Battle::Scene::Animation end end - - #=============================================================================== # Shows wild Pokémon fading back to their normal color, and triggers their intro # animations @@ -80,8 +78,6 @@ class Battle::Scene::Animation::Intro2 < Battle::Scene::Animation end end - - #=============================================================================== # Makes a side's party bar and balls appear #=============================================================================== @@ -181,8 +177,6 @@ class Battle::Scene::Animation::LineupAppear < Battle::Scene::Animation end end - - #=============================================================================== # Makes a Pokémon's data box appear #=============================================================================== @@ -202,8 +196,6 @@ class Battle::Scene::Animation::DataBoxAppear < Battle::Scene::Animation end end - - #=============================================================================== # Makes a Pokémon's data box disappear #=============================================================================== @@ -222,8 +214,6 @@ class Battle::Scene::Animation::DataBoxDisappear < Battle::Scene::Animation end end - - #=============================================================================== # Makes a Pokémon's ability bar appear #=============================================================================== @@ -242,8 +232,6 @@ class Battle::Scene::Animation::AbilitySplashAppear < Battle::Scene::Animation end end - - #=============================================================================== # Makes a Pokémon's ability bar disappear #=============================================================================== @@ -262,8 +250,6 @@ class Battle::Scene::Animation::AbilitySplashDisappear < Battle::Scene::Animatio end end - - #=============================================================================== # Make an enemy trainer slide on-screen from the right. Makes the previous # trainer slide off to the right first if it is on-screen. @@ -296,8 +282,6 @@ class Battle::Scene::Animation::TrainerAppear < Battle::Scene::Animation end end - - #=============================================================================== # Shows the player (and partner) and the player party lineup sliding off screen. # Shows the player's/partner's throwing animation (if they have one). @@ -350,8 +334,6 @@ class Battle::Scene::Animation::PlayerFade < Battle::Scene::Animation end end - - #=============================================================================== # Shows the enemy trainer(s) and the enemy party lineup sliding off screen. # Doesn't show the ball thrown or the Pokémon. @@ -395,8 +377,6 @@ class Battle::Scene::Animation::TrainerFade < Battle::Scene::Animation end end - - #=============================================================================== # Shows a Pokémon being sent out on the player's side (including by a partner). # Includes the Poké Ball being thrown. @@ -473,8 +453,6 @@ class Battle::Scene::Animation::PokeballPlayerSendOut < Battle::Scene::Animation end end - - #=============================================================================== # Shows a Pokémon being sent out on the opposing side. # Includes the Poké Ball being "thrown" (although here the Poké Ball just @@ -544,8 +522,6 @@ class Battle::Scene::Animation::PokeballTrainerSendOut < Battle::Scene::Animatio end end - - #=============================================================================== # Shows a Pokémon being recalled into its Poké Ball #=============================================================================== @@ -594,8 +570,6 @@ class Battle::Scene::Animation::BattlerRecall < Battle::Scene::Animation end end - - #=============================================================================== # Shows a Pokémon flashing after taking damage #=============================================================================== @@ -632,8 +606,6 @@ class Battle::Scene::Animation::BattlerDamage < Battle::Scene::Animation end end - - #=============================================================================== # Shows a Pokémon fainting #=============================================================================== @@ -682,8 +654,6 @@ class Battle::Scene::Animation::BattlerFaint < Battle::Scene::Animation end end - - #=============================================================================== # Shows the player's Poké Ball being thrown to capture a Pokémon #=============================================================================== @@ -836,8 +806,6 @@ class Battle::Scene::Animation::PokeballThrowCapture < Battle::Scene::Animation end end - - #=============================================================================== # Shows the player throwing a Poké Ball and it being deflected #=============================================================================== diff --git a/Data/Scripts/011_Battle/004_Scene/009_Battle_DebugScene.rb b/Data/Scripts/011_Battle/004_Scene/009_Battle_DebugScene.rb index b0bde2fbb..d428077c9 100644 --- a/Data/Scripts/011_Battle/004_Scene/009_Battle_DebugScene.rb +++ b/Data/Scripts/011_Battle/004_Scene/009_Battle_DebugScene.rb @@ -57,8 +57,7 @@ class Battle::DebugSceneNoLogging def pbChangePokemon(idxBattler, pkmn); end def pbFaintBattler(battler); end def pbEXPBar(battler, startExp, endExp, tempExp1, tempExp2); end - def pbLevelUp(pkmn, battler, oldTotalHP, oldAttack, oldDefense, - oldSpAtk, oldSpDef, oldSpeed); end + def pbLevelUp(pkmn, battler, oldTotalHP, oldAttack, oldDefense, oldSpAtk, oldSpDef, oldSpeed); end def pbForgetMove(pkmn, moveToLearn); return 0; end # Always forget first move def pbCommandMenu(idxBattler, firstAction) diff --git a/Data/Scripts/011_Battle/006_Other battle code/006_Battle_Clauses.rb b/Data/Scripts/011_Battle/006_Other battle code/006_Battle_Clauses.rb index 1bad500aa..9d27a0953 100644 --- a/Data/Scripts/011_Battle/006_Other battle code/006_Battle_Clauses.rb +++ b/Data/Scripts/011_Battle/006_Other battle code/006_Battle_Clauses.rb @@ -51,8 +51,9 @@ class Battle end end - - +#=============================================================================== +# +#=============================================================================== class Battle::Battler unless @__clauses__aliased alias __clauses__pbCanSleep? pbCanSleep? @@ -100,9 +101,10 @@ class Battle::Battler end end - - -class Battle::Move::RaiseUserEvasion1 # Double Team +#=============================================================================== +# Double Team +#=============================================================================== +class Battle::Move::RaiseUserEvasion1 unless method_defined?(:__clauses__pbMoveFailed?) alias __clauses__pbMoveFailed? pbMoveFailed? end @@ -116,9 +118,10 @@ class Battle::Move::RaiseUserEvasion1 # Double Team end end - - -class Battle::Move::RaiseUserEvasion2MinimizeUser # Minimize +#=============================================================================== +# Minimize +#=============================================================================== +class Battle::Move::RaiseUserEvasion2MinimizeUser unless method_defined?(:__clauses__pbMoveFailed?) alias __clauses__pbMoveFailed? pbMoveFailed? end @@ -132,9 +135,10 @@ class Battle::Move::RaiseUserEvasion2MinimizeUser # Minimize end end - - -class Battle::Move::UserTargetSwapAbilities # Skill Swap +#=============================================================================== +# Skill Swap +#=============================================================================== +class Battle::Move::UserTargetSwapAbilities unless method_defined?(:__clauses__pbFailsAgainstTarget?) alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget? end @@ -148,9 +152,10 @@ class Battle::Move::UserTargetSwapAbilities # Skill Swap end end - - -class Battle::Move::FixedDamage20 # Sonic Boom +#=============================================================================== +# Sonic Boom +#=============================================================================== +class Battle::Move::FixedDamage20 unless method_defined?(:__clauses__pbFailsAgainstTarget?) alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget? end @@ -164,9 +169,10 @@ class Battle::Move::FixedDamage20 # Sonic Boom end end - - -class Battle::Move::FixedDamage40 # Dragon Rage +#=============================================================================== +# Dragon Rage +#=============================================================================== +class Battle::Move::FixedDamage40 unless method_defined?(:__clauses__pbFailsAgainstTarget?) alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget? end @@ -180,8 +186,9 @@ class Battle::Move::FixedDamage40 # Dragon Rage end end - - +#=============================================================================== +# +#=============================================================================== class Battle::Move::OHKO unless method_defined?(:__clauses__pbFailsAgainstTarget?) alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget? @@ -196,8 +203,9 @@ class Battle::Move::OHKO end end - - +#=============================================================================== +# +#=============================================================================== class Battle::Move::OHKOIce unless method_defined?(:__clauses__pbFailsAgainstTarget?) alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget? @@ -212,8 +220,9 @@ class Battle::Move::OHKOIce end end - - +#=============================================================================== +# +#=============================================================================== class Battle::Move::OHKOHitsUndergroundTarget unless method_defined?(:__clauses__pbFailsAgainstTarget?) alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget? @@ -228,9 +237,10 @@ class Battle::Move::OHKOHitsUndergroundTarget end end - - -class Battle::Move::UserFaintsExplosive # Self-Destruct +#=============================================================================== +# Self-Destruct +#=============================================================================== +class Battle::Move::UserFaintsExplosive unless method_defined?(:__clauses__pbMoveFailed?) alias __clauses__pbMoveFailed? pbMoveFailed? end @@ -259,9 +269,10 @@ class Battle::Move::UserFaintsExplosive # Self-Destruct end end - - -class Battle::Move::StartPerishCountsForAllBattlers # Perish Song +#=============================================================================== +# Perish Song +#=============================================================================== +class Battle::Move::StartPerishCountsForAllBattlers unless method_defined?(:__clauses__pbFailsAgainstTarget?) alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget? end @@ -276,9 +287,10 @@ class Battle::Move::StartPerishCountsForAllBattlers # Perish Song end end - - -class Battle::Move::AttackerFaintsIfUserFaints # Destiny Bond +#=============================================================================== +# Destiny Bond +#=============================================================================== +class Battle::Move::AttackerFaintsIfUserFaints unless method_defined?(:__clauses__pbFailsAgainstTarget?) alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget? end 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 d63a72970..5abcdd2d8 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 @@ -29,8 +29,6 @@ class AnimFrame FOCUS = 26 end - - #=============================================================================== # #=============================================================================== @@ -166,8 +164,6 @@ def pbConvertRPGAnimation(animation) return pbAnim end - - #=============================================================================== # #=============================================================================== @@ -230,8 +226,6 @@ class RPG::Animation end end - - #=============================================================================== # #=============================================================================== @@ -333,8 +327,6 @@ class PBAnimTiming end end - - #=============================================================================== # #=============================================================================== @@ -397,8 +389,6 @@ class PBAnimations < Array end end - - #=============================================================================== # #=============================================================================== @@ -598,8 +588,6 @@ class PBAnimation < Array end end - - #=============================================================================== # #=============================================================================== @@ -678,8 +666,6 @@ def pbSpriteSetAnimFrame(sprite, frame, user = nil, target = nil, inEditor = fal end end - - #=============================================================================== # Animation player #=============================================================================== 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 d0f5f513a..5b0d8443c 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 @@ -888,10 +888,7 @@ Battle::AbilityEffects::MoveBlocking.add(:DAZZLING, next false if battle.choices[user.index][4] <= 0 next false if !bearer.opposes?(user) ret = false - targets.each do |b| - next if !b.opposes?(user) - ret = true - end + targets.each { |b| ret = true if b.opposes?(user) } next ret } ) diff --git a/Data/Scripts/011_Battle/007_Other battle types/001_SafariBattle.rb b/Data/Scripts/011_Battle/007_Other battle types/001_SafariBattle.rb index f0e7e0af2..e53df76fe 100644 --- a/Data/Scripts/011_Battle/007_Other battle types/001_SafariBattle.rb +++ b/Data/Scripts/011_Battle/007_Other battle types/001_SafariBattle.rb @@ -54,8 +54,6 @@ class Battle::FakeBattler def pbReset; end end - - #=============================================================================== # Data box for safari battles #=============================================================================== @@ -93,8 +91,6 @@ class Battle::Scene::SafariDataBox < Sprite end end - - #=============================================================================== # Shows the player throwing bait at a wild Pokémon in a Safari battle. #=============================================================================== @@ -159,8 +155,6 @@ class Battle::Scene::Animation::ThrowBait < Battle::Scene::Animation end end - - #=============================================================================== # Shows the player throwing a rock at a wild Pokémon in a Safari battle. #=============================================================================== @@ -222,8 +216,6 @@ class Battle::Scene::Animation::ThrowRock < Battle::Scene::Animation end end - - #=============================================================================== # Safari Zone battle scene (the visuals of the battle) #=============================================================================== @@ -280,8 +272,6 @@ class Battle::Scene end end - - #=============================================================================== # Safari Zone battle class #=============================================================================== @@ -308,9 +298,9 @@ class SafariBattle def pbRandom(x); return rand(x); end - #============================================================================= + #----------------------------------------------------------------------------- # Initialize the battle class - #============================================================================= + #----------------------------------------------------------------------------- def initialize(scene, player, party2) @scene = scene @peer = Battle::Peer.new @@ -335,9 +325,9 @@ class SafariBattle def defaultWeather=(value); @weather = value; end def defaultTerrain=(value); end - #============================================================================= + #----------------------------------------------------------------------------- # Information about the type and size of the battle - #============================================================================= + #----------------------------------------------------------------------------- def wildBattle?; return true; end def trainerBattle?; return false; end @@ -347,9 +337,9 @@ class SafariBattle return @sideSizes[index % 2] end - #============================================================================= + #----------------------------------------------------------------------------- # Trainers and owner-related - #============================================================================= + #----------------------------------------------------------------------------- def pbPlayer; return @player[0]; end def opponent; return nil; end @@ -374,18 +364,18 @@ class SafariBattle end end - #============================================================================= + #----------------------------------------------------------------------------- # Get party info (counts all teams on the same side) - #============================================================================= + #----------------------------------------------------------------------------- def pbParty(idxBattler) return (opposes?(idxBattler)) ? @party2 : nil end def pbAllFainted?(idxBattler = 0); return false; end - #============================================================================= + #----------------------------------------------------------------------------- # Battler-related - #============================================================================= + #----------------------------------------------------------------------------- def opposes?(idxBattler1, idxBattler2 = 0) idxBattler1 = idxBattler1.index if idxBattler1.respond_to?("index") idxBattler2 = idxBattler2.index if idxBattler2.respond_to?("index") @@ -395,9 +385,9 @@ class SafariBattle def pbRemoveFromParty(idxBattler, idxParty); end def pbGainExp; end - #============================================================================= + #----------------------------------------------------------------------------- # Messages and animations - #============================================================================= + #----------------------------------------------------------------------------- def pbDisplay(msg, &block) @scene.pbDisplayMessage(msg, &block) end @@ -414,17 +404,15 @@ class SafariBattle return @scene.pbDisplayConfirmMessage(msg) end - - class BattleAbortedException < Exception; end def pbAbort raise BattleAbortedException.new("Battle aborted") end - #============================================================================= + #----------------------------------------------------------------------------- # Safari battle-specific methods - #============================================================================= + #----------------------------------------------------------------------------- def pbEscapeRate(catch_rate) return 125 if catch_rate <= 45 # Escape factor 9 (45%) return 100 if catch_rate <= 60 # Escape factor 7 (35%) diff --git a/Data/Scripts/011_Battle/007_Other battle types/002_BugContestBattle.rb b/Data/Scripts/011_Battle/007_Other battle types/002_BugContestBattle.rb index 0c7b78483..aa97a0963 100644 --- a/Data/Scripts/011_Battle/007_Other battle types/002_BugContestBattle.rb +++ b/Data/Scripts/011_Battle/007_Other battle types/002_BugContestBattle.rb @@ -26,8 +26,6 @@ class Battle::Scene end end - - #=============================================================================== # Bug Catching Contest battle class #=============================================================================== 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 ce78e38b5..2a7198f87 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 @@ -164,8 +164,6 @@ class BattlePalaceBattle < Battle end end - - #=============================================================================== # #=============================================================================== 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 82f41c070..98e2bf78a 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 @@ -35,8 +35,6 @@ class Battle::SuccessState end end - - #=============================================================================== # #=============================================================================== @@ -203,8 +201,6 @@ class BattleArenaBattle < Battle end end - - #=============================================================================== # #=============================================================================== @@ -221,8 +217,6 @@ class Battle::AI end end - - #=============================================================================== # #=============================================================================== diff --git a/Data/Scripts/012_Overworld/001_Overworld visuals/002_Overworld_Overlays.rb b/Data/Scripts/012_Overworld/001_Overworld visuals/002_Overworld_Overlays.rb index 2af2116a5..13662849c 100644 --- a/Data/Scripts/012_Overworld/001_Overworld visuals/002_Overworld_Overlays.rb +++ b/Data/Scripts/012_Overworld/001_Overworld visuals/002_Overworld_Overlays.rb @@ -38,8 +38,6 @@ class LocationWindow end end - - #=============================================================================== # Visibility circle in dark maps #=============================================================================== @@ -85,8 +83,6 @@ class DarknessSprite < Sprite end end - - #=============================================================================== # Light effects #=============================================================================== @@ -120,8 +116,9 @@ class LightEffect end end - - +#=============================================================================== +# +#=============================================================================== class LightEffect_Lamp < LightEffect def initialize(event, viewport = nil, map = nil) lamp = AnimatedBitmap.new("Graphics/Pictures/LE") @@ -138,8 +135,9 @@ class LightEffect_Lamp < LightEffect end end - - +#=============================================================================== +# +#=============================================================================== class LightEffect_Basic < LightEffect def initialize(event, viewport = nil, map = nil, filename = nil) super @@ -164,8 +162,9 @@ class LightEffect_Basic < LightEffect end end - - +#=============================================================================== +# +#=============================================================================== class LightEffect_DayNight < LightEffect def initialize(event, viewport = nil, map = nil, filename = nil) super @@ -203,8 +202,9 @@ class LightEffect_DayNight < LightEffect end end - - +#=============================================================================== +# +#=============================================================================== EventHandlers.add(:on_new_spriteset_map, :add_light_effects, proc { |spriteset, viewport| map = spriteset.map # Map associated with the spriteset (not necessarily the current map) diff --git a/Data/Scripts/012_Overworld/001_Overworld visuals/003_Overworld_MapTransitionAnims.rb b/Data/Scripts/012_Overworld/001_Overworld visuals/003_Overworld_MapTransitionAnims.rb index 884d12981..2be66888c 100644 --- a/Data/Scripts/012_Overworld/001_Overworld visuals/003_Overworld_MapTransitionAnims.rb +++ b/Data/Scripts/012_Overworld/001_Overworld visuals/003_Overworld_MapTransitionAnims.rb @@ -76,8 +76,6 @@ def pbCaveExit pbCaveEntranceEx(true) end - - #=============================================================================== # Blacking out animation #=============================================================================== diff --git a/Data/Scripts/012_Overworld/001_Overworld.rb b/Data/Scripts/012_Overworld/001_Overworld.rb index 5276e750c..1e9077df5 100644 --- a/Data/Scripts/012_Overworld/001_Overworld.rb +++ b/Data/Scripts/012_Overworld/001_Overworld.rb @@ -25,16 +25,12 @@ def pbPokerus? return false end - - class Game_Temp attr_accessor :warned_low_battery attr_accessor :cue_bgm attr_accessor :cue_bgm_frame_delay end - - def pbBatteryLow? pstate = System.power_state # If it's not discharging, it doesn't matter if it's low @@ -220,8 +216,6 @@ def pbBattleOnStepTaken(repel_active) $game_temp.force_single_battle = false end - - #=============================================================================== # Checks when moving between maps #=============================================================================== @@ -331,8 +325,6 @@ EventHandlers.add(:on_map_or_spriteset_change, :show_location_window, } ) - - #=============================================================================== # Event locations, terrain tags #=============================================================================== @@ -416,8 +408,6 @@ def pbFacingEachOther(event1, event2) return pbEventFacesPlayer?(event1, event2, 1) && pbEventFacesPlayer?(event2, event1, 1) end - - #=============================================================================== # Audio playing #=============================================================================== @@ -454,8 +444,6 @@ def pbAutoplayOnSave end end - - #=============================================================================== # Event movement #=============================================================================== @@ -473,8 +461,8 @@ module PBMoveRoute AwayFromPlayer = 11 Forward = 12 Backward = 13 - Jump = 14 # xoffset, yoffset - Wait = 15 # frames + Jump = 14 # xoffset, yoffset + Wait = 15 # frames TurnDown = 16 TurnLeft = 17 TurnRight = 18 @@ -486,10 +474,10 @@ module PBMoveRoute TurnRandom = 24 TurnTowardPlayer = 25 TurnAwayFromPlayer = 26 - SwitchOn = 27 # 1 param - SwitchOff = 28 # 1 param - ChangeSpeed = 29 # 1 param - ChangeFreq = 30 # 1 param + SwitchOn = 27 # 1 param + SwitchOff = 28 # 1 param + ChangeSpeed = 29 # 1 param + ChangeFreq = 30 # 1 param WalkAnimeOn = 31 WalkAnimeOff = 32 StepAnimeOn = 33 @@ -500,16 +488,14 @@ module PBMoveRoute ThroughOff = 38 AlwaysOnTopOn = 39 AlwaysOnTopOff = 40 - Graphic = 41 # Name, hue, direction, pattern - Opacity = 42 # 1 param - Blending = 43 # 1 param - PlaySE = 44 # 1 param - Script = 45 # 1 param - ScriptAsync = 101 # 1 param + Graphic = 41 # Name, hue, direction, pattern + Opacity = 42 # 1 param + Blending = 43 # 1 param + PlaySE = 44 # 1 param + Script = 45 # 1 param + ScriptAsync = 101 # 1 param end - - def pbMoveRoute(event, commands, waitComplete = false) route = RPG::MoveRoute.new route.repeat = false @@ -555,8 +541,6 @@ def pbWait(numFrames) end end - - #=============================================================================== # Player/event movement in the field #=============================================================================== @@ -644,8 +628,6 @@ def pbJumpToward(dist = 1, playSound = false, cancelSurf = false) return false end - - #=============================================================================== # Bridges, cave escape points, and setting the heal point #=============================================================================== @@ -689,8 +671,6 @@ def pbSetPokemonCenter $PokemonGlobal.pokecenterDirection = $game_player.direction end - - #=============================================================================== # Partner trainer #=============================================================================== @@ -710,8 +690,6 @@ def pbDeregisterPartner $PokemonGlobal.partner = nil end - - #=============================================================================== # Picking up an item found on the ground #=============================================================================== @@ -752,8 +730,6 @@ def pbItemBall(item, quantity = 1) return false end - - #=============================================================================== # Being given an item #=============================================================================== diff --git a/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb b/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb index 84c97e8a6..5a5ef0494 100644 --- a/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb +++ b/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb @@ -8,8 +8,9 @@ class PokemonGlobalMetadata attr_accessor :nextBattleBack end - - +#=============================================================================== +# +#=============================================================================== class Game_Temp attr_accessor :encounter_triggered attr_accessor :encounter_type @@ -61,8 +62,9 @@ class Game_Temp end end - - +#=============================================================================== +# +#=============================================================================== def setBattleRule(*args) r = nil args.each do |arg| 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 a23f263ee..a248c4ff7 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 @@ -26,7 +26,7 @@ class PokemonEncounters @chance_accumulator = 0 end - #============================================================================= + #----------------------------------------------------------------------------- # Returns whether encounters for the given encounter type have been defined # for the current map. @@ -84,7 +84,7 @@ class PokemonEncounters return false end - #============================================================================= + #----------------------------------------------------------------------------- # Returns whether the player's current location allows wild encounters to # trigger upon taking a step. @@ -262,7 +262,7 @@ class PokemonEncounters return ret end - #============================================================================= + #----------------------------------------------------------------------------- # For the current map, randomly chooses a species and level from the encounter # list for the given encounter type. Returns nil if there are none defined. @@ -375,8 +375,6 @@ class PokemonEncounters end end - - #=============================================================================== # #=============================================================================== 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 14a5d2a83..1b6dc7f41 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 @@ -1,3 +1,6 @@ +#=============================================================================== +# +#=============================================================================== class PokemonGlobalMetadata attr_accessor :roamPosition attr_accessor :roamedAlready # Whether a roamer has been encountered on current map @@ -11,8 +14,6 @@ class PokemonGlobalMetadata end end - - #=============================================================================== # Making roaming Pokémon roam around. #=============================================================================== @@ -101,8 +102,6 @@ EventHandlers.add(:on_enter_map, :move_roaming_pokemon, } ) - - #=============================================================================== # Encountering a roaming Pokémon in a wild battle. #=============================================================================== @@ -110,8 +109,9 @@ class Game_Temp attr_accessor :roamer_index_for_encounter # Index of roaming Pokémon to encounter next end - - +#=============================================================================== +# +#=============================================================================== # Returns whether the given category of encounter contains the actual encounter # method that will occur in the player's current position. def pbRoamingMethodAllowed(roamer_method) diff --git a/Data/Scripts/012_Overworld/002_Overworld_Metadata.rb b/Data/Scripts/012_Overworld/002_Overworld_Metadata.rb index a72190551..c9cc8213b 100644 --- a/Data/Scripts/012_Overworld/002_Overworld_Metadata.rb +++ b/Data/Scripts/012_Overworld/002_Overworld_Metadata.rb @@ -115,8 +115,6 @@ class PokemonGlobalMetadata end end - - #=============================================================================== # This class keeps track of erased and moved events so their position # can remain after a game is saved and loaded. This class also includes diff --git a/Data/Scripts/012_Overworld/003_Overworld_Time.rb b/Data/Scripts/012_Overworld/003_Overworld_Time.rb index f5f0ead24..9ff45f7ef 100644 --- a/Data/Scripts/012_Overworld/003_Overworld_Time.rb +++ b/Data/Scripts/012_Overworld/003_Overworld_Time.rb @@ -5,8 +5,9 @@ def pbGetTimeNow return Time.now end - - +#=============================================================================== +# +#=============================================================================== module PBDayNight HOURLY_TONES = [ Tone.new(-70, -90, 15, 55), # Night # Midnight @@ -109,8 +110,9 @@ module PBDayNight end end - - +#=============================================================================== +# +#=============================================================================== def pbDayNightTint(object) return if !$scene.is_a?(Scene_Map) if Settings::TIME_SHADING && $game_map.metadata&.outdoor_map @@ -121,85 +123,6 @@ def pbDayNightTint(object) end end - - -#=============================================================================== -# Moon phases and Zodiac -#=============================================================================== -# Calculates the phase of the moon. -# 0 - New Moon -# 1 - Waxing Crescent -# 2 - First Quarter -# 3 - Waxing Gibbous -# 4 - Full Moon -# 5 - Waning Gibbous -# 6 - Last Quarter -# 7 - Waning Crescent -def moonphase(time = nil) # in UTC - time = pbGetTimeNow if !time - transitions = [ - 1.8456618033125, - 5.5369854099375, - 9.2283090165625, - 12.9196326231875, - 16.6109562298125, - 20.3022798364375, - 23.9936034430625, - 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 > 2_299_160 - j += (((time.hour * 60) + (time.min * 60)) + time.sec) / 86_400.0 - v = (j - 2_451_550.1) / 29.530588853 - v = ((v - v.floor) + (v < 0 ? 1 : 0)) - ag = v * 29.53 - transitions.length.times do |i| - return i if ag <= transitions[i] - end - return 0 -end - -# Calculates the zodiac sign based on the given month and day: -# 0 is Aries, 11 is Pisces. Month is 1 if January, and so on. -def zodiac(month, day) - time = [ - 3, 21, 4, 19, # Aries - 4, 20, 5, 20, # Taurus - 5, 21, 6, 20, # Gemini - 6, 21, 7, 20, # Cancer - 7, 23, 8, 22, # Leo - 8, 23, 9, 22, # Virgo - 9, 23, 10, 22, # Libra - 10, 23, 11, 21, # Scorpio - 11, 22, 12, 21, # Sagittarius - 12, 22, 1, 19, # Capricorn - 1, 20, 2, 18, # Aquarius - 2, 19, 3, 20 # Pisces - ] - (time.length / 4).times do |i| - return i if month == time[i * 4] && day >= time[(i * 4) + 1] - return i if month == time[(i * 4) + 2] && day <= time[(i * 4) + 3] - end - return 0 -end - -# Returns the opposite of the given zodiac sign. -# 0 is Aries, 11 is Pisces. -def zodiacOpposite(sign) - return (sign + 6) % 12 -end - -# 0 is Aries, 11 is Pisces. -def zodiacPartners(sign) - return [(sign + 4) % 12, (sign + 8) % 12] -end - -# 0 is Aries, 11 is Pisces. -def zodiacComplements(sign) - return [(sign + 1) % 12, (sign + 11) % 12] -end - #=============================================================================== # Days of the week #=============================================================================== @@ -307,3 +230,80 @@ def pbGetSeasonName(season) _INTL("Autumn"), _INTL("Winter")][season] end + +#=============================================================================== +# Moon phases and Zodiac +#=============================================================================== +# Calculates the phase of the moon. +# 0 - New Moon +# 1 - Waxing Crescent +# 2 - First Quarter +# 3 - Waxing Gibbous +# 4 - Full Moon +# 5 - Waning Gibbous +# 6 - Last Quarter +# 7 - Waning Crescent +def moonphase(time = nil) # in UTC + time = pbGetTimeNow if !time + transitions = [ + 1.8456618033125, + 5.5369854099375, + 9.2283090165625, + 12.9196326231875, + 16.6109562298125, + 20.3022798364375, + 23.9936034430625, + 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 > 2_299_160 + j += (((time.hour * 60) + (time.min * 60)) + time.sec) / 86_400.0 + v = (j - 2_451_550.1) / 29.530588853 + v = ((v - v.floor) + (v < 0 ? 1 : 0)) + ag = v * 29.53 + transitions.length.times do |i| + return i if ag <= transitions[i] + end + return 0 +end + +# Calculates the zodiac sign based on the given month and day: +# 0 is Aries, 11 is Pisces. Month is 1 if January, and so on. +def zodiac(month, day) + time = [ + 3, 21, 4, 19, # Aries + 4, 20, 5, 20, # Taurus + 5, 21, 6, 20, # Gemini + 6, 21, 7, 20, # Cancer + 7, 23, 8, 22, # Leo + 8, 23, 9, 22, # Virgo + 9, 23, 10, 22, # Libra + 10, 23, 11, 21, # Scorpio + 11, 22, 12, 21, # Sagittarius + 12, 22, 1, 19, # Capricorn + 1, 20, 2, 18, # Aquarius + 2, 19, 3, 20 # Pisces + ] + (time.length / 4).times do |i| + return i if month == time[i * 4] && day >= time[(i * 4) + 1] + return i if month == time[(i * 4) + 2] && day <= time[(i * 4) + 3] + end + return 0 +end + +# Returns the opposite of the given zodiac sign. +# 0 is Aries, 11 is Pisces. +def zodiacOpposite(sign) + return (sign + 6) % 12 +end + +# 0 is Aries, 11 is Pisces. +def zodiacPartners(sign) + return [(sign + 4) % 12, (sign + 8) % 12] +end + +# 0 is Aries, 11 is Pisces. +def zodiacComplements(sign) + return [(sign + 1) % 12, (sign + 11) % 12] +end diff --git a/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb b/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb index 7e86aeede..55aa36be8 100644 --- a/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb +++ b/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb @@ -33,8 +33,9 @@ module HiddenMoveHandlers end end - - +#=============================================================================== +# +#=============================================================================== def pbCanUseHiddenMove?(pkmn, move, showmsg = true) return HiddenMoveHandlers.triggerCanUseMove(move, pkmn, showmsg) end @@ -62,8 +63,6 @@ def pbCheckHiddenMoveBadge(badge = -1, showmsg = true) return false end - - #=============================================================================== # Hidden move animation #=============================================================================== @@ -184,8 +183,6 @@ def pbHiddenMoveAnimation(pokemon) return true end - - #=============================================================================== # Cut #=============================================================================== @@ -247,8 +244,6 @@ def pbSmashEvent(event) $PokemonMap&.addErasedEvent(event.id) end - - #=============================================================================== # Dig #=============================================================================== @@ -294,8 +289,6 @@ HiddenMoveHandlers::UseMove.add(:DIG, proc { |move, pokemon| next false }) - - #=============================================================================== # Dive #=============================================================================== @@ -460,8 +453,6 @@ HiddenMoveHandlers::UseMove.add(:DIVE, proc { |move, pokemon| next true }) - - #=============================================================================== # Flash #=============================================================================== @@ -497,8 +488,6 @@ HiddenMoveHandlers::UseMove.add(:FLASH, proc { |move, pokemon| next true }) - - #=============================================================================== # Fly #=============================================================================== @@ -560,8 +549,6 @@ HiddenMoveHandlers::UseMove.add(:FLY, proc { |move, pkmn| next true }) - - #=============================================================================== # Headbutt #=============================================================================== @@ -626,8 +613,6 @@ HiddenMoveHandlers::UseMove.add(:HEADBUTT, proc { |move, pokemon| pbHeadbuttEffect(facingEvent) }) - - #=============================================================================== # Rock Smash #=============================================================================== @@ -678,8 +663,6 @@ HiddenMoveHandlers::UseMove.add(:ROCKSMASH, proc { |move, pokemon| next true }) - - #=============================================================================== # Strength #=============================================================================== @@ -731,8 +714,6 @@ HiddenMoveHandlers::UseMove.add(:STRENGTH, proc { |move, pokemon| next true }) - - #=============================================================================== # Surf #=============================================================================== @@ -845,8 +826,6 @@ HiddenMoveHandlers::UseMove.add(:SURF, proc { |move, pokemon| next true }) - - #=============================================================================== # Sweet Scent #=============================================================================== @@ -896,8 +875,6 @@ HiddenMoveHandlers::UseMove.add(:SWEETSCENT, proc { |move, pokemon| next true }) - - #=============================================================================== # Teleport #=============================================================================== @@ -951,8 +928,6 @@ HiddenMoveHandlers::UseMove.add(:TELEPORT, proc { |move, pokemon| next true }) - - #=============================================================================== # Waterfall #=============================================================================== diff --git a/Data/Scripts/012_Overworld/008_Overworld_RandomDungeons.rb b/Data/Scripts/012_Overworld/008_Overworld_RandomDungeons.rb index 4f3eccc67..ebd0a470a 100644 --- a/Data/Scripts/012_Overworld/008_Overworld_RandomDungeons.rb +++ b/Data/Scripts/012_Overworld/008_Overworld_RandomDungeons.rb @@ -50,7 +50,7 @@ module RandomDungeon def initialize(cw, ch, parameters) raise ArgumentError.new if cw == 0 || ch == 0 - @node_count_x = cw + @node_count_x = cw @node_count_y = ch @parameters = parameters @nodes = Array.new(@node_count_x * @node_count_y) { MazeNode.new } @@ -257,7 +257,7 @@ module RandomDungeon :upper_wall_in_1 => Console.markup_style("~", bg: :gray), :upper_wall_in_3 => Console.markup_style("~", bg: :gray), :upper_wall_in_7 => Console.markup_style("~", bg: :gray), - :upper_wall_in_9 => Console.markup_style("~", bg: :gray), + :upper_wall_in_9 => Console.markup_style("~", bg: :gray) } def initialize(width, height) @@ -352,7 +352,7 @@ module RandomDungeon @buffer_x += 1 if @buffer_x.odd? @buffer_y += 1 if @buffer_x.odd? end - @parameters = parameters || GameData::DungeonParameters.new({}) + @parameters = parameters || GameData::DungeonParameters.new({}) if @tileset.snap_to_large_grid @parameters.cell_width -= 1 if @parameters.cell_width.odd? @parameters.cell_height -= 1 if @parameters.cell_height.odd? @@ -443,7 +443,7 @@ module RandomDungeon paint_decorations(maxWidth, maxHeight) # Draw wall top tiles paint_wall_top_tiles(maxWidth, maxHeight) - break #if !@need_redraw + break # if !@need_redraw end end @@ -801,8 +801,8 @@ module RandomDungeon x += 1 if x.odd? y += 1 if y.odd? end - x = x.clamp(@buffer_x, @usable_width - @buffer_x - width ) - y = y.clamp(@buffer_y, @usable_height - @buffer_y - height ) + x = x.clamp(@buffer_x, @usable_width - @buffer_x - width) + y = y.clamp(@buffer_y, @usable_height - @buffer_y - height) paint_ground_rect(x, y, width, height, :room) end @@ -927,7 +927,7 @@ module RandomDungeon end end # 1x1 floor decoration - if @tileset.has_decoration?(:floor_decoration) + if @tileset.has_decoration?(:floor_decoration) ((@usable_width * @usable_height) / @parameters.floor_decoration_density).times do x = rand(@usable_width) y = rand(@usable_height) diff --git a/Data/Scripts/013_Items/001_Item_Utilities.rb b/Data/Scripts/013_Items/001_Item_Utilities.rb index 6bfc67e50..3448011e7 100644 --- a/Data/Scripts/013_Items/001_Item_Utilities.rb +++ b/Data/Scripts/013_Items/001_Item_Utilities.rb @@ -113,8 +113,9 @@ module ItemHandlers end end - - +#=============================================================================== +# +#=============================================================================== def pbCanRegisterItem?(item) return ItemHandlers.hasUseInFieldHandler(item) end @@ -123,8 +124,6 @@ def pbCanUseOnPokemon?(item) return ItemHandlers.hasUseOnPokemon(item) || GameData::Item.get(item).is_machine? end - - #=============================================================================== # Change a Pokémon's level #=============================================================================== diff --git a/Data/Scripts/013_Items/005_Item_PokeRadar.rb b/Data/Scripts/013_Items/005_Item_PokeRadar.rb index 37bbaed98..6ff2046fa 100644 --- a/Data/Scripts/013_Items/005_Item_PokeRadar.rb +++ b/Data/Scripts/013_Items/005_Item_PokeRadar.rb @@ -1,18 +1,20 @@ +#=============================================================================== +# +#=============================================================================== class PokemonGlobalMetadata attr_accessor :pokeradarBattery end - - +#=============================================================================== +# +#=============================================================================== class Game_Temp attr_accessor :poke_radar_data # [species, level, chain count, grasses (x,y,ring,rarity)] end - - -################################################################################ +#=============================================================================== # Using the Poke Radar -################################################################################ +#=============================================================================== def pbCanUsePokeRadar? # Can't use Radar if not in tall grass terrain = $game_map.terrain_tag($game_player.x, $game_player.y) @@ -146,9 +148,9 @@ def pbPokeRadarGetEncounter(rarity = 0) return $PokemonEncounters.choose_wild_pokemon($PokemonEncounters.encounter_type, rarity + 1) end -################################################################################ +#=============================================================================== # Event handlers -################################################################################ +#=============================================================================== EventHandlers.add(:on_wild_species_chosen, :poke_radar_chain, proc { |encounter| if GameData::EncounterType.get($game_temp.encounter_type).type != :land || @@ -246,9 +248,9 @@ EventHandlers.add(:on_enter_map, :cancel_poke_radar, } ) -################################################################################ +#=============================================================================== # Item handlers -################################################################################ +#=============================================================================== ItemHandlers::UseInField.add(:POKERADAR, proc { |item| next pbUsePokeRadar }) diff --git a/Data/Scripts/013_Items/006_Item_Mail.rb b/Data/Scripts/013_Items/006_Item_Mail.rb index 2daafa70b..58622f4cb 100644 --- a/Data/Scripts/013_Items/006_Item_Mail.rb +++ b/Data/Scripts/013_Items/006_Item_Mail.rb @@ -1,4 +1,6 @@ +#=============================================================================== # Data structure representing mail that the Pokémon can hold +#=============================================================================== class Mail attr_accessor :item, :message, :sender, :poke1, :poke2, :poke3 @@ -12,8 +14,9 @@ class Mail end end - - +#=============================================================================== +# +#=============================================================================== def pbMoveToMailbox(pokemon) $PokemonGlobal.mailbox = [] if !$PokemonGlobal.mailbox return false if $PokemonGlobal.mailbox.length >= 10 diff --git a/Data/Scripts/013_Items/007_Item_Sprites.rb b/Data/Scripts/013_Items/007_Item_Sprites.rb index cd040e304..cc93a64ff 100644 --- a/Data/Scripts/013_Items/007_Item_Sprites.rb +++ b/Data/Scripts/013_Items/007_Item_Sprites.rb @@ -110,8 +110,6 @@ class ItemIconSprite < Sprite end end - - #=============================================================================== # Item held icon (used in the party screen) #=============================================================================== diff --git a/Data/Scripts/013_Items/008_PokemonBag.rb b/Data/Scripts/013_Items/008_PokemonBag.rb index aa00492a9..48bb14e44 100644 --- a/Data/Scripts/013_Items/008_PokemonBag.rb +++ b/Data/Scripts/013_Items/008_PokemonBag.rb @@ -16,15 +16,15 @@ class PokemonBag end def initialize - @pockets = [] + @pockets = [] (0..PokemonBag.pocket_count).each { |i| @pockets[i] = [] } reset_last_selections - @registered_items = [] + @registered_items = [] @ready_menu_selection = [0, 0, 1] # Used by the Ready Menu to remember cursor positions end def reset_last_selections - @last_viewed_pocket = 1 + @last_viewed_pocket = 1 @last_pocket_selections ||= [] (0..PokemonBag.pocket_count).each { |i| @last_pocket_selections[i] = 0 } end @@ -39,7 +39,7 @@ class PokemonBag return @pockets end - #============================================================================= + #----------------------------------------------------------------------------- # Gets the index of the current selected item in the pocket def last_viewed_index(pocket) @@ -59,7 +59,7 @@ class PokemonBag @last_pocket_selections[pocket] = value if value <= @pockets[pocket].length end - #============================================================================= + #----------------------------------------------------------------------------- def quantity(item) item_data = GameData::Item.try_get(item) @@ -139,7 +139,7 @@ class PokemonBag return ret end - #============================================================================= + #----------------------------------------------------------------------------- # Returns whether item has been registered for quick access in the Ready Menu. def registered?(item) @@ -161,7 +161,7 @@ class PokemonBag @registered_items.delete(item_data.id) if item_data end - #============================================================================= + #----------------------------------------------------------------------------- private @@ -193,8 +193,6 @@ class PokemonBag end end - - #=============================================================================== # The PC item storage object, which actually contains all the items #=============================================================================== @@ -260,8 +258,6 @@ class PCItemStorage end end - - #=============================================================================== # Implements methods that act on arrays of items. Each element in an item # array is itself an array of [itemID, itemCount]. @@ -333,8 +329,6 @@ module ItemStorageHelper end end - - #=============================================================================== # Deprecated methods #=============================================================================== diff --git a/Data/Scripts/014_Pokemon/001_Pokemon-related/001_FormHandlers.rb b/Data/Scripts/014_Pokemon/001_Pokemon-related/001_FormHandlers.rb index c33c7d715..6ded890f4 100644 --- a/Data/Scripts/014_Pokemon/001_Pokemon-related/001_FormHandlers.rb +++ b/Data/Scripts/014_Pokemon/001_Pokemon-related/001_FormHandlers.rb @@ -1,3 +1,6 @@ +#=============================================================================== +# +#=============================================================================== module MultipleForms @@formSpecies = SpeciesHandlerHash.new @@ -32,8 +35,9 @@ module MultipleForms end end - - +#=============================================================================== +# +#=============================================================================== def drawSpot(bitmap, spotpattern, x, y, red, green, blue) height = spotpattern.length width = spotpattern[0].length @@ -723,7 +727,6 @@ MultipleForms.register(:CALYREX, { } }) - #=============================================================================== # Regional forms # This code is for determining the form of a Pokémon in an egg created at the diff --git a/Data/Scripts/014_Pokemon/001_Pokemon-related/002_ShadowPokemon_Other.rb b/Data/Scripts/014_Pokemon/001_Pokemon-related/002_ShadowPokemon_Other.rb index 86a96c480..d5abc64d0 100644 --- a/Data/Scripts/014_Pokemon/001_Pokemon-related/002_ShadowPokemon_Other.rb +++ b/Data/Scripts/014_Pokemon/001_Pokemon-related/002_ShadowPokemon_Other.rb @@ -59,8 +59,6 @@ def pbPurify(pkmn, scene) end end - - #=============================================================================== # Relic Stone scene. #=============================================================================== @@ -105,8 +103,9 @@ class RelicStoneScene end end - - +#=============================================================================== +# +#=============================================================================== class RelicStoneScreen def initialize(scene) @scene = scene @@ -132,8 +131,9 @@ class RelicStoneScreen end end - - +#=============================================================================== +# +#=============================================================================== def pbRelicStoneScreen(pkmn) retval = true pbFadeOutIn { @@ -144,8 +144,6 @@ def pbRelicStoneScreen(pkmn) return retval end - - #=============================================================================== # #=============================================================================== @@ -164,8 +162,6 @@ def pbRelicStone end end - - #=============================================================================== # Shadow Pokémon in battle. #=============================================================================== @@ -184,8 +180,9 @@ class Battle end end - - +#=============================================================================== +# +#=============================================================================== class Battle::Battler alias __shadow__pbInitPokemon pbInitPokemon unless method_defined?(:__shadow__pbInitPokemon) @@ -228,8 +225,6 @@ class Battle::Battler end end - - #=============================================================================== # Shadow item effects. #=============================================================================== @@ -333,8 +328,6 @@ ItemHandlers::BattleUseOnPokemon.add(:VIVIDSCENT, proc { |item, pokemon, battler next true }) - - #=============================================================================== # Two turn attack. On first turn, halves the HP of all active Pokémon. # Skips second turn (if successful). (Shadow Half) @@ -359,8 +352,6 @@ class Battle::Move::AllBattlersLoseHalfHPUserSkipsNextTurn < Battle::Move end end - - #=============================================================================== # User takes recoil damage equal to 1/2 of its current HP. (Shadow End) #=============================================================================== @@ -380,8 +371,6 @@ class Battle::Move::UserLosesHalfHP < Battle::Move::RecoilMove end end - - #=============================================================================== # Starts shadow weather. (Shadow Sky) #=============================================================================== @@ -392,8 +381,6 @@ class Battle::Move::StartShadowSkyWeather < Battle::Move::WeatherMove end end - - #=============================================================================== # Ends the effects of Light Screen, Reflect and Safeguard on both sides. # (Shadow Shed) @@ -410,8 +397,6 @@ class Battle::Move::RemoveAllScreens < Battle::Move end end - - #=============================================================================== # #=============================================================================== @@ -419,8 +404,9 @@ class Game_Temp attr_accessor :party_heart_gauges_before_battle end - - +#=============================================================================== +# +#=============================================================================== # Record current heart gauges of Pokémon in party, to see if they drop to zero # during battle and need to say they're ready to be purified afterwards EventHandlers.add(:on_start_battle, :record_party_heart_gauges, diff --git a/Data/Scripts/014_Pokemon/001_Pokemon-related/003_Pokemon_Sprites.rb b/Data/Scripts/014_Pokemon/001_Pokemon-related/003_Pokemon_Sprites.rb index e498b4520..92ef5a813 100644 --- a/Data/Scripts/014_Pokemon/001_Pokemon-related/003_Pokemon_Sprites.rb +++ b/Data/Scripts/014_Pokemon/001_Pokemon-related/003_Pokemon_Sprites.rb @@ -77,8 +77,6 @@ class PokemonSprite < Sprite end end - - #=============================================================================== # Pokémon icon (for defined Pokémon) #=============================================================================== @@ -212,8 +210,6 @@ class PokemonIconSprite < Sprite end end - - #=============================================================================== # Pokémon icon (for species) #=============================================================================== 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 4dc0c1a73..9f05b6f8a 100644 --- a/Data/Scripts/014_Pokemon/001_Pokemon-related/004_PokemonStorage.rb +++ b/Data/Scripts/014_Pokemon/001_Pokemon-related/004_PokemonStorage.rb @@ -1,3 +1,6 @@ +#=============================================================================== +# +#=============================================================================== class PokemonBox attr_reader :pokemon attr_accessor :name @@ -49,8 +52,9 @@ class PokemonBox end end - - +#=============================================================================== +# +#=============================================================================== class PokemonStorage attr_reader :boxes attr_accessor :currentBox @@ -259,8 +263,6 @@ class PokemonStorage end end - - #=============================================================================== # Regional Storage scripts #=============================================================================== @@ -369,8 +371,6 @@ class RegionalStorage end end - - #=============================================================================== # #=============================================================================== diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/001_UI_SplashesAndTitleScreen.rb b/Data/Scripts/016_UI/001_Non-interactive UI/001_UI_SplashesAndTitleScreen.rb index a91d47738..a68a783d8 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/001_UI_SplashesAndTitleScreen.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/001_UI_SplashesAndTitleScreen.rb @@ -1,3 +1,6 @@ +#=============================================================================== +# +#=============================================================================== class IntroEventScene < EventScene # Splash screen images that appear for a few seconds and then disappear. SPLASH_IMAGES = ["splash1", "splash2"] @@ -114,8 +117,9 @@ class IntroEventScene < EventScene end end - - +#=============================================================================== +# +#=============================================================================== class Scene_Intro def main Graphics.transition(0) diff --git a/Data/Scripts/016_UI/001_UI_PauseMenu.rb b/Data/Scripts/016_UI/001_UI_PauseMenu.rb index b4b6d0af7..c5a530a0b 100644 --- a/Data/Scripts/016_UI/001_UI_PauseMenu.rb +++ b/Data/Scripts/016_UI/001_UI_PauseMenu.rb @@ -254,8 +254,9 @@ MenuHandlers.add(:pause_menu, :trainer_card, { MenuHandlers.add(:pause_menu, :save, { "name" => _INTL("Save"), "order" => 60, - "condition" => proc { next $game_system && !$game_system.save_disabled && - !pbInSafari? && !pbInBugContest? }, + "condition" => proc { + next $game_system && !$game_system.save_disabled && !pbInSafari? && !pbInBugContest? + }, "effect" => proc { |menu| menu.pbHideMenu scene = PokemonSave_Scene.new diff --git a/Data/Scripts/016_UI/010_UI_Phone.rb b/Data/Scripts/016_UI/010_UI_Phone.rb index a229361a8..0cafb4783 100644 --- a/Data/Scripts/016_UI/010_UI_Phone.rb +++ b/Data/Scripts/016_UI/010_UI_Phone.rb @@ -223,7 +223,7 @@ class PokemonPhoneScreen commands.push(_INTL("Sort Contacts")) commands.push(_INTL("Cancel")) cmd = pbShowCommands(nil, commands, -1) - cmd += 1 if cmd >=1 && !contact.can_hide? + cmd += 1 if cmd >= 1 && !contact.can_hide? case cmd when 0 # Call Phone::Call.make_outgoing(contact) diff --git a/Data/Scripts/016_UI/015_UI_Options.rb b/Data/Scripts/016_UI/015_UI_Options.rb index 21bb52188..bb15862c4 100644 --- a/Data/Scripts/016_UI/015_UI_Options.rb +++ b/Data/Scripts/016_UI/015_UI_Options.rb @@ -298,7 +298,7 @@ class PokemonOption_Scene @sprites["option"].viewport = @viewport @sprites["option"].visible = true # Get the values of each option - @options.length.times { |i| @sprites["option"].setValueNoRefresh(i, @options[i].get || 0) } + @options.length.times { |i| @sprites["option"].setValueNoRefresh(i, @options[i].get || 0) } @sprites["option"].refresh pbChangeSelection pbDeactivateWindows(@sprites) diff --git a/Data/Scripts/016_UI/021_BattlePointShop.rb b/Data/Scripts/016_UI/021_UI_BattlePointShop.rb similarity index 99% rename from Data/Scripts/016_UI/021_BattlePointShop.rb rename to Data/Scripts/016_UI/021_UI_BattlePointShop.rb index aa4ac1860..64d90e26c 100644 --- a/Data/Scripts/016_UI/021_BattlePointShop.rb +++ b/Data/Scripts/016_UI/021_UI_BattlePointShop.rb @@ -165,7 +165,7 @@ class BattlePointShop_Scene @sprites["background"] = IconSprite.new(0, 0, @viewport) @sprites["background"].setBitmap("Graphics/Pictures/martScreen") @sprites["icon"] = ItemIconSprite.new(36, Graphics.height - 50, nil, @viewport) - winAdapter = BattlePointShopAdapter.new() + winAdapter = BattlePointShopAdapter.new @sprites["itemwindow"] = Window_BattlePointShop.new( stock, winAdapter, Graphics.width - 316 - 16, 10, 330 + 16, Graphics.height - 124 ) diff --git a/Data/Scripts/016_UI/023_UI_PurifyChamber.rb b/Data/Scripts/016_UI/023_UI_PurifyChamber.rb index ff77fb2f7..23cf8ad20 100644 --- a/Data/Scripts/016_UI/023_UI_PurifyChamber.rb +++ b/Data/Scripts/016_UI/023_UI_PurifyChamber.rb @@ -958,7 +958,7 @@ class PurifyChamberSetView < Sprite type_string += GameData::Type.get(type).name end textpos.push([_INTL("{1} Lv.{2} {3}", pkmn.name, pkmn.level, type_string), - 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)]) textpos.push([_INTL("FLOW"), 2 + (@info.bitmap.width / 2), 30, 0, Color.new(248, 248, 248), Color.new(128, 128, 128)]) # draw heart gauge diff --git a/Data/Scripts/016_UI/025_UI_TextEntry.rb b/Data/Scripts/016_UI/025_UI_TextEntry.rb index 16a404a79..227c150f2 100644 --- a/Data/Scripts/016_UI/025_UI_TextEntry.rb +++ b/Data/Scripts/016_UI/025_UI_TextEntry.rb @@ -64,8 +64,6 @@ class Window_CharacterEntry < Window_DrawableCommand end end - - #=============================================================================== # Text entry screen - free typing. #=============================================================================== @@ -256,8 +254,6 @@ class PokemonEntryScene end end - - #=============================================================================== # Text entry screen - arrows to select letter. #=============================================================================== @@ -372,8 +368,6 @@ class PokemonEntryScene2 end end - - def pbStartScene(helptext, minlength, maxlength, initialText, subject = 0, pokemon = nil) @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport.z = 99999 @@ -751,8 +745,6 @@ class PokemonEntryScene2 end end - - #=============================================================================== # #=============================================================================== @@ -769,8 +761,6 @@ class PokemonEntry end end - - #=============================================================================== # #=============================================================================== diff --git a/Data/Scripts/017_Minigames/002_Minigame_TripleTriad.rb b/Data/Scripts/017_Minigames/002_Minigame_TripleTriad.rb index 7aeda0940..45a5fdb83 100644 --- a/Data/Scripts/017_Minigames/002_Minigame_TripleTriad.rb +++ b/Data/Scripts/017_Minigames/002_Minigame_TripleTriad.rb @@ -133,8 +133,6 @@ class TriadCard end end - - #=============================================================================== # Duel screen visuals #=============================================================================== @@ -160,9 +158,9 @@ class TriadSquare end end - - +#=============================================================================== # Scene class for handling appearance of the screen +#=============================================================================== class TriadScene def pbStartScene(battle) @sprites = {} @@ -589,8 +587,6 @@ class TriadScene end end - - #=============================================================================== # Duel screen logic #=============================================================================== @@ -965,8 +961,6 @@ class TriadScreen end end - - #=============================================================================== # Start duel #=============================================================================== @@ -985,8 +979,6 @@ def pbTriadDuel(name, minLevel, maxLevel, rules = nil, oppdeck = nil, prize = ni return ret end - - #=============================================================================== # Card storage #=============================================================================== @@ -1001,8 +993,9 @@ class PokemonGlobalMetadata end end - - +#=============================================================================== +# +#=============================================================================== class TriadStorage attr_reader :items @@ -1066,8 +1059,6 @@ class TriadStorage end end - - #=============================================================================== # Card shop screen #=============================================================================== diff --git a/Data/Scripts/017_Minigames/003_Minigame_SlotMachine.rb b/Data/Scripts/017_Minigames/003_Minigame_SlotMachine.rb index 27cb99894..12bba4ec9 100644 --- a/Data/Scripts/017_Minigames/003_Minigame_SlotMachine.rb +++ b/Data/Scripts/017_Minigames/003_Minigame_SlotMachine.rb @@ -1,10 +1,10 @@ -################################################################################ +#=============================================================================== # "Slot Machine" mini-game # By Maruno #------------------------------------------------------------------------------- # Run with: pbSlotMachine(1) # - The number is either 0 (easy), 1 (default) or 2 (hard). -################################################################################ +#=============================================================================== class SlotMachineReel < BitmapSprite attr_accessor :reel attr_accessor :toppos @@ -79,8 +79,9 @@ class SlotMachineReel < BitmapSprite end end - - +#=============================================================================== +# +#=============================================================================== class SlotMachineScore < BitmapSprite attr_reader :score @@ -107,8 +108,9 @@ class SlotMachineScore < BitmapSprite end end - - +#=============================================================================== +# +#=============================================================================== class SlotMachineScene attr_accessor :gameRunning attr_accessor :gameEnd @@ -376,8 +378,9 @@ class SlotMachineScene end end - - +#=============================================================================== +# +#=============================================================================== class SlotMachine def initialize(scene) @scene = scene @@ -390,8 +393,9 @@ class SlotMachine end end - - +#=============================================================================== +# +#=============================================================================== def pbSlotMachine(difficulty = 1) if !$bag.has?(:COINCASE) pbMessage(_INTL("It's a Slot Machine.")) diff --git a/Data/Scripts/017_Minigames/004_Minigame_VoltorbFlip.rb b/Data/Scripts/017_Minigames/004_Minigame_VoltorbFlip.rb index bc97d61a5..c4560e80c 100644 --- a/Data/Scripts/017_Minigames/004_Minigame_VoltorbFlip.rb +++ b/Data/Scripts/017_Minigames/004_Minigame_VoltorbFlip.rb @@ -580,8 +580,9 @@ class VoltorbFlip end end - - +#=============================================================================== +# +#=============================================================================== class VoltorbFlipScreen def initialize(scene) @scene = scene @@ -594,8 +595,9 @@ class VoltorbFlipScreen end end - - +#=============================================================================== +# +#=============================================================================== def pbVoltorbFlip if !$bag.has?(:COINCASE) pbMessage(_INTL("You can't play unless you have a Coin Case.")) diff --git a/Data/Scripts/017_Minigames/006_Minigame_Mining.rb b/Data/Scripts/017_Minigames/006_Minigame_Mining.rb index 9f86c925b..cde5b3350 100644 --- a/Data/Scripts/017_Minigames/006_Minigame_Mining.rb +++ b/Data/Scripts/017_Minigames/006_Minigame_Mining.rb @@ -1,9 +1,9 @@ -################################################################################ +#=============================================================================== # "Mining" mini-game # By Maruno #------------------------------------------------------------------------------- # Run with: pbMiningGame -################################################################################ +#=============================================================================== class MiningGameCounter < BitmapSprite attr_accessor :hits @@ -32,8 +32,9 @@ class MiningGameCounter < BitmapSprite end end - - +#=============================================================================== +# +#=============================================================================== class MiningGameTile < BitmapSprite attr_reader :layer @@ -70,8 +71,9 @@ class MiningGameTile < BitmapSprite end end - - +#=============================================================================== +# +#=============================================================================== class MiningGameCursor < BitmapSprite attr_accessor :mode attr_accessor :position @@ -138,8 +140,9 @@ class MiningGameCursor < BitmapSprite end end - - +#=============================================================================== +# +#=============================================================================== class MiningGameScene BOARD_WIDTH = 13 BOARD_HEIGHT = 10 @@ -606,8 +609,9 @@ class MiningGameScene end end - - +#=============================================================================== +# +#=============================================================================== class MiningGame def initialize(scene) @scene = scene @@ -620,8 +624,9 @@ class MiningGame end end - - +#=============================================================================== +# +#=============================================================================== def pbMiningGame pbFadeOutIn { scene = MiningGameScene.new diff --git a/Data/Scripts/017_Minigames/007_Minigame_TilePuzzles.rb b/Data/Scripts/017_Minigames/007_Minigame_TilePuzzles.rb index 01efc392e..41fc9f203 100644 --- a/Data/Scripts/017_Minigames/007_Minigame_TilePuzzles.rb +++ b/Data/Scripts/017_Minigames/007_Minigame_TilePuzzles.rb @@ -1,4 +1,4 @@ -################################################################################ +#=============================================================================== # "Tile Puzzle" mini-games # By Maruno # Graphics by the__end @@ -14,7 +14,7 @@ # board = The name/number of the graphics to be used. # width,height = Optional, the number of tiles wide/high the puzzle is (0 for # the default value of 4). -################################################################################ +#=============================================================================== class TilePuzzleCursor < BitmapSprite attr_accessor :game attr_accessor :position @@ -83,8 +83,9 @@ class TilePuzzleCursor < BitmapSprite end end - - +#=============================================================================== +# +#=============================================================================== class TilePuzzleScene def initialize(game, board, width, height) @game = game @@ -563,8 +564,9 @@ class TilePuzzleScene end end - - +#=============================================================================== +# +#=============================================================================== class TilePuzzle def initialize(scene) @scene = scene @@ -578,8 +580,9 @@ class TilePuzzle end end - - +#=============================================================================== +# +#=============================================================================== def pbTilePuzzle(game, board, width = 0, height = 0) ret = false pbFadeOutIn { diff --git a/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/005_UI_BattleSwap.rb b/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/005_UI_BattleSwap.rb index abbe25d0e..de4b14977 100644 --- a/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/005_UI_BattleSwap.rb +++ b/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/005_UI_BattleSwap.rb @@ -1,3 +1,6 @@ +#=============================================================================== +# +#=============================================================================== class BattleSwapScene def pbStartRentScene(rentals) @rentals = rentals @@ -150,8 +153,9 @@ class BattleSwapScene end end - - +#=============================================================================== +# +#=============================================================================== class BattleSwapScreen def initialize(scene) @scene = scene 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 cb5e42f35..4ecd0f956 100644 --- a/Data/Scripts/020_Debug/001_Editor screens/001_EditorScreens.rb +++ b/Data/Scripts/020_Debug/001_Editor screens/001_EditorScreens.rb @@ -339,8 +339,6 @@ def pbEncounterTypeEditor(enc_data, enc_type) Input.update end - - #=============================================================================== # Trainer type editor #=============================================================================== @@ -444,8 +442,6 @@ def pbTrainerTypeEditorNew(default_name) return id.to_sym end - - #=============================================================================== # Individual trainer editor #=============================================================================== @@ -476,8 +472,9 @@ module TrainerBattleProperty end end - - +#=============================================================================== +# +#=============================================================================== def pbTrainerBattleEditor modified = false pbListScreenBlock(_INTL("Trainer Battles"), TrainerBattleLister.new(0, true)) { |button, trainer_id| @@ -601,14 +598,12 @@ def pbTrainerBattleEditor end end - - #=============================================================================== # Trainer Pokémon editor #=============================================================================== 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], @@ -691,8 +686,6 @@ module TrainerPokemonProperty end end - - #=============================================================================== # Metadata editor #=============================================================================== @@ -747,7 +740,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 @@ -780,8 +773,6 @@ def pbEditPlayerMetadata(player_id = 1) end end - - #=============================================================================== # Map metadata editor #=============================================================================== @@ -798,7 +789,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| val = metadata.get_property_for_PBS(property[0]) @@ -825,8 +816,6 @@ def pbEditMapMetadata(map_id) end end - - #=============================================================================== # Item editor #=============================================================================== @@ -931,8 +920,6 @@ def pbItemEditorNew(default_name) pbMessage(_INTL("Put the item's graphic ({1}.png) in Graphics/Items, or it will be blank.", id.to_s)) end - - #=============================================================================== # Pokémon species editor #=============================================================================== @@ -999,8 +986,6 @@ def pbPokemonEditor } end - - #=============================================================================== # Regional Dexes editor #=============================================================================== @@ -1261,8 +1246,6 @@ def pbEvoFamiliesToStrings return ret end - - #=============================================================================== # Battle animations rearranger #=============================================================================== diff --git a/Data/Scripts/020_Debug/001_Editor_Utilities.rb b/Data/Scripts/020_Debug/001_Editor_Utilities.rb index 969735787..6a1c44dab 100644 --- a/Data/Scripts/020_Debug/001_Editor_Utilities.rb +++ b/Data/Scripts/020_Debug/001_Editor_Utilities.rb @@ -1,3 +1,6 @@ +#=============================================================================== +# +#=============================================================================== def pbGetLegalMoves(species) species_data = GameData::Species.get(species) moves = [] @@ -125,7 +128,6 @@ def pbChooseFromGameDataList(game_data, default = nil) return pbChooseList(commands, default, nil, -1) end - # Displays a list of all Pokémon species, and returns the ID of the species # selected (or nil if the selection was canceled). "default", if specified, is # the ID of the species to initially select. Pressing Input::ACTION will toggle @@ -239,8 +241,6 @@ def pbChooseBallList(defaultMoveID = nil) return (ret >= 0) ? commands[ret][0] : defaultMoveID end - - #=============================================================================== # General list methods #=============================================================================== 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 f0905e8ea..10499653d 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 @@ -1,6 +1,6 @@ -################################################################################ +#=============================================================================== # Controls -################################################################################ +#=============================================================================== class Window_Menu < Window_CommandPokemon def initialize(commands, x, y) tempbitmap = Bitmap.new(32, 32) @@ -40,11 +40,9 @@ class Window_Menu < Window_CommandPokemon end end - - -################################################################################ +#=============================================================================== # Clipboard -################################################################################ +#=============================================================================== module Clipboard @data = nil @typekey = "" @@ -64,11 +62,9 @@ module Clipboard end end - - -################################################################################ +#=============================================================================== # Collision testing -################################################################################ +#=============================================================================== class Rect < Object def contains(x, y) return x >= self.x && x < self.x + self.width && @@ -76,8 +72,9 @@ class Rect < Object end end - - +#=============================================================================== +# +#=============================================================================== def pbSpriteHitTest(sprite, x, y, usealpha = true, wholecanvas = false) return false if !sprite || sprite.disposed? return false if !sprite.bitmap @@ -158,11 +155,9 @@ def pbTrackPopupMenu(commands) return -1 end - - -################################################################################ +#=============================================================================== # Sprite sheet scrolling bar -################################################################################ +#=============================================================================== class AnimationWindow < Sprite attr_reader :animbitmap attr_reader :start @@ -298,8 +293,9 @@ class AnimationWindow < Sprite end end - - +#=============================================================================== +# +#=============================================================================== class CanvasAnimationWindow < AnimationWindow def animbitmap return @canvas.animbitmap @@ -311,33 +307,31 @@ class CanvasAnimationWindow < AnimationWindow end end - - -################################################################################ +#=============================================================================== # Cel sprite -################################################################################ +#=============================================================================== class InvalidatableSprite < Sprite def initialize(viewport = nil) super(viewport) @invalid = false end -# Marks that the control must be redrawn to reflect current logic. + # Marks that the control must be redrawn to reflect current logic. def invalidate @invalid = true end -# Determines whether the control is invalid + # Determines whether the control is invalid def invalid? return @invalid end -# Marks that the control is valid. Normally called only by repaint. + # Marks that the control is valid. Normally called only by repaint. def validate @invalid = false end -# Redraws the sprite only if it is invalid, and then revalidates the sprite + # Redraws the sprite only if it is invalid, and then revalidates the sprite def repaint if self.invalid? refresh @@ -345,14 +339,15 @@ class InvalidatableSprite < Sprite end end - # Redraws the sprite. This method should not check whether - # the sprite is invalid, to allow it to be explicitly called. + # Redraws the sprite. This method should not check whether + # the sprite is invalid, to allow it to be explicitly called. def refresh end end - - +#=============================================================================== +# +#=============================================================================== class SpriteFrame < InvalidatableSprite attr_reader :id attr_reader :locked @@ -419,11 +414,9 @@ class SpriteFrame < InvalidatableSprite end end - - -################################################################################ +#=============================================================================== # Canvas -################################################################################ +#=============================================================================== class AnimationCanvas < Sprite attr_reader :viewport attr_reader :sprites @@ -947,11 +940,9 @@ class AnimationCanvas < Sprite end end - - -################################################################################ +#=============================================================================== # Window classes -################################################################################ +#=============================================================================== class BitmapDisplayWindow < SpriteWindow_Base attr_reader :bitmapname attr_reader :hue @@ -1001,8 +992,9 @@ class BitmapDisplayWindow < SpriteWindow_Base end end - - +#=============================================================================== +# +#=============================================================================== class AnimationNameWindow def initialize(canvas, x, y, width, height, viewport = nil) @canvas = canvas 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 598920fab..800edff09 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 @@ -1,3 +1,6 @@ +#=============================================================================== +# +#=============================================================================== module ShadowText def shadowtext(bitmap, x, y, w, h, t, disabled = false, align = 0) width = bitmap.text_size(t).width @@ -13,8 +16,9 @@ module ShadowText end end - - +#=============================================================================== +# +#=============================================================================== class UIControl include ShadowText attr_accessor :bitmap @@ -90,8 +94,9 @@ class UIControl end end - - +#=============================================================================== +# +#=============================================================================== class Label < UIControl def text=(value) self.label = value @@ -106,8 +111,9 @@ class Label < UIControl end end - - +#=============================================================================== +# +#=============================================================================== class Button < UIControl attr_accessor :label @@ -155,8 +161,9 @@ class Button < UIControl end end - - +#=============================================================================== +# +#=============================================================================== class Checkbox < Button attr_reader :checked @@ -210,8 +217,9 @@ class Checkbox < Button end end - - +#=============================================================================== +# +#=============================================================================== class TextField < UIControl attr_accessor :label attr_reader :text @@ -340,8 +348,9 @@ class TextField < UIControl end end - - +#=============================================================================== +# +#=============================================================================== class Slider < UIControl attr_reader :minvalue attr_reader :maxvalue @@ -453,8 +462,9 @@ class Slider < UIControl end end - - +#=============================================================================== +# +#=============================================================================== class OptionalSlider < Slider def initialize(label, minvalue, maxvalue, curvalue) @slider = Slider.new(label, minvalue, maxvalue, curvalue) @@ -543,8 +553,9 @@ class OptionalSlider < Slider end end - - +#=============================================================================== +# +#=============================================================================== class ArrayCountSlider < Slider def maxvalue return @array.length - 1 @@ -556,8 +567,9 @@ class ArrayCountSlider < Slider end end - - +#=============================================================================== +# +#=============================================================================== class FrameCountSlider < Slider def maxvalue return @canvas.animation.length @@ -569,8 +581,9 @@ class FrameCountSlider < Slider end end - - +#=============================================================================== +# +#=============================================================================== class FrameCountButton < Button def label return _INTL("Total Frames: {1}", @canvas.animation.length) @@ -582,8 +595,9 @@ class FrameCountButton < Button end end - - +#=============================================================================== +# +#=============================================================================== class TextSlider < UIControl attr_reader :minvalue attr_reader :maxvalue @@ -701,8 +715,9 @@ class TextSlider < UIControl end end - - +#=============================================================================== +# +#=============================================================================== class OptionalTextSlider < TextSlider def initialize(label, options, curval) @slider = TextSlider.new(label, options, curval) @@ -791,7 +806,9 @@ class OptionalTextSlider < TextSlider end end - +#=============================================================================== +# +#=============================================================================== class ControlWindow < SpriteWindow_Base attr_reader :controls 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 321b6516c..1d9fd40b9 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 @@ -1,6 +1,6 @@ -################################################################################ +#=============================================================================== # Paths and interpolation -################################################################################ +#=============================================================================== class ControlPointSprite < Sprite attr_accessor :dragging @@ -48,8 +48,9 @@ class ControlPointSprite < Sprite end end - - +#=============================================================================== +# +#=============================================================================== class PointSprite < Sprite def initialize(x, y, viewport = nil) super(viewport) @@ -65,8 +66,9 @@ class PointSprite < Sprite end end - - +#=============================================================================== +# +#=============================================================================== class PointPath include Enumerable @@ -180,8 +182,9 @@ class PointPath end end - - +#=============================================================================== +# +#=============================================================================== def catmullRom(p1, p2, p3, p4, t) # p1=prevPoint, p2=startPoint, p3=endPoint, p4=nextPoint, t is from 0 through 1 t2 = t * t 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 70bf6d323..ffdfde73b 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 @@ -1,6 +1,6 @@ -################################################################################ +#=============================================================================== # Mini battle scene -################################################################################ +#=============================================================================== class MiniBattler attr_accessor :index attr_accessor :pokemon @@ -8,8 +8,9 @@ class MiniBattler def initialize(index); self.index = index; end end - - +#=============================================================================== +# +#=============================================================================== class MiniBattle attr_accessor :battlers @@ -19,11 +20,9 @@ class MiniBattle end end - - -################################################################################ +#=============================================================================== # Pop-up menus for buttons in bottom menu -################################################################################ +#=============================================================================== def pbSelectAnim(canvas, animwin) animfiles = [] pbRgssChdir(File.join("Graphics", "Animations")) { @@ -182,9 +181,9 @@ def pbAnimList(animations, canvas, animwin) cmdwin.dispose end -################################################################################ +#=============================================================================== # Pop-up menus for individual cels -################################################################################ +#=============================================================================== def pbChooseNum(cel) ret = cel sliderwin2 = ControlWindow.new(0, 0, 320, 32 * 5) @@ -370,9 +369,9 @@ def pbCellProperties(canvas) return end -################################################################################ +#=============================================================================== # Pop-up menus for buttons in right hand menu -################################################################################ +#=============================================================================== def pbTimingList(canvas) commands = [] cmdNewSound = -1 @@ -957,9 +956,9 @@ def pbAnimEditorHelpWindow cmdwin.dispose end -################################################################################ +#=============================================================================== # Main -################################################################################ +#=============================================================================== def animationEditorMain(animation) viewport = Viewport.new(0, 0, Settings::SCREEN_WIDTH + 288, Settings::SCREEN_HEIGHT + 288) viewport.z = 99999 @@ -1172,9 +1171,9 @@ def animationEditorMain(animation) RPG::Cache.clear end -################################################################################ +#=============================================================================== # Start -################################################################################ +#=============================================================================== def pbAnimationEditor pbBGMStop animation = pbLoadBattleAnimations diff --git a/Data/Scripts/020_Debug/002_Editor_DataTypes.rb b/Data/Scripts/020_Debug/002_Editor_DataTypes.rb index b28203f69..dac8ce166 100644 --- a/Data/Scripts/020_Debug/002_Editor_DataTypes.rb +++ b/Data/Scripts/020_Debug/002_Editor_DataTypes.rb @@ -12,8 +12,9 @@ module UndefinedProperty end end - - +#=============================================================================== +# +#=============================================================================== module ReadOnlyProperty def self.set(_settingname, oldsetting) pbMessage(_INTL("This property cannot be edited.")) @@ -25,8 +26,9 @@ module ReadOnlyProperty end end - - +#=============================================================================== +# +#=============================================================================== class UIntProperty def initialize(maxdigits) @maxdigits = maxdigits @@ -48,8 +50,9 @@ class UIntProperty end end - - +#=============================================================================== +# +#=============================================================================== class LimitProperty def initialize(maxvalue) @maxvalue = maxvalue @@ -72,8 +75,9 @@ class LimitProperty end end - - +#=============================================================================== +# +#=============================================================================== class LimitProperty2 def initialize(maxvalue) @maxvalue = maxvalue @@ -98,8 +102,9 @@ class LimitProperty2 end end - - +#=============================================================================== +# +#=============================================================================== class NonzeroLimitProperty def initialize(maxvalue) @maxvalue = maxvalue @@ -122,8 +127,9 @@ class NonzeroLimitProperty end end - - +#=============================================================================== +# +#=============================================================================== module BooleanProperty def self.set(settingname, _oldsetting) return pbConfirmMessage(_INTL("Enable the setting {1}?", settingname)) ? true : false @@ -134,8 +140,9 @@ module BooleanProperty end end - - +#=============================================================================== +# +#=============================================================================== module BooleanProperty2 def self.set(_settingname, _oldsetting) ret = pbShowCommands(nil, [_INTL("True"), _INTL("False")], -1) @@ -151,8 +158,9 @@ module BooleanProperty2 end end - - +#=============================================================================== +# +#=============================================================================== module StringProperty def self.set(settingname, oldsetting) return pbMessageFreeText(_INTL("Set the value for {1}.", settingname), @@ -164,8 +172,9 @@ module StringProperty end end - - +#=============================================================================== +# +#=============================================================================== class LimitStringProperty def initialize(limit) @limit = limit @@ -181,8 +190,9 @@ class LimitStringProperty end end - - +#=============================================================================== +# +#=============================================================================== class EnumProperty def initialize(values) @values = values @@ -207,9 +217,9 @@ class EnumProperty end end - - +#=============================================================================== # Unused +#=============================================================================== class EnumProperty2 def initialize(value) @module = value @@ -234,8 +244,9 @@ class EnumProperty2 end end - - +#=============================================================================== +# +#=============================================================================== class StringListProperty def self.set(_setting_name, old_setting) old_setting = [] if !old_setting @@ -324,8 +335,9 @@ class StringListProperty end end - - +#=============================================================================== +# +#=============================================================================== class GameDataProperty def initialize(value) raise _INTL("Couldn't find class {1} in module GameData.", value.to_s) if !GameData.const_defined?(value.to_sym) @@ -355,8 +367,9 @@ class GameDataProperty end end - - +#=============================================================================== +# +#=============================================================================== module BGMProperty def self.set(settingname, oldsetting) chosenmap = pbListScreen(settingname, MusicFileLister.new(true, oldsetting)) @@ -368,8 +381,9 @@ module BGMProperty end end - - +#=============================================================================== +# +#=============================================================================== module MEProperty def self.set(settingname, oldsetting) chosenmap = pbListScreen(settingname, MusicFileLister.new(false, oldsetting)) @@ -381,8 +395,9 @@ module MEProperty end end - - +#=============================================================================== +# +#=============================================================================== module WindowskinProperty def self.set(settingname, oldsetting) chosenmap = pbListScreen(settingname, GraphicsLister.new("Graphics/Windowskins/", oldsetting)) @@ -394,8 +409,9 @@ module WindowskinProperty end end - - +#=============================================================================== +# +#=============================================================================== module TrainerTypeProperty def self.set(settingname, oldsetting) chosenmap = pbListScreen(settingname, TrainerTypeLister.new(0, false)) @@ -407,8 +423,9 @@ module TrainerTypeProperty end end - - +#=============================================================================== +# +#=============================================================================== module SpeciesProperty def self.set(_settingname, oldsetting) ret = pbChooseSpeciesList(oldsetting || nil) @@ -424,8 +441,9 @@ module SpeciesProperty end end - - +#=============================================================================== +# +#=============================================================================== class SpeciesFormProperty def initialize(default_value) @default_value = default_value @@ -453,8 +471,9 @@ class SpeciesFormProperty end end - - +#=============================================================================== +# +#=============================================================================== module TypeProperty def self.set(_settingname, oldsetting) ret = pbChooseTypeList(oldsetting || nil) @@ -470,8 +489,9 @@ module TypeProperty end end - - +#=============================================================================== +# +#=============================================================================== module TypesProperty def self.set(_settingname, oldsetting) ret = oldsetting.clone @@ -501,8 +521,9 @@ module TypesProperty end end - - +#=============================================================================== +# +#=============================================================================== module MoveProperty def self.set(_settingname, oldsetting) ret = pbChooseMoveList(oldsetting || nil) @@ -518,8 +539,9 @@ module MoveProperty end end - - +#=============================================================================== +# +#=============================================================================== class MovePropertyForSpecies def initialize(pokemondata) @pokemondata = pokemondata @@ -539,8 +561,9 @@ class MovePropertyForSpecies end end - - +#=============================================================================== +# +#=============================================================================== module GenderProperty def self.set(_settingname, _oldsetting) ret = pbShowCommands(nil, [_INTL("Male"), _INTL("Female")], -1) @@ -557,8 +580,9 @@ module GenderProperty end end - - +#=============================================================================== +# +#=============================================================================== module ItemProperty def self.set(_settingname, oldsetting) ret = pbChooseItemList((oldsetting) ? oldsetting : nil) @@ -574,8 +598,9 @@ module ItemProperty end end - - +#=============================================================================== +# +#=============================================================================== class IVsProperty def initialize(limit) @limit = limit @@ -614,8 +639,9 @@ class IVsProperty end end - - +#=============================================================================== +# +#=============================================================================== class EVsProperty def initialize(limit) @limit = limit @@ -660,8 +686,9 @@ class EVsProperty end end - - +#=============================================================================== +# +#=============================================================================== class BallProperty def initialize(pokemondata) @pokemondata = pokemondata @@ -680,8 +707,9 @@ class BallProperty end end - - +#=============================================================================== +# +#=============================================================================== module CharacterProperty def self.set(settingname, oldsetting) chosenmap = pbListScreen(settingname, GraphicsLister.new("Graphics/Characters/", oldsetting)) @@ -693,8 +721,9 @@ module CharacterProperty end end - - +#=============================================================================== +# +#=============================================================================== module MapSizeProperty def self.set(settingname, oldsetting) oldsetting = [0, ""] if !oldsetting @@ -711,8 +740,6 @@ module MapSizeProperty end end - - def chooseMapPoint(map, rgnmap = false) viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) viewport.z = 99999 @@ -745,8 +772,9 @@ def chooseMapPoint(map, rgnmap = false) return ret end - - +#=============================================================================== +# +#=============================================================================== module MapCoordsProperty def self.set(settingname, oldsetting) chosenmap = pbListScreen(settingname, MapLister.new((oldsetting) ? oldsetting[0] : 0)) @@ -763,8 +791,9 @@ module MapCoordsProperty end end - - +#=============================================================================== +# +#=============================================================================== module MapCoordsFacingProperty def self.set(settingname, oldsetting) chosenmap = pbListScreen(settingname, MapLister.new((oldsetting) ? oldsetting[0] : 0)) @@ -787,8 +816,9 @@ module MapCoordsFacingProperty end end - - +#=============================================================================== +# +#=============================================================================== module RegionMapCoordsProperty def self.set(_settingname, oldsetting) regions = self.getMapNameList @@ -821,8 +851,9 @@ module RegionMapCoordsProperty end end - - +#=============================================================================== +# +#=============================================================================== module WeatherEffectProperty def self.set(_settingname, oldsetting) oldsetting = [:None, 100] if !oldsetting @@ -848,8 +879,9 @@ module WeatherEffectProperty end end - - +#=============================================================================== +# +#=============================================================================== module MapProperty def self.set(settingname, oldsetting) chosenmap = pbListScreen(settingname, MapLister.new(oldsetting || 0)) @@ -865,8 +897,9 @@ module MapProperty end end - - +#=============================================================================== +# +#=============================================================================== module ItemNameProperty def self.set(settingname, oldsetting) return pbMessageFreeText(_INTL("Set the value for {1}.", settingname), @@ -882,8 +915,9 @@ module ItemNameProperty end end - - +#=============================================================================== +# +#=============================================================================== module PocketProperty def self.set(_settingname, oldsetting) commands = Settings.bag_pocket_names.clone @@ -901,8 +935,9 @@ module PocketProperty end end - - +#=============================================================================== +# +#=============================================================================== module BaseStatsProperty def self.set(settingname, oldsetting) return oldsetting if !oldsetting @@ -935,8 +970,9 @@ module BaseStatsProperty end end - - +#=============================================================================== +# +#=============================================================================== module EffortValuesProperty def self.set(settingname, oldsetting) return oldsetting if !oldsetting @@ -977,8 +1013,9 @@ module EffortValuesProperty end end - - +#=============================================================================== +# +#=============================================================================== module AbilityProperty def self.set(_settingname, oldsetting) ret = pbChooseAbilityList((oldsetting) ? oldsetting : nil) @@ -994,8 +1031,9 @@ module AbilityProperty end end - - +#=============================================================================== +# +#=============================================================================== class GameDataPoolProperty def initialize(game_data, allow_multiple = true, auto_sort = false) if !GameData.const_defined?(game_data.to_sym) @@ -1113,32 +1151,36 @@ class GameDataPoolProperty end end - - +#=============================================================================== +# +#=============================================================================== class EggMovesProperty < GameDataPoolProperty def initialize super(:Move, false, true) end end - - +#=============================================================================== +# +#=============================================================================== class EggGroupsProperty < GameDataPoolProperty def initialize super(:EggGroup, false, false) end end - - +#=============================================================================== +# +#=============================================================================== class AbilitiesProperty < GameDataPoolProperty def initialize super(:Ability, false, false) end end - - +#=============================================================================== +# +#=============================================================================== module LevelUpMovesProperty def self.set(_settingname, oldsetting) # Get all moves in move pool @@ -1289,8 +1331,9 @@ module LevelUpMovesProperty end end - - +#=============================================================================== +# +#=============================================================================== class EvolutionsProperty def initialize @methods = [] @@ -1517,14 +1560,15 @@ class EvolutionsProperty ret << "," if i > 0 ret << value[i][0].to_s + "," ret << value[i][1].to_s + "," - ret << value[i][2].to_s if value[i][2] != nil + ret << value[i][2].to_s if value[i][2] end return ret end end - - +#=============================================================================== +# +#=============================================================================== module EncounterSlotProperty def self.set(setting_name, data) max_level = GameData::GrowthRate.max_level @@ -1571,8 +1615,6 @@ module EncounterSlotProperty end end - - #=============================================================================== # Core property editor script #=============================================================================== 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 70d5231ae..054fc0be2 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 @@ -38,8 +38,6 @@ def pbWarpToMap return nil end - - #=============================================================================== # Debug Variables screen #=============================================================================== @@ -95,8 +93,8 @@ class SpriteWindow_DebugVariables < Window_DrawableCommand (Kernel.const_defined?(code_parts[0]) rescue false) val = (eval(code) rescue nil) # Code starts with a class/method name elsif code_parts[0][0].downcase == code_parts[0][0] && - !(Interpreter.method_defined?(code_parts[0].to_sym) rescue false) && - !(Game_Event.method_defined?(code_parts[0].to_sym) rescue false) + !(Interpreter.method_defined?(code_parts[0].to_sym) rescue false) && + !(Game_Event.method_defined?(code_parts[0].to_sym) rescue false) val = (eval(code) rescue nil) # Code starts with a method name (that isn't in Interpreter/Game_Event) end else @@ -131,8 +129,9 @@ class SpriteWindow_DebugVariables < Window_DrawableCommand end end - - +#=============================================================================== +# +#=============================================================================== def pbDebugSetVariable(id, diff) $game_variables[id] = 0 if $game_variables[id].nil? if $game_variables[id].is_a?(Numeric) @@ -371,8 +370,6 @@ def pbDebugDayCare cmd_window.dispose end - - #=============================================================================== # Debug roaming Pokémon screen #=============================================================================== @@ -453,8 +450,9 @@ class SpriteWindow_DebugRoamers < Window_DrawableCommand end end - - +#=============================================================================== +# +#=============================================================================== def pbDebugRoamers viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) viewport.z = 99999 @@ -544,8 +542,6 @@ def pbDebugRoamers viewport.dispose end - - #=============================================================================== # Battle animations import/export #=============================================================================== @@ -739,8 +735,6 @@ def pbCheckTileValidity(tile_id, map, tilesets, passages) return false end - - #=============================================================================== # Pseudo-party screen for editing Pokémon being set up for a wild battle #=============================================================================== diff --git a/Data/Scripts/020_Debug/003_Debug menus/004_Debug_BattleCommands.rb b/Data/Scripts/020_Debug/003_Debug menus/004_Debug_BattleCommands.rb index d8c4bd2d7..771b65e4a 100644 --- a/Data/Scripts/020_Debug/003_Debug menus/004_Debug_BattleCommands.rb +++ b/Data/Scripts/020_Debug/003_Debug menus/004_Debug_BattleCommands.rb @@ -88,7 +88,7 @@ MenuHandlers.add(:battle_debug_menu, :pokemon_teams, { if battle.opponent battle.opponent.each_with_index do |trainer, i| first_index = foe_party_starts[i] - last_index = (i < foe_party_starts.length - 1) ? foe_party_starts[i + 1] : battle.pbParty(1).length + last_index = (i < foe_party_starts.length - 1) ? foe_party_starts[i + 1] : battle.pbParty(1).length num_pkmn = last_index - first_index commands.push(_INTL("Opponent {1}: {2} ({3} Pokémon)", i + 1, trainer.full_name, num_pkmn)) team_indices.push([1, i, first_index]) @@ -99,7 +99,7 @@ MenuHandlers.add(:battle_debug_menu, :pokemon_teams, { end battle.player.each_with_index do |trainer, i| first_index = player_party_starts[i] - last_index = (i < player_party_starts.length - 1) ? player_party_starts[i + 1] : battle.pbParty(0).length + last_index = (i < player_party_starts.length - 1) ? player_party_starts[i + 1] : battle.pbParty(0).length num_pkmn = last_index - first_index if i == 0 # Player commands.push(_INTL("You: {1} ({2} Pokémon)", trainer.full_name, num_pkmn)) diff --git a/Data/Scripts/020_Debug/003_Debug menus/006_Debug_BattleExtraCode.rb b/Data/Scripts/020_Debug/003_Debug menus/006_Debug_BattleExtraCode.rb index 2ec21bb9d..7b9b62ada 100644 --- a/Data/Scripts/020_Debug/003_Debug menus/006_Debug_BattleExtraCode.rb +++ b/Data/Scripts/020_Debug/003_Debug menus/006_Debug_BattleExtraCode.rb @@ -3,164 +3,164 @@ #=============================================================================== 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::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::ExtraType - 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: -99_999, max: 99_999 }, - 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: -99_999, max: 99_999}, + 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} } POSITION_EFFECTS = { @@ -168,8 +168,8 @@ module Battle::DebugVariables # PBEffects::FutureSightMove - too complex to be worth bothering with # PBEffects::FutureSightUserIndex - too complex to be worth bothering with # PBEffects::FutureSightUserPartyIndex - too complex to be worth bothering with - PBEffects::HealingWish => { name: "Whether Healing Wish is waiting to apply", default: false }, - PBEffects::LunarDance => { name: "Whether Lunar Dance is waiting to apply", default: false } + PBEffects::HealingWish => {name: "Whether Healing Wish is waiting to apply", default: false}, + PBEffects::LunarDance => {name: "Whether Lunar Dance is waiting to apply", default: false} # PBEffects::Wish - too complex to be worth bothering with # PBEffects::WishAmount - too complex to be worth bothering with # PBEffects::WishMaker - too complex to be worth bothering with diff --git a/Data/Scripts/021_Compiler/001_Compiler.rb b/Data/Scripts/021_Compiler/001_Compiler.rb index 023b78a20..fba3576b9 100644 --- a/Data/Scripts/021_Compiler/001_Compiler.rb +++ b/Data/Scripts/021_Compiler/001_Compiler.rb @@ -888,7 +888,7 @@ module Compiler rescue SystemCallError mustCompile = true end - else + elsif filename != "shadow_pokemon.dat" mustCompile = true break end diff --git a/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb b/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb index d876ed861..168082b28 100644 --- a/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb +++ b/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb @@ -99,7 +99,7 @@ module Compiler # Compile map connections #============================================================================= def compile_connections(*paths) - records = [] + records = [] paths.each do |path| compile_pbs_file_message_start(path) pbCompilerEachPreppedLine(path) { |line, lineno| diff --git a/Data/Scripts/021_Compiler/003_Compiler_WritePBS.rb b/Data/Scripts/021_Compiler/003_Compiler_WritePBS.rb index 2ab8d7065..0dac52b56 100644 --- a/Data/Scripts/021_Compiler/003_Compiler_WritePBS.rb +++ b/Data/Scripts/021_Compiler/003_Compiler_WritePBS.rb @@ -476,7 +476,7 @@ module Compiler end # Write each trainer property schema.each_key do |key| - next if key == "SectionName" || key == "Pokemon" + next if ["SectionName", "Pokemon"].include?(key) val = element.get_property_for_PBS(key) next if val.nil? f.write(sprintf("%s = ", key))