anger shell use saveattacker (#5409)

* anger shell use saveattacker

* tabs instead of spaces

* add BattleScript_RestoreAttackerButItFailed for anger shell failure

* Update data/battle_scripts_1.s

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>

---------

Co-authored-by: ghoulslash <pokevoyager0@gmail.com>
Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
This commit is contained in:
ghoulslash 2024-09-20 12:19:45 -04:00 committed by GitHub
parent 64d4d7e570
commit 4cd23a377d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View File

@ -4724,6 +4724,9 @@ BattleScript_ButItFailed::
resultmessage
waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_RestoreAttackerButItFailed:
restoreattacker
goto BattleScript_ButItFailed
BattleScript_NotAffected::
pause B_WAIT_TIME_SHORT
@ -6460,12 +6463,14 @@ BattleScript_SeedSowerActivates::
return
BattleScript_AngerShellActivates::
saveattacker
copybyte gBattlerAttacker, gBattlerTarget
call BattleScript_AbilityPopUp
jumpifstat BS_TARGET, CMP_LESS_THAN, STAT_ATK, MAX_STAT_STAGE, BattleScript_AngerShellTryDef
jumpifstat BS_TARGET, CMP_LESS_THAN, STAT_SPATK, MAX_STAT_STAGE, BattleScript_AngerShellTryDef
jumpifstat BS_TARGET, CMP_LESS_THAN, STAT_SPEED, MAX_STAT_STAGE, BattleScript_AngerShellTryDef
jumpifstat BS_TARGET, CMP_GREATER_THAN, STAT_DEF, MIN_STAT_STAGE, BattleScript_AngerShellTryDef
jumpifstat BS_TARGET, CMP_EQUAL, STAT_SPDEF, MIN_STAT_STAGE, BattleScript_ButItFailed
jumpifstat BS_TARGET, CMP_EQUAL, STAT_SPDEF, MIN_STAT_STAGE, BattleScript_RestoreAttackerButItFailed
BattleScript_AngerShellTryDef::
setbyte sSTAT_ANIM_PLAYED, FALSE
modifybattlerstatstage BS_ATTACKER, STAT_DEF, DECREASE, 1, BattleScript_AngerShellTrySpDef, ANIM_ON
@ -6479,6 +6484,7 @@ BattleScript_AngerShellTrySpAtk:
BattleScript_AngerShellTrySpeed:
modifybattlerstatstage BS_ATTACKER, STAT_SPEED, INCREASE, 1, BattleScript_AngerShellRet, ANIM_ON
BattleScript_AngerShellRet:
restoreattacker
return
BattleScript_WindPowerActivates::

View File

@ -5936,7 +5936,6 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
&& HadMoreThanHalfHpNowDoesnt(gBattlerTarget)
&& !(TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove)))
{
gBattlerAttacker = gBattlerTarget;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_AngerShellActivates;
effect++;