Cleans up Primal Reversion code (#5659)
This commit is contained in:
commit
1d7e4cf8fc
4 changed files with 9 additions and 28 deletions
|
@ -6988,26 +6988,17 @@ BattleScript_WishMegaEvolution::
|
||||||
goto BattleScript_MegaEvolutionAfterString
|
goto BattleScript_MegaEvolutionAfterString
|
||||||
|
|
||||||
BattleScript_PrimalReversion::
|
BattleScript_PrimalReversion::
|
||||||
call BattleScript_PrimalReversionRet
|
|
||||||
end3
|
|
||||||
|
|
||||||
BattleScript_PrimalReversionRestoreAttacker::
|
|
||||||
call BattleScript_PrimalReversionRet
|
|
||||||
copybyte gBattlerAttacker, sSAVED_BATTLER
|
|
||||||
end3
|
|
||||||
|
|
||||||
BattleScript_PrimalReversionRet::
|
|
||||||
flushtextbox
|
flushtextbox
|
||||||
setbyte gIsCriticalHit, 0
|
setbyte gIsCriticalHit, 0
|
||||||
handleprimalreversion BS_ATTACKER, 0
|
handleprimalreversion BS_SCRIPTING, 0
|
||||||
handleprimalreversion BS_ATTACKER, 1
|
handleprimalreversion BS_SCRIPTING, 1
|
||||||
playanimation BS_ATTACKER, B_ANIM_PRIMAL_REVERSION
|
playanimation BS_SCRIPTING, B_ANIM_PRIMAL_REVERSION
|
||||||
waitanimation
|
waitanimation
|
||||||
handleprimalreversion BS_ATTACKER, 2
|
handleprimalreversion BS_SCRIPTING, 2
|
||||||
printstring STRINGID_PKMNREVERTEDTOPRIMAL
|
printstring STRINGID_PKMNREVERTEDTOPRIMAL
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
switchinabilities BS_ATTACKER
|
switchinabilities BS_SCRIPTING
|
||||||
return
|
end3
|
||||||
|
|
||||||
BattleScript_UltraBurst::
|
BattleScript_UltraBurst::
|
||||||
flushtextbox
|
flushtextbox
|
||||||
|
|
|
@ -439,7 +439,6 @@ extern const u8 BattleScript_AttackWeakenedByStrongWinds[];
|
||||||
extern const u8 BattleScript_BlockedByPrimalWeatherEnd3[];
|
extern const u8 BattleScript_BlockedByPrimalWeatherEnd3[];
|
||||||
extern const u8 BattleScript_BlockedByPrimalWeatherRet[];
|
extern const u8 BattleScript_BlockedByPrimalWeatherRet[];
|
||||||
extern const u8 BattleScript_PrimalReversion[];
|
extern const u8 BattleScript_PrimalReversion[];
|
||||||
extern const u8 BattleScript_PrimalReversionRestoreAttacker[];
|
|
||||||
extern const u8 BattleScript_HyperspaceFuryRemoveProtect[];
|
extern const u8 BattleScript_HyperspaceFuryRemoveProtect[];
|
||||||
extern const u8 BattleScript_SelectingNotAllowedMoveGorillaTactics[];
|
extern const u8 BattleScript_SelectingNotAllowedMoveGorillaTactics[];
|
||||||
extern const u8 BattleScript_SelectingNotAllowedMoveGorillaTacticsInPalace[];
|
extern const u8 BattleScript_SelectingNotAllowedMoveGorillaTacticsInPalace[];
|
||||||
|
|
|
@ -750,7 +750,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
|
||||||
[STRINGID_MYSTERIOUSAIRCURRENTBLOWSON] = COMPOUND_STRING("The mysterious strong winds blow on regardless!"),
|
[STRINGID_MYSTERIOUSAIRCURRENTBLOWSON] = COMPOUND_STRING("The mysterious strong winds blow on regardless!"),
|
||||||
[STRINGID_ATTACKWEAKENEDBSTRONGWINDS] = COMPOUND_STRING("The mysterious strong winds weakened the attack!"),
|
[STRINGID_ATTACKWEAKENEDBSTRONGWINDS] = COMPOUND_STRING("The mysterious strong winds weakened the attack!"),
|
||||||
[STRINGID_STUFFCHEEKSCANTSELECT] = COMPOUND_STRING("It can't use the move because it doesn't have a Berry!\p"),
|
[STRINGID_STUFFCHEEKSCANTSELECT] = COMPOUND_STRING("It can't use the move because it doesn't have a Berry!\p"),
|
||||||
[STRINGID_PKMNREVERTEDTOPRIMAL] = COMPOUND_STRING("{B_ATK_NAME_WITH_PREFIX}'s Primal Reversion! It reverted to its primal state!"),
|
[STRINGID_PKMNREVERTEDTOPRIMAL] = COMPOUND_STRING("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s Primal Reversion! It reverted to its primal state!"),
|
||||||
[STRINGID_BUTPOKEMONCANTUSETHEMOVE] = COMPOUND_STRING("But {B_ATK_NAME_WITH_PREFIX2} can't use the move!"),
|
[STRINGID_BUTPOKEMONCANTUSETHEMOVE] = COMPOUND_STRING("But {B_ATK_NAME_WITH_PREFIX2} can't use the move!"),
|
||||||
[STRINGID_BUTHOOPACANTUSEIT] = COMPOUND_STRING("But {B_ATK_NAME_WITH_PREFIX2} can't use it the way it is now!"),
|
[STRINGID_BUTHOOPACANTUSEIT] = COMPOUND_STRING("But {B_ATK_NAME_WITH_PREFIX2} can't use it the way it is now!"),
|
||||||
[STRINGID_BROKETHROUGHPROTECTION] = COMPOUND_STRING("It broke through {B_DEF_NAME_WITH_PREFIX2}'s protection!"),
|
[STRINGID_BROKETHROUGHPROTECTION] = COMPOUND_STRING("It broke through {B_DEF_NAME_WITH_PREFIX2}'s protection!"),
|
||||||
|
|
|
@ -6425,17 +6425,8 @@ bool32 TryPrimalReversion(u32 battler)
|
||||||
if (GetBattlerHoldEffect(battler, FALSE) == HOLD_EFFECT_PRIMAL_ORB
|
if (GetBattlerHoldEffect(battler, FALSE) == HOLD_EFFECT_PRIMAL_ORB
|
||||||
&& GetBattleFormChangeTargetSpecies(battler, FORM_CHANGE_BATTLE_PRIMAL_REVERSION) != SPECIES_NONE)
|
&& GetBattleFormChangeTargetSpecies(battler, FORM_CHANGE_BATTLE_PRIMAL_REVERSION) != SPECIES_NONE)
|
||||||
{
|
{
|
||||||
if (gBattlerAttacker == battler)
|
gBattleScripting.battler = battler;
|
||||||
{
|
|
||||||
BattleScriptPushCursorAndCallback(BattleScript_PrimalReversion);
|
BattleScriptPushCursorAndCallback(BattleScript_PrimalReversion);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// edge case for scenarios like a switch-in after activated eject button
|
|
||||||
gBattleScripting.savedBattler = gBattlerAttacker;
|
|
||||||
gBattlerAttacker = battler;
|
|
||||||
BattleScriptPushCursorAndCallback(BattleScript_PrimalReversionRestoreAttacker);
|
|
||||||
}
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
Loading…
Reference in a new issue