mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2026-01-27 08:46:00 +00:00
Fixed incorrect animation when a critical capture Poké Ball fails to catch the Pokémon
This commit is contained in:
@@ -686,7 +686,8 @@ class Battle::Scene::Animation::PokeballThrowCapture < Battle::Scene::Animation
|
|||||||
def initialize(sprites,viewport,
|
def initialize(sprites,viewport,
|
||||||
poke_ball,numShakes,critCapture,battler,showingTrainer)
|
poke_ball,numShakes,critCapture,battler,showingTrainer)
|
||||||
@poke_ball = poke_ball
|
@poke_ball = poke_ball
|
||||||
@numShakes = (critCapture) ? 1 : numShakes
|
@success = numShakes >= 4
|
||||||
|
@numShakes = (critCapture && numShakes > 0) ? 1 : numShakes
|
||||||
@critCapture = critCapture
|
@critCapture = critCapture
|
||||||
@battler = battler
|
@battler = battler
|
||||||
@showingTrainer = showingTrainer # Only true if a Safari Zone battle
|
@showingTrainer = showingTrainer # Only true if a Safari Zone battle
|
||||||
@@ -713,7 +714,7 @@ class Battle::Scene::Animation::PokeballThrowCapture < Battle::Scene::Animation
|
|||||||
# Set up Poké Ball sprite
|
# Set up Poké Ball sprite
|
||||||
ball = addBallSprite(ballStartX,ballStartY,@poke_ball)
|
ball = addBallSprite(ballStartX,ballStartY,@poke_ball)
|
||||||
ball.setZ(0,batSprite.z+1)
|
ball.setZ(0,batSprite.z+1)
|
||||||
@ballSpriteIndex = (@numShakes>=4 || @critCapture) ? @tempSprites.length-1 : -1
|
@ballSpriteIndex = (@success) ? @tempSprites.length - 1 : -1
|
||||||
# Set up trainer sprite (only visible in Safari Zone battles)
|
# Set up trainer sprite (only visible in Safari Zone battles)
|
||||||
if @showingTrainer && traSprite
|
if @showingTrainer && traSprite
|
||||||
if traSprite.bitmap.width>=traSprite.bitmap.height*2
|
if traSprite.bitmap.width>=traSprite.bitmap.height*2
|
||||||
@@ -796,7 +797,10 @@ class Battle::Scene::Animation::PokeballThrowCapture < Battle::Scene::Animation
|
|||||||
ball.moveAngle(delay+6,2,0)
|
ball.moveAngle(delay+6,2,0)
|
||||||
delay = ball.totalDuration+8
|
delay = ball.totalDuration+8
|
||||||
end
|
end
|
||||||
if @numShakes==0 || (@numShakes<4 && !@critCapture)
|
if @success
|
||||||
|
# Pokémon was caught
|
||||||
|
ballCaptureSuccess(ball,delay,ballEndX,ballGroundY)
|
||||||
|
else
|
||||||
# Poké Ball opens
|
# Poké Ball opens
|
||||||
ball.setZ(delay,batSprite.z-1)
|
ball.setZ(delay,batSprite.z-1)
|
||||||
ballOpenUp(ball,delay,@poke_ball,false)
|
ballOpenUp(ball,delay,@poke_ball,false)
|
||||||
@@ -812,9 +816,6 @@ class Battle::Scene::Animation::PokeballThrowCapture < Battle::Scene::Animation
|
|||||||
shadow.setZoom(delay+5,100)
|
shadow.setZoom(delay+5,100)
|
||||||
shadow.moveOpacity(delay+5,10,255)
|
shadow.moveOpacity(delay+5,10,255)
|
||||||
end
|
end
|
||||||
else
|
|
||||||
# Pokémon was caught
|
|
||||||
ballCaptureSuccess(ball,delay,ballEndX,ballGroundY)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user