diff options
author | yenatch <yenatch@gmail.com> | 2015-04-01 12:56:42 -0400 |
---|---|---|
committer | yenatch <yenatch@gmail.com> | 2015-04-01 12:56:42 -0400 |
commit | c2efe700ac1c5cca88bac710b98388a99665741e (patch) | |
tree | b30d2f676d5ad0d78b959c8ffcf0f8dcfca13943 /engine/battle/moveEffects/one_hit_ko_effect.asm | |
parent | 52add272c6bca00d2ea827ef7fa4611a4bc41b47 (diff) | |
parent | ce9940a2eb89caa9f53507a6d6071f8eaf85ee48 (diff) |
Merge pull request #90 from xCrystal/master
Rename/split battle and move effect files. Battle functions, AI, and attack animations
Diffstat (limited to 'engine/battle/moveEffects/one_hit_ko_effect.asm')
-rw-r--r-- | engine/battle/moveEffects/one_hit_ko_effect.asm | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/engine/battle/moveEffects/one_hit_ko_effect.asm b/engine/battle/moveEffects/one_hit_ko_effect.asm new file mode 100644 index 00000000..84418e33 --- /dev/null +++ b/engine/battle/moveEffects/one_hit_ko_effect.asm @@ -0,0 +1,36 @@ +OneHitKOEffect_: ; 33f57 (c:7f57) + ld hl, W_DAMAGE + xor a + ld [hli], a + ld [hl], a ; set the damage output to zero + dec a + ld [wCriticalHitOrOHKO], a + ld hl, wBattleMonSpeed + 1 + ld de, wEnemyMonSpeed + 1 + ld a, [H_WHOSETURN] ; $fff3 + and a + jr z, .asm_33f72 + ld hl, wEnemyMonSpeed + 1 + ld de, wBattleMonSpeed + 1 +.asm_33f72 + ld a, [de] + dec de + ld b, a + ld a, [hld] + sub b + ld a, [de] + ld b, a + ld a, [hl] + sbc b + jr c, .asm_33f8a + ld hl, W_DAMAGE + ld a, $ff + ld [hli], a + ld [hl], a + ld a, $2 + ld [wCriticalHitOrOHKO], a + ret +.asm_33f8a + ld a, $1 + ld [W_MOVEMISSED], a + ret |