Applied most Rubocop-suggested layout fixes

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