Fix B_ANIMATE_MON_AFTER_KO with a new counter (#7531)
Co-authored-by: Hedara <hedara90@gmail.com> Co-authored-by: Martin Griffin <martinrgriffin@gmail.com>
This commit is contained in:
parent
2d9dc28b7a
commit
95eb3ba1a7
@ -5232,6 +5232,7 @@ BattleScript_FaintAttacker::
|
|||||||
dofaintanimation BS_ATTACKER
|
dofaintanimation BS_ATTACKER
|
||||||
printstring STRINGID_ATTACKERFAINTED
|
printstring STRINGID_ATTACKERFAINTED
|
||||||
cleareffectsonfaint BS_ATTACKER
|
cleareffectsonfaint BS_ATTACKER
|
||||||
|
waitanimation
|
||||||
tryactivatesoulheart
|
tryactivatesoulheart
|
||||||
tryactivatereceiver BS_ATTACKER
|
tryactivatereceiver BS_ATTACKER
|
||||||
trytrainerslidefirstdownmsg BS_ATTACKER
|
trytrainerslidefirstdownmsg BS_ATTACKER
|
||||||
@ -5246,6 +5247,7 @@ BattleScript_FaintTarget::
|
|||||||
dofaintanimation BS_TARGET
|
dofaintanimation BS_TARGET
|
||||||
printstring STRINGID_TARGETFAINTED
|
printstring STRINGID_TARGETFAINTED
|
||||||
cleareffectsonfaint BS_TARGET
|
cleareffectsonfaint BS_TARGET
|
||||||
|
waitanimation
|
||||||
tryactivatesoulheart
|
tryactivatesoulheart
|
||||||
tryactivatereceiver BS_TARGET
|
tryactivatereceiver BS_TARGET
|
||||||
trytrainerslidefirstdownmsg BS_TARGET
|
trytrainerslidefirstdownmsg BS_TARGET
|
||||||
@ -8980,6 +8982,7 @@ BattleScript_ArenaDoJudgment::
|
|||||||
waitcry BS_ATTACKER
|
waitcry BS_ATTACKER
|
||||||
dofaintanimation BS_OPPONENT1
|
dofaintanimation BS_OPPONENT1
|
||||||
cleareffectsonfaint BS_OPPONENT1
|
cleareffectsonfaint BS_OPPONENT1
|
||||||
|
waitanimation
|
||||||
arenaopponentmonlost
|
arenaopponentmonlost
|
||||||
end2
|
end2
|
||||||
|
|
||||||
@ -8994,6 +8997,7 @@ BattleScript_ArenaJudgmentPlayerLoses:
|
|||||||
waitcry BS_ATTACKER
|
waitcry BS_ATTACKER
|
||||||
dofaintanimation BS_PLAYER1
|
dofaintanimation BS_PLAYER1
|
||||||
cleareffectsonfaint BS_PLAYER1
|
cleareffectsonfaint BS_PLAYER1
|
||||||
|
waitanimation
|
||||||
arenaplayermonlost
|
arenaplayermonlost
|
||||||
end2
|
end2
|
||||||
|
|
||||||
@ -9008,10 +9012,12 @@ BattleScript_ArenaJudgmentDraw:
|
|||||||
waitcry BS_ATTACKER
|
waitcry BS_ATTACKER
|
||||||
dofaintanimation BS_PLAYER1
|
dofaintanimation BS_PLAYER1
|
||||||
cleareffectsonfaint BS_PLAYER1
|
cleareffectsonfaint BS_PLAYER1
|
||||||
|
waitanimation
|
||||||
playfaintcry BS_OPPONENT1
|
playfaintcry BS_OPPONENT1
|
||||||
waitcry BS_ATTACKER
|
waitcry BS_ATTACKER
|
||||||
dofaintanimation BS_OPPONENT1
|
dofaintanimation BS_OPPONENT1
|
||||||
cleareffectsonfaint BS_OPPONENT1
|
cleareffectsonfaint BS_OPPONENT1
|
||||||
|
waitanimation
|
||||||
arenabothmonlost
|
arenabothmonlost
|
||||||
end2
|
end2
|
||||||
|
|
||||||
|
|||||||
@ -687,7 +687,7 @@ struct BattleStruct
|
|||||||
u8 startingStatusDone:1;
|
u8 startingStatusDone:1;
|
||||||
u8 terrainDone:1;
|
u8 terrainDone:1;
|
||||||
u8 overworldWeatherDone:1;
|
u8 overworldWeatherDone:1;
|
||||||
u8 unused:3;
|
u8 battlerKOAnimsRunning:3;
|
||||||
u8 isAtkCancelerForCalledMove:1; // Certain cases in atk canceler should only be checked once, when the original move is called, however others need to be checked the twice.
|
u8 isAtkCancelerForCalledMove:1; // Certain cases in atk canceler should only be checked once, when the original move is called, however others need to be checked the twice.
|
||||||
u8 friskedAbility:1; // If identifies two mons, show the ability pop-up only once.
|
u8 friskedAbility:1; // If identifies two mons, show the ability pop-up only once.
|
||||||
u8 fickleBeamBoosted:1;
|
u8 fickleBeamBoosted:1;
|
||||||
|
|||||||
@ -3122,6 +3122,8 @@ static void LaunchKOAnimation(u32 battlerId, u16 animId, bool32 isFront)
|
|||||||
u32 species = GetBattlerVisualSpecies(battlerId);
|
u32 species = GetBattlerVisualSpecies(battlerId);
|
||||||
u32 spriteId = gBattlerSpriteIds[battlerId];
|
u32 spriteId = gBattlerSpriteIds[battlerId];
|
||||||
|
|
||||||
|
gBattleStruct->battlerKOAnimsRunning++;
|
||||||
|
|
||||||
if (isFront)
|
if (isFront)
|
||||||
{
|
{
|
||||||
LaunchAnimationTaskForFrontSprite(&gSprites[spriteId], animId);
|
LaunchAnimationTaskForFrontSprite(&gSprites[spriteId], animId);
|
||||||
|
|||||||
@ -2558,7 +2558,7 @@ static void Cmd_waitanimation(void)
|
|||||||
{
|
{
|
||||||
CMD_ARGS();
|
CMD_ARGS();
|
||||||
|
|
||||||
if (gBattleControllerExecFlags == 0)
|
if (gBattleControllerExecFlags == 0 && gBattleStruct->battlerKOAnimsRunning == 0)
|
||||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -523,6 +523,11 @@ static void Task_HandleMonAnimation(u8 taskId)
|
|||||||
sprite->data[2] = gTasks[taskId].tSpeciesId;
|
sprite->data[2] = gTasks[taskId].tSpeciesId;
|
||||||
sprite->data[1] = 0;
|
sprite->data[1] = 0;
|
||||||
|
|
||||||
|
// Task_HandleMonAnimation handles more than just KO animations,
|
||||||
|
// but if the counter is non-zero then only KO animations are running.
|
||||||
|
// This assumption is not checked.
|
||||||
|
if (gBattleStruct->battlerKOAnimsRunning > 0)
|
||||||
|
gBattleStruct->battlerKOAnimsRunning--;
|
||||||
DestroyTask(taskId);
|
DestroyTask(taskId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user