diff options
Diffstat (limited to 'engine/battle/moveEffects/one_hit_ko_effect.asm')
-rw-r--r-- | engine/battle/moveEffects/one_hit_ko_effect.asm | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/engine/battle/moveEffects/one_hit_ko_effect.asm b/engine/battle/moveEffects/one_hit_ko_effect.asm index 84418e33..cc0eca7b 100644 --- a/engine/battle/moveEffects/one_hit_ko_effect.asm +++ b/engine/battle/moveEffects/one_hit_ko_effect.asm @@ -7,12 +7,13 @@ OneHitKOEffect_: ; 33f57 (c:7f57) ld [wCriticalHitOrOHKO], a ld hl, wBattleMonSpeed + 1 ld de, wEnemyMonSpeed + 1 - ld a, [H_WHOSETURN] ; $fff3 + ld a, [H_WHOSETURN] and a - jr z, .asm_33f72 + jr z, .compareSpeed ld hl, wEnemyMonSpeed + 1 ld de, wBattleMonSpeed + 1 -.asm_33f72 +.compareSpeed +; set damage to 65535 and OHKO flag is the user's current speed is higher than the target's ld a, [de] dec de ld b, a @@ -22,7 +23,7 @@ OneHitKOEffect_: ; 33f57 (c:7f57) ld b, a ld a, [hl] sbc b - jr c, .asm_33f8a + jr c, .userIsSlower ld hl, W_DAMAGE ld a, $ff ld [hli], a @@ -30,7 +31,8 @@ OneHitKOEffect_: ; 33f57 (c:7f57) ld a, $2 ld [wCriticalHitOrOHKO], a ret -.asm_33f8a +.userIsSlower +; keep damage at 0 and set move missed flag if target's current speed is higher instead ld a, $1 ld [W_MOVEMISSED], a ret |