The Great Enspacening begins!

This commit is contained in:
Maruno17
2021-12-18 12:20:31 +00:00
parent 2480ab0f9e
commit f7b76ae62e
138 changed files with 567 additions and 567 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -17,7 +17,7 @@ class Battle::Scene::Animation
def empty?; return @pictureEx.length==0; end
def animDone?; return @animDone; end
def addSprite(s,origin=PictureOrigin::TopLeft)
def addSprite(s,origin = PictureOrigin::TopLeft)
num = @pictureEx.length
picture = PictureEx.new(s.z)
picture.x = s.x
@@ -31,7 +31,7 @@ class Battle::Scene::Animation
return picture
end
def addNewSprite(x,y,name,origin=PictureOrigin::TopLeft)
def addNewSprite(x,y,name,origin = PictureOrigin::TopLeft)
num = @pictureEx.length
picture = PictureEx.new(num)
picture.setXY(0,x,y)
@@ -96,7 +96,7 @@ module Battle::Scene::Animation::BallAnimationMixin
return ball
end
def ballTracksHand(ball,traSprite,safariThrow=false)
def ballTracksHand(ball,traSprite,safariThrow = false)
# Back sprite isn't animated, no hand-tracking needed
if traSprite.bitmap.width<traSprite.bitmap.height*2
ball.setVisible(7,true)

View File

@@ -47,7 +47,7 @@ class Battle::Scene::Animation::Intro < Battle::Scene::Animation
blackBar.moveOpacity(appearTime*3/4,appearTime/4,0)
end
def makeSlideSprite(spriteName,deltaMult,appearTime,origin=nil)
def makeSlideSprite(spriteName,deltaMult,appearTime,origin = nil)
# If deltaMult is positive, the sprite starts off to the right and moves
# left (for sprites on the player's side and the background).
return if !@sprites[spriteName]
@@ -304,7 +304,7 @@ end
# Doesn't show the ball thrown or the Pokémon.
#===============================================================================
class Battle::Scene::Animation::PlayerFade < Battle::Scene::Animation
def initialize(sprites,viewport,fullAnim=false)
def initialize(sprites,viewport,fullAnim = false)
@fullAnim = fullAnim # True at start of battle, false when switching
super(sprites,viewport)
end
@@ -357,7 +357,7 @@ end
# Doesn't show the ball thrown or the Pokémon.
#===============================================================================
class Battle::Scene::Animation::TrainerFade < Battle::Scene::Animation
def initialize(sprites,viewport,fullAnim=false)
def initialize(sprites,viewport,fullAnim = false)
@fullAnim = fullAnim # True at start of battle, false when switching
super(sprites,viewport)
end
@@ -404,7 +404,7 @@ end
class Battle::Scene::Animation::PokeballPlayerSendOut < Battle::Scene::Animation
include Battle::Scene::Animation::BallAnimationMixin
def initialize(sprites,viewport,idxTrainer,battler,startBattle,idxOrder=0)
def initialize(sprites,viewport,idxTrainer,battler,startBattle,idxOrder = 0)
@idxTrainer = idxTrainer
@battler = battler
@showingTrainer = startBattle

View File

@@ -23,9 +23,9 @@ class Battle::DebugSceneNoLogging
def pbBeginCommandPhase; end
def pbBeginAttackPhase; end
def pbShowOpponent(idxTrainer); end
def pbDamageAnimation(battler,effectiveness=0); end
def pbCommonAnimation(animName,user=nil,target=nil); end
def pbAnimation(moveID,user,targets,hitNum=0); end
def pbDamageAnimation(battler,effectiveness = 0); end
def pbCommonAnimation(animName,user = nil,target = nil); end
def pbAnimation(moveID,user,targets,hitNum = 0); end
def pbEndBattle(result); end
def pbWildBattleSuccess; end
def pbTrainerBattleSuccess; end
@@ -34,17 +34,17 @@ class Battle::DebugSceneNoLogging
def pbRefresh; end
def pbDisplayMessage(msg,brief=false); end
def pbDisplayMessage(msg,brief = false); end
def pbDisplayPausedMessage(msg); end
def pbDisplayConfirmMessage(msg); return true; end
def pbShowCommands(msg,commands,defaultValue); return 0; end
def pbSendOutBattlers(sendOuts,startBattle=false); end
def pbSendOutBattlers(sendOuts,startBattle = false); end
def pbRecall(idxBattler); end
def pbItemMenu(idxBattler,firstAction); return -1; end
def pbResetMoveIndex(idxBattler); end
def pbHPChanged(battler,oldHP,showAnim=false); end
def pbHPChanged(battler,oldHP,showAnim = false); end
def pbFaintBattler(battler); end
def pbEXPBar(battler,startExp,endExp,tempExp1,tempExp2); end
def pbLevelUp(pkmn, battler, oldTotalHP, oldAttack, oldDefense,
@@ -57,20 +57,20 @@ class Battle::DebugSceneNoLogging
return 0 # Fight
end
def pbFightMenu(idxBattler,megaEvoPossible=false)
def pbFightMenu(idxBattler,megaEvoPossible = false)
battler = @battle.battlers[idxBattler]
50.times do
break if yield rand(battler.move.length)
end
end
def pbChooseTarget(idxBattler,target_data,visibleSprites=nil)
def pbChooseTarget(idxBattler,target_data,visibleSprites = nil)
targets = @battle.allOtherSideBattlers(idxBattler).map { |b| b.index }
return -1 if targets.length==0
return targets.sample
end
def pbPartyScreen(idxBattler,canCancel=false)
def pbPartyScreen(idxBattler,canCancel = false)
replacements = []
@battle.eachInTeamFromBattlerIndex(idxBattler) do |_b,idxParty|
replacements.push(idxParty) if !@battle.pbFindBattler(idxParty,idxBattler)