diff --git a/include/battle.h b/include/battle.h index 9fd35f7329..74985151bd 100644 --- a/include/battle.h +++ b/include/battle.h @@ -619,7 +619,7 @@ struct EventStates enum FirstTurnEventsStates beforeFristTurn:8; enum FaintedActions faintedAction:8; enum BattlerId faintedActionBattler:4; - enum MoveSuccessOrder atkCanceller:8; + enum MoveSuccessOrder atkCanceler:8; enum BattleIntroStates battleIntro:8; u32 padding:24; }; diff --git a/include/battle_util.h b/include/battle_util.h index 1dfd71ad80..068f138264 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -98,39 +98,39 @@ struct TypePower enum MoveSuccessOrder { - CANCELLER_CLEAR_FLAGS, - CANCELLER_STANCE_CHANGE_1, - CANCELLER_SKY_DROP, - CANCELLER_RECHARGE, - CANCELLER_ASLEEP_OR_FROZEN, - CANCELLER_POWER_POINTS, - CANCELLER_OBEDIENCE, - CANCELLER_TRUANT, - CANCELLER_FLINCH, - CANCELLER_DISABLED, - CANCELLER_VOLATILE_BLOCKED, // Gravity / Heal Block / Throat Chop - CANCELLER_TAUNTED, - CANCELLER_IMPRISONED, - CANCELLER_CONFUSED, - CANCELLER_PARALYSED, - CANCELLER_INFATUATION, - CANCELLER_BIDE, - CANCELLER_Z_MOVES, - CANCELLER_CHOICE_LOCK, - CANCELLER_CALLSUBMOVE, - CANCELLER_THAW, - CANCELLER_STANCE_CHANGE_2, - CANCELLER_ATTACKSTRING, - CANCELLER_PPDEDUCTION, - CANCELLER_WEATHER_PRIMAL, - CANCELLER_MOVE_FAILURE, - CANCELLER_POWDER_STATUS, - CANCELLER_PRIORITY_BLOCK, - CANCELLER_PROTEAN, - CANCELLER_EXPLODING_DAMP, - CANCELLER_MULTIHIT_MOVES, - CANCELLER_MULTI_TARGET_MOVES, - CANCELLER_END, + CANCELER_STANCE_CHANGE_1, + CANCELER_CLEAR_FLAGS, + CANCELER_SKY_DROP, + CANCELER_RECHARGE, + CANCELER_ASLEEP_OR_FROZEN, + CANCELER_POWER_POINTS, + CANCELER_OBEDIENCE, + CANCELER_TRUANT, + CANCELER_FLINCH, + CANCELER_DISABLED, + CANCELER_VOLATILE_BLOCKED, // Gravity / Heal Block / Throat Chop + CANCELER_TAUNTED, + CANCELER_IMPRISONED, + CANCELER_CONFUSED, + CANCELER_PARALYSED, + CANCELER_INFATUATION, + CANCELER_BIDE, + CANCELER_Z_MOVES, + CANCELER_CHOICE_LOCK, + CANCELER_CALLSUBMOVE, + CANCELER_THAW, + CANCELER_STANCE_CHANGE_2, + CANCELER_ATTACKSTRING, + CANCELER_PPDEDUCTION, + CANCELER_WEATHER_PRIMAL, + CANCELER_MOVE_FAILURE, + CANCELER_POWDER_STATUS, + CANCELER_PRIORITY_BLOCK, + CANCELER_PROTEAN, + CANCELER_EXPLODING_DAMP, + CANCELER_MULTIHIT_MOVES, + CANCELER_MULTI_TARGET_MOVES, + CANCELER_END, }; enum Obedience @@ -143,7 +143,7 @@ enum Obedience DISOBEYS_RANDOM_MOVE, }; -enum MoveCanceller +enum MoveCanceler { MOVE_STEP_SUCCESS, MOVE_STEP_BREAK, // Breaks out of the function to run a script @@ -195,7 +195,7 @@ enum SleepClauseBlock enum SkyDropState { SKY_DROP_IGNORE, - SKY_DROP_ATTACKCANCELLER_CHECK, + SKY_DROP_ATTACKCANCELER_CHECK, SKY_DROP_GRAVITY_ON_AIRBORNE, SKY_DROP_CANCEL_MULTI_TURN_MOVES, SKY_DROP_STATUS_YAWN, @@ -256,7 +256,7 @@ bool32 IsAbilityAndRecord(u32 battler, enum Ability battlerAbility, enum Ability u32 DoEndTurnEffects(void); bool32 HandleFaintedMonActions(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 TryChangeBattleWeather(u32 battler, u32 battleWeatherId, u32 ability); bool32 TryChangeBattleTerrain(u32 battler, u32 statusFlag); diff --git a/src/battle_main.c b/src/battle_main.c index f2b74ee4b5..96ef53b323 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -5162,7 +5162,7 @@ static void TurnValuesCleanUp(bool8 var0) gSideTimers[B_SIDE_PLAYER].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->tryGrudge = FALSE; ClearPursuitValues(); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index dbd1e9e46d..2e5a244d29 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1110,11 +1110,11 @@ static void Cmd_attackcanceler(void) 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.battlerDef] = GetBattlerAbility(ctx.battlerDef); - if (AtkCanceller_MoveSuccessOrder(&ctx) != MOVE_STEP_SUCCESS) + if (AtkCanceler_MoveSuccessOrder(&ctx) != MOVE_STEP_SUCCESS) return; if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_OFF @@ -1166,7 +1166,7 @@ static void Cmd_attackcanceler(void) gBattlescriptCurrInstr = BattleScript_ButItFailed; if (!gBattleMoveEffects[moveEffect].twoTurnEffect || (gBattleMons[gBattlerAttacker].volatiles.multipleTurns)) - CancelMultiTurnMoves(gBattlerAttacker, SKY_DROP_ATTACKCANCELLER_CHECK); + CancelMultiTurnMoves(gBattlerAttacker, SKY_DROP_ATTACKCANCELER_CHECK); return; } @@ -1255,7 +1255,7 @@ static void Cmd_attackcanceler(void) { if (!CanBattlerAvoidContactEffects(gBattlerAttacker, gBattlerTarget, GetBattlerAbility(gBattlerAttacker), GetBattlerHoldEffect(gBattlerAttacker), gCurrentMove)) gProtectStructs[gBattlerAttacker].touchedProtectLike = TRUE; - CancelMultiTurnMoves(gBattlerAttacker, SKY_DROP_ATTACKCANCELLER_CHECK); + CancelMultiTurnMoves(gBattlerAttacker, SKY_DROP_ATTACKCANCELER_CHECK); gBattleStruct->moveResultFlags[gBattlerTarget] |= MOVE_RESULT_MISSED; gLastLandedMoves[gBattlerTarget] = 0; gLastHitByType[gBattlerTarget] = 0; @@ -1763,7 +1763,7 @@ static void Cmd_typecalc(void) { 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}; ctx.battlerAtk = gBattlerAttacker; @@ -8567,9 +8567,9 @@ static void Cmd_hidepartystatussummary(void) static void ResetValuesForCalledMove(void) { if (gBattlerByTurnOrder[gCurrentTurnActionNumber] != gBattlerAttacker) - gBattleStruct->eventState.atkCanceller = 0; + gBattleStruct->eventState.atkCanceler = 0; else - gBattleStruct->eventState.atkCanceller = CANCELLER_VOLATILE_BLOCKED; + gBattleStruct->eventState.atkCanceler = CANCELER_VOLATILE_BLOCKED; gBattleScripting.animTurn = 0; gBattleScripting.animTargetsHit = 0; SetTypeBeforeUsingMove(gCurrentMove, gBattlerAttacker); diff --git a/src/battle_util.c b/src/battle_util.c index 8623291552..19d9bd1345 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -433,7 +433,7 @@ void HandleAction_UseMove(void) return; } - gBattleStruct->eventState.atkCanceller = 0; + gBattleStruct->eventState.atkCanceler = 0; ClearDamageCalcResults(); gMultiHitCounter = 0; gBattleScripting.savedDmg = 0; @@ -1114,7 +1114,7 @@ const u8 *CheckSkyDropState(u32 battler, enum SkyDropState skyDropState) // Set confused status 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; } @@ -1946,21 +1946,21 @@ static inline bool32 TryActivatePowderStatus(u32 move) 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.glaiveRush = FALSE; 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()) return MOVE_STEP_BREAK; 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 (gBattleMons[ctx->battlerAtk].volatiles.semiInvulnerable == STATE_SKY_DROP) @@ -1972,11 +1972,11 @@ static enum MoveCanceller CancellerSkyDrop(struct BattleContext *ctx) return MOVE_STEP_SUCCESS; } -static enum MoveCanceller CancellerRecharge(struct BattleContext *ctx) +static enum MoveCanceler CancelerRecharge(struct BattleContext *ctx) { if (gDisableStructs[ctx->battlerAtk].rechargeTimer > 0) { - CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELLER_CHECK); + CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELER_CHECK); gBattlescriptCurrInstr = BattleScript_MoveUsedMustRecharge; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; return MOVE_STEP_FAILURE; @@ -1984,7 +1984,7 @@ static enum MoveCanceller CancellerRecharge(struct BattleContext *ctx) 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) { @@ -2050,7 +2050,7 @@ static enum MoveCanceller CancellerAsleepOrFrozen(struct BattleContext *ctx) return MOVE_STEP_SUCCESS; } -static enum MoveCanceller CancellerObedience(struct BattleContext *ctx) +static enum MoveCanceler CancelerObedience(struct BattleContext *ctx) { if (!gBattleMons[ctx->battlerAtk].volatiles.multipleTurns) { @@ -2105,7 +2105,7 @@ static enum MoveCanceller CancellerObedience(struct BattleContext *ctx) 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 && ctx->currentMove != MOVE_STRUGGLE @@ -2120,11 +2120,11 @@ static enum MoveCanceller CancellerPowerPoints(struct BattleContext *ctx) 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) { - CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELLER_CHECK); + CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELER_CHECK); gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_LOAFING; gBattlerAbility = ctx->battlerAtk; @@ -2135,12 +2135,12 @@ static enum MoveCanceller CancellerTruant(struct BattleContext *ctx) return MOVE_STEP_SUCCESS; } -static enum MoveCanceller CancellerFlinch(struct BattleContext *ctx) +static enum MoveCanceler CancelerFlinch(struct BattleContext *ctx) { if (gBattleMons[ctx->battlerAtk].volatiles.flinched) { gProtectStructs[ctx->battlerAtk].unableToUseMove = TRUE; - CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELLER_CHECK); + CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELER_CHECK); gBattlescriptCurrInstr = BattleScript_MoveUsedFlinched; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; return MOVE_STEP_FAILURE; @@ -2148,7 +2148,7 @@ static enum MoveCanceller CancellerFlinch(struct BattleContext *ctx) 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 && gDisableStructs[ctx->battlerAtk].disabledMove == ctx->currentMove @@ -2156,7 +2156,7 @@ static enum MoveCanceller CancellerDisabled(struct BattleContext *ctx) { gProtectStructs[ctx->battlerAtk].unableToUseMove = TRUE; gBattleScripting.battler = ctx->battlerAtk; - CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELLER_CHECK); + CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELER_CHECK); gBattlescriptCurrInstr = BattleScript_MoveUsedIsDisabled; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; return MOVE_STEP_FAILURE; @@ -2164,7 +2164,7 @@ static enum MoveCanceller CancellerDisabled(struct BattleContext *ctx) 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 && gBattleMons[ctx->battlerAtk].volatiles.healBlock @@ -2172,7 +2172,7 @@ static enum MoveCanceller CancellerVolatileBlocked(struct BattleContext *ctx) { gProtectStructs[ctx->battlerAtk].unableToUseMove = TRUE; gBattleScripting.battler = ctx->battlerAtk; - CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELLER_CHECK); + CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELER_CHECK); gBattlescriptCurrInstr = BattleScript_MoveUsedHealBlockPrevents; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; return MOVE_STEP_FAILURE; @@ -2181,7 +2181,7 @@ static enum MoveCanceller CancellerVolatileBlocked(struct BattleContext *ctx) { gProtectStructs[ctx->battlerAtk].unableToUseMove = TRUE; gBattleScripting.battler = ctx->battlerAtk; - CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELLER_CHECK); + CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELER_CHECK); gBattlescriptCurrInstr = BattleScript_MoveUsedGravityPrevents; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; 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)) { gProtectStructs[ctx->battlerAtk].unableToUseMove = TRUE; - CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELLER_CHECK); + CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELER_CHECK); gBattlescriptCurrInstr = BattleScript_MoveUsedIsThroatChopPrevented; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; return MOVE_STEP_FAILURE; @@ -2197,12 +2197,12 @@ static enum MoveCanceller CancellerVolatileBlocked(struct BattleContext *ctx) 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)) { gProtectStructs[ctx->battlerAtk].unableToUseMove = TRUE; - CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELLER_CHECK); + CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELER_CHECK); gBattlescriptCurrInstr = BattleScript_MoveUsedIsTaunted; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; return MOVE_STEP_BREAK; @@ -2210,12 +2210,12 @@ static enum MoveCanceller CancellerTaunted(struct BattleContext *ctx) 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)) { gProtectStructs[ctx->battlerAtk].unableToUseMove = TRUE; - CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELLER_CHECK); + CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELER_CHECK); gBattlescriptCurrInstr = BattleScript_MoveUsedIsImprisoned; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; return MOVE_STEP_FAILURE; @@ -2223,7 +2223,7 @@ static enum MoveCanceller CancellerImprisoned(struct BattleContext *ctx) return MOVE_STEP_SUCCESS; } -static enum MoveCanceller CancellerConfused(struct BattleContext *ctx) +static enum MoveCanceler CancelerConfused(struct BattleContext *ctx) { if (gBattleMons[ctx->battlerAtk].volatiles.confusionTurns) { @@ -2263,7 +2263,7 @@ static enum MoveCanceller CancellerConfused(struct BattleContext *ctx) 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 && !(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; // 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; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; return MOVE_STEP_FAILURE; @@ -2279,7 +2279,7 @@ static enum MoveCanceller CancellerParalysed(struct BattleContext *ctx) return MOVE_STEP_SUCCESS; } -static enum MoveCanceller CancellerInfatuation(struct BattleContext *ctx) +static enum MoveCanceler CancelerInfatuation(struct BattleContext *ctx) { if (gBattleMons[ctx->battlerAtk].volatiles.infatuation) { @@ -2294,7 +2294,7 @@ static enum MoveCanceller CancellerInfatuation(struct BattleContext *ctx) BattleScriptPush(BattleScript_MoveUsedIsInLoveCantAttack); gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; gProtectStructs[ctx->battlerAtk].unableToUseMove = TRUE; - CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELLER_CHECK); + CancelMultiTurnMoves(ctx->battlerAtk, SKY_DROP_ATTACKCANCELER_CHECK); gBattlescriptCurrInstr = BattleScript_MoveUsedIsInLove; return MOVE_STEP_FAILURE; } @@ -2302,7 +2302,7 @@ static enum MoveCanceller CancellerInfatuation(struct BattleContext *ctx) return MOVE_STEP_SUCCESS; } -static enum MoveCanceller CancellerBide(struct BattleContext *ctx) +static enum MoveCanceler CancelerBide(struct BattleContext *ctx) { if (gBattleMons[ctx->battlerAtk].volatiles.bideTurns) { @@ -2333,7 +2333,7 @@ static enum MoveCanceller CancellerBide(struct BattleContext *ctx) 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) { @@ -2352,7 +2352,7 @@ static enum MoveCanceller CancellerZMoves(struct BattleContext *ctx) return MOVE_STEP_SUCCESS; } -static enum MoveCanceller CancellerChoiceLock(struct BattleContext *ctx) +static enum MoveCanceler CancelerChoiceLock(struct BattleContext *ctx) { u16 *choicedMoveAtk = &gBattleStruct->choicedMove[ctx->battlerAtk]; enum HoldEffect holdEffect = GetBattlerHoldEffect(ctx->battlerAtk); @@ -2375,7 +2375,7 @@ static enum MoveCanceller CancellerChoiceLock(struct BattleContext *ctx) return MOVE_STEP_SUCCESS; } -static enum MoveCanceller CancellerCallSubmove(struct BattleContext *ctx) +static enum MoveCanceler CancelerCallSubmove(struct BattleContext *ctx) { bool32 noEffect = FALSE; u32 calledMove = MOVE_NONE; @@ -2436,7 +2436,7 @@ static enum MoveCanceller CancellerCallSubmove(struct BattleContext *ctx) 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) { @@ -2461,14 +2461,14 @@ static enum MoveCanceller CancellerThaw(struct BattleContext *ctx) 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()) return MOVE_STEP_BREAK; return MOVE_STEP_SUCCESS; } -static enum MoveCanceller CancellerAttackstring(struct BattleContext *ctx) +static enum MoveCanceler CancelerAttackstring(struct BattleContext *ctx) { BattleScriptCall(BattleScript_Attackstring); if (!gSpecialStatuses[gBattlerAttacker].dancerUsedMove) @@ -2476,7 +2476,7 @@ static enum MoveCanceller CancellerAttackstring(struct BattleContext *ctx) return MOVE_STEP_BREAK; } -static enum MoveCanceller CancellerPPDeduction(struct BattleContext *ctx) +static enum MoveCanceler CancelerPPDeduction(struct BattleContext *ctx) { if (gBattleMons[ctx->battlerAtk].volatiles.multipleTurns || gSpecialStatuses[ctx->battlerAtk].dancerUsedMove @@ -2536,7 +2536,7 @@ static enum MoveCanceller CancellerPPDeduction(struct BattleContext *ctx) gBattlescriptCurrInstr = BattleScript_ButItFailed; 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; return MOVE_STEP_FAILURE; @@ -2548,7 +2548,7 @@ static enum MoveCanceller CancellerPPDeduction(struct BattleContext *ctx) gBattleScripting.animTurn = 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); HandleMoveTargetRedirection(); gBattlescriptCurrInstr = GetMoveBattleScript(ctx->currentMove); @@ -2559,9 +2559,9 @@ static enum MoveCanceller CancellerPPDeduction(struct BattleContext *ctx) 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) { enum Type moveType = GetBattleMoveType(ctx->currentMove); @@ -2578,7 +2578,7 @@ static enum MoveCanceller CancellerWeatherPrimal(struct BattleContext *ctx) if (effect == MOVE_STEP_FAILURE) { 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; gBattlescriptCurrInstr = BattleScript_PrimalWeatherBlocksMove; } @@ -2586,7 +2586,7 @@ static enum MoveCanceller CancellerWeatherPrimal(struct BattleContext *ctx) return effect; } -static enum MoveCanceller CancellerMoveFailure(struct BattleContext *ctx) +static enum MoveCanceler CancelerMoveFailure(struct BattleContext *ctx) { const u8 *battleScript = NULL; @@ -2715,7 +2715,7 @@ static enum MoveCanceller CancellerMoveFailure(struct BattleContext *ctx) return MOVE_STEP_SUCCESS; } -static enum MoveCanceller CancellerPowderStatus(struct BattleContext *ctx) +static enum MoveCanceler CancelerPowderStatus(struct BattleContext *ctx) { if (TryActivatePowderStatus(ctx->currentMove)) { @@ -2744,7 +2744,7 @@ bool32 IsDazzlingAbility(enum Ability ability) return FALSE; } -static enum MoveCanceller CancellerPriorityBlock(struct BattleContext *ctx) +static enum MoveCanceler CancelerPriorityBlock(struct BattleContext *ctx) { bool32 effect = FALSE; s32 priority = GetChosenMovePriority(ctx->battlerAtk, ctx->abilities[ctx->battlerAtk]); @@ -2783,7 +2783,7 @@ static enum MoveCanceller CancellerPriorityBlock(struct BattleContext *ctx) return MOVE_STEP_SUCCESS; } -static enum MoveCanceller CancellerProtean(struct BattleContext *ctx) +static enum MoveCanceler CancelerProtean(struct BattleContext *ctx) { enum Type moveType = GetBattleMoveType(ctx->currentMove); 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; } -static enum MoveCanceller CancellerExplodingDamp(struct BattleContext *ctx) +static enum MoveCanceler CancelerExplodingDamp(struct BattleContext *ctx) { u32 dampBattler = IsAbilityOnField(ABILITY_DAMP); if (dampBattler && IsMoveDampBanned(ctx->currentMove)) @@ -2813,7 +2813,7 @@ static enum MoveCanceller CancellerExplodingDamp(struct BattleContext *ctx) 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) { @@ -2885,7 +2885,7 @@ static enum MoveCanceller CancellerMultihitMoves(struct BattleContext *ctx) 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); enum Ability abilityAtk = ctx->abilities[ctx->battlerAtk]; @@ -2932,50 +2932,50 @@ static enum MoveCanceller CancellerMultiTargetMoves(struct BattleContext *ctx) return MOVE_STEP_SUCCESS; } -static enum MoveCanceller (*const sMoveSuccessOrderCancellers[])(struct BattleContext *ctx) = +static enum MoveCanceler (*const sMoveSuccessOrderCancelers[])(struct BattleContext *ctx) = { - [CANCELLER_CLEAR_FLAGS] = CancellerClearFlags, - [CANCELLER_STANCE_CHANGE_1] = CancellerStanceChangeOne, - [CANCELLER_SKY_DROP] = CancellerSkyDrop, - [CANCELLER_RECHARGE] = CancellerRecharge, - [CANCELLER_ASLEEP_OR_FROZEN] = CancellerAsleepOrFrozen, - [CANCELLER_OBEDIENCE] = CancellerObedience, - [CANCELLER_POWER_POINTS] = CancellerPowerPoints, - [CANCELLER_TRUANT] = CancellerTruant, - [CANCELLER_FLINCH] = CancellerFlinch, - [CANCELLER_DISABLED] = CancellerDisabled, - [CANCELLER_VOLATILE_BLOCKED] = CancellerVolatileBlocked, - [CANCELLER_TAUNTED] = CancellerTaunted, - [CANCELLER_IMPRISONED] = CancellerImprisoned, - [CANCELLER_CONFUSED] = CancellerConfused, - [CANCELLER_PARALYSED] = CancellerParalysed, - [CANCELLER_INFATUATION] = CancellerInfatuation, - [CANCELLER_BIDE] = CancellerBide, - [CANCELLER_Z_MOVES] = CancellerZMoves, - [CANCELLER_CHOICE_LOCK] = CancellerChoiceLock, - [CANCELLER_CALLSUBMOVE] = CancellerCallSubmove, - [CANCELLER_THAW] = CancellerThaw, - [CANCELLER_STANCE_CHANGE_2] = CancellerStanceChangeTwo, - [CANCELLER_ATTACKSTRING] = CancellerAttackstring, - [CANCELLER_PPDEDUCTION] = CancellerPPDeduction, - [CANCELLER_WEATHER_PRIMAL] = CancellerWeatherPrimal, - [CANCELLER_MOVE_FAILURE] = CancellerMoveFailure, - [CANCELLER_POWDER_STATUS] = CancellerPowderStatus, - [CANCELLER_PRIORITY_BLOCK] = CancellerPriorityBlock, - [CANCELLER_PROTEAN] = CancellerProtean, - [CANCELLER_EXPLODING_DAMP] = CancellerExplodingDamp, - [CANCELLER_MULTIHIT_MOVES] = CancellerMultihitMoves, - [CANCELLER_MULTI_TARGET_MOVES] = CancellerMultiTargetMoves, + [CANCELER_CLEAR_FLAGS] = CancelerClearFlags, + [CANCELER_STANCE_CHANGE_1] = CancelerStanceChangeOne, + [CANCELER_SKY_DROP] = CancelerSkyDrop, + [CANCELER_RECHARGE] = CancelerRecharge, + [CANCELER_ASLEEP_OR_FROZEN] = CancelerAsleepOrFrozen, + [CANCELER_OBEDIENCE] = CancelerObedience, + [CANCELER_POWER_POINTS] = CancelerPowerPoints, + [CANCELER_TRUANT] = CancelerTruant, + [CANCELER_FLINCH] = CancelerFlinch, + [CANCELER_DISABLED] = CancelerDisabled, + [CANCELER_VOLATILE_BLOCKED] = CancelerVolatileBlocked, + [CANCELER_TAUNTED] = CancelerTaunted, + [CANCELER_IMPRISONED] = CancelerImprisoned, + [CANCELER_CONFUSED] = CancelerConfused, + [CANCELER_PARALYSED] = CancelerParalysed, + [CANCELER_INFATUATION] = CancelerInfatuation, + [CANCELER_BIDE] = CancelerBide, + [CANCELER_Z_MOVES] = CancelerZMoves, + [CANCELER_CHOICE_LOCK] = CancelerChoiceLock, + [CANCELER_CALLSUBMOVE] = CancelerCallSubmove, + [CANCELER_THAW] = CancelerThaw, + [CANCELER_STANCE_CHANGE_2] = CancelerStanceChangeTwo, + [CANCELER_ATTACKSTRING] = CancelerAttackstring, + [CANCELER_PPDEDUCTION] = CancelerPPDeduction, + [CANCELER_WEATHER_PRIMAL] = CancelerWeatherPrimal, + [CANCELER_MOVE_FAILURE] = CancelerMoveFailure, + [CANCELER_POWDER_STATUS] = CancelerPowderStatus, + [CANCELER_PRIORITY_BLOCK] = CancelerPriorityBlock, + [CANCELER_PROTEAN] = CancelerProtean, + [CANCELER_EXPLODING_DAMP] = CancelerExplodingDamp, + [CANCELER_MULTIHIT_MOVES] = CancelerMultihitMoves, + [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); - gBattleStruct->eventState.atkCanceller++; + effect = sMoveSuccessOrderCancelers[gBattleStruct->eventState.atkCanceler](ctx); + gBattleStruct->eventState.atkCanceler++; } 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))) { 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; } 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. 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; return TRUE; // Early return since we don't want to set remaining values }