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
EnforcedColonStyle: table
# This interferes with the presentation of some code, notably registered procs.
Layout/MultilineMethodCallBraceLayout:
Enabled: false
# This means hashes and arrays are written the same way, rather than hashes
# needing to be written like { foo => bar } while arrays are like [foo, bar].
Layout/SpaceInsideHashLiteralBraces:
@@ -106,6 +110,11 @@ Style/GlobalVars:
Style/HashSyntax:
EnforcedStyle: no_mixed_keys
# The alernative is ->(x) { x } which is less English than "lambda". This style
# makes lambda definitions require the word "lambda".
Style/Lambda:
EnforcedStyle: lambda
# unless just adds mental gymnastics trying to figure out what it actually
# means. I much prefer if !something.
Style/NegatedIf:
@@ -139,6 +148,11 @@ Style/SingleLineBlockParams:
Style/SingleLineMethods:
Enabled: false
# This requires writing array[n..] instead of array[n..-1], and I think endless
# ranges look bad.
Style/SlicingWithRange:
Enabled: false
# Single quotes being faster is hardly measurable and only affects parse time.
# Enforcing double quotes reduces the times where you need to change them
# when introducing an interpolation or an apostrophe. Use single quotes only if
@@ -154,6 +168,10 @@ Style/SymbolArray:
Style/WordArray:
EnforcedStyle: brackets
# Allows procs to be written like { |obj| obj.something } which is clearer.
Style/SymbolProc:
AllowMethodsWithArguments: true
# Parentheses around the condition in a ternary operator helps to differentiate
# it from the true/false results.
Style/TernaryParentheses:
@@ -2,9 +2,7 @@
# Reads files of certain format from a directory
#===============================================================================
class Dir
#-----------------------------------------------------------------------------
# Reads all files in a directory
#-----------------------------------------------------------------------------
def self.get(dir, filters = "*", full = true)
files = []
filters = [filters] if !filters.is_a?(Array)
@@ -15,9 +13,8 @@ class Dir
end
return files.sort
end
#-----------------------------------------------------------------------------
# Generates entire file/folder tree from a certain directory
#-----------------------------------------------------------------------------
def self.all(dir, filters = "*", full = true)
# sets variables for starting
files = []
@@ -33,18 +30,16 @@ class Dir
# returns all found files
return files + subfolders
end
#-----------------------------------------------------------------------------
# Checks for existing directory, gets around accents
#-----------------------------------------------------------------------------
def self.safe?(dir)
return false if !FileTest.directory?(dir)
ret = false
self.chdir(dir) { ret = true } rescue nil
return ret
end
#-----------------------------------------------------------------------------
# Creates all the required directories for filename path
#-----------------------------------------------------------------------------
def self.create(path)
path.gsub!("\\", "/") # Windows compatibility
# get path tree
@@ -56,9 +51,8 @@ class Dir
self.mkdir(full) if !self.safe?(full)
end
end
#-----------------------------------------------------------------------------
# Generates entire folder tree from a certain directory
#-----------------------------------------------------------------------------
def self.all_dirs(dir)
# sets variables for starting
dirs = []
@@ -69,45 +63,35 @@ class Dir
# returns all found directories
return dirs.length > 0 ? (dirs + [dir]) : [dir]
end
#-----------------------------------------------------------------------------
# Deletes all the files in a directory and all the sub directories (allows for non-empty dirs)
#-----------------------------------------------------------------------------
def self.delete_all(dir)
# delete all files in dir
self.all(dir).each { |f| File.delete(f) }
# delete all dirs in dir
self.all_dirs(dir).each { |f| Dir.delete(f) }
end
#-----------------------------------------------------------------------------
end
#===============================================================================
# extensions for file class
# Extensions for file class
#===============================================================================
class File
#-----------------------------------------------------------------------------
# Checks for existing file, gets around accents
#-----------------------------------------------------------------------------
def self.safe?(file)
ret = false
self.open(file, "rb") { ret = true } rescue nil
return ret
end
#-----------------------------------------------------------------------------
# Checks for existing .rxdata file
#-----------------------------------------------------------------------------
def self.safeData?(file)
ret = false
ret = (load_data(file) ? true : false) rescue false
return ret
end
#-----------------------------------------------------------------------------
end
#===============================================================================
# Checking for files and directories
#===============================================================================
@@ -219,8 +203,9 @@ def canonicalize(c)
return retstr
end
#===============================================================================
#
#===============================================================================
module RTP
@rtpPaths = nil
@@ -299,8 +284,9 @@ module RTP
end
end
#===============================================================================
#
#===============================================================================
module FileTest
IMAGE_EXTENSIONS = [".png", ".gif"] # ".jpg", ".jpeg", ".bmp",
AUDIO_EXTENSIONS = [".mid", ".midi", ".ogg", ".wav", ".wma"] # ".mp3"
@@ -314,27 +300,23 @@ module FileTest
end
end
#===============================================================================
#
#===============================================================================
# Used to determine whether a data file exists (rather than a graphics or
# audio file). Doesn't check RTP, but does check encrypted archives.
# NOTE: pbGetFileChar checks anything added in MKXP's RTP setting,
# and matching mount points added through System.mount
# NOTE: pbGetFileChar checks anything added in MKXP's RTP setting, and matching
# mount points added through System.mount.
def pbRgssExists?(filename)
if safeExists?("./Game.rgssad")
return pbGetFileChar(filename) != nil
else
return pbGetFileChar(filename) != nil if safeExists?("./Game.rgssad")
filename = canonicalize(filename)
return safeExists?(filename)
end
end
# Opens an IO, even if the file is in an encrypted archive.
# Doesn't check RTP for the file.
# NOTE: load_data checks anything added in MKXP's RTP setting,
# and matching mount points added through System.mount
# NOTE: load_data checks anything added in MKXP's RTP setting, and matching
# mount points added through System.mount.
def pbRgssOpen(file, mode = nil)
# File.open("debug.txt","ab") { |fw| fw.write([file,mode,Time.now.to_f].inspect+"\r\n") }
if !safeExists?("./Game.rgssad")
@@ -385,9 +367,8 @@ end
# Gets the contents of a file. Doesn't check RTP, but does check
# encrypted archives.
# NOTE: load_data will check anything added in MKXP's RTP setting,
# and matching mount points added through System.mount
# NOTE: load_data will check anything added in MKXP's RTP setting, and matching
# mount points added through System.mount.
def pbGetFileString(file)
file = canonicalize(file)
if !safeExists?("./Game.rgssad")
@@ -407,14 +388,14 @@ def pbGetFileString(file)
return str
end
#===============================================================================
#
#===============================================================================
class StringInput
include Enumerable
attr_reader :lineno, :string
class << self
def new(str)
if block_given?
@@ -438,8 +419,6 @@ class StringInput
@lineno = 0
end
attr_reader :lineno, :string
def inspect
return "#<#{self.class}:#{@closed ? 'closed' : 'open'},src=#{@string[0, 30].inspect}>"
end
@@ -267,7 +267,10 @@ module Translator
# existing destination folder
if Dir.safe?(dir_name)
has_files = false
Dir.all(dir_name).each { |f| has_files = true; break }
Dir.all(dir_name).each do |f|
has_files = true
break
end
if has_files && !pbConfirmMessageSerious(_INTL("Replace all text files in folder '{1}'?", dir_name))
pbDisposeMessageWindow(msg_window)
return
@@ -568,14 +571,15 @@ class Translation
def setMapMessagesAsHash(map_id, array)
load_default_messages
@default_game_messages[MessageTypes::EventTexts] ||= []
@default_game_messages[MessageTypes::EventTexts][map_id] = priv_add_to_hash(MessageTypes::EventTexts, array, nil, map_id)
@default_game_messages[MessageTypes::EventTexts][map_id] = priv_add_to_hash(MessageTypes::EventTexts,
array, nil, map_id)
end
def addMapMessagesAsHash(map_id, array)
load_default_messages
@default_game_messages[MessageTypes::EventTexts] ||= []
@default_game_messages[MessageTypes::EventTexts][map_id] = priv_add_to_hash(
MessageTypes::EventTexts, array, @default_game_messages[MessageTypes::EventTexts][map_id], map_id)
@default_game_messages[MessageTypes::EventTexts][map_id] = priv_add_to_hash(MessageTypes::EventTexts,
array, @default_game_messages[MessageTypes::EventTexts][map_id], map_id)
end
def get(type, id)
+19 -38
View File
@@ -106,9 +106,8 @@
module PluginManager
# Holds all registered plugin data.
@@Plugins = {}
#-----------------------------------------------------------------------------
# Registers a plugin and tests its dependencies and incompatibilities.
#-----------------------------------------------------------------------------
def self.register(options)
name = nil
version = nil
@@ -289,9 +288,8 @@ module PluginManager
:credits => credits
}
end
#-----------------------------------------------------------------------------
# Throws a pure error message without stack trace or any other useless info.
#-----------------------------------------------------------------------------
def self.error(msg)
Graphics.update
t = Thread.new do
@@ -304,11 +302,10 @@ module PluginManager
end
Kernel.exit! true
end
#-----------------------------------------------------------------------------
# Returns true if the specified plugin is installed.
# If the version is specified, this version is taken into account.
# If mustequal is true, the version must be a match with the specified version.
#-----------------------------------------------------------------------------
def self.installed?(plugin_name, plugin_version = nil, mustequal = false)
plugin = @@Plugins[plugin_name]
return false if plugin.nil?
@@ -317,41 +314,36 @@ module PluginManager
return true if !mustequal && comparison >= 0
return true if mustequal && comparison == 0
end
#-----------------------------------------------------------------------------
# Returns the string names of all installed plugins.
#-----------------------------------------------------------------------------
def self.plugins
return @@Plugins.keys
end
#-----------------------------------------------------------------------------
# Returns the installed version of the specified plugin.
#-----------------------------------------------------------------------------
def self.version(plugin_name)
return if !installed?(plugin_name)
return @@Plugins[plugin_name][:version]
end
#-----------------------------------------------------------------------------
# Returns the link of the specified plugin.
#-----------------------------------------------------------------------------
def self.link(plugin_name)
return if !installed?(plugin_name)
return @@Plugins[plugin_name][:link]
end
#-----------------------------------------------------------------------------
# Returns the credits of the specified plugin.
#-----------------------------------------------------------------------------
def self.credits(plugin_name)
return if !installed?(plugin_name)
return @@Plugins[plugin_name][:credits]
end
#-----------------------------------------------------------------------------
# Compares two versions given in string form. v1 should be the plugin version
# you actually have, and v2 should be the minimum/desired plugin version.
# Return values:
# 1 if v1 is higher than v2
# 0 if v1 is equal to v2
# -1 if v1 is lower than v2
#-----------------------------------------------------------------------------
def self.compare_versions(v1, v2)
d1 = v1.chars
d1.insert(0, "0") if d1[0] == "." # Turn ".123" into "0.123"
@@ -376,9 +368,8 @@ module PluginManager
end
return 0
end
#-----------------------------------------------------------------------------
# formats the error message
#-----------------------------------------------------------------------------
# Formats the error message
def self.pluginErrorMsg(name, script)
e = $!
# begin message formatting
@@ -415,9 +406,8 @@ module PluginManager
end
end
end
#-----------------------------------------------------------------------------
# Used to read the metadata file
#-----------------------------------------------------------------------------
def self.readMeta(dir, file)
filename = "#{dir}/#{file}"
meta = {}
@@ -480,9 +470,8 @@ module PluginManager
# return meta hash
return meta
end
#-----------------------------------------------------------------------------
# Get a list of all the plugin directories to inspect
#-----------------------------------------------------------------------------
def self.listAll
return [] if !$DEBUG || safeExists?("Game.rgssad") || !Dir.safe?("Plugins")
# get a list of all directories in the `Plugins/` folder
@@ -491,9 +480,8 @@ module PluginManager
# return all plugins
return dirs
end
#-----------------------------------------------------------------------------
# Catch any potential loop with dependencies and raise an error
#-----------------------------------------------------------------------------
def self.validateDependencies(name, meta, og = nil)
# exit if no registered dependency
return nil if !meta[name] || !meta[name][:dependencies]
@@ -511,9 +499,8 @@ module PluginManager
end
return name
end
#-----------------------------------------------------------------------------
# Sort load order based on dependencies (this ends up in reverse order)
#-----------------------------------------------------------------------------
def self.sortLoadOrder(order, plugins)
# go through the load order
order.each do |o|
@@ -540,9 +527,8 @@ module PluginManager
end
return order
end
#-----------------------------------------------------------------------------
# Get the order in which to load plugins
#-----------------------------------------------------------------------------
def self.getPluginOrder
plugins = {}
order = []
@@ -568,9 +554,8 @@ module PluginManager
# sort the load order
return self.sortLoadOrder(order, plugins).reverse, plugins
end
#-----------------------------------------------------------------------------
# Check if plugins need compiling
#-----------------------------------------------------------------------------
def self.needCompiling?(order, plugins)
# fixed actions
return false if !$DEBUG || safeExists?("Game.rgssad")
@@ -590,9 +575,8 @@ module PluginManager
end
return false
end
#-----------------------------------------------------------------------------
# Check if plugins need compiling
#-----------------------------------------------------------------------------
def self.compilePlugins(order, plugins)
Console.echo_li("Compiling plugin scripts...")
scripts = []
@@ -618,9 +602,8 @@ module PluginManager
GC.start
Console.echo_done(true)
end
#-----------------------------------------------------------------------------
# Check if plugins need compiling
#-----------------------------------------------------------------------------
def self.runPlugins
Console.echo_h1("Checking plugins")
# get the order of plugins to interpret
@@ -668,9 +651,8 @@ module PluginManager
Console.echoln_li_done("No plugins found")
end
end
#-----------------------------------------------------------------------------
# Get plugin dir from name based on meta entries
#-----------------------------------------------------------------------------
def self.findDirectory(name)
# go through the plugins folder
Dir.get("Plugins").each do |dir|
@@ -683,5 +665,4 @@ module PluginManager
# return nil if no plugin dir found
return nil
end
#-----------------------------------------------------------------------------
end
+6 -2
View File
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
class SpriteAnimation
@@_animations = []
@@_reference_count = {}
@@ -262,8 +265,9 @@ class SpriteAnimation
end
end
#===============================================================================
#
#===============================================================================
module RPG
class Sprite < ::Sprite
def initialize(viewport = nil)
@@ -5,11 +5,9 @@
# Game_System class and the Game_Event class.
#===============================================================================
class Interpreter
#-----------------------------------------------------------------------------
# * Object Initialization
# Object Initialization
# depth : nest depth
# main : main flag
#-----------------------------------------------------------------------------
def initialize(depth = 0, main = false)
@depth = depth
@main = main
@@ -39,11 +37,10 @@ class Interpreter
@renamed_choices = []
end_follower_overrides
end
#-----------------------------------------------------------------------------
# * Event Setup
# Event Setup
# list : list of event commands
# event_id : event ID
#-----------------------------------------------------------------------------
def setup(list, event_id, map_id = nil)
clear
@map_id = map_id || $game_map.map_id
@@ -82,9 +79,7 @@ class Interpreter
def running?
return !@list.nil?
end
#-----------------------------------------------------------------------------
# * Frame Update
#-----------------------------------------------------------------------------
def update
@loop_count = 0
loop do
@@ -135,9 +130,7 @@ class Interpreter
@index += 1
end
end
#-----------------------------------------------------------------------------
# * Execute script
#-----------------------------------------------------------------------------
def execute_script(script)
begin
result = eval(script)
@@ -182,10 +175,7 @@ class Interpreter
raise EventScriptError.new(err)
end
end
#-----------------------------------------------------------------------------
# * Get Character
# parameter : parameter
#-----------------------------------------------------------------------------
def get_character(parameter = 0)
case parameter
when -1 # player
@@ -210,21 +200,18 @@ class Interpreter
def get_event(parameter)
return get_character(parameter)
end
#-----------------------------------------------------------------------------
# * Freezes all events on the map (for use at the beginning of common events)
#-----------------------------------------------------------------------------
# Freezes all events on the map (for use at the beginning of common events)
def pbGlobalLock
$game_map.events.each_value { |event| event.minilock }
end
#-----------------------------------------------------------------------------
# * Unfreezes all events on the map (for use at the end of common events)
#-----------------------------------------------------------------------------
# Unfreezes all events on the map (for use at the end of common events)
def pbGlobalUnlock
$game_map.events.each_value { |event| event.unlock }
end
#-----------------------------------------------------------------------------
# * Gets the next index in the interpreter, ignoring certain commands between messages
#-----------------------------------------------------------------------------
# Gets the next index in the interpreter, ignoring certain commands between messages
def pbNextIndex(index)
return -1 if !@list || @list.length == 0
i = index + 1
@@ -292,9 +279,6 @@ class Interpreter
@follower_animation_id = nil
end
#-----------------------------------------------------------------------------
# * Various methods to be used in a script event command.
#-----------------------------------------------------------------------------
# Helper function that shows a picture in a script.
def pbShowPicture(number, name, origin, x, y, zoomX = 100, zoomY = 100, opacity = 255, blendType = 0)
number += ($game_temp.in_battle ? 50 : 0)
@@ -121,6 +121,7 @@ class Interpreter
def command_dummy
return true
end
#-----------------------------------------------------------------------------
# * End Event
#-----------------------------------------------------------------------------
@@ -132,6 +133,7 @@ class Interpreter
$game_map.events[@event_id].unlock
end
end
#-----------------------------------------------------------------------------
# * Command Skip
#-----------------------------------------------------------------------------
@@ -142,6 +144,7 @@ class Interpreter
@index += 1
end
end
#-----------------------------------------------------------------------------
# * Command If
#-----------------------------------------------------------------------------
@@ -152,6 +155,7 @@ class Interpreter
end
return command_skip
end
#-----------------------------------------------------------------------------
# * Show Text
#-----------------------------------------------------------------------------
@@ -203,6 +207,7 @@ class Interpreter
@message_waiting = false
return true
end
#-----------------------------------------------------------------------------
# * Show Choices
#-----------------------------------------------------------------------------
@@ -289,6 +294,7 @@ class Interpreter
return if !condition || nil_or_empty?(new_name)
@renamed_choices[number - 1] = new_name
end
#-----------------------------------------------------------------------------
# * When [**]
#-----------------------------------------------------------------------------
@@ -300,6 +306,7 @@ class Interpreter
end
return command_skip
end
#-----------------------------------------------------------------------------
# * When Cancel
#-----------------------------------------------------------------------------
@@ -311,6 +318,7 @@ class Interpreter
end
return command_skip
end
#-----------------------------------------------------------------------------
# * Input Number
#-----------------------------------------------------------------------------
@@ -325,6 +333,7 @@ class Interpreter
@message_waiting = false
return true
end
#-----------------------------------------------------------------------------
# * Change Text Options
#-----------------------------------------------------------------------------
@@ -334,6 +343,7 @@ class Interpreter
$game_system.message_frame = @parameters[1]
return true
end
#-----------------------------------------------------------------------------
# * Button Input Processing
#-----------------------------------------------------------------------------
@@ -371,6 +381,7 @@ class Interpreter
@index += 1
return true
end
#-----------------------------------------------------------------------------
# * Wait
#-----------------------------------------------------------------------------
@@ -378,6 +389,7 @@ class Interpreter
@wait_count = @parameters[0] * Graphics.frame_rate / 20
return true
end
#-----------------------------------------------------------------------------
# * Conditional Branch
#-----------------------------------------------------------------------------
@@ -433,6 +445,7 @@ class Interpreter
end
return command_skip
end
#-----------------------------------------------------------------------------
# * Else
#-----------------------------------------------------------------------------
@@ -443,12 +456,14 @@ class Interpreter
end
return command_skip
end
#-----------------------------------------------------------------------------
# * Loop
#-----------------------------------------------------------------------------
def command_112
return true
end
#-----------------------------------------------------------------------------
# * Repeat Above
#-----------------------------------------------------------------------------
@@ -459,6 +474,7 @@ class Interpreter
return true if @list[@index].indent == indent
end
end
#-----------------------------------------------------------------------------
# * Break Loop
#-----------------------------------------------------------------------------
@@ -475,6 +491,7 @@ class Interpreter
end
end
end
#-----------------------------------------------------------------------------
# * Exit Event Processing
#-----------------------------------------------------------------------------
@@ -482,6 +499,7 @@ class Interpreter
command_end
return true
end
#-----------------------------------------------------------------------------
# * Erase Event
#-----------------------------------------------------------------------------
@@ -493,6 +511,7 @@ class Interpreter
@index += 1
return false
end
#-----------------------------------------------------------------------------
# * Call Common Event
#-----------------------------------------------------------------------------
@@ -504,12 +523,14 @@ class Interpreter
end
return true
end
#-----------------------------------------------------------------------------
# * Label
#-----------------------------------------------------------------------------
def command_118
return true
end
#-----------------------------------------------------------------------------
# * Jump to Label
#-----------------------------------------------------------------------------
@@ -528,6 +549,7 @@ class Interpreter
temp_index += 1
end
end
#-----------------------------------------------------------------------------
# * Control Switches
#-----------------------------------------------------------------------------
@@ -542,6 +564,7 @@ class Interpreter
$game_map.need_refresh = true if should_refresh
return true
end
#-----------------------------------------------------------------------------
# * Control Variables
#-----------------------------------------------------------------------------
@@ -606,6 +629,7 @@ class Interpreter
end
return true
end
#-----------------------------------------------------------------------------
# * Control Self Switch
#-----------------------------------------------------------------------------
@@ -620,6 +644,7 @@ class Interpreter
end
return true
end
#-----------------------------------------------------------------------------
# * Control Timer
#-----------------------------------------------------------------------------
@@ -628,6 +653,7 @@ class Interpreter
$game_system.timer = @parameters[1] * Graphics.frame_rate if @parameters[0] == 0
return true
end
#-----------------------------------------------------------------------------
# * Change Gold
#-----------------------------------------------------------------------------
@@ -642,6 +668,7 @@ class Interpreter
def command_127; command_dummy; end # Change Weapons
def command_128; command_dummy; end # Change Armor
def command_129; command_dummy; end # Change Party Member
#-----------------------------------------------------------------------------
# * Change Windowskin
#-----------------------------------------------------------------------------
@@ -654,6 +681,7 @@ class Interpreter
end
return true
end
#-----------------------------------------------------------------------------
# * Change Battle BGM
#-----------------------------------------------------------------------------
@@ -661,10 +689,12 @@ class Interpreter
($PokemonGlobal.nextBattleBGM = @parameters[0]) ? @parameters[0].clone : nil
return true
end
#-----------------------------------------------------------------------------
# * Change Battle End ME
#-----------------------------------------------------------------------------
def command_133; command_dummy; end
#-----------------------------------------------------------------------------
# * Change Save Access
#-----------------------------------------------------------------------------
@@ -672,6 +702,7 @@ class Interpreter
$game_system.save_disabled = (@parameters[0] == 0)
return true
end
#-----------------------------------------------------------------------------
# * Change Menu Access
#-----------------------------------------------------------------------------
@@ -679,6 +710,7 @@ class Interpreter
$game_system.menu_disabled = (@parameters[0] == 0)
return true
end
#-----------------------------------------------------------------------------
# * Change Encounter
#-----------------------------------------------------------------------------
@@ -687,6 +719,7 @@ class Interpreter
$game_player.make_encounter_count
return true
end
#-----------------------------------------------------------------------------
# * Transfer Player
#-----------------------------------------------------------------------------
@@ -716,6 +749,7 @@ class Interpreter
end
return false
end
#-----------------------------------------------------------------------------
# * Set Event Location
#-----------------------------------------------------------------------------
@@ -747,6 +781,7 @@ class Interpreter
end
return true
end
#-----------------------------------------------------------------------------
# * Scroll Map
#-----------------------------------------------------------------------------
@@ -756,6 +791,7 @@ class Interpreter
$game_map.start_scroll(@parameters[0], @parameters[1], @parameters[2])
return true
end
#-----------------------------------------------------------------------------
# * Change Map Settings
#-----------------------------------------------------------------------------
@@ -778,6 +814,7 @@ class Interpreter
end
return true
end
#-----------------------------------------------------------------------------
# * Change Fog Color Tone
#-----------------------------------------------------------------------------
@@ -785,6 +822,7 @@ class Interpreter
$game_map.start_fog_tone_change(@parameters[0], @parameters[1] * Graphics.frame_rate / 20)
return true
end
#-----------------------------------------------------------------------------
# * Change Fog Opacity
#-----------------------------------------------------------------------------
@@ -792,6 +830,7 @@ class Interpreter
$game_map.start_fog_opacity_change(@parameters[0], @parameters[1] * Graphics.frame_rate / 20)
return true
end
#-----------------------------------------------------------------------------
# * Show Animation
#-----------------------------------------------------------------------------
@@ -806,6 +845,7 @@ class Interpreter
character.animation_id = @parameters[1]
return true
end
#-----------------------------------------------------------------------------
# * Change Transparent Flag
#-----------------------------------------------------------------------------
@@ -813,6 +853,7 @@ class Interpreter
$game_player.transparent = (@parameters[0] == 0)
return true
end
#-----------------------------------------------------------------------------
# * Set Move Route
#-----------------------------------------------------------------------------
@@ -827,6 +868,7 @@ class Interpreter
character.force_move_route(@parameters[1])
return true
end
#-----------------------------------------------------------------------------
# * Wait for Move's Completion
#-----------------------------------------------------------------------------
@@ -834,6 +876,7 @@ class Interpreter
@move_route_waiting = true if !$game_temp.in_battle
return true
end
#-----------------------------------------------------------------------------
# * Prepare for Transition
#-----------------------------------------------------------------------------
@@ -842,6 +885,7 @@ class Interpreter
Graphics.freeze
return true
end
#-----------------------------------------------------------------------------
# * Execute Transition
#-----------------------------------------------------------------------------
@@ -852,6 +896,7 @@ class Interpreter
@index += 1
return false
end
#-----------------------------------------------------------------------------
# * Change Screen Color Tone
#-----------------------------------------------------------------------------
@@ -859,6 +904,7 @@ class Interpreter
$game_screen.start_tone_change(@parameters[0], @parameters[1] * Graphics.frame_rate / 20)
return true
end
#-----------------------------------------------------------------------------
# * Screen Flash
#-----------------------------------------------------------------------------
@@ -866,6 +912,7 @@ class Interpreter
$game_screen.start_flash(@parameters[0], @parameters[1] * Graphics.frame_rate / 20)
return true
end
#-----------------------------------------------------------------------------
# * Screen Shake
#-----------------------------------------------------------------------------
@@ -873,6 +920,7 @@ class Interpreter
$game_screen.start_shake(@parameters[0], @parameters[1], @parameters[2] * Graphics.frame_rate / 20)
return true
end
#-----------------------------------------------------------------------------
# * Show Picture
#-----------------------------------------------------------------------------
@@ -889,6 +937,7 @@ class Interpreter
x, y, @parameters[6], @parameters[7], @parameters[8], @parameters[9])
return true
end
#-----------------------------------------------------------------------------
# * Move Picture
#-----------------------------------------------------------------------------
@@ -905,6 +954,7 @@ class Interpreter
@parameters[2], x, y, @parameters[6], @parameters[7], @parameters[8], @parameters[9])
return true
end
#-----------------------------------------------------------------------------
# * Rotate Picture
#-----------------------------------------------------------------------------
@@ -913,6 +963,7 @@ class Interpreter
$game_screen.pictures[number].rotate(@parameters[1])
return true
end
#-----------------------------------------------------------------------------
# * Change Picture Color Tone
#-----------------------------------------------------------------------------
@@ -922,6 +973,7 @@ class Interpreter
@parameters[2] * Graphics.frame_rate / 20)
return true
end
#-----------------------------------------------------------------------------
# * Erase Picture
#-----------------------------------------------------------------------------
@@ -930,6 +982,7 @@ class Interpreter
$game_screen.pictures[number].erase
return true
end
#-----------------------------------------------------------------------------
# * Set Weather Effects
#-----------------------------------------------------------------------------
@@ -937,6 +990,7 @@ class Interpreter
$game_screen.weather(@parameters[0], @parameters[1], @parameters[2])
return true
end
#-----------------------------------------------------------------------------
# * Play BGM
#-----------------------------------------------------------------------------
@@ -944,6 +998,7 @@ class Interpreter
pbBGMPlay(@parameters[0])
return true
end
#-----------------------------------------------------------------------------
# * Fade Out BGM
#-----------------------------------------------------------------------------
@@ -951,6 +1006,7 @@ class Interpreter
pbBGMFade(@parameters[0])
return true
end
#-----------------------------------------------------------------------------
# * Play BGS
#-----------------------------------------------------------------------------
@@ -958,6 +1014,7 @@ class Interpreter
pbBGSPlay(@parameters[0])
return true
end
#-----------------------------------------------------------------------------
# * Fade Out BGS
#-----------------------------------------------------------------------------
@@ -965,6 +1022,7 @@ class Interpreter
pbBGSFade(@parameters[0])
return true
end
#-----------------------------------------------------------------------------
# * Memorize BGM/BGS
#-----------------------------------------------------------------------------
@@ -973,6 +1031,7 @@ class Interpreter
$game_system.bgs_memorize
return true
end
#-----------------------------------------------------------------------------
# * Restore BGM/BGS
#-----------------------------------------------------------------------------
@@ -981,6 +1040,7 @@ class Interpreter
$game_system.bgs_restore
return true
end
#-----------------------------------------------------------------------------
# * Play ME
#-----------------------------------------------------------------------------
@@ -988,6 +1048,7 @@ class Interpreter
pbMEPlay(@parameters[0])
return true
end
#-----------------------------------------------------------------------------
# * Play SE
#-----------------------------------------------------------------------------
@@ -995,6 +1056,7 @@ class Interpreter
pbSEPlay(@parameters[0])
return true
end
#-----------------------------------------------------------------------------
# * Stop SE
#-----------------------------------------------------------------------------
@@ -1008,6 +1070,7 @@ class Interpreter
def command_602; command_if(1); end # If Escape
def command_603; command_if(2); end # If Lose
def command_302; command_dummy; end # Shop Processing
#-----------------------------------------------------------------------------
# * Name Input Processing
#-----------------------------------------------------------------------------
@@ -1033,6 +1096,7 @@ class Interpreter
def command_311; command_dummy; end # Change HP
def command_312; command_dummy; end # Change SP
def command_313; command_dummy; end # Change State
#-----------------------------------------------------------------------------
# * Recover All
#-----------------------------------------------------------------------------
@@ -1065,6 +1129,7 @@ class Interpreter
def command_338; command_dummy; end # Deal Damage
def command_339; command_dummy; end # Force Action
def command_340; command_dummy; end # Abort Battle
#-----------------------------------------------------------------------------
# * Call Menu Screen
#-----------------------------------------------------------------------------
@@ -1073,6 +1138,7 @@ class Interpreter
@index += 1
return false
end
#-----------------------------------------------------------------------------
# * Call Save Screen
#-----------------------------------------------------------------------------
@@ -1082,6 +1148,7 @@ class Interpreter
screen.pbSaveScreen
return true
end
#-----------------------------------------------------------------------------
# * Game Over
#-----------------------------------------------------------------------------
@@ -1090,6 +1157,7 @@ class Interpreter
pbBGSFade(1.0)
pbFadeOutIn { pbStartOver(true) }
end
#-----------------------------------------------------------------------------
# * Return to Title Screen
#-----------------------------------------------------------------------------
@@ -1097,6 +1165,7 @@ class Interpreter
$game_temp.title_screen_calling = true
return false
end
#-----------------------------------------------------------------------------
# * Script
#-----------------------------------------------------------------------------
@@ -5,9 +5,6 @@
# flashing, etc. Refer to "$game_screen" for the instance of this class.
#===============================================================================
class Game_Screen
#-----------------------------------------------------------------------------
# * Public Instance Variables
#-----------------------------------------------------------------------------
attr_reader :brightness # brightness
attr_reader :tone # color tone
attr_reader :flash_color # flash color
@@ -17,9 +14,6 @@ class Game_Screen
attr_reader :weather_max # max number of weather sprites
attr_accessor :weather_duration # ticks in which the weather should fade in
#-----------------------------------------------------------------------------
# * Object Initialization
#-----------------------------------------------------------------------------
def initialize
@brightness = 255
@fadeout_duration = 0
@@ -42,11 +36,7 @@ class Game_Screen
@weather_max = 0.0
@weather_duration = 0
end
#-----------------------------------------------------------------------------
# * Start Changing Color Tone
# tone : color tone
# duration : time
#-----------------------------------------------------------------------------
def start_tone_change(tone, duration)
@tone_target = tone.clone
@tone_duration = duration
@@ -54,40 +44,24 @@ class Game_Screen
@tone = @tone_target.clone
end
end
#-----------------------------------------------------------------------------
# * Start Flashing
# color : color
# duration : time
#-----------------------------------------------------------------------------
def start_flash(color, duration)
@flash_color = color.clone
@flash_duration = duration
end
#-----------------------------------------------------------------------------
# * Start Shaking
# power : strength
# speed : speed
# duration : time
#-----------------------------------------------------------------------------
def start_shake(power, speed, duration)
@shake_power = power
@shake_speed = speed
@shake_duration = duration
end
#-----------------------------------------------------------------------------
# * Set Weather
# type : type
# power : strength
# duration : time
#-----------------------------------------------------------------------------
def weather(type, power, duration)
@weather_type = GameData::Weather.get(type).id
@weather_max = (power + 1) * RPG::Weather::MAX_SPRITES / 10
@weather_duration = duration # In 1/20ths of a seconds
end
#-----------------------------------------------------------------------------
# * Frame Update
#-----------------------------------------------------------------------------
def update
if @fadeout_duration && @fadeout_duration >= 1
d = @fadeout_duration
@@ -5,25 +5,20 @@
# Refer to "$game_switches" for the instance of this class.
#===============================================================================
class Game_Switches
#-----------------------------------------------------------------------------
# * Object Initialization
#-----------------------------------------------------------------------------
def initialize
@data = []
end
#-----------------------------------------------------------------------------
# * Get Switch
# Get Switch
# switch_id : switch ID
#-----------------------------------------------------------------------------
def [](switch_id)
return @data[switch_id] if switch_id <= 5000 && @data[switch_id]
return false
end
#-----------------------------------------------------------------------------
# * Set Switch
# Set Switch
# switch_id : switch ID
# value : ON (true) / OFF (false)
#-----------------------------------------------------------------------------
def []=(switch_id, value)
@data[switch_id] = value if switch_id <= 5000
end
@@ -5,25 +5,20 @@
# Refer to "$game_variables" for the instance of this class.
#===============================================================================
class Game_Variables
#-----------------------------------------------------------------------------
# * Object Initialization
#-----------------------------------------------------------------------------
def initialize
@data = []
end
#-----------------------------------------------------------------------------
# * Get Variable
# Get Variable
# variable_id : variable ID
#-----------------------------------------------------------------------------
def [](variable_id)
return @data[variable_id] if variable_id <= 5000 && !@data[variable_id].nil?
return 0
end
#-----------------------------------------------------------------------------
# * Set Variable
# Set Variable
# variable_id : variable ID
# value : the variable's value
#-----------------------------------------------------------------------------
def []=(variable_id, value)
@data[variable_id] = value if variable_id <= 5000
end
@@ -5,24 +5,19 @@
# "Hash." Refer to "$game_self_switches" for the instance of this class.
#===============================================================================
class Game_SelfSwitches
#-----------------------------------------------------------------------------
# * Object Initialization
#-----------------------------------------------------------------------------
def initialize
@data = {}
end
#-----------------------------------------------------------------------------
# * Get Self Switch
# Get Self Switch
# key : key
#-----------------------------------------------------------------------------
def [](key)
return @data[key] == true
end
#-----------------------------------------------------------------------------
# * Set Self Switch
# Set Self Switch
# key : key
# value : ON (true) / OFF (false)
#-----------------------------------------------------------------------------
def []=(key, value)
@data[key] = value
end
@@ -4,11 +4,7 @@
# This class handles the picture. It's used within the Game_Screen class
# ($game_screen).
#===============================================================================
class Game_Picture
#-----------------------------------------------------------------------------
# * Public Instance Variables
#-----------------------------------------------------------------------------
attr_reader :number # picture number
attr_reader :name # file name
attr_reader :origin # starting point
@@ -21,10 +17,6 @@ class Game_Picture
attr_reader :tone # color tone
attr_reader :angle # rotation angle
#-----------------------------------------------------------------------------
# * Object Initialization
# number : picture number
#-----------------------------------------------------------------------------
def initialize(number)
@number = number
@name = ""
@@ -47,8 +39,8 @@ class Game_Picture
@angle = 0
@rotate_speed = 0
end
#-----------------------------------------------------------------------------
# * Show Picture
# Show Picture
# name : file name
# origin : starting point
# x : x-coordinate
@@ -57,7 +49,6 @@ class Game_Picture
# zoom_y : y directional zoom rate
# opacity : opacity level
# blend_type : blend method
#-----------------------------------------------------------------------------
def show(name, origin, x, y, zoom_x, zoom_y, opacity, blend_type)
@name = name
@origin = origin
@@ -79,8 +70,8 @@ class Game_Picture
@angle = 0
@rotate_speed = 0
end
#-----------------------------------------------------------------------------
# * Move Picture
# Move Picture
# duration : time
# origin : starting point
# x : x-coordinate
@@ -89,7 +80,6 @@ class Game_Picture
# zoom_y : y directional zoom rate
# opacity : opacity level
# blend_type : blend method
#-----------------------------------------------------------------------------
def move(duration, origin, x, y, zoom_x, zoom_y, opacity, blend_type)
@duration = duration
@origin = origin
@@ -100,18 +90,16 @@ class Game_Picture
@target_opacity = opacity.to_f
@blend_type = blend_type || 0
end
#-----------------------------------------------------------------------------
# * Change Rotation Speed
# Change Rotation Speed
# speed : rotation speed
#-----------------------------------------------------------------------------
def rotate(speed)
@rotate_speed = speed
end
#-----------------------------------------------------------------------------
# * Start Change of Color Tone
# Start Change of Color Tone
# tone : color tone
# duration : time
#-----------------------------------------------------------------------------
def start_tone_change(tone, duration)
@tone_target = tone.clone
@tone_duration = duration
@@ -119,15 +107,13 @@ class Game_Picture
@tone = @tone_target.clone
end
end
#-----------------------------------------------------------------------------
# * Erase Picture
#-----------------------------------------------------------------------------
# Erase Picture
def erase
@name = ""
end
#-----------------------------------------------------------------------------
# * Frame Update
#-----------------------------------------------------------------------------
# Frame Update
def update
if @duration >= 1
d = @duration
@@ -106,28 +106,24 @@ class Game_Map
return GameData::MapMetadata.try_get(@map_id)
end
#-----------------------------------------------------------------------------
# Returns the name of this map's BGM. If it's night time, returns the night
# version of the BGM (if it exists).
#-----------------------------------------------------------------------------
def bgm_name
if PBDayNight.isNight? && FileTest.audio_exist?("Audio/BGM/" + @map.bgm.name + "_n")
return @map.bgm.name + "_n"
end
return @map.bgm.name
end
#-----------------------------------------------------------------------------
# * Autoplays background music
# Autoplays background music
# Plays music called "[normal BGM]_n" if it's night time and it exists
#-----------------------------------------------------------------------------
def autoplayAsCue
pbCueBGM(bgm_name, 1.0, @map.bgm.volume, @map.bgm.pitch) if @map.autoplay_bgm
pbBGSPlay(@map.bgs) if @map.autoplay_bgs
end
#-----------------------------------------------------------------------------
# * Plays background music
# Plays background music
# Plays music called "[normal BGM]_n" if it's night time and it exists
#-----------------------------------------------------------------------------
def autoplay
pbBGMPlay(bgm_name, @map.bgm.volume, @map.bgm.pitch) if @map.autoplay_bgm
pbBGSPlay(@map.bgs) if @map.autoplay_bgs
@@ -249,7 +245,7 @@ class Game_Map
end
# Returns whether the position x,y is fully passable (there is no blocking
# event there, and the tile is fully passable in all directions)
# event there, and the tile is fully passable in all directions).
def passableStrict?(x, y, d, self_event = nil)
return false if !valid?(x, y)
events.each_value do |event|
@@ -69,14 +69,15 @@
=end
#===============================================================================
#
#===============================================================================
class Interpreter
SCROLL_SPEED_DEFAULT = 4
#-----------------------------------------------------------------------------
# * Map Autoscroll to Coordinates
# Map Autoscroll to Coordinates
# x : x coordinate to scroll to and center on
# y : y coordinate to scroll to and center on
# speed : (optional) scroll speed (from 1-6, default being 4)
#-----------------------------------------------------------------------------
def autoscroll(x, y, speed = SCROLL_SPEED_DEFAULT)
if $game_map.scrolling?
return false
@@ -130,17 +131,16 @@ class Interpreter
return !@diag
end
#-----------------------------------------------------------------------------
# * Map Autoscroll (to Player)
# Map Autoscroll (to Player)
# speed : (optional) scroll speed (from 1-6, default being 4)
#-----------------------------------------------------------------------------
def autoscroll_player(speed = SCROLL_SPEED_DEFAULT)
autoscroll($game_player.x, $game_player.y, speed)
end
end
#===============================================================================
#
#===============================================================================
class Game_Map
def scroll_downright(distance)
@display_x = [@display_x + distance,
@@ -355,7 +355,7 @@ class PokemonMapFactory
def updateMaps(scene)
updateMapsInternal
$map_factory.setSceneStarted(scene) if @mapChanged
setSceneStarted(scene) if @mapChanged
end
def updateMapsInternal
@@ -267,13 +267,11 @@ class Game_Player < Game_Character
return $game_map.terrain_tag(facing[1], facing[2])
end
#-----------------------------------------------------------------------------
# * Passable Determinants
# Passable Determinants
# x : x-coordinate
# y : y-coordinate
# d : direction (0, 2, 4, 6, 8)
# * 0 = Determines if all directions are impassable (for jumping)
#-----------------------------------------------------------------------------
def passable?(x, y, d, strict = false)
# Get new coordinates
new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
@@ -289,28 +287,22 @@ class Game_Player < Game_Character
return super
end
#-----------------------------------------------------------------------------
# * Set Map Display Position to Center of Screen
#-----------------------------------------------------------------------------
# Set Map Display Position to Center of Screen
def center(x, y)
self.map.display_x = (x * Game_Map::REAL_RES_X) - SCREEN_CENTER_X
self.map.display_y = (y * Game_Map::REAL_RES_Y) - SCREEN_CENTER_Y
end
#-----------------------------------------------------------------------------
# * Move to Designated Position
# Move to Designated Position
# x : x-coordinate
# y : y-coordinate
#-----------------------------------------------------------------------------
def moveto(x, y)
super
center(x, y)
make_encounter_count
end
#-----------------------------------------------------------------------------
# * Make Encounter Count
#-----------------------------------------------------------------------------
# Make Encounter Count
def make_encounter_count
# Image of two dice rolling
if $game_map.map_id != 0
@@ -319,18 +311,13 @@ class Game_Player < Game_Character
end
end
#-----------------------------------------------------------------------------
# * Refresh
#-----------------------------------------------------------------------------
def refresh
@opacity = 255
@blend_type = 0
end
#-----------------------------------------------------------------------------
# * Trigger event(s) at the same coordinates as self with the appropriate
# Trigger event(s) at the same coordinates as self with the appropriate
# trigger(s) that can be triggered
#-----------------------------------------------------------------------------
def check_event_trigger_here(triggers)
result = false
# If event is running
@@ -348,9 +335,7 @@ class Game_Player < Game_Character
return result
end
#-----------------------------------------------------------------------------
# * Front Event Starting Determinant
#-----------------------------------------------------------------------------
# Front Event Starting Determinant
def check_event_trigger_there(triggers)
result = false
# If event is running
@@ -389,9 +374,7 @@ class Game_Player < Game_Character
return result
end
#-----------------------------------------------------------------------------
# * Touch Event Starting Determinant
#-----------------------------------------------------------------------------
# Touch Event Starting Determinant
def check_event_trigger_touch(dir)
result = false
return result if $game_system.map_interpreter.running?
@@ -417,9 +400,6 @@ class Game_Player < Game_Character
return result
end
#-----------------------------------------------------------------------------
# * Frame Update
#-----------------------------------------------------------------------------
def update
last_real_x = @real_x
last_real_y = @real_y
@@ -531,7 +511,7 @@ class Game_Player < Game_Character
end
end
# Track the player on-screen as they move
# Track the player on-screen as they move.
def update_screen_position(last_real_x, last_real_y)
return if self.map.scrolling? || !(@moved_last_frame || @moved_this_frame)
if (@real_x < last_real_x && @real_x - $game_map.display_x < SCREEN_CENTER_X) ||
@@ -564,8 +544,6 @@ class Game_Player < Game_Character
end
end
#===============================================================================
#
#===============================================================================
@@ -5,42 +5,28 @@
# event. This class is used within the Game_Map class ($game_map).
#===============================================================================
class Game_CommonEvent
#-----------------------------------------------------------------------------
# * Object Initialization
# common_event_id : common event ID
#-----------------------------------------------------------------------------
def initialize(common_event_id)
@common_event_id = common_event_id
@interpreter = nil
refresh
end
#-----------------------------------------------------------------------------
# * Get Name
#-----------------------------------------------------------------------------
def name
return $data_common_events[@common_event_id].name
end
#-----------------------------------------------------------------------------
# * Get Trigger
#-----------------------------------------------------------------------------
def trigger
return $data_common_events[@common_event_id].trigger
end
#-----------------------------------------------------------------------------
# * Get Condition Switch ID
#-----------------------------------------------------------------------------
def switch_id
return $data_common_events[@common_event_id].switch_id
end
#-----------------------------------------------------------------------------
# * Get List of Event Commands
#-----------------------------------------------------------------------------
def list
return $data_common_events[@common_event_id].list
end
#-----------------------------------------------------------------------------
# * Checks if switch is on
#-----------------------------------------------------------------------------
def switchIsOn?(id)
switchName = $data_system.switches[id]
return false if !switchName
@@ -50,9 +36,7 @@ class Game_CommonEvent
return $game_switches[id]
end
end
#-----------------------------------------------------------------------------
# * Refresh
#-----------------------------------------------------------------------------
def refresh
# Create an interpreter for parallel process if necessary
if self.trigger == 2 && switchIsOn?(self.switch_id)
@@ -63,9 +47,7 @@ class Game_CommonEvent
@interpreter = nil
end
end
#-----------------------------------------------------------------------------
# * Frame Update
#-----------------------------------------------------------------------------
def update
return if !@interpreter
# Set up event if interpreter is not running
@@ -388,7 +388,6 @@ module Followers
end
end
#===============================================================================
# Deprecated methods
#===============================================================================
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
class BushBitmap
def initialize(bitmap, isTile, depth)
@bitmaps = []
@@ -53,8 +56,9 @@ class BushBitmap
end
end
#===============================================================================
#
#===============================================================================
class Sprite_Character < RPG::Sprite
attr_accessor :character
@@ -1,4 +1,6 @@
# Unused
#===============================================================================
# Unused.
#===============================================================================
class ClippableSprite < Sprite_Character
def initialize(viewport, event, tilemap)
@tilemap = tilemap
@@ -29,8 +31,9 @@ class ClippableSprite < Sprite_Character
end
end
#===============================================================================
#
#===============================================================================
class Spriteset_Map
attr_reader :map
@@ -1,9 +1,8 @@
=begin
A sprite whose sole purpose is to display an animation. This sprite
can be displayed anywhere on the map and is disposed
automatically when its animation is finished.
Used for grass rustling and so forth.
=end
#===============================================================================
# A sprite whose sole purpose is to display an animation. This sprite can be
# displayed anywhere on the map and is disposed automatically when its animation
# is finished. Used for grass rustling and so forth.
#===============================================================================
class AnimationSprite < RPG::Sprite
def initialize(animID, map, tileX, tileY, viewport = nil, tinting = false, height = 3)
super(viewport)
@@ -38,8 +37,9 @@ class AnimationSprite < RPG::Sprite
end
end
#===============================================================================
#
#===============================================================================
class Spriteset_Map
alias _animationSprite_initialize initialize unless private_method_defined?(:_animationSprite_initialize)
alias _animationSprite_update update unless method_defined?(:_animationSprite_update)
@@ -117,11 +117,9 @@ class Sprite_Shadow < RPG::Sprite
end
end
#===================================================
#===============================================================================
# ? CLASS Sprite_Character edit
#===================================================
#===============================================================================
class Sprite_Character < RPG::Sprite
alias shadow_initialize initialize unless private_method_defined?(:shadow_initialize)
@@ -161,20 +159,16 @@ class Sprite_Character < RPG::Sprite
end
end
#===================================================
#===============================================================================
# ? CLASS Game_Event edit
#===================================================
#===============================================================================
class Game_Event
attr_accessor :id
end
#===================================================
#===============================================================================
# ? CLASS Spriteset_Map edit
#===================================================
#===============================================================================
class Spriteset_Map
attr_accessor :shadows
@@ -202,9 +196,7 @@ class Spriteset_Map
end
end
#===================================================
#===============================================================================
# ? XPML Definition, by Rataime, using ideas from Near Fantastica
#
# Returns nil if the markup wasn't present at all,
@@ -222,7 +214,7 @@ end
# p XPML_read("second", event_id) -> [1, "two"]
# p XPML_read("third", event_id) -> [3]
# p XPML_read("forth", event_id) -> nil
#===================================================
#===============================================================================
def XPML_read(map, markup, event, max_param_number = 0)
parameter_list = nil
return nil if !event || event.list.nil?
+55 -36
View File
@@ -1,6 +1,8 @@
#===============================================================================
# Particle Engine, Peter O., 2007-11-03
# Based on version 2 by Near Fantastica, 04.01.06
# In turn based on the Particle Engine designed by PinkMan
#===============================================================================
class Particle_Engine
def initialize(viewport = nil, map = nil)
@map = (map) ? map : $game_map
@@ -98,8 +100,9 @@ class Particle_Engine
end
end
#===============================================================================
#
#===============================================================================
class ParticleEffect
attr_accessor :x, :y, :z
@@ -113,8 +116,9 @@ class ParticleEffect
def dispose; end
end
#===============================================================================
#
#===============================================================================
class ParticleSprite
attr_accessor :x, :y, :z, :ox, :oy, :opacity, :blend_type
attr_reader :bitmap
@@ -171,8 +175,9 @@ class ParticleSprite
end
end
#===============================================================================
#
#===============================================================================
class ParticleEffect_Event < ParticleEffect
attr_accessor :event
@@ -357,8 +362,9 @@ class ParticleEffect_Event < ParticleEffect
end
end
#===============================================================================
#
#===============================================================================
class Particle_Engine::Fire < ParticleEffect_Event
def initialize(event, viewport)
super
@@ -368,8 +374,9 @@ class Particle_Engine::Fire < ParticleEffect_Event
end
end
#===============================================================================
#
#===============================================================================
class Particle_Engine::Smoke < ParticleEffect_Event
def initialize(event, viewport)
super
@@ -379,8 +386,9 @@ class Particle_Engine::Smoke < ParticleEffect_Event
end
end
#===============================================================================
#
#===============================================================================
class Particle_Engine::Teleport < ParticleEffect_Event
def initialize(event, viewport)
super
@@ -394,8 +402,9 @@ class Particle_Engine::Teleport < ParticleEffect_Event
end
end
#===============================================================================
#
#===============================================================================
class Particle_Engine::Spirit < ParticleEffect_Event
def initialize(event, viewport)
super
@@ -405,8 +414,9 @@ class Particle_Engine::Spirit < ParticleEffect_Event
end
end
#===============================================================================
#
#===============================================================================
class Particle_Engine::Explosion < ParticleEffect_Event
def initialize(event, viewport)
super
@@ -416,8 +426,9 @@ class Particle_Engine::Explosion < ParticleEffect_Event
end
end
#===============================================================================
#
#===============================================================================
class Particle_Engine::Aura < ParticleEffect_Event
def initialize(event, viewport)
super
@@ -427,8 +438,9 @@ class Particle_Engine::Aura < ParticleEffect_Event
end
end
#===============================================================================
#
#===============================================================================
class Particle_Engine::Soot < ParticleEffect_Event
def initialize(event, viewport)
super
@@ -438,8 +450,9 @@ class Particle_Engine::Soot < ParticleEffect_Event
end
end
#===============================================================================
#
#===============================================================================
class Particle_Engine::SootSmoke < ParticleEffect_Event
def initialize(event, viewport)
super
@@ -452,8 +465,9 @@ class Particle_Engine::SootSmoke < ParticleEffect_Event
end
end
#===============================================================================
#
#===============================================================================
class Particle_Engine::Rocket < ParticleEffect_Event
def initialize(event, viewport)
super
@@ -463,8 +477,9 @@ class Particle_Engine::Rocket < ParticleEffect_Event
end
end
#===============================================================================
#
#===============================================================================
class Particle_Engine::FixedTeleport < ParticleEffect_Event
def initialize(event, viewport)
super
@@ -478,9 +493,9 @@ class Particle_Engine::FixedTeleport < ParticleEffect_Event
end
end
#===============================================================================
# By Peter O.
#===============================================================================
class Particle_Engine::StarTeleport < ParticleEffect_Event
def initialize(event, viewport)
super
@@ -494,8 +509,9 @@ class Particle_Engine::StarTeleport < ParticleEffect_Event
end
end
#===============================================================================
#
#===============================================================================
class Particle_Engine::Smokescreen < ParticleEffect_Event
def initialize(event, viewport)
super
@@ -531,8 +547,9 @@ class Particle_Engine::Smokescreen < ParticleEffect_Event
end
end
#===============================================================================
#
#===============================================================================
class Particle_Engine::Flare < ParticleEffect_Event
def initialize(event, viewport)
super
@@ -542,8 +559,9 @@ class Particle_Engine::Flare < ParticleEffect_Event
end
end
#===============================================================================
#
#===============================================================================
class Particle_Engine::Splash < ParticleEffect_Event
def initialize(event, viewport)
super
@@ -561,8 +579,9 @@ class Particle_Engine::Splash < ParticleEffect_Event
end
end
#===============================================================================
#
#===============================================================================
class Game_Event < Game_Character
attr_accessor :pe_refresh
+9 -8
View File
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
class PictureOrigin
TOP_LEFT = 0
CENTER = 1
@@ -12,8 +15,9 @@ class PictureOrigin
RIGHT = 8
end
#===============================================================================
#
#===============================================================================
class Processes
XY = 0
DELTA_XY = 1
@@ -35,8 +39,9 @@ class Processes
CROP_BOTTOM = 17
end
#===============================================================================
#
#===============================================================================
def getCubicPoint2(src, t)
x0 = src[0]
y0 = src[1]
@@ -72,8 +77,6 @@ def getCubicPoint2(src, t)
return [cx, cy]
end
#===============================================================================
# PictureEx
#===============================================================================
@@ -456,8 +459,6 @@ class PictureEx
end
end
#===============================================================================
#
#===============================================================================
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
class Interpolator
ZOOM_X = 1
ZOOM_Y = 2
@@ -83,8 +86,9 @@ class Interpolator
end
end
#===============================================================================
#
#===============================================================================
class RectInterpolator
def initialize(oldrect, newrect, frames)
restart(oldrect, newrect, frames)
@@ -130,8 +134,9 @@ class RectInterpolator
end
end
#===============================================================================
#
#===============================================================================
class PointInterpolator
attr_reader :x
attr_reader :y
@@ -1,7 +1,11 @@
#===============================================================================
#
#===============================================================================
class Hangup < Exception; end
#===============================================================================
#
#===============================================================================
module RPG
module Cache
def self.debug
@@ -106,8 +110,9 @@ module RPG
end
end
#===============================================================================
#
#===============================================================================
class BitmapWrapper < Bitmap
attr_reader :refcount
attr_accessor :never_dispose
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module MessageConfig
LIGHT_TEXT_MAIN_COLOR = Color.new(248, 248, 248)
LIGHT_TEXT_SHADOW_COLOR = Color.new(72, 80, 88)
@@ -163,8 +166,6 @@ module MessageConfig
end
end
#===============================================================================
# Position a window
#===============================================================================
@@ -759,10 +760,8 @@ def addBackgroundOrColoredPlane(sprites, planename, background, color, viewport
end
end
#===============================================================================
# Ensure required method definitions
# Ensure required method definitions.
#===============================================================================
module Graphics
if !self.respond_to?("width")
@@ -773,8 +772,9 @@ module Graphics
end
end
#===============================================================================
# Ensure required method definitions.
#===============================================================================
if !defined?(_INTL)
def _INTL(*args)
string = args[0].clone
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
class WindowCursorRect < Rect
def initialize(window)
super(0, 0, 0, 0)
@@ -46,7 +49,9 @@ class WindowCursorRect < Rect
end
end
#===============================================================================
#
#===============================================================================
class Window
attr_reader :tone
attr_reader :color
@@ -46,6 +46,8 @@ class SpriteWindow < Window
end
attr_reader :compat
attr_reader :skinformat
attr_reader :skinrect
def compat=(value)
@compat = value
@@ -324,10 +326,6 @@ class SpriteWindow < Window
end
end
#############
attr_reader :skinformat
attr_reader :skinrect
def loadSkinFile(_file)
if (self.windowskin.width == 80 || self.windowskin.width == 96) &&
self.windowskin.height == 48
@@ -437,7 +435,8 @@ class SpriteWindow < Window
privRefresh
end
#############
#===============================================================================
private
def ensureBitmap(bitmap, dwidth, dheight)
@@ -813,8 +812,6 @@ class SpriteWindow < Window
end
end
#===============================================================================
#
#===============================================================================
@@ -1,8 +1,7 @@
#===============================================================================
#
#===============================================================================
# Represents a window with no formatting capabilities. Its text color can be set,
# though, and line breaks are supported, but the text is generally unformatted.
#===============================================================================
class Window_UnformattedTextPokemon < SpriteWindow_Base
attr_reader :text
attr_reader :baseColor
@@ -106,8 +105,6 @@ class Window_UnformattedTextPokemon < SpriteWindow_Base
end
end
#===============================================================================
#
#===============================================================================
@@ -602,8 +599,6 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base
end
end
#===============================================================================
#
#===============================================================================
@@ -723,8 +718,6 @@ class Window_InputNumberPokemon < SpriteWindow_Base
end
end
#===============================================================================
#
#===============================================================================
@@ -951,8 +944,6 @@ class SpriteWindow_Selectable < SpriteWindow_Base
end
end
#===============================================================================
#
#===============================================================================
@@ -1016,8 +1007,6 @@ module UpDownArrowMixin
end
end
#===============================================================================
#
#===============================================================================
@@ -1030,8 +1019,6 @@ class SpriteWindow_SelectableEx < SpriteWindow_Selectable
end
end
#===============================================================================
#
#===============================================================================
@@ -1137,8 +1124,6 @@ class Window_DrawableCommand < SpriteWindow_SelectableEx
end
end
#===============================================================================
#
#===============================================================================
@@ -1229,15 +1214,12 @@ class Window_CommandPokemon < Window_DrawableCommand
end
end
#===============================================================================
#
#===============================================================================
class Window_CommandPokemonEx < Window_CommandPokemon
end
#===============================================================================
#
#===============================================================================
@@ -1350,8 +1332,6 @@ class Window_AdvancedCommandPokemon < Window_DrawableCommand
end
end
#===============================================================================
#
#===============================================================================
@@ -51,8 +51,6 @@ class IconWindow < SpriteWindow_Base
end
end
#===============================================================================
# Displays an icon bitmap in a window. Supports animated images.
# Accepts bitmaps and paths to bitmap files in its constructor.
@@ -88,8 +88,6 @@ class SpriteWrapper
end
end
#===============================================================================
# Sprite class that maintains a bitmap of its own.
# This bitmap can't be changed to a different one.
@@ -111,8 +109,6 @@ class BitmapSprite < Sprite
end
end
#===============================================================================
#
#===============================================================================
@@ -237,8 +233,6 @@ class AnimatedSprite < Sprite
end
end
#===============================================================================
# Displays an icon bitmap in a sprite. Supports animated images.
#===============================================================================
@@ -310,8 +304,6 @@ class IconSprite < Sprite
end
end
#===============================================================================
# Sprite class that stores multiple bitmaps, and displays only one at once.
#===============================================================================
@@ -54,8 +54,6 @@ def getContrastColor(color)
return color.get_contrast_color
end
#===============================================================================
# Format text
#===============================================================================
@@ -248,8 +246,6 @@ def getLastColors(colorstack, opacitystack, defaultcolors)
return colors
end
#===============================================================================
# Formats a string of text and returns an array containing a list of formatted
# characters.
@@ -317,7 +313,6 @@ In addition, the syntax supports the following:
To draw the characters, pass the returned array to the
_drawFormattedChars_ function.
=end
def getFormattedText(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight = 32,
newlineBreaks = true, explicitBreaksOnly = false,
collapseAlignments = false)
@@ -774,8 +769,6 @@ def getFormattedText(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight =
return characters
end
#===============================================================================
# Draw text and images on a bitmap
#===============================================================================
@@ -1109,8 +1102,6 @@ def pbDrawTextPositions(bitmap, textpos)
end
end
#===============================================================================
# Draw images on a bitmap
#===============================================================================
@@ -49,8 +49,6 @@ def pbCurrentEventCommentInput(elements, trigger)
return pbEventCommentInput(event, elements, trigger)
end
#===============================================================================
#
#===============================================================================
@@ -164,8 +162,9 @@ class ChooseNumberParams
end
end
#===============================================================================
#
#===============================================================================
def pbChooseNumber(msgwindow, params)
return 0 if !params
ret = 0
@@ -208,8 +207,6 @@ def pbChooseNumber(msgwindow, params)
return ret
end
#===============================================================================
#
#===============================================================================
@@ -244,8 +241,6 @@ class FaceWindowVX < SpriteWindow_Base
end
end
#===============================================================================
#
#===============================================================================
@@ -311,8 +306,6 @@ def pbCsvPosInt!(str)
return ret.to_i
end
#===============================================================================
# Money and coins windows
#===============================================================================
@@ -368,8 +361,6 @@ def pbDisplayBattlePointsWindow(msgwindow)
return pointswindow
end
#===============================================================================
#
#===============================================================================
@@ -410,8 +401,6 @@ def pbDisposeMessageWindow(msgwindow)
msgwindow.dispose
end
#===============================================================================
# Main message-displaying function
#===============================================================================
@@ -701,8 +690,6 @@ def pbMessageDisplay(msgwindow, message, letterbyletter = true, commandProc = ni
return ret
end
#===============================================================================
# Message-displaying functions
#===============================================================================
@@ -81,8 +81,6 @@ class CharacterEntryHelper
end
end
#===============================================================================
#
#===============================================================================
@@ -217,8 +215,6 @@ class Window_TextEntry < SpriteWindow_Base
end
end
#===============================================================================
#
#===============================================================================
@@ -253,8 +249,6 @@ class Window_TextEntry_Keyboard < Window_TextEntry
end
end
#===============================================================================
#
#===============================================================================
+4 -7
View File
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
class PictureSprite < Sprite
def initialize(viewport, picture)
super(viewport)
@@ -50,8 +53,6 @@ class PictureSprite < Sprite
end
end
def pbTextBitmap(text, maxwidth = Graphics.width)
tmp = Bitmap.new(maxwidth, Graphics.height)
pbSetSystemFont(tmp)
@@ -59,10 +60,8 @@ def pbTextBitmap(text, maxwidth = Graphics.width)
return tmp
end
#===============================================================================
# EventScene
#
#===============================================================================
class EventScene
attr_accessor :onCTrigger, :onBTrigger, :onUpdate
@@ -181,8 +180,6 @@ class EventScene
end
end
#===============================================================================
#
#===============================================================================
@@ -42,7 +42,7 @@ module GameData
validate tr_type => [Symbol, String]
validate tr_name => [String, NilClass]
key = [tr_type.to_sym, tr_name, tr_version]
key = key[0] if key[1] == nil
key = key[0] if key[1].nil?
return !self::DATA[key].nil?
end
@@ -453,8 +453,6 @@ class Battle::Move::DoublePowerIfTargetPoisoned < Battle::Move
end
end
#===============================================================================
# Power is doubled if the target is paralyzed. Cures the target of paralysis.
# (Smelling Salts)
@@ -91,8 +91,6 @@ class Battle::Scene::MenuBase
end
end
#===============================================================================
# Command menu (Fight/Pokémon/Bag/Run)
#===============================================================================
@@ -194,8 +192,6 @@ class Battle::Scene::CommandMenu < Battle::Scene::MenuBase
end
end
#===============================================================================
# Fight menu (choose a move)
#===============================================================================
@@ -440,8 +436,6 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase
end
end
#===============================================================================
# Target menu (choose a move's target)
# NOTE: Unlike the command and fight menus, this one doesn't have a textbox-only
@@ -402,8 +402,6 @@ class Battle::Scene::PokemonDataBox < Sprite
end
end
#===============================================================================
# Splash bar to announce a triggered ability
#===============================================================================
@@ -496,8 +494,6 @@ class Battle::Scene::AbilitySplashBar < Sprite
end
end
#===============================================================================
# Pokémon sprite (used in battle)
#===============================================================================
@@ -624,8 +620,6 @@ class Battle::Scene::BattlerSprite < RPG::Sprite
end
end
#===============================================================================
# Shadow sprite for Pokémon (used in battle)
#===============================================================================
@@ -57,8 +57,6 @@ class Battle::Scene::Animation::Intro < Battle::Scene::Animation
end
end
#===============================================================================
# Shows wild Pokémon fading back to their normal color, and triggers their intro
# animations
@@ -80,8 +78,6 @@ class Battle::Scene::Animation::Intro2 < Battle::Scene::Animation
end
end
#===============================================================================
# Makes a side's party bar and balls appear
#===============================================================================
@@ -181,8 +177,6 @@ class Battle::Scene::Animation::LineupAppear < Battle::Scene::Animation
end
end
#===============================================================================
# Makes a Pokémon's data box appear
#===============================================================================
@@ -202,8 +196,6 @@ class Battle::Scene::Animation::DataBoxAppear < Battle::Scene::Animation
end
end
#===============================================================================
# Makes a Pokémon's data box disappear
#===============================================================================
@@ -222,8 +214,6 @@ class Battle::Scene::Animation::DataBoxDisappear < Battle::Scene::Animation
end
end
#===============================================================================
# Makes a Pokémon's ability bar appear
#===============================================================================
@@ -242,8 +232,6 @@ class Battle::Scene::Animation::AbilitySplashAppear < Battle::Scene::Animation
end
end
#===============================================================================
# Makes a Pokémon's ability bar disappear
#===============================================================================
@@ -262,8 +250,6 @@ class Battle::Scene::Animation::AbilitySplashDisappear < Battle::Scene::Animatio
end
end
#===============================================================================
# Make an enemy trainer slide on-screen from the right. Makes the previous
# trainer slide off to the right first if it is on-screen.
@@ -296,8 +282,6 @@ class Battle::Scene::Animation::TrainerAppear < Battle::Scene::Animation
end
end
#===============================================================================
# Shows the player (and partner) and the player party lineup sliding off screen.
# Shows the player's/partner's throwing animation (if they have one).
@@ -350,8 +334,6 @@ class Battle::Scene::Animation::PlayerFade < Battle::Scene::Animation
end
end
#===============================================================================
# Shows the enemy trainer(s) and the enemy party lineup sliding off screen.
# Doesn't show the ball thrown or the Pokémon.
@@ -395,8 +377,6 @@ class Battle::Scene::Animation::TrainerFade < Battle::Scene::Animation
end
end
#===============================================================================
# Shows a Pokémon being sent out on the player's side (including by a partner).
# Includes the Poké Ball being thrown.
@@ -473,8 +453,6 @@ class Battle::Scene::Animation::PokeballPlayerSendOut < Battle::Scene::Animation
end
end
#===============================================================================
# Shows a Pokémon being sent out on the opposing side.
# Includes the Poké Ball being "thrown" (although here the Poké Ball just
@@ -544,8 +522,6 @@ class Battle::Scene::Animation::PokeballTrainerSendOut < Battle::Scene::Animatio
end
end
#===============================================================================
# Shows a Pokémon being recalled into its Poké Ball
#===============================================================================
@@ -594,8 +570,6 @@ class Battle::Scene::Animation::BattlerRecall < Battle::Scene::Animation
end
end
#===============================================================================
# Shows a Pokémon flashing after taking damage
#===============================================================================
@@ -632,8 +606,6 @@ class Battle::Scene::Animation::BattlerDamage < Battle::Scene::Animation
end
end
#===============================================================================
# Shows a Pokémon fainting
#===============================================================================
@@ -682,8 +654,6 @@ class Battle::Scene::Animation::BattlerFaint < Battle::Scene::Animation
end
end
#===============================================================================
# Shows the player's Poké Ball being thrown to capture a Pokémon
#===============================================================================
@@ -836,8 +806,6 @@ class Battle::Scene::Animation::PokeballThrowCapture < Battle::Scene::Animation
end
end
#===============================================================================
# Shows the player throwing a Poké Ball and it being deflected
#===============================================================================
@@ -57,8 +57,7 @@ class Battle::DebugSceneNoLogging
def pbChangePokemon(idxBattler, pkmn); end
def pbFaintBattler(battler); end
def pbEXPBar(battler, startExp, endExp, tempExp1, tempExp2); end
def pbLevelUp(pkmn, battler, oldTotalHP, oldAttack, oldDefense,
oldSpAtk, oldSpDef, oldSpeed); end
def pbLevelUp(pkmn, battler, oldTotalHP, oldAttack, oldDefense, oldSpAtk, oldSpDef, oldSpeed); end
def pbForgetMove(pkmn, moveToLearn); return 0; end # Always forget first move
def pbCommandMenu(idxBattler, firstAction)
@@ -51,8 +51,9 @@ class Battle
end
end
#===============================================================================
#
#===============================================================================
class Battle::Battler
unless @__clauses__aliased
alias __clauses__pbCanSleep? pbCanSleep?
@@ -100,9 +101,10 @@ class Battle::Battler
end
end
class Battle::Move::RaiseUserEvasion1 # Double Team
#===============================================================================
# Double Team
#===============================================================================
class Battle::Move::RaiseUserEvasion1
unless method_defined?(:__clauses__pbMoveFailed?)
alias __clauses__pbMoveFailed? pbMoveFailed?
end
@@ -116,9 +118,10 @@ class Battle::Move::RaiseUserEvasion1 # Double Team
end
end
class Battle::Move::RaiseUserEvasion2MinimizeUser # Minimize
#===============================================================================
# Minimize
#===============================================================================
class Battle::Move::RaiseUserEvasion2MinimizeUser
unless method_defined?(:__clauses__pbMoveFailed?)
alias __clauses__pbMoveFailed? pbMoveFailed?
end
@@ -132,9 +135,10 @@ class Battle::Move::RaiseUserEvasion2MinimizeUser # Minimize
end
end
class Battle::Move::UserTargetSwapAbilities # Skill Swap
#===============================================================================
# Skill Swap
#===============================================================================
class Battle::Move::UserTargetSwapAbilities
unless method_defined?(:__clauses__pbFailsAgainstTarget?)
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
end
@@ -148,9 +152,10 @@ class Battle::Move::UserTargetSwapAbilities # Skill Swap
end
end
class Battle::Move::FixedDamage20 # Sonic Boom
#===============================================================================
# Sonic Boom
#===============================================================================
class Battle::Move::FixedDamage20
unless method_defined?(:__clauses__pbFailsAgainstTarget?)
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
end
@@ -164,9 +169,10 @@ class Battle::Move::FixedDamage20 # Sonic Boom
end
end
class Battle::Move::FixedDamage40 # Dragon Rage
#===============================================================================
# Dragon Rage
#===============================================================================
class Battle::Move::FixedDamage40
unless method_defined?(:__clauses__pbFailsAgainstTarget?)
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
end
@@ -180,8 +186,9 @@ class Battle::Move::FixedDamage40 # Dragon Rage
end
end
#===============================================================================
#
#===============================================================================
class Battle::Move::OHKO
unless method_defined?(:__clauses__pbFailsAgainstTarget?)
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
@@ -196,8 +203,9 @@ class Battle::Move::OHKO
end
end
#===============================================================================
#
#===============================================================================
class Battle::Move::OHKOIce
unless method_defined?(:__clauses__pbFailsAgainstTarget?)
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
@@ -212,8 +220,9 @@ class Battle::Move::OHKOIce
end
end
#===============================================================================
#
#===============================================================================
class Battle::Move::OHKOHitsUndergroundTarget
unless method_defined?(:__clauses__pbFailsAgainstTarget?)
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
@@ -228,9 +237,10 @@ class Battle::Move::OHKOHitsUndergroundTarget
end
end
class Battle::Move::UserFaintsExplosive # Self-Destruct
#===============================================================================
# Self-Destruct
#===============================================================================
class Battle::Move::UserFaintsExplosive
unless method_defined?(:__clauses__pbMoveFailed?)
alias __clauses__pbMoveFailed? pbMoveFailed?
end
@@ -259,9 +269,10 @@ class Battle::Move::UserFaintsExplosive # Self-Destruct
end
end
class Battle::Move::StartPerishCountsForAllBattlers # Perish Song
#===============================================================================
# Perish Song
#===============================================================================
class Battle::Move::StartPerishCountsForAllBattlers
unless method_defined?(:__clauses__pbFailsAgainstTarget?)
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
end
@@ -276,9 +287,10 @@ class Battle::Move::StartPerishCountsForAllBattlers # Perish Song
end
end
class Battle::Move::AttackerFaintsIfUserFaints # Destiny Bond
#===============================================================================
# Destiny Bond
#===============================================================================
class Battle::Move::AttackerFaintsIfUserFaints
unless method_defined?(:__clauses__pbFailsAgainstTarget?)
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
end
@@ -29,8 +29,6 @@ class AnimFrame
FOCUS = 26
end
#===============================================================================
#
#===============================================================================
@@ -166,8 +164,6 @@ def pbConvertRPGAnimation(animation)
return pbAnim
end
#===============================================================================
#
#===============================================================================
@@ -230,8 +226,6 @@ class RPG::Animation
end
end
#===============================================================================
#
#===============================================================================
@@ -333,8 +327,6 @@ class PBAnimTiming
end
end
#===============================================================================
#
#===============================================================================
@@ -397,8 +389,6 @@ class PBAnimations < Array
end
end
#===============================================================================
#
#===============================================================================
@@ -598,8 +588,6 @@ class PBAnimation < Array
end
end
#===============================================================================
#
#===============================================================================
@@ -678,8 +666,6 @@ def pbSpriteSetAnimFrame(sprite, frame, user = nil, target = nil, inEditor = fal
end
end
#===============================================================================
# Animation player
#===============================================================================
@@ -888,10 +888,7 @@ Battle::AbilityEffects::MoveBlocking.add(:DAZZLING,
next false if battle.choices[user.index][4] <= 0
next false if !bearer.opposes?(user)
ret = false
targets.each do |b|
next if !b.opposes?(user)
ret = true
end
targets.each { |b| ret = true if b.opposes?(user) }
next ret
}
)
@@ -54,8 +54,6 @@ class Battle::FakeBattler
def pbReset; end
end
#===============================================================================
# Data box for safari battles
#===============================================================================
@@ -93,8 +91,6 @@ class Battle::Scene::SafariDataBox < Sprite
end
end
#===============================================================================
# Shows the player throwing bait at a wild Pokémon in a Safari battle.
#===============================================================================
@@ -159,8 +155,6 @@ class Battle::Scene::Animation::ThrowBait < Battle::Scene::Animation
end
end
#===============================================================================
# Shows the player throwing a rock at a wild Pokémon in a Safari battle.
#===============================================================================
@@ -222,8 +216,6 @@ class Battle::Scene::Animation::ThrowRock < Battle::Scene::Animation
end
end
#===============================================================================
# Safari Zone battle scene (the visuals of the battle)
#===============================================================================
@@ -280,8 +272,6 @@ class Battle::Scene
end
end
#===============================================================================
# Safari Zone battle class
#===============================================================================
@@ -308,9 +298,9 @@ class SafariBattle
def pbRandom(x); return rand(x); end
#=============================================================================
#-----------------------------------------------------------------------------
# Initialize the battle class
#=============================================================================
#-----------------------------------------------------------------------------
def initialize(scene, player, party2)
@scene = scene
@peer = Battle::Peer.new
@@ -335,9 +325,9 @@ class SafariBattle
def defaultWeather=(value); @weather = value; end
def defaultTerrain=(value); end
#=============================================================================
#-----------------------------------------------------------------------------
# Information about the type and size of the battle
#=============================================================================
#-----------------------------------------------------------------------------
def wildBattle?; return true; end
def trainerBattle?; return false; end
@@ -347,9 +337,9 @@ class SafariBattle
return @sideSizes[index % 2]
end
#=============================================================================
#-----------------------------------------------------------------------------
# Trainers and owner-related
#=============================================================================
#-----------------------------------------------------------------------------
def pbPlayer; return @player[0]; end
def opponent; return nil; end
@@ -374,18 +364,18 @@ class SafariBattle
end
end
#=============================================================================
#-----------------------------------------------------------------------------
# Get party info (counts all teams on the same side)
#=============================================================================
#-----------------------------------------------------------------------------
def pbParty(idxBattler)
return (opposes?(idxBattler)) ? @party2 : nil
end
def pbAllFainted?(idxBattler = 0); return false; end
#=============================================================================
#-----------------------------------------------------------------------------
# Battler-related
#=============================================================================
#-----------------------------------------------------------------------------
def opposes?(idxBattler1, idxBattler2 = 0)
idxBattler1 = idxBattler1.index if idxBattler1.respond_to?("index")
idxBattler2 = idxBattler2.index if idxBattler2.respond_to?("index")
@@ -395,9 +385,9 @@ class SafariBattle
def pbRemoveFromParty(idxBattler, idxParty); end
def pbGainExp; end
#=============================================================================
#-----------------------------------------------------------------------------
# Messages and animations
#=============================================================================
#-----------------------------------------------------------------------------
def pbDisplay(msg, &block)
@scene.pbDisplayMessage(msg, &block)
end
@@ -414,17 +404,15 @@ class SafariBattle
return @scene.pbDisplayConfirmMessage(msg)
end
class BattleAbortedException < Exception; end
def pbAbort
raise BattleAbortedException.new("Battle aborted")
end
#=============================================================================
#-----------------------------------------------------------------------------
# Safari battle-specific methods
#=============================================================================
#-----------------------------------------------------------------------------
def pbEscapeRate(catch_rate)
return 125 if catch_rate <= 45 # Escape factor 9 (45%)
return 100 if catch_rate <= 60 # Escape factor 7 (35%)
@@ -26,8 +26,6 @@ class Battle::Scene
end
end
#===============================================================================
# Bug Catching Contest battle class
#===============================================================================
@@ -164,8 +164,6 @@ class BattlePalaceBattle < Battle
end
end
#===============================================================================
#
#===============================================================================
@@ -35,8 +35,6 @@ class Battle::SuccessState
end
end
#===============================================================================
#
#===============================================================================
@@ -203,8 +201,6 @@ class BattleArenaBattle < Battle
end
end
#===============================================================================
#
#===============================================================================
@@ -221,8 +217,6 @@ class Battle::AI
end
end
#===============================================================================
#
#===============================================================================
@@ -38,8 +38,6 @@ class LocationWindow
end
end
#===============================================================================
# Visibility circle in dark maps
#===============================================================================
@@ -85,8 +83,6 @@ class DarknessSprite < Sprite
end
end
#===============================================================================
# Light effects
#===============================================================================
@@ -120,8 +116,9 @@ class LightEffect
end
end
#===============================================================================
#
#===============================================================================
class LightEffect_Lamp < LightEffect
def initialize(event, viewport = nil, map = nil)
lamp = AnimatedBitmap.new("Graphics/Pictures/LE")
@@ -138,8 +135,9 @@ class LightEffect_Lamp < LightEffect
end
end
#===============================================================================
#
#===============================================================================
class LightEffect_Basic < LightEffect
def initialize(event, viewport = nil, map = nil, filename = nil)
super
@@ -164,8 +162,9 @@ class LightEffect_Basic < LightEffect
end
end
#===============================================================================
#
#===============================================================================
class LightEffect_DayNight < LightEffect
def initialize(event, viewport = nil, map = nil, filename = nil)
super
@@ -203,8 +202,9 @@ class LightEffect_DayNight < LightEffect
end
end
#===============================================================================
#
#===============================================================================
EventHandlers.add(:on_new_spriteset_map, :add_light_effects,
proc { |spriteset, viewport|
map = spriteset.map # Map associated with the spriteset (not necessarily the current map)
@@ -76,8 +76,6 @@ def pbCaveExit
pbCaveEntranceEx(true)
end
#===============================================================================
# Blacking out animation
#===============================================================================
@@ -25,16 +25,12 @@ def pbPokerus?
return false
end
class Game_Temp
attr_accessor :warned_low_battery
attr_accessor :cue_bgm
attr_accessor :cue_bgm_frame_delay
end
def pbBatteryLow?
pstate = System.power_state
# If it's not discharging, it doesn't matter if it's low
@@ -220,8 +216,6 @@ def pbBattleOnStepTaken(repel_active)
$game_temp.force_single_battle = false
end
#===============================================================================
# Checks when moving between maps
#===============================================================================
@@ -331,8 +325,6 @@ EventHandlers.add(:on_map_or_spriteset_change, :show_location_window,
}
)
#===============================================================================
# Event locations, terrain tags
#===============================================================================
@@ -416,8 +408,6 @@ def pbFacingEachOther(event1, event2)
return pbEventFacesPlayer?(event1, event2, 1) && pbEventFacesPlayer?(event2, event1, 1)
end
#===============================================================================
# Audio playing
#===============================================================================
@@ -454,8 +444,6 @@ def pbAutoplayOnSave
end
end
#===============================================================================
# Event movement
#===============================================================================
@@ -508,8 +496,6 @@ module PBMoveRoute
ScriptAsync = 101 # 1 param
end
def pbMoveRoute(event, commands, waitComplete = false)
route = RPG::MoveRoute.new
route.repeat = false
@@ -555,8 +541,6 @@ def pbWait(numFrames)
end
end
#===============================================================================
# Player/event movement in the field
#===============================================================================
@@ -644,8 +628,6 @@ def pbJumpToward(dist = 1, playSound = false, cancelSurf = false)
return false
end
#===============================================================================
# Bridges, cave escape points, and setting the heal point
#===============================================================================
@@ -689,8 +671,6 @@ def pbSetPokemonCenter
$PokemonGlobal.pokecenterDirection = $game_player.direction
end
#===============================================================================
# Partner trainer
#===============================================================================
@@ -710,8 +690,6 @@ def pbDeregisterPartner
$PokemonGlobal.partner = nil
end
#===============================================================================
# Picking up an item found on the ground
#===============================================================================
@@ -752,8 +730,6 @@ def pbItemBall(item, quantity = 1)
return false
end
#===============================================================================
# Being given an item
#===============================================================================
@@ -8,8 +8,9 @@ class PokemonGlobalMetadata
attr_accessor :nextBattleBack
end
#===============================================================================
#
#===============================================================================
class Game_Temp
attr_accessor :encounter_triggered
attr_accessor :encounter_type
@@ -61,8 +62,9 @@ class Game_Temp
end
end
#===============================================================================
#
#===============================================================================
def setBattleRule(*args)
r = nil
args.each do |arg|
@@ -26,7 +26,7 @@ class PokemonEncounters
@chance_accumulator = 0
end
#=============================================================================
#-----------------------------------------------------------------------------
# Returns whether encounters for the given encounter type have been defined
# for the current map.
@@ -84,7 +84,7 @@ class PokemonEncounters
return false
end
#=============================================================================
#-----------------------------------------------------------------------------
# Returns whether the player's current location allows wild encounters to
# trigger upon taking a step.
@@ -262,7 +262,7 @@ class PokemonEncounters
return ret
end
#=============================================================================
#-----------------------------------------------------------------------------
# For the current map, randomly chooses a species and level from the encounter
# list for the given encounter type. Returns nil if there are none defined.
@@ -375,8 +375,6 @@ class PokemonEncounters
end
end
#===============================================================================
#
#===============================================================================
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
class PokemonGlobalMetadata
attr_accessor :roamPosition
attr_accessor :roamedAlready # Whether a roamer has been encountered on current map
@@ -11,8 +14,6 @@ class PokemonGlobalMetadata
end
end
#===============================================================================
# Making roaming Pokémon roam around.
#===============================================================================
@@ -101,8 +102,6 @@ EventHandlers.add(:on_enter_map, :move_roaming_pokemon,
}
)
#===============================================================================
# Encountering a roaming Pokémon in a wild battle.
#===============================================================================
@@ -110,8 +109,9 @@ class Game_Temp
attr_accessor :roamer_index_for_encounter # Index of roaming Pokémon to encounter next
end
#===============================================================================
#
#===============================================================================
# Returns whether the given category of encounter contains the actual encounter
# method that will occur in the player's current position.
def pbRoamingMethodAllowed(roamer_method)
@@ -115,8 +115,6 @@ class PokemonGlobalMetadata
end
end
#===============================================================================
# This class keeps track of erased and moved events so their position
# can remain after a game is saved and loaded. This class also includes
@@ -5,8 +5,9 @@ def pbGetTimeNow
return Time.now
end
#===============================================================================
#
#===============================================================================
module PBDayNight
HOURLY_TONES = [
Tone.new(-70, -90, 15, 55), # Night # Midnight
@@ -109,8 +110,9 @@ module PBDayNight
end
end
#===============================================================================
#
#===============================================================================
def pbDayNightTint(object)
return if !$scene.is_a?(Scene_Map)
if Settings::TIME_SHADING && $game_map.metadata&.outdoor_map
@@ -121,85 +123,6 @@ def pbDayNightTint(object)
end
end
#===============================================================================
# Moon phases and Zodiac
#===============================================================================
# Calculates the phase of the moon.
# 0 - New Moon
# 1 - Waxing Crescent
# 2 - First Quarter
# 3 - Waxing Gibbous
# 4 - Full Moon
# 5 - Waning Gibbous
# 6 - Last Quarter
# 7 - Waning Crescent
def moonphase(time = nil) # in UTC
time = pbGetTimeNow if !time
transitions = [
1.8456618033125,
5.5369854099375,
9.2283090165625,
12.9196326231875,
16.6109562298125,
20.3022798364375,
23.9936034430625,
27.6849270496875
]
yy = time.year - ((12 - time.mon) / 10.0).floor
j = (365.25 * (4712 + yy)).floor + ((((time.mon + 9) % 12) * 30.6) + 0.5).floor + time.day + 59
j -= (((yy / 100.0) + 49).floor * 0.75).floor - 38 if j > 2_299_160
j += (((time.hour * 60) + (time.min * 60)) + time.sec) / 86_400.0
v = (j - 2_451_550.1) / 29.530588853
v = ((v - v.floor) + (v < 0 ? 1 : 0))
ag = v * 29.53
transitions.length.times do |i|
return i if ag <= transitions[i]
end
return 0
end
# Calculates the zodiac sign based on the given month and day:
# 0 is Aries, 11 is Pisces. Month is 1 if January, and so on.
def zodiac(month, day)
time = [
3, 21, 4, 19, # Aries
4, 20, 5, 20, # Taurus
5, 21, 6, 20, # Gemini
6, 21, 7, 20, # Cancer
7, 23, 8, 22, # Leo
8, 23, 9, 22, # Virgo
9, 23, 10, 22, # Libra
10, 23, 11, 21, # Scorpio
11, 22, 12, 21, # Sagittarius
12, 22, 1, 19, # Capricorn
1, 20, 2, 18, # Aquarius
2, 19, 3, 20 # Pisces
]
(time.length / 4).times do |i|
return i if month == time[i * 4] && day >= time[(i * 4) + 1]
return i if month == time[(i * 4) + 2] && day <= time[(i * 4) + 3]
end
return 0
end
# Returns the opposite of the given zodiac sign.
# 0 is Aries, 11 is Pisces.
def zodiacOpposite(sign)
return (sign + 6) % 12
end
# 0 is Aries, 11 is Pisces.
def zodiacPartners(sign)
return [(sign + 4) % 12, (sign + 8) % 12]
end
# 0 is Aries, 11 is Pisces.
def zodiacComplements(sign)
return [(sign + 1) % 12, (sign + 11) % 12]
end
#===============================================================================
# Days of the week
#===============================================================================
@@ -307,3 +230,80 @@ def pbGetSeasonName(season)
_INTL("Autumn"),
_INTL("Winter")][season]
end
#===============================================================================
# Moon phases and Zodiac
#===============================================================================
# Calculates the phase of the moon.
# 0 - New Moon
# 1 - Waxing Crescent
# 2 - First Quarter
# 3 - Waxing Gibbous
# 4 - Full Moon
# 5 - Waning Gibbous
# 6 - Last Quarter
# 7 - Waning Crescent
def moonphase(time = nil) # in UTC
time = pbGetTimeNow if !time
transitions = [
1.8456618033125,
5.5369854099375,
9.2283090165625,
12.9196326231875,
16.6109562298125,
20.3022798364375,
23.9936034430625,
27.6849270496875
]
yy = time.year - ((12 - time.mon) / 10.0).floor
j = (365.25 * (4712 + yy)).floor + ((((time.mon + 9) % 12) * 30.6) + 0.5).floor + time.day + 59
j -= (((yy / 100.0) + 49).floor * 0.75).floor - 38 if j > 2_299_160
j += (((time.hour * 60) + (time.min * 60)) + time.sec) / 86_400.0
v = (j - 2_451_550.1) / 29.530588853
v = ((v - v.floor) + (v < 0 ? 1 : 0))
ag = v * 29.53
transitions.length.times do |i|
return i if ag <= transitions[i]
end
return 0
end
# Calculates the zodiac sign based on the given month and day:
# 0 is Aries, 11 is Pisces. Month is 1 if January, and so on.
def zodiac(month, day)
time = [
3, 21, 4, 19, # Aries
4, 20, 5, 20, # Taurus
5, 21, 6, 20, # Gemini
6, 21, 7, 20, # Cancer
7, 23, 8, 22, # Leo
8, 23, 9, 22, # Virgo
9, 23, 10, 22, # Libra
10, 23, 11, 21, # Scorpio
11, 22, 12, 21, # Sagittarius
12, 22, 1, 19, # Capricorn
1, 20, 2, 18, # Aquarius
2, 19, 3, 20 # Pisces
]
(time.length / 4).times do |i|
return i if month == time[i * 4] && day >= time[(i * 4) + 1]
return i if month == time[(i * 4) + 2] && day <= time[(i * 4) + 3]
end
return 0
end
# Returns the opposite of the given zodiac sign.
# 0 is Aries, 11 is Pisces.
def zodiacOpposite(sign)
return (sign + 6) % 12
end
# 0 is Aries, 11 is Pisces.
def zodiacPartners(sign)
return [(sign + 4) % 12, (sign + 8) % 12]
end
# 0 is Aries, 11 is Pisces.
def zodiacComplements(sign)
return [(sign + 1) % 12, (sign + 11) % 12]
end
@@ -33,8 +33,9 @@ module HiddenMoveHandlers
end
end
#===============================================================================
#
#===============================================================================
def pbCanUseHiddenMove?(pkmn, move, showmsg = true)
return HiddenMoveHandlers.triggerCanUseMove(move, pkmn, showmsg)
end
@@ -62,8 +63,6 @@ def pbCheckHiddenMoveBadge(badge = -1, showmsg = true)
return false
end
#===============================================================================
# Hidden move animation
#===============================================================================
@@ -184,8 +183,6 @@ def pbHiddenMoveAnimation(pokemon)
return true
end
#===============================================================================
# Cut
#===============================================================================
@@ -247,8 +244,6 @@ def pbSmashEvent(event)
$PokemonMap&.addErasedEvent(event.id)
end
#===============================================================================
# Dig
#===============================================================================
@@ -294,8 +289,6 @@ HiddenMoveHandlers::UseMove.add(:DIG, proc { |move, pokemon|
next false
})
#===============================================================================
# Dive
#===============================================================================
@@ -460,8 +453,6 @@ HiddenMoveHandlers::UseMove.add(:DIVE, proc { |move, pokemon|
next true
})
#===============================================================================
# Flash
#===============================================================================
@@ -497,8 +488,6 @@ HiddenMoveHandlers::UseMove.add(:FLASH, proc { |move, pokemon|
next true
})
#===============================================================================
# Fly
#===============================================================================
@@ -560,8 +549,6 @@ HiddenMoveHandlers::UseMove.add(:FLY, proc { |move, pkmn|
next true
})
#===============================================================================
# Headbutt
#===============================================================================
@@ -626,8 +613,6 @@ HiddenMoveHandlers::UseMove.add(:HEADBUTT, proc { |move, pokemon|
pbHeadbuttEffect(facingEvent)
})
#===============================================================================
# Rock Smash
#===============================================================================
@@ -678,8 +663,6 @@ HiddenMoveHandlers::UseMove.add(:ROCKSMASH, proc { |move, pokemon|
next true
})
#===============================================================================
# Strength
#===============================================================================
@@ -731,8 +714,6 @@ HiddenMoveHandlers::UseMove.add(:STRENGTH, proc { |move, pokemon|
next true
})
#===============================================================================
# Surf
#===============================================================================
@@ -845,8 +826,6 @@ HiddenMoveHandlers::UseMove.add(:SURF, proc { |move, pokemon|
next true
})
#===============================================================================
# Sweet Scent
#===============================================================================
@@ -896,8 +875,6 @@ HiddenMoveHandlers::UseMove.add(:SWEETSCENT, proc { |move, pokemon|
next true
})
#===============================================================================
# Teleport
#===============================================================================
@@ -951,8 +928,6 @@ HiddenMoveHandlers::UseMove.add(:TELEPORT, proc { |move, pokemon|
next true
})
#===============================================================================
# Waterfall
#===============================================================================
@@ -257,7 +257,7 @@ module RandomDungeon
:upper_wall_in_1 => Console.markup_style("~", bg: :gray),
:upper_wall_in_3 => Console.markup_style("~", bg: :gray),
:upper_wall_in_7 => Console.markup_style("~", bg: :gray),
:upper_wall_in_9 => Console.markup_style("~", bg: :gray),
:upper_wall_in_9 => Console.markup_style("~", bg: :gray)
}
def initialize(width, height)
+3 -4
View File
@@ -113,8 +113,9 @@ module ItemHandlers
end
end
#===============================================================================
#
#===============================================================================
def pbCanRegisterItem?(item)
return ItemHandlers.hasUseInFieldHandler(item)
end
@@ -123,8 +124,6 @@ def pbCanUseOnPokemon?(item)
return ItemHandlers.hasUseOnPokemon(item) || GameData::Item.get(item).is_machine?
end
#===============================================================================
# Change a Pokémon's level
#===============================================================================
+12 -10
View File
@@ -1,18 +1,20 @@
#===============================================================================
#
#===============================================================================
class PokemonGlobalMetadata
attr_accessor :pokeradarBattery
end
#===============================================================================
#
#===============================================================================
class Game_Temp
attr_accessor :poke_radar_data # [species, level, chain count, grasses (x,y,ring,rarity)]
end
################################################################################
#===============================================================================
# Using the Poke Radar
################################################################################
#===============================================================================
def pbCanUsePokeRadar?
# Can't use Radar if not in tall grass
terrain = $game_map.terrain_tag($game_player.x, $game_player.y)
@@ -146,9 +148,9 @@ def pbPokeRadarGetEncounter(rarity = 0)
return $PokemonEncounters.choose_wild_pokemon($PokemonEncounters.encounter_type, rarity + 1)
end
################################################################################
#===============================================================================
# Event handlers
################################################################################
#===============================================================================
EventHandlers.add(:on_wild_species_chosen, :poke_radar_chain,
proc { |encounter|
if GameData::EncounterType.get($game_temp.encounter_type).type != :land ||
@@ -246,9 +248,9 @@ EventHandlers.add(:on_enter_map, :cancel_poke_radar,
}
)
################################################################################
#===============================================================================
# Item handlers
################################################################################
#===============================================================================
ItemHandlers::UseInField.add(:POKERADAR, proc { |item|
next pbUsePokeRadar
})
+5 -2
View File
@@ -1,4 +1,6 @@
#===============================================================================
# Data structure representing mail that the Pokémon can hold
#===============================================================================
class Mail
attr_accessor :item, :message, :sender, :poke1, :poke2, :poke3
@@ -12,8 +14,9 @@ class Mail
end
end
#===============================================================================
#
#===============================================================================
def pbMoveToMailbox(pokemon)
$PokemonGlobal.mailbox = [] if !$PokemonGlobal.mailbox
return false if $PokemonGlobal.mailbox.length >= 10
@@ -110,8 +110,6 @@ class ItemIconSprite < Sprite
end
end
#===============================================================================
# Item held icon (used in the party screen)
#===============================================================================
+4 -10
View File
@@ -39,7 +39,7 @@ class PokemonBag
return @pockets
end
#=============================================================================
#-----------------------------------------------------------------------------
# Gets the index of the current selected item in the pocket
def last_viewed_index(pocket)
@@ -59,7 +59,7 @@ class PokemonBag
@last_pocket_selections[pocket] = value if value <= @pockets[pocket].length
end
#=============================================================================
#-----------------------------------------------------------------------------
def quantity(item)
item_data = GameData::Item.try_get(item)
@@ -139,7 +139,7 @@ class PokemonBag
return ret
end
#=============================================================================
#-----------------------------------------------------------------------------
# Returns whether item has been registered for quick access in the Ready Menu.
def registered?(item)
@@ -161,7 +161,7 @@ class PokemonBag
@registered_items.delete(item_data.id) if item_data
end
#=============================================================================
#-----------------------------------------------------------------------------
private
@@ -193,8 +193,6 @@ class PokemonBag
end
end
#===============================================================================
# The PC item storage object, which actually contains all the items
#===============================================================================
@@ -260,8 +258,6 @@ class PCItemStorage
end
end
#===============================================================================
# Implements methods that act on arrays of items. Each element in an item
# array is itself an array of [itemID, itemCount].
@@ -333,8 +329,6 @@ module ItemStorageHelper
end
end
#===============================================================================
# Deprecated methods
#===============================================================================
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module MultipleForms
@@formSpecies = SpeciesHandlerHash.new
@@ -32,8 +35,9 @@ module MultipleForms
end
end
#===============================================================================
#
#===============================================================================
def drawSpot(bitmap, spotpattern, x, y, red, green, blue)
height = spotpattern.length
width = spotpattern[0].length
@@ -723,7 +727,6 @@ MultipleForms.register(:CALYREX, {
}
})
#===============================================================================
# Regional forms
# This code is for determining the form of a Pokémon in an egg created at the
@@ -59,8 +59,6 @@ def pbPurify(pkmn, scene)
end
end
#===============================================================================
# Relic Stone scene.
#===============================================================================
@@ -105,8 +103,9 @@ class RelicStoneScene
end
end
#===============================================================================
#
#===============================================================================
class RelicStoneScreen
def initialize(scene)
@scene = scene
@@ -132,8 +131,9 @@ class RelicStoneScreen
end
end
#===============================================================================
#
#===============================================================================
def pbRelicStoneScreen(pkmn)
retval = true
pbFadeOutIn {
@@ -144,8 +144,6 @@ def pbRelicStoneScreen(pkmn)
return retval
end
#===============================================================================
#
#===============================================================================
@@ -164,8 +162,6 @@ def pbRelicStone
end
end
#===============================================================================
# Shadow Pokémon in battle.
#===============================================================================
@@ -184,8 +180,9 @@ class Battle
end
end
#===============================================================================
#
#===============================================================================
class Battle::Battler
alias __shadow__pbInitPokemon pbInitPokemon unless method_defined?(:__shadow__pbInitPokemon)
@@ -228,8 +225,6 @@ class Battle::Battler
end
end
#===============================================================================
# Shadow item effects.
#===============================================================================
@@ -333,8 +328,6 @@ ItemHandlers::BattleUseOnPokemon.add(:VIVIDSCENT, proc { |item, pokemon, battler
next true
})
#===============================================================================
# Two turn attack. On first turn, halves the HP of all active Pokémon.
# Skips second turn (if successful). (Shadow Half)
@@ -359,8 +352,6 @@ class Battle::Move::AllBattlersLoseHalfHPUserSkipsNextTurn < Battle::Move
end
end
#===============================================================================
# User takes recoil damage equal to 1/2 of its current HP. (Shadow End)
#===============================================================================
@@ -380,8 +371,6 @@ class Battle::Move::UserLosesHalfHP < Battle::Move::RecoilMove
end
end
#===============================================================================
# Starts shadow weather. (Shadow Sky)
#===============================================================================
@@ -392,8 +381,6 @@ class Battle::Move::StartShadowSkyWeather < Battle::Move::WeatherMove
end
end
#===============================================================================
# Ends the effects of Light Screen, Reflect and Safeguard on both sides.
# (Shadow Shed)
@@ -410,8 +397,6 @@ class Battle::Move::RemoveAllScreens < Battle::Move
end
end
#===============================================================================
#
#===============================================================================
@@ -419,8 +404,9 @@ class Game_Temp
attr_accessor :party_heart_gauges_before_battle
end
#===============================================================================
#
#===============================================================================
# Record current heart gauges of Pokémon in party, to see if they drop to zero
# during battle and need to say they're ready to be purified afterwards
EventHandlers.add(:on_start_battle, :record_party_heart_gauges,
@@ -77,8 +77,6 @@ class PokemonSprite < Sprite
end
end
#===============================================================================
# Pokémon icon (for defined Pokémon)
#===============================================================================
@@ -212,8 +210,6 @@ class PokemonIconSprite < Sprite
end
end
#===============================================================================
# Pokémon icon (for species)
#===============================================================================
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
class PokemonBox
attr_reader :pokemon
attr_accessor :name
@@ -49,8 +52,9 @@ class PokemonBox
end
end
#===============================================================================
#
#===============================================================================
class PokemonStorage
attr_reader :boxes
attr_accessor :currentBox
@@ -259,8 +263,6 @@ class PokemonStorage
end
end
#===============================================================================
# Regional Storage scripts
#===============================================================================
@@ -369,8 +371,6 @@ class RegionalStorage
end
end
#===============================================================================
#
#===============================================================================
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
class IntroEventScene < EventScene
# Splash screen images that appear for a few seconds and then disappear.
SPLASH_IMAGES = ["splash1", "splash2"]
@@ -114,8 +117,9 @@ class IntroEventScene < EventScene
end
end
#===============================================================================
#
#===============================================================================
class Scene_Intro
def main
Graphics.transition(0)
+3 -2
View File
@@ -254,8 +254,9 @@ MenuHandlers.add(:pause_menu, :trainer_card, {
MenuHandlers.add(:pause_menu, :save, {
"name" => _INTL("Save"),
"order" => 60,
"condition" => proc { next $game_system && !$game_system.save_disabled &&
!pbInSafari? && !pbInBugContest? },
"condition" => proc {
next $game_system && !$game_system.save_disabled && !pbInSafari? && !pbInBugContest?
},
"effect" => proc { |menu|
menu.pbHideMenu
scene = PokemonSave_Scene.new
@@ -165,7 +165,7 @@ class BattlePointShop_Scene
@sprites["background"] = IconSprite.new(0, 0, @viewport)
@sprites["background"].setBitmap("Graphics/Pictures/martScreen")
@sprites["icon"] = ItemIconSprite.new(36, Graphics.height - 50, nil, @viewport)
winAdapter = BattlePointShopAdapter.new()
winAdapter = BattlePointShopAdapter.new
@sprites["itemwindow"] = Window_BattlePointShop.new(
stock, winAdapter, Graphics.width - 316 - 16, 10, 330 + 16, Graphics.height - 124
)
-10
View File
@@ -64,8 +64,6 @@ class Window_CharacterEntry < Window_DrawableCommand
end
end
#===============================================================================
# Text entry screen - free typing.
#===============================================================================
@@ -256,8 +254,6 @@ class PokemonEntryScene
end
end
#===============================================================================
# Text entry screen - arrows to select letter.
#===============================================================================
@@ -372,8 +368,6 @@ class PokemonEntryScene2
end
end
def pbStartScene(helptext, minlength, maxlength, initialText, subject = 0, pokemon = nil)
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
@viewport.z = 99999
@@ -751,8 +745,6 @@ class PokemonEntryScene2
end
end
#===============================================================================
#
#===============================================================================
@@ -769,8 +761,6 @@ class PokemonEntry
end
end
#===============================================================================
#
#===============================================================================
@@ -133,8 +133,6 @@ class TriadCard
end
end
#===============================================================================
# Duel screen visuals
#===============================================================================
@@ -160,9 +158,9 @@ class TriadSquare
end
end
#===============================================================================
# Scene class for handling appearance of the screen
#===============================================================================
class TriadScene
def pbStartScene(battle)
@sprites = {}
@@ -589,8 +587,6 @@ class TriadScene
end
end
#===============================================================================
# Duel screen logic
#===============================================================================
@@ -965,8 +961,6 @@ class TriadScreen
end
end
#===============================================================================
# Start duel
#===============================================================================
@@ -985,8 +979,6 @@ def pbTriadDuel(name, minLevel, maxLevel, rules = nil, oppdeck = nil, prize = ni
return ret
end
#===============================================================================
# Card storage
#===============================================================================
@@ -1001,8 +993,9 @@ class PokemonGlobalMetadata
end
end
#===============================================================================
#
#===============================================================================
class TriadStorage
attr_reader :items
@@ -1066,8 +1059,6 @@ class TriadStorage
end
end
#===============================================================================
# Card shop screen
#===============================================================================
@@ -1,10 +1,10 @@
################################################################################
#===============================================================================
# "Slot Machine" mini-game
# By Maruno
#-------------------------------------------------------------------------------
# Run with: pbSlotMachine(1)
# - The number is either 0 (easy), 1 (default) or 2 (hard).
################################################################################
#===============================================================================
class SlotMachineReel < BitmapSprite
attr_accessor :reel
attr_accessor :toppos
@@ -79,8 +79,9 @@ class SlotMachineReel < BitmapSprite
end
end
#===============================================================================
#
#===============================================================================
class SlotMachineScore < BitmapSprite
attr_reader :score
@@ -107,8 +108,9 @@ class SlotMachineScore < BitmapSprite
end
end
#===============================================================================
#
#===============================================================================
class SlotMachineScene
attr_accessor :gameRunning
attr_accessor :gameEnd
@@ -376,8 +378,9 @@ class SlotMachineScene
end
end
#===============================================================================
#
#===============================================================================
class SlotMachine
def initialize(scene)
@scene = scene
@@ -390,8 +393,9 @@ class SlotMachine
end
end
#===============================================================================
#
#===============================================================================
def pbSlotMachine(difficulty = 1)
if !$bag.has?(:COINCASE)
pbMessage(_INTL("It's a Slot Machine."))
@@ -580,8 +580,9 @@ class VoltorbFlip
end
end
#===============================================================================
#
#===============================================================================
class VoltorbFlipScreen
def initialize(scene)
@scene = scene
@@ -594,8 +595,9 @@ class VoltorbFlipScreen
end
end
#===============================================================================
#
#===============================================================================
def pbVoltorbFlip
if !$bag.has?(:COINCASE)
pbMessage(_INTL("You can't play unless you have a Coin Case."))
@@ -1,9 +1,9 @@
################################################################################
#===============================================================================
# "Mining" mini-game
# By Maruno
#-------------------------------------------------------------------------------
# Run with: pbMiningGame
################################################################################
#===============================================================================
class MiningGameCounter < BitmapSprite
attr_accessor :hits
@@ -32,8 +32,9 @@ class MiningGameCounter < BitmapSprite
end
end
#===============================================================================
#
#===============================================================================
class MiningGameTile < BitmapSprite
attr_reader :layer
@@ -70,8 +71,9 @@ class MiningGameTile < BitmapSprite
end
end
#===============================================================================
#
#===============================================================================
class MiningGameCursor < BitmapSprite
attr_accessor :mode
attr_accessor :position
@@ -138,8 +140,9 @@ class MiningGameCursor < BitmapSprite
end
end
#===============================================================================
#
#===============================================================================
class MiningGameScene
BOARD_WIDTH = 13
BOARD_HEIGHT = 10
@@ -606,8 +609,9 @@ class MiningGameScene
end
end
#===============================================================================
#
#===============================================================================
class MiningGame
def initialize(scene)
@scene = scene
@@ -620,8 +624,9 @@ class MiningGame
end
end
#===============================================================================
#
#===============================================================================
def pbMiningGame
pbFadeOutIn {
scene = MiningGameScene.new
@@ -1,4 +1,4 @@
################################################################################
#===============================================================================
# "Tile Puzzle" mini-games
# By Maruno
# Graphics by the__end
@@ -14,7 +14,7 @@
# board = The name/number of the graphics to be used.
# width,height = Optional, the number of tiles wide/high the puzzle is (0 for
# the default value of 4).
################################################################################
#===============================================================================
class TilePuzzleCursor < BitmapSprite
attr_accessor :game
attr_accessor :position
@@ -83,8 +83,9 @@ class TilePuzzleCursor < BitmapSprite
end
end
#===============================================================================
#
#===============================================================================
class TilePuzzleScene
def initialize(game, board, width, height)
@game = game
@@ -563,8 +564,9 @@ class TilePuzzleScene
end
end
#===============================================================================
#
#===============================================================================
class TilePuzzle
def initialize(scene)
@scene = scene
@@ -578,8 +580,9 @@ class TilePuzzle
end
end
#===============================================================================
#
#===============================================================================
def pbTilePuzzle(game, board, width = 0, height = 0)
ret = false
pbFadeOutIn {
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
class BattleSwapScene
def pbStartRentScene(rentals)
@rentals = rentals
@@ -150,8 +153,9 @@ class BattleSwapScene
end
end
#===============================================================================
#
#===============================================================================
class BattleSwapScreen
def initialize(scene)
@scene = scene
@@ -339,8 +339,6 @@ def pbEncounterTypeEditor(enc_data, enc_type)
Input.update
end
#===============================================================================
# Trainer type editor
#===============================================================================
@@ -444,8 +442,6 @@ def pbTrainerTypeEditorNew(default_name)
return id.to_sym
end
#===============================================================================
# Individual trainer editor
#===============================================================================
@@ -476,8 +472,9 @@ module TrainerBattleProperty
end
end
#===============================================================================
#
#===============================================================================
def pbTrainerBattleEditor
modified = false
pbListScreenBlock(_INTL("Trainer Battles"), TrainerBattleLister.new(0, true)) { |button, trainer_id|
@@ -601,8 +598,6 @@ def pbTrainerBattleEditor
end
end
#===============================================================================
# Trainer Pokémon editor
#===============================================================================
@@ -691,8 +686,6 @@ module TrainerPokemonProperty
end
end
#===============================================================================
# Metadata editor
#===============================================================================
@@ -780,8 +773,6 @@ def pbEditPlayerMetadata(player_id = 1)
end
end
#===============================================================================
# Map metadata editor
#===============================================================================
@@ -825,8 +816,6 @@ def pbEditMapMetadata(map_id)
end
end
#===============================================================================
# Item editor
#===============================================================================
@@ -931,8 +920,6 @@ def pbItemEditorNew(default_name)
pbMessage(_INTL("Put the item's graphic ({1}.png) in Graphics/Items, or it will be blank.", id.to_s))
end
#===============================================================================
# Pokémon species editor
#===============================================================================
@@ -999,8 +986,6 @@ def pbPokemonEditor
}
end
#===============================================================================
# Regional Dexes editor
#===============================================================================
@@ -1261,8 +1246,6 @@ def pbEvoFamiliesToStrings
return ret
end
#===============================================================================
# Battle animations rearranger
#===============================================================================
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
def pbGetLegalMoves(species)
species_data = GameData::Species.get(species)
moves = []
@@ -125,7 +128,6 @@ def pbChooseFromGameDataList(game_data, default = nil)
return pbChooseList(commands, default, nil, -1)
end
# Displays a list of all Pokémon species, and returns the ID of the species
# selected (or nil if the selection was canceled). "default", if specified, is
# the ID of the species to initially select. Pressing Input::ACTION will toggle
@@ -239,8 +241,6 @@ def pbChooseBallList(defaultMoveID = nil)
return (ret >= 0) ? commands[ret][0] : defaultMoveID
end
#===============================================================================
# General list methods
#===============================================================================
@@ -1,6 +1,6 @@
################################################################################
#===============================================================================
# Controls
################################################################################
#===============================================================================
class Window_Menu < Window_CommandPokemon
def initialize(commands, x, y)
tempbitmap = Bitmap.new(32, 32)
@@ -40,11 +40,9 @@ class Window_Menu < Window_CommandPokemon
end
end
################################################################################
#===============================================================================
# Clipboard
################################################################################
#===============================================================================
module Clipboard
@data = nil
@typekey = ""
@@ -64,11 +62,9 @@ module Clipboard
end
end
################################################################################
#===============================================================================
# Collision testing
################################################################################
#===============================================================================
class Rect < Object
def contains(x, y)
return x >= self.x && x < self.x + self.width &&
@@ -76,8 +72,9 @@ class Rect < Object
end
end
#===============================================================================
#
#===============================================================================
def pbSpriteHitTest(sprite, x, y, usealpha = true, wholecanvas = false)
return false if !sprite || sprite.disposed?
return false if !sprite.bitmap
@@ -158,11 +155,9 @@ def pbTrackPopupMenu(commands)
return -1
end
################################################################################
#===============================================================================
# Sprite sheet scrolling bar
################################################################################
#===============================================================================
class AnimationWindow < Sprite
attr_reader :animbitmap
attr_reader :start
@@ -298,8 +293,9 @@ class AnimationWindow < Sprite
end
end
#===============================================================================
#
#===============================================================================
class CanvasAnimationWindow < AnimationWindow
def animbitmap
return @canvas.animbitmap
@@ -311,11 +307,9 @@ class CanvasAnimationWindow < AnimationWindow
end
end
################################################################################
#===============================================================================
# Cel sprite
################################################################################
#===============================================================================
class InvalidatableSprite < Sprite
def initialize(viewport = nil)
super(viewport)
@@ -351,8 +345,9 @@ class InvalidatableSprite < Sprite
end
end
#===============================================================================
#
#===============================================================================
class SpriteFrame < InvalidatableSprite
attr_reader :id
attr_reader :locked
@@ -419,11 +414,9 @@ class SpriteFrame < InvalidatableSprite
end
end
################################################################################
#===============================================================================
# Canvas
################################################################################
#===============================================================================
class AnimationCanvas < Sprite
attr_reader :viewport
attr_reader :sprites
@@ -947,11 +940,9 @@ class AnimationCanvas < Sprite
end
end
################################################################################
#===============================================================================
# Window classes
################################################################################
#===============================================================================
class BitmapDisplayWindow < SpriteWindow_Base
attr_reader :bitmapname
attr_reader :hue
@@ -1001,8 +992,9 @@ class BitmapDisplayWindow < SpriteWindow_Base
end
end
#===============================================================================
#
#===============================================================================
class AnimationNameWindow
def initialize(canvas, x, y, width, height, viewport = nil)
@canvas = canvas
@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module ShadowText
def shadowtext(bitmap, x, y, w, h, t, disabled = false, align = 0)
width = bitmap.text_size(t).width
@@ -13,8 +16,9 @@ module ShadowText
end
end
#===============================================================================
#
#===============================================================================
class UIControl
include ShadowText
attr_accessor :bitmap
@@ -90,8 +94,9 @@ class UIControl
end
end
#===============================================================================
#
#===============================================================================
class Label < UIControl
def text=(value)
self.label = value
@@ -106,8 +111,9 @@ class Label < UIControl
end
end
#===============================================================================
#
#===============================================================================
class Button < UIControl
attr_accessor :label
@@ -155,8 +161,9 @@ class Button < UIControl
end
end
#===============================================================================
#
#===============================================================================
class Checkbox < Button
attr_reader :checked
@@ -210,8 +217,9 @@ class Checkbox < Button
end
end
#===============================================================================
#
#===============================================================================
class TextField < UIControl
attr_accessor :label
attr_reader :text
@@ -340,8 +348,9 @@ class TextField < UIControl
end
end
#===============================================================================
#
#===============================================================================
class Slider < UIControl
attr_reader :minvalue
attr_reader :maxvalue
@@ -453,8 +462,9 @@ class Slider < UIControl
end
end
#===============================================================================
#
#===============================================================================
class OptionalSlider < Slider
def initialize(label, minvalue, maxvalue, curvalue)
@slider = Slider.new(label, minvalue, maxvalue, curvalue)
@@ -543,8 +553,9 @@ class OptionalSlider < Slider
end
end
#===============================================================================
#
#===============================================================================
class ArrayCountSlider < Slider
def maxvalue
return @array.length - 1
@@ -556,8 +567,9 @@ class ArrayCountSlider < Slider
end
end
#===============================================================================
#
#===============================================================================
class FrameCountSlider < Slider
def maxvalue
return @canvas.animation.length
@@ -569,8 +581,9 @@ class FrameCountSlider < Slider
end
end
#===============================================================================
#
#===============================================================================
class FrameCountButton < Button
def label
return _INTL("Total Frames: {1}", @canvas.animation.length)
@@ -582,8 +595,9 @@ class FrameCountButton < Button
end
end
#===============================================================================
#
#===============================================================================
class TextSlider < UIControl
attr_reader :minvalue
attr_reader :maxvalue
@@ -701,8 +715,9 @@ class TextSlider < UIControl
end
end
#===============================================================================
#
#===============================================================================
class OptionalTextSlider < TextSlider
def initialize(label, options, curval)
@slider = TextSlider.new(label, options, curval)
@@ -791,7 +806,9 @@ class OptionalTextSlider < TextSlider
end
end
#===============================================================================
#
#===============================================================================
class ControlWindow < SpriteWindow_Base
attr_reader :controls
@@ -1,6 +1,6 @@
################################################################################
#===============================================================================
# Paths and interpolation
################################################################################
#===============================================================================
class ControlPointSprite < Sprite
attr_accessor :dragging
@@ -48,8 +48,9 @@ class ControlPointSprite < Sprite
end
end
#===============================================================================
#
#===============================================================================
class PointSprite < Sprite
def initialize(x, y, viewport = nil)
super(viewport)
@@ -65,8 +66,9 @@ class PointSprite < Sprite
end
end
#===============================================================================
#
#===============================================================================
class PointPath
include Enumerable
@@ -180,8 +182,9 @@ class PointPath
end
end
#===============================================================================
#
#===============================================================================
def catmullRom(p1, p2, p3, p4, t)
# p1=prevPoint, p2=startPoint, p3=endPoint, p4=nextPoint, t is from 0 through 1
t2 = t * t
@@ -1,6 +1,6 @@
################################################################################
#===============================================================================
# Mini battle scene
################################################################################
#===============================================================================
class MiniBattler
attr_accessor :index
attr_accessor :pokemon
@@ -8,8 +8,9 @@ class MiniBattler
def initialize(index); self.index = index; end
end
#===============================================================================
#
#===============================================================================
class MiniBattle
attr_accessor :battlers
@@ -19,11 +20,9 @@ class MiniBattle
end
end
################################################################################
#===============================================================================
# Pop-up menus for buttons in bottom menu
################################################################################
#===============================================================================
def pbSelectAnim(canvas, animwin)
animfiles = []
pbRgssChdir(File.join("Graphics", "Animations")) {
@@ -182,9 +181,9 @@ def pbAnimList(animations, canvas, animwin)
cmdwin.dispose
end
################################################################################
#===============================================================================
# Pop-up menus for individual cels
################################################################################
#===============================================================================
def pbChooseNum(cel)
ret = cel
sliderwin2 = ControlWindow.new(0, 0, 320, 32 * 5)
@@ -370,9 +369,9 @@ def pbCellProperties(canvas)
return
end
################################################################################
#===============================================================================
# Pop-up menus for buttons in right hand menu
################################################################################
#===============================================================================
def pbTimingList(canvas)
commands = []
cmdNewSound = -1
@@ -957,9 +956,9 @@ def pbAnimEditorHelpWindow
cmdwin.dispose
end
################################################################################
#===============================================================================
# Main
################################################################################
#===============================================================================
def animationEditorMain(animation)
viewport = Viewport.new(0, 0, Settings::SCREEN_WIDTH + 288, Settings::SCREEN_HEIGHT + 288)
viewport.z = 99999
@@ -1172,9 +1171,9 @@ def animationEditorMain(animation)
RPG::Cache.clear
end
################################################################################
#===============================================================================
# Start
################################################################################
#===============================================================================
def pbAnimationEditor
pbBGMStop
animation = pbLoadBattleAnimations
+141 -99
View File
@@ -12,8 +12,9 @@ module UndefinedProperty
end
end
#===============================================================================
#
#===============================================================================
module ReadOnlyProperty
def self.set(_settingname, oldsetting)
pbMessage(_INTL("This property cannot be edited."))
@@ -25,8 +26,9 @@ module ReadOnlyProperty
end
end
#===============================================================================
#
#===============================================================================
class UIntProperty
def initialize(maxdigits)
@maxdigits = maxdigits
@@ -48,8 +50,9 @@ class UIntProperty
end
end
#===============================================================================
#
#===============================================================================
class LimitProperty
def initialize(maxvalue)
@maxvalue = maxvalue
@@ -72,8 +75,9 @@ class LimitProperty
end
end
#===============================================================================
#
#===============================================================================
class LimitProperty2
def initialize(maxvalue)
@maxvalue = maxvalue
@@ -98,8 +102,9 @@ class LimitProperty2
end
end
#===============================================================================
#
#===============================================================================
class NonzeroLimitProperty
def initialize(maxvalue)
@maxvalue = maxvalue
@@ -122,8 +127,9 @@ class NonzeroLimitProperty
end
end
#===============================================================================
#
#===============================================================================
module BooleanProperty
def self.set(settingname, _oldsetting)
return pbConfirmMessage(_INTL("Enable the setting {1}?", settingname)) ? true : false
@@ -134,8 +140,9 @@ module BooleanProperty
end
end
#===============================================================================
#
#===============================================================================
module BooleanProperty2
def self.set(_settingname, _oldsetting)
ret = pbShowCommands(nil, [_INTL("True"), _INTL("False")], -1)
@@ -151,8 +158,9 @@ module BooleanProperty2
end
end
#===============================================================================
#
#===============================================================================
module StringProperty
def self.set(settingname, oldsetting)
return pbMessageFreeText(_INTL("Set the value for {1}.", settingname),
@@ -164,8 +172,9 @@ module StringProperty
end
end
#===============================================================================
#
#===============================================================================
class LimitStringProperty
def initialize(limit)
@limit = limit
@@ -181,8 +190,9 @@ class LimitStringProperty
end
end
#===============================================================================
#
#===============================================================================
class EnumProperty
def initialize(values)
@values = values
@@ -207,9 +217,9 @@ class EnumProperty
end
end
#===============================================================================
# Unused
#===============================================================================
class EnumProperty2
def initialize(value)
@module = value
@@ -234,8 +244,9 @@ class EnumProperty2
end
end
#===============================================================================
#
#===============================================================================
class StringListProperty
def self.set(_setting_name, old_setting)
old_setting = [] if !old_setting
@@ -324,8 +335,9 @@ class StringListProperty
end
end
#===============================================================================
#
#===============================================================================
class GameDataProperty
def initialize(value)
raise _INTL("Couldn't find class {1} in module GameData.", value.to_s) if !GameData.const_defined?(value.to_sym)
@@ -355,8 +367,9 @@ class GameDataProperty
end
end
#===============================================================================
#
#===============================================================================
module BGMProperty
def self.set(settingname, oldsetting)
chosenmap = pbListScreen(settingname, MusicFileLister.new(true, oldsetting))
@@ -368,8 +381,9 @@ module BGMProperty
end
end
#===============================================================================
#
#===============================================================================
module MEProperty
def self.set(settingname, oldsetting)
chosenmap = pbListScreen(settingname, MusicFileLister.new(false, oldsetting))
@@ -381,8 +395,9 @@ module MEProperty
end
end
#===============================================================================
#
#===============================================================================
module WindowskinProperty
def self.set(settingname, oldsetting)
chosenmap = pbListScreen(settingname, GraphicsLister.new("Graphics/Windowskins/", oldsetting))
@@ -394,8 +409,9 @@ module WindowskinProperty
end
end
#===============================================================================
#
#===============================================================================
module TrainerTypeProperty
def self.set(settingname, oldsetting)
chosenmap = pbListScreen(settingname, TrainerTypeLister.new(0, false))
@@ -407,8 +423,9 @@ module TrainerTypeProperty
end
end
#===============================================================================
#
#===============================================================================
module SpeciesProperty
def self.set(_settingname, oldsetting)
ret = pbChooseSpeciesList(oldsetting || nil)
@@ -424,8 +441,9 @@ module SpeciesProperty
end
end
#===============================================================================
#
#===============================================================================
class SpeciesFormProperty
def initialize(default_value)
@default_value = default_value
@@ -453,8 +471,9 @@ class SpeciesFormProperty
end
end
#===============================================================================
#
#===============================================================================
module TypeProperty
def self.set(_settingname, oldsetting)
ret = pbChooseTypeList(oldsetting || nil)
@@ -470,8 +489,9 @@ module TypeProperty
end
end
#===============================================================================
#
#===============================================================================
module TypesProperty
def self.set(_settingname, oldsetting)
ret = oldsetting.clone
@@ -501,8 +521,9 @@ module TypesProperty
end
end
#===============================================================================
#
#===============================================================================
module MoveProperty
def self.set(_settingname, oldsetting)
ret = pbChooseMoveList(oldsetting || nil)
@@ -518,8 +539,9 @@ module MoveProperty
end
end
#===============================================================================
#
#===============================================================================
class MovePropertyForSpecies
def initialize(pokemondata)
@pokemondata = pokemondata
@@ -539,8 +561,9 @@ class MovePropertyForSpecies
end
end
#===============================================================================
#
#===============================================================================
module GenderProperty
def self.set(_settingname, _oldsetting)
ret = pbShowCommands(nil, [_INTL("Male"), _INTL("Female")], -1)
@@ -557,8 +580,9 @@ module GenderProperty
end
end
#===============================================================================
#
#===============================================================================
module ItemProperty
def self.set(_settingname, oldsetting)
ret = pbChooseItemList((oldsetting) ? oldsetting : nil)
@@ -574,8 +598,9 @@ module ItemProperty
end
end
#===============================================================================
#
#===============================================================================
class IVsProperty
def initialize(limit)
@limit = limit
@@ -614,8 +639,9 @@ class IVsProperty
end
end
#===============================================================================
#
#===============================================================================
class EVsProperty
def initialize(limit)
@limit = limit
@@ -660,8 +686,9 @@ class EVsProperty
end
end
#===============================================================================
#
#===============================================================================
class BallProperty
def initialize(pokemondata)
@pokemondata = pokemondata
@@ -680,8 +707,9 @@ class BallProperty
end
end
#===============================================================================
#
#===============================================================================
module CharacterProperty
def self.set(settingname, oldsetting)
chosenmap = pbListScreen(settingname, GraphicsLister.new("Graphics/Characters/", oldsetting))
@@ -693,8 +721,9 @@ module CharacterProperty
end
end
#===============================================================================
#
#===============================================================================
module MapSizeProperty
def self.set(settingname, oldsetting)
oldsetting = [0, ""] if !oldsetting
@@ -711,8 +740,6 @@ module MapSizeProperty
end
end
def chooseMapPoint(map, rgnmap = false)
viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
viewport.z = 99999
@@ -745,8 +772,9 @@ def chooseMapPoint(map, rgnmap = false)
return ret
end
#===============================================================================
#
#===============================================================================
module MapCoordsProperty
def self.set(settingname, oldsetting)
chosenmap = pbListScreen(settingname, MapLister.new((oldsetting) ? oldsetting[0] : 0))
@@ -763,8 +791,9 @@ module MapCoordsProperty
end
end
#===============================================================================
#
#===============================================================================
module MapCoordsFacingProperty
def self.set(settingname, oldsetting)
chosenmap = pbListScreen(settingname, MapLister.new((oldsetting) ? oldsetting[0] : 0))
@@ -787,8 +816,9 @@ module MapCoordsFacingProperty
end
end
#===============================================================================
#
#===============================================================================
module RegionMapCoordsProperty
def self.set(_settingname, oldsetting)
regions = self.getMapNameList
@@ -821,8 +851,9 @@ module RegionMapCoordsProperty
end
end
#===============================================================================
#
#===============================================================================
module WeatherEffectProperty
def self.set(_settingname, oldsetting)
oldsetting = [:None, 100] if !oldsetting
@@ -848,8 +879,9 @@ module WeatherEffectProperty
end
end
#===============================================================================
#
#===============================================================================
module MapProperty
def self.set(settingname, oldsetting)
chosenmap = pbListScreen(settingname, MapLister.new(oldsetting || 0))
@@ -865,8 +897,9 @@ module MapProperty
end
end
#===============================================================================
#
#===============================================================================
module ItemNameProperty
def self.set(settingname, oldsetting)
return pbMessageFreeText(_INTL("Set the value for {1}.", settingname),
@@ -882,8 +915,9 @@ module ItemNameProperty
end
end
#===============================================================================
#
#===============================================================================
module PocketProperty
def self.set(_settingname, oldsetting)
commands = Settings.bag_pocket_names.clone
@@ -901,8 +935,9 @@ module PocketProperty
end
end
#===============================================================================
#
#===============================================================================
module BaseStatsProperty
def self.set(settingname, oldsetting)
return oldsetting if !oldsetting
@@ -935,8 +970,9 @@ module BaseStatsProperty
end
end
#===============================================================================
#
#===============================================================================
module EffortValuesProperty
def self.set(settingname, oldsetting)
return oldsetting if !oldsetting
@@ -977,8 +1013,9 @@ module EffortValuesProperty
end
end
#===============================================================================
#
#===============================================================================
module AbilityProperty
def self.set(_settingname, oldsetting)
ret = pbChooseAbilityList((oldsetting) ? oldsetting : nil)
@@ -994,8 +1031,9 @@ module AbilityProperty
end
end
#===============================================================================
#
#===============================================================================
class GameDataPoolProperty
def initialize(game_data, allow_multiple = true, auto_sort = false)
if !GameData.const_defined?(game_data.to_sym)
@@ -1113,32 +1151,36 @@ class GameDataPoolProperty
end
end
#===============================================================================
#
#===============================================================================
class EggMovesProperty < GameDataPoolProperty
def initialize
super(:Move, false, true)
end
end
#===============================================================================
#
#===============================================================================
class EggGroupsProperty < GameDataPoolProperty
def initialize
super(:EggGroup, false, false)
end
end
#===============================================================================
#
#===============================================================================
class AbilitiesProperty < GameDataPoolProperty
def initialize
super(:Ability, false, false)
end
end
#===============================================================================
#
#===============================================================================
module LevelUpMovesProperty
def self.set(_settingname, oldsetting)
# Get all moves in move pool
@@ -1289,8 +1331,9 @@ module LevelUpMovesProperty
end
end
#===============================================================================
#
#===============================================================================
class EvolutionsProperty
def initialize
@methods = []
@@ -1517,14 +1560,15 @@ class EvolutionsProperty
ret << "," if i > 0
ret << value[i][0].to_s + ","
ret << value[i][1].to_s + ","
ret << value[i][2].to_s if value[i][2] != nil
ret << value[i][2].to_s if value[i][2]
end
return ret
end
end
#===============================================================================
#
#===============================================================================
module EncounterSlotProperty
def self.set(setting_name, data)
max_level = GameData::GrowthRate.max_level
@@ -1571,8 +1615,6 @@ module EncounterSlotProperty
end
end
#===============================================================================
# Core property editor script
#===============================================================================
@@ -38,8 +38,6 @@ def pbWarpToMap
return nil
end
#===============================================================================
# Debug Variables screen
#===============================================================================
@@ -131,8 +129,9 @@ class SpriteWindow_DebugVariables < Window_DrawableCommand
end
end
#===============================================================================
#
#===============================================================================
def pbDebugSetVariable(id, diff)
$game_variables[id] = 0 if $game_variables[id].nil?
if $game_variables[id].is_a?(Numeric)
@@ -371,8 +370,6 @@ def pbDebugDayCare
cmd_window.dispose
end
#===============================================================================
# Debug roaming Pokémon screen
#===============================================================================
@@ -453,8 +450,9 @@ class SpriteWindow_DebugRoamers < Window_DrawableCommand
end
end
#===============================================================================
#
#===============================================================================
def pbDebugRoamers
viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
viewport.z = 99999
@@ -544,8 +542,6 @@ def pbDebugRoamers
viewport.dispose
end
#===============================================================================
# Battle animations import/export
#===============================================================================
@@ -739,8 +735,6 @@ def pbCheckTileValidity(tile_id, map, tilesets, passages)
return false
end
#===============================================================================
# Pseudo-party screen for editing Pokémon being set up for a wild battle
#===============================================================================
+1 -1
View File
@@ -888,7 +888,7 @@ module Compiler
rescue SystemCallError
mustCompile = true
end
else
elsif filename != "shadow_pokemon.dat"
mustCompile = true
break
end
@@ -476,7 +476,7 @@ module Compiler
end
# Write each trainer property
schema.each_key do |key|
next if key == "SectionName" || key == "Pokemon"
next if ["SectionName", "Pokemon"].include?(key)
val = element.get_property_for_PBS(key)
next if val.nil?
f.write(sprintf("%s = ", key))