diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index ac9e88bea8..730a9f56f1 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -9350,6 +9350,7 @@ BattleScript_GooeyActivates:: call BattleScript_AbilityPopUp swapattackerwithtarget @ for defiant, mirror armor seteffectsecondary + swapattackerwithtarget return BattleScript_AbilityStatusEffect:: diff --git a/test/battle/ability/mirror_armor.c b/test/battle/ability/mirror_armor.c index 2c4d8d9a27..6de3530a77 100644 --- a/test/battle/ability/mirror_armor.c +++ b/test/battle/ability/mirror_armor.c @@ -195,3 +195,20 @@ DOUBLE_BATTLE_TEST("Mirror Armor lowers Speed of the partner Pokemon after Court MESSAGE("Wobbuffet's Speed fell!"); } } + +SINGLE_BATTLE_TEST("Mirror Armor reflects Tangling Hair speed drop") +{ + KNOWN_FAILING; + GIVEN { + PLAYER(SPECIES_DUGTRIO) { Ability(ABILITY_TANGLING_HAIR); } + OPPONENT(SPECIES_CORVIKNIGHT) { Ability(ABILITY_MIRROR_ARMOR); } + } WHEN { + TURN { MOVE(opponent, MOVE_TACKLE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + ABILITY_POPUP(player, ABILITY_TANGLING_HAIR); + NOT ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent); + ABILITY_POPUP(opponent, ABILITY_MIRROR_ARMOR); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + } +} diff --git a/test/battle/ability/tangling_hair.c b/test/battle/ability/tangling_hair.c new file mode 100644 index 0000000000..5e204bc42c --- /dev/null +++ b/test/battle/ability/tangling_hair.c @@ -0,0 +1,68 @@ +#include "global.h" +#include "test/battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_TACKLE].effect == EFFECT_HIT); + ASSUME(gBattleMoves[MOVE_TACKLE].power > 0); + ASSUME(gBattleMoves[MOVE_TACKLE].makesContact == TRUE); +} + + +SINGLE_BATTLE_TEST("Tangling Hair drops opposing mon's speed if ability user got hit by a contact move") +{ + u32 move; + + PARAMETRIZE { move = MOVE_TACKLE; } + PARAMETRIZE { move = MOVE_SWIFT; } + + GIVEN { + ASSUME(gBattleMoves[MOVE_SWIFT].makesContact == FALSE); + PLAYER(SPECIES_DUGTRIO) { Ability(ABILITY_TANGLING_HAIR); } + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(opponent, move); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, move, opponent); + if (move == MOVE_TACKLE) { + ABILITY_POPUP(player, ABILITY_TANGLING_HAIR); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent); + MESSAGE("Foe Wynaut's Speed fell!"); + } + } +} + +SINGLE_BATTLE_TEST("Tangling Hair does not cause Rocky Helmet miss activation") +{ + GIVEN { + ASSUME(gItems[ITEM_ROCKY_HELMET].holdEffect == HOLD_EFFECT_ROCKY_HELMET); + PLAYER(SPECIES_DUGTRIO) { Ability(ABILITY_TANGLING_HAIR); Item(ITEM_ROCKY_HELMET); } + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(opponent, MOVE_TACKLE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + ABILITY_POPUP(player, ABILITY_TANGLING_HAIR); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent); + MESSAGE("Foe Wynaut's Speed fell!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("Foe Wynaut was hurt by Dugtrio's Rocky Helmet!"); + } +} + +SINGLE_BATTLE_TEST("Tangling Hair Speed stat drop triggers defiant") +{ + GIVEN { + PLAYER(SPECIES_DUGTRIO) { Ability(ABILITY_TANGLING_HAIR); } + OPPONENT(SPECIES_PAWNIARD) { Ability(ABILITY_DEFIANT); } + } WHEN { + TURN { MOVE(opponent, MOVE_TACKLE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + ABILITY_POPUP(player, ABILITY_TANGLING_HAIR); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent); + MESSAGE("Foe Pawniard's Speed fell!"); + ABILITY_POPUP(opponent, ABILITY_DEFIANT); + MESSAGE("Foe Pawniard's Attack sharply rose!"); + } +} diff --git a/test/battle/move_effect/rage_fist.c b/test/battle/move_effect/rage_fist.c index 7a09461a4f..1d5feaad41 100644 --- a/test/battle/move_effect/rage_fist.c +++ b/test/battle/move_effect/rage_fist.c @@ -274,7 +274,6 @@ SINGLE_BATTLE_TEST("Rage Fist number of hits is copied by Transform") { s16 timesGotHit[2]; - // KNOWN_FAILING; // After Transform , wrong move is used by transformed mon GIVEN { PLAYER(SPECIES_REGIROCK); OPPONENT(SPECIES_REGIROCK) { Moves(MOVE_RAGE_FIST, MOVE_CELEBRATE); }