Enabled BallBurst common animations to be played during other battle animations

This commit is contained in:
Maruno17
2022-02-22 19:26:50 +00:00
parent 2057084f69
commit e5be233224
5 changed files with 73 additions and 12 deletions

View File

@@ -163,7 +163,7 @@ class Battle::Scene
def pbRecall(idxBattler)
@briefMessage = false
# Recall animation
recallAnim = Animation::BattlerRecall.new(@sprites, @viewport, idxBattler)
recallAnim = Animation::BattlerRecall.new(@sprites, @viewport, @battle.battlers[idxBattler])
loop do
recallAnim&.update
pbUpdate
@@ -564,4 +564,18 @@ class Battle::Scene
targetSprite.pbSetOrigin
end
end
# Ball burst common animations should have a focus of "Target" and a priority
# of "Front".
def pbBallBurstCommonAnimation(_picture_ex, anim_name, battler, target_x, target_y)
return if nil_or_empty?(anim_name)
animations = pbLoadBattleAnimations
anim = animations&.get_from_name("Common:" + anim_name)
return if !anim
animPlayer = PBAnimationPlayerX.new(anim, battler, nil, self)
animPlayer.discard_user_and_target_sprites # Don't involve user/target in animation
animPlayer.set_target_origin(target_x, target_y)
animPlayer.start
@animations.push(animPlayer)
end
end