Fixes hazards and switch-in items not being reset when switching in (#8074)
This commit is contained in:
parent
c90e6952f3
commit
4a714225e5
@ -3235,6 +3235,9 @@ void SwitchInClearSetData(u32 battler, struct Volatiles *volatilesCopy)
|
||||
gBattleStruct->battlerState[battler].stompingTantrumTimer = 0;
|
||||
gBattleStruct->palaceFlags &= ~(1u << battler);
|
||||
gBattleStruct->battlerState[battler].canPickupItem = FALSE;
|
||||
gBattleStruct->hazardsCounter = 0;
|
||||
gDisableStructs[battler].hazardsDone = FALSE;
|
||||
gSpecialStatuses[battler].switchInItemDone = FALSE;
|
||||
|
||||
ClearPursuitValuesIfSet(battler);
|
||||
|
||||
|
||||
@ -7891,7 +7891,6 @@ static bool32 DoSwitchInEffectsForBattler(u32 battler)
|
||||
gBattleStruct->hpOnSwitchout[GetBattlerSide(i)] = gBattleMons[i].hp;
|
||||
}
|
||||
|
||||
gDisableStructs[battler].hazardsDone = FALSE;
|
||||
gBattleStruct->battlerState[battler].forcedSwitch = FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -38,3 +38,26 @@ SINGLE_BATTLE_TEST("Hazards are applied based on order of set up")
|
||||
EXPECT_EQ(gBattleStruct->hazardsQueue[0][5], HAZARDS_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Hazards are applied correctly after a battler faints")
|
||||
{
|
||||
GIVEN {
|
||||
ASSUME(GetMoveEffect(MOVE_FINAL_GAMBIT) == EFFECT_FINAL_GAMBIT);
|
||||
PLAYER(SPECIES_WYNAUT);
|
||||
PLAYER(SPECIES_WOBBUFFET) { HP(1); }
|
||||
PLAYER(SPECIES_WYNAUT);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(opponent, MOVE_STEALTH_ROCK);
|
||||
MOVE(player, MOVE_FINAL_GAMBIT);
|
||||
SEND_OUT(player, 1);
|
||||
SEND_OUT(player, 2); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_STEALTH_ROCK, opponent);
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_FINAL_GAMBIT, player);
|
||||
MESSAGE("Wynaut fainted!");
|
||||
MESSAGE("Pointed stones dug into Wobbuffet!");
|
||||
MESSAGE("Wobbuffet fainted!");
|
||||
MESSAGE("Pointed stones dug into Wynaut!");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user