diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 2ab77334db..114da2aed7 100755 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -5698,6 +5698,7 @@ static bool32 HandleMoveEndMoveBlock(u32 moveEffect) case EFFECT_KNOCK_OFF: if (gBattleStruct->battlerState[gBattlerTarget].itemCanBeKnockedOff && gBattleMons[gBattlerTarget].item != ITEM_NONE + && IsBattlerTurnDamaged(gBattlerTarget) && IsBattlerAlive(gBattlerAttacker)) { u32 side = GetBattlerSide(gBattlerTarget); @@ -5873,7 +5874,9 @@ static bool32 HandleMoveEndMoveBlock(u32 moveEffect) } break; case EFFECT_STONE_AXE: - if (!IsHazardOnSide(GetBattlerSide(gBattlerTarget), HAZARDS_STEALTH_ROCK) && IsBattlerAlive(gBattlerAttacker)) + if (!IsHazardOnSide(GetBattlerSide(gBattlerTarget), HAZARDS_STEALTH_ROCK) + && IsBattlerTurnDamaged(gBattlerTarget) + && IsBattlerAlive(gBattlerAttacker)) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_POINTEDSTONESFLOAT; BattleScriptPushCursor(); @@ -5882,7 +5885,9 @@ static bool32 HandleMoveEndMoveBlock(u32 moveEffect) } break; case EFFECT_CEASELESS_EDGE: - if (gSideTimers[GetBattlerSide(gBattlerTarget)].spikesAmount < 3 && IsBattlerAlive(gBattlerAttacker)) + if (gSideTimers[GetBattlerSide(gBattlerTarget)].spikesAmount < 3 + && IsBattlerTurnDamaged(gBattlerTarget) + && IsBattlerAlive(gBattlerAttacker)) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SPIKESSCATTERED; BattleScriptPush(gBattlescriptCurrInstr + 1); diff --git a/src/battle_util.c b/src/battle_util.c index 3ab160c03b..d80864cd36 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -7091,6 +7091,7 @@ u32 ItemBattleEffects(enum ItemCaseId caseID, u32 battler) break; case HOLD_EFFECT_THROAT_SPRAY: // Does NOT need to be a damaging move if (IsSoundMove(gCurrentMove) + && !(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) && IsBattlerAlive(gBattlerAttacker) && IsAnyTargetAffected(gBattlerAttacker) && CompareStat(gBattlerAttacker, STAT_SPATK, MAX_STAT_STAGE, CMP_LESS_THAN) diff --git a/test/battle/hold_effect/throat_spray.c b/test/battle/hold_effect/throat_spray.c index 67e596c277..99b2da3e59 100644 --- a/test/battle/hold_effect/throat_spray.c +++ b/test/battle/hold_effect/throat_spray.c @@ -88,3 +88,19 @@ SINGLE_BATTLE_TEST("Throat Spray does not activate if move fails") } } } + +SINGLE_BATTLE_TEST("Throat Spray does not activate if user flinches") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_THROAT_SPRAY); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_FAKE_OUT); MOVE(player, MOVE_HYPER_VOICE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_FAKE_OUT, opponent); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_HYPER_VOICE, player); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + } + } +} diff --git a/test/battle/move_effect/ceaseless_edge.c b/test/battle/move_effect/ceaseless_edge.c index 5a7e7f4a1a..288045945f 100644 --- a/test/battle/move_effect/ceaseless_edge.c +++ b/test/battle/move_effect/ceaseless_edge.c @@ -78,3 +78,19 @@ SINGLE_BATTLE_TEST("Ceaseless Edge fails to set up hazards if user faints") NOT MESSAGE("Spikes were scattered on the ground all around the opposing team!"); } } + +SINGLE_BATTLE_TEST("Ceaseless Edge does not set up hazards if target was not hit") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_PROTECT); MOVE(player, MOVE_CEASELESS_EDGE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_PROTECT, opponent); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_CEASELESS_EDGE, player); + MESSAGE("Spikes were scattered on the ground all around the opposing team!"); + } + } +}