mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
The Great Enspacening begins!
This commit is contained in:
@@ -13,7 +13,7 @@ class EventScriptError < Exception
|
||||
end
|
||||
end
|
||||
|
||||
def pbGetExceptionMessage(e,_script="")
|
||||
def pbGetExceptionMessage(e,_script = "")
|
||||
return e.event_message.dup if e.is_a?(EventScriptError) # Message with map/event ID generated elsewhere
|
||||
emessage = e.message.dup
|
||||
emessage.force_encoding(Encoding::UTF_8)
|
||||
|
||||
@@ -180,7 +180,7 @@ end
|
||||
module RTP
|
||||
@rtpPaths = nil
|
||||
|
||||
def self.exists?(filename,extensions=[])
|
||||
def self.exists?(filename,extensions = [])
|
||||
return false if nil_or_empty?(filename)
|
||||
eachPathFor(filename) { |path|
|
||||
return true if safeExists?(path)
|
||||
@@ -199,7 +199,7 @@ module RTP
|
||||
return self.getPath(filename,["",".wav",".wma",".mid",".ogg",".midi"]) # ".mp3"
|
||||
end
|
||||
|
||||
def self.getPath(filename,extensions=[])
|
||||
def self.getPath(filename,extensions = [])
|
||||
return filename if nil_or_empty?(filename)
|
||||
eachPathFor(filename) { |path|
|
||||
return path if safeExists?(path)
|
||||
@@ -293,7 +293,7 @@ end
|
||||
|
||||
# NOTE: load_data checks anything added in MKXP's RTP setting,
|
||||
# and matching mount points added through System.mount
|
||||
def pbRgssOpen(file,mode=nil)
|
||||
def pbRgssOpen(file,mode = nil)
|
||||
# File.open("debug.txt","ab") { |fw| fw.write([file,mode,Time.now.to_f].inspect+"\r\n") }
|
||||
if !safeExists?("./Game.rgssad")
|
||||
if block_given?
|
||||
@@ -421,7 +421,7 @@ class StringInput
|
||||
|
||||
def pos=(value); seek(value); end
|
||||
|
||||
def seek(offset, whence=IO::SEEK_SET)
|
||||
def seek(offset, whence = IO::SEEK_SET)
|
||||
raise IOError, 'closed stream' if @closed
|
||||
case whence
|
||||
when IO::SEEK_SET then @pos = offset
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# HTTP utility functions
|
||||
#
|
||||
#############################
|
||||
def pbPostData(url, postdata, filename=nil, depth=0)
|
||||
def pbPostData(url, postdata, filename = nil, depth = 0)
|
||||
if url[/^http:\/\/([^\/]+)(.*)$/]
|
||||
host = $1
|
||||
path = $2
|
||||
|
||||
@@ -344,7 +344,7 @@ class OrderedHash < Hash
|
||||
return ret
|
||||
end
|
||||
|
||||
def _dump(_depth=100)
|
||||
def _dump(_depth = 100)
|
||||
values=[]
|
||||
for key in @keys
|
||||
values.push(self[key])
|
||||
@@ -356,7 +356,7 @@ end
|
||||
|
||||
|
||||
class Messages
|
||||
def initialize(filename=nil,delayLoad=false)
|
||||
def initialize(filename = nil,delayLoad = false)
|
||||
@messages=nil
|
||||
@filename=filename
|
||||
if @filename && !delayLoad
|
||||
@@ -410,7 +410,7 @@ class Messages
|
||||
return value
|
||||
end
|
||||
|
||||
def self.writeObject(f,msgs,secname,origMessages=nil)
|
||||
def self.writeObject(f,msgs,secname,origMessages = nil)
|
||||
return if !msgs
|
||||
if msgs.is_a?(Array)
|
||||
f.write("[#{secname}]\r\n")
|
||||
@@ -529,7 +529,7 @@ class Messages
|
||||
@messages[type]=Messages.addToHash(type,array,@messages[type])
|
||||
end
|
||||
|
||||
def saveMessages(filename=nil)
|
||||
def saveMessages(filename = nil)
|
||||
filename="Data/messages.dat" if !filename
|
||||
File.open(filename,"wb") { |f| Marshal.dump(@messages,f) }
|
||||
end
|
||||
@@ -675,7 +675,7 @@ module MessageTypes
|
||||
@@messages.setMessagesAsHash(type,array)
|
||||
end
|
||||
|
||||
def self.saveMessages(filename=nil)
|
||||
def self.saveMessages(filename = nil)
|
||||
@@messages.saveMessages(filename)
|
||||
end
|
||||
|
||||
|
||||
@@ -92,14 +92,14 @@ class HandlerHash
|
||||
return ret
|
||||
end
|
||||
|
||||
def addIf(conditionProc,handler=nil,&handlerBlock)
|
||||
def addIf(conditionProc,handler = nil,&handlerBlock)
|
||||
if ![Proc,Hash].include?(handler.class) && !block_given?
|
||||
raise ArgumentError, "addIf call for #{self.class.name} has no valid handler (#{handler.inspect} was given)"
|
||||
end
|
||||
@addIfs.push([conditionProc,handler || handlerBlock])
|
||||
end
|
||||
|
||||
def add(sym,handler=nil,&handlerBlock) # 'sym' can be an ID or symbol
|
||||
def add(sym,handler = nil,&handlerBlock) # 'sym' can be an ID or symbol
|
||||
if ![Proc,Hash].include?(handler.class) && !block_given?
|
||||
raise ArgumentError, "#{self.class.name} for #{sym.inspect} has no valid handler (#{handler.inspect} was given)"
|
||||
end
|
||||
|
||||
@@ -79,7 +79,7 @@ class Game_System
|
||||
Graphics.frame_reset
|
||||
end
|
||||
|
||||
def bgm_pause(fadetime=0.0) # :nodoc:
|
||||
def bgm_pause(fadetime = 0.0) # :nodoc:
|
||||
pos = Audio.bgm_pos rescue 0
|
||||
self.bgm_fade(fadetime) if fadetime>0.0
|
||||
@bgm_position = pos
|
||||
@@ -130,7 +130,7 @@ class Game_System
|
||||
return (@playing_bgm) ? @playing_bgm.clone : nil
|
||||
end
|
||||
|
||||
def setDefaultBGM(bgm,volume=80,pitch=100)
|
||||
def setDefaultBGM(bgm,volume = 80,pitch = 100)
|
||||
bgm = RPG::AudioFile.new(bgm,volume,pitch) if bgm.is_a?(String)
|
||||
if bgm!=nil && bgm.name!=""
|
||||
@defaultBGM = nil
|
||||
@@ -178,7 +178,7 @@ class Game_System
|
||||
Graphics.frame_reset
|
||||
end
|
||||
|
||||
def bgs_pause(fadetime=0.0) # :nodoc:
|
||||
def bgs_pause(fadetime = 0.0) # :nodoc:
|
||||
if fadetime>0.0
|
||||
self.bgs_fade(fadetime)
|
||||
else
|
||||
|
||||
@@ -299,7 +299,7 @@ class Game_Map
|
||||
return false
|
||||
end
|
||||
|
||||
def terrain_tag(x,y,countBridge=false)
|
||||
def terrain_tag(x,y,countBridge = false)
|
||||
if valid?(x, y)
|
||||
for i in [2, 1, 0]
|
||||
tile_id = data[x, y, i]
|
||||
|
||||
@@ -77,7 +77,7 @@ class Interpreter
|
||||
# y : y coordinate to scroll to and center on
|
||||
# speed : (optional) scroll speed (from 1-6, default being 4)
|
||||
#-----------------------------------------------------------------------------
|
||||
def autoscroll(x,y,speed=SCROLL_SPEED_DEFAULT)
|
||||
def autoscroll(x,y,speed = SCROLL_SPEED_DEFAULT)
|
||||
if $game_map.scrolling?
|
||||
return false
|
||||
elsif !$game_map.valid?(x,y)
|
||||
@@ -138,7 +138,7 @@ class Interpreter
|
||||
# * Map Autoscroll (to Player)
|
||||
# speed : (optional) scroll speed (from 1-6, default being 4)
|
||||
#-----------------------------------------------------------------------------
|
||||
def autoscroll_player(speed=SCROLL_SPEED_DEFAULT)
|
||||
def autoscroll_player(speed = SCROLL_SPEED_DEFAULT)
|
||||
autoscroll($game_player.x,$game_player.y,speed)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -51,7 +51,7 @@ class PokemonMapFactory
|
||||
return -1
|
||||
end
|
||||
|
||||
def getMap(id,add=true)
|
||||
def getMap(id,add = true)
|
||||
for map in @maps
|
||||
return map if map.map_id==id
|
||||
end
|
||||
@@ -194,7 +194,7 @@ class PokemonMapFactory
|
||||
end
|
||||
|
||||
# Only used by dependent events
|
||||
def isPassableStrict?(mapID,x,y,thisEvent=nil)
|
||||
def isPassableStrict?(mapID,x,y,thisEvent = nil)
|
||||
thisEvent = $game_player if !thisEvent
|
||||
map = getMapNoAdd(mapID)
|
||||
return false if !map
|
||||
@@ -214,19 +214,19 @@ class PokemonMapFactory
|
||||
return true
|
||||
end
|
||||
|
||||
def getTerrainTag(mapid,x,y,countBridge=false)
|
||||
def getTerrainTag(mapid,x,y,countBridge = false)
|
||||
map = getMapNoAdd(mapid)
|
||||
return map.terrain_tag(x,y,countBridge)
|
||||
end
|
||||
|
||||
# NOTE: Assumes the event is 1x1 tile in size. Only returns one terrain tag.
|
||||
def getFacingTerrainTag(dir=nil,event=nil)
|
||||
def getFacingTerrainTag(dir = nil,event = nil)
|
||||
tile = getFacingTile(dir,event)
|
||||
return GameData::TerrainTag.get(:None) if !tile
|
||||
return getTerrainTag(tile[0],tile[1],tile[2])
|
||||
end
|
||||
|
||||
def getTerrainTagFromCoords(mapid,x,y,countBridge=false)
|
||||
def getTerrainTagFromCoords(mapid,x,y,countBridge = false)
|
||||
tile = getRealTilePos(mapid,x,y)
|
||||
return GameData::TerrainTag.get(:None) if !tile
|
||||
return getTerrainTag(tile[0],tile[1],tile[2])
|
||||
@@ -289,7 +289,7 @@ class PokemonMapFactory
|
||||
end
|
||||
|
||||
# NOTE: Assumes the event is 1x1 tile in size. Only returns one tile.
|
||||
def getFacingTile(direction=nil,event=nil,steps=1)
|
||||
def getFacingTile(direction = nil,event = nil,steps = 1)
|
||||
event = $game_player if event==nil
|
||||
return [0,0,0] if !event
|
||||
x = event.x
|
||||
@@ -299,7 +299,7 @@ class PokemonMapFactory
|
||||
return getFacingTileFromPos(id,x,y,direction,steps)
|
||||
end
|
||||
|
||||
def getFacingTileFromPos(mapID,x,y,direction=0,steps=1)
|
||||
def getFacingTileFromPos(mapID,x,y,direction = 0,steps = 1)
|
||||
id = mapID
|
||||
case direction
|
||||
when 1
|
||||
@@ -354,7 +354,7 @@ class PokemonMapFactory
|
||||
return nil
|
||||
end
|
||||
|
||||
def getFacingCoords(x,y,direction=0,steps=1)
|
||||
def getFacingCoords(x,y,direction = 0,steps = 1)
|
||||
case direction
|
||||
when 1
|
||||
x -= steps
|
||||
|
||||
@@ -26,7 +26,7 @@ class Game_Character
|
||||
attr_accessor :walk_anime
|
||||
attr_writer :bob_height
|
||||
|
||||
def initialize(map=nil)
|
||||
def initialize(map = nil)
|
||||
@map = map
|
||||
@id = 0
|
||||
@original_x = 0
|
||||
@@ -629,7 +629,7 @@ class Game_Character
|
||||
end
|
||||
end
|
||||
|
||||
def move_random_range(xrange=-1,yrange=-1)
|
||||
def move_random_range(xrange = -1,yrange = -1)
|
||||
dirs = [] # 0=down, 1=left, 2=right, 3=up
|
||||
if xrange<0
|
||||
dirs.push(1)
|
||||
@@ -654,11 +654,11 @@ class Game_Character
|
||||
end
|
||||
end
|
||||
|
||||
def move_random_UD(range=-1)
|
||||
def move_random_UD(range = -1)
|
||||
move_random_range(0,range)
|
||||
end
|
||||
|
||||
def move_random_LR(range=-1)
|
||||
def move_random_LR(range = -1)
|
||||
move_random_range(range,0)
|
||||
end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ class Game_Event < Game_Character
|
||||
attr_reader :tempSwitches # Temporary self-switches
|
||||
attr_accessor :need_refresh
|
||||
|
||||
def initialize(map_id, event, map=nil)
|
||||
def initialize(map_id, event, map = nil)
|
||||
super(map)
|
||||
@map_id = map_id
|
||||
@event = event
|
||||
@@ -99,13 +99,13 @@ class Game_Event < Game_Character
|
||||
return $PokemonGlobal.eventvars[[@map_id,@event.id]].to_i
|
||||
end
|
||||
|
||||
def expired?(secs=86400)
|
||||
def expired?(secs = 86400)
|
||||
ontime=self.variable
|
||||
time=pbGetTimeNow
|
||||
return ontime && (time.to_i>ontime+secs)
|
||||
end
|
||||
|
||||
def expiredDays?(days=1)
|
||||
def expiredDays?(days = 1)
|
||||
ontime=self.variable.to_i
|
||||
return false if !ontime
|
||||
now=pbGetTimeNow
|
||||
@@ -242,7 +242,7 @@ class Game_Event < Game_Character
|
||||
check_event_trigger_auto
|
||||
end
|
||||
|
||||
def should_update?(recalc=false)
|
||||
def should_update?(recalc = false)
|
||||
return @to_update if !recalc
|
||||
return true if @trigger && (@trigger == 3 || @trigger == 4)
|
||||
return true if @move_route_forcing
|
||||
|
||||
@@ -179,7 +179,7 @@ class Game_Player < Game_Character
|
||||
triggerLeaveTile
|
||||
end
|
||||
|
||||
def pbTriggeredTrainerEvents(triggers,checkIfRunning=true)
|
||||
def pbTriggeredTrainerEvents(triggers,checkIfRunning = true)
|
||||
result = []
|
||||
# If event is running
|
||||
return result if checkIfRunning && $game_system.map_interpreter.running?
|
||||
@@ -196,7 +196,7 @@ class Game_Player < Game_Character
|
||||
return result
|
||||
end
|
||||
|
||||
def pbTriggeredCounterEvents(triggers,checkIfRunning=true)
|
||||
def pbTriggeredCounterEvents(triggers,checkIfRunning = true)
|
||||
result = []
|
||||
# If event is running
|
||||
return result if checkIfRunning && $game_system.map_interpreter.running?
|
||||
@@ -230,7 +230,7 @@ class Game_Player < Game_Character
|
||||
return $game_map.terrain_tag(@x, @y, countBridge)
|
||||
end
|
||||
|
||||
def pbFacingEvent(ignoreInterpreter=false)
|
||||
def pbFacingEvent(ignoreInterpreter = false)
|
||||
return nil if $game_system.map_interpreter.running? && !ignoreInterpreter
|
||||
# Check the tile in front of the player for events
|
||||
new_x = @x + (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Sprite_Timer
|
||||
def initialize(viewport=nil)
|
||||
def initialize(viewport = nil)
|
||||
@viewport=viewport
|
||||
@timer=nil
|
||||
@total_sec=nil
|
||||
|
||||
@@ -2,7 +2,7 @@ class Sprite_Reflection
|
||||
attr_reader :visible
|
||||
attr_accessor :event
|
||||
|
||||
def initialize(sprite,event,viewport=nil)
|
||||
def initialize(sprite,event,viewport = nil)
|
||||
@rsprite = sprite
|
||||
@sprite = nil
|
||||
@event = event
|
||||
|
||||
@@ -2,7 +2,7 @@ class Sprite_SurfBase
|
||||
attr_reader :visible
|
||||
attr_accessor :event
|
||||
|
||||
def initialize(sprite,event,viewport=nil)
|
||||
def initialize(sprite,event,viewport = nil)
|
||||
@rsprite = sprite
|
||||
@sprite = nil
|
||||
@event = event
|
||||
|
||||
@@ -45,7 +45,7 @@ class Spriteset_Map
|
||||
return @@viewport1
|
||||
end
|
||||
|
||||
def initialize(map=nil)
|
||||
def initialize(map = nil)
|
||||
@map = (map) ? map : $game_map
|
||||
$scene.map_renderer.add_tileset(@map.tileset_name)
|
||||
@map.autotile_names.each { |filename| $scene.map_renderer.add_autotile(filename) }
|
||||
|
||||
@@ -5,7 +5,7 @@ automatically when its animation is finished.
|
||||
Used for grass rustling and so forth.
|
||||
=end
|
||||
class AnimationSprite < RPG::Sprite
|
||||
def initialize(animID,map,tileX,tileY,viewport=nil,tinting=false,height=3)
|
||||
def initialize(animID,map,tileX,tileY,viewport = nil,tinting = false,height = 3)
|
||||
super(viewport)
|
||||
@tileX = tileX
|
||||
@tileY = tileY
|
||||
@@ -45,12 +45,12 @@ class Spriteset_Map
|
||||
alias _animationSprite_update update
|
||||
alias _animationSprite_dispose dispose
|
||||
|
||||
def initialize(map=nil)
|
||||
def initialize(map = nil)
|
||||
@usersprites=[]
|
||||
_animationSprite_initialize(map)
|
||||
end
|
||||
|
||||
def addUserAnimation(animID,x,y,tinting=false,height=3)
|
||||
def addUserAnimation(animID,x,y,tinting = false,height = 3)
|
||||
sprite=AnimationSprite.new(animID,self.map,x,y,@@viewport1,tinting,height)
|
||||
addUserSprite(sprite)
|
||||
return sprite
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
class Sprite_Shadow < RPG::Sprite
|
||||
attr_accessor :character
|
||||
|
||||
def initialize(viewport, character = nil,params=[])
|
||||
def initialize(viewport, character = nil,params = [])
|
||||
super(viewport)
|
||||
@source = params[0]
|
||||
@anglemin = (params.size>1) ? params[1] : 0
|
||||
@@ -184,7 +184,7 @@ class Spriteset_Map
|
||||
attr_accessor :shadows
|
||||
|
||||
alias shadow_initialize initialize
|
||||
def initialize(map=nil)
|
||||
def initialize(map = nil)
|
||||
@shadows = []
|
||||
warn = false
|
||||
map = $game_map if !map
|
||||
@@ -228,7 +228,7 @@ end
|
||||
# p XPML_read("third", event_id) -> [3]
|
||||
# p XPML_read("forth", event_id) -> nil
|
||||
#===================================================
|
||||
def XPML_read(map,markup,event,max_param_number=0)
|
||||
def XPML_read(map,markup,event,max_param_number = 0)
|
||||
parameter_list = nil
|
||||
return nil if !event || event.list == nil
|
||||
for i in 0...event.list.size
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Based on version 2 by Near Fantastica, 04.01.06
|
||||
# In turn based on the Particle Engine designed by PinkMan
|
||||
class Particle_Engine
|
||||
def initialize(viewport=nil,map=nil)
|
||||
def initialize(viewport = nil,map = nil)
|
||||
@map = (map) ? map : $game_map
|
||||
@viewport = viewport
|
||||
@effect = []
|
||||
@@ -177,7 +177,7 @@ end
|
||||
class ParticleEffect_Event < ParticleEffect
|
||||
attr_accessor :event
|
||||
|
||||
def initialize(event,viewport=nil)
|
||||
def initialize(event,viewport = nil)
|
||||
@event = event
|
||||
@viewport = viewport
|
||||
@particles = []
|
||||
@@ -202,7 +202,7 @@ class ParticleEffect_Event < ParticleEffect
|
||||
return bitmap
|
||||
end
|
||||
|
||||
def initParticles(filename,opacity,zOffset=0,blendtype=1)
|
||||
def initParticles(filename,opacity,zOffset = 0,blendtype = 1)
|
||||
@particles = []
|
||||
@particlex = []
|
||||
@particley = []
|
||||
@@ -570,7 +570,7 @@ class Game_Event < Game_Character
|
||||
attr_accessor :pe_refresh
|
||||
|
||||
alias nf_particles_game_map_initialize initialize
|
||||
def initialize(map_id,event,map=nil)
|
||||
def initialize(map_id,event,map = nil)
|
||||
@pe_refresh = false
|
||||
begin
|
||||
nf_particles_game_map_initialize(map_id, event, map)
|
||||
|
||||
@@ -130,7 +130,7 @@ class PictureEx
|
||||
end
|
||||
end
|
||||
|
||||
def setCallback(delay, cb=nil)
|
||||
def setCallback(delay, cb = nil)
|
||||
delay = ensureDelayAndDuration(delay)
|
||||
@processes.push([nil,delay,0,0,cb])
|
||||
end
|
||||
@@ -149,7 +149,7 @@ class PictureEx
|
||||
return ret.to_i
|
||||
end
|
||||
|
||||
def ensureDelayAndDuration(delay, duration=nil)
|
||||
def ensureDelayAndDuration(delay, duration = nil)
|
||||
delay = self.totalDuration if delay<0
|
||||
delay *= Graphics.frame_rate/20.0
|
||||
if !duration.nil?
|
||||
@@ -194,149 +194,149 @@ class PictureEx
|
||||
end
|
||||
end
|
||||
|
||||
def move(delay, duration, origin, x, y, zoom_x=100.0, zoom_y=100.0, opacity=255)
|
||||
def move(delay, duration, origin, x, y, zoom_x = 100.0, zoom_y = 100.0, opacity = 255)
|
||||
setOrigin(delay,duration,origin)
|
||||
moveXY(delay,duration,x,y)
|
||||
moveZoomXY(delay,duration,zoom_x,zoom_y)
|
||||
moveOpacity(delay,duration,opacity)
|
||||
end
|
||||
|
||||
def moveXY(delay, duration, x, y, cb=nil)
|
||||
def moveXY(delay, duration, x, y, cb = nil)
|
||||
delay, duration = ensureDelayAndDuration(delay,duration)
|
||||
@processes.push([Processes::XY,delay,duration,0,cb,@x,@y,x,y])
|
||||
end
|
||||
|
||||
def setXY(delay, x, y, cb=nil)
|
||||
def setXY(delay, x, y, cb = nil)
|
||||
moveXY(delay,0,x,y,cb)
|
||||
end
|
||||
|
||||
def moveCurve(delay, duration, x1, y1, x2, y2, x3, y3, cb=nil)
|
||||
def moveCurve(delay, duration, x1, y1, x2, y2, x3, y3, cb = nil)
|
||||
delay, duration = ensureDelayAndDuration(delay,duration)
|
||||
@processes.push([Processes::Curve,delay,duration,0,cb,[@x,@y,x1,y1,x2,y2,x3,y3]])
|
||||
end
|
||||
|
||||
def moveDelta(delay, duration, x, y, cb=nil)
|
||||
def moveDelta(delay, duration, x, y, cb = nil)
|
||||
delay, duration = ensureDelayAndDuration(delay,duration)
|
||||
@processes.push([Processes::DeltaXY,delay,duration,0,cb,@x,@y,x,y])
|
||||
end
|
||||
|
||||
def setDelta(delay, x, y, cb=nil)
|
||||
def setDelta(delay, x, y, cb = nil)
|
||||
moveDelta(delay,0,x,y,cb)
|
||||
end
|
||||
|
||||
def moveZ(delay, duration, z, cb=nil)
|
||||
def moveZ(delay, duration, z, cb = nil)
|
||||
delay, duration = ensureDelayAndDuration(delay,duration)
|
||||
@processes.push([Processes::Z,delay,duration,0,cb,@z,z])
|
||||
end
|
||||
|
||||
def setZ(delay, z, cb=nil)
|
||||
def setZ(delay, z, cb = nil)
|
||||
moveZ(delay,0,z,cb)
|
||||
end
|
||||
|
||||
def moveZoomXY(delay, duration, zoom_x, zoom_y, cb=nil)
|
||||
def moveZoomXY(delay, duration, zoom_x, zoom_y, cb = nil)
|
||||
delay, duration = ensureDelayAndDuration(delay,duration)
|
||||
@processes.push([Processes::Zoom,delay,duration,0,cb,@zoom_x,@zoom_y,zoom_x,zoom_y])
|
||||
end
|
||||
|
||||
def setZoomXY(delay, zoom_x, zoom_y, cb=nil)
|
||||
def setZoomXY(delay, zoom_x, zoom_y, cb = nil)
|
||||
moveZoomXY(delay,0,zoom_x,zoom_y,cb)
|
||||
end
|
||||
|
||||
def moveZoom(delay, duration, zoom, cb=nil)
|
||||
def moveZoom(delay, duration, zoom, cb = nil)
|
||||
moveZoomXY(delay,duration,zoom,zoom,cb)
|
||||
end
|
||||
|
||||
def setZoom(delay, zoom, cb=nil)
|
||||
def setZoom(delay, zoom, cb = nil)
|
||||
moveZoomXY(delay,0,zoom,zoom,cb)
|
||||
end
|
||||
|
||||
def moveAngle(delay, duration, angle, cb=nil)
|
||||
def moveAngle(delay, duration, angle, cb = nil)
|
||||
delay, duration = ensureDelayAndDuration(delay,duration)
|
||||
@processes.push([Processes::Angle,delay,duration,0,cb,@angle,angle])
|
||||
end
|
||||
|
||||
def setAngle(delay, angle, cb=nil)
|
||||
def setAngle(delay, angle, cb = nil)
|
||||
moveAngle(delay,0,angle,cb)
|
||||
end
|
||||
|
||||
def moveTone(delay, duration, tone, cb=nil)
|
||||
def moveTone(delay, duration, tone, cb = nil)
|
||||
delay, duration = ensureDelayAndDuration(delay,duration)
|
||||
target = (tone) ? tone.clone : Tone.new(0,0,0,0)
|
||||
@processes.push([Processes::Tone,delay,duration,0,cb,@tone.clone,target])
|
||||
end
|
||||
|
||||
def setTone(delay, tone, cb=nil)
|
||||
def setTone(delay, tone, cb = nil)
|
||||
moveTone(delay,0,tone,cb)
|
||||
end
|
||||
|
||||
def moveColor(delay, duration, color, cb=nil)
|
||||
def moveColor(delay, duration, color, cb = nil)
|
||||
delay, duration = ensureDelayAndDuration(delay,duration)
|
||||
target = (color) ? color.clone : Color.new(0,0,0,0)
|
||||
@processes.push([Processes::Color,delay,duration,0,cb,@color.clone,target])
|
||||
end
|
||||
|
||||
def setColor(delay, color, cb=nil)
|
||||
def setColor(delay, color, cb = nil)
|
||||
moveColor(delay,0,color,cb)
|
||||
end
|
||||
|
||||
# Hue changes don't actually work.
|
||||
def moveHue(delay, duration, hue, cb=nil)
|
||||
def moveHue(delay, duration, hue, cb = nil)
|
||||
delay, duration = ensureDelayAndDuration(delay,duration)
|
||||
@processes.push([Processes::Hue,delay,duration,0,cb,@hue,hue])
|
||||
end
|
||||
|
||||
# Hue changes don't actually work.
|
||||
def setHue(delay, hue, cb=nil)
|
||||
def setHue(delay, hue, cb = nil)
|
||||
moveHue(delay,0,hue,cb)
|
||||
end
|
||||
|
||||
def moveOpacity(delay, duration, opacity, cb=nil)
|
||||
def moveOpacity(delay, duration, opacity, cb = nil)
|
||||
delay, duration = ensureDelayAndDuration(delay,duration)
|
||||
@processes.push([Processes::Opacity,delay,duration,0,cb,@opacity,opacity])
|
||||
end
|
||||
|
||||
def setOpacity(delay, opacity, cb=nil)
|
||||
def setOpacity(delay, opacity, cb = nil)
|
||||
moveOpacity(delay,0,opacity,cb)
|
||||
end
|
||||
|
||||
def setVisible(delay, visible, cb=nil)
|
||||
def setVisible(delay, visible, cb = nil)
|
||||
delay = ensureDelay(delay)
|
||||
@processes.push([Processes::Visible,delay,0,0,cb,visible])
|
||||
end
|
||||
|
||||
# Only values of 0 (normal), 1 (additive) and 2 (subtractive) are allowed.
|
||||
def setBlendType(delay, blend, cb=nil)
|
||||
def setBlendType(delay, blend, cb = nil)
|
||||
delay = ensureDelayAndDuration(delay)
|
||||
@processes.push([Processes::BlendType,delay,0,0,cb,blend])
|
||||
end
|
||||
|
||||
def setSE(delay, seFile, volume=nil, pitch=nil, cb=nil)
|
||||
def setSE(delay, seFile, volume = nil, pitch = nil, cb = nil)
|
||||
delay = ensureDelay(delay)
|
||||
@processes.push([Processes::SE,delay,0,0,cb,seFile,volume,pitch])
|
||||
end
|
||||
|
||||
def setName(delay, name, cb=nil)
|
||||
def setName(delay, name, cb = nil)
|
||||
delay = ensureDelay(delay)
|
||||
@processes.push([Processes::Name,delay,0,0,cb,name])
|
||||
end
|
||||
|
||||
def setOrigin(delay, origin, cb=nil)
|
||||
def setOrigin(delay, origin, cb = nil)
|
||||
delay = ensureDelay(delay)
|
||||
@processes.push([Processes::Origin,delay,0,0,cb,origin])
|
||||
end
|
||||
|
||||
def setSrc(delay, srcX, srcY, cb=nil)
|
||||
def setSrc(delay, srcX, srcY, cb = nil)
|
||||
delay = ensureDelay(delay)
|
||||
@processes.push([Processes::Src,delay,0,0,cb,srcX,srcY])
|
||||
end
|
||||
|
||||
def setSrcSize(delay, srcWidth, srcHeight, cb=nil)
|
||||
def setSrcSize(delay, srcWidth, srcHeight, cb = nil)
|
||||
delay = ensureDelay(delay)
|
||||
@processes.push([Processes::SrcSize,delay,0,0,cb,srcWidth,srcHeight])
|
||||
end
|
||||
|
||||
# Used to cut Pokémon sprites off when they faint and sink into the ground.
|
||||
def setCropBottom(delay, y, cb=nil)
|
||||
def setCropBottom(delay, y, cb = nil)
|
||||
delay = ensureDelay(delay)
|
||||
@processes.push([Processes::CropBottom,delay,0,0,cb,y])
|
||||
end
|
||||
@@ -462,7 +462,7 @@ end
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
def setPictureSprite(sprite, picture, iconSprite=false)
|
||||
def setPictureSprite(sprite, picture, iconSprite = false)
|
||||
return if picture.frameUpdates.length==0
|
||||
for i in 0...picture.frameUpdates.length
|
||||
case picture.frameUpdates[i]
|
||||
|
||||
@@ -28,7 +28,7 @@ module ScreenPosHelper
|
||||
return h
|
||||
end
|
||||
|
||||
def self.pbScreenZ(ch,height=nil)
|
||||
def self.pbScreenZ(ch,height = nil)
|
||||
if height==nil
|
||||
height=0
|
||||
if ch.tile_id > 0
|
||||
|
||||
@@ -118,7 +118,7 @@ class TileDrawingHelper
|
||||
bitmap.stretch_blt(Rect.new(x, y, cxTile, cyTile), @tileset, rect)
|
||||
end
|
||||
|
||||
def bltSmallTile(bitmap,x,y,cxTile,cyTile,id,frame=0)
|
||||
def bltSmallTile(bitmap,x,y,cxTile,cyTile,id,frame = 0)
|
||||
if id >= 384
|
||||
bltSmallRegularTile(bitmap, x, y, cxTile, cyTile, id)
|
||||
elsif id > 0
|
||||
@@ -134,7 +134,7 @@ class TileDrawingHelper
|
||||
bltSmallRegularTile(bitmap, x, y, 32, 32, id)
|
||||
end
|
||||
|
||||
def bltTile(bitmap,x,y,id,frame=0)
|
||||
def bltTile(bitmap,x,y,id,frame = 0)
|
||||
if id >= 384
|
||||
bltRegularTile(bitmap, x, y, id)
|
||||
elsif id > 0
|
||||
|
||||
@@ -174,7 +174,7 @@ def pbBottomLeft(window)
|
||||
window.y=Graphics.height-window.height
|
||||
end
|
||||
|
||||
def pbBottomLeftLines(window,lines,width=nil)
|
||||
def pbBottomLeftLines(window,lines,width = nil)
|
||||
window.x=0
|
||||
window.width=width ? width : Graphics.width
|
||||
window.height=(window.borderY rescue 32)+lines*32
|
||||
@@ -229,7 +229,7 @@ def pbPositionNearMsgWindow(cmdwindow,msgwindow,side)
|
||||
end
|
||||
|
||||
# internal function
|
||||
def pbRepositionMessageWindow(msgwindow, linecount=2)
|
||||
def pbRepositionMessageWindow(msgwindow, linecount = 2)
|
||||
msgwindow.height=32*linecount+msgwindow.borderY
|
||||
msgwindow.y=(Graphics.height)-(msgwindow.height)
|
||||
if $game_system
|
||||
@@ -246,7 +246,7 @@ def pbRepositionMessageWindow(msgwindow, linecount=2)
|
||||
end
|
||||
|
||||
# internal function
|
||||
def pbUpdateMsgWindowPos(msgwindow,event,eventChanged=false)
|
||||
def pbUpdateMsgWindowPos(msgwindow,event,eventChanged = false)
|
||||
if event
|
||||
if eventChanged
|
||||
msgwindow.resizeToFit2(msgwindow.text,Graphics.width*2/3,msgwindow.height)
|
||||
@@ -272,7 +272,7 @@ end
|
||||
#===============================================================================
|
||||
# Determine the colour of a background
|
||||
#===============================================================================
|
||||
def isDarkBackground(background,rect=nil)
|
||||
def isDarkBackground(background,rect = nil)
|
||||
return true if !background || background.disposed?
|
||||
rect = background.rect if !rect
|
||||
return true if rect.width<=0 || rect.height<=0
|
||||
@@ -545,7 +545,7 @@ end
|
||||
# pbFadeOutIn(z) { block }
|
||||
# Fades out the screen before a block is run and fades it back in after the
|
||||
# block exits. z indicates the z-coordinate of the viewport used for this effect
|
||||
def pbFadeOutIn(z=99999,nofadeout=false)
|
||||
def pbFadeOutIn(z = 99999,nofadeout = false)
|
||||
col=Color.new(0,0,0,0)
|
||||
viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
|
||||
viewport.z=z
|
||||
@@ -576,7 +576,7 @@ def pbFadeOutIn(z=99999,nofadeout=false)
|
||||
end
|
||||
end
|
||||
|
||||
def pbFadeOutInWithUpdate(z,sprites,nofadeout=false)
|
||||
def pbFadeOutInWithUpdate(z,sprites,nofadeout = false)
|
||||
col=Color.new(0,0,0,0)
|
||||
viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
|
||||
viewport.z=z
|
||||
@@ -609,7 +609,7 @@ end
|
||||
|
||||
# Similar to pbFadeOutIn, but pauses the music as it fades out.
|
||||
# Requires scripts "Audio" (for bgm_pause) and "SpriteWindow" (for pbFadeOutIn).
|
||||
def pbFadeOutInWithMusic(zViewport=99999)
|
||||
def pbFadeOutInWithMusic(zViewport = 99999)
|
||||
playingBGS = $game_system.getPlayingBGS
|
||||
playingBGM = $game_system.getPlayingBGM
|
||||
$game_system.bgm_pause(1.0)
|
||||
@@ -642,7 +642,7 @@ def pbFadeOutAndHide(sprites)
|
||||
return visiblesprites
|
||||
end
|
||||
|
||||
def pbFadeInAndShow(sprites,visiblesprites=nil)
|
||||
def pbFadeInAndShow(sprites,visiblesprites = nil)
|
||||
if visiblesprites
|
||||
for i in visiblesprites
|
||||
if i[1] && sprites[i[0]] && !pbDisposed?(sprites[i[0]])
|
||||
@@ -713,7 +713,7 @@ end
|
||||
# _background_ is a filename within the Graphics/Pictures/ folder and can be
|
||||
# an animated image.
|
||||
# _viewport_ is a viewport to place the background in.
|
||||
def addBackgroundPlane(sprites,planename,background,viewport=nil)
|
||||
def addBackgroundPlane(sprites,planename,background,viewport = nil)
|
||||
sprites[planename]=AnimatedPlane.new(viewport)
|
||||
bitmapName=pbResolveBitmap("Graphics/Pictures/#{background}")
|
||||
if bitmapName==nil
|
||||
@@ -736,7 +736,7 @@ end
|
||||
# an animated image.
|
||||
# _color_ is the color to use if the background can't be found.
|
||||
# _viewport_ is a viewport to place the background in.
|
||||
def addBackgroundOrColoredPlane(sprites,planename,background,color,viewport=nil)
|
||||
def addBackgroundOrColoredPlane(sprites,planename,background,color,viewport = nil)
|
||||
bitmapName=pbResolveBitmap("Graphics/Pictures/#{background}")
|
||||
if bitmapName==nil
|
||||
# Plane should exist in any case
|
||||
|
||||
@@ -75,7 +75,7 @@ class Window
|
||||
@_windowskin
|
||||
end
|
||||
|
||||
def initialize(viewport=nil)
|
||||
def initialize(viewport = nil)
|
||||
@sprites={}
|
||||
@spritekeys=[
|
||||
"back",
|
||||
@@ -345,7 +345,7 @@ class Window
|
||||
end
|
||||
end
|
||||
|
||||
def privRefresh(changeBitmap=false)
|
||||
def privRefresh(changeBitmap = false)
|
||||
return if self.disposed?
|
||||
backopac=self.back_opacity*self.opacity/255
|
||||
contopac=self.contents_opacity
|
||||
|
||||
@@ -52,7 +52,7 @@ class SpriteWindow < Window
|
||||
privRefresh(true)
|
||||
end
|
||||
|
||||
def initialize(viewport=nil)
|
||||
def initialize(viewport = nil)
|
||||
@sprites={}
|
||||
@spritekeys=[
|
||||
"back",
|
||||
@@ -474,7 +474,7 @@ class SpriteWindow < Window
|
||||
@sprites["cursor"].opacity=cursoropac
|
||||
end
|
||||
|
||||
def privRefresh(changeBitmap=false)
|
||||
def privRefresh(changeBitmap = false)
|
||||
return if !self || self.disposed?
|
||||
backopac=self.back_opacity*self.opacity/255
|
||||
contopac=self.contents_opacity
|
||||
|
||||
@@ -25,7 +25,7 @@ class Window_UnformattedTextPokemon < SpriteWindow_Base
|
||||
refresh
|
||||
end
|
||||
|
||||
def initialize(text="")
|
||||
def initialize(text = "")
|
||||
super(0,0,33,33)
|
||||
self.contents=Bitmap.new(1,1)
|
||||
pbSetSystemFont(self.contents)
|
||||
@@ -37,7 +37,7 @@ class Window_UnformattedTextPokemon < SpriteWindow_Base
|
||||
resizeToFit(text)
|
||||
end
|
||||
|
||||
def self.newWithSize(text,x,y,width,height,viewport=nil)
|
||||
def self.newWithSize(text,x,y,width,height,viewport = nil)
|
||||
ret=self.new(text)
|
||||
ret.x=x
|
||||
ret.y=y
|
||||
@@ -56,7 +56,7 @@ class Window_UnformattedTextPokemon < SpriteWindow_Base
|
||||
return dims
|
||||
end
|
||||
|
||||
def setTextToFit(text,maxwidth=-1)
|
||||
def setTextToFit(text,maxwidth = -1)
|
||||
resizeToFit(text,maxwidth)
|
||||
self.text=text
|
||||
end
|
||||
@@ -118,7 +118,7 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base
|
||||
attr_accessor :letterbyletter
|
||||
attr_reader :waitcount
|
||||
|
||||
def initialize(text="")
|
||||
def initialize(text = "")
|
||||
@cursorMode = MessageConfig::CURSOR_POSITION
|
||||
@endOfText = nil
|
||||
@scrollstate = 0
|
||||
@@ -148,7 +148,7 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base
|
||||
@starting = false
|
||||
end
|
||||
|
||||
def self.newWithSize(text,x,y,width,height,viewport=nil)
|
||||
def self.newWithSize(text,x,y,width,height,viewport = nil)
|
||||
ret = self.new(text)
|
||||
ret.x = x
|
||||
ret.y = y
|
||||
@@ -210,7 +210,7 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base
|
||||
self.text = self.text if !@starting
|
||||
end
|
||||
|
||||
def resizeToFit(text,maxwidth=-1)
|
||||
def resizeToFit(text,maxwidth = -1)
|
||||
dims = resizeToFitInternal(text,maxwidth)
|
||||
oldstarting = @starting
|
||||
@starting = true
|
||||
@@ -242,7 +242,7 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base
|
||||
return dims
|
||||
end
|
||||
|
||||
def resizeHeightToFit(text,width=-1)
|
||||
def resizeHeightToFit(text,width = -1)
|
||||
dims = resizeToFitInternal(text,width)
|
||||
oldstarting = @starting
|
||||
@starting = true
|
||||
@@ -252,7 +252,7 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base
|
||||
redrawText
|
||||
end
|
||||
|
||||
def setSkin(skin,redrawText=true)
|
||||
def setSkin(skin,redrawText = true)
|
||||
super(skin)
|
||||
privRefresh(true)
|
||||
oldbaser = @baseColor.red
|
||||
@@ -275,7 +275,7 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base
|
||||
end
|
||||
end
|
||||
|
||||
def setTextToFit(text,maxwidth=-1)
|
||||
def setTextToFit(text,maxwidth = -1)
|
||||
resizeToFit(text,maxwidth)
|
||||
self.text = text
|
||||
end
|
||||
@@ -913,7 +913,7 @@ class SpriteWindow_Selectable < SpriteWindow_Base
|
||||
return (self.height - self.borderY) / @row_height * @column_max
|
||||
end
|
||||
|
||||
def priv_update_cursor_rect(force=false)
|
||||
def priv_update_cursor_rect(force = false)
|
||||
if @index < 0
|
||||
self.cursor_rect.empty
|
||||
self.refresh
|
||||
@@ -1040,7 +1040,7 @@ class Window_DrawableCommand < SpriteWindow_SelectableEx
|
||||
attr_reader :baseColor
|
||||
attr_reader :shadowColor
|
||||
|
||||
def initialize(x,y,width,height,viewport=nil)
|
||||
def initialize(x,y,width,height,viewport = nil)
|
||||
super(x,y,width,height)
|
||||
self.viewport = viewport if viewport
|
||||
if isDarkWindowskin(self.windowskin)
|
||||
@@ -1076,7 +1076,7 @@ class Window_DrawableCommand < SpriteWindow_SelectableEx
|
||||
return bitmap.text_size(text).width
|
||||
end
|
||||
|
||||
def getAutoDims(commands,dims,width=nil)
|
||||
def getAutoDims(commands,dims,width = nil)
|
||||
rowMax = ((commands.length + self.columns - 1) / self.columns).to_i
|
||||
windowheight = (rowMax*self.rowHeight)
|
||||
windowheight += self.borderY
|
||||
@@ -1146,7 +1146,7 @@ end
|
||||
class Window_CommandPokemon < Window_DrawableCommand
|
||||
attr_reader :commands
|
||||
|
||||
def initialize(commands,width=nil)
|
||||
def initialize(commands,width = nil)
|
||||
@starting=true
|
||||
@commands=[]
|
||||
dims=[]
|
||||
@@ -1163,7 +1163,7 @@ class Window_CommandPokemon < Window_DrawableCommand
|
||||
@starting=false
|
||||
end
|
||||
|
||||
def self.newWithSize(commands,x,y,width,height,viewport=nil)
|
||||
def self.newWithSize(commands,x,y,width,height,viewport = nil)
|
||||
ret=self.new(commands,width)
|
||||
ret.x=x
|
||||
ret.y=y
|
||||
@@ -1173,7 +1173,7 @@ class Window_CommandPokemon < Window_DrawableCommand
|
||||
return ret
|
||||
end
|
||||
|
||||
def self.newEmpty(x,y,width,height,viewport=nil)
|
||||
def self.newEmpty(x,y,width,height,viewport = nil)
|
||||
ret=self.new([],width)
|
||||
ret.x=x
|
||||
ret.y=y
|
||||
@@ -1211,7 +1211,7 @@ class Window_CommandPokemon < Window_DrawableCommand
|
||||
end
|
||||
end
|
||||
|
||||
def resizeToFit(commands,width=nil)
|
||||
def resizeToFit(commands,width = nil)
|
||||
dims=[]
|
||||
getAutoDims(commands,dims,width)
|
||||
self.width=dims[0]
|
||||
@@ -1258,7 +1258,7 @@ class Window_AdvancedCommandPokemon < Window_DrawableCommand
|
||||
return dims[1]-dims[0]
|
||||
end
|
||||
|
||||
def initialize(commands,width=nil)
|
||||
def initialize(commands,width = nil)
|
||||
@starting=true
|
||||
@commands=[]
|
||||
dims=[]
|
||||
@@ -1275,7 +1275,7 @@ class Window_AdvancedCommandPokemon < Window_DrawableCommand
|
||||
@starting=false
|
||||
end
|
||||
|
||||
def self.newWithSize(commands,x,y,width,height,viewport=nil)
|
||||
def self.newWithSize(commands,x,y,width,height,viewport = nil)
|
||||
ret=self.new(commands,width)
|
||||
ret.x=x
|
||||
ret.y=y
|
||||
@@ -1285,7 +1285,7 @@ class Window_AdvancedCommandPokemon < Window_DrawableCommand
|
||||
return ret
|
||||
end
|
||||
|
||||
def self.newEmpty(x,y,width,height,viewport=nil)
|
||||
def self.newEmpty(x,y,width,height,viewport = nil)
|
||||
ret=self.new([],width)
|
||||
ret.x=x
|
||||
ret.y=y
|
||||
@@ -1325,7 +1325,7 @@ class Window_AdvancedCommandPokemon < Window_DrawableCommand
|
||||
end
|
||||
end
|
||||
|
||||
def resizeToFit(commands,width=nil)
|
||||
def resizeToFit(commands,width = nil)
|
||||
dims=[]
|
||||
getAutoDims(commands,dims,width)
|
||||
self.width=dims[0]
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
class IconWindow < SpriteWindow_Base
|
||||
attr_reader :name
|
||||
|
||||
def initialize(x,y,width,height,viewport=nil)
|
||||
def initialize(x,y,width,height,viewport = nil)
|
||||
super(x,y,width,height)
|
||||
self.viewport=viewport
|
||||
self.contents=nil
|
||||
@@ -37,7 +37,7 @@ class IconWindow < SpriteWindow_Base
|
||||
end
|
||||
|
||||
# Sets the icon's filename.
|
||||
def setBitmap(file,hue=0)
|
||||
def setBitmap(file,hue = 0)
|
||||
clearBitmaps()
|
||||
@name=file
|
||||
return if file==nil
|
||||
@@ -91,7 +91,7 @@ class PictureWindow < SpriteWindow_Base
|
||||
|
||||
# Sets the icon's bitmap or filename. (hue parameter
|
||||
# is ignored unless pathOrBitmap is a filename)
|
||||
def setBitmap(pathOrBitmap,hue=0)
|
||||
def setBitmap(pathOrBitmap,hue = 0)
|
||||
clearBitmaps()
|
||||
if pathOrBitmap!=nil && pathOrBitmap!=""
|
||||
if pathOrBitmap.is_a?(Bitmap)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# SpriteWrapper is a class which wraps (most of) Sprite's properties.
|
||||
#===============================================================================
|
||||
class SpriteWrapper
|
||||
def initialize(viewport=nil)
|
||||
def initialize(viewport = nil)
|
||||
@sprite = Sprite.new(viewport)
|
||||
end
|
||||
|
||||
@@ -94,7 +94,7 @@ end
|
||||
# This bitmap can't be changed to a different one.
|
||||
#===============================================================================
|
||||
class BitmapSprite < SpriteWrapper
|
||||
def initialize(width,height,viewport=nil)
|
||||
def initialize(width,height,viewport = nil)
|
||||
super(viewport)
|
||||
self.bitmap=Bitmap.new(width,height)
|
||||
@initialized=true
|
||||
@@ -190,7 +190,7 @@ class AnimatedSprite < SpriteWrapper
|
||||
end
|
||||
end
|
||||
|
||||
def self.create(animname,framecount,frameskip,viewport=nil)
|
||||
def self.create(animname,framecount,frameskip,viewport = nil)
|
||||
return self.new([animname,framecount,frameskip,viewport])
|
||||
end
|
||||
|
||||
@@ -275,7 +275,7 @@ class IconSprite < SpriteWrapper
|
||||
end
|
||||
|
||||
# Sets the icon's filename.
|
||||
def setBitmap(file,hue=0)
|
||||
def setBitmap(file,hue = 0)
|
||||
oldrc=self.src_rect
|
||||
clearBitmaps()
|
||||
@name=file
|
||||
@@ -326,7 +326,7 @@ end
|
||||
# SpriteWrapper that stores multiple bitmaps, and displays only one at once.
|
||||
#===============================================================================
|
||||
class ChangelingSprite < SpriteWrapper
|
||||
def initialize(x=0,y=0,viewport=nil)
|
||||
def initialize(x = 0,y = 0,viewport = nil)
|
||||
super(viewport)
|
||||
self.x = x
|
||||
self.y = y
|
||||
|
||||
@@ -225,14 +225,14 @@ def pbGetTileBitmap(filename, tile_id, hue, width = 1, height = 1)
|
||||
}
|
||||
end
|
||||
|
||||
def pbGetTileset(name,hue=0)
|
||||
def pbGetTileset(name,hue = 0)
|
||||
return AnimatedBitmap.new("Graphics/Tilesets/" + name, hue).deanimate
|
||||
end
|
||||
|
||||
def pbGetAutotile(name,hue=0)
|
||||
def pbGetAutotile(name,hue = 0)
|
||||
return AnimatedBitmap.new("Graphics/Autotiles/" + name, hue).deanimate
|
||||
end
|
||||
|
||||
def pbGetAnimation(name,hue=0)
|
||||
def pbGetAnimation(name,hue = 0)
|
||||
return AnimatedBitmap.new("Graphics/Animations/" + name, hue).deanimate
|
||||
end
|
||||
|
||||
@@ -157,7 +157,7 @@ def itemIconTag(item)
|
||||
end
|
||||
|
||||
def getFormattedTextForDims(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight,
|
||||
newlineBreaks=true,explicitBreaksOnly=false)
|
||||
newlineBreaks = true,explicitBreaksOnly = false)
|
||||
text2=text.gsub(/<(\/?)(c|c2|c3|o|u|s)(\s*\=\s*([^>]*))?>/i,"")
|
||||
if newlineBreaks
|
||||
text2.gsub!(/<(\/?)(br)(\s*\=\s*([^>]*))?>/i,"\n")
|
||||
@@ -169,7 +169,7 @@ def getFormattedTextForDims(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight,
|
||||
end
|
||||
|
||||
def getFormattedTextFast(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight,
|
||||
newlineBreaks=true,explicitBreaksOnly=false)
|
||||
newlineBreaks = true,explicitBreaksOnly = false)
|
||||
x=y=0
|
||||
characters=[]
|
||||
textchunks=[]
|
||||
@@ -385,9 +385,9 @@ To draw the characters, pass the returned array to the
|
||||
_drawFormattedChars_ function.
|
||||
=end
|
||||
|
||||
def getFormattedText(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight=32,
|
||||
newlineBreaks=true,explicitBreaksOnly=false,
|
||||
collapseAlignments=false)
|
||||
def getFormattedText(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight = 32,
|
||||
newlineBreaks = true,explicitBreaksOnly = false,
|
||||
collapseAlignments = false)
|
||||
dummybitmap=nil
|
||||
if !bitmap || bitmap.disposed? # allows function to be called with nil bitmap
|
||||
dummybitmap=Bitmap.new(1,1)
|
||||
@@ -908,7 +908,7 @@ def getLineBrokenText(bitmap,value,width,dims)
|
||||
return ret
|
||||
end
|
||||
|
||||
def getLineBrokenChunks(bitmap,value,width,dims,plain=false)
|
||||
def getLineBrokenChunks(bitmap,value,width,dims,plain = false)
|
||||
x=0
|
||||
y=0
|
||||
ret=[]
|
||||
@@ -962,7 +962,7 @@ def getLineBrokenChunks(bitmap,value,width,dims,plain=false)
|
||||
return ret
|
||||
end
|
||||
|
||||
def renderLineBrokenChunks(bitmap,xDst,yDst,normtext,maxheight=0)
|
||||
def renderLineBrokenChunks(bitmap,xDst,yDst,normtext,maxheight = 0)
|
||||
for i in 0...normtext.length
|
||||
width=normtext[i][3]
|
||||
textx=normtext[i][1]+xDst
|
||||
@@ -1094,7 +1094,7 @@ def drawTextEx(bitmap,x,y,width,numlines,text,baseColor,shadowColor)
|
||||
baseColor,shadowColor)
|
||||
end
|
||||
|
||||
def drawFormattedTextEx(bitmap,x,y,width,text,baseColor=nil,shadowColor=nil,lineheight=32)
|
||||
def drawFormattedTextEx(bitmap,x,y,width,text,baseColor = nil,shadowColor = nil,lineheight = 32)
|
||||
base=!baseColor ? Color.new(12*8,12*8,12*8) : baseColor.clone
|
||||
shadow=!shadowColor ? Color.new(26*8,26*8,25*8) : shadowColor.clone
|
||||
text="<c2="+colorToRgb16(base)+colorToRgb16(shadow)+">"+text
|
||||
@@ -1108,7 +1108,7 @@ def pbDrawShadow(bitmap,x,y,width,height,string)
|
||||
pbDrawShadowText(bitmap,x,y,width,height,string,nil,bitmap.font.color)
|
||||
end
|
||||
|
||||
def pbDrawShadowText(bitmap,x,y,width,height,string,baseColor,shadowColor=nil,align=0)
|
||||
def pbDrawShadowText(bitmap,x,y,width,height,string,baseColor,shadowColor = nil,align = 0)
|
||||
return if !bitmap || !string
|
||||
width=(width<0) ? bitmap.text_size(string).width+1 : width
|
||||
height=(height<0) ? bitmap.text_size(string).height+1 : height
|
||||
@@ -1125,7 +1125,7 @@ def pbDrawShadowText(bitmap,x,y,width,height,string,baseColor,shadowColor=nil,al
|
||||
end
|
||||
end
|
||||
|
||||
def pbDrawOutlineText(bitmap,x,y,width,height,string,baseColor,shadowColor=nil,align=0)
|
||||
def pbDrawOutlineText(bitmap,x,y,width,height,string,baseColor,shadowColor = nil,align = 0)
|
||||
return if !bitmap || !string
|
||||
width=(width<0) ? bitmap.text_size(string).width+4 : width
|
||||
height=(height<0) ? bitmap.text_size(string).height+4 : height
|
||||
@@ -1179,7 +1179,7 @@ end
|
||||
#===============================================================================
|
||||
# Draw images on a bitmap
|
||||
#===============================================================================
|
||||
def pbCopyBitmap(dstbm,srcbm,x,y,opacity=255)
|
||||
def pbCopyBitmap(dstbm,srcbm,x,y,opacity = 255)
|
||||
rc = Rect.new(0,0,srcbm.width,srcbm.height)
|
||||
dstbm.blt(x,y,srcbm,rc,opacity)
|
||||
end
|
||||
|
||||
@@ -376,7 +376,7 @@ end
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
def pbCreateStatusWindow(viewport=nil)
|
||||
def pbCreateStatusWindow(viewport = nil)
|
||||
msgwindow=Window_AdvancedTextPokemon.new("")
|
||||
if !viewport
|
||||
msgwindow.z=99999
|
||||
@@ -391,7 +391,7 @@ def pbCreateStatusWindow(viewport=nil)
|
||||
return msgwindow
|
||||
end
|
||||
|
||||
def pbCreateMessageWindow(viewport=nil,skin=nil)
|
||||
def pbCreateMessageWindow(viewport = nil,skin = nil)
|
||||
msgwindow=Window_AdvancedTextPokemon.new("")
|
||||
if !viewport
|
||||
msgwindow.z=99999
|
||||
@@ -418,7 +418,7 @@ end
|
||||
#===============================================================================
|
||||
# Main message-displaying function
|
||||
#===============================================================================
|
||||
def pbMessageDisplay(msgwindow,message,letterbyletter=true,commandProc=nil)
|
||||
def pbMessageDisplay(msgwindow,message,letterbyletter = true,commandProc = nil)
|
||||
return if !msgwindow
|
||||
oldletterbyletter=msgwindow.letterbyletter
|
||||
msgwindow.letterbyletter=(letterbyletter) ? true : false
|
||||
@@ -708,7 +708,7 @@ end
|
||||
#===============================================================================
|
||||
# Message-displaying functions
|
||||
#===============================================================================
|
||||
def pbMessage(message,commands=nil,cmdIfCancel=0,skin=nil,defaultCmd=0,&block)
|
||||
def pbMessage(message,commands = nil,cmdIfCancel = 0,skin = nil,defaultCmd = 0,&block)
|
||||
ret = 0
|
||||
msgwindow = pbCreateMessageWindow(nil,skin)
|
||||
if commands
|
||||
@@ -742,7 +742,7 @@ def pbMessageChooseNumber(message,params,&block)
|
||||
return ret
|
||||
end
|
||||
|
||||
def pbShowCommands(msgwindow,commands=nil,cmdIfCancel=0,defaultCmd=0)
|
||||
def pbShowCommands(msgwindow,commands = nil,cmdIfCancel = 0,defaultCmd = 0)
|
||||
return 0 if !commands
|
||||
cmdwindow=Window_CommandPokemonEx.new(commands)
|
||||
cmdwindow.z=99999
|
||||
@@ -778,7 +778,7 @@ def pbShowCommands(msgwindow,commands=nil,cmdIfCancel=0,defaultCmd=0)
|
||||
return ret
|
||||
end
|
||||
|
||||
def pbShowCommandsWithHelp(msgwindow,commands,help,cmdIfCancel=0,defaultCmd=0)
|
||||
def pbShowCommandsWithHelp(msgwindow,commands,help,cmdIfCancel = 0,defaultCmd = 0)
|
||||
msgwin=msgwindow
|
||||
msgwin=pbCreateMessageWindow(nil) if !msgwindow
|
||||
oldlbl=msgwin.letterbyletter
|
||||
@@ -828,7 +828,7 @@ def pbShowCommandsWithHelp(msgwindow,commands,help,cmdIfCancel=0,defaultCmd=0)
|
||||
end
|
||||
|
||||
# frames is the number of 1/20 seconds to wait for
|
||||
def pbMessageWaitForInput(msgwindow,frames,showPause=false)
|
||||
def pbMessageWaitForInput(msgwindow,frames,showPause = false)
|
||||
return if !frames || frames<=0
|
||||
msgwindow.startPause if msgwindow && showPause
|
||||
frames = frames*Graphics.frame_rate/20
|
||||
@@ -845,7 +845,7 @@ def pbMessageWaitForInput(msgwindow,frames,showPause=false)
|
||||
msgwindow.stopPause if msgwindow && showPause
|
||||
end
|
||||
|
||||
def pbFreeText(msgwindow,currenttext,passwordbox,maxlength,width=240)
|
||||
def pbFreeText(msgwindow,currenttext,passwordbox,maxlength,width = 240)
|
||||
window=Window_TextEntry_Keyboard.new(currenttext,0,0,width,64)
|
||||
ret=""
|
||||
window.maxlength=maxlength
|
||||
@@ -875,7 +875,7 @@ def pbFreeText(msgwindow,currenttext,passwordbox,maxlength,width=240)
|
||||
return ret
|
||||
end
|
||||
|
||||
def pbMessageFreeText(message,currenttext,passwordbox,maxlength,width=240,&block)
|
||||
def pbMessageFreeText(message,currenttext,passwordbox,maxlength,width = 240,&block)
|
||||
msgwindow=pbCreateMessageWindow
|
||||
retval=pbMessageDisplay(msgwindow,message,true,
|
||||
proc { |msgwindow|
|
||||
|
||||
@@ -87,7 +87,7 @@ end
|
||||
#
|
||||
#===============================================================================
|
||||
class Window_TextEntry < SpriteWindow_Base
|
||||
def initialize(text,x,y,width,height,heading=nil,usedarkercolor=false)
|
||||
def initialize(text,x,y,width,height,heading = nil,usedarkercolor = false)
|
||||
super(x,y,width,height)
|
||||
colors=getDefaultTextColors(self.windowskin)
|
||||
@baseColor=colors[0]
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# Exit is not called when game is reset (using F12)
|
||||
$AtExitProcs=[] if !$AtExitProcs
|
||||
|
||||
def exit(code=0)
|
||||
def exit(code = 0)
|
||||
for p in $AtExitProcs
|
||||
p.call
|
||||
end
|
||||
|
||||
@@ -21,7 +21,7 @@ end
|
||||
# filename:volume:pitch
|
||||
# volume -- Volume of the file, up to 100
|
||||
# pitch -- Pitch of the file, normally 100
|
||||
def pbResolveAudioFile(str,volume=nil,pitch=nil)
|
||||
def pbResolveAudioFile(str,volume = nil,pitch = nil)
|
||||
if str.is_a?(String)
|
||||
str = pbStringToAudioFile(str)
|
||||
str.volume = volume || 100
|
||||
@@ -49,7 +49,7 @@ end
|
||||
# filename:volume:pitch
|
||||
# volume -- Volume of the file, up to 100
|
||||
# pitch -- Pitch of the file, normally 100
|
||||
def pbBGMPlay(param,volume=nil,pitch=nil)
|
||||
def pbBGMPlay(param,volume = nil,pitch = nil)
|
||||
return if !param
|
||||
param=pbResolveAudioFile(param,volume,pitch)
|
||||
if param.name && param.name!=""
|
||||
@@ -68,10 +68,10 @@ def pbBGMPlay(param,volume=nil,pitch=nil)
|
||||
end
|
||||
|
||||
# Fades out or stops BGM playback. 'x' is the time in seconds to fade out.
|
||||
def pbBGMFade(x=0.0); pbBGMStop(x); end
|
||||
def pbBGMFade(x = 0.0); pbBGMStop(x); end
|
||||
|
||||
# Fades out or stops BGM playback. 'x' is the time in seconds to fade out.
|
||||
def pbBGMStop(timeInSeconds=0.0)
|
||||
def pbBGMStop(timeInSeconds = 0.0)
|
||||
if $game_system && timeInSeconds > 0.0
|
||||
$game_system.bgm_fade(timeInSeconds)
|
||||
return
|
||||
@@ -99,7 +99,7 @@ end
|
||||
# filename:volume:pitch
|
||||
# volume -- Volume of the file, up to 100
|
||||
# pitch -- Pitch of the file, normally 100
|
||||
def pbMEPlay(param,volume=nil,pitch=nil)
|
||||
def pbMEPlay(param,volume = nil,pitch = nil)
|
||||
return if !param
|
||||
param=pbResolveAudioFile(param,volume,pitch)
|
||||
if param.name && param.name!=""
|
||||
@@ -118,10 +118,10 @@ def pbMEPlay(param,volume=nil,pitch=nil)
|
||||
end
|
||||
|
||||
# Fades out or stops ME playback. 'x' is the time in seconds to fade out.
|
||||
def pbMEFade(x=0.0); pbMEStop(x); end
|
||||
def pbMEFade(x = 0.0); pbMEStop(x); end
|
||||
|
||||
# Fades out or stops ME playback. 'x' is the time in seconds to fade out.
|
||||
def pbMEStop(timeInSeconds=0.0)
|
||||
def pbMEStop(timeInSeconds = 0.0)
|
||||
if $game_system && timeInSeconds>0.0 && $game_system.respond_to?("me_fade")
|
||||
$game_system.me_fade(timeInSeconds)
|
||||
return
|
||||
@@ -149,7 +149,7 @@ end
|
||||
# filename:volume:pitch
|
||||
# volume -- Volume of the file, up to 100
|
||||
# pitch -- Pitch of the file, normally 100
|
||||
def pbBGSPlay(param,volume=nil,pitch=nil)
|
||||
def pbBGSPlay(param,volume = nil,pitch = nil)
|
||||
return if !param
|
||||
param=pbResolveAudioFile(param,volume,pitch)
|
||||
if param.name && param.name!=""
|
||||
@@ -168,10 +168,10 @@ def pbBGSPlay(param,volume=nil,pitch=nil)
|
||||
end
|
||||
|
||||
# Fades out or stops BGS playback. 'x' is the time in seconds to fade out.
|
||||
def pbBGSFade(x=0.0); pbBGSStop(x); end
|
||||
def pbBGSFade(x = 0.0); pbBGSStop(x); end
|
||||
|
||||
# Fades out or stops BGS playback. 'x' is the time in seconds to fade out.
|
||||
def pbBGSStop(timeInSeconds=0.0)
|
||||
def pbBGSStop(timeInSeconds = 0.0)
|
||||
if $game_system && timeInSeconds > 0.0
|
||||
$game_system.bgs_fade(timeInSeconds)
|
||||
return
|
||||
@@ -199,7 +199,7 @@ end
|
||||
# filename:volume:pitch
|
||||
# volume -- Volume of the file, up to 100
|
||||
# pitch -- Pitch of the file, normally 100
|
||||
def pbSEPlay(param,volume=nil,pitch=nil)
|
||||
def pbSEPlay(param,volume = nil,pitch = nil)
|
||||
return if !param
|
||||
param = pbResolveAudioFile(param,volume,pitch)
|
||||
if param.name && param.name!=""
|
||||
@@ -219,10 +219,10 @@ def pbSEPlay(param,volume=nil,pitch=nil)
|
||||
end
|
||||
|
||||
# Stops SE playback.
|
||||
def pbSEFade(x=0.0); pbSEStop(x); end
|
||||
def pbSEFade(x = 0.0); pbSEStop(x); end
|
||||
|
||||
# Stops SE playback.
|
||||
def pbSEStop(_timeInSeconds=0.0)
|
||||
def pbSEStop(_timeInSeconds = 0.0)
|
||||
if $game_system
|
||||
$game_system.se_stop
|
||||
elsif (RPG.const_defined?(:SE) rescue false)
|
||||
|
||||
@@ -52,7 +52,7 @@ end
|
||||
|
||||
|
||||
|
||||
def pbTextBitmap(text, maxwidth=Graphics.width)
|
||||
def pbTextBitmap(text, maxwidth = Graphics.width)
|
||||
tmp = Bitmap.new(maxwidth,Graphics.height)
|
||||
pbSetSystemFont(tmp)
|
||||
drawFormattedTextEx(tmp,0,0,maxwidth,text,Color.new(248,248,248),Color.new(168,184,184))
|
||||
@@ -67,7 +67,7 @@ end
|
||||
class EventScene
|
||||
attr_accessor :onCTrigger,:onBTrigger,:onUpdate
|
||||
|
||||
def initialize(viewport=nil)
|
||||
def initialize(viewport = nil)
|
||||
@viewport = viewport
|
||||
@onCTrigger = Event.new
|
||||
@onBTrigger = Event.new
|
||||
@@ -140,7 +140,7 @@ class EventScene
|
||||
frames.times { update }
|
||||
end
|
||||
|
||||
def pictureWait(extraframes=0)
|
||||
def pictureWait(extraframes = 0)
|
||||
loop do
|
||||
hasRunning = false
|
||||
for pic in @pictures
|
||||
|
||||
@@ -310,7 +310,7 @@ class Battle
|
||||
|
||||
# Returns the player's team in its display order. Used when showing the party
|
||||
# screen.
|
||||
def pbPlayerDisplayParty(idxBattler=0)
|
||||
def pbPlayerDisplayParty(idxBattler = 0)
|
||||
partyOrders = pbPartyOrder(idxBattler)
|
||||
idxStart, _idxEnd = pbTeamIndexRangeFromBattlerIndex(idxBattler)
|
||||
ret = []
|
||||
@@ -318,14 +318,14 @@ class Battle
|
||||
return ret
|
||||
end
|
||||
|
||||
def pbAbleCount(idxBattler=0)
|
||||
def pbAbleCount(idxBattler = 0)
|
||||
party = pbParty(idxBattler)
|
||||
count = 0
|
||||
party.each { |pkmn| count += 1 if pkmn && pkmn.able? }
|
||||
return count
|
||||
end
|
||||
|
||||
def pbAbleNonActiveCount(idxBattler=0)
|
||||
def pbAbleNonActiveCount(idxBattler = 0)
|
||||
party = pbParty(idxBattler)
|
||||
inBattleIndices = allSameSideBattlers(idxBattler).map { |b| b.pokemonIndex }
|
||||
count = 0
|
||||
@@ -337,7 +337,7 @@ class Battle
|
||||
return count
|
||||
end
|
||||
|
||||
def pbAllFainted?(idxBattler=0)
|
||||
def pbAllFainted?(idxBattler = 0)
|
||||
return pbAbleCount(idxBattler)==0
|
||||
end
|
||||
|
||||
@@ -442,7 +442,7 @@ class Battle
|
||||
end
|
||||
|
||||
# Unused
|
||||
def eachSameSideBattler(idxBattler=0)
|
||||
def eachSameSideBattler(idxBattler = 0)
|
||||
idxBattler = idxBattler.index if idxBattler.respond_to?("index")
|
||||
@battlers.each { |b| yield b if b && !b.fainted? && !b.opposes?(idxBattler) }
|
||||
end
|
||||
@@ -453,7 +453,7 @@ class Battle
|
||||
end
|
||||
|
||||
# Unused
|
||||
def eachOtherSideBattler(idxBattler=0)
|
||||
def eachOtherSideBattler(idxBattler = 0)
|
||||
idxBattler = idxBattler.index if idxBattler.respond_to?("index")
|
||||
@battlers.each { |b| yield b if b && !b.fainted? && b.opposes?(idxBattler) }
|
||||
end
|
||||
@@ -463,11 +463,11 @@ class Battle
|
||||
return @battlers.select { |b| b && !b.fainted? && b.opposes?(idxBattler) }
|
||||
end
|
||||
|
||||
def pbSideBattlerCount(idxBattler=0)
|
||||
def pbSideBattlerCount(idxBattler = 0)
|
||||
return allSameSideBattlers(idxBattler).length
|
||||
end
|
||||
|
||||
def pbOpposingBattlerCount(idxBattler=0)
|
||||
def pbOpposingBattlerCount(idxBattler = 0)
|
||||
return allOtherSideBattlers(idxBattler).length
|
||||
end
|
||||
|
||||
@@ -481,7 +481,7 @@ class Battle
|
||||
return nil
|
||||
end
|
||||
|
||||
def pbCheckOpposingAbility(abil,idxBattler=0,nearOnly=false)
|
||||
def pbCheckOpposingAbility(abil,idxBattler = 0,nearOnly = false)
|
||||
allOtherSideBattlers(idxBattler).each do |b|
|
||||
next if nearOnly && !b.near?(idxBattler)
|
||||
return b if b.hasActiveAbility?(abil)
|
||||
@@ -536,7 +536,7 @@ class Battle
|
||||
#=============================================================================
|
||||
# Comparing the positions of two battlers
|
||||
#=============================================================================
|
||||
def opposes?(idxBattler1,idxBattler2=0)
|
||||
def opposes?(idxBattler1,idxBattler2 = 0)
|
||||
idxBattler1 = idxBattler1.index if idxBattler1.respond_to?("index")
|
||||
idxBattler2 = idxBattler2.index if idxBattler2.respond_to?("index")
|
||||
return (idxBattler1&1)!=(idxBattler2&1)
|
||||
@@ -631,7 +631,7 @@ class Battle
|
||||
#=============================================================================
|
||||
# Returns the battler representing the Pokémon at index idxParty in its party,
|
||||
# on the same side as a battler with battler index of idxBattlerOther.
|
||||
def pbFindBattler(idxParty,idxBattlerOther=0)
|
||||
def pbFindBattler(idxParty,idxBattlerOther = 0)
|
||||
allSameSideBattlers(idxBattlerOther).each { |b| return b if b.pokemonIndex==idxParty }
|
||||
return nil
|
||||
end
|
||||
@@ -696,7 +696,7 @@ class Battle
|
||||
end
|
||||
|
||||
# Used for causing weather by a move or by an ability.
|
||||
def pbStartWeather(user,newWeather,fixedDuration=false,showAnim=true)
|
||||
def pbStartWeather(user,newWeather,fixedDuration = false,showAnim = true)
|
||||
return if @field.weather==newWeather
|
||||
@field.weather = newWeather
|
||||
duration = (fixedDuration) ? 5 : -1
|
||||
@@ -774,7 +774,7 @@ class Battle
|
||||
@field.terrainDuration = -1
|
||||
end
|
||||
|
||||
def pbStartTerrain(user,newTerrain,fixedDuration=true)
|
||||
def pbStartTerrain(user,newTerrain,fixedDuration = true)
|
||||
return if @field.terrain==newTerrain
|
||||
@field.terrain = newTerrain
|
||||
duration = (fixedDuration) ? 5 : -1
|
||||
@@ -820,19 +820,19 @@ class Battle
|
||||
return @scene.pbDisplayConfirmMessage(msg)
|
||||
end
|
||||
|
||||
def pbShowCommands(msg,commands,canCancel=true)
|
||||
def pbShowCommands(msg,commands,canCancel = true)
|
||||
@scene.pbShowCommands(msg,commands,canCancel)
|
||||
end
|
||||
|
||||
def pbAnimation(move,user,targets,hitNum=0)
|
||||
def pbAnimation(move,user,targets,hitNum = 0)
|
||||
@scene.pbAnimation(move,user,targets,hitNum) if @showAnims
|
||||
end
|
||||
|
||||
def pbCommonAnimation(name,user=nil,targets=nil)
|
||||
def pbCommonAnimation(name,user = nil,targets = nil)
|
||||
@scene.pbCommonAnimation(name,user,targets) if @showAnims
|
||||
end
|
||||
|
||||
def pbShowAbilitySplash(battler,delay=false,logTrigger=true)
|
||||
def pbShowAbilitySplash(battler,delay = false,logTrigger = true)
|
||||
PBDebug.log("[Ability triggered] #{battler.pbThis}'s #{battler.abilityName}") if logTrigger
|
||||
return if !Scene::USE_ABILITY_SPLASH
|
||||
@scene.pbShowAbilitySplash(battler)
|
||||
|
||||
@@ -491,7 +491,7 @@ class Battle
|
||||
#=============================================================================
|
||||
# Judging
|
||||
#=============================================================================
|
||||
def pbJudgeCheckpoint(user,move=nil); end
|
||||
def pbJudgeCheckpoint(user,move = nil); end
|
||||
|
||||
def pbDecisionOnTime
|
||||
counts = [0,0]
|
||||
|
||||
@@ -89,7 +89,7 @@ class Battle
|
||||
end
|
||||
end
|
||||
|
||||
def pbGainExpOne(idxParty,defeatedBattler,numPartic,expShare,expAll,showMessages=true)
|
||||
def pbGainExpOne(idxParty,defeatedBattler,numPartic,expShare,expAll,showMessages = true)
|
||||
pkmn = pbParty(0)[idxParty] # The Pokémon gaining Exp from defeatedBattler
|
||||
growth_rate = pkmn.growth_rate
|
||||
# Don't bother calculating if gainer is already at max Exp
|
||||
|
||||
@@ -2,7 +2,7 @@ class Battle
|
||||
#=============================================================================
|
||||
# Choosing a move/target
|
||||
#=============================================================================
|
||||
def pbCanChooseMove?(idxBattler,idxMove,showMessages,sleepTalk=false)
|
||||
def pbCanChooseMove?(idxBattler,idxMove,showMessages,sleepTalk = false)
|
||||
battler = @battlers[idxBattler]
|
||||
move = battler.moves[idxMove]
|
||||
return false unless move
|
||||
@@ -17,7 +17,7 @@ class Battle
|
||||
return battler.pbCanChooseMove?(move,true,showMessages,sleepTalk)
|
||||
end
|
||||
|
||||
def pbCanChooseAnyMove?(idxBattler,sleepTalk=false)
|
||||
def pbCanChooseAnyMove?(idxBattler,sleepTalk = false)
|
||||
battler = @battlers[idxBattler]
|
||||
battler.eachMoveWithIndex do |m,i|
|
||||
next if m.pp==0 && m.total_pp>0 && !sleepTalk
|
||||
@@ -33,7 +33,7 @@ class Battle
|
||||
|
||||
# Called when the Pokémon is Encored, or if it can't use any of its moves.
|
||||
# Makes the Pokémon use the Encored move (if Encored), or Struggle.
|
||||
def pbAutoChooseMove(idxBattler,showMessages=true)
|
||||
def pbAutoChooseMove(idxBattler,showMessages = true)
|
||||
battler = @battlers[idxBattler]
|
||||
if battler.fainted?
|
||||
pbClearChoice(idxBattler)
|
||||
@@ -67,7 +67,7 @@ class Battle
|
||||
return true
|
||||
end
|
||||
|
||||
def pbRegisterMove(idxBattler,idxMove,showMessages=true)
|
||||
def pbRegisterMove(idxBattler,idxMove,showMessages = true)
|
||||
battler = @battlers[idxBattler]
|
||||
move = battler.moves[idxMove]
|
||||
return false if !pbCanChooseMove?(idxBattler,idxMove,showMessages)
|
||||
@@ -133,7 +133,7 @@ class Battle
|
||||
#=============================================================================
|
||||
# Turn order calculation (priority)
|
||||
#=============================================================================
|
||||
def pbCalculatePriority(fullCalc=false,indexArray=nil)
|
||||
def pbCalculatePriority(fullCalc = false,indexArray = nil)
|
||||
needRearranging = false
|
||||
if fullCalc
|
||||
@priorityTrickRoom = (@field.effects[PBEffects::TrickRoom]>0)
|
||||
@@ -231,7 +231,7 @@ class Battle
|
||||
end
|
||||
end
|
||||
|
||||
def pbPriority(onlySpeedSort=false)
|
||||
def pbPriority(onlySpeedSort = false)
|
||||
ret = []
|
||||
if onlySpeedSort
|
||||
# Sort battlers by their speed stats and tie-breaker order only.
|
||||
|
||||
@@ -6,7 +6,7 @@ class Battle
|
||||
# battle.
|
||||
# NOTE: Messages are only shown while in the party screen when choosing a
|
||||
# command for the next round.
|
||||
def pbCanSwitchLax?(idxBattler,idxParty,partyScene=nil)
|
||||
def pbCanSwitchLax?(idxBattler,idxParty,partyScene = nil)
|
||||
return true if idxParty<0
|
||||
party = pbParty(idxBattler)
|
||||
return false if idxParty>=party.length
|
||||
@@ -40,7 +40,7 @@ class Battle
|
||||
# switch out (and that its replacement at party index idxParty can switch in).
|
||||
# NOTE: Messages are only shown while in the party screen when choosing a
|
||||
# command for the next round.
|
||||
def pbCanSwitch?(idxBattler,idxParty=-1,partyScene=nil)
|
||||
def pbCanSwitch?(idxBattler,idxParty = -1,partyScene = nil)
|
||||
# Check whether party Pokémon can switch in
|
||||
return false if !pbCanSwitchLax?(idxBattler,idxParty,partyScene)
|
||||
# Make sure another battler isn't already choosing to switch to the party
|
||||
@@ -113,7 +113,7 @@ class Battle
|
||||
#=============================================================================
|
||||
# Open party screen and potentially choose a Pokémon to switch with. Used in
|
||||
# all instances where the party screen is opened.
|
||||
def pbPartyScreen(idxBattler,checkLaxOnly=false,canCancel=false,shouldRegister=false)
|
||||
def pbPartyScreen(idxBattler,checkLaxOnly = false,canCancel = false,shouldRegister = false)
|
||||
ret = -1
|
||||
@scene.pbPartyScreen(idxBattler,canCancel) { |idxParty,partyScene|
|
||||
if checkLaxOnly
|
||||
@@ -132,7 +132,7 @@ class Battle
|
||||
|
||||
# For choosing a replacement Pokémon when prompted in the middle of other
|
||||
# things happening (U-turn, Baton Pass, in def pbEORSwitch).
|
||||
def pbSwitchInBetween(idxBattler,checkLaxOnly=false,canCancel=false)
|
||||
def pbSwitchInBetween(idxBattler,checkLaxOnly = false,canCancel = false)
|
||||
return pbPartyScreen(idxBattler,checkLaxOnly,canCancel) if pbOwnedByPlayer?(idxBattler)
|
||||
return @battleAI.pbDefaultChooseNewEnemy(idxBattler,pbParty(idxBattler))
|
||||
end
|
||||
@@ -142,7 +142,7 @@ class Battle
|
||||
#=============================================================================
|
||||
# General switching method that checks if any Pokémon need to be sent out and,
|
||||
# if so, does. Called at the end of each round.
|
||||
def pbEORSwitch(favorDraws=false)
|
||||
def pbEORSwitch(favorDraws = false)
|
||||
return if @decision>0 && !favorDraws
|
||||
return if @decision==5 && favorDraws
|
||||
pbJudge
|
||||
@@ -206,7 +206,7 @@ class Battle
|
||||
end
|
||||
end
|
||||
|
||||
def pbGetReplacementPokemonIndex(idxBattler,random=false)
|
||||
def pbGetReplacementPokemonIndex(idxBattler,random = false)
|
||||
if random
|
||||
choices = [] # Find all Pokémon that can switch in
|
||||
eachInTeamFromBattlerIndex(idxBattler) do |_pkmn,i|
|
||||
@@ -220,7 +220,7 @@ class Battle
|
||||
end
|
||||
|
||||
# Actually performs the recalling and sending out in all situations.
|
||||
def pbRecallAndReplace(idxBattler,idxParty,randomReplacement=false,batonPass=false)
|
||||
def pbRecallAndReplace(idxBattler,idxParty,randomReplacement = false,batonPass = false)
|
||||
@scene.pbRecall(idxBattler) if !@battlers[idxBattler].fainted?
|
||||
@battlers[idxBattler].pbAbilitiesOnSwitchOut # Inc. primordial weather check
|
||||
@scene.pbShowPartyLineup(idxBattler&1) if pbSideSize(idxBattler)==1
|
||||
@@ -274,7 +274,7 @@ class Battle
|
||||
|
||||
# Only called from def pbRecallAndReplace above and Battle Arena's def
|
||||
# pbSwitch.
|
||||
def pbReplace(idxBattler,idxParty,batonPass=false)
|
||||
def pbReplace(idxBattler,idxParty,batonPass = false)
|
||||
party = pbParty(idxBattler)
|
||||
idxPartyOld = @battlers[idxBattler].pokemonIndex
|
||||
# Initialise the new Pokémon
|
||||
@@ -289,7 +289,7 @@ class Battle
|
||||
|
||||
# Called from def pbReplace above and at the start of battle.
|
||||
# sendOuts is an array; each element is itself an array: [idxBattler,pkmn]
|
||||
def pbSendOut(sendOuts,startBattle=false)
|
||||
def pbSendOut(sendOuts,startBattle = false)
|
||||
sendOuts.each { |b| @peer.pbOnEnteringBattle(self, @battlers[b[0]], b[1]) }
|
||||
@scene.pbSendOutBattlers(sendOuts,startBattle)
|
||||
sendOuts.each do |b|
|
||||
|
||||
@@ -2,7 +2,7 @@ class Battle
|
||||
#=============================================================================
|
||||
# Choosing to use an item
|
||||
#=============================================================================
|
||||
def pbCanUseItemOnPokemon?(item,pkmn,battler,scene,showMessages=true)
|
||||
def pbCanUseItemOnPokemon?(item,pkmn,battler,scene,showMessages = true)
|
||||
if !pkmn || pkmn.egg?
|
||||
scene.pbDisplay(_INTL("It won't have any effect.")) if showMessages
|
||||
return false
|
||||
@@ -24,7 +24,7 @@ class Battle
|
||||
return false
|
||||
end
|
||||
|
||||
def pbRegisterItem(idxBattler,item,idxTarget=nil,idxMove=nil)
|
||||
def pbRegisterItem(idxBattler,item,idxTarget = nil,idxMove = nil)
|
||||
# Register for use of item on a Pokémon in the party
|
||||
@choices[idxBattler][0] = :UseItem
|
||||
@choices[idxBattler][1] = item # ID of item to be used
|
||||
|
||||
@@ -27,7 +27,7 @@ class Battle
|
||||
# 1: Succeeded at fleeing, battle will end
|
||||
# duringBattle is true for replacing a fainted Pokémon during the End Of Round
|
||||
# phase, and false for choosing the Run command.
|
||||
def pbRun(idxBattler,duringBattle=false)
|
||||
def pbRun(idxBattler,duringBattle = false)
|
||||
battler = @battlers[idxBattler]
|
||||
if battler.opposes?
|
||||
return 0 if trainerBattle?
|
||||
|
||||
@@ -208,7 +208,7 @@ class Battle::Battler
|
||||
return (itm) ? itm.name : ""
|
||||
end
|
||||
|
||||
def pbThis(lowerCase=false)
|
||||
def pbThis(lowerCase = false)
|
||||
if opposes?
|
||||
if @battle.trainerBattle?
|
||||
return lowerCase ? _INTL("the opposing {1}",name) : _INTL("The opposing {1}",name)
|
||||
@@ -221,14 +221,14 @@ class Battle::Battler
|
||||
return name
|
||||
end
|
||||
|
||||
def pbTeam(lowerCase=false)
|
||||
def pbTeam(lowerCase = false)
|
||||
if opposes?
|
||||
return lowerCase ? _INTL("the opposing team") : _INTL("The opposing team")
|
||||
end
|
||||
return lowerCase ? _INTL("your team") : _INTL("Your team")
|
||||
end
|
||||
|
||||
def pbOpposingTeam(lowerCase=false)
|
||||
def pbOpposingTeam(lowerCase = false)
|
||||
if opposes?
|
||||
return lowerCase ? _INTL("your team") : _INTL("Your team")
|
||||
end
|
||||
@@ -301,7 +301,7 @@ class Battle::Battler
|
||||
|
||||
# Returns the active types of this Pokémon. The array should not include the
|
||||
# same type more than once, and should not include any invalid types.
|
||||
def pbTypes(withType3=false)
|
||||
def pbTypes(withType3 = false)
|
||||
ret = @types.uniq
|
||||
# Burn Up erases the Fire-type.
|
||||
ret.delete(:FIRE) if @effects[PBEffects::BurnUp]
|
||||
@@ -413,7 +413,7 @@ class Battle::Battler
|
||||
return ability_blacklist.include?(abil.id)
|
||||
end
|
||||
|
||||
def itemActive?(ignoreFainted=false)
|
||||
def itemActive?(ignoreFainted = false)
|
||||
return false if fainted? && !ignoreFainted
|
||||
return false if @effects[PBEffects::Embargo]>0
|
||||
return false if @battle.field.effects[PBEffects::MagicRoom]>0
|
||||
@@ -509,7 +509,7 @@ class Battle::Battler
|
||||
return true
|
||||
end
|
||||
|
||||
def takesIndirectDamage?(showMsg=false)
|
||||
def takesIndirectDamage?(showMsg = false)
|
||||
return false if fainted?
|
||||
if hasActiveAbility?(:MAGICGUARD)
|
||||
if showMsg
|
||||
@@ -558,7 +558,7 @@ class Battle::Battler
|
||||
return ret
|
||||
end
|
||||
|
||||
def affectedByPowder?(showMsg=false)
|
||||
def affectedByPowder?(showMsg = false)
|
||||
return false if fainted?
|
||||
if pbHasType?(:GRASS) && Settings::MORE_TYPE_EFFECTS
|
||||
@battle.pbDisplay(_INTL("{1} is unaffected!",pbThis)) if showMsg
|
||||
@@ -593,7 +593,7 @@ class Battle::Battler
|
||||
return true
|
||||
end
|
||||
|
||||
def affectedByContactEffect?(showMsg=false)
|
||||
def affectedByContactEffect?(showMsg = false)
|
||||
return false if fainted?
|
||||
if hasActiveItem?(:PROTECTIVEPADS)
|
||||
@battle.pbDisplay(_INTL("{1} protected itself with the {2}!",pbThis,itemName)) if showMsg
|
||||
@@ -687,7 +687,7 @@ class Battle::Battler
|
||||
# Methods relating to this battler's position on the battlefield
|
||||
#=============================================================================
|
||||
# Returns whether the given position belongs to the opposing Pokémon's side.
|
||||
def opposes?(i=0)
|
||||
def opposes?(i = 0)
|
||||
i = i.index if i.respond_to?("index")
|
||||
return (@index&1)!=(i&1)
|
||||
end
|
||||
@@ -755,7 +755,7 @@ class Battle::Battler
|
||||
|
||||
# Returns the battler that is most directly opposite to self. unfaintedOnly is
|
||||
# whether it should prefer to return a non-fainted battler.
|
||||
def pbDirectOpposing(unfaintedOnly=false)
|
||||
def pbDirectOpposing(unfaintedOnly = false)
|
||||
@battle.pbGetOpposingIndicesInOrder(@index).each do |i|
|
||||
next if !@battle.battlers[i]
|
||||
break if unfaintedOnly && @battle.battlers[i].fainted?
|
||||
|
||||
@@ -57,7 +57,7 @@ class Battle::Battler
|
||||
@dummy = true
|
||||
end
|
||||
|
||||
def pbInitialize(pkmn,idxParty,batonPass=false)
|
||||
def pbInitialize(pkmn,idxParty,batonPass = false)
|
||||
pbInitPokemon(pkmn,idxParty)
|
||||
pbInitEffects(batonPass)
|
||||
@damageState.reset
|
||||
@@ -288,7 +288,7 @@ class Battle::Battler
|
||||
#=============================================================================
|
||||
# Refreshing a battler's properties
|
||||
#=============================================================================
|
||||
def pbUpdate(fullChange=false)
|
||||
def pbUpdate(fullChange = false)
|
||||
return if !@pokemon
|
||||
@pokemon.calc_stats
|
||||
@level = @pokemon.level
|
||||
|
||||
@@ -2,7 +2,7 @@ class Battle::Battler
|
||||
#=============================================================================
|
||||
# Change HP
|
||||
#=============================================================================
|
||||
def pbReduceHP(amt,anim=true,registerDamage=true,anyAnim=true)
|
||||
def pbReduceHP(amt,anim = true,registerDamage = true,anyAnim = true)
|
||||
amt = amt.round
|
||||
amt = @hp if amt>@hp
|
||||
amt = 1 if amt<1 && !fainted?
|
||||
@@ -19,7 +19,7 @@ class Battle::Battler
|
||||
return amt
|
||||
end
|
||||
|
||||
def pbRecoverHP(amt,anim=true,anyAnim=true)
|
||||
def pbRecoverHP(amt,anim = true,anyAnim = true)
|
||||
amt = amt.round
|
||||
amt = @totalhp-@hp if amt>@totalhp-@hp
|
||||
amt = 1 if amt<1 && @hp<@totalhp
|
||||
@@ -33,7 +33,7 @@ class Battle::Battler
|
||||
return amt
|
||||
end
|
||||
|
||||
def pbRecoverHPFromDrain(amt,target,msg=nil)
|
||||
def pbRecoverHPFromDrain(amt,target,msg = nil)
|
||||
if target.hasActiveAbility?(:LIQUIDOOZE)
|
||||
@battle.pbShowAbilitySplash(target)
|
||||
pbReduceHP(amt)
|
||||
@@ -60,7 +60,7 @@ class Battle::Battler
|
||||
@droppedBelowHalfHP = false
|
||||
end
|
||||
|
||||
def pbFaint(showMessage=true)
|
||||
def pbFaint(showMessage = true)
|
||||
if !fainted?
|
||||
PBDebug.log("!!!***Can't faint with HP greater than 0")
|
||||
return
|
||||
@@ -227,7 +227,7 @@ class Battle::Battler
|
||||
# Checks the Pokémon's form and updates it if necessary. Used for when a
|
||||
# Pokémon enters battle (endOfRound=false) and at the end of each round
|
||||
# (endOfRound=true).
|
||||
def pbCheckForm(endOfRound=false)
|
||||
def pbCheckForm(endOfRound = false)
|
||||
return if fainted? || @effects[PBEffects::Transform]
|
||||
# Form changes upon entering battle and when the weather changes
|
||||
pbCheckFormOnWeatherChange if !endOfRound
|
||||
|
||||
@@ -22,7 +22,7 @@ class Battle::Battler
|
||||
return @status != :NONE
|
||||
end
|
||||
|
||||
def pbCanInflictStatus?(newStatus,user,showMessages,move=nil,ignoreStatus=false)
|
||||
def pbCanInflictStatus?(newStatus,user,showMessages,move = nil,ignoreStatus = false)
|
||||
return false if fainted?
|
||||
selfInflicted = (user && user.index==@index)
|
||||
# Already have that status problem
|
||||
@@ -214,7 +214,7 @@ class Battle::Battler
|
||||
#=============================================================================
|
||||
# Generalised infliction of status problem
|
||||
#=============================================================================
|
||||
def pbInflictStatus(newStatus,newStatusCount=0,msg=nil,user=nil)
|
||||
def pbInflictStatus(newStatus,newStatusCount = 0,msg = nil,user = nil)
|
||||
# Inflict the new status
|
||||
self.status = newStatus
|
||||
self.statusCount = newStatusCount
|
||||
@@ -420,7 +420,7 @@ class Battle::Battler
|
||||
PBDebug.log("[Status continues] #{pbThis}'s sleep count is #{@statusCount}") if self.status == :SLEEP
|
||||
end
|
||||
|
||||
def pbCureStatus(showMessages=true)
|
||||
def pbCureStatus(showMessages = true)
|
||||
oldStatus = status
|
||||
self.status = :NONE
|
||||
if showMessages
|
||||
@@ -438,7 +438,7 @@ class Battle::Battler
|
||||
#=============================================================================
|
||||
# Confusion
|
||||
#=============================================================================
|
||||
def pbCanConfuse?(user=nil,showMessages=true,move=nil,selfInflicted=false)
|
||||
def pbCanConfuse?(user = nil,showMessages = true,move = nil,selfInflicted = false)
|
||||
return false if fainted?
|
||||
if @effects[PBEffects::Confusion]>0
|
||||
@battle.pbDisplay(_INTL("{1} is already confused.",pbThis)) if showMessages
|
||||
@@ -480,7 +480,7 @@ class Battle::Battler
|
||||
return pbCanConfuse?(nil,showMessages,nil,true)
|
||||
end
|
||||
|
||||
def pbConfuse(msg=nil)
|
||||
def pbConfuse(msg = nil)
|
||||
@effects[PBEffects::Confusion] = pbConfusionDuration
|
||||
@battle.pbCommonAnimation("Confusion",self)
|
||||
msg = _INTL("{1} became confused!",pbThis) if nil_or_empty?(msg)
|
||||
@@ -491,7 +491,7 @@ class Battle::Battler
|
||||
pbAbilityStatusCureCheck
|
||||
end
|
||||
|
||||
def pbConfusionDuration(duration=-1)
|
||||
def pbConfusionDuration(duration = -1)
|
||||
duration = 2+@battle.pbRandom(4) if duration<=0
|
||||
return duration
|
||||
end
|
||||
@@ -503,7 +503,7 @@ class Battle::Battler
|
||||
#=============================================================================
|
||||
# Attraction
|
||||
#=============================================================================
|
||||
def pbCanAttract?(user,showMessages=true)
|
||||
def pbCanAttract?(user,showMessages = true)
|
||||
return false if fainted?
|
||||
return false if !user || user.fainted?
|
||||
if @effects[PBEffects::Attract]>=0
|
||||
@@ -547,7 +547,7 @@ class Battle::Battler
|
||||
return true
|
||||
end
|
||||
|
||||
def pbAttract(user,msg=nil)
|
||||
def pbAttract(user,msg = nil)
|
||||
@effects[PBEffects::Attract] = user.index
|
||||
@battle.pbCommonAnimation("Attract",self)
|
||||
msg = _INTL("{1} fell in love!",pbThis) if nil_or_empty?(msg)
|
||||
@@ -568,7 +568,7 @@ class Battle::Battler
|
||||
#=============================================================================
|
||||
# Flinching
|
||||
#=============================================================================
|
||||
def pbFlinch(_user=nil)
|
||||
def pbFlinch(_user = nil)
|
||||
return if hasActiveAbility?(:INNERFOCUS) && !@battle.moldBreaker
|
||||
@effects[PBEffects::Flinch] = true
|
||||
end
|
||||
|
||||
@@ -6,7 +6,7 @@ class Battle::Battler
|
||||
return @stages[stat]>=6
|
||||
end
|
||||
|
||||
def pbCanRaiseStatStage?(stat,user=nil,move=nil,showFailMsg=false,ignoreContrary=false)
|
||||
def pbCanRaiseStatStage?(stat,user = nil,move = nil,showFailMsg = false,ignoreContrary = false)
|
||||
return false if fainted?
|
||||
# Contrary
|
||||
if hasActiveAbility?(:CONTRARY) && !ignoreContrary && !@battle.moldBreaker
|
||||
@@ -21,7 +21,7 @@ class Battle::Battler
|
||||
return true
|
||||
end
|
||||
|
||||
def pbRaiseStatStageBasic(stat,increment,ignoreContrary=false)
|
||||
def pbRaiseStatStageBasic(stat,increment,ignoreContrary = false)
|
||||
if !@battle.moldBreaker
|
||||
# Contrary
|
||||
if hasActiveAbility?(:CONTRARY) && !ignoreContrary
|
||||
@@ -42,7 +42,7 @@ class Battle::Battler
|
||||
return increment
|
||||
end
|
||||
|
||||
def pbRaiseStatStage(stat,increment,user,showAnim=true,ignoreContrary=false)
|
||||
def pbRaiseStatStage(stat,increment,user,showAnim = true,ignoreContrary = false)
|
||||
# Contrary
|
||||
if hasActiveAbility?(:CONTRARY) && !ignoreContrary && !@battle.moldBreaker
|
||||
return pbLowerStatStage(stat,increment,user,showAnim,true)
|
||||
@@ -65,7 +65,7 @@ class Battle::Battler
|
||||
return true
|
||||
end
|
||||
|
||||
def pbRaiseStatStageByCause(stat,increment,user,cause,showAnim=true,ignoreContrary=false)
|
||||
def pbRaiseStatStageByCause(stat,increment,user,cause,showAnim = true,ignoreContrary = false)
|
||||
# Contrary
|
||||
if hasActiveAbility?(:CONTRARY) && !ignoreContrary && !@battle.moldBreaker
|
||||
return pbLowerStatStageByCause(stat,increment,user,cause,showAnim,true)
|
||||
@@ -96,7 +96,7 @@ class Battle::Battler
|
||||
return true
|
||||
end
|
||||
|
||||
def pbRaiseStatStageByAbility(stat,increment,user,splashAnim=true)
|
||||
def pbRaiseStatStageByAbility(stat,increment,user,splashAnim = true)
|
||||
return false if fainted?
|
||||
ret = false
|
||||
@battle.pbShowAbilitySplash(user) if splashAnim
|
||||
@@ -163,7 +163,7 @@ class Battle::Battler
|
||||
return true
|
||||
end
|
||||
|
||||
def pbLowerStatStageBasic(stat,increment,ignoreContrary=false)
|
||||
def pbLowerStatStageBasic(stat,increment,ignoreContrary = false)
|
||||
if !@battle.moldBreaker
|
||||
# Contrary
|
||||
if hasActiveAbility?(:CONTRARY) && !ignoreContrary
|
||||
@@ -275,7 +275,7 @@ class Battle::Battler
|
||||
return true
|
||||
end
|
||||
|
||||
def pbLowerStatStageByAbility(stat,increment,user,splashAnim=true,checkContact=false)
|
||||
def pbLowerStatStageByAbility(stat,increment,user,splashAnim = true,checkContact = false)
|
||||
ret = false
|
||||
@battle.pbShowAbilitySplash(user) if splashAnim
|
||||
if pbCanLowerStatStage?(stat,user,nil,Battle::Scene::USE_ABILITY_SPLASH) &&
|
||||
|
||||
@@ -63,7 +63,7 @@ class Battle::Battler
|
||||
|
||||
# Called when a Pokémon (self) enters battle, at the end of each move used,
|
||||
# and at the end of each round.
|
||||
def pbContinualAbilityChecks(onSwitchIn=false)
|
||||
def pbContinualAbilityChecks(onSwitchIn = false)
|
||||
# Check for end of primordial weather
|
||||
@battle.pbEndPrimordialWeather
|
||||
# Trace
|
||||
@@ -227,7 +227,7 @@ class Battle::Battler
|
||||
self.item = nil
|
||||
end
|
||||
|
||||
def pbConsumeItem(recoverable=true,symbiosis=true,belch=true)
|
||||
def pbConsumeItem(recoverable = true,symbiosis = true,belch = true)
|
||||
PBDebug.log("[Item consumed] #{pbThis} consumed its held #{itemName}")
|
||||
if recoverable
|
||||
setRecycleItem(@item_id)
|
||||
|
||||
@@ -2,7 +2,7 @@ class Battle::Battler
|
||||
#=============================================================================
|
||||
# Turn processing
|
||||
#=============================================================================
|
||||
def pbProcessTurn(choice,tryFlee=true)
|
||||
def pbProcessTurn(choice,tryFlee = true)
|
||||
return false if fainted?
|
||||
# Wild roaming Pokémon always flee if possible
|
||||
if tryFlee && wild? &&
|
||||
@@ -144,7 +144,7 @@ class Battle::Battler
|
||||
# Simple "use move" method, used when a move calls another move and for Future
|
||||
# Sight's attack
|
||||
#=============================================================================
|
||||
def pbUseMoveSimple(moveID,target=-1,idxMove=-1,specialUsage=true)
|
||||
def pbUseMoveSimple(moveID,target = -1,idxMove = -1,specialUsage = true)
|
||||
choice = []
|
||||
choice[0] = :UseMove # "Use move"
|
||||
choice[1] = idxMove # Index of move to be used in user's moveset
|
||||
@@ -162,7 +162,7 @@ class Battle::Battler
|
||||
#=============================================================================
|
||||
# Master "use move" method
|
||||
#=============================================================================
|
||||
def pbUseMove(choice,specialUsage=false)
|
||||
def pbUseMove(choice,specialUsage = false)
|
||||
# NOTE: This is intentionally determined before a multi-turn attack can
|
||||
# set specialUsage to true.
|
||||
skipAccuracyCheck = (specialUsage && choice[2]!=@battle.struggle)
|
||||
|
||||
@@ -170,7 +170,7 @@ class Battle::Battler
|
||||
#=============================================================================
|
||||
# Register target
|
||||
#=============================================================================
|
||||
def pbAddTarget(targets,user,target,move,nearOnly=true,allowUser=false)
|
||||
def pbAddTarget(targets,user,target,move,nearOnly = true,allowUser = false)
|
||||
return false if !target || (target.fainted? && !move.targetsPosition?)
|
||||
return false if !allowUser && target == user
|
||||
return false if nearOnly && !user.near?(target) && target != user
|
||||
@@ -190,7 +190,7 @@ class Battle::Battler
|
||||
end
|
||||
end
|
||||
|
||||
def pbAddTargetRandomFoe(targets, user, move, nearOnly =true)
|
||||
def pbAddTargetRandomFoe(targets, user, move, nearOnly = true)
|
||||
choices = []
|
||||
user.allOpposing.each do |b|
|
||||
next if nearOnly && !user.near?(b)
|
||||
|
||||
@@ -7,7 +7,7 @@ class Battle::Battler
|
||||
# earlier in the same round (after choosing the command but before using the
|
||||
# move) or an unusable move may be called by another move such as Metronome.
|
||||
#=============================================================================
|
||||
def pbCanChooseMove?(move,commandPhase,showMessages=true,specialUsage=false)
|
||||
def pbCanChooseMove?(move,commandPhase,showMessages = true,specialUsage = false)
|
||||
# Disable
|
||||
if @effects[PBEffects::DisableMove]==move.id && !specialUsage
|
||||
if showMessages
|
||||
|
||||
@@ -74,7 +74,7 @@ class Battle::Move
|
||||
|
||||
# NOTE: This method is only ever called while using a move (and also by the
|
||||
# AI), so using @calcType here is acceptable.
|
||||
def physicalMove?(thisType=nil)
|
||||
def physicalMove?(thisType = nil)
|
||||
return (@category==0) if Settings::MOVE_CATEGORY_PER_MOVE
|
||||
thisType ||= @calcType
|
||||
thisType ||= @type
|
||||
@@ -84,7 +84,7 @@ class Battle::Move
|
||||
|
||||
# NOTE: This method is only ever called while using a move (and also by the
|
||||
# AI), so using @calcType here is acceptable.
|
||||
def specialMove?(thisType=nil)
|
||||
def specialMove?(thisType = nil)
|
||||
return (@category==1) if Settings::MOVE_CATEGORY_PER_MOVE
|
||||
thisType ||= @calcType
|
||||
thisType ||= @type
|
||||
@@ -134,7 +134,7 @@ class Battle::Move
|
||||
def danceMove?; return @flags.any? { |f| f[/^Dance$/i] }; end
|
||||
|
||||
# Causes perfect accuracy (param=1) and double damage (param=2).
|
||||
def tramplesMinimize?(_param=1); return false; end
|
||||
def tramplesMinimize?(_param = 1); return false; end
|
||||
def nonLethal?(_user,_target); return false; end # For False Swipe
|
||||
|
||||
def ignoresSubstitute?(user) # user is the Pokémon using this move
|
||||
|
||||
@@ -61,7 +61,7 @@ class Battle::Move
|
||||
def pbDesignateTargetsForHit(targets, hitNum); return targets; end # For Dragon Darts
|
||||
def pbRepeatHit?; return false; end # For Dragon Darts
|
||||
|
||||
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
|
||||
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
|
||||
return if !showAnimation
|
||||
if user.effects[PBEffects::ParentalBond]==1
|
||||
@battle.pbCommonAnimation("ParentalBond",user,targets)
|
||||
@@ -122,7 +122,7 @@ class Battle::Move
|
||||
return false
|
||||
end
|
||||
|
||||
def pbMoveFailedAromaVeil?(user,target,showMessage=true)
|
||||
def pbMoveFailedAromaVeil?(user,target,showMessage = true)
|
||||
return false if @battle.moldBreaker
|
||||
if target.hasActiveAbility?(:AROMAVEIL)
|
||||
if showMessage
|
||||
@@ -265,7 +265,7 @@ class Battle::Move
|
||||
#=============================================================================
|
||||
# Messages upon being hit
|
||||
#=============================================================================
|
||||
def pbEffectivenessMessage(user,target,numTargets=1)
|
||||
def pbEffectivenessMessage(user,target,numTargets = 1)
|
||||
return if target.damageState.disguise || target.damageState.iceFace
|
||||
if Effectiveness.super_effective?(target.damageState.typeMod)
|
||||
if numTargets>1
|
||||
@@ -282,7 +282,7 @@ class Battle::Move
|
||||
end
|
||||
end
|
||||
|
||||
def pbHitEffectivenessMessages(user,target,numTargets=1)
|
||||
def pbHitEffectivenessMessages(user,target,numTargets = 1)
|
||||
return if target.damageState.disguise || target.damageState.iceFace
|
||||
if target.damageState.substitute
|
||||
@battle.pbDisplay(_INTL("The substitute took damage for {1}!",target.pbThis(true)))
|
||||
|
||||
@@ -240,7 +240,7 @@ class Battle::Move
|
||||
return target.defense, target.stages[:DEFENSE]+6
|
||||
end
|
||||
|
||||
def pbCalcDamage(user,target,numTargets=1)
|
||||
def pbCalcDamage(user,target,numTargets = 1)
|
||||
return if statusMove?
|
||||
if target.damageState.disguise || target.damageState.iceFace
|
||||
target.damageState.calcDamage = 1
|
||||
@@ -476,7 +476,7 @@ class Battle::Move
|
||||
#=============================================================================
|
||||
# Additional effect chance
|
||||
#=============================================================================
|
||||
def pbAdditionalEffectChance(user,target,effectChance=0)
|
||||
def pbAdditionalEffectChance(user,target,effectChance = 0)
|
||||
return 0 if target.hasActiveAbility?(:SHIELDDUST) && !@battle.moldBreaker
|
||||
ret = (effectChance>0) ? effectChance : @addlEffect
|
||||
if Settings::MECHANICS_GENERATION >= 6 || @function != "EffectDependsOnEnvironment"
|
||||
|
||||
@@ -41,8 +41,8 @@ class Battle::Move::Confusion < Battle::Move
|
||||
@snatched = false
|
||||
end
|
||||
|
||||
def physicalMove?(thisType=nil); return true; end
|
||||
def specialMove?(thisType=nil); return false; end
|
||||
def physicalMove?(thisType = nil); return true; end
|
||||
def specialMove?(thisType = nil); return false; end
|
||||
def pbCritialOverride(user,target); return -1; end
|
||||
end
|
||||
|
||||
@@ -70,8 +70,8 @@ class Battle::Move::Struggle < Battle::Move
|
||||
@snatched = false
|
||||
end
|
||||
|
||||
def physicalMove?(thisType=nil); return true; end
|
||||
def specialMove?(thisType=nil); return false; end
|
||||
def physicalMove?(thisType = nil); return true; end
|
||||
def specialMove?(thisType = nil); return false; end
|
||||
|
||||
def pbEffectAfterAllHits(user,target)
|
||||
return if target.damageState.unaffected
|
||||
@@ -279,7 +279,7 @@ end
|
||||
class Battle::Move::FixedDamageMove < Battle::Move
|
||||
def pbFixedDamage(user,target); return 1; end
|
||||
|
||||
def pbCalcDamage(user,target,numTargets=1)
|
||||
def pbCalcDamage(user,target,numTargets = 1)
|
||||
target.damageState.critical = false
|
||||
target.damageState.calcDamage = pbFixedDamage(user,target)
|
||||
target.damageState.calcDamage = 1 if target.damageState.calcDamage<1
|
||||
@@ -367,7 +367,7 @@ class Battle::Move::TwoTurnMove < Battle::Move
|
||||
end
|
||||
end
|
||||
|
||||
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
|
||||
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
|
||||
hitNum = 1 if @chargingTurn && !@damagingTurn # Charging anim
|
||||
super
|
||||
end
|
||||
@@ -601,7 +601,7 @@ class Battle::Move::PledgeMove < Battle::Move
|
||||
@battle.pbCommonAnimation(animName) if animName
|
||||
end
|
||||
|
||||
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
|
||||
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
|
||||
return if @pledgeSetup # No animation for setting up
|
||||
id = @overrideAnim if @overrideAnim
|
||||
return super
|
||||
|
||||
@@ -640,7 +640,7 @@ class Battle::Move::AttackTwoTurnsLater < Battle::Move
|
||||
end
|
||||
end
|
||||
|
||||
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
|
||||
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
|
||||
hitNum = 1 if !@battle.futureSight # Charging anim
|
||||
super
|
||||
end
|
||||
|
||||
@@ -1721,7 +1721,7 @@ end
|
||||
class Battle::Move::UserStealTargetPositiveStatStages < Battle::Move
|
||||
def ignoresSubstitute?(user); return true; end
|
||||
|
||||
def pbCalcDamage(user,target,numTargets=1)
|
||||
def pbCalcDamage(user,target,numTargets = 1)
|
||||
if target.hasRaisedStatStages?
|
||||
pbShowAnimation(@id,user,target,1) # Stat stage-draining animation
|
||||
@battle.pbDisplay(_INTL("{1} stole the target's boosted stats!",user.pbThis))
|
||||
@@ -1931,7 +1931,7 @@ class Battle::Move::StartSwapAllBattlersBaseDefensiveStats < Battle::Move
|
||||
end
|
||||
end
|
||||
|
||||
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
|
||||
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
|
||||
return if @battle.field.effects[PBEffects::WonderRoom]>0 # No animation
|
||||
super
|
||||
end
|
||||
|
||||
@@ -174,7 +174,7 @@ end
|
||||
# Minimized. (Body Slam (Gen 6+))
|
||||
#===============================================================================
|
||||
class Battle::Move::ParalyzeTargetTrampleMinimize < Battle::Move::ParalyzeTarget
|
||||
def tramplesMinimize?(param=1)
|
||||
def tramplesMinimize?(param = 1)
|
||||
return true if param==1 && Settings::MECHANICS_GENERATION >= 6 # Perfect accuracy
|
||||
return true if param==2 # Double damage
|
||||
return super
|
||||
@@ -442,7 +442,7 @@ class Battle::Move::CureUserPartyStatus < Battle::Move
|
||||
return target.status == :NONE
|
||||
end
|
||||
|
||||
def pbAromatherapyHeal(pkmn,battler=nil)
|
||||
def pbAromatherapyHeal(pkmn,battler = nil)
|
||||
oldStatus = (battler) ? battler.status : pkmn.status
|
||||
curedName = (battler) ? battler.pbThis : pkmn.name
|
||||
if battler
|
||||
@@ -488,7 +488,7 @@ class Battle::Move::CureUserPartyStatus < Battle::Move
|
||||
end
|
||||
end
|
||||
|
||||
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
|
||||
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
|
||||
super
|
||||
if @id == :AROMATHERAPY
|
||||
@battle.pbDisplay(_INTL("A soothing aroma wafted through the area!"))
|
||||
@@ -552,7 +552,7 @@ end
|
||||
# the target is Minimized. (Dragon Rush (Gen 6+), Steamroller, Stomp)
|
||||
#===============================================================================
|
||||
class Battle::Move::FlinchTargetTrampleMinimize < Battle::Move::FlinchTarget
|
||||
def tramplesMinimize?(param=1)
|
||||
def tramplesMinimize?(param = 1)
|
||||
return true if param==1 && Settings::MECHANICS_GENERATION >= 6 # Perfect accuracy
|
||||
return true if param==2 # Double damage
|
||||
return super
|
||||
@@ -1388,7 +1388,7 @@ class Battle::Move::TransformUserIntoTarget < Battle::Move
|
||||
user.pbTransform(target)
|
||||
end
|
||||
|
||||
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
|
||||
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
|
||||
super
|
||||
@battle.scene.pbChangePokemon(user,targets[0].pokemon)
|
||||
end
|
||||
|
||||
@@ -98,7 +98,7 @@ class Battle::Move::OHKO < Battle::Move::FixedDamageMove
|
||||
return target.totalhp
|
||||
end
|
||||
|
||||
def pbHitEffectivenessMessages(user,target,numTargets=1)
|
||||
def pbHitEffectivenessMessages(user,target,numTargets = 1)
|
||||
super
|
||||
if target.fainted?
|
||||
@battle.pbDisplay(_INTL("It's a one-hit KO!"))
|
||||
@@ -310,7 +310,7 @@ end
|
||||
# Does double damage and has perfect accuracy if the target is Minimized.
|
||||
#===============================================================================
|
||||
class Battle::Move::PowerHigherWithUserHeavierThanTarget < Battle::Move
|
||||
def tramplesMinimize?(param=1)
|
||||
def tramplesMinimize?(param = 1)
|
||||
return true if Settings::MECHANICS_GENERATION >= 7 # Perfect accuracy and double damage
|
||||
return super
|
||||
end
|
||||
@@ -850,7 +850,7 @@ class Battle::Move::RemoveScreens < Battle::Move
|
||||
end
|
||||
end
|
||||
|
||||
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
|
||||
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
|
||||
if user.pbOpposingSide.effects[PBEffects::LightScreen]>0 ||
|
||||
user.pbOpposingSide.effects[PBEffects::Reflect]>0 ||
|
||||
user.pbOpposingSide.effects[PBEffects::AuroraVeil]>0
|
||||
@@ -1121,7 +1121,7 @@ end
|
||||
# Minimized. (Flying Press)
|
||||
#===============================================================================
|
||||
class Battle::Move::EffectivenessIncludesFlyingType < Battle::Move
|
||||
def tramplesMinimize?(param=1)
|
||||
def tramplesMinimize?(param = 1)
|
||||
return true if param==1 && Settings::MECHANICS_GENERATION >= 6 # Perfect accuracy
|
||||
return true if param==2 # Double damage
|
||||
return super
|
||||
@@ -1195,8 +1195,8 @@ class Battle::Move::CategoryDependsOnHigherDamageIgnoreTargetAbility < Battle::M
|
||||
@calcCategory = 1
|
||||
end
|
||||
|
||||
def physicalMove?(thisType=nil); return (@calcCategory==0); end
|
||||
def specialMove?(thisType=nil); return (@calcCategory==1); end
|
||||
def physicalMove?(thisType = nil); return (@calcCategory==0); end
|
||||
def specialMove?(thisType = nil); return (@calcCategory==1); end
|
||||
|
||||
def pbOnStartUse(user,targets)
|
||||
# Calculate user's effective attacking value
|
||||
@@ -1568,7 +1568,7 @@ class Battle::Move::TypeDependsOnUserDrive < Battle::Move
|
||||
return ret
|
||||
end
|
||||
|
||||
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
|
||||
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
|
||||
t = pbBaseType(user)
|
||||
hitNum = 0
|
||||
hitNum = 1 if t == :ELECTRIC
|
||||
@@ -1623,7 +1623,7 @@ class Battle::Move::TypeAndPowerDependOnWeather < Battle::Move
|
||||
return ret
|
||||
end
|
||||
|
||||
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
|
||||
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
|
||||
t = pbBaseType(user)
|
||||
hitNum = 1 if t == :FIRE # Type-specific anims
|
||||
hitNum = 2 if t == :WATER
|
||||
|
||||
@@ -19,9 +19,9 @@ end
|
||||
# accuracy if the target is Minimized. (Double Iron Bash)
|
||||
#===============================================================================
|
||||
class Battle::Move::HitTwoTimesFlinchTarget < Battle::Move::FlinchTarget
|
||||
def multiHitMove?; return true; end
|
||||
def pbNumHits(user,targets); return 2; end
|
||||
def tramplesMinimize?(param=1); return Settings::MECHANICS_GENERATION <= 7; end
|
||||
def multiHitMove?; return true; end
|
||||
def pbNumHits(user, targets); return 2; end
|
||||
def tramplesMinimize?(param = 1); return Settings::MECHANICS_GENERATION <= 7; end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
@@ -615,7 +615,7 @@ class Battle::Move::MultiTurnAttackBideThenReturnDoubleDamage < Battle::Move::Fi
|
||||
user.effects[PBEffects::Bide] -= 1
|
||||
end
|
||||
|
||||
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
|
||||
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
|
||||
hitNum = 1 if !@damagingTurn # Charging anim
|
||||
super
|
||||
end
|
||||
|
||||
@@ -649,7 +649,7 @@ class Battle::Move::StartPerishCountsForAllBattlers < Battle::Move
|
||||
target.effects[PBEffects::PerishSongUser] = user.index
|
||||
end
|
||||
|
||||
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
|
||||
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
|
||||
super
|
||||
@battle.pbDisplay(_INTL("All Pokémon that hear the song will faint in three turns!"))
|
||||
end
|
||||
|
||||
@@ -279,7 +279,7 @@ class Battle::Move::StartNegateHeldItems < Battle::Move
|
||||
end
|
||||
end
|
||||
|
||||
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
|
||||
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
|
||||
return if @battle.field.effects[PBEffects::MagicRoom]>0 # No animation
|
||||
super
|
||||
end
|
||||
|
||||
@@ -80,7 +80,7 @@ class Battle::Move::RandomlyDamageOrHealTarget < Battle::Move
|
||||
@battle.pbDisplay(_INTL("{1}'s HP was restored.",target.pbThis))
|
||||
end
|
||||
|
||||
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
|
||||
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
|
||||
hitNum = 1 if @presentDmg==0 # Healing anim
|
||||
super
|
||||
end
|
||||
@@ -125,7 +125,7 @@ class Battle::Move::HealAllyOrDamageFoe < Battle::Move
|
||||
@battle.pbDisplay(_INTL("{1}'s HP was restored.",target.pbThis))
|
||||
end
|
||||
|
||||
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
|
||||
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
|
||||
hitNum = 1 if @healing # Healing anim
|
||||
super
|
||||
end
|
||||
@@ -193,7 +193,7 @@ class Battle::Move::CurseTargetOrLowerUserSpd1RaiseUserAtkDef1 < Battle::Move
|
||||
user.pbItemHPHealCheck
|
||||
end
|
||||
|
||||
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
|
||||
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
|
||||
hitNum = 1 if !user.pbHasType?(:GHOST) # Non-Ghost anim
|
||||
super
|
||||
end
|
||||
@@ -288,7 +288,7 @@ class Battle::Move::EffectDependsOnEnvironment < Battle::Move
|
||||
end
|
||||
end
|
||||
|
||||
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
|
||||
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
|
||||
id = :BODYSLAM # Environment-specific anim
|
||||
case @secretPower
|
||||
when 1 then id = :THUNDERSHOCK if GameData::Move.exists?(:THUNDERSHOCK)
|
||||
@@ -371,7 +371,7 @@ class Battle::Move::DoublePowerAfterFusionFlare < Battle::Move
|
||||
@battle.field.effects[PBEffects::FusionBolt] = true
|
||||
end
|
||||
|
||||
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
|
||||
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
|
||||
hitNum = 1 if (targets.length>0 && targets[0].damageState.critical) ||
|
||||
@doublePower # Charged anim
|
||||
super
|
||||
@@ -396,7 +396,7 @@ class Battle::Move::DoublePowerAfterFusionBolt < Battle::Move
|
||||
@battle.field.effects[PBEffects::FusionFlare] = true
|
||||
end
|
||||
|
||||
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
|
||||
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
|
||||
hitNum = 1 if (targets.length>0 && targets[0].damageState.critical) ||
|
||||
@doublePower # Charged anim
|
||||
super
|
||||
@@ -777,7 +777,7 @@ class Battle::Move::UseLastMoveUsedByTarget < Battle::Move
|
||||
user.pbUseMoveSimple(target.lastRegularMoveUsed,target.index)
|
||||
end
|
||||
|
||||
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
|
||||
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
|
||||
# No animation
|
||||
end
|
||||
end
|
||||
|
||||
@@ -637,7 +637,7 @@ class Battle::Move::StartSlowerBattlersActFirst < Battle::Move
|
||||
end
|
||||
end
|
||||
|
||||
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
|
||||
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
|
||||
return if @battle.field.effects[PBEffects::TrickRoom]>0 # No animation
|
||||
super
|
||||
end
|
||||
|
||||
@@ -76,7 +76,7 @@ class Battle::Scene
|
||||
#=============================================================================
|
||||
# Updating and refreshing
|
||||
#=============================================================================
|
||||
def pbUpdate(cw=nil)
|
||||
def pbUpdate(cw = nil)
|
||||
pbGraphicsUpdate
|
||||
pbInputUpdate
|
||||
pbFrameUpdate(cw)
|
||||
@@ -111,7 +111,7 @@ class Battle::Scene
|
||||
end
|
||||
end
|
||||
|
||||
def pbFrameUpdate(cw=nil)
|
||||
def pbFrameUpdate(cw = nil)
|
||||
cw.update if cw
|
||||
@battle.battlers.each_with_index do |b,i|
|
||||
next if !b
|
||||
@@ -185,7 +185,7 @@ class Battle::Scene
|
||||
|
||||
# NOTE: A regular message is displayed for 1 second after it fully appears (or
|
||||
# less if Back/Use is pressed). Disappears automatically after that time.
|
||||
def pbDisplayMessage(msg,brief=false)
|
||||
def pbDisplayMessage(msg,brief = false)
|
||||
pbWaitMessage
|
||||
pbShowWindow(MESSAGE_BOX)
|
||||
cw = @sprites["messageWindow"]
|
||||
@@ -379,7 +379,7 @@ class Battle::Scene
|
||||
#=============================================================================
|
||||
#
|
||||
#=============================================================================
|
||||
def pbSelectBattler(idxBattler,selectMode=1)
|
||||
def pbSelectBattler(idxBattler,selectMode = 1)
|
||||
numWindows = @battle.sideSizes.max*2
|
||||
for i in 0...numWindows
|
||||
sel = (idxBattler.is_a?(Array)) ? !idxBattler[i].nil? : i==idxBattler
|
||||
|
||||
@@ -150,7 +150,7 @@ class Battle::Scene
|
||||
cmdBarBG.z = 180
|
||||
end
|
||||
|
||||
def pbCreateTrainerBackSprite(idxTrainer,trainerType,numTrainers=1)
|
||||
def pbCreateTrainerBackSprite(idxTrainer,trainerType,numTrainers = 1)
|
||||
if idxTrainer==0 # Player's sprite
|
||||
trainerFile = GameData::TrainerType.player_back_sprite_filename(trainerType)
|
||||
else # Partner trainer's sprite
|
||||
@@ -169,7 +169,7 @@ class Battle::Scene
|
||||
trainer.oy = trainer.bitmap.height
|
||||
end
|
||||
|
||||
def pbCreateTrainerFrontSprite(idxTrainer,trainerType,numTrainers=1)
|
||||
def pbCreateTrainerFrontSprite(idxTrainer,trainerType,numTrainers = 1)
|
||||
trainerFile = GameData::TrainerType.front_sprite_filename(trainerType)
|
||||
spriteX, spriteY = Battle::Scene.pbTrainerPosition(1,idxTrainer,numTrainers)
|
||||
trainer = pbAddSprite("trainer_#{idxTrainer+1}",spriteX,spriteY,trainerFile,@viewport)
|
||||
|
||||
@@ -23,7 +23,7 @@ class Battle::Scene
|
||||
# 2 = regular battle with "Call" (for Shadow Pokémon battles)
|
||||
# 3 = Safari Zone
|
||||
# 4 = Bug Catching Contest
|
||||
def pbCommandMenuEx(idxBattler,texts,mode=0)
|
||||
def pbCommandMenuEx(idxBattler,texts,mode = 0)
|
||||
pbShowWindow(COMMAND_BOX)
|
||||
cw = @sprites["commandWindow"]
|
||||
cw.setTexts(texts)
|
||||
@@ -65,7 +65,7 @@ class Battle::Scene
|
||||
#=============================================================================
|
||||
# The player chooses a move for a Pokémon to use
|
||||
#=============================================================================
|
||||
def pbFightMenu(idxBattler,megaEvoPossible=false)
|
||||
def pbFightMenu(idxBattler,megaEvoPossible = false)
|
||||
battler = @battle.battlers[idxBattler]
|
||||
cw = @sprites["fightWindow"]
|
||||
cw.battler = battler
|
||||
@@ -140,7 +140,7 @@ class Battle::Scene
|
||||
# Opens the party screen to choose a Pokémon to switch in (or just view its
|
||||
# summary screens)
|
||||
#=============================================================================
|
||||
def pbPartyScreen(idxBattler,canCancel=false)
|
||||
def pbPartyScreen(idxBattler,canCancel = false)
|
||||
# Fade out and hide all sprites
|
||||
visibleSprites = pbFadeOutAndHide(@sprites)
|
||||
# Get player's party
|
||||
@@ -373,7 +373,7 @@ class Battle::Scene
|
||||
return idxBattler # Target the user initially
|
||||
end
|
||||
|
||||
def pbChooseTarget(idxBattler,target_data,visibleSprites=nil)
|
||||
def pbChooseTarget(idxBattler,target_data,visibleSprites = nil)
|
||||
pbShowWindow(TARGET_BOX)
|
||||
cw = @sprites["targetWindow"]
|
||||
# Create an array of battler names (only valid targets are named)
|
||||
|
||||
@@ -57,7 +57,7 @@ class Battle::Scene
|
||||
#=============================================================================
|
||||
# Animates a party lineup appearing for the given side
|
||||
#=============================================================================
|
||||
def pbShowPartyLineup(side,fullAnim=false)
|
||||
def pbShowPartyLineup(side,fullAnim = false)
|
||||
@animations.push(Animation::LineupAppear.new(@sprites,@viewport,
|
||||
side,@battle.pbParty(side),@battle.pbPartyStarts(side),fullAnim))
|
||||
if !fullAnim
|
||||
@@ -88,7 +88,7 @@ class Battle::Scene
|
||||
# animation for it if relevant.
|
||||
# sendOuts is an array; each element is itself an array: [idxBattler,pkmn]
|
||||
#=============================================================================
|
||||
def pbSendOutBattlers(sendOuts,startBattle=false)
|
||||
def pbSendOutBattlers(sendOuts,startBattle = false)
|
||||
return if sendOuts.length==0
|
||||
# If party balls are still appearing, wait for them to finish showing up, as
|
||||
# the FadeAnimation will make them disappear.
|
||||
@@ -216,7 +216,7 @@ class Battle::Scene
|
||||
#=============================================================================
|
||||
# Shows a HP-changing common animation and animates a data box's HP bar.
|
||||
# Called by def pbReduceHP, def pbRecoverHP.
|
||||
def pbHPChanged(battler,oldHP,showAnim=false)
|
||||
def pbHPChanged(battler,oldHP,showAnim = false)
|
||||
@briefMessage = false
|
||||
if battler.hp>oldHP
|
||||
pbCommonAnimation("HealthUp",battler) if showAnim && @battle.showAnims
|
||||
@@ -229,7 +229,7 @@ class Battle::Scene
|
||||
end
|
||||
end
|
||||
|
||||
def pbDamageAnimation(battler,effectiveness=0)
|
||||
def pbDamageAnimation(battler,effectiveness = 0)
|
||||
@briefMessage = false
|
||||
# Damage animation
|
||||
damageAnim = Animation::BattlerDamage.new(@sprites,@viewport,battler.index,effectiveness)
|
||||
@@ -324,7 +324,7 @@ class Battle::Scene
|
||||
#=============================================================================
|
||||
# Animates throwing a Poké Ball at a Pokémon in an attempt to catch it
|
||||
#=============================================================================
|
||||
def pbThrow(ball,shakes,critical,targetBattler,showPlayer=false)
|
||||
def pbThrow(ball,shakes,critical,targetBattler,showPlayer = false)
|
||||
@briefMessage = false
|
||||
captureAnim = Animation::PokeballThrowCapture.new(@sprites,@viewport,
|
||||
ball,shakes,critical,@battle.battlers[targetBattler],showPlayer)
|
||||
@@ -403,7 +403,7 @@ class Battle::Scene
|
||||
#=============================================================================
|
||||
# Returns the animation ID to use for a given move/user. Returns nil if that
|
||||
# move has no animations defined for it.
|
||||
def pbFindMoveAnimDetails(move2anim,moveID,idxUser,hitNum=0)
|
||||
def pbFindMoveAnimDetails(move2anim,moveID,idxUser,hitNum = 0)
|
||||
real_move_id = GameData::Move.get(moveID).id
|
||||
noFlip = false
|
||||
if (idxUser&1)==0 # On player's side
|
||||
@@ -483,7 +483,7 @@ class Battle::Scene
|
||||
# Plays a move/common animation
|
||||
#=============================================================================
|
||||
# Plays a move animation.
|
||||
def pbAnimation(moveID,user,targets,hitNum=0)
|
||||
def pbAnimation(moveID,user,targets,hitNum = 0)
|
||||
animID = pbFindMoveAnimation(moveID,user.index,hitNum)
|
||||
return if !animID
|
||||
anim = animID[0]
|
||||
@@ -500,7 +500,7 @@ class Battle::Scene
|
||||
end
|
||||
|
||||
# Plays a common animation.
|
||||
def pbCommonAnimation(animName,user=nil,target=nil)
|
||||
def pbCommonAnimation(animName,user = nil,target = nil)
|
||||
return if nil_or_empty?(animName)
|
||||
target = target[0] if target && target.is_a?(Array)
|
||||
animations = pbLoadBattleAnimations
|
||||
@@ -512,7 +512,7 @@ class Battle::Scene
|
||||
end
|
||||
end
|
||||
|
||||
def pbAnimationCore(animation,user,target,oppMove=false)
|
||||
def pbAnimationCore(animation,user,target,oppMove = false)
|
||||
return if !animation
|
||||
@briefMessage = false
|
||||
userSprite = (user) ? @sprites["pokemon_#{user.index}"] : nil
|
||||
|
||||
@@ -15,7 +15,7 @@ class Battle::Scene::MenuBase
|
||||
TEXT_BASE_COLOR = Battle::Scene::MESSAGE_BASE_COLOR
|
||||
TEXT_SHADOW_COLOR = Battle::Scene::MESSAGE_SHADOW_COLOR
|
||||
|
||||
def initialize(viewport=nil)
|
||||
def initialize(viewport = nil)
|
||||
@x = 0
|
||||
@y = 0
|
||||
@z = 0
|
||||
|
||||
@@ -19,7 +19,7 @@ class Battle::Scene::PokemonDataBox < SpriteWrapper
|
||||
FEMALE_BASE_COLOR = Color.new(248,88,40)
|
||||
FEMALE_SHADOW_COLOR = NAME_SHADOW_COLOR
|
||||
|
||||
def initialize(battler,sideSize,viewport=nil)
|
||||
def initialize(battler,sideSize,viewport = nil)
|
||||
super(viewport)
|
||||
@battler = battler
|
||||
@sprites = {}
|
||||
@@ -193,7 +193,7 @@ class Battle::Scene::PokemonDataBox < SpriteWrapper
|
||||
pbSEPlay("Pkmn exp gain") if @showExp
|
||||
end
|
||||
|
||||
def pbDrawNumber(number,btmp,startX,startY,align=0)
|
||||
def pbDrawNumber(number,btmp,startX,startY,align = 0)
|
||||
# -1 means draw the / character
|
||||
n = (number == -1) ? [10] : number.to_i.digits.reverse
|
||||
charWidth = @numbersBitmap.width/11
|
||||
@@ -363,7 +363,7 @@ class Battle::Scene::PokemonDataBox < SpriteWrapper
|
||||
end
|
||||
end
|
||||
|
||||
def update(frameCounter=0)
|
||||
def update(frameCounter = 0)
|
||||
super()
|
||||
# Animate HP bar
|
||||
updateHPAnimation
|
||||
@@ -386,7 +386,7 @@ class Battle::Scene::AbilitySplashBar < SpriteWrapper
|
||||
TEXT_BASE_COLOR = Color.new(0,0,0)
|
||||
TEXT_SHADOW_COLOR = Color.new(248,248,248)
|
||||
|
||||
def initialize(side,viewport=nil)
|
||||
def initialize(side,viewport = nil)
|
||||
super(viewport)
|
||||
@side = side
|
||||
@battler = nil
|
||||
@@ -550,7 +550,7 @@ class Battle::Scene::BattlerSprite < RPG::Sprite
|
||||
@pkmn.species_data.apply_metrics_to_sprite(self, @index)
|
||||
end
|
||||
|
||||
def setPokemonBitmap(pkmn,back=false)
|
||||
def setPokemonBitmap(pkmn,back = false)
|
||||
@pkmn = pkmn
|
||||
@_iconBitmap.dispose if @_iconBitmap
|
||||
@_iconBitmap = GameData::Species.sprite_bitmap_from_pokemon(@pkmn, back)
|
||||
@@ -562,14 +562,14 @@ class Battle::Scene::BattlerSprite < RPG::Sprite
|
||||
# this is just playing the Pokémon's cry, but you can expand on it. The
|
||||
# recommendation is to create a PictureEx animation and push it into
|
||||
# the @battleAnimations array.
|
||||
def pbPlayIntroAnimation(pictureEx=nil)
|
||||
def pbPlayIntroAnimation(pictureEx = nil)
|
||||
@pkmn.play_cry if @pkmn
|
||||
end
|
||||
|
||||
QUARTER_ANIM_PERIOD = Graphics.frame_rate*3/20
|
||||
SIXTH_ANIM_PERIOD = Graphics.frame_rate*2/20
|
||||
|
||||
def update(frameCounter=0)
|
||||
def update(frameCounter = 0)
|
||||
return if !@_iconBitmap
|
||||
@updating = true
|
||||
# Update bitmap
|
||||
@@ -653,7 +653,7 @@ class Battle::Scene::BattlerShadowSprite < RPG::Sprite
|
||||
pbSetPosition
|
||||
end
|
||||
|
||||
def update(frameCounter=0)
|
||||
def update(frameCounter = 0)
|
||||
return if !@_iconBitmap
|
||||
# Update bitmap
|
||||
@_iconBitmap.update
|
||||
|
||||
@@ -17,7 +17,7 @@ class Battle::Scene::Animation
|
||||
def empty?; return @pictureEx.length==0; end
|
||||
def animDone?; return @animDone; end
|
||||
|
||||
def addSprite(s,origin=PictureOrigin::TopLeft)
|
||||
def addSprite(s,origin = PictureOrigin::TopLeft)
|
||||
num = @pictureEx.length
|
||||
picture = PictureEx.new(s.z)
|
||||
picture.x = s.x
|
||||
@@ -31,7 +31,7 @@ class Battle::Scene::Animation
|
||||
return picture
|
||||
end
|
||||
|
||||
def addNewSprite(x,y,name,origin=PictureOrigin::TopLeft)
|
||||
def addNewSprite(x,y,name,origin = PictureOrigin::TopLeft)
|
||||
num = @pictureEx.length
|
||||
picture = PictureEx.new(num)
|
||||
picture.setXY(0,x,y)
|
||||
@@ -96,7 +96,7 @@ module Battle::Scene::Animation::BallAnimationMixin
|
||||
return ball
|
||||
end
|
||||
|
||||
def ballTracksHand(ball,traSprite,safariThrow=false)
|
||||
def ballTracksHand(ball,traSprite,safariThrow = false)
|
||||
# Back sprite isn't animated, no hand-tracking needed
|
||||
if traSprite.bitmap.width<traSprite.bitmap.height*2
|
||||
ball.setVisible(7,true)
|
||||
|
||||
@@ -47,7 +47,7 @@ class Battle::Scene::Animation::Intro < Battle::Scene::Animation
|
||||
blackBar.moveOpacity(appearTime*3/4,appearTime/4,0)
|
||||
end
|
||||
|
||||
def makeSlideSprite(spriteName,deltaMult,appearTime,origin=nil)
|
||||
def makeSlideSprite(spriteName,deltaMult,appearTime,origin = nil)
|
||||
# If deltaMult is positive, the sprite starts off to the right and moves
|
||||
# left (for sprites on the player's side and the background).
|
||||
return if !@sprites[spriteName]
|
||||
@@ -304,7 +304,7 @@ end
|
||||
# Doesn't show the ball thrown or the Pokémon.
|
||||
#===============================================================================
|
||||
class Battle::Scene::Animation::PlayerFade < Battle::Scene::Animation
|
||||
def initialize(sprites,viewport,fullAnim=false)
|
||||
def initialize(sprites,viewport,fullAnim = false)
|
||||
@fullAnim = fullAnim # True at start of battle, false when switching
|
||||
super(sprites,viewport)
|
||||
end
|
||||
@@ -357,7 +357,7 @@ end
|
||||
# Doesn't show the ball thrown or the Pokémon.
|
||||
#===============================================================================
|
||||
class Battle::Scene::Animation::TrainerFade < Battle::Scene::Animation
|
||||
def initialize(sprites,viewport,fullAnim=false)
|
||||
def initialize(sprites,viewport,fullAnim = false)
|
||||
@fullAnim = fullAnim # True at start of battle, false when switching
|
||||
super(sprites,viewport)
|
||||
end
|
||||
@@ -404,7 +404,7 @@ end
|
||||
class Battle::Scene::Animation::PokeballPlayerSendOut < Battle::Scene::Animation
|
||||
include Battle::Scene::Animation::BallAnimationMixin
|
||||
|
||||
def initialize(sprites,viewport,idxTrainer,battler,startBattle,idxOrder=0)
|
||||
def initialize(sprites,viewport,idxTrainer,battler,startBattle,idxOrder = 0)
|
||||
@idxTrainer = idxTrainer
|
||||
@battler = battler
|
||||
@showingTrainer = startBattle
|
||||
|
||||
@@ -23,9 +23,9 @@ class Battle::DebugSceneNoLogging
|
||||
def pbBeginCommandPhase; end
|
||||
def pbBeginAttackPhase; end
|
||||
def pbShowOpponent(idxTrainer); end
|
||||
def pbDamageAnimation(battler,effectiveness=0); end
|
||||
def pbCommonAnimation(animName,user=nil,target=nil); end
|
||||
def pbAnimation(moveID,user,targets,hitNum=0); end
|
||||
def pbDamageAnimation(battler,effectiveness = 0); end
|
||||
def pbCommonAnimation(animName,user = nil,target = nil); end
|
||||
def pbAnimation(moveID,user,targets,hitNum = 0); end
|
||||
def pbEndBattle(result); end
|
||||
def pbWildBattleSuccess; end
|
||||
def pbTrainerBattleSuccess; end
|
||||
@@ -34,17 +34,17 @@ class Battle::DebugSceneNoLogging
|
||||
|
||||
def pbRefresh; end
|
||||
|
||||
def pbDisplayMessage(msg,brief=false); end
|
||||
def pbDisplayMessage(msg,brief = false); end
|
||||
def pbDisplayPausedMessage(msg); end
|
||||
def pbDisplayConfirmMessage(msg); return true; end
|
||||
def pbShowCommands(msg,commands,defaultValue); return 0; end
|
||||
|
||||
def pbSendOutBattlers(sendOuts,startBattle=false); end
|
||||
def pbSendOutBattlers(sendOuts,startBattle = false); end
|
||||
def pbRecall(idxBattler); end
|
||||
def pbItemMenu(idxBattler,firstAction); return -1; end
|
||||
def pbResetMoveIndex(idxBattler); end
|
||||
|
||||
def pbHPChanged(battler,oldHP,showAnim=false); end
|
||||
def pbHPChanged(battler,oldHP,showAnim = false); end
|
||||
def pbFaintBattler(battler); end
|
||||
def pbEXPBar(battler,startExp,endExp,tempExp1,tempExp2); end
|
||||
def pbLevelUp(pkmn, battler, oldTotalHP, oldAttack, oldDefense,
|
||||
@@ -57,20 +57,20 @@ class Battle::DebugSceneNoLogging
|
||||
return 0 # Fight
|
||||
end
|
||||
|
||||
def pbFightMenu(idxBattler,megaEvoPossible=false)
|
||||
def pbFightMenu(idxBattler,megaEvoPossible = false)
|
||||
battler = @battle.battlers[idxBattler]
|
||||
50.times do
|
||||
break if yield rand(battler.move.length)
|
||||
end
|
||||
end
|
||||
|
||||
def pbChooseTarget(idxBattler,target_data,visibleSprites=nil)
|
||||
def pbChooseTarget(idxBattler,target_data,visibleSprites = nil)
|
||||
targets = @battle.allOtherSideBattlers(idxBattler).map { |b| b.index }
|
||||
return -1 if targets.length==0
|
||||
return targets.sample
|
||||
end
|
||||
|
||||
def pbPartyScreen(idxBattler,canCancel=false)
|
||||
def pbPartyScreen(idxBattler,canCancel = false)
|
||||
replacements = []
|
||||
@battle.eachInTeamFromBattlerIndex(idxBattler) do |_b,idxParty|
|
||||
replacements.push(idxParty) if !@battle.pbFindBattler(idxParty,idxBattler)
|
||||
|
||||
@@ -152,7 +152,7 @@ class Battle::AI
|
||||
#=============================================================================
|
||||
# Get a score for the given move being used against the given target
|
||||
#=============================================================================
|
||||
def pbGetMoveScore(move,user,target,skill=100)
|
||||
def pbGetMoveScore(move,user,target,skill = 100)
|
||||
skill = PBTrainerAI.minimumSkill if skill<PBTrainerAI.minimumSkill
|
||||
score = 100
|
||||
score = pbGetMoveScoreFunctionCode(score,move,user,target,skill)
|
||||
|
||||
@@ -2,7 +2,7 @@ class Battle::AI
|
||||
#=============================================================================
|
||||
# Get a score for the given move based on its effect
|
||||
#=============================================================================
|
||||
def pbGetMoveScoreFunctionCode(score,move,user,target,skill=100)
|
||||
def pbGetMoveScoreFunctionCode(score,move,user,target,skill = 100)
|
||||
case move.function
|
||||
#---------------------------------------------------------------------------
|
||||
when "None" # No extra effect
|
||||
|
||||
@@ -44,7 +44,7 @@ class Battle::Peer
|
||||
end
|
||||
|
||||
# For switching out, including due to fainting, and for the end of battle
|
||||
def pbOnLeavingBattle(battle,pkmn,usedInBattle,endBattle=false)
|
||||
def pbOnLeavingBattle(battle,pkmn,usedInBattle,endBattle = false)
|
||||
return if !pkmn
|
||||
f = MultipleForms.call("getFormOnLeavingBattle",pkmn,battle,usedInBattle,endBattle)
|
||||
pkmn.form = f if f && pkmn.form!=f
|
||||
@@ -58,7 +58,7 @@ end
|
||||
#===============================================================================
|
||||
class Battle::NullPeer
|
||||
def pbOnEnteringBattle(battle, battler, pkmn, wild = false); end
|
||||
def pbOnLeavingBattle(battle,pkmn,usedInBattle,endBattle=false); end
|
||||
def pbOnLeavingBattle(battle,pkmn,usedInBattle,endBattle = false); end
|
||||
|
||||
def pbStorePokemon(player,pkmn)
|
||||
player.party[player.party.length] = pkmn if !player.party_full?
|
||||
|
||||
@@ -47,7 +47,7 @@ module Battle::CatchAndStoreMixin
|
||||
#=============================================================================
|
||||
# Throw a Poké Ball
|
||||
#=============================================================================
|
||||
def pbThrowPokeBall(idxBattler,ball,catch_rate=nil,showPlayer=false)
|
||||
def pbThrowPokeBall(idxBattler,ball,catch_rate = nil,showPlayer = false)
|
||||
# Determine which Pokémon you're throwing the Poké Ball at
|
||||
battler = nil
|
||||
if opposes?(idxBattler)
|
||||
|
||||
@@ -22,7 +22,7 @@ class Battle
|
||||
return __clauses__pbDecisionOnDraw
|
||||
end
|
||||
|
||||
def pbJudgeCheckpoint(user,move=nil)
|
||||
def pbJudgeCheckpoint(user,move = nil)
|
||||
if pbAllFainted?(0) && pbAllFainted?(1)
|
||||
if @rules["drawclause"] # NOTE: Also includes Life Orb (not implemented)
|
||||
if !(move && move.function=="HealUserByHalfOfDamageDone")
|
||||
@@ -62,7 +62,7 @@ class Battle::Battler
|
||||
@__clauses__aliased = true
|
||||
end
|
||||
|
||||
def pbCanSleep?(user,showMessages,move=nil,ignoreStatus=false)
|
||||
def pbCanSleep?(user,showMessages,move = nil,ignoreStatus = false)
|
||||
selfsleep = (user && user.index==@index)
|
||||
if ((@battle.rules["modifiedsleepclause"]) || (!selfsleep && @battle.rules["sleepclause"])) &&
|
||||
pbHasStatusPokemon?(:SLEEP)
|
||||
|
||||
@@ -74,7 +74,7 @@ def isReversed(src0,src1,dst0,dst1)
|
||||
return (dst0<dst1)
|
||||
end
|
||||
|
||||
def pbCreateCel(x,y,pattern,focus=4)
|
||||
def pbCreateCel(x,y,pattern,focus = 4)
|
||||
frame = []
|
||||
frame[AnimFrame::X] = x
|
||||
frame[AnimFrame::Y] = y
|
||||
@@ -256,7 +256,7 @@ class PBAnimTiming
|
||||
attr_accessor :flashColor
|
||||
attr_accessor :flashDuration
|
||||
|
||||
def initialize(type=0)
|
||||
def initialize(type = 0)
|
||||
@frame = 0
|
||||
@timingType = type
|
||||
@name = ""
|
||||
@@ -358,7 +358,7 @@ class PBAnimations < Array
|
||||
attr_reader :array
|
||||
attr_accessor :selected
|
||||
|
||||
def initialize(size=1)
|
||||
def initialize(size = 1)
|
||||
@array = []
|
||||
@selected = 0
|
||||
size = 1 if size<1 # Always create at least one animation
|
||||
@@ -433,7 +433,7 @@ class PBAnimation < Array
|
||||
return @speed || 20
|
||||
end
|
||||
|
||||
def initialize(size=1)
|
||||
def initialize(size = 1)
|
||||
@id = -1
|
||||
@name = ""
|
||||
@graphic = ""
|
||||
@@ -494,7 +494,7 @@ class PBAnimation < Array
|
||||
return @array[pos]
|
||||
end
|
||||
|
||||
def playTiming(frame,bgGraphic,bgColor,foGraphic,foColor,oldbg=[],oldfo=[],user=nil)
|
||||
def playTiming(frame,bgGraphic,bgColor,foGraphic,foColor,oldbg = [],oldfo = [],user = nil)
|
||||
for i in @timing
|
||||
next if i.frame!=frame
|
||||
case i.timingType
|
||||
@@ -617,7 +617,7 @@ end
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
def pbSpriteSetAnimFrame(sprite,frame,user=nil,target=nil,inEditor=false)
|
||||
def pbSpriteSetAnimFrame(sprite,frame,user = nil,target = nil,inEditor = false)
|
||||
return if !sprite
|
||||
if !frame
|
||||
sprite.visible = false
|
||||
@@ -702,7 +702,7 @@ class PBAnimationPlayerX
|
||||
|
||||
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)
|
||||
@animation = animation
|
||||
@user = (oppMove) ? target : user # Just used for playing user's cry
|
||||
@usersprite = (user) ? scene.sprites["pokemon_#{user.index}"] : nil
|
||||
|
||||
@@ -42,7 +42,7 @@ class Battle::FakeBattler
|
||||
return $player.owned?(pokemon.species)
|
||||
end
|
||||
|
||||
def pbThis(lowerCase=false)
|
||||
def pbThis(lowerCase = false)
|
||||
return (lowerCase) ? _INTL("the wild {1}",name) : _INTL("The wild {1}",name)
|
||||
end
|
||||
|
||||
@@ -62,7 +62,7 @@ end
|
||||
class Battle::Scene::SafariDataBox < SpriteWrapper
|
||||
attr_accessor :selected
|
||||
|
||||
def initialize(battle,viewport=nil)
|
||||
def initialize(battle,viewport = nil)
|
||||
super(viewport)
|
||||
@selected = 0
|
||||
@battle = battle
|
||||
@@ -88,7 +88,7 @@ class Battle::Scene::SafariDataBox < SpriteWrapper
|
||||
pbDrawTextPositions(self.bitmap,textpos)
|
||||
end
|
||||
|
||||
def update(frameCounter=0)
|
||||
def update(frameCounter = 0)
|
||||
super()
|
||||
end
|
||||
end
|
||||
@@ -381,12 +381,12 @@ class SafariBattle
|
||||
return (opposes?(idxBattler)) ? @party2 : nil
|
||||
end
|
||||
|
||||
def pbAllFainted?(idxBattler=0); return false; end
|
||||
def pbAllFainted?(idxBattler = 0); return false; end
|
||||
|
||||
#=============================================================================
|
||||
# Battler-related
|
||||
#=============================================================================
|
||||
def opposes?(idxBattler1,idxBattler2=0)
|
||||
def opposes?(idxBattler1,idxBattler2 = 0)
|
||||
idxBattler1 = idxBattler1.index if idxBattler1.respond_to?("index")
|
||||
idxBattler2 = idxBattler2.index if idxBattler2.respond_to?("index")
|
||||
return (idxBattler1&1)!=(idxBattler2&1)
|
||||
|
||||
@@ -93,7 +93,7 @@ class BattlePalaceBattle < Battle
|
||||
return true
|
||||
end
|
||||
|
||||
def pbRegisterMove(idxBattler,idxMove,_showMessages=true)
|
||||
def pbRegisterMove(idxBattler,idxMove,_showMessages = true)
|
||||
this_battler = @battlers[idxBattler]
|
||||
if idxMove==-2
|
||||
@choices[idxBattler][0] = :UseMove # "Use move"
|
||||
|
||||
@@ -9,7 +9,7 @@ class Battle::SuccessState
|
||||
|
||||
def initialize; clear; end
|
||||
|
||||
def clear(full=true)
|
||||
def clear(full = true)
|
||||
@typeMod = Effectiveness::NORMAL_EFFECTIVE
|
||||
@useState = 0
|
||||
@protected = false
|
||||
@@ -51,14 +51,14 @@ class BattleArenaBattle < Battle
|
||||
@battleAI.battleArena = true
|
||||
end
|
||||
|
||||
def pbCanSwitchLax?(idxBattler,_idxParty,partyScene=nil)
|
||||
def pbCanSwitchLax?(idxBattler,_idxParty,partyScene = nil)
|
||||
if partyScene
|
||||
partyScene.pbDisplay(_INTL("{1} can't be switched out!",@battlers[idxBattler].pbThis))
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
def pbEORSwitch(favorDraws=false)
|
||||
def pbEORSwitch(favorDraws = false)
|
||||
return if favorDraws && @decision==5
|
||||
return if !favorDraws && @decision>0
|
||||
pbJudge
|
||||
|
||||
@@ -73,13 +73,13 @@ module RecordedBattleModule
|
||||
return Marshal.dump([pbGetBattleType,@properties,@rounds,@randomnumbers,@switches])
|
||||
end
|
||||
|
||||
def pbSwitchInBetween(idxBattler,checkLaxOnly=false,canCancel=false)
|
||||
def pbSwitchInBetween(idxBattler,checkLaxOnly = false,canCancel = false)
|
||||
ret = super
|
||||
@switches.push(ret)
|
||||
return ret
|
||||
end
|
||||
|
||||
def pbRegisterMove(idxBattler,idxMove,showMessages=true)
|
||||
def pbRegisterMove(idxBattler,idxMove,showMessages = true)
|
||||
if super
|
||||
@rounds[@roundindex][idxBattler] = [Commands::Fight,idxMove]
|
||||
return true
|
||||
@@ -92,13 +92,13 @@ module RecordedBattleModule
|
||||
@rounds[@roundindex][idxBattler][2] = idxTarget
|
||||
end
|
||||
|
||||
def pbRun(idxBattler,duringBattle=false)
|
||||
def pbRun(idxBattler,duringBattle = false)
|
||||
ret = super
|
||||
@rounds[@roundindex][idxBattler] = [Commands::Run,@decision]
|
||||
return ret
|
||||
end
|
||||
|
||||
def pbAutoChooseMove(idxBattler,showMessages=true)
|
||||
def pbAutoChooseMove(idxBattler,showMessages = true)
|
||||
ret = super
|
||||
@rounds[@roundindex][idxBattler] = [Commands::Fight,-1]
|
||||
return ret
|
||||
@@ -112,7 +112,7 @@ module RecordedBattleModule
|
||||
return false
|
||||
end
|
||||
|
||||
def pbRegisterItem(idxBattler,item,idxTarget=nil,idxMove=nil)
|
||||
def pbRegisterItem(idxBattler,item,idxTarget = nil,idxMove = nil)
|
||||
if super
|
||||
@rounds[@roundindex][idxBattler] = [Commands::Bag,item,idxTarget,idxMove]
|
||||
return true
|
||||
@@ -183,7 +183,7 @@ module RecordedBattlePlaybackModule
|
||||
super
|
||||
end
|
||||
|
||||
def pbSwitchInBetween(_idxBattler,_checkLaxOnly=false,_canCancel=false)
|
||||
def pbSwitchInBetween(_idxBattler,_checkLaxOnly = false,_canCancel = false)
|
||||
ret = @switches[@switchindex]
|
||||
@switchindex += 1
|
||||
return ret
|
||||
|
||||
@@ -46,7 +46,7 @@ end
|
||||
class DarknessSprite < SpriteWrapper
|
||||
attr_reader :radius
|
||||
|
||||
def initialize(viewport=nil)
|
||||
def initialize(viewport = nil)
|
||||
super(viewport)
|
||||
@darkness = BitmapWrapper.new(Graphics.width,Graphics.height)
|
||||
@radius = radiusMin
|
||||
@@ -91,7 +91,7 @@ end
|
||||
# Light effects
|
||||
#===============================================================================
|
||||
class LightEffect
|
||||
def initialize(event,viewport=nil,map=nil,filename=nil)
|
||||
def initialize(event,viewport = nil,map = nil,filename = nil)
|
||||
@light = IconSprite.new(0,0,viewport)
|
||||
if filename!=nil && filename!="" && pbResolveBitmap("Graphics/Pictures/"+filename)
|
||||
@light.setBitmap("Graphics/Pictures/"+filename)
|
||||
@@ -123,7 +123,7 @@ end
|
||||
|
||||
|
||||
class LightEffect_Lamp < LightEffect
|
||||
def initialize(event,viewport=nil,map=nil)
|
||||
def initialize(event,viewport = nil,map = nil)
|
||||
lamp = AnimatedBitmap.new("Graphics/Pictures/LE")
|
||||
@light = Sprite.new(viewport)
|
||||
@light.bitmap = Bitmap.new(128,64)
|
||||
|
||||
@@ -81,7 +81,7 @@ end
|
||||
#===============================================================================
|
||||
# Blacking out animation
|
||||
#===============================================================================
|
||||
def pbStartOver(gameover=false)
|
||||
def pbStartOver(gameover = false)
|
||||
if pbInBugContest?
|
||||
pbBugContestStartOver
|
||||
return
|
||||
|
||||
@@ -311,7 +311,7 @@ Events.onMapSceneChange += proc { |_sender, e|
|
||||
# Event locations, terrain tags
|
||||
#===============================================================================
|
||||
# NOTE: Assumes the event is 1x1 tile in size. Only returns one tile.
|
||||
def pbFacingTile(direction=nil,event=nil)
|
||||
def pbFacingTile(direction = nil,event = nil)
|
||||
return $map_factory.getFacingTile(direction,event) if $map_factory
|
||||
return pbFacingTileRegular(direction,event)
|
||||
end
|
||||
@@ -395,7 +395,7 @@ end
|
||||
#===============================================================================
|
||||
# Audio playing
|
||||
#===============================================================================
|
||||
def pbCueBGM(bgm,seconds,volume=nil,pitch=nil)
|
||||
def pbCueBGM(bgm,seconds,volume = nil,pitch = nil)
|
||||
return if !bgm
|
||||
bgm = pbResolveAudioFile(bgm,volume,pitch)
|
||||
playingBGM = $game_system.playing_bgm
|
||||
@@ -484,7 +484,7 @@ end
|
||||
|
||||
|
||||
|
||||
def pbMoveRoute(event,commands,waitComplete=false)
|
||||
def pbMoveRoute(event,commands,waitComplete = false)
|
||||
route = RPG::MoveRoute.new
|
||||
route.repeat = false
|
||||
route.skippable = true
|
||||
@@ -612,7 +612,7 @@ def pbMoveTowardPlayer(event)
|
||||
$PokemonMap.addMovedEvent(event.id) if $PokemonMap
|
||||
end
|
||||
|
||||
def pbJumpToward(dist=1,playSound=false,cancelSurf=false)
|
||||
def pbJumpToward(dist = 1,playSound = false,cancelSurf = false)
|
||||
x = $game_player.x
|
||||
y = $game_player.y
|
||||
case $game_player.direction
|
||||
@@ -640,7 +640,7 @@ end
|
||||
#===============================================================================
|
||||
# Bridges, cave escape points, and setting the heal point
|
||||
#===============================================================================
|
||||
def pbBridgeOn(height=2)
|
||||
def pbBridgeOn(height = 2)
|
||||
$PokemonGlobal.bridge = height
|
||||
end
|
||||
|
||||
@@ -706,7 +706,7 @@ end
|
||||
#===============================================================================
|
||||
# Picking up an item found on the ground
|
||||
#===============================================================================
|
||||
def pbItemBall(item,quantity=1)
|
||||
def pbItemBall(item,quantity = 1)
|
||||
item = GameData::Item.get(item)
|
||||
return false if !item || quantity<1
|
||||
itemname = (quantity>1) ? item.name_plural : item.name
|
||||
@@ -752,7 +752,7 @@ end
|
||||
#===============================================================================
|
||||
# Being given an item
|
||||
#===============================================================================
|
||||
def pbReceiveItem(item,quantity=1)
|
||||
def pbReceiveItem(item,quantity = 1)
|
||||
item = GameData::Item.get(item)
|
||||
return false if !item || quantity<1
|
||||
itemname = (quantity>1) ? item.name_plural : item.name
|
||||
|
||||
@@ -309,7 +309,7 @@ end
|
||||
# Standard methods that start a wild battle of various sizes
|
||||
#===============================================================================
|
||||
# Used when walking in tall grass, hence the additional code.
|
||||
def pbWildBattle(species, level, outcomeVar=1, canRun=true, canLose=false)
|
||||
def pbWildBattle(species, level, outcomeVar = 1, canRun = true, canLose = false)
|
||||
species = GameData::Species.get(species).id
|
||||
# Potentially call a different pbWildBattle-type method instead (for roaming
|
||||
# Pokémon, Safari battles, Bug Contest battles)
|
||||
@@ -329,7 +329,7 @@ def pbWildBattle(species, level, outcomeVar=1, canRun=true, canLose=false)
|
||||
end
|
||||
|
||||
def pbDoubleWildBattle(species1, level1, species2, level2,
|
||||
outcomeVar=1, canRun=true, canLose=false)
|
||||
outcomeVar = 1, canRun = true, canLose = false)
|
||||
# Set some battle rules
|
||||
setBattleRule("outcomeVar",outcomeVar) if outcomeVar!=1
|
||||
setBattleRule("cannotRun") if !canRun
|
||||
@@ -342,7 +342,7 @@ def pbDoubleWildBattle(species1, level1, species2, level2,
|
||||
end
|
||||
|
||||
def pbTripleWildBattle(species1, level1, species2, level2, species3, level3,
|
||||
outcomeVar=1, canRun=true, canLose=false)
|
||||
outcomeVar = 1, canRun = true, canLose = false)
|
||||
# Set some battle rules
|
||||
setBattleRule("outcomeVar",outcomeVar) if outcomeVar!=1
|
||||
setBattleRule("cannotRun") if !canRun
|
||||
@@ -467,8 +467,8 @@ end
|
||||
# Used by most trainer events, which can be positioned in such a way that
|
||||
# multiple trainer events spot the player at once. The extra code in this method
|
||||
# deals with that case and can cause a double trainer battle instead.
|
||||
def pbTrainerBattle(trainerID, trainerName, endSpeech=nil,
|
||||
doubleBattle=false, trainerPartyID=0, canLose=false, outcomeVar=1)
|
||||
def pbTrainerBattle(trainerID, trainerName, endSpeech = nil,
|
||||
doubleBattle = false, trainerPartyID = 0, canLose = false, outcomeVar = 1)
|
||||
# If there is another NPC trainer who spotted the player at the same time, and
|
||||
# it is possible to have a double battle (the player has 2+ able Pokémon or
|
||||
# has a partner trainer), then record this first NPC trainer into
|
||||
@@ -523,8 +523,8 @@ def pbTrainerBattle(trainerID, trainerName, endSpeech=nil,
|
||||
end
|
||||
|
||||
def pbDoubleTrainerBattle(trainerID1, trainerName1, trainerPartyID1, endSpeech1,
|
||||
trainerID2, trainerName2, trainerPartyID2=0, endSpeech2=nil,
|
||||
canLose=false, outcomeVar=1)
|
||||
trainerID2, trainerName2, trainerPartyID2 = 0, endSpeech2 = nil,
|
||||
canLose = false, outcomeVar = 1)
|
||||
# Set some battle rules
|
||||
setBattleRule("outcomeVar",outcomeVar) if outcomeVar!=1
|
||||
setBattleRule("canLose") if canLose
|
||||
@@ -540,8 +540,8 @@ end
|
||||
|
||||
def pbTripleTrainerBattle(trainerID1, trainerName1, trainerPartyID1, endSpeech1,
|
||||
trainerID2, trainerName2, trainerPartyID2, endSpeech2,
|
||||
trainerID3, trainerName3, trainerPartyID3=0, endSpeech3=nil,
|
||||
canLose=false, outcomeVar=1)
|
||||
trainerID3, trainerName3, trainerPartyID3 = 0, endSpeech3 = nil,
|
||||
canLose = false, outcomeVar = 1)
|
||||
# Set some battle rules
|
||||
setBattleRule("outcomeVar",outcomeVar) if outcomeVar!=1
|
||||
setBattleRule("canLose") if canLose
|
||||
|
||||
@@ -39,7 +39,7 @@ def pbSceneStandby
|
||||
$scene.createSpritesets if $scene && $scene.is_a?(Scene_Map)
|
||||
end
|
||||
|
||||
def pbBattleAnimation(bgm=nil,battletype=0,foe=nil)
|
||||
def pbBattleAnimation(bgm = nil,battletype = 0,foe = nil)
|
||||
$game_temp.in_battle = true
|
||||
viewport = Viewport.new(0,0,Graphics.width,Graphics.height)
|
||||
viewport.z = 99999
|
||||
|
||||
@@ -387,7 +387,7 @@ end
|
||||
# Creates and returns a Pokémon based on the given species and level.
|
||||
# Applies wild Pokémon modifiers (wild held item, shiny chance modifiers,
|
||||
# Pokérus, gender/nature forcing because of player's lead Pokémon).
|
||||
def pbGenerateWildPokemon(species,level,isRoamer=false)
|
||||
def pbGenerateWildPokemon(species,level,isRoamer = false)
|
||||
genwildpoke = Pokemon.new(species,level)
|
||||
# Give the wild Pokémon a held item
|
||||
items = genwildpoke.wildHoldItems
|
||||
|
||||
@@ -39,31 +39,31 @@ module PBDayNight
|
||||
@oneOverSixty = 1/60.0
|
||||
|
||||
# Returns true if it's day.
|
||||
def self.isDay?(time=nil)
|
||||
def self.isDay?(time = nil)
|
||||
time = pbGetTimeNow if !time
|
||||
return (time.hour>=5 && time.hour<20)
|
||||
end
|
||||
|
||||
# Returns true if it's night.
|
||||
def self.isNight?(time=nil)
|
||||
def self.isNight?(time = nil)
|
||||
time = pbGetTimeNow if !time
|
||||
return (time.hour>=20 || time.hour<5)
|
||||
end
|
||||
|
||||
# Returns true if it's morning.
|
||||
def self.isMorning?(time=nil)
|
||||
def self.isMorning?(time = nil)
|
||||
time = pbGetTimeNow if !time
|
||||
return (time.hour>=5 && time.hour<10)
|
||||
end
|
||||
|
||||
# Returns true if it's the afternoon.
|
||||
def self.isAfternoon?(time=nil)
|
||||
def self.isAfternoon?(time = nil)
|
||||
time = pbGetTimeNow if !time
|
||||
return (time.hour>=14 && time.hour<17)
|
||||
end
|
||||
|
||||
# Returns true if it's the evening.
|
||||
def self.isEvening?(time=nil)
|
||||
def self.isEvening?(time = nil)
|
||||
time = pbGetTimeNow if !time
|
||||
return (time.hour>=17 && time.hour<20)
|
||||
end
|
||||
@@ -137,7 +137,7 @@ end
|
||||
# 5 - Waning Gibbous
|
||||
# 6 - Last Quarter
|
||||
# 7 - Waning Crescent
|
||||
def moonphase(time=nil) # in UTC
|
||||
def moonphase(time = nil) # in UTC
|
||||
time = pbGetTimeNow if !time
|
||||
transitions = [
|
||||
1.8456618033125,
|
||||
|
||||
@@ -35,7 +35,7 @@ end
|
||||
|
||||
|
||||
|
||||
def pbCanUseHiddenMove?(pkmn,move,showmsg=true)
|
||||
def pbCanUseHiddenMove?(pkmn,move,showmsg = true)
|
||||
return HiddenMoveHandlers.triggerCanUseMove(move,pkmn,showmsg)
|
||||
end
|
||||
|
||||
@@ -52,7 +52,7 @@ def pbHiddenMoveEvent
|
||||
Events.onAction.trigger(nil)
|
||||
end
|
||||
|
||||
def pbCheckHiddenMoveBadge(badge=-1,showmsg=true)
|
||||
def pbCheckHiddenMoveBadge(badge = -1,showmsg = true)
|
||||
return true if badge<0 # No badge requirement
|
||||
return true if $DEBUG
|
||||
if (Settings::FIELD_MOVES_COUNT_BADGES) ? $player.badge_count >= badge : $player.badges[badge]
|
||||
@@ -368,7 +368,7 @@ def pbSurfacing
|
||||
end
|
||||
|
||||
# @deprecated This method is slated to be removed in v21.
|
||||
def pbTransferUnderwater(mapid,x,y,direction=$game_player.direction)
|
||||
def pbTransferUnderwater(mapid,x,y,direction = $game_player.direction)
|
||||
Deprecation.warn_method('pbTransferUnderwater', 'v21', '"Transfer Player" event command')
|
||||
pbFadeOutIn {
|
||||
$game_temp.player_new_map_id = mapid
|
||||
@@ -560,7 +560,7 @@ HiddenMoveHandlers::UseMove.add(:FLY,proc { |move, pkmn|
|
||||
#===============================================================================
|
||||
# Headbutt
|
||||
#===============================================================================
|
||||
def pbHeadbuttEffect(event=nil)
|
||||
def pbHeadbuttEffect(event = nil)
|
||||
event = $game_player.pbFacingEvent(true) if !event
|
||||
a = (event.x+(event.x/24).floor+1)*(event.y+(event.y/24).floor+1)
|
||||
a = (a*2/5)%10 # Even 2x as likely as odd, 0 is 1.5x as likely as odd
|
||||
@@ -585,7 +585,7 @@ def pbHeadbuttEffect(event=nil)
|
||||
end
|
||||
end
|
||||
|
||||
def pbHeadbutt(event=nil)
|
||||
def pbHeadbutt(event = nil)
|
||||
move = :HEADBUTT
|
||||
movefinder = $player.get_pokemon_with_move(move)
|
||||
if !$DEBUG && !movefinder
|
||||
@@ -781,7 +781,7 @@ def pbEndSurf(_xOffset,_yOffset)
|
||||
end
|
||||
|
||||
# @deprecated This method is slated to be removed in v21.
|
||||
def pbTransferSurfing(mapid,xcoord,ycoord,direction=$game_player.direction)
|
||||
def pbTransferSurfing(mapid,xcoord,ycoord,direction = $game_player.direction)
|
||||
Deprecation.warn_method('pbTransferSurfing', 'v21', '"Transfer Player" event command')
|
||||
pbFadeOutIn {
|
||||
$game_temp.player_new_map_id = mapid
|
||||
|
||||
@@ -37,7 +37,7 @@ def pbFishingEnd
|
||||
$PokemonGlobal.fishing = false
|
||||
end
|
||||
|
||||
def pbFishing(hasEncounter,rodType=1)
|
||||
def pbFishing(hasEncounter,rodType = 1)
|
||||
$stats.fishing_count += 1
|
||||
speedup = ($player.first_pokemon && [:STICKYHOLD, :SUCTIONCUPS].include?($player.first_pokemon.ability_id))
|
||||
biteChance = 20+(25*rodType) # 45, 70, 95
|
||||
|
||||
@@ -91,7 +91,7 @@ module ItemHandlers
|
||||
return [UseOnPokemonMaximum.trigger(item, pkmn), 1].max
|
||||
end
|
||||
|
||||
def self.triggerCanUseInBattle(item,pkmn,battler,move,firstAction,battle,scene,showMessages=true)
|
||||
def self.triggerCanUseInBattle(item,pkmn,battler,move,firstAction,battle,scene,showMessages = true)
|
||||
return true if !CanUseInBattle[item] # Can use the item by default
|
||||
return CanUseInBattle.trigger(item,pkmn,battler,move,firstAction,battle,scene,showMessages)
|
||||
end
|
||||
@@ -640,7 +640,7 @@ end
|
||||
# Use an item from the Bag and/or on a Pokémon
|
||||
#===============================================================================
|
||||
# @return [Integer] 0 = item wasn't used; 1 = item used; 2 = close Bag to use in field
|
||||
def pbUseItem(bag,item,bagscene=nil)
|
||||
def pbUseItem(bag,item,bagscene = nil)
|
||||
itm = GameData::Item.get(item)
|
||||
useType = itm.field_use
|
||||
if itm.is_machine? # TM or TR or HM
|
||||
@@ -794,7 +794,7 @@ end
|
||||
#===============================================================================
|
||||
# Give an item to a Pokémon to hold, and take a held item from a Pokémon
|
||||
#===============================================================================
|
||||
def pbGiveItemToPokemon(item,pkmn,scene,pkmnid=0)
|
||||
def pbGiveItemToPokemon(item,pkmn,scene,pkmnid = 0)
|
||||
newitemname = GameData::Item.get(item).name
|
||||
if pkmn.egg?
|
||||
scene.pbDisplay(_INTL("Eggs can't hold items."))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#===============================================================================
|
||||
# Register contacts
|
||||
#===============================================================================
|
||||
def pbPhoneRegisterNPC(ident,name,mapid,showmessage=true)
|
||||
def pbPhoneRegisterNPC(ident,name,mapid,showmessage = true)
|
||||
$PokemonGlobal.phoneNumbers = [] if !$PokemonGlobal.phoneNumbers
|
||||
exists = pbFindPhoneTrainer(ident,name)
|
||||
if exists
|
||||
|
||||
@@ -55,7 +55,7 @@ def pbPokeRadarCancel
|
||||
$game_temp.poke_radar_data = nil
|
||||
end
|
||||
|
||||
def pbPokeRadarHighlightGrass(showmessage=true)
|
||||
def pbPokeRadarHighlightGrass(showmessage = true)
|
||||
grasses = [] # x, y, ring (0-3 inner to outer), rarity
|
||||
# Choose 1 random tile from each ring around the player
|
||||
for i in 0...4
|
||||
|
||||
@@ -23,12 +23,12 @@ def pbMoveToMailbox(pokemon)
|
||||
return true
|
||||
end
|
||||
|
||||
def pbStoreMail(pkmn,item,message,poke1=nil,poke2=nil,poke3=nil)
|
||||
def pbStoreMail(pkmn,item,message,poke1 = nil,poke2 = nil,poke3 = nil)
|
||||
raise _INTL("Pokémon already has mail") if pkmn.mail
|
||||
pkmn.mail = Mail.new(item, message, $player.name, poke1, poke2, poke3)
|
||||
end
|
||||
|
||||
def pbDisplayMail(mail,_bearer=nil)
|
||||
def pbDisplayMail(mail,_bearer = nil)
|
||||
sprites = {}
|
||||
viewport = Viewport.new(0,0,Graphics.width,Graphics.height)
|
||||
viewport.z = 99999
|
||||
|
||||
@@ -7,7 +7,7 @@ class ItemIconSprite < SpriteWrapper
|
||||
ANIM_ICON_SIZE = 48
|
||||
FRAMES_PER_CYCLE = Graphics.frame_rate
|
||||
|
||||
def initialize(x,y,item,viewport=nil)
|
||||
def initialize(x,y,item,viewport = nil)
|
||||
super(viewport)
|
||||
@animbitmap = nil
|
||||
@animframe = 0
|
||||
@@ -42,7 +42,7 @@ class ItemIconSprite < SpriteWrapper
|
||||
@forceitemchange = false
|
||||
end
|
||||
|
||||
def setOffset(offset=PictureOrigin::Center)
|
||||
def setOffset(offset = PictureOrigin::Center)
|
||||
@offset = offset
|
||||
changeOrigin
|
||||
end
|
||||
@@ -116,7 +116,7 @@ end
|
||||
# Item held icon (used in the party screen)
|
||||
#===============================================================================
|
||||
class HeldItemIconSprite < SpriteWrapper
|
||||
def initialize(x,y,pokemon,viewport=nil)
|
||||
def initialize(x,y,pokemon,viewport = nil)
|
||||
super(viewport)
|
||||
self.x = x
|
||||
self.y = y
|
||||
|
||||
@@ -76,7 +76,7 @@ class RelicStoneScene
|
||||
@viewport.dispose
|
||||
end
|
||||
|
||||
def pbDisplay(msg,brief=false)
|
||||
def pbDisplay(msg,brief = false)
|
||||
UIHelper.pbDisplay(@sprites["msgwindow"],msg,brief) { pbUpdate }
|
||||
end
|
||||
|
||||
@@ -170,7 +170,7 @@ end
|
||||
class Battle
|
||||
alias __shadow__pbCanUseItemOnPokemon? pbCanUseItemOnPokemon?
|
||||
|
||||
def pbCanUseItemOnPokemon?(item,pkmn,battler,scene,showMessages=true)
|
||||
def pbCanUseItemOnPokemon?(item,pkmn,battler,scene,showMessages = true)
|
||||
ret = __shadow__pbCanUseItemOnPokemon?(item,pkmn,battler,scene,showMessages)
|
||||
if ret && pkmn.hyper_mode && ![:JOYSCENT, :EXCITESCENT, :VIVIDSCENT].include?(item)
|
||||
scene.pbDisplay(_INTL("This item can't be used on that Pokémon."))
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Pokémon sprite (used out of battle)
|
||||
#===============================================================================
|
||||
class PokemonSprite < SpriteWrapper
|
||||
def initialize(viewport=nil)
|
||||
def initialize(viewport = nil)
|
||||
super(viewport)
|
||||
@_iconbitmap = nil
|
||||
end
|
||||
@@ -20,7 +20,7 @@ class PokemonSprite < SpriteWrapper
|
||||
self.bitmap = nil
|
||||
end
|
||||
|
||||
def setOffset(offset=PictureOrigin::Center)
|
||||
def setOffset(offset = PictureOrigin::Center)
|
||||
@offset = offset
|
||||
changeOrigin
|
||||
end
|
||||
@@ -46,7 +46,7 @@ class PokemonSprite < SpriteWrapper
|
||||
end
|
||||
end
|
||||
|
||||
def setPokemonBitmap(pokemon,back=false)
|
||||
def setPokemonBitmap(pokemon,back = false)
|
||||
@_iconbitmap.dispose if @_iconbitmap
|
||||
@_iconbitmap = (pokemon) ? GameData::Species.sprite_bitmap_from_pokemon(pokemon, back) : nil
|
||||
self.bitmap = (@_iconbitmap) ? @_iconbitmap.bitmap : nil
|
||||
@@ -54,7 +54,7 @@ class PokemonSprite < SpriteWrapper
|
||||
changeOrigin
|
||||
end
|
||||
|
||||
def setPokemonBitmapSpecies(pokemon,species,back=false)
|
||||
def setPokemonBitmapSpecies(pokemon,species,back = false)
|
||||
@_iconbitmap.dispose if @_iconbitmap
|
||||
@_iconbitmap = (pokemon) ? GameData::Species.sprite_bitmap_from_pokemon(pokemon, back, species) : nil
|
||||
self.bitmap = (@_iconbitmap) ? @_iconbitmap.bitmap : nil
|
||||
@@ -87,7 +87,7 @@ class PokemonIconSprite < SpriteWrapper
|
||||
attr_accessor :active
|
||||
attr_reader :pokemon
|
||||
|
||||
def initialize(pokemon,viewport=nil)
|
||||
def initialize(pokemon,viewport = nil)
|
||||
super(viewport)
|
||||
@selected = false
|
||||
@active = false
|
||||
@@ -138,7 +138,7 @@ class PokemonIconSprite < SpriteWrapper
|
||||
changeOrigin
|
||||
end
|
||||
|
||||
def setOffset(offset=PictureOrigin::Center)
|
||||
def setOffset(offset = PictureOrigin::Center)
|
||||
@offset = offset
|
||||
changeOrigin
|
||||
end
|
||||
@@ -223,7 +223,7 @@ class PokemonSpeciesIconSprite < SpriteWrapper
|
||||
attr_reader :form
|
||||
attr_reader :shiny
|
||||
|
||||
def initialize(species,viewport=nil)
|
||||
def initialize(species,viewport = nil)
|
||||
super(viewport)
|
||||
@species = species
|
||||
@gender = 0
|
||||
@@ -260,7 +260,7 @@ class PokemonSpeciesIconSprite < SpriteWrapper
|
||||
refresh
|
||||
end
|
||||
|
||||
def pbSetParams(species,gender,form,shiny=false)
|
||||
def pbSetParams(species,gender,form,shiny = false)
|
||||
@species = species
|
||||
@gender = gender
|
||||
@form = form
|
||||
@@ -268,7 +268,7 @@ class PokemonSpeciesIconSprite < SpriteWrapper
|
||||
refresh
|
||||
end
|
||||
|
||||
def setOffset(offset=PictureOrigin::Center)
|
||||
def setOffset(offset = PictureOrigin::Center)
|
||||
@offset = offset
|
||||
changeOrigin
|
||||
end
|
||||
|
||||
@@ -154,7 +154,7 @@ class PokemonStorage
|
||||
return -1
|
||||
end
|
||||
|
||||
def [](x,y=nil)
|
||||
def [](x,y = nil)
|
||||
if y==nil
|
||||
return (x==-1) ? self.party : @boxes[x]
|
||||
else
|
||||
@@ -338,7 +338,7 @@ class RegionalStorage
|
||||
getCurrentStorage.currentBox = value
|
||||
end
|
||||
|
||||
def [](x,y=nil)
|
||||
def [](x,y = nil)
|
||||
getCurrentStorage[x,y]
|
||||
end
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user