Canceller -> Canceler rename (#8294)

This commit is contained in:
Martin Griffin 2025-11-19 15:53:38 +00:00 committed by GitHub
commit 976a88bca5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 134 additions and 134 deletions

View File

@ -619,7 +619,7 @@ struct EventStates
enum FirstTurnEventsStates beforeFristTurn:8; enum FirstTurnEventsStates beforeFristTurn:8;
enum FaintedActions faintedAction:8; enum FaintedActions faintedAction:8;
enum BattlerId faintedActionBattler:4; enum BattlerId faintedActionBattler:4;
enum MoveSuccessOrder atkCanceller:8; enum MoveSuccessOrder atkCanceler:8;
enum BattleIntroStates battleIntro:8; enum BattleIntroStates battleIntro:8;
u32 padding:24; u32 padding:24;
}; };

View File

@ -98,39 +98,39 @@ struct TypePower
enum MoveSuccessOrder enum MoveSuccessOrder
{ {
CANCELLER_CLEAR_FLAGS, CANCELER_STANCE_CHANGE_1,
CANCELLER_STANCE_CHANGE_1, CANCELER_CLEAR_FLAGS,
CANCELLER_SKY_DROP, CANCELER_SKY_DROP,
CANCELLER_RECHARGE, CANCELER_RECHARGE,
CANCELLER_ASLEEP_OR_FROZEN, CANCELER_ASLEEP_OR_FROZEN,
CANCELLER_POWER_POINTS, CANCELER_POWER_POINTS,
CANCELLER_OBEDIENCE, CANCELER_OBEDIENCE,
CANCELLER_TRUANT, CANCELER_TRUANT,
CANCELLER_FLINCH, CANCELER_FLINCH,
CANCELLER_DISABLED, CANCELER_DISABLED,
CANCELLER_VOLATILE_BLOCKED, // Gravity / Heal Block / Throat Chop CANCELER_VOLATILE_BLOCKED, // Gravity / Heal Block / Throat Chop
CANCELLER_TAUNTED, CANCELER_TAUNTED,
CANCELLER_IMPRISONED, CANCELER_IMPRISONED,
CANCELLER_CONFUSED, CANCELER_CONFUSED,
CANCELLER_PARALYSED, CANCELER_PARALYSED,
CANCELLER_INFATUATION, CANCELER_INFATUATION,
CANCELLER_BIDE, CANCELER_BIDE,
CANCELLER_Z_MOVES, CANCELER_Z_MOVES,
CANCELLER_CHOICE_LOCK, CANCELER_CHOICE_LOCK,
CANCELLER_CALLSUBMOVE, CANCELER_CALLSUBMOVE,
CANCELLER_THAW, CANCELER_THAW,
CANCELLER_STANCE_CHANGE_2, CANCELER_STANCE_CHANGE_2,
CANCELLER_ATTACKSTRING, CANCELER_ATTACKSTRING,
CANCELLER_PPDEDUCTION, CANCELER_PPDEDUCTION,
CANCELLER_WEATHER_PRIMAL, CANCELER_WEATHER_PRIMAL,
CANCELLER_MOVE_FAILURE, CANCELER_MOVE_FAILURE,
CANCELLER_POWDER_STATUS, CANCELER_POWDER_STATUS,
CANCELLER_PRIORITY_BLOCK, CANCELER_PRIORITY_BLOCK,
CANCELLER_PROTEAN, CANCELER_PROTEAN,
CANCELLER_EXPLODING_DAMP, CANCELER_EXPLODING_DAMP,
CANCELLER_MULTIHIT_MOVES, CANCELER_MULTIHIT_MOVES,
CANCELLER_MULTI_TARGET_MOVES, CANCELER_MULTI_TARGET_MOVES,
CANCELLER_END, CANCELER_END,
}; };
enum Obedience enum Obedience
@ -143,7 +143,7 @@ enum Obedience
DISOBEYS_RANDOM_MOVE, DISOBEYS_RANDOM_MOVE,
}; };
enum MoveCanceller enum MoveCanceler
{ {
MOVE_STEP_SUCCESS, MOVE_STEP_SUCCESS,
MOVE_STEP_BREAK, // Breaks out of the function to run a script MOVE_STEP_BREAK, // Breaks out of the function to run a script
@ -195,7 +195,7 @@ enum SleepClauseBlock
enum SkyDropState enum SkyDropState
{ {
SKY_DROP_IGNORE, SKY_DROP_IGNORE,
SKY_DROP_ATTACKCANCELLER_CHECK, SKY_DROP_ATTACKCANCELER_CHECK,
SKY_DROP_GRAVITY_ON_AIRBORNE, SKY_DROP_GRAVITY_ON_AIRBORNE,
SKY_DROP_CANCEL_MULTI_TURN_MOVES, SKY_DROP_CANCEL_MULTI_TURN_MOVES,
SKY_DROP_STATUS_YAWN, SKY_DROP_STATUS_YAWN,
@ -256,7 +256,7 @@ bool32 IsAbilityAndRecord(u32 battler, enum Ability battlerAbility, enum Ability
u32 DoEndTurnEffects(void); u32 DoEndTurnEffects(void);
bool32 HandleFaintedMonActions(void); bool32 HandleFaintedMonActions(void);
void TryClearRageAndFuryCutter(void); void TryClearRageAndFuryCutter(void);
enum MoveCanceller AtkCanceller_MoveSuccessOrder(struct BattleContext *ctx); enum MoveCanceler AtkCanceler_MoveSuccessOrder(struct BattleContext *ctx);
bool32 HasNoMonsToSwitch(u32 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2); bool32 HasNoMonsToSwitch(u32 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2);
bool32 TryChangeBattleWeather(u32 battler, u32 battleWeatherId, u32 ability); bool32 TryChangeBattleWeather(u32 battler, u32 battleWeatherId, u32 ability);
bool32 TryChangeBattleTerrain(u32 battler, u32 statusFlag); bool32 TryChangeBattleTerrain(u32 battler, u32 statusFlag);

View File

@ -5162,7 +5162,7 @@ static void TurnValuesCleanUp(bool8 var0)
gSideTimers[B_SIDE_PLAYER].followmeTimer = 0; gSideTimers[B_SIDE_PLAYER].followmeTimer = 0;
gSideTimers[B_SIDE_OPPONENT].followmeTimer = 0; gSideTimers[B_SIDE_OPPONENT].followmeTimer = 0;
gBattleStruct->pledgeMove = FALSE; // combined pledge move may not have been used due to a canceller gBattleStruct->pledgeMove = FALSE; // combined pledge move may not have been used due to a canceler
gBattleStruct->tryDestinyBond = FALSE; gBattleStruct->tryDestinyBond = FALSE;
gBattleStruct->tryGrudge = FALSE; gBattleStruct->tryGrudge = FALSE;
ClearPursuitValues(); ClearPursuitValues();

View File

@ -1110,11 +1110,11 @@ static void Cmd_attackcanceler(void)
return; return;
} }
// With how attackcanceller works right now we only need attacker and target abilities. Might change in the future // With how attackcanceler works right now we only need attacker and target abilities. Might change in the future
ctx.abilities[ctx.battlerAtk] = GetBattlerAbility(ctx.battlerAtk); ctx.abilities[ctx.battlerAtk] = GetBattlerAbility(ctx.battlerAtk);
ctx.abilities[ctx.battlerDef] = GetBattlerAbility(ctx.battlerDef); ctx.abilities[ctx.battlerDef] = GetBattlerAbility(ctx.battlerDef);
if (AtkCanceller_MoveSuccessOrder(&ctx) != MOVE_STEP_SUCCESS) if (AtkCanceler_MoveSuccessOrder(&ctx) != MOVE_STEP_SUCCESS)
return; return;
if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_OFF if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_OFF
@ -1166,7 +1166,7 @@ static void Cmd_attackcanceler(void)
gBattlescriptCurrInstr = BattleScript_ButItFailed; gBattlescriptCurrInstr = BattleScript_ButItFailed;
if (!gBattleMoveEffects[moveEffect].twoTurnEffect || (gBattleMons[gBattlerAttacker].volatiles.multipleTurns)) if (!gBattleMoveEffects[moveEffect].twoTurnEffect || (gBattleMons[gBattlerAttacker].volatiles.multipleTurns))
CancelMultiTurnMoves(gBattlerAttacker, SKY_DROP_ATTACKCANCELLER_CHECK); CancelMultiTurnMoves(gBattlerAttacker, SKY_DROP_ATTACKCANCELER_CHECK);
return; return;
} }
@ -1255,7 +1255,7 @@ static void Cmd_attackcanceler(void)
{ {
if (!CanBattlerAvoidContactEffects(gBattlerAttacker, gBattlerTarget, GetBattlerAbility(gBattlerAttacker), GetBattlerHoldEffect(gBattlerAttacker), gCurrentMove)) if (!CanBattlerAvoidContactEffects(gBattlerAttacker, gBattlerTarget, GetBattlerAbility(gBattlerAttacker), GetBattlerHoldEffect(gBattlerAttacker), gCurrentMove))
gProtectStructs[gBattlerAttacker].touchedProtectLike = TRUE; gProtectStructs[gBattlerAttacker].touchedProtectLike = TRUE;
CancelMultiTurnMoves(gBattlerAttacker, SKY_DROP_ATTACKCANCELLER_CHECK); CancelMultiTurnMoves(gBattlerAttacker, SKY_DROP_ATTACKCANCELER_CHECK);
gBattleStruct->moveResultFlags[gBattlerTarget] |= MOVE_RESULT_MISSED; gBattleStruct->moveResultFlags[gBattlerTarget] |= MOVE_RESULT_MISSED;
gLastLandedMoves[gBattlerTarget] = 0; gLastLandedMoves[gBattlerTarget] = 0;
gLastHitByType[gBattlerTarget] = 0; gLastHitByType[gBattlerTarget] = 0;
@ -1763,7 +1763,7 @@ static void Cmd_typecalc(void)
{ {
CMD_ARGS(); CMD_ARGS();
if (!IsSpreadMove(GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove))) // Handled in CANCELLER_MULTI_TARGET_MOVES for Spread Moves if (!IsSpreadMove(GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove))) // Handled in CANCELER_MULTI_TARGET_MOVES for Spread Moves
{ {
struct DamageContext ctx = {0}; struct DamageContext ctx = {0};
ctx.battlerAtk = gBattlerAttacker; ctx.battlerAtk = gBattlerAttacker;
@ -8567,9 +8567,9 @@ static void Cmd_hidepartystatussummary(void)
static void ResetValuesForCalledMove(void) static void ResetValuesForCalledMove(void)
{ {
if (gBattlerByTurnOrder[gCurrentTurnActionNumber] != gBattlerAttacker) if (gBattlerByTurnOrder[gCurrentTurnActionNumber] != gBattlerAttacker)
gBattleStruct->eventState.atkCanceller = 0; gBattleStruct->eventState.atkCanceler = 0;
else else
gBattleStruct->eventState.atkCanceller = CANCELLER_VOLATILE_BLOCKED; gBattleStruct->eventState.atkCanceler = CANCELER_VOLATILE_BLOCKED;
gBattleScripting.animTurn = 0; gBattleScripting.animTurn = 0;
gBattleScripting.animTargetsHit = 0; gBattleScripting.animTargetsHit = 0;
SetTypeBeforeUsingMove(gCurrentMove, gBattlerAttacker); SetTypeBeforeUsingMove(gCurrentMove, gBattlerAttacker);

View File

@ -433,7 +433,7 @@ void HandleAction_UseMove(void)
return; return;
} }
gBattleStruct->eventState.atkCanceller = 0; gBattleStruct->eventState.atkCanceler = 0;
ClearDamageCalcResults(); ClearDamageCalcResults();
gMultiHitCounter = 0; gMultiHitCounter = 0;
gBattleScripting.savedDmg = 0; gBattleScripting.savedDmg = 0;
@ -1114,7 +1114,7 @@ const u8 *CheckSkyDropState(u32 battler, enum SkyDropState skyDropState)
// Set confused status // Set confused status
gBattleMons[otherSkyDropper].volatiles.confusionTurns = ((Random()) % 4) + 2; gBattleMons[otherSkyDropper].volatiles.confusionTurns = ((Random()) % 4) + 2;
if (skyDropState == SKY_DROP_ATTACKCANCELLER_CHECK) if (skyDropState == SKY_DROP_ATTACKCANCELER_CHECK)
{ {
gBattleStruct->skyDropTargets[battler] = SKY_DROP_RELEASED_TARGET; gBattleStruct->skyDropTargets[battler] = SKY_DROP_RELEASED_TARGET;
} }
@ -1946,21 +1946,21 @@ static inline bool32 TryActivatePowderStatus(u32 move)
return FALSE; return FALSE;
} }
static enum MoveCanceller CancellerClearFlags(struct BattleContext *ctx) static enum MoveCanceler CancelerClearFlags(struct BattleContext *ctx)
{ {
gBattleMons[ctx->battlerAtk].volatiles.grudge = FALSE; gBattleMons[ctx->battlerAtk].volatiles.grudge = FALSE;
gBattleMons[ctx->battlerAtk].volatiles.glaiveRush = FALSE; gBattleMons[ctx->battlerAtk].volatiles.glaiveRush = FALSE;
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerStanceChangeOne(struct BattleContext *ctx) static enum MoveCanceler CancelerStanceChangeOne(struct BattleContext *ctx)
{ {
if (B_STANCE_CHANGE_FAIL < GEN_7 && gChosenMove == ctx->currentMove && TryFormChangeBeforeMove()) if (B_STANCE_CHANGE_FAIL < GEN_7 && gChosenMove == ctx->currentMove && TryFormChangeBeforeMove())
return MOVE_STEP_BREAK; return MOVE_STEP_BREAK;
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerSkyDrop(struct BattleContext *ctx) static enum MoveCanceler CancelerSkyDrop(struct BattleContext *ctx)
{ {
// If Pokemon is being held in Sky Drop // If Pokemon is being held in Sky Drop
if (gBattleMons[ctx->battlerAtk].volatiles.semiInvulnerable == STATE_SKY_DROP) if (gBattleMons[ctx->battlerAtk].volatiles.semiInvulnerable == STATE_SKY_DROP)
@ -1972,11 +1972,11 @@ static enum MoveCanceller CancellerSkyDrop(struct BattleContext *ctx)
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerRecharge(struct BattleContext *ctx) static enum MoveCanceler CancelerRecharge(struct BattleContext *ctx)
{ {
if (gDisableStructs[ctx->battlerAtk].rechargeTimer > 0) if (gDisableStructs[ctx->battlerAtk].rechargeTimer > 0)
{ {
CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELLER_CHECK); CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELER_CHECK);
gBattlescriptCurrInstr = BattleScript_MoveUsedMustRecharge; gBattlescriptCurrInstr = BattleScript_MoveUsedMustRecharge;
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
return MOVE_STEP_FAILURE; return MOVE_STEP_FAILURE;
@ -1984,7 +1984,7 @@ static enum MoveCanceller CancellerRecharge(struct BattleContext *ctx)
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerAsleepOrFrozen(struct BattleContext *ctx) static enum MoveCanceler CancelerAsleepOrFrozen(struct BattleContext *ctx)
{ {
if (gBattleMons[ctx->battlerAtk].status1 & STATUS1_SLEEP) if (gBattleMons[ctx->battlerAtk].status1 & STATUS1_SLEEP)
{ {
@ -2050,7 +2050,7 @@ static enum MoveCanceller CancellerAsleepOrFrozen(struct BattleContext *ctx)
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerObedience(struct BattleContext *ctx) static enum MoveCanceler CancelerObedience(struct BattleContext *ctx)
{ {
if (!gBattleMons[ctx->battlerAtk].volatiles.multipleTurns) if (!gBattleMons[ctx->battlerAtk].volatiles.multipleTurns)
{ {
@ -2105,7 +2105,7 @@ static enum MoveCanceller CancellerObedience(struct BattleContext *ctx)
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerPowerPoints(struct BattleContext *ctx) static enum MoveCanceler CancelerPowerPoints(struct BattleContext *ctx)
{ {
if (gBattleMons[ctx->battlerAtk].pp[gCurrMovePos] == 0 if (gBattleMons[ctx->battlerAtk].pp[gCurrMovePos] == 0
&& ctx->currentMove != MOVE_STRUGGLE && ctx->currentMove != MOVE_STRUGGLE
@ -2120,11 +2120,11 @@ static enum MoveCanceller CancellerPowerPoints(struct BattleContext *ctx)
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerTruant(struct BattleContext *ctx) static enum MoveCanceler CancelerTruant(struct BattleContext *ctx)
{ {
if (GetBattlerAbility(ctx->battlerAtk) == ABILITY_TRUANT && gDisableStructs[ctx->battlerAtk].truantCounter) if (GetBattlerAbility(ctx->battlerAtk) == ABILITY_TRUANT && gDisableStructs[ctx->battlerAtk].truantCounter)
{ {
CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELLER_CHECK); CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELER_CHECK);
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_LOAFING; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_LOAFING;
gBattlerAbility = ctx->battlerAtk; gBattlerAbility = ctx->battlerAtk;
@ -2135,12 +2135,12 @@ static enum MoveCanceller CancellerTruant(struct BattleContext *ctx)
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerFlinch(struct BattleContext *ctx) static enum MoveCanceler CancelerFlinch(struct BattleContext *ctx)
{ {
if (gBattleMons[ctx->battlerAtk].volatiles.flinched) if (gBattleMons[ctx->battlerAtk].volatiles.flinched)
{ {
gProtectStructs[ctx->battlerAtk].unableToUseMove = TRUE; gProtectStructs[ctx->battlerAtk].unableToUseMove = TRUE;
CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELLER_CHECK); CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELER_CHECK);
gBattlescriptCurrInstr = BattleScript_MoveUsedFlinched; gBattlescriptCurrInstr = BattleScript_MoveUsedFlinched;
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
return MOVE_STEP_FAILURE; return MOVE_STEP_FAILURE;
@ -2148,7 +2148,7 @@ static enum MoveCanceller CancellerFlinch(struct BattleContext *ctx)
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerDisabled(struct BattleContext *ctx) static enum MoveCanceler CancelerDisabled(struct BattleContext *ctx)
{ {
if (GetActiveGimmick(ctx->battlerAtk) != GIMMICK_Z_MOVE if (GetActiveGimmick(ctx->battlerAtk) != GIMMICK_Z_MOVE
&& gDisableStructs[ctx->battlerAtk].disabledMove == ctx->currentMove && gDisableStructs[ctx->battlerAtk].disabledMove == ctx->currentMove
@ -2156,7 +2156,7 @@ static enum MoveCanceller CancellerDisabled(struct BattleContext *ctx)
{ {
gProtectStructs[ctx->battlerAtk].unableToUseMove = TRUE; gProtectStructs[ctx->battlerAtk].unableToUseMove = TRUE;
gBattleScripting.battler = ctx->battlerAtk; gBattleScripting.battler = ctx->battlerAtk;
CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELLER_CHECK); CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELER_CHECK);
gBattlescriptCurrInstr = BattleScript_MoveUsedIsDisabled; gBattlescriptCurrInstr = BattleScript_MoveUsedIsDisabled;
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
return MOVE_STEP_FAILURE; return MOVE_STEP_FAILURE;
@ -2164,7 +2164,7 @@ static enum MoveCanceller CancellerDisabled(struct BattleContext *ctx)
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerVolatileBlocked(struct BattleContext *ctx) static enum MoveCanceler CancelerVolatileBlocked(struct BattleContext *ctx)
{ {
if (GetActiveGimmick(ctx->battlerAtk) != GIMMICK_Z_MOVE if (GetActiveGimmick(ctx->battlerAtk) != GIMMICK_Z_MOVE
&& gBattleMons[ctx->battlerAtk].volatiles.healBlock && gBattleMons[ctx->battlerAtk].volatiles.healBlock
@ -2172,7 +2172,7 @@ static enum MoveCanceller CancellerVolatileBlocked(struct BattleContext *ctx)
{ {
gProtectStructs[ctx->battlerAtk].unableToUseMove = TRUE; gProtectStructs[ctx->battlerAtk].unableToUseMove = TRUE;
gBattleScripting.battler = ctx->battlerAtk; gBattleScripting.battler = ctx->battlerAtk;
CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELLER_CHECK); CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELER_CHECK);
gBattlescriptCurrInstr = BattleScript_MoveUsedHealBlockPrevents; gBattlescriptCurrInstr = BattleScript_MoveUsedHealBlockPrevents;
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
return MOVE_STEP_FAILURE; return MOVE_STEP_FAILURE;
@ -2181,7 +2181,7 @@ static enum MoveCanceller CancellerVolatileBlocked(struct BattleContext *ctx)
{ {
gProtectStructs[ctx->battlerAtk].unableToUseMove = TRUE; gProtectStructs[ctx->battlerAtk].unableToUseMove = TRUE;
gBattleScripting.battler = ctx->battlerAtk; gBattleScripting.battler = ctx->battlerAtk;
CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELLER_CHECK); CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELER_CHECK);
gBattlescriptCurrInstr = BattleScript_MoveUsedGravityPrevents; gBattlescriptCurrInstr = BattleScript_MoveUsedGravityPrevents;
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
return MOVE_STEP_FAILURE; return MOVE_STEP_FAILURE;
@ -2189,7 +2189,7 @@ static enum MoveCanceller CancellerVolatileBlocked(struct BattleContext *ctx)
else if (GetActiveGimmick(ctx->battlerAtk) != GIMMICK_Z_MOVE && gDisableStructs[ctx->battlerAtk].throatChopTimer > 0 && IsSoundMove(ctx->currentMove)) else if (GetActiveGimmick(ctx->battlerAtk) != GIMMICK_Z_MOVE && gDisableStructs[ctx->battlerAtk].throatChopTimer > 0 && IsSoundMove(ctx->currentMove))
{ {
gProtectStructs[ctx->battlerAtk].unableToUseMove = TRUE; gProtectStructs[ctx->battlerAtk].unableToUseMove = TRUE;
CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELLER_CHECK); CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELER_CHECK);
gBattlescriptCurrInstr = BattleScript_MoveUsedIsThroatChopPrevented; gBattlescriptCurrInstr = BattleScript_MoveUsedIsThroatChopPrevented;
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
return MOVE_STEP_FAILURE; return MOVE_STEP_FAILURE;
@ -2197,12 +2197,12 @@ static enum MoveCanceller CancellerVolatileBlocked(struct BattleContext *ctx)
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerTaunted(struct BattleContext *ctx) static enum MoveCanceler CancelerTaunted(struct BattleContext *ctx)
{ {
if (GetActiveGimmick(ctx->battlerAtk) != GIMMICK_Z_MOVE && gDisableStructs[ctx->battlerAtk].tauntTimer && IsBattleMoveStatus(ctx->currentMove)) if (GetActiveGimmick(ctx->battlerAtk) != GIMMICK_Z_MOVE && gDisableStructs[ctx->battlerAtk].tauntTimer && IsBattleMoveStatus(ctx->currentMove))
{ {
gProtectStructs[ctx->battlerAtk].unableToUseMove = TRUE; gProtectStructs[ctx->battlerAtk].unableToUseMove = TRUE;
CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELLER_CHECK); CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELER_CHECK);
gBattlescriptCurrInstr = BattleScript_MoveUsedIsTaunted; gBattlescriptCurrInstr = BattleScript_MoveUsedIsTaunted;
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
return MOVE_STEP_BREAK; return MOVE_STEP_BREAK;
@ -2210,12 +2210,12 @@ static enum MoveCanceller CancellerTaunted(struct BattleContext *ctx)
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerImprisoned(struct BattleContext *ctx) static enum MoveCanceler CancelerImprisoned(struct BattleContext *ctx)
{ {
if (GetActiveGimmick(ctx->battlerAtk) != GIMMICK_Z_MOVE && GetImprisonedMovesCount(ctx->battlerAtk, ctx->currentMove)) if (GetActiveGimmick(ctx->battlerAtk) != GIMMICK_Z_MOVE && GetImprisonedMovesCount(ctx->battlerAtk, ctx->currentMove))
{ {
gProtectStructs[ctx->battlerAtk].unableToUseMove = TRUE; gProtectStructs[ctx->battlerAtk].unableToUseMove = TRUE;
CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELLER_CHECK); CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELER_CHECK);
gBattlescriptCurrInstr = BattleScript_MoveUsedIsImprisoned; gBattlescriptCurrInstr = BattleScript_MoveUsedIsImprisoned;
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
return MOVE_STEP_FAILURE; return MOVE_STEP_FAILURE;
@ -2223,7 +2223,7 @@ static enum MoveCanceller CancellerImprisoned(struct BattleContext *ctx)
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerConfused(struct BattleContext *ctx) static enum MoveCanceler CancelerConfused(struct BattleContext *ctx)
{ {
if (gBattleMons[ctx->battlerAtk].volatiles.confusionTurns) if (gBattleMons[ctx->battlerAtk].volatiles.confusionTurns)
{ {
@ -2263,7 +2263,7 @@ static enum MoveCanceller CancellerConfused(struct BattleContext *ctx)
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerParalysed(struct BattleContext *ctx) static enum MoveCanceler CancelerParalysed(struct BattleContext *ctx)
{ {
if (gBattleMons[ctx->battlerAtk].status1 & STATUS1_PARALYSIS if (gBattleMons[ctx->battlerAtk].status1 & STATUS1_PARALYSIS
&& !(B_MAGIC_GUARD == GEN_4 && IsAbilityAndRecord(ctx->battlerAtk, ctx->abilities[ctx->battlerAtk], ABILITY_MAGIC_GUARD)) && !(B_MAGIC_GUARD == GEN_4 && IsAbilityAndRecord(ctx->battlerAtk, ctx->abilities[ctx->battlerAtk], ABILITY_MAGIC_GUARD))
@ -2271,7 +2271,7 @@ static enum MoveCanceller CancellerParalysed(struct BattleContext *ctx)
{ {
gProtectStructs[ctx->battlerAtk].nonVolatileStatusImmobility = TRUE; gProtectStructs[ctx->battlerAtk].nonVolatileStatusImmobility = TRUE;
// This is removed in FRLG and Emerald for some reason // This is removed in FRLG and Emerald for some reason
//CancelMultiTurnMoves(gBattlerAttacker, SKY_DROP_ATTACKCANCELLER_CHECK); //CancelMultiTurnMoves(gBattlerAttacker, SKY_DROP_ATTACKCANCELER_CHECK);
gBattlescriptCurrInstr = BattleScript_MoveUsedIsParalyzed; gBattlescriptCurrInstr = BattleScript_MoveUsedIsParalyzed;
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
return MOVE_STEP_FAILURE; return MOVE_STEP_FAILURE;
@ -2279,7 +2279,7 @@ static enum MoveCanceller CancellerParalysed(struct BattleContext *ctx)
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerInfatuation(struct BattleContext *ctx) static enum MoveCanceler CancelerInfatuation(struct BattleContext *ctx)
{ {
if (gBattleMons[ctx->battlerAtk].volatiles.infatuation) if (gBattleMons[ctx->battlerAtk].volatiles.infatuation)
{ {
@ -2294,7 +2294,7 @@ static enum MoveCanceller CancellerInfatuation(struct BattleContext *ctx)
BattleScriptPush(BattleScript_MoveUsedIsInLoveCantAttack); BattleScriptPush(BattleScript_MoveUsedIsInLoveCantAttack);
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
gProtectStructs[ctx->battlerAtk].unableToUseMove = TRUE; gProtectStructs[ctx->battlerAtk].unableToUseMove = TRUE;
CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELLER_CHECK); CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELER_CHECK);
gBattlescriptCurrInstr = BattleScript_MoveUsedIsInLove; gBattlescriptCurrInstr = BattleScript_MoveUsedIsInLove;
return MOVE_STEP_FAILURE; return MOVE_STEP_FAILURE;
} }
@ -2302,7 +2302,7 @@ static enum MoveCanceller CancellerInfatuation(struct BattleContext *ctx)
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerBide(struct BattleContext *ctx) static enum MoveCanceler CancelerBide(struct BattleContext *ctx)
{ {
if (gBattleMons[ctx->battlerAtk].volatiles.bideTurns) if (gBattleMons[ctx->battlerAtk].volatiles.bideTurns)
{ {
@ -2333,7 +2333,7 @@ static enum MoveCanceller CancellerBide(struct BattleContext *ctx)
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerZMoves(struct BattleContext *ctx) static enum MoveCanceler CancelerZMoves(struct BattleContext *ctx)
{ {
if (GetActiveGimmick(ctx->battlerAtk) == GIMMICK_Z_MOVE) if (GetActiveGimmick(ctx->battlerAtk) == GIMMICK_Z_MOVE)
{ {
@ -2352,7 +2352,7 @@ static enum MoveCanceller CancellerZMoves(struct BattleContext *ctx)
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerChoiceLock(struct BattleContext *ctx) static enum MoveCanceler CancelerChoiceLock(struct BattleContext *ctx)
{ {
u16 *choicedMoveAtk = &gBattleStruct->choicedMove[ctx->battlerAtk]; u16 *choicedMoveAtk = &gBattleStruct->choicedMove[ctx->battlerAtk];
enum HoldEffect holdEffect = GetBattlerHoldEffect(ctx->battlerAtk); enum HoldEffect holdEffect = GetBattlerHoldEffect(ctx->battlerAtk);
@ -2375,7 +2375,7 @@ static enum MoveCanceller CancellerChoiceLock(struct BattleContext *ctx)
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerCallSubmove(struct BattleContext *ctx) static enum MoveCanceler CancelerCallSubmove(struct BattleContext *ctx)
{ {
bool32 noEffect = FALSE; bool32 noEffect = FALSE;
u32 calledMove = MOVE_NONE; u32 calledMove = MOVE_NONE;
@ -2436,7 +2436,7 @@ static enum MoveCanceller CancellerCallSubmove(struct BattleContext *ctx)
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerThaw(struct BattleContext *ctx) static enum MoveCanceler CancelerThaw(struct BattleContext *ctx)
{ {
if (gBattleMons[ctx->battlerAtk].status1 & STATUS1_FREEZE) if (gBattleMons[ctx->battlerAtk].status1 & STATUS1_FREEZE)
{ {
@ -2461,14 +2461,14 @@ static enum MoveCanceller CancellerThaw(struct BattleContext *ctx)
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerStanceChangeTwo(struct BattleContext *ctx) static enum MoveCanceler CancelerStanceChangeTwo(struct BattleContext *ctx)
{ {
if (B_STANCE_CHANGE_FAIL >= GEN_7 && gChosenMove == ctx->currentMove && TryFormChangeBeforeMove()) if (B_STANCE_CHANGE_FAIL >= GEN_7 && gChosenMove == ctx->currentMove && TryFormChangeBeforeMove())
return MOVE_STEP_BREAK; return MOVE_STEP_BREAK;
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerAttackstring(struct BattleContext *ctx) static enum MoveCanceler CancelerAttackstring(struct BattleContext *ctx)
{ {
BattleScriptCall(BattleScript_Attackstring); BattleScriptCall(BattleScript_Attackstring);
if (!gSpecialStatuses[gBattlerAttacker].dancerUsedMove) if (!gSpecialStatuses[gBattlerAttacker].dancerUsedMove)
@ -2476,7 +2476,7 @@ static enum MoveCanceller CancellerAttackstring(struct BattleContext *ctx)
return MOVE_STEP_BREAK; return MOVE_STEP_BREAK;
} }
static enum MoveCanceller CancellerPPDeduction(struct BattleContext *ctx) static enum MoveCanceler CancelerPPDeduction(struct BattleContext *ctx)
{ {
if (gBattleMons[ctx->battlerAtk].volatiles.multipleTurns if (gBattleMons[ctx->battlerAtk].volatiles.multipleTurns
|| gSpecialStatuses[ctx->battlerAtk].dancerUsedMove || gSpecialStatuses[ctx->battlerAtk].dancerUsedMove
@ -2536,7 +2536,7 @@ static enum MoveCanceller CancellerPPDeduction(struct BattleContext *ctx)
gBattlescriptCurrInstr = BattleScript_ButItFailed; gBattlescriptCurrInstr = BattleScript_ButItFailed;
return MOVE_STEP_FAILURE; return MOVE_STEP_FAILURE;
} }
else if (CancellerVolatileBlocked(ctx) == MOVE_STEP_FAILURE) // Check Gravity/Heal Block/Throat Chop for Submove else if (CancelerVolatileBlocked(ctx) == MOVE_STEP_FAILURE) // Check Gravity/Heal Block/Throat Chop for Submove
{ {
gBattleStruct->submoveAnnouncement = SUBMOVE_NO_EFFECT; gBattleStruct->submoveAnnouncement = SUBMOVE_NO_EFFECT;
return MOVE_STEP_FAILURE; return MOVE_STEP_FAILURE;
@ -2548,7 +2548,7 @@ static enum MoveCanceller CancellerPPDeduction(struct BattleContext *ctx)
gBattleScripting.animTurn = 0; gBattleScripting.animTurn = 0;
gBattleScripting.animTargetsHit = 0; gBattleScripting.animTargetsHit = 0;
// Possibly better to just move type setting and redirection to attackcanceller as a new case at this point // Possibly better to just move type setting and redirection to attackcanceler as a new case at this point
SetTypeBeforeUsingMove(ctx->currentMove, ctx->battlerAtk); SetTypeBeforeUsingMove(ctx->currentMove, ctx->battlerAtk);
HandleMoveTargetRedirection(); HandleMoveTargetRedirection();
gBattlescriptCurrInstr = GetMoveBattleScript(ctx->currentMove); gBattlescriptCurrInstr = GetMoveBattleScript(ctx->currentMove);
@ -2559,9 +2559,9 @@ static enum MoveCanceller CancellerPPDeduction(struct BattleContext *ctx)
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerWeatherPrimal(struct BattleContext *ctx) static enum MoveCanceler CancelerWeatherPrimal(struct BattleContext *ctx)
{ {
enum MoveCanceller effect = MOVE_STEP_SUCCESS; enum MoveCanceler effect = MOVE_STEP_SUCCESS;
if (HasWeatherEffect() && GetMovePower(ctx->currentMove) > 0) if (HasWeatherEffect() && GetMovePower(ctx->currentMove) > 0)
{ {
enum Type moveType = GetBattleMoveType(ctx->currentMove); enum Type moveType = GetBattleMoveType(ctx->currentMove);
@ -2578,7 +2578,7 @@ static enum MoveCanceller CancellerWeatherPrimal(struct BattleContext *ctx)
if (effect == MOVE_STEP_FAILURE) if (effect == MOVE_STEP_FAILURE)
{ {
gProtectStructs[ctx->battlerAtk].chargingTurn = FALSE; gProtectStructs[ctx->battlerAtk].chargingTurn = FALSE;
CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELLER_CHECK); CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELER_CHECK);
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
gBattlescriptCurrInstr = BattleScript_PrimalWeatherBlocksMove; gBattlescriptCurrInstr = BattleScript_PrimalWeatherBlocksMove;
} }
@ -2586,7 +2586,7 @@ static enum MoveCanceller CancellerWeatherPrimal(struct BattleContext *ctx)
return effect; return effect;
} }
static enum MoveCanceller CancellerMoveFailure(struct BattleContext *ctx) static enum MoveCanceler CancelerMoveFailure(struct BattleContext *ctx)
{ {
const u8 *battleScript = NULL; const u8 *battleScript = NULL;
@ -2715,7 +2715,7 @@ static enum MoveCanceller CancellerMoveFailure(struct BattleContext *ctx)
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerPowderStatus(struct BattleContext *ctx) static enum MoveCanceler CancelerPowderStatus(struct BattleContext *ctx)
{ {
if (TryActivatePowderStatus(ctx->currentMove)) if (TryActivatePowderStatus(ctx->currentMove))
{ {
@ -2744,7 +2744,7 @@ bool32 IsDazzlingAbility(enum Ability ability)
return FALSE; return FALSE;
} }
static enum MoveCanceller CancellerPriorityBlock(struct BattleContext *ctx) static enum MoveCanceler CancelerPriorityBlock(struct BattleContext *ctx)
{ {
bool32 effect = FALSE; bool32 effect = FALSE;
s32 priority = GetChosenMovePriority(ctx->battlerAtk, ctx->abilities[ctx->battlerAtk]); s32 priority = GetChosenMovePriority(ctx->battlerAtk, ctx->abilities[ctx->battlerAtk]);
@ -2783,7 +2783,7 @@ static enum MoveCanceller CancellerPriorityBlock(struct BattleContext *ctx)
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerProtean(struct BattleContext *ctx) static enum MoveCanceler CancelerProtean(struct BattleContext *ctx)
{ {
enum Type moveType = GetBattleMoveType(ctx->currentMove); enum Type moveType = GetBattleMoveType(ctx->currentMove);
if (ProteanTryChangeType(ctx->battlerAtk, ctx->abilities[ctx->battlerAtk], ctx->currentMove, moveType)) if (ProteanTryChangeType(ctx->battlerAtk, ctx->abilities[ctx->battlerAtk], ctx->currentMove, moveType))
@ -2800,7 +2800,7 @@ static enum MoveCanceller CancellerProtean(struct BattleContext *ctx)
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerExplodingDamp(struct BattleContext *ctx) static enum MoveCanceler CancelerExplodingDamp(struct BattleContext *ctx)
{ {
u32 dampBattler = IsAbilityOnField(ABILITY_DAMP); u32 dampBattler = IsAbilityOnField(ABILITY_DAMP);
if (dampBattler && IsMoveDampBanned(ctx->currentMove)) if (dampBattler && IsMoveDampBanned(ctx->currentMove))
@ -2813,7 +2813,7 @@ static enum MoveCanceller CancellerExplodingDamp(struct BattleContext *ctx)
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerMultihitMoves(struct BattleContext *ctx) static enum MoveCanceler CancelerMultihitMoves(struct BattleContext *ctx)
{ {
if (GetMoveEffect(ctx->currentMove) == EFFECT_MULTI_HIT) if (GetMoveEffect(ctx->currentMove) == EFFECT_MULTI_HIT)
{ {
@ -2885,7 +2885,7 @@ static enum MoveCanceller CancellerMultihitMoves(struct BattleContext *ctx)
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller CancellerMultiTargetMoves(struct BattleContext *ctx) static enum MoveCanceler CancelerMultiTargetMoves(struct BattleContext *ctx)
{ {
u32 moveTarget = GetBattlerMoveTargetType(ctx->battlerAtk, ctx->currentMove); u32 moveTarget = GetBattlerMoveTargetType(ctx->battlerAtk, ctx->currentMove);
enum Ability abilityAtk = ctx->abilities[ctx->battlerAtk]; enum Ability abilityAtk = ctx->abilities[ctx->battlerAtk];
@ -2932,50 +2932,50 @@ static enum MoveCanceller CancellerMultiTargetMoves(struct BattleContext *ctx)
return MOVE_STEP_SUCCESS; return MOVE_STEP_SUCCESS;
} }
static enum MoveCanceller (*const sMoveSuccessOrderCancellers[])(struct BattleContext *ctx) = static enum MoveCanceler (*const sMoveSuccessOrderCancelers[])(struct BattleContext *ctx) =
{ {
[CANCELLER_CLEAR_FLAGS] = CancellerClearFlags, [CANCELER_CLEAR_FLAGS] = CancelerClearFlags,
[CANCELLER_STANCE_CHANGE_1] = CancellerStanceChangeOne, [CANCELER_STANCE_CHANGE_1] = CancelerStanceChangeOne,
[CANCELLER_SKY_DROP] = CancellerSkyDrop, [CANCELER_SKY_DROP] = CancelerSkyDrop,
[CANCELLER_RECHARGE] = CancellerRecharge, [CANCELER_RECHARGE] = CancelerRecharge,
[CANCELLER_ASLEEP_OR_FROZEN] = CancellerAsleepOrFrozen, [CANCELER_ASLEEP_OR_FROZEN] = CancelerAsleepOrFrozen,
[CANCELLER_OBEDIENCE] = CancellerObedience, [CANCELER_OBEDIENCE] = CancelerObedience,
[CANCELLER_POWER_POINTS] = CancellerPowerPoints, [CANCELER_POWER_POINTS] = CancelerPowerPoints,
[CANCELLER_TRUANT] = CancellerTruant, [CANCELER_TRUANT] = CancelerTruant,
[CANCELLER_FLINCH] = CancellerFlinch, [CANCELER_FLINCH] = CancelerFlinch,
[CANCELLER_DISABLED] = CancellerDisabled, [CANCELER_DISABLED] = CancelerDisabled,
[CANCELLER_VOLATILE_BLOCKED] = CancellerVolatileBlocked, [CANCELER_VOLATILE_BLOCKED] = CancelerVolatileBlocked,
[CANCELLER_TAUNTED] = CancellerTaunted, [CANCELER_TAUNTED] = CancelerTaunted,
[CANCELLER_IMPRISONED] = CancellerImprisoned, [CANCELER_IMPRISONED] = CancelerImprisoned,
[CANCELLER_CONFUSED] = CancellerConfused, [CANCELER_CONFUSED] = CancelerConfused,
[CANCELLER_PARALYSED] = CancellerParalysed, [CANCELER_PARALYSED] = CancelerParalysed,
[CANCELLER_INFATUATION] = CancellerInfatuation, [CANCELER_INFATUATION] = CancelerInfatuation,
[CANCELLER_BIDE] = CancellerBide, [CANCELER_BIDE] = CancelerBide,
[CANCELLER_Z_MOVES] = CancellerZMoves, [CANCELER_Z_MOVES] = CancelerZMoves,
[CANCELLER_CHOICE_LOCK] = CancellerChoiceLock, [CANCELER_CHOICE_LOCK] = CancelerChoiceLock,
[CANCELLER_CALLSUBMOVE] = CancellerCallSubmove, [CANCELER_CALLSUBMOVE] = CancelerCallSubmove,
[CANCELLER_THAW] = CancellerThaw, [CANCELER_THAW] = CancelerThaw,
[CANCELLER_STANCE_CHANGE_2] = CancellerStanceChangeTwo, [CANCELER_STANCE_CHANGE_2] = CancelerStanceChangeTwo,
[CANCELLER_ATTACKSTRING] = CancellerAttackstring, [CANCELER_ATTACKSTRING] = CancelerAttackstring,
[CANCELLER_PPDEDUCTION] = CancellerPPDeduction, [CANCELER_PPDEDUCTION] = CancelerPPDeduction,
[CANCELLER_WEATHER_PRIMAL] = CancellerWeatherPrimal, [CANCELER_WEATHER_PRIMAL] = CancelerWeatherPrimal,
[CANCELLER_MOVE_FAILURE] = CancellerMoveFailure, [CANCELER_MOVE_FAILURE] = CancelerMoveFailure,
[CANCELLER_POWDER_STATUS] = CancellerPowderStatus, [CANCELER_POWDER_STATUS] = CancelerPowderStatus,
[CANCELLER_PRIORITY_BLOCK] = CancellerPriorityBlock, [CANCELER_PRIORITY_BLOCK] = CancelerPriorityBlock,
[CANCELLER_PROTEAN] = CancellerProtean, [CANCELER_PROTEAN] = CancelerProtean,
[CANCELLER_EXPLODING_DAMP] = CancellerExplodingDamp, [CANCELER_EXPLODING_DAMP] = CancelerExplodingDamp,
[CANCELLER_MULTIHIT_MOVES] = CancellerMultihitMoves, [CANCELER_MULTIHIT_MOVES] = CancelerMultihitMoves,
[CANCELLER_MULTI_TARGET_MOVES] = CancellerMultiTargetMoves, [CANCELER_MULTI_TARGET_MOVES] = CancelerMultiTargetMoves,
}; };
enum MoveCanceller AtkCanceller_MoveSuccessOrder(struct BattleContext *ctx) enum MoveCanceler AtkCanceler_MoveSuccessOrder(struct BattleContext *ctx)
{ {
enum MoveCanceller effect = MOVE_STEP_SUCCESS; enum MoveCanceler effect = MOVE_STEP_SUCCESS;
while (gBattleStruct->eventState.atkCanceller < CANCELLER_END && effect == MOVE_STEP_SUCCESS) while (gBattleStruct->eventState.atkCanceler < CANCELER_END && effect == MOVE_STEP_SUCCESS)
{ {
effect = sMoveSuccessOrderCancellers[gBattleStruct->eventState.atkCanceller](ctx); effect = sMoveSuccessOrderCancelers[gBattleStruct->eventState.atkCanceler](ctx);
gBattleStruct->eventState.atkCanceller++; gBattleStruct->eventState.atkCanceler++;
} }
if (effect == MOVE_STEP_REMOVES_STATUS) if (effect == MOVE_STEP_REMOVES_STATUS)
@ -3406,7 +3406,7 @@ bool32 CanAbilityBlockMove(u32 battlerAtk, u32 battlerDef, enum Ability abilityA
&& !(IsBattleMoveStatus(move) && (abilityDef == ABILITY_MAGIC_BOUNCE || gProtectStructs[battlerDef].bounceMove))) && !(IsBattleMoveStatus(move) && (abilityDef == ABILITY_MAGIC_BOUNCE || gProtectStructs[battlerDef].bounceMove)))
{ {
if (option == RUN_SCRIPT && !IsSpreadMove(GetBattlerMoveTargetType(battlerAtk, move))) if (option == RUN_SCRIPT && !IsSpreadMove(GetBattlerMoveTargetType(battlerAtk, move)))
CancelMultiTurnMoves(battlerAtk, SKY_DROP_ATTACKCANCELLER_CHECK); // Don't cancel moves that can hit two targets bc one target might not be protected CancelMultiTurnMoves(battlerAtk, SKY_DROP_ATTACKCANCELER_CHECK); // Don't cancel moves that can hit two targets bc one target might not be protected
battleScriptBlocksMove = BattleScript_DoesntAffectTargetAtkString; battleScriptBlocksMove = BattleScript_DoesntAffectTargetAtkString;
} }
else if (IsBattlerTerrainAffected(battlerDef, abilityDef, GetBattlerHoldEffect(battlerDef), STATUS_FIELD_PSYCHIC_TERRAIN) // Not an ability but similar conditions else if (IsBattlerTerrainAffected(battlerDef, abilityDef, GetBattlerHoldEffect(battlerDef), STATUS_FIELD_PSYCHIC_TERRAIN) // Not an ability but similar conditions
@ -3419,7 +3419,7 @@ bool32 CanAbilityBlockMove(u32 battlerAtk, u32 battlerDef, enum Ability abilityA
{ {
gMultiHitCounter = 0; // Prevent multi-hit moves from hitting more than once after move has been absorbed. gMultiHitCounter = 0; // Prevent multi-hit moves from hitting more than once after move has been absorbed.
if (!IsSpreadMove(GetBattlerMoveTargetType(battlerAtk, move))) if (!IsSpreadMove(GetBattlerMoveTargetType(battlerAtk, move)))
CancelMultiTurnMoves(battlerAtk, SKY_DROP_ATTACKCANCELLER_CHECK); // Don't cancel moves that can hit two targets bc one target might not be protected CancelMultiTurnMoves(battlerAtk, SKY_DROP_ATTACKCANCELER_CHECK); // Don't cancel moves that can hit two targets bc one target might not be protected
gBattlescriptCurrInstr = BattleScript_MoveUsedPsychicTerrainPrevents; gBattlescriptCurrInstr = BattleScript_MoveUsedPsychicTerrainPrevents;
return TRUE; // Early return since we don't want to set remaining values return TRUE; // Early return since we don't want to set remaining values
} }