Skip to content

Commit

Permalink
anger shell use saveattacker (#5409)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

---------

Co-authored-by: ghoulslash <[email protected]>
Co-authored-by: Alex <[email protected]>
  • Loading branch information
3 people authored Sep 20, 2024
1 parent 64d4d7e commit 4cd23a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 7 additions & 1 deletion data/battle_scripts_1.s
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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::
Expand Down
1 change: 0 additions & 1 deletion src/battle_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down

0 comments on commit 4cd23a3

Please sign in to comment.