From cb12bdc22086bafc34d90c3288d23662d0f514a6 Mon Sep 17 00:00:00 2001 From: iriv24 <40581123+iriv24@users.noreply.github.com> Date: Sat, 7 Dec 2024 16:11:45 -0500 Subject: [PATCH] Fix No Guard failing OHKO Moves into Semi-Invulnerable Pokemon (#5779) Co-authored-by: Bassoonian --- data/battle_scripts_1.s | 2 +- test/battle/move_effect/ohko.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 5f7e898e1d..1eb74cea31 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -3413,7 +3413,7 @@ BattleScript_EffectOHKO:: attackcanceler attackstring ppreduce - accuracycheck BattleScript_ButItFailed, NO_ACC_CALC_CHECK_LOCK_ON + accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE typecalc jumpifmovehadnoeffect BattleScript_HitFromAtkAnimation tryKO BattleScript_KOFail diff --git a/test/battle/move_effect/ohko.c b/test/battle/move_effect/ohko.c index 511d76a8ad..8a8015309b 100644 --- a/test/battle/move_effect/ohko.c +++ b/test/battle/move_effect/ohko.c @@ -20,6 +20,22 @@ SINGLE_BATTLE_TEST("Sheer Cold doesn't affect Ice-type Pokémon") MESSAGE("It doesn't affect the opposing Glalie…"); } } + +SINGLE_BATTLE_TEST("OHKO moves can hit semi-invulnerable mons when the user has No-Guard") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_SHEER_COLD].effect == EFFECT_OHKO); + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_NO_GUARD); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_FLY); } + TURN { MOVE(player, MOVE_SHEER_COLD); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_SHEER_COLD, player); + HP_BAR(opponent, hp: 0); + } +} + TO_DO_BATTLE_TEST("Fissure faints the target, skipping regular damage calculations") TO_DO_BATTLE_TEST("Fissure always fails if the target has a higher level than the user") TO_DO_BATTLE_TEST("Fissure's accuracy increases by 1% for every level the user has over the target")