Skip to content

Commit

Permalink
Fix No Guard failing OHKO Moves into Semi-Invulnerable Pokemon (#5779)
Browse files Browse the repository at this point in the history
Co-authored-by: Bassoonian <[email protected]>
  • Loading branch information
iriv24 and Bassoonian authored Dec 7, 2024
1 parent 6e24b6a commit cb12bdc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion data/battle_scripts_1.s
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions test/battle/move_effect/ohko.c
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit cb12bdc

Please sign in to comment.