diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 18d20ebc9417..9a26c78dc2d2 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -6716,6 +6716,7 @@ BattleScript_PrintFullBox:: BattleScript_ActionSwitch:: hpthresholds2 BS_ATTACKER + copybyte sSAVED_BATTLER, gBattlerAttacker printstring STRINGID_RETURNMON jumpifbattletype BATTLE_TYPE_DOUBLE, BattleScript_PursuitSwitchDmgSetMultihit setmultihit 1 @@ -6733,6 +6734,7 @@ BattleScript_DoSwitchOut:: switchoutabilities BS_ATTACKER updatedynamax waitstate + copybyte gBattlerAttacker, sSAVED_BATTLER returnatktoball waitstate drawpartystatussummary BS_ATTACKER diff --git a/test/battle/move_effect/pursuit.c b/test/battle/move_effect/pursuit.c new file mode 100644 index 000000000000..9d53f3057347 --- /dev/null +++ b/test/battle/move_effect/pursuit.c @@ -0,0 +1,26 @@ +#include "global.h" +#include "test/battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_PURSUIT].effect == EFFECT_PURSUIT); +} + +SINGLE_BATTLE_TEST("Pursuited mon correctly switches out after it got hit and activated ability Tangling Hair") +{ + GIVEN { + PLAYER(SPECIES_DUGTRIO) { Ability(ABILITY_TANGLING_HAIR); } + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { SWITCH(player, 1); MOVE(opponent, MOVE_PURSUIT); } + } SCENE { + MESSAGE("Dugtrio, that's enough! Come back!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_PURSUIT, opponent); + ABILITY_POPUP(player, ABILITY_TANGLING_HAIR); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent); + MESSAGE("Foe Wynaut's Speed fell!"); + MESSAGE("Go! Wobbuffet!"); + } +}