From a195b78f6caee77cc24bec9c22d1c75c3dc3fd14 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 28 Jan 2024 18:23:24 +0100 Subject: [PATCH] Fixes Pursuit, Tangling Hair interaction --- data/battle_scripts_1.s | 2 ++ test/battle/move_effect/pursuit.c | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 test/battle/move_effect/pursuit.c 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!"); + } +}