diff --git a/Data/Scripts/001_Technical/001_Debugging/003_Errors.rb b/Data/Scripts/001_Technical/001_Debugging/003_Errors.rb index 22b6eea1e..0eba02855 100644 --- a/Data/Scripts/001_Technical/001_Debugging/003_Errors.rb +++ b/Data/Scripts/001_Technical/001_Debugging/003_Errors.rb @@ -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) diff --git a/Data/Scripts/001_Technical/002_Files/001_FileTests.rb b/Data/Scripts/001_Technical/002_Files/001_FileTests.rb index a39456647..ecbfa0ba1 100644 --- a/Data/Scripts/001_Technical/002_Files/001_FileTests.rb +++ b/Data/Scripts/001_Technical/002_Files/001_FileTests.rb @@ -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 diff --git a/Data/Scripts/001_Technical/002_Files/003_HTTP_Utilities.rb b/Data/Scripts/001_Technical/002_Files/003_HTTP_Utilities.rb index 11157ace3..a53599bfe 100644 --- a/Data/Scripts/001_Technical/002_Files/003_HTTP_Utilities.rb +++ b/Data/Scripts/001_Technical/002_Files/003_HTTP_Utilities.rb @@ -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 diff --git a/Data/Scripts/001_Technical/003_Intl_Messages.rb b/Data/Scripts/001_Technical/003_Intl_Messages.rb index 7df576b41..143fc20a3 100644 --- a/Data/Scripts/001_Technical/003_Intl_Messages.rb +++ b/Data/Scripts/001_Technical/003_Intl_Messages.rb @@ -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 diff --git a/Data/Scripts/003_Game processing/005_Event_Handlers.rb b/Data/Scripts/003_Game processing/005_Event_Handlers.rb index 4fbf06ab6..309375749 100644 --- a/Data/Scripts/003_Game processing/005_Event_Handlers.rb +++ b/Data/Scripts/003_Game processing/005_Event_Handlers.rb @@ -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 diff --git a/Data/Scripts/004_Game classes/002_Game_System.rb b/Data/Scripts/004_Game classes/002_Game_System.rb index 3ce1b249b..2312c4659 100644 --- a/Data/Scripts/004_Game classes/002_Game_System.rb +++ b/Data/Scripts/004_Game classes/002_Game_System.rb @@ -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 diff --git a/Data/Scripts/004_Game classes/004_Game_Map.rb b/Data/Scripts/004_Game classes/004_Game_Map.rb index 0e36302e7..bdf87a956 100644 --- a/Data/Scripts/004_Game classes/004_Game_Map.rb +++ b/Data/Scripts/004_Game classes/004_Game_Map.rb @@ -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] diff --git a/Data/Scripts/004_Game classes/005_Game_Map_Autoscroll.rb b/Data/Scripts/004_Game classes/005_Game_Map_Autoscroll.rb index cf6605e37..35478091f 100644 --- a/Data/Scripts/004_Game classes/005_Game_Map_Autoscroll.rb +++ b/Data/Scripts/004_Game classes/005_Game_Map_Autoscroll.rb @@ -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 diff --git a/Data/Scripts/004_Game classes/006_Game_MapFactory.rb b/Data/Scripts/004_Game classes/006_Game_MapFactory.rb index b2d50c87f..20ffa4368 100644 --- a/Data/Scripts/004_Game classes/006_Game_MapFactory.rb +++ b/Data/Scripts/004_Game classes/006_Game_MapFactory.rb @@ -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 diff --git a/Data/Scripts/004_Game classes/007_Game_Character.rb b/Data/Scripts/004_Game classes/007_Game_Character.rb index d75daa915..4dc20b4de 100644 --- a/Data/Scripts/004_Game classes/007_Game_Character.rb +++ b/Data/Scripts/004_Game classes/007_Game_Character.rb @@ -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 diff --git a/Data/Scripts/004_Game classes/008_Game_Event.rb b/Data/Scripts/004_Game classes/008_Game_Event.rb index 40965fdc3..e4b64dafe 100644 --- a/Data/Scripts/004_Game classes/008_Game_Event.rb +++ b/Data/Scripts/004_Game classes/008_Game_Event.rb @@ -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 diff --git a/Data/Scripts/004_Game classes/009_Game_Player.rb b/Data/Scripts/004_Game classes/009_Game_Player.rb index f408eefda..f8f96897c 100644 --- a/Data/Scripts/004_Game classes/009_Game_Player.rb +++ b/Data/Scripts/004_Game classes/009_Game_Player.rb @@ -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) diff --git a/Data/Scripts/005_Sprites/002_Sprite_Timer.rb b/Data/Scripts/005_Sprites/002_Sprite_Timer.rb index 4e5b26274..c5d82742c 100644 --- a/Data/Scripts/005_Sprites/002_Sprite_Timer.rb +++ b/Data/Scripts/005_Sprites/002_Sprite_Timer.rb @@ -1,5 +1,5 @@ class Sprite_Timer - def initialize(viewport=nil) + def initialize(viewport = nil) @viewport=viewport @timer=nil @total_sec=nil diff --git a/Data/Scripts/005_Sprites/004_Sprite_Reflection.rb b/Data/Scripts/005_Sprites/004_Sprite_Reflection.rb index dda104aa8..d30f0803e 100644 --- a/Data/Scripts/005_Sprites/004_Sprite_Reflection.rb +++ b/Data/Scripts/005_Sprites/004_Sprite_Reflection.rb @@ -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 diff --git a/Data/Scripts/005_Sprites/005_Sprite_SurfBase.rb b/Data/Scripts/005_Sprites/005_Sprite_SurfBase.rb index 1982dff3c..ffe8727fa 100644 --- a/Data/Scripts/005_Sprites/005_Sprite_SurfBase.rb +++ b/Data/Scripts/005_Sprites/005_Sprite_SurfBase.rb @@ -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 diff --git a/Data/Scripts/005_Sprites/007_Spriteset_Map.rb b/Data/Scripts/005_Sprites/007_Spriteset_Map.rb index ec88e5d8e..75673ac65 100644 --- a/Data/Scripts/005_Sprites/007_Spriteset_Map.rb +++ b/Data/Scripts/005_Sprites/007_Spriteset_Map.rb @@ -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) } diff --git a/Data/Scripts/005_Sprites/008_Sprite_AnimationSprite.rb b/Data/Scripts/005_Sprites/008_Sprite_AnimationSprite.rb index 0713535b5..7b2fa9ff8 100644 --- a/Data/Scripts/005_Sprites/008_Sprite_AnimationSprite.rb +++ b/Data/Scripts/005_Sprites/008_Sprite_AnimationSprite.rb @@ -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 diff --git a/Data/Scripts/005_Sprites/009_Sprite_DynamicShadows.rb b/Data/Scripts/005_Sprites/009_Sprite_DynamicShadows.rb index f170ef521..0b17218d0 100644 --- a/Data/Scripts/005_Sprites/009_Sprite_DynamicShadows.rb +++ b/Data/Scripts/005_Sprites/009_Sprite_DynamicShadows.rb @@ -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 diff --git a/Data/Scripts/005_Sprites/010_ParticleEngine.rb b/Data/Scripts/005_Sprites/010_ParticleEngine.rb index 37faeceaf..b6e212a34 100644 --- a/Data/Scripts/005_Sprites/010_ParticleEngine.rb +++ b/Data/Scripts/005_Sprites/010_ParticleEngine.rb @@ -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) diff --git a/Data/Scripts/005_Sprites/011_PictureEx.rb b/Data/Scripts/005_Sprites/011_PictureEx.rb index 08a590b4f..b8a3394f4 100644 --- a/Data/Scripts/005_Sprites/011_PictureEx.rb +++ b/Data/Scripts/005_Sprites/011_PictureEx.rb @@ -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] diff --git a/Data/Scripts/005_Sprites/013_ScreenPosHelper.rb b/Data/Scripts/005_Sprites/013_ScreenPosHelper.rb index 418bbd9bf..5c354ff21 100644 --- a/Data/Scripts/005_Sprites/013_ScreenPosHelper.rb +++ b/Data/Scripts/005_Sprites/013_ScreenPosHelper.rb @@ -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 diff --git a/Data/Scripts/006_Map renderer/004_TileDrawingHelper.rb b/Data/Scripts/006_Map renderer/004_TileDrawingHelper.rb index 443304e15..487e7c9da 100644 --- a/Data/Scripts/006_Map renderer/004_TileDrawingHelper.rb +++ b/Data/Scripts/006_Map renderer/004_TileDrawingHelper.rb @@ -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 diff --git a/Data/Scripts/007_Objects and windows/002_MessageConfig.rb b/Data/Scripts/007_Objects and windows/002_MessageConfig.rb index 5c060db1d..1ed0134c9 100644 --- a/Data/Scripts/007_Objects and windows/002_MessageConfig.rb +++ b/Data/Scripts/007_Objects and windows/002_MessageConfig.rb @@ -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 diff --git a/Data/Scripts/007_Objects and windows/003_Window.rb b/Data/Scripts/007_Objects and windows/003_Window.rb index db62d0247..0b385b6da 100644 --- a/Data/Scripts/007_Objects and windows/003_Window.rb +++ b/Data/Scripts/007_Objects and windows/003_Window.rb @@ -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 diff --git a/Data/Scripts/007_Objects and windows/004_SpriteWindow.rb b/Data/Scripts/007_Objects and windows/004_SpriteWindow.rb index 63fccb92c..d49967aa2 100644 --- a/Data/Scripts/007_Objects and windows/004_SpriteWindow.rb +++ b/Data/Scripts/007_Objects and windows/004_SpriteWindow.rb @@ -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 diff --git a/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb b/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb index 7d6461919..6ae8c6c74 100644 --- a/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb +++ b/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb @@ -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] diff --git a/Data/Scripts/007_Objects and windows/006_SpriteWindow_pictures.rb b/Data/Scripts/007_Objects and windows/006_SpriteWindow_pictures.rb index 7c85dfac5..eb59e3211 100644 --- a/Data/Scripts/007_Objects and windows/006_SpriteWindow_pictures.rb +++ b/Data/Scripts/007_Objects and windows/006_SpriteWindow_pictures.rb @@ -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) diff --git a/Data/Scripts/007_Objects and windows/007_SpriteWrapper.rb b/Data/Scripts/007_Objects and windows/007_SpriteWrapper.rb index fb9b972b5..00c08e0ba 100644 --- a/Data/Scripts/007_Objects and windows/007_SpriteWrapper.rb +++ b/Data/Scripts/007_Objects and windows/007_SpriteWrapper.rb @@ -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 diff --git a/Data/Scripts/007_Objects and windows/008_AnimatedBitmap.rb b/Data/Scripts/007_Objects and windows/008_AnimatedBitmap.rb index 3f3dfb16f..e6e1a90c4 100644 --- a/Data/Scripts/007_Objects and windows/008_AnimatedBitmap.rb +++ b/Data/Scripts/007_Objects and windows/008_AnimatedBitmap.rb @@ -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 diff --git a/Data/Scripts/007_Objects and windows/010_DrawText.rb b/Data/Scripts/007_Objects and windows/010_DrawText.rb index ff2de575a..17ffdb44c 100644 --- a/Data/Scripts/007_Objects and windows/010_DrawText.rb +++ b/Data/Scripts/007_Objects and windows/010_DrawText.rb @@ -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=""+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 diff --git a/Data/Scripts/007_Objects and windows/011_Messages.rb b/Data/Scripts/007_Objects and windows/011_Messages.rb index f9a930f05..777fee6f6 100644 --- a/Data/Scripts/007_Objects and windows/011_Messages.rb +++ b/Data/Scripts/007_Objects and windows/011_Messages.rb @@ -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| diff --git a/Data/Scripts/007_Objects and windows/012_TextEntry.rb b/Data/Scripts/007_Objects and windows/012_TextEntry.rb index 39b0e0d62..a75363d90 100644 --- a/Data/Scripts/007_Objects and windows/012_TextEntry.rb +++ b/Data/Scripts/007_Objects and windows/012_TextEntry.rb @@ -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] diff --git a/Data/Scripts/008_Audio/001_Audio.rb b/Data/Scripts/008_Audio/001_Audio.rb index 01d47a01b..d33631abb 100644 --- a/Data/Scripts/008_Audio/001_Audio.rb +++ b/Data/Scripts/008_Audio/001_Audio.rb @@ -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 diff --git a/Data/Scripts/008_Audio/002_Audio_Play.rb b/Data/Scripts/008_Audio/002_Audio_Play.rb index ab2fcb9c2..7fdc8624a 100644 --- a/Data/Scripts/008_Audio/002_Audio_Play.rb +++ b/Data/Scripts/008_Audio/002_Audio_Play.rb @@ -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) diff --git a/Data/Scripts/009_Scenes/002_EventScene.rb b/Data/Scripts/009_Scenes/002_EventScene.rb index 94e9de3e1..9b633c685 100644 --- a/Data/Scripts/009_Scenes/002_EventScene.rb +++ b/Data/Scripts/009_Scenes/002_EventScene.rb @@ -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 diff --git a/Data/Scripts/011_Battle/001_Battle/001_Battle.rb b/Data/Scripts/011_Battle/001_Battle/001_Battle.rb index 4d9bf0b74..83581f037 100644 --- a/Data/Scripts/011_Battle/001_Battle/001_Battle.rb +++ b/Data/Scripts/011_Battle/001_Battle/001_Battle.rb @@ -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) diff --git a/Data/Scripts/011_Battle/001_Battle/002_Battle_StartAndEnd.rb b/Data/Scripts/011_Battle/001_Battle/002_Battle_StartAndEnd.rb index fb659ed38..fc6c0b7c9 100644 --- a/Data/Scripts/011_Battle/001_Battle/002_Battle_StartAndEnd.rb +++ b/Data/Scripts/011_Battle/001_Battle/002_Battle_StartAndEnd.rb @@ -491,7 +491,7 @@ class Battle #============================================================================= # Judging #============================================================================= - def pbJudgeCheckpoint(user,move=nil); end + def pbJudgeCheckpoint(user,move = nil); end def pbDecisionOnTime counts = [0,0] diff --git a/Data/Scripts/011_Battle/001_Battle/003_Battle_ExpAndMoveLearning.rb b/Data/Scripts/011_Battle/001_Battle/003_Battle_ExpAndMoveLearning.rb index 36d7163a1..5b5f9a0e6 100644 --- a/Data/Scripts/011_Battle/001_Battle/003_Battle_ExpAndMoveLearning.rb +++ b/Data/Scripts/011_Battle/001_Battle/003_Battle_ExpAndMoveLearning.rb @@ -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 diff --git a/Data/Scripts/011_Battle/001_Battle/004_Battle_ActionAttacksPriority.rb b/Data/Scripts/011_Battle/001_Battle/004_Battle_ActionAttacksPriority.rb index 22a9f2444..b91ab1424 100644 --- a/Data/Scripts/011_Battle/001_Battle/004_Battle_ActionAttacksPriority.rb +++ b/Data/Scripts/011_Battle/001_Battle/004_Battle_ActionAttacksPriority.rb @@ -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. diff --git a/Data/Scripts/011_Battle/001_Battle/005_Battle_ActionSwitching.rb b/Data/Scripts/011_Battle/001_Battle/005_Battle_ActionSwitching.rb index b18014dc9..493d5be32 100644 --- a/Data/Scripts/011_Battle/001_Battle/005_Battle_ActionSwitching.rb +++ b/Data/Scripts/011_Battle/001_Battle/005_Battle_ActionSwitching.rb @@ -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| diff --git a/Data/Scripts/011_Battle/001_Battle/006_Battle_ActionUseItem.rb b/Data/Scripts/011_Battle/001_Battle/006_Battle_ActionUseItem.rb index cf5e134c3..e71004a9b 100644 --- a/Data/Scripts/011_Battle/001_Battle/006_Battle_ActionUseItem.rb +++ b/Data/Scripts/011_Battle/001_Battle/006_Battle_ActionUseItem.rb @@ -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 diff --git a/Data/Scripts/011_Battle/001_Battle/007_Battle_ActionRunning.rb b/Data/Scripts/011_Battle/001_Battle/007_Battle_ActionRunning.rb index 01d85123b..b6b444ee2 100644 --- a/Data/Scripts/011_Battle/001_Battle/007_Battle_ActionRunning.rb +++ b/Data/Scripts/011_Battle/001_Battle/007_Battle_ActionRunning.rb @@ -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? diff --git a/Data/Scripts/011_Battle/002_Battler/001_Battle_Battler.rb b/Data/Scripts/011_Battle/002_Battler/001_Battle_Battler.rb index 71659d9bb..ead2596c7 100644 --- a/Data/Scripts/011_Battle/002_Battler/001_Battle_Battler.rb +++ b/Data/Scripts/011_Battle/002_Battler/001_Battle_Battler.rb @@ -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? diff --git a/Data/Scripts/011_Battle/002_Battler/002_Battler_Initialize.rb b/Data/Scripts/011_Battle/002_Battler/002_Battler_Initialize.rb index e11ee40b5..bcd1785fb 100644 --- a/Data/Scripts/011_Battle/002_Battler/002_Battler_Initialize.rb +++ b/Data/Scripts/011_Battle/002_Battler/002_Battler_Initialize.rb @@ -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 diff --git a/Data/Scripts/011_Battle/002_Battler/003_Battler_ChangeSelf.rb b/Data/Scripts/011_Battle/002_Battler/003_Battler_ChangeSelf.rb index ff688c39e..c1cd50e82 100644 --- a/Data/Scripts/011_Battle/002_Battler/003_Battler_ChangeSelf.rb +++ b/Data/Scripts/011_Battle/002_Battler/003_Battler_ChangeSelf.rb @@ -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 diff --git a/Data/Scripts/011_Battle/002_Battler/004_Battler_Statuses.rb b/Data/Scripts/011_Battle/002_Battler/004_Battler_Statuses.rb index d6096a54a..501bd6bc4 100644 --- a/Data/Scripts/011_Battle/002_Battler/004_Battler_Statuses.rb +++ b/Data/Scripts/011_Battle/002_Battler/004_Battler_Statuses.rb @@ -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 diff --git a/Data/Scripts/011_Battle/002_Battler/005_Battler_StatStages.rb b/Data/Scripts/011_Battle/002_Battler/005_Battler_StatStages.rb index c6edef241..abc64aa45 100644 --- a/Data/Scripts/011_Battle/002_Battler/005_Battler_StatStages.rb +++ b/Data/Scripts/011_Battle/002_Battler/005_Battler_StatStages.rb @@ -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) && diff --git a/Data/Scripts/011_Battle/002_Battler/006_Battler_AbilityAndItem.rb b/Data/Scripts/011_Battle/002_Battler/006_Battler_AbilityAndItem.rb index c7eec8a15..0252bc317 100644 --- a/Data/Scripts/011_Battle/002_Battler/006_Battler_AbilityAndItem.rb +++ b/Data/Scripts/011_Battle/002_Battler/006_Battler_AbilityAndItem.rb @@ -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) diff --git a/Data/Scripts/011_Battle/002_Battler/007_Battler_UseMove.rb b/Data/Scripts/011_Battle/002_Battler/007_Battler_UseMove.rb index 2d47a2652..2389f69ce 100644 --- a/Data/Scripts/011_Battle/002_Battler/007_Battler_UseMove.rb +++ b/Data/Scripts/011_Battle/002_Battler/007_Battler_UseMove.rb @@ -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) diff --git a/Data/Scripts/011_Battle/002_Battler/008_Battler_UseMoveTargeting.rb b/Data/Scripts/011_Battle/002_Battler/008_Battler_UseMoveTargeting.rb index 05d98aa2a..a36759f87 100644 --- a/Data/Scripts/011_Battle/002_Battler/008_Battler_UseMoveTargeting.rb +++ b/Data/Scripts/011_Battle/002_Battler/008_Battler_UseMoveTargeting.rb @@ -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) diff --git a/Data/Scripts/011_Battle/002_Battler/009_Battler_UseMoveSuccessChecks.rb b/Data/Scripts/011_Battle/002_Battler/009_Battler_UseMoveSuccessChecks.rb index e3e2429cf..087fce1d9 100644 --- a/Data/Scripts/011_Battle/002_Battler/009_Battler_UseMoveSuccessChecks.rb +++ b/Data/Scripts/011_Battle/002_Battler/009_Battler_UseMoveSuccessChecks.rb @@ -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 diff --git a/Data/Scripts/011_Battle/003_Move/001_Battle_Move.rb b/Data/Scripts/011_Battle/003_Move/001_Battle_Move.rb index 1fd09f867..c75fd3401 100644 --- a/Data/Scripts/011_Battle/003_Move/001_Battle_Move.rb +++ b/Data/Scripts/011_Battle/003_Move/001_Battle_Move.rb @@ -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 diff --git a/Data/Scripts/011_Battle/003_Move/002_Move_Usage.rb b/Data/Scripts/011_Battle/003_Move/002_Move_Usage.rb index 96920ca39..6fab891f5 100644 --- a/Data/Scripts/011_Battle/003_Move/002_Move_Usage.rb +++ b/Data/Scripts/011_Battle/003_Move/002_Move_Usage.rb @@ -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))) diff --git a/Data/Scripts/011_Battle/003_Move/003_Move_UsageCalculations.rb b/Data/Scripts/011_Battle/003_Move/003_Move_UsageCalculations.rb index 59b6bcf7d..f86a04442 100644 --- a/Data/Scripts/011_Battle/003_Move/003_Move_UsageCalculations.rb +++ b/Data/Scripts/011_Battle/003_Move/003_Move_UsageCalculations.rb @@ -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" diff --git a/Data/Scripts/011_Battle/003_Move/004_Move_BaseEffects.rb b/Data/Scripts/011_Battle/003_Move/004_Move_BaseEffects.rb index 546aa57be..829cb5526 100644 --- a/Data/Scripts/011_Battle/003_Move/004_Move_BaseEffects.rb +++ b/Data/Scripts/011_Battle/003_Move/004_Move_BaseEffects.rb @@ -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 diff --git a/Data/Scripts/011_Battle/003_Move/005_MoveEffects_Misc.rb b/Data/Scripts/011_Battle/003_Move/005_MoveEffects_Misc.rb index a9a9c6a3d..3bb310057 100644 --- a/Data/Scripts/011_Battle/003_Move/005_MoveEffects_Misc.rb +++ b/Data/Scripts/011_Battle/003_Move/005_MoveEffects_Misc.rb @@ -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 diff --git a/Data/Scripts/011_Battle/003_Move/006_MoveEffects_BattlerStats.rb b/Data/Scripts/011_Battle/003_Move/006_MoveEffects_BattlerStats.rb index 72664d3a0..9b5061c54 100644 --- a/Data/Scripts/011_Battle/003_Move/006_MoveEffects_BattlerStats.rb +++ b/Data/Scripts/011_Battle/003_Move/006_MoveEffects_BattlerStats.rb @@ -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 diff --git a/Data/Scripts/011_Battle/003_Move/007_MoveEffects_BattlerOther.rb b/Data/Scripts/011_Battle/003_Move/007_MoveEffects_BattlerOther.rb index 7a8d85b73..7f445fcf6 100644 --- a/Data/Scripts/011_Battle/003_Move/007_MoveEffects_BattlerOther.rb +++ b/Data/Scripts/011_Battle/003_Move/007_MoveEffects_BattlerOther.rb @@ -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 diff --git a/Data/Scripts/011_Battle/003_Move/008_MoveEffects_MoveAttributes.rb b/Data/Scripts/011_Battle/003_Move/008_MoveEffects_MoveAttributes.rb index 2909c6a5d..d025f53b6 100644 --- a/Data/Scripts/011_Battle/003_Move/008_MoveEffects_MoveAttributes.rb +++ b/Data/Scripts/011_Battle/003_Move/008_MoveEffects_MoveAttributes.rb @@ -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 diff --git a/Data/Scripts/011_Battle/003_Move/009_MoveEffects_MultiHit.rb b/Data/Scripts/011_Battle/003_Move/009_MoveEffects_MultiHit.rb index 898bb35ab..d47339ad3 100644 --- a/Data/Scripts/011_Battle/003_Move/009_MoveEffects_MultiHit.rb +++ b/Data/Scripts/011_Battle/003_Move/009_MoveEffects_MultiHit.rb @@ -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 diff --git a/Data/Scripts/011_Battle/003_Move/010_MoveEffects_Healing.rb b/Data/Scripts/011_Battle/003_Move/010_MoveEffects_Healing.rb index 7ec9dedcd..5b4a8d8f0 100644 --- a/Data/Scripts/011_Battle/003_Move/010_MoveEffects_Healing.rb +++ b/Data/Scripts/011_Battle/003_Move/010_MoveEffects_Healing.rb @@ -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 diff --git a/Data/Scripts/011_Battle/003_Move/011_MoveEffects_Items.rb b/Data/Scripts/011_Battle/003_Move/011_MoveEffects_Items.rb index d86a4de87..5dbea8eb5 100644 --- a/Data/Scripts/011_Battle/003_Move/011_MoveEffects_Items.rb +++ b/Data/Scripts/011_Battle/003_Move/011_MoveEffects_Items.rb @@ -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 diff --git a/Data/Scripts/011_Battle/003_Move/012_MoveEffects_ChangeMoveEffect.rb b/Data/Scripts/011_Battle/003_Move/012_MoveEffects_ChangeMoveEffect.rb index a7e391f93..e930de708 100644 --- a/Data/Scripts/011_Battle/003_Move/012_MoveEffects_ChangeMoveEffect.rb +++ b/Data/Scripts/011_Battle/003_Move/012_MoveEffects_ChangeMoveEffect.rb @@ -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 diff --git a/Data/Scripts/011_Battle/003_Move/013_MoveEffects_SwitchingActing.rb b/Data/Scripts/011_Battle/003_Move/013_MoveEffects_SwitchingActing.rb index 9a35b635c..a8277f366 100644 --- a/Data/Scripts/011_Battle/003_Move/013_MoveEffects_SwitchingActing.rb +++ b/Data/Scripts/011_Battle/003_Move/013_MoveEffects_SwitchingActing.rb @@ -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 diff --git a/Data/Scripts/011_Battle/004_Scene/001_Battle_Scene.rb b/Data/Scripts/011_Battle/004_Scene/001_Battle_Scene.rb index 12b81eb7a..b95ffb8f7 100644 --- a/Data/Scripts/011_Battle/004_Scene/001_Battle_Scene.rb +++ b/Data/Scripts/011_Battle/004_Scene/001_Battle_Scene.rb @@ -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 diff --git a/Data/Scripts/011_Battle/004_Scene/002_Scene_Initialize.rb b/Data/Scripts/011_Battle/004_Scene/002_Scene_Initialize.rb index 4db703155..4779632cb 100644 --- a/Data/Scripts/011_Battle/004_Scene/002_Scene_Initialize.rb +++ b/Data/Scripts/011_Battle/004_Scene/002_Scene_Initialize.rb @@ -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) diff --git a/Data/Scripts/011_Battle/004_Scene/003_Scene_ChooseCommands.rb b/Data/Scripts/011_Battle/004_Scene/003_Scene_ChooseCommands.rb index b1a23489b..ce2232d6c 100644 --- a/Data/Scripts/011_Battle/004_Scene/003_Scene_ChooseCommands.rb +++ b/Data/Scripts/011_Battle/004_Scene/003_Scene_ChooseCommands.rb @@ -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) diff --git a/Data/Scripts/011_Battle/004_Scene/004_Scene_PlayAnimations.rb b/Data/Scripts/011_Battle/004_Scene/004_Scene_PlayAnimations.rb index 16b78165d..2725c8d87 100644 --- a/Data/Scripts/011_Battle/004_Scene/004_Scene_PlayAnimations.rb +++ b/Data/Scripts/011_Battle/004_Scene/004_Scene_PlayAnimations.rb @@ -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 diff --git a/Data/Scripts/011_Battle/004_Scene/005_Battle_Scene_Menus.rb b/Data/Scripts/011_Battle/004_Scene/005_Battle_Scene_Menus.rb index ee02532ef..b67cc8d94 100644 --- a/Data/Scripts/011_Battle/004_Scene/005_Battle_Scene_Menus.rb +++ b/Data/Scripts/011_Battle/004_Scene/005_Battle_Scene_Menus.rb @@ -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 diff --git a/Data/Scripts/011_Battle/004_Scene/006_Battle_Scene_Objects.rb b/Data/Scripts/011_Battle/004_Scene/006_Battle_Scene_Objects.rb index e5836b871..265ec56fa 100644 --- a/Data/Scripts/011_Battle/004_Scene/006_Battle_Scene_Objects.rb +++ b/Data/Scripts/011_Battle/004_Scene/006_Battle_Scene_Objects.rb @@ -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 diff --git a/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb b/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb index c0f3908ed..6cecd12c8 100644 --- a/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb +++ b/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb @@ -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.width0 pbJudge diff --git a/Data/Scripts/011_Battle/007_Other battle types/005_RecordedBattle.rb b/Data/Scripts/011_Battle/007_Other battle types/005_RecordedBattle.rb index 4b6170aea..b568a85f8 100644 --- a/Data/Scripts/011_Battle/007_Other battle types/005_RecordedBattle.rb +++ b/Data/Scripts/011_Battle/007_Other battle types/005_RecordedBattle.rb @@ -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 diff --git a/Data/Scripts/012_Overworld/001_Overworld visuals/002_Overworld_Overlays.rb b/Data/Scripts/012_Overworld/001_Overworld visuals/002_Overworld_Overlays.rb index 97b5a6081..3e035c196 100644 --- a/Data/Scripts/012_Overworld/001_Overworld visuals/002_Overworld_Overlays.rb +++ b/Data/Scripts/012_Overworld/001_Overworld visuals/002_Overworld_Overlays.rb @@ -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) diff --git a/Data/Scripts/012_Overworld/001_Overworld visuals/003_Overworld_MapTransitionAnims.rb b/Data/Scripts/012_Overworld/001_Overworld visuals/003_Overworld_MapTransitionAnims.rb index 637fab861..d48a81df6 100644 --- a/Data/Scripts/012_Overworld/001_Overworld visuals/003_Overworld_MapTransitionAnims.rb +++ b/Data/Scripts/012_Overworld/001_Overworld visuals/003_Overworld_MapTransitionAnims.rb @@ -81,7 +81,7 @@ end #=============================================================================== # Blacking out animation #=============================================================================== -def pbStartOver(gameover=false) +def pbStartOver(gameover = false) if pbInBugContest? pbBugContestStartOver return diff --git a/Data/Scripts/012_Overworld/001_Overworld.rb b/Data/Scripts/012_Overworld/001_Overworld.rb index a1e8e89eb..704c806ae 100644 --- a/Data/Scripts/012_Overworld/001_Overworld.rb +++ b/Data/Scripts/012_Overworld/001_Overworld.rb @@ -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 diff --git a/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb b/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb index eb1971dd5..90de30bf5 100644 --- a/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb +++ b/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb @@ -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 diff --git a/Data/Scripts/012_Overworld/002_Battle triggering/002_Overworld_BattleIntroAnim.rb b/Data/Scripts/012_Overworld/002_Battle triggering/002_Overworld_BattleIntroAnim.rb index 05f47371a..68400ae0e 100644 --- a/Data/Scripts/012_Overworld/002_Battle triggering/002_Overworld_BattleIntroAnim.rb +++ b/Data/Scripts/012_Overworld/002_Battle triggering/002_Overworld_BattleIntroAnim.rb @@ -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 diff --git a/Data/Scripts/012_Overworld/002_Battle triggering/003_Overworld_WildEncounters.rb b/Data/Scripts/012_Overworld/002_Battle triggering/003_Overworld_WildEncounters.rb index 4b30ae311..b4611d448 100644 --- a/Data/Scripts/012_Overworld/002_Battle triggering/003_Overworld_WildEncounters.rb +++ b/Data/Scripts/012_Overworld/002_Battle triggering/003_Overworld_WildEncounters.rb @@ -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 diff --git a/Data/Scripts/012_Overworld/003_Overworld_Time.rb b/Data/Scripts/012_Overworld/003_Overworld_Time.rb index 9065c34de..881736b3b 100644 --- a/Data/Scripts/012_Overworld/003_Overworld_Time.rb +++ b/Data/Scripts/012_Overworld/003_Overworld_Time.rb @@ -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, diff --git a/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb b/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb index 4a0f4ee87..032ea9c7b 100644 --- a/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb +++ b/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb @@ -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 diff --git a/Data/Scripts/012_Overworld/005_Overworld_Fishing.rb b/Data/Scripts/012_Overworld/005_Overworld_Fishing.rb index e26004364..c30db647a 100644 --- a/Data/Scripts/012_Overworld/005_Overworld_Fishing.rb +++ b/Data/Scripts/012_Overworld/005_Overworld_Fishing.rb @@ -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 diff --git a/Data/Scripts/013_Items/001_Item_Utilities.rb b/Data/Scripts/013_Items/001_Item_Utilities.rb index 84501ff8e..9a7ddd623 100644 --- a/Data/Scripts/013_Items/001_Item_Utilities.rb +++ b/Data/Scripts/013_Items/001_Item_Utilities.rb @@ -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.")) diff --git a/Data/Scripts/013_Items/004_Item_Phone.rb b/Data/Scripts/013_Items/004_Item_Phone.rb index 96da00d3c..875f1fc12 100644 --- a/Data/Scripts/013_Items/004_Item_Phone.rb +++ b/Data/Scripts/013_Items/004_Item_Phone.rb @@ -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 diff --git a/Data/Scripts/013_Items/005_Item_PokeRadar.rb b/Data/Scripts/013_Items/005_Item_PokeRadar.rb index 89b0b5470..b45a3b210 100644 --- a/Data/Scripts/013_Items/005_Item_PokeRadar.rb +++ b/Data/Scripts/013_Items/005_Item_PokeRadar.rb @@ -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 diff --git a/Data/Scripts/013_Items/006_Item_Mail.rb b/Data/Scripts/013_Items/006_Item_Mail.rb index ad89b8638..f438c9fba 100644 --- a/Data/Scripts/013_Items/006_Item_Mail.rb +++ b/Data/Scripts/013_Items/006_Item_Mail.rb @@ -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 diff --git a/Data/Scripts/013_Items/007_Item_Sprites.rb b/Data/Scripts/013_Items/007_Item_Sprites.rb index 34bfa8a92..df8d2a534 100644 --- a/Data/Scripts/013_Items/007_Item_Sprites.rb +++ b/Data/Scripts/013_Items/007_Item_Sprites.rb @@ -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 diff --git a/Data/Scripts/014_Pokemon/001_Pokemon-related/002_ShadowPokemon_Other.rb b/Data/Scripts/014_Pokemon/001_Pokemon-related/002_ShadowPokemon_Other.rb index 1ef7e20c6..bceb3f3bf 100644 --- a/Data/Scripts/014_Pokemon/001_Pokemon-related/002_ShadowPokemon_Other.rb +++ b/Data/Scripts/014_Pokemon/001_Pokemon-related/002_ShadowPokemon_Other.rb @@ -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.")) diff --git a/Data/Scripts/014_Pokemon/001_Pokemon-related/003_Pokemon_Sprites.rb b/Data/Scripts/014_Pokemon/001_Pokemon-related/003_Pokemon_Sprites.rb index 7e1a5e005..7ac0cf202 100644 --- a/Data/Scripts/014_Pokemon/001_Pokemon-related/003_Pokemon_Sprites.rb +++ b/Data/Scripts/014_Pokemon/001_Pokemon-related/003_Pokemon_Sprites.rb @@ -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 diff --git a/Data/Scripts/014_Pokemon/001_Pokemon-related/004_PokemonStorage.rb b/Data/Scripts/014_Pokemon/001_Pokemon-related/004_PokemonStorage.rb index 4a2d764d3..5aee9a03e 100644 --- a/Data/Scripts/014_Pokemon/001_Pokemon-related/004_PokemonStorage.rb +++ b/Data/Scripts/014_Pokemon/001_Pokemon-related/004_PokemonStorage.rb @@ -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 diff --git a/Data/Scripts/015_Trainers and player/003_Trainer_Sprites.rb b/Data/Scripts/015_Trainers and player/003_Trainer_Sprites.rb index e11cc3bd2..803e822b3 100644 --- a/Data/Scripts/015_Trainers and player/003_Trainer_Sprites.rb +++ b/Data/Scripts/015_Trainers and player/003_Trainer_Sprites.rb @@ -2,7 +2,7 @@ # Walking charset, for use in text entry screens and load game screen #=============================================================================== class TrainerWalkingCharSprite < SpriteWrapper - def initialize(charset,viewport=nil) + def initialize(charset,viewport = nil) super(viewport) @animbitmap = nil self.charset = charset diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/003_UI_EggHatching.rb b/Data/Scripts/016_UI/001_Non-interactive UI/003_UI_EggHatching.rb index 665e6717a..ece5d7d39 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/003_UI_EggHatching.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/003_UI_EggHatching.rb @@ -123,7 +123,7 @@ class PokemonEggHatch_Scene @sprites["hatch"].src_rect.x = index*@sprites["hatch"].src_rect.width end - def swingEgg(speed,swingTimes=1) + def swingEgg(speed,swingTimes = 1) @sprites["hatch"].visible = true speed = speed.to_f*20/Graphics.frame_rate amplitude = 8 @@ -147,7 +147,7 @@ class PokemonEggHatch_Scene @sprites["hatch"].x = @sprites["pokemon"].x end - def updateScene(frames=1) # Can be used for "wait" effect + def updateScene(frames = 1) # Can be used for "wait" effect frames.times do Graphics.update Input.update diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb b/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb index 0192bfab5..f4f8e95af 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb @@ -31,7 +31,7 @@ class SpriteMetafile return @metafile[i] end - def initialize(viewport=nil) + def initialize(viewport = nil) @metafile=[] @values=[ viewport, @@ -230,7 +230,7 @@ end # #=============================================================================== class SpriteMetafilePlayer - def initialize(metafile,sprite=nil) + def initialize(metafile,sprite = nil) @metafile=metafile @sprites=[] @playing=false @@ -411,7 +411,7 @@ class PokemonEvolutionScene public - def pbUpdate(animating=false) + def pbUpdate(animating = false) if animating # Pokémon shouldn't animate during the evolution animation @sprites["background"].update else @@ -526,7 +526,7 @@ class PokemonEvolutionScene end # Opens the evolution screen - def pbEvolution(cancancel=true) + def pbEvolution(cancancel = true) metaplayer1 = SpriteMetafilePlayer.new(@metafile1,@sprites["rsprite1"]) metaplayer2 = SpriteMetafilePlayer.new(@metafile2,@sprites["rsprite2"]) metaplayer1.play diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/005_UI_Trading.rb b/Data/Scripts/016_UI/001_Non-interactive UI/005_UI_Trading.rb index 1f3d2e870..337236ab1 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/005_UI_Trading.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/005_UI_Trading.rb @@ -197,7 +197,7 @@ end #=============================================================================== # #=============================================================================== -def pbStartTrade(pokemonIndex,newpoke,nickname,trainerName,trainerGender=0) +def pbStartTrade(pokemonIndex,newpoke,nickname,trainerName,trainerGender = 0) $stats.trade_count += 1 myPokemon = $player.party[pokemonIndex] yourPokemon = nil diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb b/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb index eb8635731..23cdc7d4e 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb @@ -116,7 +116,7 @@ class HallOfFame_Scene end # Change the pokémon sprites opacity except the index one - def setPokemonSpritesOpacity(index,opacity=255) + def setPokemonSpritesOpacity(index,opacity = 255) for n in 0...@hallEntry.size @sprites["pokemon#{n}"].opacity=(n==index) ? 255 : opacity if @sprites["pokemon#{n}"] end @@ -199,7 +199,7 @@ class HallOfFame_Scene end end - def createBattlers(hide=true) + def createBattlers(hide = true) # Movement in animation for i in 0...6 # Clear all 6 pokémon sprites and dispose the ones that exists every time @@ -292,7 +292,7 @@ class HallOfFame_Scene _INTL("League champion!\nCongratulations!\\^")) end - def writePokemonData(pokemon,hallNumber=-1) + def writePokemonData(pokemon,hallNumber = -1) overlay=@sprites["overlay"].bitmap overlay.clear pokename=pokemon.name diff --git a/Data/Scripts/016_UI/003_UI_Pokedex_Main.rb b/Data/Scripts/016_UI/003_UI_Pokedex_Main.rb index 009b294d2..7db75dff8 100644 --- a/Data/Scripts/016_UI/003_UI_Pokedex_Main.rb +++ b/Data/Scripts/016_UI/003_UI_Pokedex_Main.rb @@ -80,7 +80,7 @@ class PokedexSearchSelectionSprite < SpriteWrapper attr_accessor :cmds attr_accessor :minmax - def initialize(viewport=nil) + def initialize(viewport = nil) super(viewport) @selbitmap = AnimatedBitmap.new("Graphics/Pictures/Pokedex/cursor_search") self.bitmap = @selbitmap.bitmap @@ -369,7 +369,7 @@ class PokemonPokedex_Scene return ret end - def pbRefreshDexList(index=0) + def pbRefreshDexList(index = 0) dexlist = pbGetDexList case $PokemonGlobal.pokedexMode when MODENUMERICAL diff --git a/Data/Scripts/016_UI/005_UI_Party.rb b/Data/Scripts/016_UI/005_UI_Party.rb index d7e837744..7b2929a7e 100644 --- a/Data/Scripts/016_UI/005_UI_Party.rb +++ b/Data/Scripts/016_UI/005_UI_Party.rb @@ -4,7 +4,7 @@ class PokemonPartyConfirmCancelSprite < SpriteWrapper attr_reader :selected - def initialize(text,x,y,narrowbox=false,viewport=nil) + def initialize(text,x,y,narrowbox = false,viewport = nil) super(viewport) @refreshBitmap = true @bgsprite = ChangelingSprite.new(0,0,viewport) @@ -79,7 +79,7 @@ end # #=============================================================================== class PokemonPartyCancelSprite < PokemonPartyConfirmCancelSprite - def initialize(viewport=nil) + def initialize(viewport = nil) super(_INTL("CANCEL"),398,328,false,viewport) end end @@ -88,7 +88,7 @@ end # #=============================================================================== class PokemonPartyConfirmSprite < PokemonPartyConfirmCancelSprite - def initialize(viewport=nil) + def initialize(viewport = nil) super(_INTL("CONFIRM"),398,308,true,viewport) end end @@ -97,7 +97,7 @@ end # #=============================================================================== class PokemonPartyCancelSprite2 < PokemonPartyConfirmCancelSprite - def initialize(viewport=nil) + def initialize(viewport = nil) super(_INTL("CANCEL"),398,346,true,viewport) end end @@ -106,7 +106,7 @@ end # #=============================================================================== class Window_CommandPokemonColor < Window_CommandPokemon - def initialize(commands,width=nil) + def initialize(commands,width = nil) @colorKey = [] for i in 0...commands.length if commands[i].is_a?(Array) @@ -137,7 +137,7 @@ end class PokemonPartyBlankPanel < SpriteWrapper attr_accessor :text - def initialize(_pokemon,index,viewport=nil) + def initialize(_pokemon,index,viewport = nil) super(viewport) self.x = (index % 2) * Graphics.width / 2 self.y = 16 * (index % 2) + 96 * (index / 2) @@ -171,7 +171,7 @@ class PokemonPartyPanel < SpriteWrapper attr_reader :switching attr_reader :text - def initialize(pokemon,index,viewport=nil) + def initialize(pokemon,index,viewport = nil) super(viewport) @pokemon = pokemon @active = (index==0) # true = rounded panel, false = rectangular panel @@ -557,7 +557,7 @@ class PokemonParty_Scene return ret end - def pbShowCommands(helptext,commands,index=0) + def pbShowCommands(helptext,commands,index = 0) ret = -1 helpwindow = @sprites["helpwindow"] helpwindow.visible = true @@ -665,7 +665,7 @@ class PokemonParty_Scene end end - def pbSummary(pkmnid,inbattle=false) + def pbSummary(pkmnid,inbattle = false) oldsprites = pbFadeOutAndHide(@sprites) scene = PokemonSummary_Scene.new screen = PokemonSummaryScreen.new(scene,inbattle) @@ -704,7 +704,7 @@ class PokemonParty_Scene return ret end - def pbChoosePokemon(switching=false,initialsel=-1,canswitch=0) + def pbChoosePokemon(switching = false,initialsel = -1,canswitch = 0) for i in 0...Settings::MAX_PARTY_SIZE @sprites["pokemon#{i}"].preselected = (switching && i==@activecmd) @sprites["pokemon#{i}"].switching = switching @@ -873,11 +873,11 @@ class PokemonPartyScreen @party = party end - def pbStartScene(helptext,_numBattlersOut,annotations=nil) + def pbStartScene(helptext,_numBattlersOut,annotations = nil) @scene.pbStartScene(@party,helptext,annotations) end - def pbChoosePokemon(helptext=nil) + def pbChoosePokemon(helptext = nil) @scene.pbSetHelpText(helptext) if helptext return @scene.pbChoosePokemon end @@ -942,7 +942,7 @@ class PokemonPartyScreen return @scene.pbDisplayConfirm(text) end - def pbShowCommands(helptext,commands,index=0) + def pbShowCommands(helptext,commands,index = 0) return @scene.pbShowCommands(helptext,commands,index) end @@ -977,7 +977,7 @@ class PokemonPartyScreen end end - def pbChooseMove(pokemon,helptext,index=0) + def pbChooseMove(pokemon,helptext,index = 0) movenames = [] for i in pokemon.moves next if !i || !i.id @@ -1096,7 +1096,7 @@ class PokemonPartyScreen return ret end - def pbChooseAblePokemon(ableProc,allowIneligible=false) + def pbChooseAblePokemon(ableProc,allowIneligible = false) annot = [] eligibility = [] for pkmn in @party @@ -1123,7 +1123,7 @@ class PokemonPartyScreen return ret end - def pbChooseTradablePokemon(ableProc,allowIneligible=false) + def pbChooseTradablePokemon(ableProc,allowIneligible = false) annot = [] eligibility = [] for pkmn in @party @@ -1390,7 +1390,7 @@ end # Choose a Pokémon/egg from the party. # Stores result in variable _variableNumber_ and the chosen Pokémon's name in # variable _nameVarNumber_; result is -1 if no Pokémon was chosen -def pbChoosePokemon(variableNumber,nameVarNumber,ableProc=nil,allowIneligible=false) +def pbChoosePokemon(variableNumber,nameVarNumber,ableProc = nil,allowIneligible = false) chosen = 0 pbFadeOutIn { scene = PokemonParty_Scene.new @@ -1420,7 +1420,7 @@ def pbChooseAblePokemon(variableNumber,nameVarNumber) end # Same as pbChoosePokemon, but prevents choosing an egg or a Shadow Pokémon. -def pbChooseTradablePokemon(variableNumber,nameVarNumber,ableProc=nil,allowIneligible=false) +def pbChooseTradablePokemon(variableNumber,nameVarNumber,ableProc = nil,allowIneligible = false) chosen = 0 pbFadeOutIn { scene = PokemonParty_Scene.new diff --git a/Data/Scripts/016_UI/006_UI_Summary.rb b/Data/Scripts/016_UI/006_UI_Summary.rb index a1ef58cae..9d8a482b6 100644 --- a/Data/Scripts/016_UI/006_UI_Summary.rb +++ b/Data/Scripts/016_UI/006_UI_Summary.rb @@ -5,7 +5,7 @@ class MoveSelectionSprite < SpriteWrapper attr_reader :preselected attr_reader :index - def initialize(viewport=nil,fifthmove=false) + def initialize(viewport = nil,fifthmove = false) super(viewport) @movesel = AnimatedBitmap.new("Graphics/Pictures/Summary/cursor_move") @frame = 0 @@ -59,7 +59,7 @@ end # #=============================================================================== class RibbonSelectionSprite < MoveSelectionSprite - def initialize(viewport=nil) + def initialize(viewport = nil) super(viewport) @movesel = AnimatedBitmap.new("Graphics/Pictures/Summary/cursor_ribbon") @frame = 0 @@ -109,7 +109,7 @@ class PokemonSummary_Scene pbUpdateSpriteHash(@sprites) end - def pbStartScene(party,partyindex,inbattle=false) + def pbStartScene(party,partyindex,inbattle = false) @viewport = Viewport.new(0,0,Graphics.width,Graphics.height) @viewport.z = 99999 @party = party @@ -259,7 +259,7 @@ class PokemonSummary_Scene return ret end - def pbShowCommands(commands,index=0) + def pbShowCommands(commands,index = 0) ret = -1 using(cmdwindow = Window_CommandPokemon.new(commands)) { cmdwindow.z = @viewport.z+1 @@ -1331,7 +1331,7 @@ end # #=============================================================================== class PokemonSummaryScreen - def initialize(scene,inbattle=false) + def initialize(scene,inbattle = false) @scene = scene @inbattle = inbattle end diff --git a/Data/Scripts/016_UI/007_UI_Bag.rb b/Data/Scripts/016_UI/007_UI_Bag.rb index 9b250a7d9..c5ad354d1 100644 --- a/Data/Scripts/016_UI/007_UI_Bag.rb +++ b/Data/Scripts/016_UI/007_UI_Bag.rb @@ -135,7 +135,7 @@ class PokemonBag_Scene pbUpdateSpriteHash(@sprites) end - def pbStartScene(bag,choosing=false,filterproc=nil,resetpocket=true) + def pbStartScene(bag,choosing = false,filterproc = nil,resetpocket = true) @viewport = Viewport.new(0,0,Graphics.width,Graphics.height) @viewport.z = 99999 @bag = bag @@ -237,7 +237,7 @@ class PokemonBag_Scene @viewport.dispose end - def pbDisplay(msg,brief=false) + def pbDisplay(msg,brief = false) UIHelper.pbDisplay(@sprites["msgwindow"],msg,brief) { pbUpdate } end @@ -245,11 +245,11 @@ class PokemonBag_Scene UIHelper.pbConfirm(@sprites["msgwindow"],msg) { pbUpdate } end - def pbChooseNumber(helptext,maximum,initnum=1) + def pbChooseNumber(helptext,maximum,initnum = 1) return UIHelper.pbChooseNumber(@sprites["helpwindow"],helptext,maximum,initnum) { pbUpdate } end - def pbShowCommands(helptext,commands,index=0) + def pbShowCommands(helptext,commands,index = 0) return UIHelper.pbShowCommands(@sprites["helpwindow"],helptext,commands,index) { pbUpdate } end @@ -580,7 +580,7 @@ class PokemonBagScreen end # UI logic for the item screen for choosing an item. - def pbChooseItemScreen(proc=nil) + def pbChooseItemScreen(proc = nil) oldlastpocket = @bag.last_viewed_pocket oldchoices = @bag.last_pocket_selections.clone @scene.pbStartScene(@bag,true,proc) diff --git a/Data/Scripts/016_UI/008_UI_Pokegear.rb b/Data/Scripts/016_UI/008_UI_Pokegear.rb index 8143f2ee9..a32309899 100644 --- a/Data/Scripts/016_UI/008_UI_Pokegear.rb +++ b/Data/Scripts/016_UI/008_UI_Pokegear.rb @@ -6,7 +6,7 @@ class PokegearButton < SpriteWrapper attr_reader :name attr_reader :selected - def initialize(command,x,y,viewport=nil) + def initialize(command,x,y,viewport = nil) super(viewport) @image = command[0] @name = command[1] diff --git a/Data/Scripts/016_UI/009_UI_RegionMap.rb b/Data/Scripts/016_UI/009_UI_RegionMap.rb index 4d4e460ab..b5309f1e9 100644 --- a/Data/Scripts/016_UI/009_UI_RegionMap.rb +++ b/Data/Scripts/016_UI/009_UI_RegionMap.rb @@ -58,7 +58,7 @@ class PokemonRegionMap_Scene SQUARE_WIDTH = 16 SQUARE_HEIGHT = 16 - def initialize(region =- 1, wallmap = true) + def initialize(region = - 1, wallmap = true) @region = region @wallmap = wallmap end diff --git a/Data/Scripts/016_UI/014_UI_Save.rb b/Data/Scripts/016_UI/014_UI_Save.rb index 711757d4e..1ca82f7a5 100644 --- a/Data/Scripts/016_UI/014_UI_Save.rb +++ b/Data/Scripts/016_UI/014_UI_Save.rb @@ -67,7 +67,7 @@ class PokemonSaveScreen @scene=scene end - def pbDisplay(text,brief=false) + def pbDisplay(text,brief = false) @scene.pbDisplay(text,brief) end diff --git a/Data/Scripts/016_UI/015_UI_Options.rb b/Data/Scripts/016_UI/015_UI_Options.rb index 2bd0049d9..e200039bf 100644 --- a/Data/Scripts/016_UI/015_UI_Options.rb +++ b/Data/Scripts/016_UI/015_UI_Options.rb @@ -286,7 +286,7 @@ class PokemonOption_Scene pbUpdateSpriteHash(@sprites) end - def pbStartScene(inloadscreen=false) + def pbStartScene(inloadscreen = false) @sprites = {} @viewport = Viewport.new(0,0,Graphics.width,Graphics.height) @viewport.z = 99999 @@ -449,7 +449,7 @@ class PokemonOptionScreen @scene = scene end - def pbStartScreen(inloadscreen=false) + def pbStartScreen(inloadscreen = false) @scene.pbStartScene(inloadscreen) @scene.pbOptions @scene.pbEndScene diff --git a/Data/Scripts/016_UI/016_UI_ReadyMenu.rb b/Data/Scripts/016_UI/016_UI_ReadyMenu.rb index 73b25a52e..1c8e38749 100644 --- a/Data/Scripts/016_UI/016_UI_ReadyMenu.rb +++ b/Data/Scripts/016_UI/016_UI_ReadyMenu.rb @@ -6,7 +6,7 @@ class ReadyMenuButton < SpriteWrapper attr_reader :selected attr_reader :side - def initialize(index,command,selected,side,viewport=nil) + def initialize(index,command,selected,side,viewport = nil) super(viewport) @index = index @command = command # Item/move ID, name, mode (T move/F item), pkmnIndex diff --git a/Data/Scripts/016_UI/017_UI_PokemonStorage.rb b/Data/Scripts/016_UI/017_UI_PokemonStorage.rb index 50f716ee9..1a2ea87b3 100644 --- a/Data/Scripts/016_UI/017_UI_PokemonStorage.rb +++ b/Data/Scripts/016_UI/017_UI_PokemonStorage.rb @@ -2,7 +2,7 @@ # Pokémon icons #=============================================================================== class PokemonBoxIcon < IconSprite - def initialize(pokemon,viewport=nil) + def initialize(pokemon,viewport = nil) super(0,0,viewport) @pokemon = pokemon @release = Interpolator.new @@ -120,7 +120,7 @@ end class PokemonBoxArrow < SpriteWrapper attr_accessor :quickswap - def initialize(viewport=nil) + def initialize(viewport = nil) super(viewport) @frame = 0 @holding = false @@ -292,7 +292,7 @@ class PokemonBoxSprite < SpriteWrapper attr_accessor :refreshBox attr_accessor :refreshSprites - def initialize(storage,boxnumber,viewport=nil) + def initialize(storage,boxnumber,viewport = nil) super(viewport) @storage = storage @boxnumber = boxnumber @@ -444,7 +444,7 @@ end # Party pop-up panel #=============================================================================== class PokemonBoxPartySprite < SpriteWrapper - def initialize(party,viewport=nil) + def initialize(party,viewport = nil) super(viewport) @party = party @boxbitmap = AnimatedBitmap.new("Graphics/Pictures/Storage/overlay_party") @@ -657,7 +657,7 @@ class PokemonStorageScene Input.update end - def pbShowCommands(message,commands,index=0) + def pbShowCommands(message,commands,index = 0) ret = -1 msgwindow = Window_UnformattedTextPokemon.newWithSize("",180,0,Graphics.width-180,32) msgwindow.viewport = @viewport @@ -1392,7 +1392,7 @@ class PokemonStorageScene end end - def pbUpdateOverlay(selection,party=nil) + def pbUpdateOverlay(selection,party = nil) overlay = @sprites["overlay"].bitmap overlay.clear buttonbase = Color.new(248,248,248) @@ -1659,7 +1659,7 @@ class PokemonStorageScreen return pbShowCommands(str,[_INTL("Yes"),_INTL("No")])==0 end - def pbShowCommands(msg,commands,index=0) + def pbShowCommands(msg,commands,index = 0) return @scene.pbShowCommands(msg,commands,index) end @@ -1862,7 +1862,7 @@ class PokemonStorageScreen return end - def pbChooseMove(pkmn,helptext,index=0) + def pbChooseMove(pkmn,helptext,index = 0) movenames = [] for i in pkmn.moves if i.total_pp<=0 @@ -1949,7 +1949,7 @@ class PokemonStorageScreen end end - def pbChoosePokemon(_party=nil) + def pbChoosePokemon(_party = nil) $game_temp.in_storage = true @heldpkmn = nil @scene.pbStartBox(self,1) diff --git a/Data/Scripts/016_UI/018_UI_ItemStorage.rb b/Data/Scripts/016_UI/018_UI_ItemStorage.rb index f62641056..4be47d82e 100644 --- a/Data/Scripts/016_UI/018_UI_ItemStorage.rb +++ b/Data/Scripts/016_UI/018_UI_ItemStorage.rb @@ -117,7 +117,7 @@ class ItemStorage_Scene return UIHelper.pbChooseNumber(@sprites["helpwindow"],helptext,maximum) { update } end - def pbDisplay(msg,brief=false) + def pbDisplay(msg,brief = false) UIHelper.pbDisplay(@sprites["msgwindow"],msg,brief) { update } end @@ -275,7 +275,7 @@ module UIHelper return ret end - def self.pbChooseNumber(helpwindow,helptext,maximum,initnum=1) + def self.pbChooseNumber(helpwindow,helptext,maximum,initnum = 1) oldvisible = helpwindow.visible helpwindow.visible = true helpwindow.text = helptext @@ -331,7 +331,7 @@ module UIHelper return ret end - def self.pbShowCommands(helpwindow,helptext,commands,initcmd=0) + def self.pbShowCommands(helpwindow,helptext,commands,initcmd = 0) ret = -1 oldvisible = helpwindow.visible helpwindow.visible = helptext ? true : false diff --git a/Data/Scripts/016_UI/020_UI_PokeMart.rb b/Data/Scripts/016_UI/020_UI_PokeMart.rb index 44c7c3bc3..18aa1713d 100644 --- a/Data/Scripts/016_UI/020_UI_PokeMart.rb +++ b/Data/Scripts/016_UI/020_UI_PokeMart.rb @@ -660,7 +660,7 @@ end #=============================================================================== # #=============================================================================== -def pbPokemonMart(stock,speech=nil,cantsell=false) +def pbPokemonMart(stock,speech = nil,cantsell = false) stock.delete_if { |item| GameData::Item.get(item).is_important? && $bag.has?(item) } commands = [] cmdBuy = -1 diff --git a/Data/Scripts/016_UI/021_UI_MoveRelearner.rb b/Data/Scripts/016_UI/021_UI_MoveRelearner.rb index c2600c4a3..333077da4 100644 --- a/Data/Scripts/016_UI/021_UI_MoveRelearner.rb +++ b/Data/Scripts/016_UI/021_UI_MoveRelearner.rb @@ -4,7 +4,7 @@ class MoveRelearner_Scene VISIBLEMOVES = 4 - def pbDisplay(msg,brief=false) + def pbDisplay(msg,brief = false) UIHelper.pbDisplay(@sprites["msgwindow"],msg,brief) { pbUpdate } end diff --git a/Data/Scripts/016_UI/022_UI_PurifyChamber.rb b/Data/Scripts/016_UI/022_UI_PurifyChamber.rb index 077cf045b..a21233b8f 100644 --- a/Data/Scripts/016_UI/022_UI_PurifyChamber.rb +++ b/Data/Scripts/016_UI/022_UI_PurifyChamber.rb @@ -219,7 +219,7 @@ class PurifyChamber @sets[set].insertAt(index,value) end - def [](chamber,slot=nil) + def [](chamber,slot = nil) if slot==nil return @sets[chamber] end @@ -272,7 +272,7 @@ class PurifyChamber insertAfter(set,setCount(set),pkmn) end - def debugAdd(set,shadow,type1,type2=nil) + def debugAdd(set,shadow,type1,type2 = nil) pkmn = PseudoPokemon.new(shadow, type1, type2 || type1) if pkmn.shadowPokemon? self.setShadow(set,pkmn) @@ -637,7 +637,7 @@ end class Window_PurifyChamberSets < Window_DrawableCommand attr_reader :switching - def initialize(chamber,x,y,width,height,viewport=nil) + def initialize(chamber,x,y,width,height,viewport = nil) @chamber=chamber @switching=-1 super(x,y,width,height,viewport) @@ -680,7 +680,7 @@ end # #=============================================================================== class DirectFlowDiagram - def initialize(viewport=nil) + def initialize(viewport = nil) @points=[] @angles=[] @viewport=viewport @@ -754,7 +754,7 @@ end # #=============================================================================== class FlowDiagram - def initialize(viewport=nil) + def initialize(viewport = nil) @points=[] @angles=[] @viewport=viewport @@ -846,7 +846,7 @@ class PurifyChamberSetView < SpriteWrapper attr_reader :cursor attr_reader :heldpkmn - def initialize(chamber,set,viewport=nil) + def initialize(chamber,set,viewport = nil) super(viewport) @set=set @heldpkmn=nil diff --git a/Data/Scripts/016_UI/023_UI_MysteryGift.rb b/Data/Scripts/016_UI/023_UI_MysteryGift.rb index ace713f31..a7ba4cf65 100644 --- a/Data/Scripts/016_UI/023_UI_MysteryGift.rb +++ b/Data/Scripts/016_UI/023_UI_MysteryGift.rb @@ -14,7 +14,7 @@ end #=============================================================================== # type: 0=Pokémon; 1 or higher=item (is the item's quantity). # item: The thing being turned into a Mystery Gift (Pokémon object or item ID). -def pbEditMysteryGift(type,item,id=0,giftname="") +def pbEditMysteryGift(type,item,id = 0,giftname = "") begin if type==0 # Pokémon commands=[_INTL("Mystery Gift"), diff --git a/Data/Scripts/016_UI/024_UI_TextEntry.rb b/Data/Scripts/016_UI/024_UI_TextEntry.rb index f322ad630..d7eb6a8ef 100644 --- a/Data/Scripts/016_UI/024_UI_TextEntry.rb +++ b/Data/Scripts/016_UI/024_UI_TextEntry.rb @@ -5,7 +5,7 @@ class Window_CharacterEntry < Window_DrawableCommand XSIZE=13 YSIZE=4 - def initialize(charset,viewport=nil) + def initialize(charset,viewport = nil) @viewport=viewport @charset=charset @othercharset="" @@ -76,7 +76,7 @@ class PokemonEntryScene ] USEKEYBOARD=true - def pbStartScene(helptext,minlength,maxlength,initialText,subject=0,pokemon=nil) + def pbStartScene(helptext,minlength,maxlength,initialText,subject = 0,pokemon = nil) @sprites={} @viewport=Viewport.new(0,0,Graphics.width,Graphics.height) @viewport.z=99999 @@ -373,7 +373,7 @@ class PokemonEntryScene2 - def pbStartScene(helptext,minlength,maxlength,initialText,subject=0,pokemon=nil) + def pbStartScene(helptext,minlength,maxlength,initialText,subject = 0,pokemon = nil) @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport.z = 99999 @helptext = helptext @@ -756,7 +756,7 @@ class PokemonEntry @scene=scene end - def pbStartScreen(helptext,minlength,maxlength,initialText,mode=-1,pokemon=nil) + def pbStartScreen(helptext,minlength,maxlength,initialText,mode = -1,pokemon = nil) @scene.pbStartScene(helptext,minlength,maxlength,initialText,mode,pokemon) ret=@scene.pbEntry @scene.pbEndScene @@ -769,7 +769,7 @@ end #=============================================================================== # #=============================================================================== -def pbEnterText(helptext,minlength,maxlength,initialText="",mode=0,pokemon=nil,nofadeout=false) +def pbEnterText(helptext,minlength,maxlength,initialText = "",mode = 0,pokemon = nil,nofadeout = false) ret="" if ($PokemonSystem.textinput==1 rescue false) # Keyboard pbFadeOutIn(99999,nofadeout) { @@ -787,18 +787,18 @@ def pbEnterText(helptext,minlength,maxlength,initialText="",mode=0,pokemon=nil,n return ret end -def pbEnterPlayerName(helptext,minlength,maxlength,initialText="",nofadeout=false) +def pbEnterPlayerName(helptext,minlength,maxlength,initialText = "",nofadeout = false) return pbEnterText(helptext,minlength,maxlength,initialText,1,nil,nofadeout) end -def pbEnterPokemonName(helptext,minlength,maxlength,initialText="",pokemon=nil,nofadeout=false) +def pbEnterPokemonName(helptext,minlength,maxlength,initialText = "",pokemon = nil,nofadeout = false) return pbEnterText(helptext,minlength,maxlength,initialText,2,pokemon,nofadeout) end -def pbEnterNPCName(helptext,minlength,maxlength,initialText="",id=0,nofadeout=false) +def pbEnterNPCName(helptext,minlength,maxlength,initialText = "",id = 0,nofadeout = false) return pbEnterText(helptext,minlength,maxlength,initialText,3,id,nofadeout) end -def pbEnterBoxName(helptext,minlength,maxlength,initialText="",nofadeout=false) +def pbEnterBoxName(helptext,minlength,maxlength,initialText = "",nofadeout = false) return pbEnterText(helptext,minlength,maxlength,initialText,4,nil,nofadeout) end diff --git a/Data/Scripts/017_Minigames/002_Minigame_TripleTriad.rb b/Data/Scripts/017_Minigames/002_Minigame_TripleTriad.rb index e2cdfac2d..186530763 100644 --- a/Data/Scripts/017_Minigames/002_Minigame_TripleTriad.rb +++ b/Data/Scripts/017_Minigames/002_Minigame_TripleTriad.rb @@ -644,7 +644,7 @@ class TriadScreen return ItemStorageHelper.remove(items, item, 1) end - def flipBoard(x,y,attackerParam=nil,recurse=false) + def flipBoard(x,y,attackerParam = nil,recurse = false) panels = [x-1,y,x+1,y,x,y-1,x,y+1] panels[0] = (@wrapAround ? @width-1 : 0) if panels[0]<0 # left panels[2] = (@wrapAround ? 0 : @width-1) if panels[2]>@width-1 # right @@ -697,7 +697,7 @@ class TriadScreen # If pbStartScreen includes parameters, it should # pass the parameters to pbStartScene. - def pbStartScreen(opponentName,minLevel,maxLevel,rules=nil,oppdeck=nil,prize=nil) + def pbStartScreen(opponentName,minLevel,maxLevel,rules = nil,oppdeck = nil,prize = nil) raise _INTL("Minimum level must be 0 through 9.") if minLevel<0 || minLevel>9 raise _INTL("Maximum level must be 0 through 9.") if maxLevel<0 || maxLevel>9 raise _INTL("Maximum level shouldn't be less than the minimum level.") if maxLevel=0 if anim @sprites["cursor"].visible=false @@ -407,7 +407,7 @@ class TilePuzzleScene return true end - def pbShiftLine(dir,cursor,anim=true) + def pbShiftLine(dir,cursor,anim = true) # Get tiles involved tiles=[] dist=0 @@ -584,7 +584,7 @@ end -def pbTilePuzzle(game,board,width=0,height=0) +def pbTilePuzzle(game,board,width = 0,height = 0) ret = false pbFadeOutIn { scene = TilePuzzleScene.new(game,board,width,height) diff --git a/Data/Scripts/018_Alternate battle modes/002_BugContest.rb b/Data/Scripts/018_Alternate battle modes/002_BugContest.rb index 8b7bfe757..c2c72f41c 100644 --- a/Data/Scripts/018_Alternate battle modes/002_BugContest.rb +++ b/Data/Scripts/018_Alternate battle modes/002_BugContest.rb @@ -83,7 +83,7 @@ class BugContestState return true end - def pbSetJudgingPoint(startMap,startX,startY,dir=8) + def pbSetJudgingPoint(startMap,startX,startY,dir = 8) @start=[startMap,startX,startY,dir] end @@ -199,7 +199,7 @@ class BugContestState return 3 end - def pbEnd(interrupted=false) + def pbEnd(interrupted = false) return if !@inProgress for poke in @otherparty $player.party.push(poke) diff --git a/Data/Scripts/019_Utilities/001_Utilities.rb b/Data/Scripts/019_Utilities/001_Utilities.rb index 8754fc7bc..f4b97f383 100644 --- a/Data/Scripts/019_Utilities/001_Utilities.rb +++ b/Data/Scripts/019_Utilities/001_Utilities.rb @@ -132,7 +132,7 @@ end #=============================================================================== # Event utilities #=============================================================================== -def pbTimeEvent(variableNumber,secs=86400) +def pbTimeEvent(variableNumber,secs = 86400) if variableNumber && variableNumber>=0 if $game_variables secs = 0 if secs<0 @@ -143,7 +143,7 @@ def pbTimeEvent(variableNumber,secs=86400) end end -def pbTimeEventDays(variableNumber,days=0) +def pbTimeEventDays(variableNumber,days = 0) if variableNumber && variableNumber>=0 if $game_variables days = 0 if days<0 @@ -173,7 +173,7 @@ def pbTimeEventValid(variableNumber) return retval end -def pbExclaim(event,id=Settings::EXCLAMATION_ANIMATION_ID,tinting=false) +def pbExclaim(event,id = Settings::EXCLAMATION_ANIMATION_ID,tinting = false) if event.is_a?(Array) sprite = nil done = [] @@ -264,7 +264,7 @@ def pbGetUserName return System.user_name end -def getRandomNameEx(type,variable,upper,maxLength=100) +def getRandomNameEx(type,variable,upper,maxLength = 100) return "" if maxLength<=0 name = "" 50.times { @@ -339,7 +339,7 @@ def getRandomNameEx(type,variable,upper,maxLength=100) return name end -def getRandomName(maxLength=100) +def getRandomName(maxLength = 100) return getRandomNameEx(2,nil,nil,maxLength) end @@ -424,7 +424,7 @@ def pbMoveTutorAnnotations(move, movelist = nil) return ret end -def pbMoveTutorChoose(move,movelist=nil,bymachine=false,oneusemachine=false) +def pbMoveTutorChoose(move,movelist = nil,bymachine = false,oneusemachine = false) ret = false move = GameData::Move.get(move).id if movelist!=nil && movelist.is_a?(Array) diff --git a/Data/Scripts/020_Debug/001_Editor screens/003_EditorScreens_MapConnections.rb b/Data/Scripts/020_Debug/001_Editor screens/003_EditorScreens_MapConnections.rb index 91765b23a..e985bda78 100644 --- a/Data/Scripts/020_Debug/001_Editor screens/003_EditorScreens_MapConnections.rb +++ b/Data/Scripts/020_Debug/001_Editor screens/003_EditorScreens_MapConnections.rb @@ -2,7 +2,7 @@ # Miniature game map drawing #=============================================================================== class MapSprite - def initialize(map,viewport=nil) + def initialize(map,viewport = nil) @sprite=Sprite.new(viewport) @sprite.bitmap=createMinimap(map) @sprite.x=(Graphics.width/2)-(@sprite.bitmap.width/2) @@ -38,7 +38,7 @@ end # #=============================================================================== class SelectionSprite < Sprite - def initialize(viewport=nil) + def initialize(viewport = nil) @sprite=Sprite.new(viewport) @sprite.bitmap=nil @sprite.z=2 @@ -87,7 +87,7 @@ end # #=============================================================================== class RegionMapSprite - def initialize(map,viewport=nil) + def initialize(map,viewport = nil) @sprite=Sprite.new(viewport) @sprite.bitmap=createRegionMap(map) @sprite.x=(Graphics.width/2)-(@sprite.bitmap.width/2) diff --git a/Data/Scripts/020_Debug/001_Editor_Utilities.rb b/Data/Scripts/020_Debug/001_Editor_Utilities.rb index 8ad8ead2a..ed8b2748d 100644 --- a/Data/Scripts/020_Debug/001_Editor_Utilities.rb +++ b/Data/Scripts/020_Debug/001_Editor_Utilities.rb @@ -10,7 +10,7 @@ def pbGetLegalMoves(species) return moves end -def pbSafeCopyFile(x,y,z=nil) +def pbSafeCopyFile(x,y,z = nil) if safeExists?(x) safetocopy = true filedata = nil @@ -245,7 +245,7 @@ end #=============================================================================== # General list methods #=============================================================================== -def pbCommands2(cmdwindow,commands,cmdIfCancel,defaultindex=-1,noresize=false) +def pbCommands2(cmdwindow,commands,cmdIfCancel,defaultindex = -1,noresize = false) cmdwindow.commands = commands cmdwindow.index = defaultindex if defaultindex>=0 cmdwindow.x = 0 @@ -282,7 +282,7 @@ def pbCommands2(cmdwindow,commands,cmdIfCancel,defaultindex=-1,noresize=false) return ret end -def pbCommands3(cmdwindow,commands,cmdIfCancel,defaultindex=-1,noresize=false) +def pbCommands3(cmdwindow,commands,cmdIfCancel,defaultindex = -1,noresize = false) cmdwindow.commands = commands cmdwindow.index = defaultindex if defaultindex>=0 cmdwindow.x = 0 @@ -378,7 +378,7 @@ def pbChooseList(commands, default = 0, cancelValue = -1, sortType = 1) return itemID end -def pbCommandsSortable(cmdwindow,commands,cmdIfCancel,defaultindex=-1,sortable=false) +def pbCommandsSortable(cmdwindow,commands,cmdIfCancel,defaultindex = -1,sortable = false) cmdwindow.commands = commands cmdwindow.index = defaultindex if defaultindex >= 0 cmdwindow.x = 0 diff --git a/Data/Scripts/020_Debug/002_Animation editor/001_AnimEditor_SceneElements.rb b/Data/Scripts/020_Debug/002_Animation editor/001_AnimEditor_SceneElements.rb index 67aae3105..62afa31c9 100644 --- a/Data/Scripts/020_Debug/002_Animation editor/001_AnimEditor_SceneElements.rb +++ b/Data/Scripts/020_Debug/002_Animation editor/001_AnimEditor_SceneElements.rb @@ -78,7 +78,7 @@ end -def pbSpriteHitTest(sprite,x,y,usealpha=true,wholecanvas=false) +def pbSpriteHitTest(sprite,x,y,usealpha = true,wholecanvas = false) return false if !sprite || sprite.disposed? return false if !sprite.bitmap return false if !sprite.visible @@ -170,7 +170,7 @@ class AnimationWindow < SpriteWrapper NUMFRAMES=5 - def initialize(x,y,width,height,viewport=nil) + def initialize(x,y,width,height,viewport = nil) super(viewport) @animbitmap=nil @arrows=AnimatedBitmap.new("Graphics/Pictures/arrows") @@ -306,7 +306,7 @@ class CanvasAnimationWindow < AnimationWindow return @canvas.animbitmap end - def initialize(canvas,x,y,width,height,viewport=nil) + def initialize(canvas,x,y,width,height,viewport = nil) @canvas=canvas super(x,y,width,height,viewport) end @@ -318,7 +318,7 @@ end # Cel sprite ################################################################################ class InvalidatableSprite < Sprite - def initialize(viewport=nil) + def initialize(viewport = nil) super(viewport) @invalid=false end @@ -362,7 +362,7 @@ class SpriteFrame < InvalidatableSprite NUM_ROWS = (PBAnimation::MAX_SPRITES.to_f/10).ceil # 10 frame number icons in each row - def initialize(id,sprite,viewport,previous=false) + def initialize(id,sprite,viewport,previous = false) super(viewport) @id=id @sprite=sprite @@ -436,7 +436,7 @@ class AnimationCanvas < Sprite BORDERSIZE=64 - def initialize(animation,viewport=nil) + def initialize(animation,viewport = nil) super(viewport) @currentframe=0 @currentcel=-1 @@ -518,7 +518,7 @@ class AnimationCanvas < Sprite super end - def play(oppmove=false) + def play(oppmove = false) if !@playing @sprites["pokemon_0"]=Sprite.new(@viewport) @sprites["pokemon_0"].bitmap=@user @@ -1005,7 +1005,7 @@ end class AnimationNameWindow - def initialize(canvas,x,y,width,height,viewport=nil) + def initialize(canvas,x,y,width,height,viewport = nil) @canvas=canvas @oldname=nil @window=Window_UnformattedTextPokemon.newWithSize( diff --git a/Data/Scripts/020_Debug/002_Animation editor/002_AnimEditor_ControlsButtons.rb b/Data/Scripts/020_Debug/002_Animation editor/002_AnimEditor_ControlsButtons.rb index 2da0927d9..f505153d4 100644 --- a/Data/Scripts/020_Debug/002_Animation editor/002_AnimEditor_ControlsButtons.rb +++ b/Data/Scripts/020_Debug/002_Animation editor/002_AnimEditor_ControlsButtons.rb @@ -1,5 +1,5 @@ module ShadowText - def shadowtext(bitmap,x,y,w,h,t,disabled=false,align=0) + def shadowtext(bitmap,x,y,w,h,t,disabled = false,align = 0) width=bitmap.text_size(t).width if align==2 x+=(w-width) diff --git a/Data/Scripts/020_Debug/002_Animation editor/003_AnimEditor_Interpolation.rb b/Data/Scripts/020_Debug/002_Animation editor/003_AnimEditor_Interpolation.rb index ae1dbb1a9..f43bfeecf 100644 --- a/Data/Scripts/020_Debug/002_Animation editor/003_AnimEditor_Interpolation.rb +++ b/Data/Scripts/020_Debug/002_Animation editor/003_AnimEditor_Interpolation.rb @@ -4,7 +4,7 @@ class ControlPointSprite < SpriteWrapper attr_accessor :dragging - def initialize(red,viewport=nil) + def initialize(red,viewport = nil) super(viewport) self.bitmap=Bitmap.new(6,6) self.bitmap.fill_rect(0,0,6,1,Color.new(0,0,0)) @@ -51,7 +51,7 @@ end class PointSprite < SpriteWrapper - def initialize(x,y,viewport=nil) + def initialize(x,y,viewport = nil) super(viewport) self.bitmap=Bitmap.new(2,2) self.bitmap.fill_rect(0,0,2,2,Color.new(0,0,0)) @@ -129,7 +129,7 @@ class PointPath @totaldist=0 end - def smoothPointPath(frames,roundValues=false) + def smoothPointPath(frames,roundValues = false) if frames<0 raise ArgumentError.new("frames out of range: #{frames}") end diff --git a/Data/Scripts/020_Debug/002_Editor_DataTypes.rb b/Data/Scripts/020_Debug/002_Editor_DataTypes.rb index 23106bf8e..81e75e16c 100644 --- a/Data/Scripts/020_Debug/002_Editor_DataTypes.rb +++ b/Data/Scripts/020_Debug/002_Editor_DataTypes.rb @@ -681,7 +681,7 @@ end -def chooseMapPoint(map,rgnmap=false) +def chooseMapPoint(map,rgnmap = false) viewport=Viewport.new(0,0,Graphics.width,Graphics.height) viewport.z=99999 title = Window_UnformattedTextPokemon.newWithSize(_INTL("Click a point on the map."), @@ -1546,7 +1546,7 @@ end #=============================================================================== # Core property editor script #=============================================================================== -def pbPropertyList(title,data,properties,saveprompt=false) +def pbPropertyList(title,data,properties,saveprompt = false) viewport = Viewport.new(0,0,Graphics.width,Graphics.height) viewport.z = 99999 list = pbListWindow([], Graphics.width / 2) diff --git a/Data/Scripts/020_Debug/003_Debug menus/003_Debug_MenuExtraCode.rb b/Data/Scripts/020_Debug/003_Debug menus/003_Debug_MenuExtraCode.rb index bd2c4bfb0..96bad89b4 100644 --- a/Data/Scripts/020_Debug/003_Debug menus/003_Debug_MenuExtraCode.rb +++ b/Data/Scripts/020_Debug/003_Debug menus/003_Debug_MenuExtraCode.rb @@ -59,7 +59,7 @@ class SpriteWindow_DebugVariables < Window_DrawableCommand refresh end - def shadowtext(x,y,w,h,t,align=0,colors=0) + def shadowtext(x,y,w,h,t,align = 0,colors = 0) width = self.contents.text_size(t).width if align==1 # Right aligned x += (w-width) @@ -364,7 +364,7 @@ class SpriteWindow_DebugRoamers < Window_DrawableCommand return self.roamerCount+2 end - def shadowtext(t,x,y,w,h,align=0,colors=0) + def shadowtext(t,x,y,w,h,align = 0,colors = 0) width = self.contents.text_size(t).width if align==1 x += (w-width) # Right aligned @@ -823,7 +823,7 @@ class PokemonDebugPartyScreen return ret end - def pbShowCommands(text,commands,index=0) + def pbShowCommands(text,commands,index = 0) ret = -1 @helpWindow.visible = true using(cmdwindow = Window_CommandPokemonColor.new(commands)) { @@ -852,7 +852,7 @@ class PokemonDebugPartyScreen return ret end - def pbChooseMove(pkmn,text,index=0) + def pbChooseMove(pkmn,text,index = 0) moveNames = [] for i in pkmn.moves if i.total_pp<=0 diff --git a/Data/Scripts/020_Debug/003_Editor_Listers.rb b/Data/Scripts/020_Debug/003_Editor_Listers.rb index 9979e4b5c..4c46f54b1 100644 --- a/Data/Scripts/020_Debug/003_Editor_Listers.rb +++ b/Data/Scripts/020_Debug/003_Editor_Listers.rb @@ -302,7 +302,7 @@ end # #=============================================================================== class MapLister - def initialize(selmap,addGlobal=false) + def initialize(selmap,addGlobal = false) @sprite = SpriteWrapper.new @sprite.bitmap = nil @sprite.x = Graphics.width * 3 / 4 diff --git a/Data/Scripts/021_Compiler/001_Compiler.rb b/Data/Scripts/021_Compiler/001_Compiler.rb index 0ceedcc7b..d7344c6c4 100644 --- a/Data/Scripts/021_Compiler/001_Compiler.rb +++ b/Data/Scripts/021_Compiler/001_Compiler.rb @@ -76,7 +76,7 @@ module Compiler return line end - def csvQuote(str,always=false) + def csvQuote(str,always = false) return "" if nil_or_empty?(str) if always || str[/[,\"]/] # || str[/^\s/] || str[/\s$/] || str[/^#/] str = str.gsub(/[\"]/,"\\\"") @@ -278,7 +278,7 @@ module Compiler return ret end - def csvBoolean!(str,_line=-1) + def csvBoolean!(str,_line = -1) field = csvfield!(str) if field[/^1|[Tt][Rr][Uu][Ee]|[Yy][Ee][Ss]|[Yy]$/] return true @@ -288,7 +288,7 @@ module Compiler raise _INTL("Field {1} is not a Boolean value (true, false, 1, 0)\r\n{2}",field,FileLineData.linereport) end - def csvInt!(str,_line=-1) + def csvInt!(str,_line = -1) ret = csvfield!(str) if !ret[/^\-?\d+$/] raise _INTL("Field {1} is not an integer\r\n{2}",ret,FileLineData.linereport) @@ -296,7 +296,7 @@ module Compiler return ret.to_i end - def csvPosInt!(str,_line=-1) + def csvPosInt!(str,_line = -1) ret = csvfield!(str) if !ret[/^\d+$/] raise _INTL("Field {1} is not a positive integer\r\n{2}",ret,FileLineData.linereport) @@ -304,7 +304,7 @@ module Compiler return ret.to_i end - def csvFloat!(str,_line=-1) + def csvFloat!(str,_line = -1) ret = csvfield!(str) return Float(ret) rescue raise _INTL("Field {1} is not a number\r\n{2}",ret,FileLineData.linereport) end diff --git a/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb b/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb index 327819d6e..0498d16b9 100644 --- a/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb +++ b/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb @@ -114,7 +114,7 @@ module Compiler return route end - def push_move_route(list,character,route,indent=0) + def push_move_route(list,character,route,indent = 0) route = generate_move_route(route) if route.is_a?(Array) for i in 0...route.list.length list.push(RPG::EventCommand.new( @@ -123,16 +123,16 @@ module Compiler end end - def push_move_route_and_wait(list,character,route,indent=0) + def push_move_route_and_wait(list,character,route,indent = 0) push_move_route(list,character,route,indent) push_event(list,210,[],indent) end - def push_wait(list,frames,indent=0) + def push_wait(list,frames,indent = 0) push_event(list,106,[frames],indent) end - def push_event(list,cmd,params=nil,indent=0) + def push_event(list,cmd,params = nil,indent = 0) list.push(RPG::EventCommand.new(cmd,indent,params ? params : [])) end @@ -140,14 +140,14 @@ module Compiler list.push(RPG::EventCommand.new(0,0,[])) end - def push_comment(list,cmt,indent=0) + def push_comment(list,cmt,indent = 0) textsplit2 = cmt.split(/\n/) for i in 0...textsplit2.length list.push(RPG::EventCommand.new((i==0) ? 108 : 408,indent,[textsplit2[i].gsub(/\s+$/,"")])) end end - def push_text(list,text,indent=0) + def push_text(list,text,indent = 0) return if !text textsplit = text.split(/\\m/) for t in textsplit @@ -163,7 +163,7 @@ module Compiler end end - def push_script(list,script,indent=0) + def push_script(list,script,indent = 0) return if !script first = true textsplit2 = script.split(/\n/) @@ -176,25 +176,25 @@ module Compiler end end - def push_exit(list,indent=0) + def push_exit(list,indent = 0) list.push(RPG::EventCommand.new(115,indent,[])) end - def push_else(list,indent=0) + def push_else(list,indent = 0) list.push(RPG::EventCommand.new(0,indent,[])) list.push(RPG::EventCommand.new(411,indent-1,[])) end - def push_branch(list,script,indent=0) + def push_branch(list,script,indent = 0) list.push(RPG::EventCommand.new(111,indent,[12,script])) end - def push_branch_end(list,indent=0) + def push_branch_end(list,indent = 0) list.push(RPG::EventCommand.new(0,indent,[])) list.push(RPG::EventCommand.new(412,indent-1,[])) end - def push_self_switch(list,swtch,switchOn,indent=0) + def push_self_switch(list,swtch,switchOn,indent = 0) list.push(RPG::EventCommand.new(123,indent,[swtch,switchOn ? 0 : 1])) end