diff --git a/include/battle.h b/include/battle.h index 826a0929ec..49881bacf7 100644 --- a/include/battle.h +++ b/include/battle.h @@ -210,6 +210,7 @@ struct SideTimer u8 tailwindBattlerId; u8 luckyChantTimer; u8 luckyChantBattlerId; + u8 retaliateTimer; }; struct FieldTimer diff --git a/include/constants/battle.h b/include/constants/battle.h index 39994a049e..a59ea2f1a5 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -220,7 +220,6 @@ #define SIDE_STATUS_WIDE_GUARD (1 << 19) #define SIDE_STATUS_CRAFTY_SHIELD (1 << 20) #define SIDE_STATUS_MAT_BLOCK (1 << 21) -#define SIDE_STATUS_RETALIATE (1 << 22) #define SIDE_STATUS_HAZARDS_ANY (SIDE_STATUS_SPIKES | SIDE_STATUS_STICKY_WEB | SIDE_STATUS_TOXIC_SPIKES | SIDE_STATUS_STEALTH_ROCK) #define SIDE_STATUS_SCREEN_ANY (SIDE_STATUS_REFLECT | SIDE_STATUS_LIGHTSCREEN | SIDE_STATUS_AURORA_VEIL) diff --git a/src/battle_main.c b/src/battle_main.c index f3f86d58f4..055ec9bbe8 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3583,7 +3583,6 @@ static void HandleEndTurn_ContinueBattle(void) gBattleMons[i].status2 &= ~(STATUS2_FLINCHED); if ((gBattleMons[i].status1 & STATUS1_SLEEP) && (gBattleMons[i].status2 & STATUS2_MULTIPLETURNS)) CancelMultiTurnMoves(i); - gSideStatuses[GET_BATTLER_SIDE(i)] &= ~SIDE_STATUS_RETALIATE; } gBattleStruct->turnEffectsTracker = 0; gBattleStruct->turnEffectsBattlerId = 0; diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index b301047aac..8813f2029d 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3499,14 +3499,14 @@ static void Cmd_tryfaintmon(void) if (gBattleResults.playerFaintCounter < 0xFF) gBattleResults.playerFaintCounter++; AdjustFriendshipOnBattleFaint(gActiveBattler); - gSideStatuses[0] |= SIDE_STATUS_RETALIATE; + gSideTimers[0].retaliateTimer = 2; } else { if (gBattleResults.opponentFaintCounter < 0xFF) gBattleResults.opponentFaintCounter++; gBattleResults.lastOpponentSpecies = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES, NULL); - gSideStatuses[1] |= SIDE_STATUS_RETALIATE; + gSideTimers[1].retaliateTimer = 2; } if ((gHitMarker & HITMARKER_DESTINYBOND) && gBattleMons[gBattlerAttacker].hp != 0) { diff --git a/src/battle_util.c b/src/battle_util.c index 3bf34afd5c..6b43709da4 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -1881,6 +1881,7 @@ enum ENDTURN_PSYCHIC_TERRAIN, ENDTURN_ION_DELUGE, ENDTURN_FAIRY_LOCK, + ENDTURN_RETALIATE, ENDTURN_FIELD_COUNT, }; @@ -2312,6 +2313,12 @@ u8 DoFieldEndTurnEffects(void) } gBattleStruct->turnCountersTracker++; break; + case ENDTURN_RETALIATE: + gActiveBattler = gBattlerByTurnOrder[gBattleStruct->turnSideTracker]; + if (gSideTimers[GET_BATTLER_SIDE(gActiveBattler)].retaliateTimer > 0) + gSideTimers[GET_BATTLER_SIDE(gActiveBattler)].retaliateTimer--; + gBattleStruct->turnCountersTracker++; + break; case ENDTURN_FIELD_COUNT: effect++; break; @@ -7934,7 +7941,7 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe MulModifier(&modifier, UQ_4_12(2.0)); break; case EFFECT_RETALIATE: - if (gSideStatuses[atkSide] & SIDE_STATUS_RETALIATE) + if (gSideTimers[atkSide].retaliateTimer == 1) MulModifier(&modifier, UQ_4_12(2.0)); break; case EFFECT_SOLARBEAM: