From b5293cc3e2b7c38364b9bc7b39ed7e4bc6cb2bec Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sat, 16 Oct 2021 17:04:36 +1300 Subject: [PATCH] Fix multi target moves Only run CANCELLER_PRANKSTER when moving to the next target of a multi target move. If more cancellers are needed they can be added/moved after CANCELLER_PRANKSTER. --- include/battle_util.h | 27 +++++++++++++++++++++++++++ src/battle_script_commands.c | 2 +- src/battle_util.c | 27 --------------------------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/include/battle_util.h b/include/battle_util.h index 7d1b99f347..3f4f4bbc79 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -34,6 +34,33 @@ #define ITEMEFFECT_LIFEORB_SHELLBELL 0x7 #define ITEMEFFECT_BATTLER_MOVE_END 0x8 // move end effects for just the battler, not whole field +// Move cancellers. Note that anything from CANCELLER_PRANKSTER onwards is +// called on each target of a multi target move, so any new cancellers should +// probably be added before CANCELLER_PRANKSTER. +#define CANCELLER_FLAGS 0 +#define CANCELLER_ASLEEP 1 +#define CANCELLER_FROZEN 2 +#define CANCELLER_TRUANT 3 +#define CANCELLER_RECHARGE 4 +#define CANCELLER_FLINCH 5 +#define CANCELLER_DISABLED 6 +#define CANCELLER_GRAVITY 7 +#define CANCELLER_HEAL_BLOCKED 8 +#define CANCELLER_TAUNTED 9 +#define CANCELLER_IMPRISONED 10 +#define CANCELLER_CONFUSED 11 +#define CANCELLER_PARALYSED 12 +#define CANCELLER_IN_LOVE 13 +#define CANCELLER_BIDE 14 +#define CANCELLER_THAW 15 +#define CANCELLER_POWDER_MOVE 16 +#define CANCELLER_POWDER_STATUS 17 +#define CANCELLER_THROAT_CHOP 18 +#define CANCELLER_PRANKSTER 19 +#define CANCELLER_END 20 +#define CANCELLER_PSYCHIC_TERRAIN 21 +#define CANCELLER_END2 22 + #define WEATHER_HAS_EFFECT ((!IsAbilityOnField(ABILITY_CLOUD_NINE) && !IsAbilityOnField(ABILITY_AIR_LOCK))) #define IS_WHOLE_SIDE_ALIVE(battler)((IsBattlerAlive(battler) && IsBattlerAlive(BATTLE_PARTNER(battler)))) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 29614e09b4..ea169f52d1 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -5157,7 +5157,7 @@ static void Cmd_moveend(void) MoveValuesCleanUp(); gBattleScripting.moveEffect = gBattleScripting.savedMoveEffect; BattleScriptPush(gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]); - gBattleStruct->atkCancellerTracker = 0; // Run all cancellers on next target + gBattleStruct->atkCancellerTracker = CANCELLER_PRANKSTER; // Run Prankster canceller on next target, skip the earlier ones gBattlescriptCurrInstr = BattleScript_FlushMessageBox; return; } diff --git a/src/battle_util.c b/src/battle_util.c index 18a1bfb476..1177c316ef 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -3102,33 +3102,6 @@ void TryClearRageAndFuryCutter(void) } } -enum -{ - CANCELLER_FLAGS, - CANCELLER_ASLEEP, - CANCELLER_FROZEN, - CANCELLER_TRUANT, - CANCELLER_RECHARGE, - CANCELLER_FLINCH, - CANCELLER_DISABLED, - CANCELLER_GRAVITY, - CANCELLER_HEAL_BLOCKED, - CANCELLER_TAUNTED, - CANCELLER_IMPRISONED, - CANCELLER_CONFUSED, - CANCELLER_PARALYSED, - CANCELLER_IN_LOVE, - CANCELLER_BIDE, - CANCELLER_THAW, - CANCELLER_POWDER_MOVE, - CANCELLER_POWDER_STATUS, - CANCELLER_THROAT_CHOP, - CANCELLER_PRANKSTER, - CANCELLER_END, - CANCELLER_PSYCHIC_TERRAIN, - CANCELLER_END2, -}; - u8 AtkCanceller_UnableToUseMove(void) { u8 effect = 0;