Fixed previous commit always causing recompiling if shadow_pokemon.dat doesn't exist, also rubocopping

This commit is contained in:
Maruno17
2023-01-23 22:27:04 +00:00
parent f6213057d8
commit b0b6e675c3
103 changed files with 1099 additions and 1302 deletions
+18
View File
@@ -21,6 +21,10 @@ Layout/HashAlignment:
EnforcedHashRocketStyle: table EnforcedHashRocketStyle: table
EnforcedColonStyle: 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 # 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]. # needing to be written like { foo => bar } while arrays are like [foo, bar].
Layout/SpaceInsideHashLiteralBraces: Layout/SpaceInsideHashLiteralBraces:
@@ -106,6 +110,11 @@ Style/GlobalVars:
Style/HashSyntax: Style/HashSyntax:
EnforcedStyle: no_mixed_keys 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 # unless just adds mental gymnastics trying to figure out what it actually
# means. I much prefer if !something. # means. I much prefer if !something.
Style/NegatedIf: Style/NegatedIf:
@@ -139,6 +148,11 @@ Style/SingleLineBlockParams:
Style/SingleLineMethods: Style/SingleLineMethods:
Enabled: false 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. # Single quotes being faster is hardly measurable and only affects parse time.
# Enforcing double quotes reduces the times where you need to change them # Enforcing double quotes reduces the times where you need to change them
# when introducing an interpolation or an apostrophe. Use single quotes only if # when introducing an interpolation or an apostrophe. Use single quotes only if
@@ -154,6 +168,10 @@ Style/SymbolArray:
Style/WordArray: Style/WordArray:
EnforcedStyle: brackets 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 # Parentheses around the condition in a ternary operator helps to differentiate
# it from the true/false results. # it from the true/false results.
Style/TernaryParentheses: Style/TernaryParentheses:
@@ -2,9 +2,7 @@
# Reads files of certain format from a directory # Reads files of certain format from a directory
#=============================================================================== #===============================================================================
class Dir class Dir
#----------------------------------------------------------------------------- # Reads all files in a directory
# Reads all files in a directory
#-----------------------------------------------------------------------------
def self.get(dir, filters = "*", full = true) def self.get(dir, filters = "*", full = true)
files = [] files = []
filters = [filters] if !filters.is_a?(Array) filters = [filters] if !filters.is_a?(Array)
@@ -15,9 +13,8 @@ class Dir
end end
return files.sort return files.sort
end 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) def self.all(dir, filters = "*", full = true)
# sets variables for starting # sets variables for starting
files = [] files = []
@@ -33,18 +30,16 @@ class Dir
# returns all found files # returns all found files
return files + subfolders return files + subfolders
end end
#-----------------------------------------------------------------------------
# Checks for existing directory, gets around accents # Checks for existing directory, gets around accents
#-----------------------------------------------------------------------------
def self.safe?(dir) def self.safe?(dir)
return false if !FileTest.directory?(dir) return false if !FileTest.directory?(dir)
ret = false ret = false
self.chdir(dir) { ret = true } rescue nil self.chdir(dir) { ret = true } rescue nil
return ret return ret
end end
#-----------------------------------------------------------------------------
# Creates all the required directories for filename path # Creates all the required directories for filename path
#-----------------------------------------------------------------------------
def self.create(path) def self.create(path)
path.gsub!("\\", "/") # Windows compatibility path.gsub!("\\", "/") # Windows compatibility
# get path tree # get path tree
@@ -56,9 +51,8 @@ class Dir
self.mkdir(full) if !self.safe?(full) self.mkdir(full) if !self.safe?(full)
end end
end end
#-----------------------------------------------------------------------------
# Generates entire folder tree from a certain directory # Generates entire folder tree from a certain directory
#-----------------------------------------------------------------------------
def self.all_dirs(dir) def self.all_dirs(dir)
# sets variables for starting # sets variables for starting
dirs = [] dirs = []
@@ -69,45 +63,35 @@ class Dir
# returns all found directories # returns all found directories
return dirs.length > 0 ? (dirs + [dir]) : [dir] return dirs.length > 0 ? (dirs + [dir]) : [dir]
end 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) def self.delete_all(dir)
# delete all files in dir # delete all files in dir
self.all(dir).each { |f| File.delete(f) } self.all(dir).each { |f| File.delete(f) }
# delete all dirs in dir # delete all dirs in dir
self.all_dirs(dir).each { |f| Dir.delete(f) } self.all_dirs(dir).each { |f| Dir.delete(f) }
end end
#-----------------------------------------------------------------------------
end end
#=============================================================================== #===============================================================================
# extensions for file class # Extensions for file class
#=============================================================================== #===============================================================================
class File class File
#----------------------------------------------------------------------------- # Checks for existing file, gets around accents
# Checks for existing file, gets around accents
#-----------------------------------------------------------------------------
def self.safe?(file) def self.safe?(file)
ret = false ret = false
self.open(file, "rb") { ret = true } rescue nil self.open(file, "rb") { ret = true } rescue nil
return ret return ret
end end
#-----------------------------------------------------------------------------
# Checks for existing .rxdata file # Checks for existing .rxdata file
#-----------------------------------------------------------------------------
def self.safeData?(file) def self.safeData?(file)
ret = false ret = false
ret = (load_data(file) ? true : false) rescue false ret = (load_data(file) ? true : false) rescue false
return ret return ret
end end
#-----------------------------------------------------------------------------
end end
#=============================================================================== #===============================================================================
# Checking for files and directories # Checking for files and directories
#=============================================================================== #===============================================================================
@@ -219,8 +203,9 @@ def canonicalize(c)
return retstr return retstr
end end
#===============================================================================
#
#===============================================================================
module RTP module RTP
@rtpPaths = nil @rtpPaths = nil
@@ -255,7 +240,7 @@ module RTP
return filename return filename
end 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) def self.eachPathFor(filename)
return if !filename return if !filename
if filename[/^[A-Za-z]\:[\/\\]/] || filename[/^[\/\\]/] if filename[/^[A-Za-z]\:[\/\\]/] || filename[/^[\/\\]/]
@@ -299,8 +284,9 @@ module RTP
end end
end end
#===============================================================================
#
#===============================================================================
module FileTest module FileTest
IMAGE_EXTENSIONS = [".png", ".gif"] # ".jpg", ".jpeg", ".bmp", IMAGE_EXTENSIONS = [".png", ".gif"] # ".jpg", ".jpeg", ".bmp",
AUDIO_EXTENSIONS = [".mid", ".midi", ".ogg", ".wav", ".wma"] # ".mp3" AUDIO_EXTENSIONS = [".mid", ".midi", ".ogg", ".wav", ".wma"] # ".mp3"
@@ -314,27 +300,23 @@ module FileTest
end end
end end
#===============================================================================
#
#===============================================================================
# Used to determine whether a data file exists (rather than a graphics or # Used to determine whether a data file exists (rather than a graphics or
# audio file). Doesn't check RTP, but does check encrypted archives. # audio file). Doesn't check RTP, but does check encrypted archives.
# NOTE: pbGetFileChar checks anything added in MKXP's RTP setting, and matching
# NOTE: pbGetFileChar checks anything added in MKXP's RTP setting, # mount points added through System.mount.
# and matching mount points added through System.mount
def pbRgssExists?(filename) def pbRgssExists?(filename)
if safeExists?("./Game.rgssad") return pbGetFileChar(filename) != nil if safeExists?("./Game.rgssad")
return pbGetFileChar(filename) != nil filename = canonicalize(filename)
else return safeExists?(filename)
filename = canonicalize(filename)
return safeExists?(filename)
end
end end
# Opens an IO, even if the file is in an encrypted archive. # Opens an IO, even if the file is in an encrypted archive.
# Doesn't check RTP for the file. # Doesn't check RTP for the file.
# NOTE: load_data checks anything added in MKXP's RTP setting, and matching
# NOTE: load_data checks anything added in MKXP's RTP setting, # mount points added through System.mount.
# and matching mount points added through System.mount
def pbRgssOpen(file, mode = nil) def pbRgssOpen(file, mode = nil)
# File.open("debug.txt","ab") { |fw| fw.write([file,mode,Time.now.to_f].inspect+"\r\n") } # File.open("debug.txt","ab") { |fw| fw.write([file,mode,Time.now.to_f].inspect+"\r\n") }
if !safeExists?("./Game.rgssad") if !safeExists?("./Game.rgssad")
@@ -385,9 +367,8 @@ end
# Gets the contents of a file. Doesn't check RTP, but does check # Gets the contents of a file. Doesn't check RTP, but does check
# encrypted archives. # encrypted archives.
# NOTE: load_data will check anything added in MKXP's RTP setting, and matching
# NOTE: load_data will check anything added in MKXP's RTP setting, # mount points added through System.mount.
# and matching mount points added through System.mount
def pbGetFileString(file) def pbGetFileString(file)
file = canonicalize(file) file = canonicalize(file)
if !safeExists?("./Game.rgssad") if !safeExists?("./Game.rgssad")
@@ -407,14 +388,14 @@ def pbGetFileString(file)
return str return str
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
class StringInput class StringInput
include Enumerable include Enumerable
attr_reader :lineno, :string
class << self class << self
def new(str) def new(str)
if block_given? if block_given?
@@ -438,8 +419,6 @@ class StringInput
@lineno = 0 @lineno = 0
end end
attr_reader :lineno, :string
def inspect def inspect
return "#<#{self.class}:#{@closed ? 'closed' : 'open'},src=#{@string[0, 30].inspect}>" return "#<#{self.class}:#{@closed ? 'closed' : 'open'},src=#{@string[0, 30].inspect}>"
end end
+12 -12
View File
@@ -168,8 +168,8 @@ class Color
# New constructor, accepts RGB values as well as a hex number or string value. # New constructor, accepts RGB values as well as a hex number or string value.
def initialize(*args) def initialize(*args)
pbPrintException("Wrong number of arguments! At least 1 is needed!") if args.length < 1 pbPrintException("Wrong number of arguments! At least 1 is needed!") if args.length < 1
if args.length == 1 if args.length == 1
if args.first.is_a?(Fixnum) if args.first.is_a?(Fixnum)
hex = args.first.to_s(16) hex = args.first.to_s(16)
elsif args.first.is_a?(String) elsif args.first.is_a?(String)
@@ -181,11 +181,11 @@ class Color
r = hex[0...2].to_i(16) r = hex[0...2].to_i(16)
g = hex[2...4].to_i(16) g = hex[2...4].to_i(16)
b = hex[4...6].to_i(16) b = hex[4...6].to_i(16)
elsif args.length == 3 elsif args.length == 3
r, g, b = *args r, g, b = *args
end end
return init_original(r, g, b) if r && g && b return init_original(r, g, b) if r && g && b
return init_original(*args) return init_original(*args)
end end
def self.new_from_rgb(param) def self.new_from_rgb(param)
@@ -253,7 +253,7 @@ class Color
# @return [Integer] this color in RGB format converted to an integer # @return [Integer] this color in RGB format converted to an integer
def to_i def to_i
return self.to_rgb24.to_i(16) return self.to_rgb24.to_i(16)
end end
# @return [Color] the contrasting color to this one # @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. # Converts the provided hex string/24-bit integer to RGB values.
def self.hex_to_rgb(hex) def self.hex_to_rgb(hex)
hex = hex.delete("#") if hex.is_a?(String) hex = hex.delete("#") if hex.is_a?(String)
hex = hex.to_s(16) if hex.is_a?(Numeric) hex = hex.to_s(16) if hex.is_a?(Numeric)
r = hex[0...2].to_i(16) r = hex[0...2].to_i(16)
g = hex[2...4].to_i(16) g = hex[2...4].to_i(16)
b = hex[4...6].to_i(16) b = hex[4...6].to_i(16)
return r, g, b return r, g, b
end end
# Parses the input as a Color and returns a Color object made from it. # Parses the input as a Color and returns a Color object made from it.
@@ -267,7 +267,10 @@ module Translator
# existing destination folder # existing destination folder
if Dir.safe?(dir_name) if Dir.safe?(dir_name)
has_files = false 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)) if has_files && !pbConfirmMessageSerious(_INTL("Replace all text files in folder '{1}'?", dir_name))
pbDisposeMessageWindow(msg_window) pbDisposeMessageWindow(msg_window)
return return
@@ -568,14 +571,15 @@ class Translation
def setMapMessagesAsHash(map_id, array) def setMapMessagesAsHash(map_id, array)
load_default_messages load_default_messages
@default_game_messages[MessageTypes::EventTexts] ||= [] @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 end
def addMapMessagesAsHash(map_id, array) def addMapMessagesAsHash(map_id, array)
load_default_messages load_default_messages
@default_game_messages[MessageTypes::EventTexts] ||= [] @default_game_messages[MessageTypes::EventTexts] ||= []
@default_game_messages[MessageTypes::EventTexts][map_id] = priv_add_to_hash( @default_game_messages[MessageTypes::EventTexts][map_id] = priv_add_to_hash(MessageTypes::EventTexts,
MessageTypes::EventTexts, array, @default_game_messages[MessageTypes::EventTexts][map_id], map_id) array, @default_game_messages[MessageTypes::EventTexts][map_id], map_id)
end end
def get(type, id) def get(type, id)
+20 -39
View File
@@ -106,9 +106,8 @@
module PluginManager module PluginManager
# Holds all registered plugin data. # Holds all registered plugin data.
@@Plugins = {} @@Plugins = {}
#-----------------------------------------------------------------------------
# Registers a plugin and tests its dependencies and incompatibilities. # Registers a plugin and tests its dependencies and incompatibilities.
#-----------------------------------------------------------------------------
def self.register(options) def self.register(options)
name = nil name = nil
version = nil version = nil
@@ -289,9 +288,8 @@ module PluginManager
:credits => credits :credits => credits
} }
end end
#-----------------------------------------------------------------------------
# Throws a pure error message without stack trace or any other useless info. # Throws a pure error message without stack trace or any other useless info.
#-----------------------------------------------------------------------------
def self.error(msg) def self.error(msg)
Graphics.update Graphics.update
t = Thread.new do t = Thread.new do
@@ -304,11 +302,10 @@ module PluginManager
end end
Kernel.exit! true Kernel.exit! true
end end
#-----------------------------------------------------------------------------
# Returns true if the specified plugin is installed. # Returns true if the specified plugin is installed.
# If the version is specified, this version is taken into account. # 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. # If mustequal is true, the version must be a match with the specified version.
#-----------------------------------------------------------------------------
def self.installed?(plugin_name, plugin_version = nil, mustequal = false) def self.installed?(plugin_name, plugin_version = nil, mustequal = false)
plugin = @@Plugins[plugin_name] plugin = @@Plugins[plugin_name]
return false if plugin.nil? return false if plugin.nil?
@@ -317,41 +314,36 @@ module PluginManager
return true if !mustequal && comparison >= 0 return true if !mustequal && comparison >= 0
return true if mustequal && comparison == 0 return true if mustequal && comparison == 0
end end
#-----------------------------------------------------------------------------
# Returns the string names of all installed plugins. # Returns the string names of all installed plugins.
#-----------------------------------------------------------------------------
def self.plugins def self.plugins
return @@Plugins.keys return @@Plugins.keys
end end
#-----------------------------------------------------------------------------
# Returns the installed version of the specified plugin. # Returns the installed version of the specified plugin.
#-----------------------------------------------------------------------------
def self.version(plugin_name) def self.version(plugin_name)
return if !installed?(plugin_name) return if !installed?(plugin_name)
return @@Plugins[plugin_name][:version] return @@Plugins[plugin_name][:version]
end end
#-----------------------------------------------------------------------------
# Returns the link of the specified plugin. # Returns the link of the specified plugin.
#-----------------------------------------------------------------------------
def self.link(plugin_name) def self.link(plugin_name)
return if !installed?(plugin_name) return if !installed?(plugin_name)
return @@Plugins[plugin_name][:link] return @@Plugins[plugin_name][:link]
end end
#-----------------------------------------------------------------------------
# Returns the credits of the specified plugin. # Returns the credits of the specified plugin.
#-----------------------------------------------------------------------------
def self.credits(plugin_name) def self.credits(plugin_name)
return if !installed?(plugin_name) return if !installed?(plugin_name)
return @@Plugins[plugin_name][:credits] return @@Plugins[plugin_name][:credits]
end end
#-----------------------------------------------------------------------------
# Compares two versions given in string form. v1 should be the plugin version # 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. # you actually have, and v2 should be the minimum/desired plugin version.
# Return values: # Return values:
# 1 if v1 is higher than v2 # 1 if v1 is higher than v2
# 0 if v1 is equal to v2 # 0 if v1 is equal to v2
# -1 if v1 is lower than v2 # -1 if v1 is lower than v2
#-----------------------------------------------------------------------------
def self.compare_versions(v1, v2) def self.compare_versions(v1, v2)
d1 = v1.chars d1 = v1.chars
d1.insert(0, "0") if d1[0] == "." # Turn ".123" into "0.123" d1.insert(0, "0") if d1[0] == "." # Turn ".123" into "0.123"
@@ -376,9 +368,8 @@ module PluginManager
end end
return 0 return 0
end end
#-----------------------------------------------------------------------------
# formats the error message # Formats the error message
#-----------------------------------------------------------------------------
def self.pluginErrorMsg(name, script) def self.pluginErrorMsg(name, script)
e = $! e = $!
# begin message formatting # begin message formatting
@@ -415,9 +406,8 @@ module PluginManager
end end
end end
end end
#-----------------------------------------------------------------------------
# Used to read the metadata file # Used to read the metadata file
#-----------------------------------------------------------------------------
def self.readMeta(dir, file) def self.readMeta(dir, file)
filename = "#{dir}/#{file}" filename = "#{dir}/#{file}"
meta = {} meta = {}
@@ -480,9 +470,8 @@ module PluginManager
# return meta hash # return meta hash
return meta return meta
end end
#-----------------------------------------------------------------------------
# Get a list of all the plugin directories to inspect # Get a list of all the plugin directories to inspect
#-----------------------------------------------------------------------------
def self.listAll def self.listAll
return [] if !$DEBUG || safeExists?("Game.rgssad") || !Dir.safe?("Plugins") return [] if !$DEBUG || safeExists?("Game.rgssad") || !Dir.safe?("Plugins")
# get a list of all directories in the `Plugins/` folder # get a list of all directories in the `Plugins/` folder
@@ -491,9 +480,8 @@ module PluginManager
# return all plugins # return all plugins
return dirs return dirs
end end
#-----------------------------------------------------------------------------
# Catch any potential loop with dependencies and raise an error # Catch any potential loop with dependencies and raise an error
#-----------------------------------------------------------------------------
def self.validateDependencies(name, meta, og = nil) def self.validateDependencies(name, meta, og = nil)
# exit if no registered dependency # exit if no registered dependency
return nil if !meta[name] || !meta[name][:dependencies] return nil if !meta[name] || !meta[name][:dependencies]
@@ -511,9 +499,8 @@ module PluginManager
end end
return name return name
end end
#-----------------------------------------------------------------------------
# Sort load order based on dependencies (this ends up in reverse order) # Sort load order based on dependencies (this ends up in reverse order)
#-----------------------------------------------------------------------------
def self.sortLoadOrder(order, plugins) def self.sortLoadOrder(order, plugins)
# go through the load order # go through the load order
order.each do |o| order.each do |o|
@@ -540,9 +527,8 @@ module PluginManager
end end
return order return order
end end
#-----------------------------------------------------------------------------
# Get the order in which to load plugins # Get the order in which to load plugins
#-----------------------------------------------------------------------------
def self.getPluginOrder def self.getPluginOrder
plugins = {} plugins = {}
order = [] order = []
@@ -568,9 +554,8 @@ module PluginManager
# sort the load order # sort the load order
return self.sortLoadOrder(order, plugins).reverse, plugins return self.sortLoadOrder(order, plugins).reverse, plugins
end end
#-----------------------------------------------------------------------------
# Check if plugins need compiling # Check if plugins need compiling
#-----------------------------------------------------------------------------
def self.needCompiling?(order, plugins) def self.needCompiling?(order, plugins)
# fixed actions # fixed actions
return false if !$DEBUG || safeExists?("Game.rgssad") return false if !$DEBUG || safeExists?("Game.rgssad")
@@ -590,9 +575,8 @@ module PluginManager
end end
return false return false
end end
#-----------------------------------------------------------------------------
# Check if plugins need compiling # Check if plugins need compiling
#-----------------------------------------------------------------------------
def self.compilePlugins(order, plugins) def self.compilePlugins(order, plugins)
Console.echo_li("Compiling plugin scripts...") Console.echo_li("Compiling plugin scripts...")
scripts = [] scripts = []
@@ -618,9 +602,8 @@ module PluginManager
GC.start GC.start
Console.echo_done(true) Console.echo_done(true)
end end
#-----------------------------------------------------------------------------
# Check if plugins need compiling # Check if plugins need compiling
#-----------------------------------------------------------------------------
def self.runPlugins def self.runPlugins
Console.echo_h1("Checking plugins") Console.echo_h1("Checking plugins")
# get the order of plugins to interpret # get the order of plugins to interpret
@@ -668,9 +651,8 @@ module PluginManager
Console.echoln_li_done("No plugins found") Console.echoln_li_done("No plugins found")
end end
end end
#-----------------------------------------------------------------------------
# Get plugin dir from name based on meta entries # Get plugin dir from name based on meta entries
#-----------------------------------------------------------------------------
def self.findDirectory(name) def self.findDirectory(name)
# go through the plugins folder # go through the plugins folder
Dir.get("Plugins").each do |dir| Dir.get("Plugins").each do |dir|
@@ -683,5 +665,4 @@ module PluginManager
# return nil if no plugin dir found # return nil if no plugin dir found
return nil return nil
end end
#-----------------------------------------------------------------------------
end end
+6 -2
View File
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
class SpriteAnimation class SpriteAnimation
@@_animations = [] @@_animations = []
@@_reference_count = {} @@_reference_count = {}
@@ -262,8 +265,9 @@ class SpriteAnimation
end end
end end
#===============================================================================
#
#===============================================================================
module RPG module RPG
class Sprite < ::Sprite class Sprite < ::Sprite
def initialize(viewport = nil) def initialize(viewport = nil)
@@ -5,11 +5,9 @@
# Game_System class and the Game_Event class. # Game_System class and the Game_Event class.
#=============================================================================== #===============================================================================
class Interpreter class Interpreter
#----------------------------------------------------------------------------- # Object Initialization
# * Object Initialization
# depth : nest depth # depth : nest depth
# main : main flag # main : main flag
#-----------------------------------------------------------------------------
def initialize(depth = 0, main = false) def initialize(depth = 0, main = false)
@depth = depth @depth = depth
@main = main @main = main
@@ -39,11 +37,10 @@ class Interpreter
@renamed_choices = [] @renamed_choices = []
end_follower_overrides end_follower_overrides
end end
#-----------------------------------------------------------------------------
# * Event Setup # Event Setup
# list : list of event commands # list : list of event commands
# event_id : event ID # event_id : event ID
#-----------------------------------------------------------------------------
def setup(list, event_id, map_id = nil) def setup(list, event_id, map_id = nil)
clear clear
@map_id = map_id || $game_map.map_id @map_id = map_id || $game_map.map_id
@@ -82,9 +79,7 @@ class Interpreter
def running? def running?
return !@list.nil? return !@list.nil?
end end
#-----------------------------------------------------------------------------
# * Frame Update
#-----------------------------------------------------------------------------
def update def update
@loop_count = 0 @loop_count = 0
loop do loop do
@@ -135,9 +130,7 @@ class Interpreter
@index += 1 @index += 1
end end
end end
#-----------------------------------------------------------------------------
# * Execute script
#-----------------------------------------------------------------------------
def execute_script(script) def execute_script(script)
begin begin
result = eval(script) result = eval(script)
@@ -182,10 +175,7 @@ class Interpreter
raise EventScriptError.new(err) raise EventScriptError.new(err)
end end
end end
#-----------------------------------------------------------------------------
# * Get Character
# parameter : parameter
#-----------------------------------------------------------------------------
def get_character(parameter = 0) def get_character(parameter = 0)
case parameter case parameter
when -1 # player when -1 # player
@@ -210,21 +200,18 @@ class Interpreter
def get_event(parameter) def get_event(parameter)
return get_character(parameter) return get_character(parameter)
end 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 def pbGlobalLock
$game_map.events.each_value { |event| event.minilock } $game_map.events.each_value { |event| event.minilock }
end 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 def pbGlobalUnlock
$game_map.events.each_value { |event| event.unlock } $game_map.events.each_value { |event| event.unlock }
end 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) def pbNextIndex(index)
return -1 if !@list || @list.length == 0 return -1 if !@list || @list.length == 0
i = index + 1 i = index + 1
@@ -292,9 +279,6 @@ class Interpreter
@follower_animation_id = nil @follower_animation_id = nil
end end
#-----------------------------------------------------------------------------
# * Various methods to be used in a script event command.
#-----------------------------------------------------------------------------
# Helper function that shows a picture in a script. # Helper function that shows a picture in a script.
def pbShowPicture(number, name, origin, x, y, zoomX = 100, zoomY = 100, opacity = 255, blendType = 0) def pbShowPicture(number, name, origin, x, y, zoomX = 100, zoomY = 100, opacity = 255, blendType = 0)
number += ($game_temp.in_battle ? 50 : 0) number += ($game_temp.in_battle ? 50 : 0)
@@ -121,6 +121,7 @@ class Interpreter
def command_dummy def command_dummy
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * End Event # * End Event
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -132,6 +133,7 @@ class Interpreter
$game_map.events[@event_id].unlock $game_map.events[@event_id].unlock
end end
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Command Skip # * Command Skip
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -142,6 +144,7 @@ class Interpreter
@index += 1 @index += 1
end end
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Command If # * Command If
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -152,6 +155,7 @@ class Interpreter
end end
return command_skip return command_skip
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Show Text # * Show Text
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -203,6 +207,7 @@ class Interpreter
@message_waiting = false @message_waiting = false
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Show Choices # * Show Choices
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -289,6 +294,7 @@ class Interpreter
return if !condition || nil_or_empty?(new_name) return if !condition || nil_or_empty?(new_name)
@renamed_choices[number - 1] = new_name @renamed_choices[number - 1] = new_name
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * When [**] # * When [**]
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -300,6 +306,7 @@ class Interpreter
end end
return command_skip return command_skip
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * When Cancel # * When Cancel
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -311,6 +318,7 @@ class Interpreter
end end
return command_skip return command_skip
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Input Number # * Input Number
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -325,6 +333,7 @@ class Interpreter
@message_waiting = false @message_waiting = false
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Change Text Options # * Change Text Options
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -334,6 +343,7 @@ class Interpreter
$game_system.message_frame = @parameters[1] $game_system.message_frame = @parameters[1]
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Button Input Processing # * Button Input Processing
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -371,6 +381,7 @@ class Interpreter
@index += 1 @index += 1
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Wait # * Wait
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -378,6 +389,7 @@ class Interpreter
@wait_count = @parameters[0] * Graphics.frame_rate / 20 @wait_count = @parameters[0] * Graphics.frame_rate / 20
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Conditional Branch # * Conditional Branch
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -433,6 +445,7 @@ class Interpreter
end end
return command_skip return command_skip
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Else # * Else
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -443,12 +456,14 @@ class Interpreter
end end
return command_skip return command_skip
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Loop # * Loop
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
def command_112 def command_112
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Repeat Above # * Repeat Above
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -459,6 +474,7 @@ class Interpreter
return true if @list[@index].indent == indent return true if @list[@index].indent == indent
end end
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Break Loop # * Break Loop
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -475,6 +491,7 @@ class Interpreter
end end
end end
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Exit Event Processing # * Exit Event Processing
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -482,6 +499,7 @@ class Interpreter
command_end command_end
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Erase Event # * Erase Event
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -493,6 +511,7 @@ class Interpreter
@index += 1 @index += 1
return false return false
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Call Common Event # * Call Common Event
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -504,12 +523,14 @@ class Interpreter
end end
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Label # * Label
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
def command_118 def command_118
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Jump to Label # * Jump to Label
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -528,6 +549,7 @@ class Interpreter
temp_index += 1 temp_index += 1
end end
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Control Switches # * Control Switches
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -542,6 +564,7 @@ class Interpreter
$game_map.need_refresh = true if should_refresh $game_map.need_refresh = true if should_refresh
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Control Variables # * Control Variables
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -606,6 +629,7 @@ class Interpreter
end end
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Control Self Switch # * Control Self Switch
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -620,6 +644,7 @@ class Interpreter
end end
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Control Timer # * Control Timer
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -628,6 +653,7 @@ class Interpreter
$game_system.timer = @parameters[1] * Graphics.frame_rate if @parameters[0] == 0 $game_system.timer = @parameters[1] * Graphics.frame_rate if @parameters[0] == 0
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Change Gold # * Change Gold
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -642,6 +668,7 @@ class Interpreter
def command_127; command_dummy; end # Change Weapons def command_127; command_dummy; end # Change Weapons
def command_128; command_dummy; end # Change Armor def command_128; command_dummy; end # Change Armor
def command_129; command_dummy; end # Change Party Member def command_129; command_dummy; end # Change Party Member
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Change Windowskin # * Change Windowskin
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -654,6 +681,7 @@ class Interpreter
end end
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Change Battle BGM # * Change Battle BGM
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -661,10 +689,12 @@ class Interpreter
($PokemonGlobal.nextBattleBGM = @parameters[0]) ? @parameters[0].clone : nil ($PokemonGlobal.nextBattleBGM = @parameters[0]) ? @parameters[0].clone : nil
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Change Battle End ME # * Change Battle End ME
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
def command_133; command_dummy; end def command_133; command_dummy; end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Change Save Access # * Change Save Access
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -672,6 +702,7 @@ class Interpreter
$game_system.save_disabled = (@parameters[0] == 0) $game_system.save_disabled = (@parameters[0] == 0)
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Change Menu Access # * Change Menu Access
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -679,6 +710,7 @@ class Interpreter
$game_system.menu_disabled = (@parameters[0] == 0) $game_system.menu_disabled = (@parameters[0] == 0)
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Change Encounter # * Change Encounter
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -687,6 +719,7 @@ class Interpreter
$game_player.make_encounter_count $game_player.make_encounter_count
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Transfer Player # * Transfer Player
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -716,6 +749,7 @@ class Interpreter
end end
return false return false
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Set Event Location # * Set Event Location
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -747,6 +781,7 @@ class Interpreter
end end
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Scroll Map # * Scroll Map
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -756,6 +791,7 @@ class Interpreter
$game_map.start_scroll(@parameters[0], @parameters[1], @parameters[2]) $game_map.start_scroll(@parameters[0], @parameters[1], @parameters[2])
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Change Map Settings # * Change Map Settings
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -778,6 +814,7 @@ class Interpreter
end end
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Change Fog Color Tone # * Change Fog Color Tone
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -785,6 +822,7 @@ class Interpreter
$game_map.start_fog_tone_change(@parameters[0], @parameters[1] * Graphics.frame_rate / 20) $game_map.start_fog_tone_change(@parameters[0], @parameters[1] * Graphics.frame_rate / 20)
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Change Fog Opacity # * Change Fog Opacity
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -792,6 +830,7 @@ class Interpreter
$game_map.start_fog_opacity_change(@parameters[0], @parameters[1] * Graphics.frame_rate / 20) $game_map.start_fog_opacity_change(@parameters[0], @parameters[1] * Graphics.frame_rate / 20)
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Show Animation # * Show Animation
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -806,6 +845,7 @@ class Interpreter
character.animation_id = @parameters[1] character.animation_id = @parameters[1]
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Change Transparent Flag # * Change Transparent Flag
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -813,6 +853,7 @@ class Interpreter
$game_player.transparent = (@parameters[0] == 0) $game_player.transparent = (@parameters[0] == 0)
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Set Move Route # * Set Move Route
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -827,6 +868,7 @@ class Interpreter
character.force_move_route(@parameters[1]) character.force_move_route(@parameters[1])
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Wait for Move's Completion # * Wait for Move's Completion
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -834,6 +876,7 @@ class Interpreter
@move_route_waiting = true if !$game_temp.in_battle @move_route_waiting = true if !$game_temp.in_battle
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Prepare for Transition # * Prepare for Transition
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -842,6 +885,7 @@ class Interpreter
Graphics.freeze Graphics.freeze
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Execute Transition # * Execute Transition
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -852,6 +896,7 @@ class Interpreter
@index += 1 @index += 1
return false return false
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Change Screen Color Tone # * Change Screen Color Tone
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -859,6 +904,7 @@ class Interpreter
$game_screen.start_tone_change(@parameters[0], @parameters[1] * Graphics.frame_rate / 20) $game_screen.start_tone_change(@parameters[0], @parameters[1] * Graphics.frame_rate / 20)
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Screen Flash # * Screen Flash
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -866,6 +912,7 @@ class Interpreter
$game_screen.start_flash(@parameters[0], @parameters[1] * Graphics.frame_rate / 20) $game_screen.start_flash(@parameters[0], @parameters[1] * Graphics.frame_rate / 20)
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Screen Shake # * Screen Shake
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -873,6 +920,7 @@ class Interpreter
$game_screen.start_shake(@parameters[0], @parameters[1], @parameters[2] * Graphics.frame_rate / 20) $game_screen.start_shake(@parameters[0], @parameters[1], @parameters[2] * Graphics.frame_rate / 20)
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Show Picture # * Show Picture
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -889,6 +937,7 @@ class Interpreter
x, y, @parameters[6], @parameters[7], @parameters[8], @parameters[9]) x, y, @parameters[6], @parameters[7], @parameters[8], @parameters[9])
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Move Picture # * Move Picture
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -905,6 +954,7 @@ class Interpreter
@parameters[2], x, y, @parameters[6], @parameters[7], @parameters[8], @parameters[9]) @parameters[2], x, y, @parameters[6], @parameters[7], @parameters[8], @parameters[9])
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Rotate Picture # * Rotate Picture
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -913,6 +963,7 @@ class Interpreter
$game_screen.pictures[number].rotate(@parameters[1]) $game_screen.pictures[number].rotate(@parameters[1])
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Change Picture Color Tone # * Change Picture Color Tone
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -922,6 +973,7 @@ class Interpreter
@parameters[2] * Graphics.frame_rate / 20) @parameters[2] * Graphics.frame_rate / 20)
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Erase Picture # * Erase Picture
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -930,6 +982,7 @@ class Interpreter
$game_screen.pictures[number].erase $game_screen.pictures[number].erase
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Set Weather Effects # * Set Weather Effects
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -937,6 +990,7 @@ class Interpreter
$game_screen.weather(@parameters[0], @parameters[1], @parameters[2]) $game_screen.weather(@parameters[0], @parameters[1], @parameters[2])
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Play BGM # * Play BGM
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -944,6 +998,7 @@ class Interpreter
pbBGMPlay(@parameters[0]) pbBGMPlay(@parameters[0])
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Fade Out BGM # * Fade Out BGM
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -951,6 +1006,7 @@ class Interpreter
pbBGMFade(@parameters[0]) pbBGMFade(@parameters[0])
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Play BGS # * Play BGS
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -958,6 +1014,7 @@ class Interpreter
pbBGSPlay(@parameters[0]) pbBGSPlay(@parameters[0])
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Fade Out BGS # * Fade Out BGS
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -965,6 +1022,7 @@ class Interpreter
pbBGSFade(@parameters[0]) pbBGSFade(@parameters[0])
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Memorize BGM/BGS # * Memorize BGM/BGS
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -973,6 +1031,7 @@ class Interpreter
$game_system.bgs_memorize $game_system.bgs_memorize
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Restore BGM/BGS # * Restore BGM/BGS
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -981,6 +1040,7 @@ class Interpreter
$game_system.bgs_restore $game_system.bgs_restore
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Play ME # * Play ME
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -988,6 +1048,7 @@ class Interpreter
pbMEPlay(@parameters[0]) pbMEPlay(@parameters[0])
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Play SE # * Play SE
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -995,6 +1056,7 @@ class Interpreter
pbSEPlay(@parameters[0]) pbSEPlay(@parameters[0])
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Stop SE # * Stop SE
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -1008,6 +1070,7 @@ class Interpreter
def command_602; command_if(1); end # If Escape def command_602; command_if(1); end # If Escape
def command_603; command_if(2); end # If Lose def command_603; command_if(2); end # If Lose
def command_302; command_dummy; end # Shop Processing def command_302; command_dummy; end # Shop Processing
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Name Input Processing # * Name Input Processing
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -1033,6 +1096,7 @@ class Interpreter
def command_311; command_dummy; end # Change HP def command_311; command_dummy; end # Change HP
def command_312; command_dummy; end # Change SP def command_312; command_dummy; end # Change SP
def command_313; command_dummy; end # Change State def command_313; command_dummy; end # Change State
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Recover All # * Recover All
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -1065,6 +1129,7 @@ class Interpreter
def command_338; command_dummy; end # Deal Damage def command_338; command_dummy; end # Deal Damage
def command_339; command_dummy; end # Force Action def command_339; command_dummy; end # Force Action
def command_340; command_dummy; end # Abort Battle def command_340; command_dummy; end # Abort Battle
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Call Menu Screen # * Call Menu Screen
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -1073,6 +1138,7 @@ class Interpreter
@index += 1 @index += 1
return false return false
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Call Save Screen # * Call Save Screen
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -1082,6 +1148,7 @@ class Interpreter
screen.pbSaveScreen screen.pbSaveScreen
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Game Over # * Game Over
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -1090,6 +1157,7 @@ class Interpreter
pbBGSFade(1.0) pbBGSFade(1.0)
pbFadeOutIn { pbStartOver(true) } pbFadeOutIn { pbStartOver(true) }
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Return to Title Screen # * Return to Title Screen
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -1097,6 +1165,7 @@ class Interpreter
$game_temp.title_screen_calling = true $game_temp.title_screen_calling = true
return false return false
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Script # * Script
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -5,9 +5,6 @@
# flashing, etc. Refer to "$game_screen" for the instance of this class. # flashing, etc. Refer to "$game_screen" for the instance of this class.
#=============================================================================== #===============================================================================
class Game_Screen class Game_Screen
#-----------------------------------------------------------------------------
# * Public Instance Variables
#-----------------------------------------------------------------------------
attr_reader :brightness # brightness attr_reader :brightness # brightness
attr_reader :tone # color tone attr_reader :tone # color tone
attr_reader :flash_color # flash color attr_reader :flash_color # flash color
@@ -17,9 +14,6 @@ class Game_Screen
attr_reader :weather_max # max number of weather sprites attr_reader :weather_max # max number of weather sprites
attr_accessor :weather_duration # ticks in which the weather should fade in attr_accessor :weather_duration # ticks in which the weather should fade in
#-----------------------------------------------------------------------------
# * Object Initialization
#-----------------------------------------------------------------------------
def initialize def initialize
@brightness = 255 @brightness = 255
@fadeout_duration = 0 @fadeout_duration = 0
@@ -42,11 +36,7 @@ class Game_Screen
@weather_max = 0.0 @weather_max = 0.0
@weather_duration = 0 @weather_duration = 0
end end
#-----------------------------------------------------------------------------
# * Start Changing Color Tone
# tone : color tone
# duration : time
#-----------------------------------------------------------------------------
def start_tone_change(tone, duration) def start_tone_change(tone, duration)
@tone_target = tone.clone @tone_target = tone.clone
@tone_duration = duration @tone_duration = duration
@@ -54,40 +44,24 @@ class Game_Screen
@tone = @tone_target.clone @tone = @tone_target.clone
end end
end end
#-----------------------------------------------------------------------------
# * Start Flashing
# color : color
# duration : time
#-----------------------------------------------------------------------------
def start_flash(color, duration) def start_flash(color, duration)
@flash_color = color.clone @flash_color = color.clone
@flash_duration = duration @flash_duration = duration
end end
#-----------------------------------------------------------------------------
# * Start Shaking
# power : strength
# speed : speed
# duration : time
#-----------------------------------------------------------------------------
def start_shake(power, speed, duration) def start_shake(power, speed, duration)
@shake_power = power @shake_power = power
@shake_speed = speed @shake_speed = speed
@shake_duration = duration @shake_duration = duration
end end
#-----------------------------------------------------------------------------
# * Set Weather
# type : type
# power : strength
# duration : time
#-----------------------------------------------------------------------------
def weather(type, power, duration) def weather(type, power, duration)
@weather_type = GameData::Weather.get(type).id @weather_type = GameData::Weather.get(type).id
@weather_max = (power + 1) * RPG::Weather::MAX_SPRITES / 10 @weather_max = (power + 1) * RPG::Weather::MAX_SPRITES / 10
@weather_duration = duration # In 1/20ths of a seconds @weather_duration = duration # In 1/20ths of a seconds
end end
#-----------------------------------------------------------------------------
# * Frame Update
#-----------------------------------------------------------------------------
def update def update
if @fadeout_duration && @fadeout_duration >= 1 if @fadeout_duration && @fadeout_duration >= 1
d = @fadeout_duration d = @fadeout_duration
@@ -5,25 +5,20 @@
# Refer to "$game_switches" for the instance of this class. # Refer to "$game_switches" for the instance of this class.
#=============================================================================== #===============================================================================
class Game_Switches class Game_Switches
#-----------------------------------------------------------------------------
# * Object Initialization
#-----------------------------------------------------------------------------
def initialize def initialize
@data = [] @data = []
end end
#-----------------------------------------------------------------------------
# * Get Switch # Get Switch
# switch_id : switch ID # switch_id : switch ID
#-----------------------------------------------------------------------------
def [](switch_id) def [](switch_id)
return @data[switch_id] if switch_id <= 5000 && @data[switch_id] return @data[switch_id] if switch_id <= 5000 && @data[switch_id]
return false return false
end end
#-----------------------------------------------------------------------------
# * Set Switch # Set Switch
# switch_id : switch ID # switch_id : switch ID
# value : ON (true) / OFF (false) # value : ON (true) / OFF (false)
#-----------------------------------------------------------------------------
def []=(switch_id, value) def []=(switch_id, value)
@data[switch_id] = value if switch_id <= 5000 @data[switch_id] = value if switch_id <= 5000
end end
@@ -5,25 +5,20 @@
# Refer to "$game_variables" for the instance of this class. # Refer to "$game_variables" for the instance of this class.
#=============================================================================== #===============================================================================
class Game_Variables class Game_Variables
#-----------------------------------------------------------------------------
# * Object Initialization
#-----------------------------------------------------------------------------
def initialize def initialize
@data = [] @data = []
end end
#-----------------------------------------------------------------------------
# * Get Variable # Get Variable
# variable_id : variable ID # variable_id : variable ID
#-----------------------------------------------------------------------------
def [](variable_id) def [](variable_id)
return @data[variable_id] if variable_id <= 5000 && !@data[variable_id].nil? return @data[variable_id] if variable_id <= 5000 && !@data[variable_id].nil?
return 0 return 0
end end
#-----------------------------------------------------------------------------
# * Set Variable # Set Variable
# variable_id : variable ID # variable_id : variable ID
# value : the variable's value # value : the variable's value
#-----------------------------------------------------------------------------
def []=(variable_id, value) def []=(variable_id, value)
@data[variable_id] = value if variable_id <= 5000 @data[variable_id] = value if variable_id <= 5000
end end
@@ -5,24 +5,19 @@
# "Hash." Refer to "$game_self_switches" for the instance of this class. # "Hash." Refer to "$game_self_switches" for the instance of this class.
#=============================================================================== #===============================================================================
class Game_SelfSwitches class Game_SelfSwitches
#-----------------------------------------------------------------------------
# * Object Initialization
#-----------------------------------------------------------------------------
def initialize def initialize
@data = {} @data = {}
end end
#-----------------------------------------------------------------------------
# * Get Self Switch # Get Self Switch
# key : key # key : key
#-----------------------------------------------------------------------------
def [](key) def [](key)
return @data[key] == true return @data[key] == true
end end
#-----------------------------------------------------------------------------
# * Set Self Switch # Set Self Switch
# key : key # key : key
# value : ON (true) / OFF (false) # value : ON (true) / OFF (false)
#-----------------------------------------------------------------------------
def []=(key, value) def []=(key, value)
@data[key] = value @data[key] = value
end end
@@ -4,11 +4,7 @@
# This class handles the picture. It's used within the Game_Screen class # This class handles the picture. It's used within the Game_Screen class
# ($game_screen). # ($game_screen).
#=============================================================================== #===============================================================================
class Game_Picture class Game_Picture
#-----------------------------------------------------------------------------
# * Public Instance Variables
#-----------------------------------------------------------------------------
attr_reader :number # picture number attr_reader :number # picture number
attr_reader :name # file name attr_reader :name # file name
attr_reader :origin # starting point attr_reader :origin # starting point
@@ -21,10 +17,6 @@ class Game_Picture
attr_reader :tone # color tone attr_reader :tone # color tone
attr_reader :angle # rotation angle attr_reader :angle # rotation angle
#-----------------------------------------------------------------------------
# * Object Initialization
# number : picture number
#-----------------------------------------------------------------------------
def initialize(number) def initialize(number)
@number = number @number = number
@name = "" @name = ""
@@ -47,8 +39,8 @@ class Game_Picture
@angle = 0 @angle = 0
@rotate_speed = 0 @rotate_speed = 0
end end
#-----------------------------------------------------------------------------
# * Show Picture # Show Picture
# name : file name # name : file name
# origin : starting point # origin : starting point
# x : x-coordinate # x : x-coordinate
@@ -57,7 +49,6 @@ class Game_Picture
# zoom_y : y directional zoom rate # zoom_y : y directional zoom rate
# opacity : opacity level # opacity : opacity level
# blend_type : blend method # blend_type : blend method
#-----------------------------------------------------------------------------
def show(name, origin, x, y, zoom_x, zoom_y, opacity, blend_type) def show(name, origin, x, y, zoom_x, zoom_y, opacity, blend_type)
@name = name @name = name
@origin = origin @origin = origin
@@ -79,8 +70,8 @@ class Game_Picture
@angle = 0 @angle = 0
@rotate_speed = 0 @rotate_speed = 0
end end
#-----------------------------------------------------------------------------
# * Move Picture # Move Picture
# duration : time # duration : time
# origin : starting point # origin : starting point
# x : x-coordinate # x : x-coordinate
@@ -89,7 +80,6 @@ class Game_Picture
# zoom_y : y directional zoom rate # zoom_y : y directional zoom rate
# opacity : opacity level # opacity : opacity level
# blend_type : blend method # blend_type : blend method
#-----------------------------------------------------------------------------
def move(duration, origin, x, y, zoom_x, zoom_y, opacity, blend_type) def move(duration, origin, x, y, zoom_x, zoom_y, opacity, blend_type)
@duration = duration @duration = duration
@origin = origin @origin = origin
@@ -100,18 +90,16 @@ class Game_Picture
@target_opacity = opacity.to_f @target_opacity = opacity.to_f
@blend_type = blend_type || 0 @blend_type = blend_type || 0
end end
#-----------------------------------------------------------------------------
# * Change Rotation Speed # Change Rotation Speed
# speed : rotation speed # speed : rotation speed
#-----------------------------------------------------------------------------
def rotate(speed) def rotate(speed)
@rotate_speed = speed @rotate_speed = speed
end end
#-----------------------------------------------------------------------------
# * Start Change of Color Tone # Start Change of Color Tone
# tone : color tone # tone : color tone
# duration : time # duration : time
#-----------------------------------------------------------------------------
def start_tone_change(tone, duration) def start_tone_change(tone, duration)
@tone_target = tone.clone @tone_target = tone.clone
@tone_duration = duration @tone_duration = duration
@@ -119,15 +107,13 @@ class Game_Picture
@tone = @tone_target.clone @tone = @tone_target.clone
end end
end end
#-----------------------------------------------------------------------------
# * Erase Picture # Erase Picture
#-----------------------------------------------------------------------------
def erase def erase
@name = "" @name = ""
end end
#-----------------------------------------------------------------------------
# * Frame Update # Frame Update
#-----------------------------------------------------------------------------
def update def update
if @duration >= 1 if @duration >= 1
d = @duration d = @duration
+7 -11
View File
@@ -106,28 +106,24 @@ class Game_Map
return GameData::MapMetadata.try_get(@map_id) return GameData::MapMetadata.try_get(@map_id)
end end
#-----------------------------------------------------------------------------
# Returns the name of this map's BGM. If it's night time, returns the night # Returns the name of this map's BGM. If it's night time, returns the night
# version of the BGM (if it exists). # version of the BGM (if it exists).
#-----------------------------------------------------------------------------
def bgm_name def bgm_name
if PBDayNight.isNight? && FileTest.audio_exist?("Audio/BGM/" + @map.bgm.name + "_n") if PBDayNight.isNight? && FileTest.audio_exist?("Audio/BGM/" + @map.bgm.name + "_n")
return @map.bgm.name + "_n" return @map.bgm.name + "_n"
end end
return @map.bgm.name return @map.bgm.name
end end
#-----------------------------------------------------------------------------
# * Autoplays background music # Autoplays background music
# Plays music called "[normal BGM]_n" if it's night time and it exists # Plays music called "[normal BGM]_n" if it's night time and it exists
#-----------------------------------------------------------------------------
def autoplayAsCue def autoplayAsCue
pbCueBGM(bgm_name, 1.0, @map.bgm.volume, @map.bgm.pitch) if @map.autoplay_bgm pbCueBGM(bgm_name, 1.0, @map.bgm.volume, @map.bgm.pitch) if @map.autoplay_bgm
pbBGSPlay(@map.bgs) if @map.autoplay_bgs pbBGSPlay(@map.bgs) if @map.autoplay_bgs
end end
#-----------------------------------------------------------------------------
# * Plays background music # Plays background music
# Plays music called "[normal BGM]_n" if it's night time and it exists # Plays music called "[normal BGM]_n" if it's night time and it exists
#-----------------------------------------------------------------------------
def autoplay def autoplay
pbBGMPlay(bgm_name, @map.bgm.volume, @map.bgm.pitch) if @map.autoplay_bgm pbBGMPlay(bgm_name, @map.bgm.volume, @map.bgm.pitch) if @map.autoplay_bgm
pbBGSPlay(@map.bgs) if @map.autoplay_bgs pbBGSPlay(@map.bgs) if @map.autoplay_bgs
@@ -249,7 +245,7 @@ class Game_Map
end end
# Returns whether the position x,y is fully passable (there is no blocking # 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) def passableStrict?(x, y, d, self_event = nil)
return false if !valid?(x, y) return false if !valid?(x, y)
events.each_value do |event| events.each_value do |event|
@@ -69,14 +69,15 @@
=end =end
#===============================================================================
#
#===============================================================================
class Interpreter class Interpreter
SCROLL_SPEED_DEFAULT = 4 SCROLL_SPEED_DEFAULT = 4
#----------------------------------------------------------------------------- # Map Autoscroll to Coordinates
# * Map Autoscroll to Coordinates
# x : x coordinate to scroll to and center on # x : x coordinate to scroll to and center on
# y : y 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) # speed : (optional) scroll speed (from 1-6, default being 4)
#-----------------------------------------------------------------------------
def autoscroll(x, y, speed = SCROLL_SPEED_DEFAULT) def autoscroll(x, y, speed = SCROLL_SPEED_DEFAULT)
if $game_map.scrolling? if $game_map.scrolling?
return false return false
@@ -130,17 +131,16 @@ class Interpreter
return !@diag return !@diag
end end
#----------------------------------------------------------------------------- # Map Autoscroll (to Player)
# * Map Autoscroll (to Player)
# speed : (optional) scroll speed (from 1-6, default being 4) # speed : (optional) scroll speed (from 1-6, default being 4)
#-----------------------------------------------------------------------------
def autoscroll_player(speed = SCROLL_SPEED_DEFAULT) def autoscroll_player(speed = SCROLL_SPEED_DEFAULT)
autoscroll($game_player.x, $game_player.y, speed) autoscroll($game_player.x, $game_player.y, speed)
end end
end end
#===============================================================================
#
#===============================================================================
class Game_Map class Game_Map
def scroll_downright(distance) def scroll_downright(distance)
@display_x = [@display_x + distance, @display_x = [@display_x + distance,
@@ -355,7 +355,7 @@ class PokemonMapFactory
def updateMaps(scene) def updateMaps(scene)
updateMapsInternal updateMapsInternal
$map_factory.setSceneStarted(scene) if @mapChanged setSceneStarted(scene) if @mapChanged
end end
def updateMapsInternal def updateMapsInternal
@@ -267,13 +267,11 @@ class Game_Player < Game_Character
return $game_map.terrain_tag(facing[1], facing[2]) return $game_map.terrain_tag(facing[1], facing[2])
end end
#----------------------------------------------------------------------------- # Passable Determinants
# * Passable Determinants
# x : x-coordinate # x : x-coordinate
# y : y-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) # * 0 = Determines if all directions are impassable (for jumping)
#-----------------------------------------------------------------------------
def passable?(x, y, d, strict = false) def passable?(x, y, d, strict = false)
# Get new coordinates # Get new coordinates
new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0) new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
@@ -289,28 +287,22 @@ class Game_Player < Game_Character
return super return super
end end
#----------------------------------------------------------------------------- # Set Map Display Position to Center of Screen
# * Set Map Display Position to Center of Screen
#-----------------------------------------------------------------------------
def center(x, y) def center(x, y)
self.map.display_x = (x * Game_Map::REAL_RES_X) - SCREEN_CENTER_X 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 self.map.display_y = (y * Game_Map::REAL_RES_Y) - SCREEN_CENTER_Y
end end
#----------------------------------------------------------------------------- # Move to Designated Position
# * Move to Designated Position
# x : x-coordinate # x : x-coordinate
# y : y-coordinate # y : y-coordinate
#-----------------------------------------------------------------------------
def moveto(x, y) def moveto(x, y)
super super
center(x, y) center(x, y)
make_encounter_count make_encounter_count
end end
#----------------------------------------------------------------------------- # Make Encounter Count
# * Make Encounter Count
#-----------------------------------------------------------------------------
def make_encounter_count def make_encounter_count
# Image of two dice rolling # Image of two dice rolling
if $game_map.map_id != 0 if $game_map.map_id != 0
@@ -319,18 +311,13 @@ class Game_Player < Game_Character
end end
end end
#-----------------------------------------------------------------------------
# * Refresh
#-----------------------------------------------------------------------------
def refresh def refresh
@opacity = 255 @opacity = 255
@blend_type = 0 @blend_type = 0
end end
#----------------------------------------------------------------------------- # Trigger event(s) at the same coordinates as self with the appropriate
# * Trigger event(s) at the same coordinates as self with the appropriate # trigger(s) that can be triggered
# trigger(s) that can be triggered
#-----------------------------------------------------------------------------
def check_event_trigger_here(triggers) def check_event_trigger_here(triggers)
result = false result = false
# If event is running # If event is running
@@ -348,9 +335,7 @@ class Game_Player < Game_Character
return result return result
end end
#----------------------------------------------------------------------------- # Front Event Starting Determinant
# * Front Event Starting Determinant
#-----------------------------------------------------------------------------
def check_event_trigger_there(triggers) def check_event_trigger_there(triggers)
result = false result = false
# If event is running # If event is running
@@ -389,9 +374,7 @@ class Game_Player < Game_Character
return result return result
end end
#----------------------------------------------------------------------------- # Touch Event Starting Determinant
# * Touch Event Starting Determinant
#-----------------------------------------------------------------------------
def check_event_trigger_touch(dir) def check_event_trigger_touch(dir)
result = false result = false
return result if $game_system.map_interpreter.running? return result if $game_system.map_interpreter.running?
@@ -417,9 +400,6 @@ class Game_Player < Game_Character
return result return result
end end
#-----------------------------------------------------------------------------
# * Frame Update
#-----------------------------------------------------------------------------
def update def update
last_real_x = @real_x last_real_x = @real_x
last_real_y = @real_y last_real_y = @real_y
@@ -531,7 +511,7 @@ class Game_Player < Game_Character
end end
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) def update_screen_position(last_real_x, last_real_y)
return if self.map.scrolling? || !(@moved_last_frame || @moved_this_frame) 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) || 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
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -5,42 +5,28 @@
# event. This class is used within the Game_Map class ($game_map). # event. This class is used within the Game_Map class ($game_map).
#=============================================================================== #===============================================================================
class Game_CommonEvent class Game_CommonEvent
#-----------------------------------------------------------------------------
# * Object Initialization
# common_event_id : common event ID
#-----------------------------------------------------------------------------
def initialize(common_event_id) def initialize(common_event_id)
@common_event_id = common_event_id @common_event_id = common_event_id
@interpreter = nil @interpreter = nil
refresh refresh
end end
#-----------------------------------------------------------------------------
# * Get Name
#-----------------------------------------------------------------------------
def name def name
return $data_common_events[@common_event_id].name return $data_common_events[@common_event_id].name
end end
#-----------------------------------------------------------------------------
# * Get Trigger
#-----------------------------------------------------------------------------
def trigger def trigger
return $data_common_events[@common_event_id].trigger return $data_common_events[@common_event_id].trigger
end end
#-----------------------------------------------------------------------------
# * Get Condition Switch ID
#-----------------------------------------------------------------------------
def switch_id def switch_id
return $data_common_events[@common_event_id].switch_id return $data_common_events[@common_event_id].switch_id
end end
#-----------------------------------------------------------------------------
# * Get List of Event Commands
#-----------------------------------------------------------------------------
def list def list
return $data_common_events[@common_event_id].list return $data_common_events[@common_event_id].list
end end
#-----------------------------------------------------------------------------
# * Checks if switch is on
#-----------------------------------------------------------------------------
def switchIsOn?(id) def switchIsOn?(id)
switchName = $data_system.switches[id] switchName = $data_system.switches[id]
return false if !switchName return false if !switchName
@@ -50,9 +36,7 @@ class Game_CommonEvent
return $game_switches[id] return $game_switches[id]
end end
end end
#-----------------------------------------------------------------------------
# * Refresh
#-----------------------------------------------------------------------------
def refresh def refresh
# Create an interpreter for parallel process if necessary # Create an interpreter for parallel process if necessary
if self.trigger == 2 && switchIsOn?(self.switch_id) if self.trigger == 2 && switchIsOn?(self.switch_id)
@@ -63,9 +47,7 @@ class Game_CommonEvent
@interpreter = nil @interpreter = nil
end end
end end
#-----------------------------------------------------------------------------
# * Frame Update
#-----------------------------------------------------------------------------
def update def update
return if !@interpreter return if !@interpreter
# Set up event if interpreter is not running # Set up event if interpreter is not running
@@ -77,7 +77,7 @@ class Game_FollowerFactory
attr_reader :last_update attr_reader :last_update
def initialize def initialize
@events = [] @events = []
$PokemonGlobal.followers.each do |follower| $PokemonGlobal.followers.each do |follower|
@events.push(create_follower_object(follower)) @events.push(create_follower_object(follower))
end end
@@ -388,7 +388,6 @@ module Followers
end end
end end
#=============================================================================== #===============================================================================
# Deprecated methods # Deprecated methods
#=============================================================================== #===============================================================================
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
class BushBitmap class BushBitmap
def initialize(bitmap, isTile, depth) def initialize(bitmap, isTile, depth)
@bitmaps = [] @bitmaps = []
@@ -53,8 +56,9 @@ class BushBitmap
end end
end end
#===============================================================================
#
#===============================================================================
class Sprite_Character < RPG::Sprite class Sprite_Character < RPG::Sprite
attr_accessor :character attr_accessor :character
@@ -22,7 +22,7 @@ class Sprite_SurfBase
def dispose def dispose
return if @disposed return if @disposed
@sprite&.dispose @sprite&.dispose
@sprite = nil @sprite = nil
@surfbitmap.dispose @surfbitmap.dispose
@divebitmap.dispose @divebitmap.dispose
@disposed = true @disposed = true
@@ -1,4 +1,6 @@
# Unused #===============================================================================
# Unused.
#===============================================================================
class ClippableSprite < Sprite_Character class ClippableSprite < Sprite_Character
def initialize(viewport, event, tilemap) def initialize(viewport, event, tilemap)
@tilemap = tilemap @tilemap = tilemap
@@ -29,8 +31,9 @@ class ClippableSprite < Sprite_Character
end end
end end
#===============================================================================
#
#===============================================================================
class Spriteset_Map class Spriteset_Map
attr_reader :map attr_reader :map
@@ -1,9 +1,8 @@
=begin #===============================================================================
A sprite whose sole purpose is to display an animation. This sprite # A sprite whose sole purpose is to display an animation. This sprite can be
can be displayed anywhere on the map and is disposed # displayed anywhere on the map and is disposed automatically when its animation
automatically when its animation is finished. # is finished. Used for grass rustling and so forth.
Used for grass rustling and so forth. #===============================================================================
=end
class AnimationSprite < RPG::Sprite class AnimationSprite < RPG::Sprite
def initialize(animID, map, tileX, tileY, viewport = nil, tinting = false, height = 3) def initialize(animID, map, tileX, tileY, viewport = nil, tinting = false, height = 3)
super(viewport) super(viewport)
@@ -38,8 +37,9 @@ class AnimationSprite < RPG::Sprite
end end
end end
#===============================================================================
#
#===============================================================================
class Spriteset_Map class Spriteset_Map
alias _animationSprite_initialize initialize unless private_method_defined?(:_animationSprite_initialize) alias _animationSprite_initialize initialize unless private_method_defined?(:_animationSprite_initialize)
alias _animationSprite_update update unless method_defined?(:_animationSprite_update) alias _animationSprite_update update unless method_defined?(:_animationSprite_update)
@@ -117,11 +117,9 @@ class Sprite_Shadow < RPG::Sprite
end end
end end
#===============================================================================
#===================================================
# ? CLASS Sprite_Character edit # ? CLASS Sprite_Character edit
#=================================================== #===============================================================================
class Sprite_Character < RPG::Sprite class Sprite_Character < RPG::Sprite
alias shadow_initialize initialize unless private_method_defined?(:shadow_initialize) alias shadow_initialize initialize unless private_method_defined?(:shadow_initialize)
@@ -161,20 +159,16 @@ class Sprite_Character < RPG::Sprite
end end
end end
#===============================================================================
#===================================================
# ? CLASS Game_Event edit # ? CLASS Game_Event edit
#=================================================== #===============================================================================
class Game_Event class Game_Event
attr_accessor :id attr_accessor :id
end end
#===============================================================================
#===================================================
# ? CLASS Spriteset_Map edit # ? CLASS Spriteset_Map edit
#=================================================== #===============================================================================
class Spriteset_Map class Spriteset_Map
attr_accessor :shadows attr_accessor :shadows
@@ -202,9 +196,7 @@ class Spriteset_Map
end end
end end
#===============================================================================
#===================================================
# ? XPML Definition, by Rataime, using ideas from Near Fantastica # ? XPML Definition, by Rataime, using ideas from Near Fantastica
# #
# Returns nil if the markup wasn't present at all, # 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("second", event_id) -> [1, "two"]
# p XPML_read("third", event_id) -> [3] # p XPML_read("third", event_id) -> [3]
# p XPML_read("forth", event_id) -> nil # p XPML_read("forth", event_id) -> nil
#=================================================== #===============================================================================
def XPML_read(map, markup, event, max_param_number = 0) def XPML_read(map, markup, event, max_param_number = 0)
parameter_list = nil parameter_list = nil
return nil if !event || event.list.nil? return nil if !event || event.list.nil?
+55 -36
View File
@@ -1,6 +1,8 @@
#===============================================================================
# Particle Engine, Peter O., 2007-11-03 # Particle Engine, Peter O., 2007-11-03
# Based on version 2 by Near Fantastica, 04.01.06 # Based on version 2 by Near Fantastica, 04.01.06
# In turn based on the Particle Engine designed by PinkMan # In turn based on the Particle Engine designed by PinkMan
#===============================================================================
class Particle_Engine class Particle_Engine
def initialize(viewport = nil, map = nil) def initialize(viewport = nil, map = nil)
@map = (map) ? map : $game_map @map = (map) ? map : $game_map
@@ -98,8 +100,9 @@ class Particle_Engine
end end
end end
#===============================================================================
#
#===============================================================================
class ParticleEffect class ParticleEffect
attr_accessor :x, :y, :z attr_accessor :x, :y, :z
@@ -113,8 +116,9 @@ class ParticleEffect
def dispose; end def dispose; end
end end
#===============================================================================
#
#===============================================================================
class ParticleSprite class ParticleSprite
attr_accessor :x, :y, :z, :ox, :oy, :opacity, :blend_type attr_accessor :x, :y, :z, :ox, :oy, :opacity, :blend_type
attr_reader :bitmap attr_reader :bitmap
@@ -171,8 +175,9 @@ class ParticleSprite
end end
end end
#===============================================================================
#
#===============================================================================
class ParticleEffect_Event < ParticleEffect class ParticleEffect_Event < ParticleEffect
attr_accessor :event attr_accessor :event
@@ -357,8 +362,9 @@ class ParticleEffect_Event < ParticleEffect
end end
end end
#===============================================================================
#
#===============================================================================
class Particle_Engine::Fire < ParticleEffect_Event class Particle_Engine::Fire < ParticleEffect_Event
def initialize(event, viewport) def initialize(event, viewport)
super super
@@ -368,8 +374,9 @@ class Particle_Engine::Fire < ParticleEffect_Event
end end
end end
#===============================================================================
#
#===============================================================================
class Particle_Engine::Smoke < ParticleEffect_Event class Particle_Engine::Smoke < ParticleEffect_Event
def initialize(event, viewport) def initialize(event, viewport)
super super
@@ -379,8 +386,9 @@ class Particle_Engine::Smoke < ParticleEffect_Event
end end
end end
#===============================================================================
#
#===============================================================================
class Particle_Engine::Teleport < ParticleEffect_Event class Particle_Engine::Teleport < ParticleEffect_Event
def initialize(event, viewport) def initialize(event, viewport)
super super
@@ -394,8 +402,9 @@ class Particle_Engine::Teleport < ParticleEffect_Event
end end
end end
#===============================================================================
#
#===============================================================================
class Particle_Engine::Spirit < ParticleEffect_Event class Particle_Engine::Spirit < ParticleEffect_Event
def initialize(event, viewport) def initialize(event, viewport)
super super
@@ -405,8 +414,9 @@ class Particle_Engine::Spirit < ParticleEffect_Event
end end
end end
#===============================================================================
#
#===============================================================================
class Particle_Engine::Explosion < ParticleEffect_Event class Particle_Engine::Explosion < ParticleEffect_Event
def initialize(event, viewport) def initialize(event, viewport)
super super
@@ -416,8 +426,9 @@ class Particle_Engine::Explosion < ParticleEffect_Event
end end
end end
#===============================================================================
#
#===============================================================================
class Particle_Engine::Aura < ParticleEffect_Event class Particle_Engine::Aura < ParticleEffect_Event
def initialize(event, viewport) def initialize(event, viewport)
super super
@@ -427,8 +438,9 @@ class Particle_Engine::Aura < ParticleEffect_Event
end end
end end
#===============================================================================
#
#===============================================================================
class Particle_Engine::Soot < ParticleEffect_Event class Particle_Engine::Soot < ParticleEffect_Event
def initialize(event, viewport) def initialize(event, viewport)
super super
@@ -438,8 +450,9 @@ class Particle_Engine::Soot < ParticleEffect_Event
end end
end end
#===============================================================================
#
#===============================================================================
class Particle_Engine::SootSmoke < ParticleEffect_Event class Particle_Engine::SootSmoke < ParticleEffect_Event
def initialize(event, viewport) def initialize(event, viewport)
super super
@@ -452,8 +465,9 @@ class Particle_Engine::SootSmoke < ParticleEffect_Event
end end
end end
#===============================================================================
#
#===============================================================================
class Particle_Engine::Rocket < ParticleEffect_Event class Particle_Engine::Rocket < ParticleEffect_Event
def initialize(event, viewport) def initialize(event, viewport)
super super
@@ -463,8 +477,9 @@ class Particle_Engine::Rocket < ParticleEffect_Event
end end
end end
#===============================================================================
#
#===============================================================================
class Particle_Engine::FixedTeleport < ParticleEffect_Event class Particle_Engine::FixedTeleport < ParticleEffect_Event
def initialize(event, viewport) def initialize(event, viewport)
super super
@@ -478,9 +493,9 @@ class Particle_Engine::FixedTeleport < ParticleEffect_Event
end end
end end
#===============================================================================
# By Peter O. # By Peter O.
#===============================================================================
class Particle_Engine::StarTeleport < ParticleEffect_Event class Particle_Engine::StarTeleport < ParticleEffect_Event
def initialize(event, viewport) def initialize(event, viewport)
super super
@@ -494,8 +509,9 @@ class Particle_Engine::StarTeleport < ParticleEffect_Event
end end
end end
#===============================================================================
#
#===============================================================================
class Particle_Engine::Smokescreen < ParticleEffect_Event class Particle_Engine::Smokescreen < ParticleEffect_Event
def initialize(event, viewport) def initialize(event, viewport)
super super
@@ -531,8 +547,9 @@ class Particle_Engine::Smokescreen < ParticleEffect_Event
end end
end end
#===============================================================================
#
#===============================================================================
class Particle_Engine::Flare < ParticleEffect_Event class Particle_Engine::Flare < ParticleEffect_Event
def initialize(event, viewport) def initialize(event, viewport)
super super
@@ -542,8 +559,9 @@ class Particle_Engine::Flare < ParticleEffect_Event
end end
end end
#===============================================================================
#
#===============================================================================
class Particle_Engine::Splash < ParticleEffect_Event class Particle_Engine::Splash < ParticleEffect_Event
def initialize(event, viewport) def initialize(event, viewport)
super super
@@ -561,8 +579,9 @@ class Particle_Engine::Splash < ParticleEffect_Event
end end
end end
#===============================================================================
#
#===============================================================================
class Game_Event < Game_Character class Game_Event < Game_Character
attr_accessor :pe_refresh attr_accessor :pe_refresh
+9 -8
View File
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
class PictureOrigin class PictureOrigin
TOP_LEFT = 0 TOP_LEFT = 0
CENTER = 1 CENTER = 1
@@ -12,8 +15,9 @@ class PictureOrigin
RIGHT = 8 RIGHT = 8
end end
#===============================================================================
#
#===============================================================================
class Processes class Processes
XY = 0 XY = 0
DELTA_XY = 1 DELTA_XY = 1
@@ -35,8 +39,9 @@ class Processes
CROP_BOTTOM = 17 CROP_BOTTOM = 17
end end
#===============================================================================
#
#===============================================================================
def getCubicPoint2(src, t) def getCubicPoint2(src, t)
x0 = src[0] x0 = src[0]
y0 = src[1] y0 = src[1]
@@ -72,8 +77,6 @@ def getCubicPoint2(src, t)
return [cx, cy] return [cx, cy]
end end
#=============================================================================== #===============================================================================
# PictureEx # PictureEx
#=============================================================================== #===============================================================================
@@ -456,8 +459,6 @@ class PictureEx
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
class Interpolator class Interpolator
ZOOM_X = 1 ZOOM_X = 1
ZOOM_Y = 2 ZOOM_Y = 2
@@ -83,8 +86,9 @@ class Interpolator
end end
end end
#===============================================================================
#
#===============================================================================
class RectInterpolator class RectInterpolator
def initialize(oldrect, newrect, frames) def initialize(oldrect, newrect, frames)
restart(oldrect, newrect, frames) restart(oldrect, newrect, frames)
@@ -130,8 +134,9 @@ class RectInterpolator
end end
end end
#===============================================================================
#
#===============================================================================
class PointInterpolator class PointInterpolator
attr_reader :x attr_reader :x
attr_reader :y attr_reader :y
@@ -1,7 +1,11 @@
#===============================================================================
#
#===============================================================================
class Hangup < Exception; end class Hangup < Exception; end
#===============================================================================
#
#===============================================================================
module RPG module RPG
module Cache module Cache
def self.debug def self.debug
@@ -106,8 +110,9 @@ module RPG
end end
end end
#===============================================================================
#
#===============================================================================
class BitmapWrapper < Bitmap class BitmapWrapper < Bitmap
attr_reader :refcount attr_reader :refcount
attr_accessor :never_dispose attr_accessor :never_dispose
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module MessageConfig module MessageConfig
LIGHT_TEXT_MAIN_COLOR = Color.new(248, 248, 248) LIGHT_TEXT_MAIN_COLOR = Color.new(248, 248, 248)
LIGHT_TEXT_SHADOW_COLOR = Color.new(72, 80, 88) LIGHT_TEXT_SHADOW_COLOR = Color.new(72, 80, 88)
@@ -163,8 +166,6 @@ module MessageConfig
end end
end end
#=============================================================================== #===============================================================================
# Position a window # Position a window
#=============================================================================== #===============================================================================
@@ -759,10 +760,8 @@ def addBackgroundOrColoredPlane(sprites, planename, background, color, viewport
end end
end end
#=============================================================================== #===============================================================================
# Ensure required method definitions # Ensure required method definitions.
#=============================================================================== #===============================================================================
module Graphics module Graphics
if !self.respond_to?("width") if !self.respond_to?("width")
@@ -773,8 +772,9 @@ module Graphics
end end
end end
#===============================================================================
# Ensure required method definitions.
#===============================================================================
if !defined?(_INTL) if !defined?(_INTL)
def _INTL(*args) def _INTL(*args)
string = args[0].clone string = args[0].clone
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
class WindowCursorRect < Rect class WindowCursorRect < Rect
def initialize(window) def initialize(window)
super(0, 0, 0, 0) super(0, 0, 0, 0)
@@ -46,7 +49,9 @@ class WindowCursorRect < Rect
end end
end end
#===============================================================================
#
#===============================================================================
class Window class Window
attr_reader :tone attr_reader :tone
attr_reader :color attr_reader :color
@@ -46,6 +46,8 @@ class SpriteWindow < Window
end end
attr_reader :compat attr_reader :compat
attr_reader :skinformat
attr_reader :skinrect
def compat=(value) def compat=(value)
@compat = value @compat = value
@@ -324,10 +326,6 @@ class SpriteWindow < Window
end end
end end
#############
attr_reader :skinformat
attr_reader :skinrect
def loadSkinFile(_file) def loadSkinFile(_file)
if (self.windowskin.width == 80 || self.windowskin.width == 96) && if (self.windowskin.width == 80 || self.windowskin.width == 96) &&
self.windowskin.height == 48 self.windowskin.height == 48
@@ -437,7 +435,8 @@ class SpriteWindow < Window
privRefresh privRefresh
end end
############# #===============================================================================
private private
def ensureBitmap(bitmap, dwidth, dheight) def ensureBitmap(bitmap, dwidth, dheight)
@@ -813,8 +812,6 @@ class SpriteWindow < Window
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -1,8 +1,7 @@
#=============================================================================== #===============================================================================
#
#===============================================================================
# Represents a window with no formatting capabilities. Its text color can be set, # 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. # though, and line breaks are supported, but the text is generally unformatted.
#===============================================================================
class Window_UnformattedTextPokemon < SpriteWindow_Base class Window_UnformattedTextPokemon < SpriteWindow_Base
attr_reader :text attr_reader :text
attr_reader :baseColor attr_reader :baseColor
@@ -106,8 +105,6 @@ class Window_UnformattedTextPokemon < SpriteWindow_Base
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -602,8 +599,6 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -723,8 +718,6 @@ class Window_InputNumberPokemon < SpriteWindow_Base
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -951,8 +944,6 @@ class SpriteWindow_Selectable < SpriteWindow_Base
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -1016,8 +1007,6 @@ module UpDownArrowMixin
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -1030,8 +1019,6 @@ class SpriteWindow_SelectableEx < SpriteWindow_Selectable
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -1137,8 +1124,6 @@ class Window_DrawableCommand < SpriteWindow_SelectableEx
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -1229,15 +1214,12 @@ class Window_CommandPokemon < Window_DrawableCommand
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
class Window_CommandPokemonEx < Window_CommandPokemon class Window_CommandPokemonEx < Window_CommandPokemon
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -1350,8 +1332,6 @@ class Window_AdvancedCommandPokemon < Window_DrawableCommand
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -51,8 +51,6 @@ class IconWindow < SpriteWindow_Base
end end
end end
#=============================================================================== #===============================================================================
# Displays an icon bitmap in a window. Supports animated images. # Displays an icon bitmap in a window. Supports animated images.
# Accepts bitmaps and paths to bitmap files in its constructor. # Accepts bitmaps and paths to bitmap files in its constructor.
@@ -88,8 +88,6 @@ class SpriteWrapper
end end
end end
#=============================================================================== #===============================================================================
# Sprite class that maintains a bitmap of its own. # Sprite class that maintains a bitmap of its own.
# This bitmap can't be changed to a different one. # This bitmap can't be changed to a different one.
@@ -111,8 +109,6 @@ class BitmapSprite < Sprite
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -237,8 +233,6 @@ class AnimatedSprite < Sprite
end end
end end
#=============================================================================== #===============================================================================
# Displays an icon bitmap in a sprite. Supports animated images. # Displays an icon bitmap in a sprite. Supports animated images.
#=============================================================================== #===============================================================================
@@ -310,8 +304,6 @@ class IconSprite < Sprite
end end
end end
#=============================================================================== #===============================================================================
# Sprite class that stores multiple bitmaps, and displays only one at once. # Sprite class that stores multiple bitmaps, and displays only one at once.
#=============================================================================== #===============================================================================
@@ -54,8 +54,6 @@ def getContrastColor(color)
return color.get_contrast_color return color.get_contrast_color
end end
#=============================================================================== #===============================================================================
# Format text # Format text
#=============================================================================== #===============================================================================
@@ -248,8 +246,6 @@ def getLastColors(colorstack, opacitystack, defaultcolors)
return colors return colors
end end
#=============================================================================== #===============================================================================
# Formats a string of text and returns an array containing a list of formatted # Formats a string of text and returns an array containing a list of formatted
# characters. # characters.
@@ -317,7 +313,6 @@ In addition, the syntax supports the following:
To draw the characters, pass the returned array to the To draw the characters, pass the returned array to the
_drawFormattedChars_ function. _drawFormattedChars_ function.
=end =end
def getFormattedText(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight = 32, def getFormattedText(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight = 32,
newlineBreaks = true, explicitBreaksOnly = false, newlineBreaks = true, explicitBreaksOnly = false,
collapseAlignments = false) collapseAlignments = false)
@@ -774,8 +769,6 @@ def getFormattedText(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight =
return characters return characters
end end
#=============================================================================== #===============================================================================
# Draw text and images on a bitmap # Draw text and images on a bitmap
#=============================================================================== #===============================================================================
@@ -1109,8 +1102,6 @@ def pbDrawTextPositions(bitmap, textpos)
end end
end end
#=============================================================================== #===============================================================================
# Draw images on a bitmap # Draw images on a bitmap
#=============================================================================== #===============================================================================
@@ -49,8 +49,6 @@ def pbCurrentEventCommentInput(elements, trigger)
return pbEventCommentInput(event, elements, trigger) return pbEventCommentInput(event, elements, trigger)
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -164,8 +162,9 @@ class ChooseNumberParams
end end
end end
#===============================================================================
#
#===============================================================================
def pbChooseNumber(msgwindow, params) def pbChooseNumber(msgwindow, params)
return 0 if !params return 0 if !params
ret = 0 ret = 0
@@ -208,8 +207,6 @@ def pbChooseNumber(msgwindow, params)
return ret return ret
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -244,8 +241,6 @@ class FaceWindowVX < SpriteWindow_Base
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -311,8 +306,6 @@ def pbCsvPosInt!(str)
return ret.to_i return ret.to_i
end end
#=============================================================================== #===============================================================================
# Money and coins windows # Money and coins windows
#=============================================================================== #===============================================================================
@@ -368,8 +361,6 @@ def pbDisplayBattlePointsWindow(msgwindow)
return pointswindow return pointswindow
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -410,8 +401,6 @@ def pbDisposeMessageWindow(msgwindow)
msgwindow.dispose msgwindow.dispose
end end
#=============================================================================== #===============================================================================
# Main message-displaying function # Main message-displaying function
#=============================================================================== #===============================================================================
@@ -701,8 +690,6 @@ def pbMessageDisplay(msgwindow, message, letterbyletter = true, commandProc = ni
return ret return ret
end end
#=============================================================================== #===============================================================================
# Message-displaying functions # Message-displaying functions
#=============================================================================== #===============================================================================
@@ -81,8 +81,6 @@ class CharacterEntryHelper
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -217,8 +215,6 @@ class Window_TextEntry < SpriteWindow_Base
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -253,8 +249,6 @@ class Window_TextEntry_Keyboard < Window_TextEntry
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
+4 -7
View File
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
class PictureSprite < Sprite class PictureSprite < Sprite
def initialize(viewport, picture) def initialize(viewport, picture)
super(viewport) super(viewport)
@@ -50,8 +53,6 @@ class PictureSprite < Sprite
end end
end end
def pbTextBitmap(text, maxwidth = Graphics.width) def pbTextBitmap(text, maxwidth = Graphics.width)
tmp = Bitmap.new(maxwidth, Graphics.height) tmp = Bitmap.new(maxwidth, Graphics.height)
pbSetSystemFont(tmp) pbSetSystemFont(tmp)
@@ -59,10 +60,8 @@ def pbTextBitmap(text, maxwidth = Graphics.width)
return tmp return tmp
end end
#=============================================================================== #===============================================================================
# EventScene #
#=============================================================================== #===============================================================================
class EventScene class EventScene
attr_accessor :onCTrigger, :onBTrigger, :onUpdate attr_accessor :onCTrigger, :onBTrigger, :onUpdate
@@ -181,8 +180,6 @@ class EventScene
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -14,10 +14,10 @@ module GameData
include InstanceMethods include InstanceMethods
SCHEMA = { SCHEMA = {
"SectionName" => [:id, "m"], "SectionName" => [:id, "m"],
"Name" => [:real_name, "s"], "Name" => [:real_name, "s"],
"Description" => [:real_description, "q"], "Description" => [:real_description, "q"],
"Flags" => [:flags, "*s"] "Flags" => [:flags, "*s"]
} }
def initialize(hash) def initialize(hash)
@@ -31,10 +31,10 @@ module GameData
"Price" => [:price, "u"], "Price" => [:price, "u"],
"SellPrice" => [:sell_price, "u"], "SellPrice" => [:sell_price, "u"],
"BPPrice" => [:bp_price, "u"], "BPPrice" => [:bp_price, "u"],
"FieldUse" => [:field_use, "e", { "OnPokemon" => 1, "Direct" => 2, "FieldUse" => [:field_use, "e", {"OnPokemon" => 1, "Direct" => 2,
"TM" => 3, "HM" => 4, "TR" => 5 }], "TM" => 3, "HM" => 4, "TR" => 5}],
"BattleUse" => [:battle_use, "e", { "OnPokemon" => 1, "OnMove" => 2, "BattleUse" => [:battle_use, "e", {"OnPokemon" => 1, "OnMove" => 2,
"OnBattler" => 3, "OnFoe" => 4, "Direct" => 5 }], "OnBattler" => 3, "OnFoe" => 4, "Direct" => 5}],
"Flags" => [:flags, "*s"], "Flags" => [:flags, "*s"],
"Consumable" => [:consumable, "b"], "Consumable" => [:consumable, "b"],
"Move" => [:move, "e", :Move], "Move" => [:move, "e", :Move],
@@ -38,7 +38,7 @@ module GameData
if form > 0 if form > 0
trial = sprintf("%s_%d", species, form).to_sym trial = sprintf("%s_%d", species, form).to_sym
if !DATA.has_key?(trial) if !DATA.has_key?(trial)
self.register({ :id => species }) if !DATA[species] self.register({:id => species}) if !DATA[species]
self.register({ self.register({
:id => trial, :id => trial,
:species => species, :species => species,
@@ -52,7 +52,7 @@ module GameData
end end
return DATA[trial] return DATA[trial]
end end
self.register({ :id => species }) if !DATA[species] self.register({:id => species}) if !DATA[species]
return DATA[species] return DATA[species]
end end
@@ -18,10 +18,10 @@ module GameData
SCHEMA = { SCHEMA = {
"SectionName" => [:id, "m"], "SectionName" => [:id, "m"],
"Name" => [:real_name, "s"], "Name" => [:real_name, "s"],
"Gender" => [:gender, "e", { "Male" => 0, "male" => 0, "M" => 0, "m" => 0, "0" => 0, "Gender" => [:gender, "e", {"Male" => 0, "male" => 0, "M" => 0, "m" => 0, "0" => 0,
"Female" => 1, "female" => 1, "F" => 1, "f" => 1, "1" => 1, "Female" => 1, "female" => 1, "F" => 1, "f" => 1, "1" => 1,
"Unknown" => 2, "unknown" => 2, "Other" => 2, "other" => 2, "Unknown" => 2, "unknown" => 2, "Other" => 2, "other" => 2,
"Mixed" => 2, "mixed" => 2, "X" => 2, "x" => 2, "2" => 2 }], "Mixed" => 2, "mixed" => 2, "X" => 2, "x" => 2, "2" => 2}],
"BaseMoney" => [:base_money, "u"], "BaseMoney" => [:base_money, "u"],
"SkillLevel" => [:skill_level, "u"], "SkillLevel" => [:skill_level, "u"],
"Flags" => [:flags, "*s"], "Flags" => [:flags, "*s"],
@@ -30,8 +30,8 @@ module GameData
"Ability" => [:ability, "e", :Ability], "Ability" => [:ability, "e", :Ability],
"AbilityIndex" => [:ability_index, "u"], "AbilityIndex" => [:ability_index, "u"],
"Item" => [:item, "e", :Item], "Item" => [:item, "e", :Item],
"Gender" => [:gender, "e", { "M" => 0, "m" => 0, "Male" => 0, "male" => 0, "0" => 0, "Gender" => [:gender, "e", {"M" => 0, "m" => 0, "Male" => 0, "male" => 0, "0" => 0,
"F" => 1, "f" => 1, "Female" => 1, "female" => 1, "1" => 1 }], "F" => 1, "f" => 1, "Female" => 1, "female" => 1, "1" => 1}],
"Nature" => [:nature, "e", :Nature], "Nature" => [:nature, "e", :Nature],
"IV" => [:iv, "uUUUUU"], "IV" => [:iv, "uUUUUU"],
"EV" => [:ev, "uUUUUU"], "EV" => [:ev, "uUUUUU"],
@@ -42,7 +42,7 @@ module GameData
validate tr_type => [Symbol, String] validate tr_type => [Symbol, String]
validate tr_name => [String, NilClass] validate tr_name => [String, NilClass]
key = [tr_type.to_sym, tr_name, tr_version] 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? return !self::DATA[key].nil?
end end
@@ -164,11 +164,11 @@ class Battle
@runCommand = 0 @runCommand = 0
@nextPickupUse = 0 @nextPickupUse = 0
if GameData::Move.exists?(:STRUGGLE) 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 else
@struggle = Move::Struggle.new(self, nil) @struggle = Move::Struggle.new(self, nil)
end end
@mega_rings = [] @mega_rings = []
GameData::Item.each { |item| @mega_rings.push(item.id) if item.has_flag?("MegaRing") } GameData::Item.each { |item| @mega_rings.push(item.id) if item.has_flag?("MegaRing") }
@battleAI = AI.new(self) @battleAI = AI.new(self)
end end
@@ -144,7 +144,7 @@ class Battle::Battler
def pbResetTypes def pbResetTypes
@types = @pokemon.types @types = @pokemon.types
@effects[PBEffects::ExtraType] = nil @effects[PBEffects::ExtraType] = nil
@effects[PBEffects::BurnUp] = false @effects[PBEffects::BurnUp] = false
@effects[PBEffects::Roost] = false @effects[PBEffects::Roost] = false
end end
@@ -453,8 +453,6 @@ class Battle::Move::DoublePowerIfTargetPoisoned < Battle::Move
end end
end end
#=============================================================================== #===============================================================================
# Power is doubled if the target is paralyzed. Cures the target of paralysis. # Power is doubled if the target is paralyzed. Cures the target of paralysis.
# (Smelling Salts) # (Smelling Salts)
@@ -91,8 +91,6 @@ class Battle::Scene::MenuBase
end end
end end
#=============================================================================== #===============================================================================
# Command menu (Fight/Pokémon/Bag/Run) # Command menu (Fight/Pokémon/Bag/Run)
#=============================================================================== #===============================================================================
@@ -194,8 +192,6 @@ class Battle::Scene::CommandMenu < Battle::Scene::MenuBase
end end
end end
#=============================================================================== #===============================================================================
# Fight menu (choose a move) # Fight menu (choose a move)
#=============================================================================== #===============================================================================
@@ -440,8 +436,6 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase
end end
end end
#=============================================================================== #===============================================================================
# Target menu (choose a move's target) # Target menu (choose a move's target)
# NOTE: Unlike the command and fight menus, this one doesn't have a textbox-only # NOTE: Unlike the command and fight menus, this one doesn't have a textbox-only
@@ -402,8 +402,6 @@ class Battle::Scene::PokemonDataBox < Sprite
end end
end end
#=============================================================================== #===============================================================================
# Splash bar to announce a triggered ability # Splash bar to announce a triggered ability
#=============================================================================== #===============================================================================
@@ -496,8 +494,6 @@ class Battle::Scene::AbilitySplashBar < Sprite
end end
end end
#=============================================================================== #===============================================================================
# Pokémon sprite (used in battle) # Pokémon sprite (used in battle)
#=============================================================================== #===============================================================================
@@ -624,8 +620,6 @@ class Battle::Scene::BattlerSprite < RPG::Sprite
end end
end end
#=============================================================================== #===============================================================================
# Shadow sprite for Pokémon (used in battle) # Shadow sprite for Pokémon (used in battle)
#=============================================================================== #===============================================================================
@@ -57,8 +57,6 @@ class Battle::Scene::Animation::Intro < Battle::Scene::Animation
end end
end end
#=============================================================================== #===============================================================================
# Shows wild Pokémon fading back to their normal color, and triggers their intro # Shows wild Pokémon fading back to their normal color, and triggers their intro
# animations # animations
@@ -80,8 +78,6 @@ class Battle::Scene::Animation::Intro2 < Battle::Scene::Animation
end end
end end
#=============================================================================== #===============================================================================
# Makes a side's party bar and balls appear # Makes a side's party bar and balls appear
#=============================================================================== #===============================================================================
@@ -181,8 +177,6 @@ class Battle::Scene::Animation::LineupAppear < Battle::Scene::Animation
end end
end end
#=============================================================================== #===============================================================================
# Makes a Pokémon's data box appear # Makes a Pokémon's data box appear
#=============================================================================== #===============================================================================
@@ -202,8 +196,6 @@ class Battle::Scene::Animation::DataBoxAppear < Battle::Scene::Animation
end end
end end
#=============================================================================== #===============================================================================
# Makes a Pokémon's data box disappear # Makes a Pokémon's data box disappear
#=============================================================================== #===============================================================================
@@ -222,8 +214,6 @@ class Battle::Scene::Animation::DataBoxDisappear < Battle::Scene::Animation
end end
end end
#=============================================================================== #===============================================================================
# Makes a Pokémon's ability bar appear # Makes a Pokémon's ability bar appear
#=============================================================================== #===============================================================================
@@ -242,8 +232,6 @@ class Battle::Scene::Animation::AbilitySplashAppear < Battle::Scene::Animation
end end
end end
#=============================================================================== #===============================================================================
# Makes a Pokémon's ability bar disappear # Makes a Pokémon's ability bar disappear
#=============================================================================== #===============================================================================
@@ -262,8 +250,6 @@ class Battle::Scene::Animation::AbilitySplashDisappear < Battle::Scene::Animatio
end end
end end
#=============================================================================== #===============================================================================
# Make an enemy trainer slide on-screen from the right. Makes the previous # 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. # 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
end end
#=============================================================================== #===============================================================================
# Shows the player (and partner) and the player party lineup sliding off screen. # 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). # 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
end end
#=============================================================================== #===============================================================================
# Shows the enemy trainer(s) and the enemy party lineup sliding off screen. # Shows the enemy trainer(s) and the enemy party lineup sliding off screen.
# Doesn't show the ball thrown or the Pokémon. # Doesn't show the ball thrown or the Pokémon.
@@ -395,8 +377,6 @@ class Battle::Scene::Animation::TrainerFade < Battle::Scene::Animation
end end
end end
#=============================================================================== #===============================================================================
# Shows a Pokémon being sent out on the player's side (including by a partner). # Shows a Pokémon being sent out on the player's side (including by a partner).
# Includes the Poké Ball being thrown. # Includes the Poké Ball being thrown.
@@ -473,8 +453,6 @@ class Battle::Scene::Animation::PokeballPlayerSendOut < Battle::Scene::Animation
end end
end end
#=============================================================================== #===============================================================================
# Shows a Pokémon being sent out on the opposing side. # Shows a Pokémon being sent out on the opposing side.
# Includes the Poké Ball being "thrown" (although here the Poké Ball just # 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
end end
#=============================================================================== #===============================================================================
# Shows a Pokémon being recalled into its Poké Ball # Shows a Pokémon being recalled into its Poké Ball
#=============================================================================== #===============================================================================
@@ -594,8 +570,6 @@ class Battle::Scene::Animation::BattlerRecall < Battle::Scene::Animation
end end
end end
#=============================================================================== #===============================================================================
# Shows a Pokémon flashing after taking damage # Shows a Pokémon flashing after taking damage
#=============================================================================== #===============================================================================
@@ -632,8 +606,6 @@ class Battle::Scene::Animation::BattlerDamage < Battle::Scene::Animation
end end
end end
#=============================================================================== #===============================================================================
# Shows a Pokémon fainting # Shows a Pokémon fainting
#=============================================================================== #===============================================================================
@@ -682,8 +654,6 @@ class Battle::Scene::Animation::BattlerFaint < Battle::Scene::Animation
end end
end end
#=============================================================================== #===============================================================================
# Shows the player's Poké Ball being thrown to capture a Pokémon # 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
end end
#=============================================================================== #===============================================================================
# Shows the player throwing a Poké Ball and it being deflected # Shows the player throwing a Poké Ball and it being deflected
#=============================================================================== #===============================================================================
@@ -57,8 +57,7 @@ class Battle::DebugSceneNoLogging
def pbChangePokemon(idxBattler, pkmn); end def pbChangePokemon(idxBattler, pkmn); end
def pbFaintBattler(battler); end def pbFaintBattler(battler); end
def pbEXPBar(battler, startExp, endExp, tempExp1, tempExp2); end def pbEXPBar(battler, startExp, endExp, tempExp1, tempExp2); end
def pbLevelUp(pkmn, battler, oldTotalHP, oldAttack, oldDefense, def pbLevelUp(pkmn, battler, oldTotalHP, oldAttack, oldDefense, oldSpAtk, oldSpDef, oldSpeed); end
oldSpAtk, oldSpDef, oldSpeed); end
def pbForgetMove(pkmn, moveToLearn); return 0; end # Always forget first move def pbForgetMove(pkmn, moveToLearn); return 0; end # Always forget first move
def pbCommandMenu(idxBattler, firstAction) def pbCommandMenu(idxBattler, firstAction)
@@ -51,8 +51,9 @@ class Battle
end end
end end
#===============================================================================
#
#===============================================================================
class Battle::Battler class Battle::Battler
unless @__clauses__aliased unless @__clauses__aliased
alias __clauses__pbCanSleep? pbCanSleep? alias __clauses__pbCanSleep? pbCanSleep?
@@ -100,9 +101,10 @@ class Battle::Battler
end end
end end
#===============================================================================
# Double Team
class Battle::Move::RaiseUserEvasion1 # Double Team #===============================================================================
class Battle::Move::RaiseUserEvasion1
unless method_defined?(:__clauses__pbMoveFailed?) unless method_defined?(:__clauses__pbMoveFailed?)
alias __clauses__pbMoveFailed? pbMoveFailed? alias __clauses__pbMoveFailed? pbMoveFailed?
end end
@@ -116,9 +118,10 @@ class Battle::Move::RaiseUserEvasion1 # Double Team
end end
end end
#===============================================================================
# Minimize
class Battle::Move::RaiseUserEvasion2MinimizeUser # Minimize #===============================================================================
class Battle::Move::RaiseUserEvasion2MinimizeUser
unless method_defined?(:__clauses__pbMoveFailed?) unless method_defined?(:__clauses__pbMoveFailed?)
alias __clauses__pbMoveFailed? pbMoveFailed? alias __clauses__pbMoveFailed? pbMoveFailed?
end end
@@ -132,9 +135,10 @@ class Battle::Move::RaiseUserEvasion2MinimizeUser # Minimize
end end
end end
#===============================================================================
# Skill Swap
class Battle::Move::UserTargetSwapAbilities # Skill Swap #===============================================================================
class Battle::Move::UserTargetSwapAbilities
unless method_defined?(:__clauses__pbFailsAgainstTarget?) unless method_defined?(:__clauses__pbFailsAgainstTarget?)
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget? alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
end end
@@ -148,9 +152,10 @@ class Battle::Move::UserTargetSwapAbilities # Skill Swap
end end
end end
#===============================================================================
# Sonic Boom
class Battle::Move::FixedDamage20 # Sonic Boom #===============================================================================
class Battle::Move::FixedDamage20
unless method_defined?(:__clauses__pbFailsAgainstTarget?) unless method_defined?(:__clauses__pbFailsAgainstTarget?)
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget? alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
end end
@@ -164,9 +169,10 @@ class Battle::Move::FixedDamage20 # Sonic Boom
end end
end end
#===============================================================================
# Dragon Rage
class Battle::Move::FixedDamage40 # Dragon Rage #===============================================================================
class Battle::Move::FixedDamage40
unless method_defined?(:__clauses__pbFailsAgainstTarget?) unless method_defined?(:__clauses__pbFailsAgainstTarget?)
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget? alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
end end
@@ -180,8 +186,9 @@ class Battle::Move::FixedDamage40 # Dragon Rage
end end
end end
#===============================================================================
#
#===============================================================================
class Battle::Move::OHKO class Battle::Move::OHKO
unless method_defined?(:__clauses__pbFailsAgainstTarget?) unless method_defined?(:__clauses__pbFailsAgainstTarget?)
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget? alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
@@ -196,8 +203,9 @@ class Battle::Move::OHKO
end end
end end
#===============================================================================
#
#===============================================================================
class Battle::Move::OHKOIce class Battle::Move::OHKOIce
unless method_defined?(:__clauses__pbFailsAgainstTarget?) unless method_defined?(:__clauses__pbFailsAgainstTarget?)
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget? alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
@@ -212,8 +220,9 @@ class Battle::Move::OHKOIce
end end
end end
#===============================================================================
#
#===============================================================================
class Battle::Move::OHKOHitsUndergroundTarget class Battle::Move::OHKOHitsUndergroundTarget
unless method_defined?(:__clauses__pbFailsAgainstTarget?) unless method_defined?(:__clauses__pbFailsAgainstTarget?)
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget? alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
@@ -228,9 +237,10 @@ class Battle::Move::OHKOHitsUndergroundTarget
end end
end end
#===============================================================================
# Self-Destruct
class Battle::Move::UserFaintsExplosive # Self-Destruct #===============================================================================
class Battle::Move::UserFaintsExplosive
unless method_defined?(:__clauses__pbMoveFailed?) unless method_defined?(:__clauses__pbMoveFailed?)
alias __clauses__pbMoveFailed? pbMoveFailed? alias __clauses__pbMoveFailed? pbMoveFailed?
end end
@@ -259,9 +269,10 @@ class Battle::Move::UserFaintsExplosive # Self-Destruct
end end
end end
#===============================================================================
# Perish Song
class Battle::Move::StartPerishCountsForAllBattlers # Perish Song #===============================================================================
class Battle::Move::StartPerishCountsForAllBattlers
unless method_defined?(:__clauses__pbFailsAgainstTarget?) unless method_defined?(:__clauses__pbFailsAgainstTarget?)
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget? alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
end end
@@ -276,9 +287,10 @@ class Battle::Move::StartPerishCountsForAllBattlers # Perish Song
end end
end end
#===============================================================================
# Destiny Bond
class Battle::Move::AttackerFaintsIfUserFaints # Destiny Bond #===============================================================================
class Battle::Move::AttackerFaintsIfUserFaints
unless method_defined?(:__clauses__pbFailsAgainstTarget?) unless method_defined?(:__clauses__pbFailsAgainstTarget?)
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget? alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
end end
@@ -29,8 +29,6 @@ class AnimFrame
FOCUS = 26 FOCUS = 26
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -166,8 +164,6 @@ def pbConvertRPGAnimation(animation)
return pbAnim return pbAnim
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -230,8 +226,6 @@ class RPG::Animation
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -333,8 +327,6 @@ class PBAnimTiming
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -397,8 +389,6 @@ class PBAnimations < Array
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -598,8 +588,6 @@ class PBAnimation < Array
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -678,8 +666,6 @@ def pbSpriteSetAnimFrame(sprite, frame, user = nil, target = nil, inEditor = fal
end end
end end
#=============================================================================== #===============================================================================
# Animation player # Animation player
#=============================================================================== #===============================================================================
@@ -888,10 +888,7 @@ Battle::AbilityEffects::MoveBlocking.add(:DAZZLING,
next false if battle.choices[user.index][4] <= 0 next false if battle.choices[user.index][4] <= 0
next false if !bearer.opposes?(user) next false if !bearer.opposes?(user)
ret = false ret = false
targets.each do |b| targets.each { |b| ret = true if b.opposes?(user) }
next if !b.opposes?(user)
ret = true
end
next ret next ret
} }
) )
@@ -54,8 +54,6 @@ class Battle::FakeBattler
def pbReset; end def pbReset; end
end end
#=============================================================================== #===============================================================================
# Data box for safari battles # Data box for safari battles
#=============================================================================== #===============================================================================
@@ -93,8 +91,6 @@ class Battle::Scene::SafariDataBox < Sprite
end end
end end
#=============================================================================== #===============================================================================
# Shows the player throwing bait at a wild Pokémon in a Safari battle. # 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
end end
#=============================================================================== #===============================================================================
# Shows the player throwing a rock at a wild Pokémon in a Safari battle. # 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
end end
#=============================================================================== #===============================================================================
# Safari Zone battle scene (the visuals of the battle) # Safari Zone battle scene (the visuals of the battle)
#=============================================================================== #===============================================================================
@@ -280,8 +272,6 @@ class Battle::Scene
end end
end end
#=============================================================================== #===============================================================================
# Safari Zone battle class # Safari Zone battle class
#=============================================================================== #===============================================================================
@@ -308,9 +298,9 @@ class SafariBattle
def pbRandom(x); return rand(x); end def pbRandom(x); return rand(x); end
#============================================================================= #-----------------------------------------------------------------------------
# Initialize the battle class # Initialize the battle class
#============================================================================= #-----------------------------------------------------------------------------
def initialize(scene, player, party2) def initialize(scene, player, party2)
@scene = scene @scene = scene
@peer = Battle::Peer.new @peer = Battle::Peer.new
@@ -335,9 +325,9 @@ class SafariBattle
def defaultWeather=(value); @weather = value; end def defaultWeather=(value); @weather = value; end
def defaultTerrain=(value); end def defaultTerrain=(value); end
#============================================================================= #-----------------------------------------------------------------------------
# Information about the type and size of the battle # Information about the type and size of the battle
#============================================================================= #-----------------------------------------------------------------------------
def wildBattle?; return true; end def wildBattle?; return true; end
def trainerBattle?; return false; end def trainerBattle?; return false; end
@@ -347,9 +337,9 @@ class SafariBattle
return @sideSizes[index % 2] return @sideSizes[index % 2]
end end
#============================================================================= #-----------------------------------------------------------------------------
# Trainers and owner-related # Trainers and owner-related
#============================================================================= #-----------------------------------------------------------------------------
def pbPlayer; return @player[0]; end def pbPlayer; return @player[0]; end
def opponent; return nil; end def opponent; return nil; end
@@ -374,18 +364,18 @@ class SafariBattle
end end
end end
#============================================================================= #-----------------------------------------------------------------------------
# Get party info (counts all teams on the same side) # Get party info (counts all teams on the same side)
#============================================================================= #-----------------------------------------------------------------------------
def pbParty(idxBattler) def pbParty(idxBattler)
return (opposes?(idxBattler)) ? @party2 : nil return (opposes?(idxBattler)) ? @party2 : nil
end end
def pbAllFainted?(idxBattler = 0); return false; end def pbAllFainted?(idxBattler = 0); return false; end
#============================================================================= #-----------------------------------------------------------------------------
# Battler-related # Battler-related
#============================================================================= #-----------------------------------------------------------------------------
def opposes?(idxBattler1, idxBattler2 = 0) def opposes?(idxBattler1, idxBattler2 = 0)
idxBattler1 = idxBattler1.index if idxBattler1.respond_to?("index") idxBattler1 = idxBattler1.index if idxBattler1.respond_to?("index")
idxBattler2 = idxBattler2.index if idxBattler2.respond_to?("index") idxBattler2 = idxBattler2.index if idxBattler2.respond_to?("index")
@@ -395,9 +385,9 @@ class SafariBattle
def pbRemoveFromParty(idxBattler, idxParty); end def pbRemoveFromParty(idxBattler, idxParty); end
def pbGainExp; end def pbGainExp; end
#============================================================================= #-----------------------------------------------------------------------------
# Messages and animations # Messages and animations
#============================================================================= #-----------------------------------------------------------------------------
def pbDisplay(msg, &block) def pbDisplay(msg, &block)
@scene.pbDisplayMessage(msg, &block) @scene.pbDisplayMessage(msg, &block)
end end
@@ -414,17 +404,15 @@ class SafariBattle
return @scene.pbDisplayConfirmMessage(msg) return @scene.pbDisplayConfirmMessage(msg)
end end
class BattleAbortedException < Exception; end class BattleAbortedException < Exception; end
def pbAbort def pbAbort
raise BattleAbortedException.new("Battle aborted") raise BattleAbortedException.new("Battle aborted")
end end
#============================================================================= #-----------------------------------------------------------------------------
# Safari battle-specific methods # Safari battle-specific methods
#============================================================================= #-----------------------------------------------------------------------------
def pbEscapeRate(catch_rate) def pbEscapeRate(catch_rate)
return 125 if catch_rate <= 45 # Escape factor 9 (45%) return 125 if catch_rate <= 45 # Escape factor 9 (45%)
return 100 if catch_rate <= 60 # Escape factor 7 (35%) return 100 if catch_rate <= 60 # Escape factor 7 (35%)
@@ -26,8 +26,6 @@ class Battle::Scene
end end
end end
#=============================================================================== #===============================================================================
# Bug Catching Contest battle class # Bug Catching Contest battle class
#=============================================================================== #===============================================================================
@@ -164,8 +164,6 @@ class BattlePalaceBattle < Battle
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -35,8 +35,6 @@ class Battle::SuccessState
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -203,8 +201,6 @@ class BattleArenaBattle < Battle
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -221,8 +217,6 @@ class Battle::AI
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -38,8 +38,6 @@ class LocationWindow
end end
end end
#=============================================================================== #===============================================================================
# Visibility circle in dark maps # Visibility circle in dark maps
#=============================================================================== #===============================================================================
@@ -85,8 +83,6 @@ class DarknessSprite < Sprite
end end
end end
#=============================================================================== #===============================================================================
# Light effects # Light effects
#=============================================================================== #===============================================================================
@@ -120,8 +116,9 @@ class LightEffect
end end
end end
#===============================================================================
#
#===============================================================================
class LightEffect_Lamp < LightEffect class LightEffect_Lamp < LightEffect
def initialize(event, viewport = nil, map = nil) def initialize(event, viewport = nil, map = nil)
lamp = AnimatedBitmap.new("Graphics/Pictures/LE") lamp = AnimatedBitmap.new("Graphics/Pictures/LE")
@@ -138,8 +135,9 @@ class LightEffect_Lamp < LightEffect
end end
end end
#===============================================================================
#
#===============================================================================
class LightEffect_Basic < LightEffect class LightEffect_Basic < LightEffect
def initialize(event, viewport = nil, map = nil, filename = nil) def initialize(event, viewport = nil, map = nil, filename = nil)
super super
@@ -164,8 +162,9 @@ class LightEffect_Basic < LightEffect
end end
end end
#===============================================================================
#
#===============================================================================
class LightEffect_DayNight < LightEffect class LightEffect_DayNight < LightEffect
def initialize(event, viewport = nil, map = nil, filename = nil) def initialize(event, viewport = nil, map = nil, filename = nil)
super super
@@ -203,8 +202,9 @@ class LightEffect_DayNight < LightEffect
end end
end end
#===============================================================================
#
#===============================================================================
EventHandlers.add(:on_new_spriteset_map, :add_light_effects, EventHandlers.add(:on_new_spriteset_map, :add_light_effects,
proc { |spriteset, viewport| proc { |spriteset, viewport|
map = spriteset.map # Map associated with the spriteset (not necessarily the current map) map = spriteset.map # Map associated with the spriteset (not necessarily the current map)
@@ -76,8 +76,6 @@ def pbCaveExit
pbCaveEntranceEx(true) pbCaveEntranceEx(true)
end end
#=============================================================================== #===============================================================================
# Blacking out animation # Blacking out animation
#=============================================================================== #===============================================================================
+12 -36
View File
@@ -25,16 +25,12 @@ def pbPokerus?
return false return false
end end
class Game_Temp class Game_Temp
attr_accessor :warned_low_battery attr_accessor :warned_low_battery
attr_accessor :cue_bgm attr_accessor :cue_bgm
attr_accessor :cue_bgm_frame_delay attr_accessor :cue_bgm_frame_delay
end end
def pbBatteryLow? def pbBatteryLow?
pstate = System.power_state pstate = System.power_state
# If it's not discharging, it doesn't matter if it's low # 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 $game_temp.force_single_battle = false
end end
#=============================================================================== #===============================================================================
# Checks when moving between maps # Checks when moving between maps
#=============================================================================== #===============================================================================
@@ -331,8 +325,6 @@ EventHandlers.add(:on_map_or_spriteset_change, :show_location_window,
} }
) )
#=============================================================================== #===============================================================================
# Event locations, terrain tags # Event locations, terrain tags
#=============================================================================== #===============================================================================
@@ -416,8 +408,6 @@ def pbFacingEachOther(event1, event2)
return pbEventFacesPlayer?(event1, event2, 1) && pbEventFacesPlayer?(event2, event1, 1) return pbEventFacesPlayer?(event1, event2, 1) && pbEventFacesPlayer?(event2, event1, 1)
end end
#=============================================================================== #===============================================================================
# Audio playing # Audio playing
#=============================================================================== #===============================================================================
@@ -454,8 +444,6 @@ def pbAutoplayOnSave
end end
end end
#=============================================================================== #===============================================================================
# Event movement # Event movement
#=============================================================================== #===============================================================================
@@ -473,8 +461,8 @@ module PBMoveRoute
AwayFromPlayer = 11 AwayFromPlayer = 11
Forward = 12 Forward = 12
Backward = 13 Backward = 13
Jump = 14 # xoffset, yoffset Jump = 14 # xoffset, yoffset
Wait = 15 # frames Wait = 15 # frames
TurnDown = 16 TurnDown = 16
TurnLeft = 17 TurnLeft = 17
TurnRight = 18 TurnRight = 18
@@ -486,10 +474,10 @@ module PBMoveRoute
TurnRandom = 24 TurnRandom = 24
TurnTowardPlayer = 25 TurnTowardPlayer = 25
TurnAwayFromPlayer = 26 TurnAwayFromPlayer = 26
SwitchOn = 27 # 1 param SwitchOn = 27 # 1 param
SwitchOff = 28 # 1 param SwitchOff = 28 # 1 param
ChangeSpeed = 29 # 1 param ChangeSpeed = 29 # 1 param
ChangeFreq = 30 # 1 param ChangeFreq = 30 # 1 param
WalkAnimeOn = 31 WalkAnimeOn = 31
WalkAnimeOff = 32 WalkAnimeOff = 32
StepAnimeOn = 33 StepAnimeOn = 33
@@ -500,16 +488,14 @@ module PBMoveRoute
ThroughOff = 38 ThroughOff = 38
AlwaysOnTopOn = 39 AlwaysOnTopOn = 39
AlwaysOnTopOff = 40 AlwaysOnTopOff = 40
Graphic = 41 # Name, hue, direction, pattern Graphic = 41 # Name, hue, direction, pattern
Opacity = 42 # 1 param Opacity = 42 # 1 param
Blending = 43 # 1 param Blending = 43 # 1 param
PlaySE = 44 # 1 param PlaySE = 44 # 1 param
Script = 45 # 1 param Script = 45 # 1 param
ScriptAsync = 101 # 1 param ScriptAsync = 101 # 1 param
end end
def pbMoveRoute(event, commands, waitComplete = false) def pbMoveRoute(event, commands, waitComplete = false)
route = RPG::MoveRoute.new route = RPG::MoveRoute.new
route.repeat = false route.repeat = false
@@ -555,8 +541,6 @@ def pbWait(numFrames)
end end
end end
#=============================================================================== #===============================================================================
# Player/event movement in the field # Player/event movement in the field
#=============================================================================== #===============================================================================
@@ -644,8 +628,6 @@ def pbJumpToward(dist = 1, playSound = false, cancelSurf = false)
return false return false
end end
#=============================================================================== #===============================================================================
# Bridges, cave escape points, and setting the heal point # Bridges, cave escape points, and setting the heal point
#=============================================================================== #===============================================================================
@@ -689,8 +671,6 @@ def pbSetPokemonCenter
$PokemonGlobal.pokecenterDirection = $game_player.direction $PokemonGlobal.pokecenterDirection = $game_player.direction
end end
#=============================================================================== #===============================================================================
# Partner trainer # Partner trainer
#=============================================================================== #===============================================================================
@@ -710,8 +690,6 @@ def pbDeregisterPartner
$PokemonGlobal.partner = nil $PokemonGlobal.partner = nil
end end
#=============================================================================== #===============================================================================
# Picking up an item found on the ground # Picking up an item found on the ground
#=============================================================================== #===============================================================================
@@ -752,8 +730,6 @@ def pbItemBall(item, quantity = 1)
return false return false
end end
#=============================================================================== #===============================================================================
# Being given an item # Being given an item
#=============================================================================== #===============================================================================
@@ -8,8 +8,9 @@ class PokemonGlobalMetadata
attr_accessor :nextBattleBack attr_accessor :nextBattleBack
end end
#===============================================================================
#
#===============================================================================
class Game_Temp class Game_Temp
attr_accessor :encounter_triggered attr_accessor :encounter_triggered
attr_accessor :encounter_type attr_accessor :encounter_type
@@ -61,8 +62,9 @@ class Game_Temp
end end
end end
#===============================================================================
#
#===============================================================================
def setBattleRule(*args) def setBattleRule(*args)
r = nil r = nil
args.each do |arg| args.each do |arg|
@@ -26,7 +26,7 @@ class PokemonEncounters
@chance_accumulator = 0 @chance_accumulator = 0
end end
#============================================================================= #-----------------------------------------------------------------------------
# Returns whether encounters for the given encounter type have been defined # Returns whether encounters for the given encounter type have been defined
# for the current map. # for the current map.
@@ -84,7 +84,7 @@ class PokemonEncounters
return false return false
end end
#============================================================================= #-----------------------------------------------------------------------------
# Returns whether the player's current location allows wild encounters to # Returns whether the player's current location allows wild encounters to
# trigger upon taking a step. # trigger upon taking a step.
@@ -262,7 +262,7 @@ class PokemonEncounters
return ret return ret
end end
#============================================================================= #-----------------------------------------------------------------------------
# For the current map, randomly chooses a species and level from the encounter # 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. # list for the given encounter type. Returns nil if there are none defined.
@@ -375,8 +375,6 @@ class PokemonEncounters
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
class PokemonGlobalMetadata class PokemonGlobalMetadata
attr_accessor :roamPosition attr_accessor :roamPosition
attr_accessor :roamedAlready # Whether a roamer has been encountered on current map attr_accessor :roamedAlready # Whether a roamer has been encountered on current map
@@ -11,8 +14,6 @@ class PokemonGlobalMetadata
end end
end end
#=============================================================================== #===============================================================================
# Making roaming Pokémon roam around. # 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. # 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 attr_accessor :roamer_index_for_encounter # Index of roaming Pokémon to encounter next
end end
#===============================================================================
#
#===============================================================================
# Returns whether the given category of encounter contains the actual encounter # Returns whether the given category of encounter contains the actual encounter
# method that will occur in the player's current position. # method that will occur in the player's current position.
def pbRoamingMethodAllowed(roamer_method) def pbRoamingMethodAllowed(roamer_method)
@@ -115,8 +115,6 @@ class PokemonGlobalMetadata
end end
end end
#=============================================================================== #===============================================================================
# This class keeps track of erased and moved events so their position # 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 # can remain after a game is saved and loaded. This class also includes
@@ -5,8 +5,9 @@ def pbGetTimeNow
return Time.now return Time.now
end end
#===============================================================================
#
#===============================================================================
module PBDayNight module PBDayNight
HOURLY_TONES = [ HOURLY_TONES = [
Tone.new(-70, -90, 15, 55), # Night # Midnight Tone.new(-70, -90, 15, 55), # Night # Midnight
@@ -109,8 +110,9 @@ module PBDayNight
end end
end end
#===============================================================================
#
#===============================================================================
def pbDayNightTint(object) def pbDayNightTint(object)
return if !$scene.is_a?(Scene_Map) return if !$scene.is_a?(Scene_Map)
if Settings::TIME_SHADING && $game_map.metadata&.outdoor_map if Settings::TIME_SHADING && $game_map.metadata&.outdoor_map
@@ -121,85 +123,6 @@ def pbDayNightTint(object)
end end
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 # Days of the week
#=============================================================================== #===============================================================================
@@ -307,3 +230,80 @@ def pbGetSeasonName(season)
_INTL("Autumn"), _INTL("Autumn"),
_INTL("Winter")][season] _INTL("Winter")][season]
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
@@ -33,8 +33,9 @@ module HiddenMoveHandlers
end end
end end
#===============================================================================
#
#===============================================================================
def pbCanUseHiddenMove?(pkmn, move, showmsg = true) def pbCanUseHiddenMove?(pkmn, move, showmsg = true)
return HiddenMoveHandlers.triggerCanUseMove(move, pkmn, showmsg) return HiddenMoveHandlers.triggerCanUseMove(move, pkmn, showmsg)
end end
@@ -62,8 +63,6 @@ def pbCheckHiddenMoveBadge(badge = -1, showmsg = true)
return false return false
end end
#=============================================================================== #===============================================================================
# Hidden move animation # Hidden move animation
#=============================================================================== #===============================================================================
@@ -184,8 +183,6 @@ def pbHiddenMoveAnimation(pokemon)
return true return true
end end
#=============================================================================== #===============================================================================
# Cut # Cut
#=============================================================================== #===============================================================================
@@ -247,8 +244,6 @@ def pbSmashEvent(event)
$PokemonMap&.addErasedEvent(event.id) $PokemonMap&.addErasedEvent(event.id)
end end
#=============================================================================== #===============================================================================
# Dig # Dig
#=============================================================================== #===============================================================================
@@ -294,8 +289,6 @@ HiddenMoveHandlers::UseMove.add(:DIG, proc { |move, pokemon|
next false next false
}) })
#=============================================================================== #===============================================================================
# Dive # Dive
#=============================================================================== #===============================================================================
@@ -460,8 +453,6 @@ HiddenMoveHandlers::UseMove.add(:DIVE, proc { |move, pokemon|
next true next true
}) })
#=============================================================================== #===============================================================================
# Flash # Flash
#=============================================================================== #===============================================================================
@@ -497,8 +488,6 @@ HiddenMoveHandlers::UseMove.add(:FLASH, proc { |move, pokemon|
next true next true
}) })
#=============================================================================== #===============================================================================
# Fly # Fly
#=============================================================================== #===============================================================================
@@ -560,8 +549,6 @@ HiddenMoveHandlers::UseMove.add(:FLY, proc { |move, pkmn|
next true next true
}) })
#=============================================================================== #===============================================================================
# Headbutt # Headbutt
#=============================================================================== #===============================================================================
@@ -626,8 +613,6 @@ HiddenMoveHandlers::UseMove.add(:HEADBUTT, proc { |move, pokemon|
pbHeadbuttEffect(facingEvent) pbHeadbuttEffect(facingEvent)
}) })
#=============================================================================== #===============================================================================
# Rock Smash # Rock Smash
#=============================================================================== #===============================================================================
@@ -678,8 +663,6 @@ HiddenMoveHandlers::UseMove.add(:ROCKSMASH, proc { |move, pokemon|
next true next true
}) })
#=============================================================================== #===============================================================================
# Strength # Strength
#=============================================================================== #===============================================================================
@@ -731,8 +714,6 @@ HiddenMoveHandlers::UseMove.add(:STRENGTH, proc { |move, pokemon|
next true next true
}) })
#=============================================================================== #===============================================================================
# Surf # Surf
#=============================================================================== #===============================================================================
@@ -845,8 +826,6 @@ HiddenMoveHandlers::UseMove.add(:SURF, proc { |move, pokemon|
next true next true
}) })
#=============================================================================== #===============================================================================
# Sweet Scent # Sweet Scent
#=============================================================================== #===============================================================================
@@ -896,8 +875,6 @@ HiddenMoveHandlers::UseMove.add(:SWEETSCENT, proc { |move, pokemon|
next true next true
}) })
#=============================================================================== #===============================================================================
# Teleport # Teleport
#=============================================================================== #===============================================================================
@@ -951,8 +928,6 @@ HiddenMoveHandlers::UseMove.add(:TELEPORT, proc { |move, pokemon|
next true next true
}) })
#=============================================================================== #===============================================================================
# Waterfall # Waterfall
#=============================================================================== #===============================================================================
@@ -50,7 +50,7 @@ module RandomDungeon
def initialize(cw, ch, parameters) def initialize(cw, ch, parameters)
raise ArgumentError.new if cw == 0 || ch == 0 raise ArgumentError.new if cw == 0 || ch == 0
@node_count_x = cw @node_count_x = cw
@node_count_y = ch @node_count_y = ch
@parameters = parameters @parameters = parameters
@nodes = Array.new(@node_count_x * @node_count_y) { MazeNode.new } @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_1 => Console.markup_style("~", bg: :gray),
:upper_wall_in_3 => 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_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) def initialize(width, height)
@@ -352,7 +352,7 @@ module RandomDungeon
@buffer_x += 1 if @buffer_x.odd? @buffer_x += 1 if @buffer_x.odd?
@buffer_y += 1 if @buffer_x.odd? @buffer_y += 1 if @buffer_x.odd?
end end
@parameters = parameters || GameData::DungeonParameters.new({}) @parameters = parameters || GameData::DungeonParameters.new({})
if @tileset.snap_to_large_grid if @tileset.snap_to_large_grid
@parameters.cell_width -= 1 if @parameters.cell_width.odd? @parameters.cell_width -= 1 if @parameters.cell_width.odd?
@parameters.cell_height -= 1 if @parameters.cell_height.odd? @parameters.cell_height -= 1 if @parameters.cell_height.odd?
@@ -443,7 +443,7 @@ module RandomDungeon
paint_decorations(maxWidth, maxHeight) paint_decorations(maxWidth, maxHeight)
# Draw wall top tiles # Draw wall top tiles
paint_wall_top_tiles(maxWidth, maxHeight) paint_wall_top_tiles(maxWidth, maxHeight)
break #if !@need_redraw break # if !@need_redraw
end end
end end
@@ -801,8 +801,8 @@ module RandomDungeon
x += 1 if x.odd? x += 1 if x.odd?
y += 1 if y.odd? y += 1 if y.odd?
end end
x = x.clamp(@buffer_x, @usable_width - @buffer_x - width ) x = x.clamp(@buffer_x, @usable_width - @buffer_x - width)
y = y.clamp(@buffer_y, @usable_height - @buffer_y - height ) y = y.clamp(@buffer_y, @usable_height - @buffer_y - height)
paint_ground_rect(x, y, width, height, :room) paint_ground_rect(x, y, width, height, :room)
end end
@@ -927,7 +927,7 @@ module RandomDungeon
end end
end end
# 1x1 floor decoration # 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 ((@usable_width * @usable_height) / @parameters.floor_decoration_density).times do
x = rand(@usable_width) x = rand(@usable_width)
y = rand(@usable_height) y = rand(@usable_height)
+3 -4
View File
@@ -113,8 +113,9 @@ module ItemHandlers
end end
end end
#===============================================================================
#
#===============================================================================
def pbCanRegisterItem?(item) def pbCanRegisterItem?(item)
return ItemHandlers.hasUseInFieldHandler(item) return ItemHandlers.hasUseInFieldHandler(item)
end end
@@ -123,8 +124,6 @@ def pbCanUseOnPokemon?(item)
return ItemHandlers.hasUseOnPokemon(item) || GameData::Item.get(item).is_machine? return ItemHandlers.hasUseOnPokemon(item) || GameData::Item.get(item).is_machine?
end end
#=============================================================================== #===============================================================================
# Change a Pokémon's level # Change a Pokémon's level
#=============================================================================== #===============================================================================
+12 -10
View File
@@ -1,18 +1,20 @@
#===============================================================================
#
#===============================================================================
class PokemonGlobalMetadata class PokemonGlobalMetadata
attr_accessor :pokeradarBattery attr_accessor :pokeradarBattery
end end
#===============================================================================
#
#===============================================================================
class Game_Temp class Game_Temp
attr_accessor :poke_radar_data # [species, level, chain count, grasses (x,y,ring,rarity)] attr_accessor :poke_radar_data # [species, level, chain count, grasses (x,y,ring,rarity)]
end end
#===============================================================================
################################################################################
# Using the Poke Radar # Using the Poke Radar
################################################################################ #===============================================================================
def pbCanUsePokeRadar? def pbCanUsePokeRadar?
# Can't use Radar if not in tall grass # Can't use Radar if not in tall grass
terrain = $game_map.terrain_tag($game_player.x, $game_player.y) 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) return $PokemonEncounters.choose_wild_pokemon($PokemonEncounters.encounter_type, rarity + 1)
end end
################################################################################ #===============================================================================
# Event handlers # Event handlers
################################################################################ #===============================================================================
EventHandlers.add(:on_wild_species_chosen, :poke_radar_chain, EventHandlers.add(:on_wild_species_chosen, :poke_radar_chain,
proc { |encounter| proc { |encounter|
if GameData::EncounterType.get($game_temp.encounter_type).type != :land || if GameData::EncounterType.get($game_temp.encounter_type).type != :land ||
@@ -246,9 +248,9 @@ EventHandlers.add(:on_enter_map, :cancel_poke_radar,
} }
) )
################################################################################ #===============================================================================
# Item handlers # Item handlers
################################################################################ #===============================================================================
ItemHandlers::UseInField.add(:POKERADAR, proc { |item| ItemHandlers::UseInField.add(:POKERADAR, proc { |item|
next pbUsePokeRadar next pbUsePokeRadar
}) })
+5 -2
View File
@@ -1,4 +1,6 @@
#===============================================================================
# Data structure representing mail that the Pokémon can hold # Data structure representing mail that the Pokémon can hold
#===============================================================================
class Mail class Mail
attr_accessor :item, :message, :sender, :poke1, :poke2, :poke3 attr_accessor :item, :message, :sender, :poke1, :poke2, :poke3
@@ -12,8 +14,9 @@ class Mail
end end
end end
#===============================================================================
#
#===============================================================================
def pbMoveToMailbox(pokemon) def pbMoveToMailbox(pokemon)
$PokemonGlobal.mailbox = [] if !$PokemonGlobal.mailbox $PokemonGlobal.mailbox = [] if !$PokemonGlobal.mailbox
return false if $PokemonGlobal.mailbox.length >= 10 return false if $PokemonGlobal.mailbox.length >= 10
@@ -110,8 +110,6 @@ class ItemIconSprite < Sprite
end end
end end
#=============================================================================== #===============================================================================
# Item held icon (used in the party screen) # Item held icon (used in the party screen)
#=============================================================================== #===============================================================================
+7 -13
View File
@@ -16,15 +16,15 @@ class PokemonBag
end end
def initialize def initialize
@pockets = [] @pockets = []
(0..PokemonBag.pocket_count).each { |i| @pockets[i] = [] } (0..PokemonBag.pocket_count).each { |i| @pockets[i] = [] }
reset_last_selections reset_last_selections
@registered_items = [] @registered_items = []
@ready_menu_selection = [0, 0, 1] # Used by the Ready Menu to remember cursor positions @ready_menu_selection = [0, 0, 1] # Used by the Ready Menu to remember cursor positions
end end
def reset_last_selections def reset_last_selections
@last_viewed_pocket = 1 @last_viewed_pocket = 1
@last_pocket_selections ||= [] @last_pocket_selections ||= []
(0..PokemonBag.pocket_count).each { |i| @last_pocket_selections[i] = 0 } (0..PokemonBag.pocket_count).each { |i| @last_pocket_selections[i] = 0 }
end end
@@ -39,7 +39,7 @@ class PokemonBag
return @pockets return @pockets
end end
#============================================================================= #-----------------------------------------------------------------------------
# Gets the index of the current selected item in the pocket # Gets the index of the current selected item in the pocket
def last_viewed_index(pocket) def last_viewed_index(pocket)
@@ -59,7 +59,7 @@ class PokemonBag
@last_pocket_selections[pocket] = value if value <= @pockets[pocket].length @last_pocket_selections[pocket] = value if value <= @pockets[pocket].length
end end
#============================================================================= #-----------------------------------------------------------------------------
def quantity(item) def quantity(item)
item_data = GameData::Item.try_get(item) item_data = GameData::Item.try_get(item)
@@ -139,7 +139,7 @@ class PokemonBag
return ret return ret
end end
#============================================================================= #-----------------------------------------------------------------------------
# Returns whether item has been registered for quick access in the Ready Menu. # Returns whether item has been registered for quick access in the Ready Menu.
def registered?(item) def registered?(item)
@@ -161,7 +161,7 @@ class PokemonBag
@registered_items.delete(item_data.id) if item_data @registered_items.delete(item_data.id) if item_data
end end
#============================================================================= #-----------------------------------------------------------------------------
private private
@@ -193,8 +193,6 @@ class PokemonBag
end end
end end
#=============================================================================== #===============================================================================
# The PC item storage object, which actually contains all the items # The PC item storage object, which actually contains all the items
#=============================================================================== #===============================================================================
@@ -260,8 +258,6 @@ class PCItemStorage
end end
end end
#=============================================================================== #===============================================================================
# Implements methods that act on arrays of items. Each element in an item # Implements methods that act on arrays of items. Each element in an item
# array is itself an array of [itemID, itemCount]. # array is itself an array of [itemID, itemCount].
@@ -333,8 +329,6 @@ module ItemStorageHelper
end end
end end
#=============================================================================== #===============================================================================
# Deprecated methods # Deprecated methods
#=============================================================================== #===============================================================================
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module MultipleForms module MultipleForms
@@formSpecies = SpeciesHandlerHash.new @@formSpecies = SpeciesHandlerHash.new
@@ -32,8 +35,9 @@ module MultipleForms
end end
end end
#===============================================================================
#
#===============================================================================
def drawSpot(bitmap, spotpattern, x, y, red, green, blue) def drawSpot(bitmap, spotpattern, x, y, red, green, blue)
height = spotpattern.length height = spotpattern.length
width = spotpattern[0].length width = spotpattern[0].length
@@ -723,7 +727,6 @@ MultipleForms.register(:CALYREX, {
} }
}) })
#=============================================================================== #===============================================================================
# Regional forms # Regional forms
# This code is for determining the form of a Pokémon in an egg created at the # This code is for determining the form of a Pokémon in an egg created at the
@@ -59,8 +59,6 @@ def pbPurify(pkmn, scene)
end end
end end
#=============================================================================== #===============================================================================
# Relic Stone scene. # Relic Stone scene.
#=============================================================================== #===============================================================================
@@ -105,8 +103,9 @@ class RelicStoneScene
end end
end end
#===============================================================================
#
#===============================================================================
class RelicStoneScreen class RelicStoneScreen
def initialize(scene) def initialize(scene)
@scene = scene @scene = scene
@@ -132,8 +131,9 @@ class RelicStoneScreen
end end
end end
#===============================================================================
#
#===============================================================================
def pbRelicStoneScreen(pkmn) def pbRelicStoneScreen(pkmn)
retval = true retval = true
pbFadeOutIn { pbFadeOutIn {
@@ -144,8 +144,6 @@ def pbRelicStoneScreen(pkmn)
return retval return retval
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -164,8 +162,6 @@ def pbRelicStone
end end
end end
#=============================================================================== #===============================================================================
# Shadow Pokémon in battle. # Shadow Pokémon in battle.
#=============================================================================== #===============================================================================
@@ -184,8 +180,9 @@ class Battle
end end
end end
#===============================================================================
#
#===============================================================================
class Battle::Battler class Battle::Battler
alias __shadow__pbInitPokemon pbInitPokemon unless method_defined?(:__shadow__pbInitPokemon) alias __shadow__pbInitPokemon pbInitPokemon unless method_defined?(:__shadow__pbInitPokemon)
@@ -228,8 +225,6 @@ class Battle::Battler
end end
end end
#=============================================================================== #===============================================================================
# Shadow item effects. # Shadow item effects.
#=============================================================================== #===============================================================================
@@ -333,8 +328,6 @@ ItemHandlers::BattleUseOnPokemon.add(:VIVIDSCENT, proc { |item, pokemon, battler
next true next true
}) })
#=============================================================================== #===============================================================================
# Two turn attack. On first turn, halves the HP of all active Pokémon. # Two turn attack. On first turn, halves the HP of all active Pokémon.
# Skips second turn (if successful). (Shadow Half) # Skips second turn (if successful). (Shadow Half)
@@ -359,8 +352,6 @@ class Battle::Move::AllBattlersLoseHalfHPUserSkipsNextTurn < Battle::Move
end end
end end
#=============================================================================== #===============================================================================
# User takes recoil damage equal to 1/2 of its current HP. (Shadow 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
end end
#=============================================================================== #===============================================================================
# Starts shadow weather. (Shadow Sky) # Starts shadow weather. (Shadow Sky)
#=============================================================================== #===============================================================================
@@ -392,8 +381,6 @@ class Battle::Move::StartShadowSkyWeather < Battle::Move::WeatherMove
end end
end end
#=============================================================================== #===============================================================================
# Ends the effects of Light Screen, Reflect and Safeguard on both sides. # Ends the effects of Light Screen, Reflect and Safeguard on both sides.
# (Shadow Shed) # (Shadow Shed)
@@ -410,8 +397,6 @@ class Battle::Move::RemoveAllScreens < Battle::Move
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -419,8 +404,9 @@ class Game_Temp
attr_accessor :party_heart_gauges_before_battle attr_accessor :party_heart_gauges_before_battle
end end
#===============================================================================
#
#===============================================================================
# Record current heart gauges of Pokémon in party, to see if they drop to zero # 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 # during battle and need to say they're ready to be purified afterwards
EventHandlers.add(:on_start_battle, :record_party_heart_gauges, EventHandlers.add(:on_start_battle, :record_party_heart_gauges,
@@ -77,8 +77,6 @@ class PokemonSprite < Sprite
end end
end end
#=============================================================================== #===============================================================================
# Pokémon icon (for defined Pokémon) # Pokémon icon (for defined Pokémon)
#=============================================================================== #===============================================================================
@@ -212,8 +210,6 @@ class PokemonIconSprite < Sprite
end end
end end
#=============================================================================== #===============================================================================
# Pokémon icon (for species) # Pokémon icon (for species)
#=============================================================================== #===============================================================================
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
class PokemonBox class PokemonBox
attr_reader :pokemon attr_reader :pokemon
attr_accessor :name attr_accessor :name
@@ -49,8 +52,9 @@ class PokemonBox
end end
end end
#===============================================================================
#
#===============================================================================
class PokemonStorage class PokemonStorage
attr_reader :boxes attr_reader :boxes
attr_accessor :currentBox attr_accessor :currentBox
@@ -259,8 +263,6 @@ class PokemonStorage
end end
end end
#=============================================================================== #===============================================================================
# Regional Storage scripts # Regional Storage scripts
#=============================================================================== #===============================================================================
@@ -369,8 +371,6 @@ class RegionalStorage
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
class IntroEventScene < EventScene class IntroEventScene < EventScene
# Splash screen images that appear for a few seconds and then disappear. # Splash screen images that appear for a few seconds and then disappear.
SPLASH_IMAGES = ["splash1", "splash2"] SPLASH_IMAGES = ["splash1", "splash2"]
@@ -114,8 +117,9 @@ class IntroEventScene < EventScene
end end
end end
#===============================================================================
#
#===============================================================================
class Scene_Intro class Scene_Intro
def main def main
Graphics.transition(0) Graphics.transition(0)
+3 -2
View File
@@ -254,8 +254,9 @@ MenuHandlers.add(:pause_menu, :trainer_card, {
MenuHandlers.add(:pause_menu, :save, { MenuHandlers.add(:pause_menu, :save, {
"name" => _INTL("Save"), "name" => _INTL("Save"),
"order" => 60, "order" => 60,
"condition" => proc { next $game_system && !$game_system.save_disabled && "condition" => proc {
!pbInSafari? && !pbInBugContest? }, next $game_system && !$game_system.save_disabled && !pbInSafari? && !pbInBugContest?
},
"effect" => proc { |menu| "effect" => proc { |menu|
menu.pbHideMenu menu.pbHideMenu
scene = PokemonSave_Scene.new scene = PokemonSave_Scene.new
+1 -1
View File
@@ -223,7 +223,7 @@ class PokemonPhoneScreen
commands.push(_INTL("Sort Contacts")) commands.push(_INTL("Sort Contacts"))
commands.push(_INTL("Cancel")) commands.push(_INTL("Cancel"))
cmd = pbShowCommands(nil, commands, -1) cmd = pbShowCommands(nil, commands, -1)
cmd += 1 if cmd >=1 && !contact.can_hide? cmd += 1 if cmd >= 1 && !contact.can_hide?
case cmd case cmd
when 0 # Call when 0 # Call
Phone::Call.make_outgoing(contact) Phone::Call.make_outgoing(contact)
+1 -1
View File
@@ -298,7 +298,7 @@ class PokemonOption_Scene
@sprites["option"].viewport = @viewport @sprites["option"].viewport = @viewport
@sprites["option"].visible = true @sprites["option"].visible = true
# Get the values of each option # 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 @sprites["option"].refresh
pbChangeSelection pbChangeSelection
pbDeactivateWindows(@sprites) pbDeactivateWindows(@sprites)
@@ -165,7 +165,7 @@ class BattlePointShop_Scene
@sprites["background"] = IconSprite.new(0, 0, @viewport) @sprites["background"] = IconSprite.new(0, 0, @viewport)
@sprites["background"].setBitmap("Graphics/Pictures/martScreen") @sprites["background"].setBitmap("Graphics/Pictures/martScreen")
@sprites["icon"] = ItemIconSprite.new(36, Graphics.height - 50, nil, @viewport) @sprites["icon"] = ItemIconSprite.new(36, Graphics.height - 50, nil, @viewport)
winAdapter = BattlePointShopAdapter.new() winAdapter = BattlePointShopAdapter.new
@sprites["itemwindow"] = Window_BattlePointShop.new( @sprites["itemwindow"] = Window_BattlePointShop.new(
stock, winAdapter, Graphics.width - 316 - 16, 10, 330 + 16, Graphics.height - 124 stock, winAdapter, Graphics.width - 316 - 16, 10, 330 + 16, Graphics.height - 124
) )
+1 -1
View File
@@ -958,7 +958,7 @@ class PurifyChamberSetView < Sprite
type_string += GameData::Type.get(type).name type_string += GameData::Type.get(type).name
end end
textpos.push([_INTL("{1} Lv.{2} {3}", pkmn.name, pkmn.level, type_string), 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, textpos.push([_INTL("FLOW"), 2 + (@info.bitmap.width / 2), 30, 0,
Color.new(248, 248, 248), Color.new(128, 128, 128)]) Color.new(248, 248, 248), Color.new(128, 128, 128)])
# draw heart gauge # draw heart gauge
-10
View File
@@ -64,8 +64,6 @@ class Window_CharacterEntry < Window_DrawableCommand
end end
end end
#=============================================================================== #===============================================================================
# Text entry screen - free typing. # Text entry screen - free typing.
#=============================================================================== #===============================================================================
@@ -256,8 +254,6 @@ class PokemonEntryScene
end end
end end
#=============================================================================== #===============================================================================
# Text entry screen - arrows to select letter. # Text entry screen - arrows to select letter.
#=============================================================================== #===============================================================================
@@ -372,8 +368,6 @@ class PokemonEntryScene2
end end
end end
def pbStartScene(helptext, minlength, maxlength, initialText, subject = 0, pokemon = nil) def pbStartScene(helptext, minlength, maxlength, initialText, subject = 0, pokemon = nil)
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
@viewport.z = 99999 @viewport.z = 99999
@@ -751,8 +745,6 @@ class PokemonEntryScene2
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -769,8 +761,6 @@ class PokemonEntry
end end
end end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
@@ -133,8 +133,6 @@ class TriadCard
end end
end end
#=============================================================================== #===============================================================================
# Duel screen visuals # Duel screen visuals
#=============================================================================== #===============================================================================
@@ -160,9 +158,9 @@ class TriadSquare
end end
end end
#===============================================================================
# Scene class for handling appearance of the screen # Scene class for handling appearance of the screen
#===============================================================================
class TriadScene class TriadScene
def pbStartScene(battle) def pbStartScene(battle)
@sprites = {} @sprites = {}
@@ -589,8 +587,6 @@ class TriadScene
end end
end end
#=============================================================================== #===============================================================================
# Duel screen logic # Duel screen logic
#=============================================================================== #===============================================================================
@@ -965,8 +961,6 @@ class TriadScreen
end end
end end
#=============================================================================== #===============================================================================
# Start duel # Start duel
#=============================================================================== #===============================================================================
@@ -985,8 +979,6 @@ def pbTriadDuel(name, minLevel, maxLevel, rules = nil, oppdeck = nil, prize = ni
return ret return ret
end end
#=============================================================================== #===============================================================================
# Card storage # Card storage
#=============================================================================== #===============================================================================
@@ -1001,8 +993,9 @@ class PokemonGlobalMetadata
end end
end end
#===============================================================================
#
#===============================================================================
class TriadStorage class TriadStorage
attr_reader :items attr_reader :items
@@ -1066,8 +1059,6 @@ class TriadStorage
end end
end end
#=============================================================================== #===============================================================================
# Card shop screen # Card shop screen
#=============================================================================== #===============================================================================
@@ -1,10 +1,10 @@
################################################################################ #===============================================================================
# "Slot Machine" mini-game # "Slot Machine" mini-game
# By Maruno # By Maruno
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Run with: pbSlotMachine(1) # Run with: pbSlotMachine(1)
# - The number is either 0 (easy), 1 (default) or 2 (hard). # - The number is either 0 (easy), 1 (default) or 2 (hard).
################################################################################ #===============================================================================
class SlotMachineReel < BitmapSprite class SlotMachineReel < BitmapSprite
attr_accessor :reel attr_accessor :reel
attr_accessor :toppos attr_accessor :toppos
@@ -79,8 +79,9 @@ class SlotMachineReel < BitmapSprite
end end
end end
#===============================================================================
#
#===============================================================================
class SlotMachineScore < BitmapSprite class SlotMachineScore < BitmapSprite
attr_reader :score attr_reader :score
@@ -107,8 +108,9 @@ class SlotMachineScore < BitmapSprite
end end
end end
#===============================================================================
#
#===============================================================================
class SlotMachineScene class SlotMachineScene
attr_accessor :gameRunning attr_accessor :gameRunning
attr_accessor :gameEnd attr_accessor :gameEnd
@@ -376,8 +378,9 @@ class SlotMachineScene
end end
end end
#===============================================================================
#
#===============================================================================
class SlotMachine class SlotMachine
def initialize(scene) def initialize(scene)
@scene = scene @scene = scene
@@ -390,8 +393,9 @@ class SlotMachine
end end
end end
#===============================================================================
#
#===============================================================================
def pbSlotMachine(difficulty = 1) def pbSlotMachine(difficulty = 1)
if !$bag.has?(:COINCASE) if !$bag.has?(:COINCASE)
pbMessage(_INTL("It's a Slot Machine.")) pbMessage(_INTL("It's a Slot Machine."))
@@ -580,8 +580,9 @@ class VoltorbFlip
end end
end end
#===============================================================================
#
#===============================================================================
class VoltorbFlipScreen class VoltorbFlipScreen
def initialize(scene) def initialize(scene)
@scene = scene @scene = scene
@@ -594,8 +595,9 @@ class VoltorbFlipScreen
end end
end end
#===============================================================================
#
#===============================================================================
def pbVoltorbFlip def pbVoltorbFlip
if !$bag.has?(:COINCASE) if !$bag.has?(:COINCASE)
pbMessage(_INTL("You can't play unless you have a Coin Case.")) pbMessage(_INTL("You can't play unless you have a Coin Case."))
@@ -1,9 +1,9 @@
################################################################################ #===============================================================================
# "Mining" mini-game # "Mining" mini-game
# By Maruno # By Maruno
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Run with: pbMiningGame # Run with: pbMiningGame
################################################################################ #===============================================================================
class MiningGameCounter < BitmapSprite class MiningGameCounter < BitmapSprite
attr_accessor :hits attr_accessor :hits
@@ -32,8 +32,9 @@ class MiningGameCounter < BitmapSprite
end end
end end
#===============================================================================
#
#===============================================================================
class MiningGameTile < BitmapSprite class MiningGameTile < BitmapSprite
attr_reader :layer attr_reader :layer
@@ -70,8 +71,9 @@ class MiningGameTile < BitmapSprite
end end
end end
#===============================================================================
#
#===============================================================================
class MiningGameCursor < BitmapSprite class MiningGameCursor < BitmapSprite
attr_accessor :mode attr_accessor :mode
attr_accessor :position attr_accessor :position
@@ -138,8 +140,9 @@ class MiningGameCursor < BitmapSprite
end end
end end
#===============================================================================
#
#===============================================================================
class MiningGameScene class MiningGameScene
BOARD_WIDTH = 13 BOARD_WIDTH = 13
BOARD_HEIGHT = 10 BOARD_HEIGHT = 10
@@ -606,8 +609,9 @@ class MiningGameScene
end end
end end
#===============================================================================
#
#===============================================================================
class MiningGame class MiningGame
def initialize(scene) def initialize(scene)
@scene = scene @scene = scene
@@ -620,8 +624,9 @@ class MiningGame
end end
end end
#===============================================================================
#
#===============================================================================
def pbMiningGame def pbMiningGame
pbFadeOutIn { pbFadeOutIn {
scene = MiningGameScene.new scene = MiningGameScene.new
@@ -1,4 +1,4 @@
################################################################################ #===============================================================================
# "Tile Puzzle" mini-games # "Tile Puzzle" mini-games
# By Maruno # By Maruno
# Graphics by the__end # Graphics by the__end
@@ -14,7 +14,7 @@
# board = The name/number of the graphics to be used. # board = The name/number of the graphics to be used.
# width,height = Optional, the number of tiles wide/high the puzzle is (0 for # width,height = Optional, the number of tiles wide/high the puzzle is (0 for
# the default value of 4). # the default value of 4).
################################################################################ #===============================================================================
class TilePuzzleCursor < BitmapSprite class TilePuzzleCursor < BitmapSprite
attr_accessor :game attr_accessor :game
attr_accessor :position attr_accessor :position
@@ -83,8 +83,9 @@ class TilePuzzleCursor < BitmapSprite
end end
end end
#===============================================================================
#
#===============================================================================
class TilePuzzleScene class TilePuzzleScene
def initialize(game, board, width, height) def initialize(game, board, width, height)
@game = game @game = game
@@ -563,8 +564,9 @@ class TilePuzzleScene
end end
end end
#===============================================================================
#
#===============================================================================
class TilePuzzle class TilePuzzle
def initialize(scene) def initialize(scene)
@scene = scene @scene = scene
@@ -578,8 +580,9 @@ class TilePuzzle
end end
end end
#===============================================================================
#
#===============================================================================
def pbTilePuzzle(game, board, width = 0, height = 0) def pbTilePuzzle(game, board, width = 0, height = 0)
ret = false ret = false
pbFadeOutIn { pbFadeOutIn {
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
class BattleSwapScene class BattleSwapScene
def pbStartRentScene(rentals) def pbStartRentScene(rentals)
@rentals = rentals @rentals = rentals
@@ -150,8 +153,9 @@ class BattleSwapScene
end end
end end
#===============================================================================
#
#===============================================================================
class BattleSwapScreen class BattleSwapScreen
def initialize(scene) def initialize(scene)
@scene = scene @scene = scene
@@ -339,8 +339,6 @@ def pbEncounterTypeEditor(enc_data, enc_type)
Input.update Input.update
end end
#=============================================================================== #===============================================================================
# Trainer type editor # Trainer type editor
#=============================================================================== #===============================================================================
@@ -444,8 +442,6 @@ def pbTrainerTypeEditorNew(default_name)
return id.to_sym return id.to_sym
end end
#=============================================================================== #===============================================================================
# Individual trainer editor # Individual trainer editor
#=============================================================================== #===============================================================================
@@ -476,8 +472,9 @@ module TrainerBattleProperty
end end
end end
#===============================================================================
#
#===============================================================================
def pbTrainerBattleEditor def pbTrainerBattleEditor
modified = false modified = false
pbListScreenBlock(_INTL("Trainer Battles"), TrainerBattleLister.new(0, true)) { |button, trainer_id| pbListScreenBlock(_INTL("Trainer Battles"), TrainerBattleLister.new(0, true)) { |button, trainer_id|
@@ -601,14 +598,12 @@ def pbTrainerBattleEditor
end end
end end
#=============================================================================== #===============================================================================
# Trainer Pokémon editor # Trainer Pokémon editor
#=============================================================================== #===============================================================================
module TrainerPokemonProperty module TrainerPokemonProperty
def self.set(settingname, initsetting) def self.set(settingname, initsetting)
initsetting = { :species => nil, :level => 10 } if !initsetting initsetting = {:species => nil, :level => 10} if !initsetting
oldsetting = [ oldsetting = [
initsetting[:species], initsetting[:species],
initsetting[:level], initsetting[:level],
@@ -691,8 +686,6 @@ module TrainerPokemonProperty
end end
end end
#=============================================================================== #===============================================================================
# Metadata editor # Metadata editor
#=============================================================================== #===============================================================================
@@ -747,7 +740,7 @@ def pbEditPlayerMetadata(player_id = 1)
player_id = i player_id = i
break break
end end
metadata = GameData::PlayerMetadata.new({ :id => player_id }) metadata = GameData::PlayerMetadata.new({:id => player_id})
elsif !GameData::PlayerMetadata.exists?(player_id) elsif !GameData::PlayerMetadata.exists?(player_id)
pbMessage(_INTL("Metadata for player character {1} was not found.", player_id)) pbMessage(_INTL("Metadata for player character {1} was not found.", player_id))
return return
@@ -780,8 +773,6 @@ def pbEditPlayerMetadata(player_id = 1)
end end
end end
#=============================================================================== #===============================================================================
# Map metadata editor # Map metadata editor
#=============================================================================== #===============================================================================
@@ -798,7 +789,7 @@ def pbEditMapMetadata(map_id)
data = [] data = []
map_name = mapinfos[map_id].name map_name = mapinfos[map_id].name
metadata = GameData::MapMetadata.try_get(map_id) 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 = GameData::MapMetadata.editor_properties
properties.each do |property| properties.each do |property|
val = metadata.get_property_for_PBS(property[0]) val = metadata.get_property_for_PBS(property[0])
@@ -825,8 +816,6 @@ def pbEditMapMetadata(map_id)
end end
end end
#=============================================================================== #===============================================================================
# Item editor # 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)) pbMessage(_INTL("Put the item's graphic ({1}.png) in Graphics/Items, or it will be blank.", id.to_s))
end end
#=============================================================================== #===============================================================================
# Pokémon species editor # Pokémon species editor
#=============================================================================== #===============================================================================
@@ -999,8 +986,6 @@ def pbPokemonEditor
} }
end end
#=============================================================================== #===============================================================================
# Regional Dexes editor # Regional Dexes editor
#=============================================================================== #===============================================================================
@@ -1261,8 +1246,6 @@ def pbEvoFamiliesToStrings
return ret return ret
end end
#=============================================================================== #===============================================================================
# Battle animations rearranger # Battle animations rearranger
#=============================================================================== #===============================================================================
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
def pbGetLegalMoves(species) def pbGetLegalMoves(species)
species_data = GameData::Species.get(species) species_data = GameData::Species.get(species)
moves = [] moves = []
@@ -125,7 +128,6 @@ def pbChooseFromGameDataList(game_data, default = nil)
return pbChooseList(commands, default, nil, -1) return pbChooseList(commands, default, nil, -1)
end end
# Displays a list of all Pokémon species, and returns the ID of the species # 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 # 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 # 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 return (ret >= 0) ? commands[ret][0] : defaultMoveID
end end
#=============================================================================== #===============================================================================
# General list methods # General list methods
#=============================================================================== #===============================================================================
@@ -1,6 +1,6 @@
################################################################################ #===============================================================================
# Controls # Controls
################################################################################ #===============================================================================
class Window_Menu < Window_CommandPokemon class Window_Menu < Window_CommandPokemon
def initialize(commands, x, y) def initialize(commands, x, y)
tempbitmap = Bitmap.new(32, 32) tempbitmap = Bitmap.new(32, 32)
@@ -40,11 +40,9 @@ class Window_Menu < Window_CommandPokemon
end end
end end
#===============================================================================
################################################################################
# Clipboard # Clipboard
################################################################################ #===============================================================================
module Clipboard module Clipboard
@data = nil @data = nil
@typekey = "" @typekey = ""
@@ -64,11 +62,9 @@ module Clipboard
end end
end end
#===============================================================================
################################################################################
# Collision testing # Collision testing
################################################################################ #===============================================================================
class Rect < Object class Rect < Object
def contains(x, y) def contains(x, y)
return x >= self.x && x < self.x + self.width && return x >= self.x && x < self.x + self.width &&
@@ -76,8 +72,9 @@ class Rect < Object
end end
end end
#===============================================================================
#
#===============================================================================
def pbSpriteHitTest(sprite, x, y, usealpha = true, wholecanvas = false) def pbSpriteHitTest(sprite, x, y, usealpha = true, wholecanvas = false)
return false if !sprite || sprite.disposed? return false if !sprite || sprite.disposed?
return false if !sprite.bitmap return false if !sprite.bitmap
@@ -158,11 +155,9 @@ def pbTrackPopupMenu(commands)
return -1 return -1
end end
#===============================================================================
################################################################################
# Sprite sheet scrolling bar # Sprite sheet scrolling bar
################################################################################ #===============================================================================
class AnimationWindow < Sprite class AnimationWindow < Sprite
attr_reader :animbitmap attr_reader :animbitmap
attr_reader :start attr_reader :start
@@ -298,8 +293,9 @@ class AnimationWindow < Sprite
end end
end end
#===============================================================================
#
#===============================================================================
class CanvasAnimationWindow < AnimationWindow class CanvasAnimationWindow < AnimationWindow
def animbitmap def animbitmap
return @canvas.animbitmap return @canvas.animbitmap
@@ -311,33 +307,31 @@ class CanvasAnimationWindow < AnimationWindow
end end
end end
#===============================================================================
################################################################################
# Cel sprite # Cel sprite
################################################################################ #===============================================================================
class InvalidatableSprite < Sprite class InvalidatableSprite < Sprite
def initialize(viewport = nil) def initialize(viewport = nil)
super(viewport) super(viewport)
@invalid = false @invalid = false
end 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 def invalidate
@invalid = true @invalid = true
end end
# Determines whether the control is invalid # Determines whether the control is invalid
def invalid? def invalid?
return @invalid return @invalid
end 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 def validate
@invalid = false @invalid = false
end 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 def repaint
if self.invalid? if self.invalid?
refresh refresh
@@ -345,14 +339,15 @@ class InvalidatableSprite < Sprite
end end
end end
# Redraws the sprite. This method should not check whether # Redraws the sprite. This method should not check whether
# the sprite is invalid, to allow it to be explicitly called. # the sprite is invalid, to allow it to be explicitly called.
def refresh def refresh
end end
end end
#===============================================================================
#
#===============================================================================
class SpriteFrame < InvalidatableSprite class SpriteFrame < InvalidatableSprite
attr_reader :id attr_reader :id
attr_reader :locked attr_reader :locked
@@ -419,11 +414,9 @@ class SpriteFrame < InvalidatableSprite
end end
end end
#===============================================================================
################################################################################
# Canvas # Canvas
################################################################################ #===============================================================================
class AnimationCanvas < Sprite class AnimationCanvas < Sprite
attr_reader :viewport attr_reader :viewport
attr_reader :sprites attr_reader :sprites
@@ -947,11 +940,9 @@ class AnimationCanvas < Sprite
end end
end end
#===============================================================================
################################################################################
# Window classes # Window classes
################################################################################ #===============================================================================
class BitmapDisplayWindow < SpriteWindow_Base class BitmapDisplayWindow < SpriteWindow_Base
attr_reader :bitmapname attr_reader :bitmapname
attr_reader :hue attr_reader :hue
@@ -1001,8 +992,9 @@ class BitmapDisplayWindow < SpriteWindow_Base
end end
end end
#===============================================================================
#
#===============================================================================
class AnimationNameWindow class AnimationNameWindow
def initialize(canvas, x, y, width, height, viewport = nil) def initialize(canvas, x, y, width, height, viewport = nil)
@canvas = canvas @canvas = canvas
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module ShadowText module ShadowText
def shadowtext(bitmap, x, y, w, h, t, disabled = false, align = 0) def shadowtext(bitmap, x, y, w, h, t, disabled = false, align = 0)
width = bitmap.text_size(t).width width = bitmap.text_size(t).width
@@ -13,8 +16,9 @@ module ShadowText
end end
end end
#===============================================================================
#
#===============================================================================
class UIControl class UIControl
include ShadowText include ShadowText
attr_accessor :bitmap attr_accessor :bitmap
@@ -90,8 +94,9 @@ class UIControl
end end
end end
#===============================================================================
#
#===============================================================================
class Label < UIControl class Label < UIControl
def text=(value) def text=(value)
self.label = value self.label = value
@@ -106,8 +111,9 @@ class Label < UIControl
end end
end end
#===============================================================================
#
#===============================================================================
class Button < UIControl class Button < UIControl
attr_accessor :label attr_accessor :label
@@ -155,8 +161,9 @@ class Button < UIControl
end end
end end
#===============================================================================
#
#===============================================================================
class Checkbox < Button class Checkbox < Button
attr_reader :checked attr_reader :checked
@@ -210,8 +217,9 @@ class Checkbox < Button
end end
end end
#===============================================================================
#
#===============================================================================
class TextField < UIControl class TextField < UIControl
attr_accessor :label attr_accessor :label
attr_reader :text attr_reader :text
@@ -340,8 +348,9 @@ class TextField < UIControl
end end
end end
#===============================================================================
#
#===============================================================================
class Slider < UIControl class Slider < UIControl
attr_reader :minvalue attr_reader :minvalue
attr_reader :maxvalue attr_reader :maxvalue
@@ -453,8 +462,9 @@ class Slider < UIControl
end end
end end
#===============================================================================
#
#===============================================================================
class OptionalSlider < Slider class OptionalSlider < Slider
def initialize(label, minvalue, maxvalue, curvalue) def initialize(label, minvalue, maxvalue, curvalue)
@slider = Slider.new(label, minvalue, maxvalue, curvalue) @slider = Slider.new(label, minvalue, maxvalue, curvalue)
@@ -543,8 +553,9 @@ class OptionalSlider < Slider
end end
end end
#===============================================================================
#
#===============================================================================
class ArrayCountSlider < Slider class ArrayCountSlider < Slider
def maxvalue def maxvalue
return @array.length - 1 return @array.length - 1
@@ -556,8 +567,9 @@ class ArrayCountSlider < Slider
end end
end end
#===============================================================================
#
#===============================================================================
class FrameCountSlider < Slider class FrameCountSlider < Slider
def maxvalue def maxvalue
return @canvas.animation.length return @canvas.animation.length
@@ -569,8 +581,9 @@ class FrameCountSlider < Slider
end end
end end
#===============================================================================
#
#===============================================================================
class FrameCountButton < Button class FrameCountButton < Button
def label def label
return _INTL("Total Frames: {1}", @canvas.animation.length) return _INTL("Total Frames: {1}", @canvas.animation.length)
@@ -582,8 +595,9 @@ class FrameCountButton < Button
end end
end end
#===============================================================================
#
#===============================================================================
class TextSlider < UIControl class TextSlider < UIControl
attr_reader :minvalue attr_reader :minvalue
attr_reader :maxvalue attr_reader :maxvalue
@@ -701,8 +715,9 @@ class TextSlider < UIControl
end end
end end
#===============================================================================
#
#===============================================================================
class OptionalTextSlider < TextSlider class OptionalTextSlider < TextSlider
def initialize(label, options, curval) def initialize(label, options, curval)
@slider = TextSlider.new(label, options, curval) @slider = TextSlider.new(label, options, curval)
@@ -791,7 +806,9 @@ class OptionalTextSlider < TextSlider
end end
end end
#===============================================================================
#
#===============================================================================
class ControlWindow < SpriteWindow_Base class ControlWindow < SpriteWindow_Base
attr_reader :controls attr_reader :controls
@@ -1,6 +1,6 @@
################################################################################ #===============================================================================
# Paths and interpolation # Paths and interpolation
################################################################################ #===============================================================================
class ControlPointSprite < Sprite class ControlPointSprite < Sprite
attr_accessor :dragging attr_accessor :dragging
@@ -48,8 +48,9 @@ class ControlPointSprite < Sprite
end end
end end
#===============================================================================
#
#===============================================================================
class PointSprite < Sprite class PointSprite < Sprite
def initialize(x, y, viewport = nil) def initialize(x, y, viewport = nil)
super(viewport) super(viewport)
@@ -65,8 +66,9 @@ class PointSprite < Sprite
end end
end end
#===============================================================================
#
#===============================================================================
class PointPath class PointPath
include Enumerable include Enumerable
@@ -180,8 +182,9 @@ class PointPath
end end
end end
#===============================================================================
#
#===============================================================================
def catmullRom(p1, p2, p3, p4, t) def catmullRom(p1, p2, p3, p4, t)
# p1=prevPoint, p2=startPoint, p3=endPoint, p4=nextPoint, t is from 0 through 1 # p1=prevPoint, p2=startPoint, p3=endPoint, p4=nextPoint, t is from 0 through 1
t2 = t * t t2 = t * t
@@ -1,6 +1,6 @@
################################################################################ #===============================================================================
# Mini battle scene # Mini battle scene
################################################################################ #===============================================================================
class MiniBattler class MiniBattler
attr_accessor :index attr_accessor :index
attr_accessor :pokemon attr_accessor :pokemon
@@ -8,8 +8,9 @@ class MiniBattler
def initialize(index); self.index = index; end def initialize(index); self.index = index; end
end end
#===============================================================================
#
#===============================================================================
class MiniBattle class MiniBattle
attr_accessor :battlers attr_accessor :battlers
@@ -19,11 +20,9 @@ class MiniBattle
end end
end end
#===============================================================================
################################################################################
# Pop-up menus for buttons in bottom menu # Pop-up menus for buttons in bottom menu
################################################################################ #===============================================================================
def pbSelectAnim(canvas, animwin) def pbSelectAnim(canvas, animwin)
animfiles = [] animfiles = []
pbRgssChdir(File.join("Graphics", "Animations")) { pbRgssChdir(File.join("Graphics", "Animations")) {
@@ -182,9 +181,9 @@ def pbAnimList(animations, canvas, animwin)
cmdwin.dispose cmdwin.dispose
end end
################################################################################ #===============================================================================
# Pop-up menus for individual cels # Pop-up menus for individual cels
################################################################################ #===============================================================================
def pbChooseNum(cel) def pbChooseNum(cel)
ret = cel ret = cel
sliderwin2 = ControlWindow.new(0, 0, 320, 32 * 5) sliderwin2 = ControlWindow.new(0, 0, 320, 32 * 5)
@@ -370,9 +369,9 @@ def pbCellProperties(canvas)
return return
end end
################################################################################ #===============================================================================
# Pop-up menus for buttons in right hand menu # Pop-up menus for buttons in right hand menu
################################################################################ #===============================================================================
def pbTimingList(canvas) def pbTimingList(canvas)
commands = [] commands = []
cmdNewSound = -1 cmdNewSound = -1
@@ -957,9 +956,9 @@ def pbAnimEditorHelpWindow
cmdwin.dispose cmdwin.dispose
end end
################################################################################ #===============================================================================
# Main # Main
################################################################################ #===============================================================================
def animationEditorMain(animation) def animationEditorMain(animation)
viewport = Viewport.new(0, 0, Settings::SCREEN_WIDTH + 288, Settings::SCREEN_HEIGHT + 288) viewport = Viewport.new(0, 0, Settings::SCREEN_WIDTH + 288, Settings::SCREEN_HEIGHT + 288)
viewport.z = 99999 viewport.z = 99999
@@ -1172,9 +1171,9 @@ def animationEditorMain(animation)
RPG::Cache.clear RPG::Cache.clear
end end
################################################################################ #===============================================================================
# Start # Start
################################################################################ #===============================================================================
def pbAnimationEditor def pbAnimationEditor
pbBGMStop pbBGMStop
animation = pbLoadBattleAnimations animation = pbLoadBattleAnimations
+141 -99
View File
@@ -12,8 +12,9 @@ module UndefinedProperty
end end
end end
#===============================================================================
#
#===============================================================================
module ReadOnlyProperty module ReadOnlyProperty
def self.set(_settingname, oldsetting) def self.set(_settingname, oldsetting)
pbMessage(_INTL("This property cannot be edited.")) pbMessage(_INTL("This property cannot be edited."))
@@ -25,8 +26,9 @@ module ReadOnlyProperty
end end
end end
#===============================================================================
#
#===============================================================================
class UIntProperty class UIntProperty
def initialize(maxdigits) def initialize(maxdigits)
@maxdigits = maxdigits @maxdigits = maxdigits
@@ -48,8 +50,9 @@ class UIntProperty
end end
end end
#===============================================================================
#
#===============================================================================
class LimitProperty class LimitProperty
def initialize(maxvalue) def initialize(maxvalue)
@maxvalue = maxvalue @maxvalue = maxvalue
@@ -72,8 +75,9 @@ class LimitProperty
end end
end end
#===============================================================================
#
#===============================================================================
class LimitProperty2 class LimitProperty2
def initialize(maxvalue) def initialize(maxvalue)
@maxvalue = maxvalue @maxvalue = maxvalue
@@ -98,8 +102,9 @@ class LimitProperty2
end end
end end
#===============================================================================
#
#===============================================================================
class NonzeroLimitProperty class NonzeroLimitProperty
def initialize(maxvalue) def initialize(maxvalue)
@maxvalue = maxvalue @maxvalue = maxvalue
@@ -122,8 +127,9 @@ class NonzeroLimitProperty
end end
end end
#===============================================================================
#
#===============================================================================
module BooleanProperty module BooleanProperty
def self.set(settingname, _oldsetting) def self.set(settingname, _oldsetting)
return pbConfirmMessage(_INTL("Enable the setting {1}?", settingname)) ? true : false return pbConfirmMessage(_INTL("Enable the setting {1}?", settingname)) ? true : false
@@ -134,8 +140,9 @@ module BooleanProperty
end end
end end
#===============================================================================
#
#===============================================================================
module BooleanProperty2 module BooleanProperty2
def self.set(_settingname, _oldsetting) def self.set(_settingname, _oldsetting)
ret = pbShowCommands(nil, [_INTL("True"), _INTL("False")], -1) ret = pbShowCommands(nil, [_INTL("True"), _INTL("False")], -1)
@@ -151,8 +158,9 @@ module BooleanProperty2
end end
end end
#===============================================================================
#
#===============================================================================
module StringProperty module StringProperty
def self.set(settingname, oldsetting) def self.set(settingname, oldsetting)
return pbMessageFreeText(_INTL("Set the value for {1}.", settingname), return pbMessageFreeText(_INTL("Set the value for {1}.", settingname),
@@ -164,8 +172,9 @@ module StringProperty
end end
end end
#===============================================================================
#
#===============================================================================
class LimitStringProperty class LimitStringProperty
def initialize(limit) def initialize(limit)
@limit = limit @limit = limit
@@ -181,8 +190,9 @@ class LimitStringProperty
end end
end end
#===============================================================================
#
#===============================================================================
class EnumProperty class EnumProperty
def initialize(values) def initialize(values)
@values = values @values = values
@@ -207,9 +217,9 @@ class EnumProperty
end end
end end
#===============================================================================
# Unused # Unused
#===============================================================================
class EnumProperty2 class EnumProperty2
def initialize(value) def initialize(value)
@module = value @module = value
@@ -234,8 +244,9 @@ class EnumProperty2
end end
end end
#===============================================================================
#
#===============================================================================
class StringListProperty class StringListProperty
def self.set(_setting_name, old_setting) def self.set(_setting_name, old_setting)
old_setting = [] if !old_setting old_setting = [] if !old_setting
@@ -324,8 +335,9 @@ class StringListProperty
end end
end end
#===============================================================================
#
#===============================================================================
class GameDataProperty class GameDataProperty
def initialize(value) def initialize(value)
raise _INTL("Couldn't find class {1} in module GameData.", value.to_s) if !GameData.const_defined?(value.to_sym) 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
end end
#===============================================================================
#
#===============================================================================
module BGMProperty module BGMProperty
def self.set(settingname, oldsetting) def self.set(settingname, oldsetting)
chosenmap = pbListScreen(settingname, MusicFileLister.new(true, oldsetting)) chosenmap = pbListScreen(settingname, MusicFileLister.new(true, oldsetting))
@@ -368,8 +381,9 @@ module BGMProperty
end end
end end
#===============================================================================
#
#===============================================================================
module MEProperty module MEProperty
def self.set(settingname, oldsetting) def self.set(settingname, oldsetting)
chosenmap = pbListScreen(settingname, MusicFileLister.new(false, oldsetting)) chosenmap = pbListScreen(settingname, MusicFileLister.new(false, oldsetting))
@@ -381,8 +395,9 @@ module MEProperty
end end
end end
#===============================================================================
#
#===============================================================================
module WindowskinProperty module WindowskinProperty
def self.set(settingname, oldsetting) def self.set(settingname, oldsetting)
chosenmap = pbListScreen(settingname, GraphicsLister.new("Graphics/Windowskins/", oldsetting)) chosenmap = pbListScreen(settingname, GraphicsLister.new("Graphics/Windowskins/", oldsetting))
@@ -394,8 +409,9 @@ module WindowskinProperty
end end
end end
#===============================================================================
#
#===============================================================================
module TrainerTypeProperty module TrainerTypeProperty
def self.set(settingname, oldsetting) def self.set(settingname, oldsetting)
chosenmap = pbListScreen(settingname, TrainerTypeLister.new(0, false)) chosenmap = pbListScreen(settingname, TrainerTypeLister.new(0, false))
@@ -407,8 +423,9 @@ module TrainerTypeProperty
end end
end end
#===============================================================================
#
#===============================================================================
module SpeciesProperty module SpeciesProperty
def self.set(_settingname, oldsetting) def self.set(_settingname, oldsetting)
ret = pbChooseSpeciesList(oldsetting || nil) ret = pbChooseSpeciesList(oldsetting || nil)
@@ -424,8 +441,9 @@ module SpeciesProperty
end end
end end
#===============================================================================
#
#===============================================================================
class SpeciesFormProperty class SpeciesFormProperty
def initialize(default_value) def initialize(default_value)
@default_value = default_value @default_value = default_value
@@ -453,8 +471,9 @@ class SpeciesFormProperty
end end
end end
#===============================================================================
#
#===============================================================================
module TypeProperty module TypeProperty
def self.set(_settingname, oldsetting) def self.set(_settingname, oldsetting)
ret = pbChooseTypeList(oldsetting || nil) ret = pbChooseTypeList(oldsetting || nil)
@@ -470,8 +489,9 @@ module TypeProperty
end end
end end
#===============================================================================
#
#===============================================================================
module TypesProperty module TypesProperty
def self.set(_settingname, oldsetting) def self.set(_settingname, oldsetting)
ret = oldsetting.clone ret = oldsetting.clone
@@ -501,8 +521,9 @@ module TypesProperty
end end
end end
#===============================================================================
#
#===============================================================================
module MoveProperty module MoveProperty
def self.set(_settingname, oldsetting) def self.set(_settingname, oldsetting)
ret = pbChooseMoveList(oldsetting || nil) ret = pbChooseMoveList(oldsetting || nil)
@@ -518,8 +539,9 @@ module MoveProperty
end end
end end
#===============================================================================
#
#===============================================================================
class MovePropertyForSpecies class MovePropertyForSpecies
def initialize(pokemondata) def initialize(pokemondata)
@pokemondata = pokemondata @pokemondata = pokemondata
@@ -539,8 +561,9 @@ class MovePropertyForSpecies
end end
end end
#===============================================================================
#
#===============================================================================
module GenderProperty module GenderProperty
def self.set(_settingname, _oldsetting) def self.set(_settingname, _oldsetting)
ret = pbShowCommands(nil, [_INTL("Male"), _INTL("Female")], -1) ret = pbShowCommands(nil, [_INTL("Male"), _INTL("Female")], -1)
@@ -557,8 +580,9 @@ module GenderProperty
end end
end end
#===============================================================================
#
#===============================================================================
module ItemProperty module ItemProperty
def self.set(_settingname, oldsetting) def self.set(_settingname, oldsetting)
ret = pbChooseItemList((oldsetting) ? oldsetting : nil) ret = pbChooseItemList((oldsetting) ? oldsetting : nil)
@@ -574,8 +598,9 @@ module ItemProperty
end end
end end
#===============================================================================
#
#===============================================================================
class IVsProperty class IVsProperty
def initialize(limit) def initialize(limit)
@limit = limit @limit = limit
@@ -614,8 +639,9 @@ class IVsProperty
end end
end end
#===============================================================================
#
#===============================================================================
class EVsProperty class EVsProperty
def initialize(limit) def initialize(limit)
@limit = limit @limit = limit
@@ -660,8 +686,9 @@ class EVsProperty
end end
end end
#===============================================================================
#
#===============================================================================
class BallProperty class BallProperty
def initialize(pokemondata) def initialize(pokemondata)
@pokemondata = pokemondata @pokemondata = pokemondata
@@ -680,8 +707,9 @@ class BallProperty
end end
end end
#===============================================================================
#
#===============================================================================
module CharacterProperty module CharacterProperty
def self.set(settingname, oldsetting) def self.set(settingname, oldsetting)
chosenmap = pbListScreen(settingname, GraphicsLister.new("Graphics/Characters/", oldsetting)) chosenmap = pbListScreen(settingname, GraphicsLister.new("Graphics/Characters/", oldsetting))
@@ -693,8 +721,9 @@ module CharacterProperty
end end
end end
#===============================================================================
#
#===============================================================================
module MapSizeProperty module MapSizeProperty
def self.set(settingname, oldsetting) def self.set(settingname, oldsetting)
oldsetting = [0, ""] if !oldsetting oldsetting = [0, ""] if !oldsetting
@@ -711,8 +740,6 @@ module MapSizeProperty
end end
end end
def chooseMapPoint(map, rgnmap = false) def chooseMapPoint(map, rgnmap = false)
viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
viewport.z = 99999 viewport.z = 99999
@@ -745,8 +772,9 @@ def chooseMapPoint(map, rgnmap = false)
return ret return ret
end end
#===============================================================================
#
#===============================================================================
module MapCoordsProperty module MapCoordsProperty
def self.set(settingname, oldsetting) def self.set(settingname, oldsetting)
chosenmap = pbListScreen(settingname, MapLister.new((oldsetting) ? oldsetting[0] : 0)) chosenmap = pbListScreen(settingname, MapLister.new((oldsetting) ? oldsetting[0] : 0))
@@ -763,8 +791,9 @@ module MapCoordsProperty
end end
end end
#===============================================================================
#
#===============================================================================
module MapCoordsFacingProperty module MapCoordsFacingProperty
def self.set(settingname, oldsetting) def self.set(settingname, oldsetting)
chosenmap = pbListScreen(settingname, MapLister.new((oldsetting) ? oldsetting[0] : 0)) chosenmap = pbListScreen(settingname, MapLister.new((oldsetting) ? oldsetting[0] : 0))
@@ -787,8 +816,9 @@ module MapCoordsFacingProperty
end end
end end
#===============================================================================
#
#===============================================================================
module RegionMapCoordsProperty module RegionMapCoordsProperty
def self.set(_settingname, oldsetting) def self.set(_settingname, oldsetting)
regions = self.getMapNameList regions = self.getMapNameList
@@ -821,8 +851,9 @@ module RegionMapCoordsProperty
end end
end end
#===============================================================================
#
#===============================================================================
module WeatherEffectProperty module WeatherEffectProperty
def self.set(_settingname, oldsetting) def self.set(_settingname, oldsetting)
oldsetting = [:None, 100] if !oldsetting oldsetting = [:None, 100] if !oldsetting
@@ -848,8 +879,9 @@ module WeatherEffectProperty
end end
end end
#===============================================================================
#
#===============================================================================
module MapProperty module MapProperty
def self.set(settingname, oldsetting) def self.set(settingname, oldsetting)
chosenmap = pbListScreen(settingname, MapLister.new(oldsetting || 0)) chosenmap = pbListScreen(settingname, MapLister.new(oldsetting || 0))
@@ -865,8 +897,9 @@ module MapProperty
end end
end end
#===============================================================================
#
#===============================================================================
module ItemNameProperty module ItemNameProperty
def self.set(settingname, oldsetting) def self.set(settingname, oldsetting)
return pbMessageFreeText(_INTL("Set the value for {1}.", settingname), return pbMessageFreeText(_INTL("Set the value for {1}.", settingname),
@@ -882,8 +915,9 @@ module ItemNameProperty
end end
end end
#===============================================================================
#
#===============================================================================
module PocketProperty module PocketProperty
def self.set(_settingname, oldsetting) def self.set(_settingname, oldsetting)
commands = Settings.bag_pocket_names.clone commands = Settings.bag_pocket_names.clone
@@ -901,8 +935,9 @@ module PocketProperty
end end
end end
#===============================================================================
#
#===============================================================================
module BaseStatsProperty module BaseStatsProperty
def self.set(settingname, oldsetting) def self.set(settingname, oldsetting)
return oldsetting if !oldsetting return oldsetting if !oldsetting
@@ -935,8 +970,9 @@ module BaseStatsProperty
end end
end end
#===============================================================================
#
#===============================================================================
module EffortValuesProperty module EffortValuesProperty
def self.set(settingname, oldsetting) def self.set(settingname, oldsetting)
return oldsetting if !oldsetting return oldsetting if !oldsetting
@@ -977,8 +1013,9 @@ module EffortValuesProperty
end end
end end
#===============================================================================
#
#===============================================================================
module AbilityProperty module AbilityProperty
def self.set(_settingname, oldsetting) def self.set(_settingname, oldsetting)
ret = pbChooseAbilityList((oldsetting) ? oldsetting : nil) ret = pbChooseAbilityList((oldsetting) ? oldsetting : nil)
@@ -994,8 +1031,9 @@ module AbilityProperty
end end
end end
#===============================================================================
#
#===============================================================================
class GameDataPoolProperty class GameDataPoolProperty
def initialize(game_data, allow_multiple = true, auto_sort = false) def initialize(game_data, allow_multiple = true, auto_sort = false)
if !GameData.const_defined?(game_data.to_sym) if !GameData.const_defined?(game_data.to_sym)
@@ -1113,32 +1151,36 @@ class GameDataPoolProperty
end end
end end
#===============================================================================
#
#===============================================================================
class EggMovesProperty < GameDataPoolProperty class EggMovesProperty < GameDataPoolProperty
def initialize def initialize
super(:Move, false, true) super(:Move, false, true)
end end
end end
#===============================================================================
#
#===============================================================================
class EggGroupsProperty < GameDataPoolProperty class EggGroupsProperty < GameDataPoolProperty
def initialize def initialize
super(:EggGroup, false, false) super(:EggGroup, false, false)
end end
end end
#===============================================================================
#
#===============================================================================
class AbilitiesProperty < GameDataPoolProperty class AbilitiesProperty < GameDataPoolProperty
def initialize def initialize
super(:Ability, false, false) super(:Ability, false, false)
end end
end end
#===============================================================================
#
#===============================================================================
module LevelUpMovesProperty module LevelUpMovesProperty
def self.set(_settingname, oldsetting) def self.set(_settingname, oldsetting)
# Get all moves in move pool # Get all moves in move pool
@@ -1289,8 +1331,9 @@ module LevelUpMovesProperty
end end
end end
#===============================================================================
#
#===============================================================================
class EvolutionsProperty class EvolutionsProperty
def initialize def initialize
@methods = [] @methods = []
@@ -1517,14 +1560,15 @@ class EvolutionsProperty
ret << "," if i > 0 ret << "," if i > 0
ret << value[i][0].to_s + "," ret << value[i][0].to_s + ","
ret << value[i][1].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 end
return ret return ret
end end
end end
#===============================================================================
#
#===============================================================================
module EncounterSlotProperty module EncounterSlotProperty
def self.set(setting_name, data) def self.set(setting_name, data)
max_level = GameData::GrowthRate.max_level max_level = GameData::GrowthRate.max_level
@@ -1571,8 +1615,6 @@ module EncounterSlotProperty
end end
end end
#=============================================================================== #===============================================================================
# Core property editor script # Core property editor script
#=============================================================================== #===============================================================================
@@ -38,8 +38,6 @@ def pbWarpToMap
return nil return nil
end end
#=============================================================================== #===============================================================================
# Debug Variables screen # Debug Variables screen
#=============================================================================== #===============================================================================
@@ -95,8 +93,8 @@ class SpriteWindow_DebugVariables < Window_DrawableCommand
(Kernel.const_defined?(code_parts[0]) rescue false) (Kernel.const_defined?(code_parts[0]) rescue false)
val = (eval(code) rescue nil) # Code starts with a class/method name val = (eval(code) rescue nil) # Code starts with a class/method name
elsif code_parts[0][0].downcase == code_parts[0][0] && elsif code_parts[0][0].downcase == code_parts[0][0] &&
!(Interpreter.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) !(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) val = (eval(code) rescue nil) # Code starts with a method name (that isn't in Interpreter/Game_Event)
end end
else else
@@ -131,8 +129,9 @@ class SpriteWindow_DebugVariables < Window_DrawableCommand
end end
end end
#===============================================================================
#
#===============================================================================
def pbDebugSetVariable(id, diff) def pbDebugSetVariable(id, diff)
$game_variables[id] = 0 if $game_variables[id].nil? $game_variables[id] = 0 if $game_variables[id].nil?
if $game_variables[id].is_a?(Numeric) if $game_variables[id].is_a?(Numeric)
@@ -371,8 +370,6 @@ def pbDebugDayCare
cmd_window.dispose cmd_window.dispose
end end
#=============================================================================== #===============================================================================
# Debug roaming Pokémon screen # Debug roaming Pokémon screen
#=============================================================================== #===============================================================================
@@ -453,8 +450,9 @@ class SpriteWindow_DebugRoamers < Window_DrawableCommand
end end
end end
#===============================================================================
#
#===============================================================================
def pbDebugRoamers def pbDebugRoamers
viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
viewport.z = 99999 viewport.z = 99999
@@ -544,8 +542,6 @@ def pbDebugRoamers
viewport.dispose viewport.dispose
end end
#=============================================================================== #===============================================================================
# Battle animations import/export # Battle animations import/export
#=============================================================================== #===============================================================================
@@ -739,8 +735,6 @@ def pbCheckTileValidity(tile_id, map, tilesets, passages)
return false return false
end end
#=============================================================================== #===============================================================================
# Pseudo-party screen for editing Pokémon being set up for a wild battle # Pseudo-party screen for editing Pokémon being set up for a wild battle
#=============================================================================== #===============================================================================
@@ -88,7 +88,7 @@ MenuHandlers.add(:battle_debug_menu, :pokemon_teams, {
if battle.opponent if battle.opponent
battle.opponent.each_with_index do |trainer, i| battle.opponent.each_with_index do |trainer, i|
first_index = foe_party_starts[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 num_pkmn = last_index - first_index
commands.push(_INTL("Opponent {1}: {2} ({3} Pokémon)", i + 1, trainer.full_name, num_pkmn)) commands.push(_INTL("Opponent {1}: {2} ({3} Pokémon)", i + 1, trainer.full_name, num_pkmn))
team_indices.push([1, i, first_index]) team_indices.push([1, i, first_index])
@@ -99,7 +99,7 @@ MenuHandlers.add(:battle_debug_menu, :pokemon_teams, {
end end
battle.player.each_with_index do |trainer, i| battle.player.each_with_index do |trainer, i|
first_index = player_party_starts[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 num_pkmn = last_index - first_index
if i == 0 # Player if i == 0 # Player
commands.push(_INTL("You: {1} ({2} Pokémon)", trainer.full_name, num_pkmn)) commands.push(_INTL("You: {1} ({2} Pokémon)", trainer.full_name, num_pkmn))
@@ -3,164 +3,164 @@
#=============================================================================== #===============================================================================
module Battle::DebugVariables module Battle::DebugVariables
BATTLER_EFFECTS = { BATTLER_EFFECTS = {
PBEffects::AquaRing => { name: "Aqua Ring applies", default: false }, PBEffects::AquaRing => {name: "Aqua Ring applies", default: false},
PBEffects::Attract => { name: "Battler that self is attracted to", default: -1 }, # Battler index PBEffects::Attract => {name: "Battler that self is attracted to", default: -1}, # Battler index
PBEffects::BanefulBunker => { name: "Baneful Bunker applies this round", default: false }, 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::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::Bide => {name: "Bide number of rounds remaining", default: 0},
PBEffects::BideDamage => { name: "Bide damage accumulated", default: 0, max: 999 }, PBEffects::BideDamage => {name: "Bide damage accumulated", default: 0, max: 999},
PBEffects::BideTarget => { name: "Bide last battler to hurt self", default: -1 }, # Battler index 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::BurnUp => {name: "Burn Up has removed self's Fire type", default: false},
PBEffects::Charge => { name: "Charge number of rounds remaining", default: 0 }, PBEffects::Charge => {name: "Charge number of rounds remaining", default: 0},
PBEffects::ChoiceBand => { name: "Move locked into by Choice items", default: nil, type: :move }, PBEffects::ChoiceBand => {name: "Move locked into by Choice items", default: nil, type: :move},
PBEffects::Confusion => { name: "Confusion number of rounds remaining", default: 0 }, PBEffects::Confusion => {name: "Confusion number of rounds remaining", default: 0},
# PBEffects::Counter - not suitable for setting via debug # PBEffects::Counter - not suitable for setting via debug
# PBEffects::CounterTarget - 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::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::DestinyBond - not suitable for setting via debug
# PBEffects::DestinyBondPrevious - not suitable for setting via debug # PBEffects::DestinyBondPrevious - not suitable for setting via debug
# PBEffects::DestinyBondTarget - 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::Disable => {name: "Disable number of rounds remaining", default: 0},
PBEffects::DisableMove => { name: "Disabled move", default: nil, type: :move }, PBEffects::DisableMove => {name: "Disabled move", default: nil, type: :move},
PBEffects::Electrify => { name: "Electrify making moves Electric", default: false }, PBEffects::Electrify => {name: "Electrify making moves Electric", default: false},
PBEffects::Embargo => { name: "Embargo number of rounds remaining", default: 0 }, PBEffects::Embargo => {name: "Embargo number of rounds remaining", default: 0},
PBEffects::Encore => { name: "Encore 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::EncoreMove => {name: "Encored move", default: nil, type: :move},
PBEffects::Endure => { name: "Endures all lethal damage this round", default: false }, 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::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::FlashFire => {name: "Flash Fire powering up Fire moves", default: false},
PBEffects::Flinch => { name: "Will flinch this round", 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::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::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::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::RagePowder => {name: "Rage Powder applies (use with Follow Me)", default: false},
PBEffects::Foresight => { name: "Foresight applies (Ghost loses immunities)", 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::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::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::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::Grudge => {name: "Grudge will apply if self faints", default: false},
PBEffects::HealBlock => { name: "Heal Block number of rounds remaining", default: 0 }, 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::HelpingHand => {name: "Helping Hand will power up self's move", default: false},
PBEffects::HyperBeam => { name: "Hyper Beam recharge rounds remaining", default: 0 }, 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::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::Imprison => {name: "Imprison disables others' moves known by self", default: false},
PBEffects::Ingrain => { name: "Ingrain applies", default: false }, PBEffects::Ingrain => {name: "Ingrain applies", default: false},
# PBEffects::Instruct - only used while Instruct is running, not suitable for setting via debug # 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::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::JawLock => {name: "Battler trapping self with Jaw Lock", default: -1}, # Battler index
PBEffects::KingsShield => { name: "King's Shield applies this round", default: false }, PBEffects::KingsShield => {name: "King's Shield applies this round", default: false},
PBEffects::LaserFocus => { name: "Laser Focus certain critial hit duration", default: 0 }, 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::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::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::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::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::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::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::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::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::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::MicleBerry => {name: "Micle Berry boosting next move's accuracy", default: false},
PBEffects::Minimize => { name: "Used Minimize", default: false }, PBEffects::Minimize => {name: "Used Minimize", default: false},
PBEffects::MiracleEye => { name: "Miracle Eye applies (Dark loses immunities)", default: false }, PBEffects::MiracleEye => {name: "Miracle Eye applies (Dark loses immunities)", default: false},
# PBEffects::MirrorCoat - not suitable for setting via debug # PBEffects::MirrorCoat - not suitable for setting via debug
# PBEffects::MirrorCoatTarget - not suitable for setting via debug # PBEffects::MirrorCoatTarget - not suitable for setting via debug
# PBEffects::MoveNext - 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::MudSport => {name: "Used Mud Sport (Gen 5 and older)", default: false},
PBEffects::Nightmare => { name: "Taking Nightmare damage", default: false }, PBEffects::Nightmare => {name: "Taking Nightmare damage", default: false},
PBEffects::NoRetreat => { name: "No Retreat trapping self in battle", default: false }, PBEffects::NoRetreat => {name: "No Retreat trapping self in battle", default: false},
PBEffects::Obstruct => { name: "Obstruct applies this round", default: false }, PBEffects::Obstruct => {name: "Obstruct applies this round", default: false},
PBEffects::Octolock => { name: "Battler trapping self with Octolock", default: -1 }, # Battler index PBEffects::Octolock => {name: "Battler trapping self with Octolock", default: -1}, # Battler index
PBEffects::Outrage => { name: "Outrage number of rounds remaining", default: 0 }, 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::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::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::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::PickupItem => {name: "Item retrievable by Pickup", default: nil, type: :item},
PBEffects::PickupUse => { name: "Pickup item consumed time (higher=more recent)", default: 0 }, 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::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::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::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::Prankster - not suitable for setting via debug
# PBEffects::PriorityAbility - not suitable for setting via debug # PBEffects::PriorityAbility - not suitable for setting via debug
# PBEffects::PriorityItem - not suitable for setting via debug # PBEffects::PriorityItem - not suitable for setting via debug
PBEffects::Protect => { name: "Protect applies this round", default: false }, PBEffects::Protect => {name: "Protect applies this round", default: false},
PBEffects::ProtectRate => { name: "Protect success chance 1/x", default: 1, max: 999 }, PBEffects::ProtectRate => {name: "Protect success chance 1/x", default: 1, max: 999},
# PBEffects::Quash - not suitable for setting via debug # PBEffects::Quash - not suitable for setting via debug
# PBEffects::Rage - only applies to use of specific move, not suitable for setting via debug # PBEffects::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::Rollout => {name: "Rollout rounds remaining (lower=stronger)", default: 0},
PBEffects::Roost => { name: "Roost removing Flying type this round", default: false }, 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::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::SkyDrop - only applies to use of specific move, not suitable for setting via debug
PBEffects::SlowStart => { name: "Slow Start rounds remaining", default: 0 }, PBEffects::SlowStart => {name: "Slow Start rounds remaining", default: 0},
PBEffects::SmackDown => { name: "Smack Down is grounding self", default: false }, 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::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::SpikyShield => {name: "Spiky Shield applies this round", default: false},
PBEffects::Spotlight => { name: "Spotlight drawing in attacks (if 1+)", default: 0 }, PBEffects::Spotlight => {name: "Spotlight drawing in attacks (if 1+)", default: 0},
PBEffects::Stockpile => { name: "Stockpile count (0-3)", default: 0, max: 3 }, 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::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::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::Substitute => {name: "Substitute's HP", default: 0, max: 999},
PBEffects::TarShot => { name: "Tar Shot weakening self to Fire", default: false }, PBEffects::TarShot => {name: "Tar Shot weakening self to Fire", default: false},
PBEffects::Taunt => { name: "Taunt number of rounds remaining", default: 0 }, PBEffects::Taunt => {name: "Taunt number of rounds remaining", default: 0},
PBEffects::Telekinesis => { name: "Telekinesis 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::ThroatChop => {name: "Throat Chop number of rounds remaining", default: 0},
PBEffects::Torment => { name: "Torment preventing repeating moves", default: false }, PBEffects::Torment => {name: "Torment preventing repeating moves", default: false},
# PBEffects::Toxic - set elsewhere # PBEffects::Toxic - set elsewhere
# PBEffects::Transform - too complex to be worth bothering with # PBEffects::Transform - too complex to be worth bothering with
# PBEffects::TransformSpecies - 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::Trapping => {name: "Trapping number of rounds remaining", default: 0},
PBEffects::TrappingMove => { name: "Move that is trapping self", default: nil, type: :move }, 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::TrappingUser => {name: "Battler trapping self (for Binding Band)", default: -1}, # Battler index
PBEffects::Truant => { name: "Truant will loaf around this round", default: false }, 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::TwoTurnAttack - only applies to use of specific moves, not suitable for setting via debug
# PBEffects::ExtraType - set elsewhere # PBEffects::ExtraType - set elsewhere
PBEffects::Unburden => { name: "Self lost its item (for Unburden)", default: false }, PBEffects::Unburden => {name: "Self lost its item (for Unburden)", default: false},
PBEffects::Uproar => { name: "Uproar number of rounds remaining", default: 0 }, PBEffects::Uproar => {name: "Uproar number of rounds remaining", default: 0},
PBEffects::WaterSport => { name: "Used Water Sport (Gen 5 and older)", default: false }, 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::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::Yawn => {name: "Yawn rounds remaining until falling asleep", default: 0}
} }
SIDE_EFFECTS = { SIDE_EFFECTS = {
PBEffects::AuroraVeil => { name: "Aurora Veil duration", default: 0 }, PBEffects::AuroraVeil => {name: "Aurora Veil duration", default: 0},
PBEffects::CraftyShield => { name: "Crafty Shield applies this round", default: false }, PBEffects::CraftyShield => {name: "Crafty Shield applies this round", default: false},
PBEffects::EchoedVoiceCounter => { name: "Echoed Voice rounds used (max. 5)", default: 0, max: 5 }, PBEffects::EchoedVoiceCounter => {name: "Echoed Voice rounds used (max. 5)", default: 0, max: 5},
PBEffects::EchoedVoiceUsed => { name: "Echoed Voice used this round", default: false }, 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::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::LightScreen => {name: "Light Screen duration", default: 0},
PBEffects::LuckyChant => { name: "Lucky Chant duration", default: 0 }, PBEffects::LuckyChant => {name: "Lucky Chant duration", default: 0},
PBEffects::MatBlock => { name: "Mat Block applies this round", default: false }, PBEffects::MatBlock => {name: "Mat Block applies this round", default: false},
PBEffects::Mist => { name: "Mist duration", default: 0 }, PBEffects::Mist => {name: "Mist duration", default: 0},
PBEffects::QuickGuard => { name: "Quick Guard applies this round", default: false }, PBEffects::QuickGuard => {name: "Quick Guard applies this round", default: false},
PBEffects::Rainbow => { name: "Rainbow duration", default: 0 }, PBEffects::Rainbow => {name: "Rainbow duration", default: 0},
PBEffects::Reflect => { name: "Reflect duration", default: 0 }, PBEffects::Reflect => {name: "Reflect duration", default: 0},
PBEffects::Round => { name: "Round was used this round", default: false }, PBEffects::Round => {name: "Round was used this round", default: false},
PBEffects::Safeguard => { name: "Safeguard duration", default: 0 }, PBEffects::Safeguard => {name: "Safeguard duration", default: 0},
PBEffects::SeaOfFire => { name: "Sea Of Fire duration", default: 0 }, PBEffects::SeaOfFire => {name: "Sea Of Fire duration", default: 0},
PBEffects::Spikes => { name: "Spikes layers (0-3)", default: 0, max: 3 }, PBEffects::Spikes => {name: "Spikes layers (0-3)", default: 0, max: 3},
PBEffects::StealthRock => { name: "Stealth Rock exists", default: false }, PBEffects::StealthRock => {name: "Stealth Rock exists", default: false},
PBEffects::StickyWeb => { name: "Sticky Web exists", default: false }, PBEffects::StickyWeb => {name: "Sticky Web exists", default: false},
PBEffects::Swamp => { name: "Swamp duration", default: 0 }, PBEffects::Swamp => {name: "Swamp duration", default: 0},
PBEffects::Tailwind => { name: "Tailwind duration", default: 0 }, PBEffects::Tailwind => {name: "Tailwind duration", default: 0},
PBEffects::ToxicSpikes => { name: "Toxic Spikes layers (0-2)", default: 0, max: 2 }, PBEffects::ToxicSpikes => {name: "Toxic Spikes layers (0-2)", default: 0, max: 2},
PBEffects::WideGuard => { name: "Wide Guard applies this round", default: false } PBEffects::WideGuard => {name: "Wide Guard applies this round", default: false}
} }
FIELD_EFFECTS = { FIELD_EFFECTS = {
PBEffects::AmuletCoin => { name: "Amulet Coin doubling prize money", default: false }, PBEffects::AmuletCoin => {name: "Amulet Coin doubling prize money", default: false},
PBEffects::FairyLock => { name: "Fairy Lock trapping duration", default: 0 }, PBEffects::FairyLock => {name: "Fairy Lock trapping duration", default: 0},
PBEffects::FusionBolt => { name: "Fusion Bolt was used", default: false }, PBEffects::FusionBolt => {name: "Fusion Bolt was used", default: false},
PBEffects::FusionFlare => { name: "Fusion Flare was used", default: false }, PBEffects::FusionFlare => {name: "Fusion Flare was used", default: false},
PBEffects::Gravity => { name: "Gravity duration", default: 0 }, PBEffects::Gravity => {name: "Gravity duration", default: 0},
PBEffects::HappyHour => { name: "Happy Hour doubling prize money", default: false }, PBEffects::HappyHour => {name: "Happy Hour doubling prize money", default: false},
PBEffects::IonDeluge => { name: "Ion Deluge making moves Electric", default: false }, PBEffects::IonDeluge => {name: "Ion Deluge making moves Electric", default: false},
PBEffects::MagicRoom => { name: "Magic Room duration", default: 0 }, PBEffects::MagicRoom => {name: "Magic Room duration", default: 0},
PBEffects::MudSportField => { name: "Mud Sport duration (Gen 6+)", 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::PayDay => {name: "Pay Day additional prize money", default: 0, max: Settings::MAX_MONEY},
PBEffects::TrickRoom => { name: "Trick Room duration", default: 0 }, PBEffects::TrickRoom => {name: "Trick Room duration", default: 0},
PBEffects::WaterSportField => { name: "Water Sport duration (Gen 6+)", default: 0 }, PBEffects::WaterSportField => {name: "Water Sport duration (Gen 6+)", default: 0},
PBEffects::WonderRoom => { name: "Wonder Room duration", default: 0 } PBEffects::WonderRoom => {name: "Wonder Room duration", default: 0}
} }
POSITION_EFFECTS = { POSITION_EFFECTS = {
@@ -168,8 +168,8 @@ module Battle::DebugVariables
# PBEffects::FutureSightMove - too complex to be worth bothering with # PBEffects::FutureSightMove - too complex to be worth bothering with
# PBEffects::FutureSightUserIndex - 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::FutureSightUserPartyIndex - too complex to be worth bothering with
PBEffects::HealingWish => { name: "Whether Healing Wish 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::LunarDance => {name: "Whether Lunar Dance is waiting to apply", default: false}
# PBEffects::Wish - too complex to be worth bothering with # PBEffects::Wish - too complex to be worth bothering with
# PBEffects::WishAmount - 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 # PBEffects::WishMaker - too complex to be worth bothering with

Some files were not shown because too many files have changed in this diff Show More