From 7722ebf47048d07342e9f767254a56043af4e1d4 Mon Sep 17 00:00:00 2001 From: PhallenTree <168426989+PhallenTree@users.noreply.github.com> Date: Fri, 23 Jan 2026 22:28:22 +0000 Subject: [PATCH] Fixes Hyperspace Fury not breaking protection (#8999) --- src/battle_script_commands.c | 2 +- src/data/moves_info.h | 4 +- test/battle/move_effect/hyperspace_fury.c | 4 - .../move_effects_combined/hyperspace_fury.c | 97 +++++++++++++++++++ 4 files changed, 101 insertions(+), 6 deletions(-) delete mode 100644 test/battle/move_effect/hyperspace_fury.c create mode 100644 test/battle/move_effects_combined/hyperspace_fury.c diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 0dee3f9320..83d665a06d 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3471,7 +3471,7 @@ void SetMoveEffect(u32 battler, u32 effectBattler, enum MoveEffect moveEffect, c if (i) { BattleScriptPush(battleScript); - if (gCurrentMove == MOVE_HYPERSPACE_FURY) + if (GetMoveEffect(gCurrentMove) == EFFECT_HYPERSPACE_FURY) gBattlescriptCurrInstr = BattleScript_HyperspaceFuryRemoveProtect; else gBattlescriptCurrInstr = BattleScript_MoveEffectFeint; diff --git a/src/data/moves_info.h b/src/data/moves_info.h index 312a2a2e00..31db4e424f 100644 --- a/src/data/moves_info.h +++ b/src/data/moves_info.h @@ -15981,7 +15981,9 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_ALL] = .metronomeBanned = TRUE, .sketchBanned = (B_SKETCH_BANS >= GEN_9), .additionalEffects = ADDITIONAL_EFFECTS({ - // Feint move effect handled in script as it goes before animation + .moveEffect = MOVE_EFFECT_FEINT, // TODO: Is this supposed to happen before the attack animation? + }, + { .moveEffect = MOVE_EFFECT_DEF_MINUS_1, .self = TRUE, }), diff --git a/test/battle/move_effect/hyperspace_fury.c b/test/battle/move_effect/hyperspace_fury.c deleted file mode 100644 index 080758c94b..0000000000 --- a/test/battle/move_effect/hyperspace_fury.c +++ /dev/null @@ -1,4 +0,0 @@ -#include "global.h" -#include "test/battle.h" - -TO_DO_BATTLE_TEST("TODO: Write Hyperspace Fury (Move Effect) test titles") diff --git a/test/battle/move_effects_combined/hyperspace_fury.c b/test/battle/move_effects_combined/hyperspace_fury.c new file mode 100644 index 0000000000..5c0a865c2b --- /dev/null +++ b/test/battle/move_effects_combined/hyperspace_fury.c @@ -0,0 +1,97 @@ +#include "global.h" +#include "test/battle.h" + +ASSUMPTIONS +{ + ASSUME(GetMoveEffect(MOVE_HYPERSPACE_FURY) == EFFECT_HYPERSPACE_FURY); + ASSUME(MoveHasAdditionalEffect(MOVE_HYPERSPACE_FURY, MOVE_EFFECT_FEINT)); + ASSUME(MoveHasAdditionalEffectSelf(MOVE_HYPERSPACE_FURY, MOVE_EFFECT_DEF_MINUS_1)); + ASSUME(GetMoveEffect(MOVE_PROTECT) == EFFECT_PROTECT); +} + +SINGLE_BATTLE_TEST("Hyperspace Fury fails if used by a Pokémon other than Hoopa Unbound") +{ + u32 species; + PARAMETRIZE { species = SPECIES_WOBBUFFET; } + PARAMETRIZE { species = SPECIES_HOOPA_CONFINED; } + PARAMETRIZE { species = SPECIES_HOOPA_UNBOUND; } + + GIVEN { + PLAYER(species); + OPPONENT(SPECIES_REGIROCK); + } WHEN { + TURN { MOVE(player, MOVE_HYPERSPACE_FURY); } + } SCENE { + switch (species) + { + case SPECIES_HOOPA_UNBOUND: + ANIMATION(ANIM_TYPE_MOVE, MOVE_HYPERSPACE_FURY, player); + break; + case SPECIES_HOOPA_CONFINED: + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_HYPERSPACE_FURY, player); + MESSAGE("But Hoopa can't use it the way it is now!"); + break; + case SPECIES_WOBBUFFET: + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_HYPERSPACE_FURY, player); + MESSAGE("But Wobbuffet can't use the move!"); + break; + default: + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_HYPERSPACE_FURY, player); + break; + } + } +} + +DOUBLE_BATTLE_TEST("Hyperspace Fury hits the target through Protect and breaks it") +{ + GIVEN { + PLAYER(SPECIES_HOOPA_UNBOUND); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_REGIROCK); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(opponentLeft, MOVE_PROTECT); MOVE(playerLeft, MOVE_HYPERSPACE_FURY, target: opponentLeft); MOVE(playerRight, MOVE_SCRATCH, target: opponentLeft); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_PROTECT, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_HYPERSPACE_FURY, playerLeft); + HP_BAR(opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SCRATCH, playerRight); + HP_BAR(opponentLeft); + } +} + +SINGLE_BATTLE_TEST("Hyperspace Fury lowers the user's Defense by 1 stage after hitting the target") +{ + GIVEN { + PLAYER(SPECIES_HOOPA_UNBOUND); + OPPONENT(SPECIES_REGIROCK); + } WHEN { + TURN { MOVE(player, MOVE_HYPERSPACE_FURY); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_HYPERSPACE_FURY, player); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + } THEN { + EXPECT_EQ(player->statStages[STAT_DEF], DEFAULT_STAT_STAGE - 1); + } +} + +DOUBLE_BATTLE_TEST("Hyperspace Fury breaks protection and lowers the user's Defense by 1 stage") +{ + GIVEN { + PLAYER(SPECIES_HOOPA_UNBOUND); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_REGIROCK); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(opponentLeft, MOVE_PROTECT); MOVE(playerLeft, MOVE_HYPERSPACE_FURY, target: opponentLeft); MOVE(playerRight, MOVE_SCRATCH, target: opponentLeft); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_PROTECT, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_HYPERSPACE_FURY, playerLeft); + HP_BAR(opponentLeft); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SCRATCH, playerRight); + HP_BAR(opponentLeft); + } THEN { + EXPECT_EQ(playerLeft->statStages[STAT_DEF], DEFAULT_STAT_STAGE - 1); + } +}