1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
MistEffect_: ; 33f2b (c:7f2b)
ld hl, W_PLAYERBATTSTATUS2
ld a, [$fff3]
and a
jr z, .asm_33f36
ld hl, W_ENEMYBATTSTATUS2
.asm_33f36
bit 1, [hl] ; is mon protected by mist?
jr nz, .asm_33f4a
set 1, [hl] ; mon is now protected by mist
callab Func_3fba8
ld hl, ShroudedInMistText
jp PrintText
.asm_33f4a
ld hl, PrintButItFailedText_
ld b, BANK(PrintButItFailedText_)
jp Bankswitch
ShroudedInMistText: ; 33f52 (c:7f52)
TX_FAR _ShroudedInMistText
db "@"
OneHitKOEffect_: ; 33f57 (c:7f57)
ld hl, W_DAMAGE ; $d0d7
xor a
ld [hli], a
ld [hl], a ; set the damage output to zero
dec a
ld [$d05e], a
ld hl, $d02a
ld de, $cffb
ld a, [H_WHOSETURN] ; $fff3
and a
jr z, .asm_33f72
ld hl, $cffb
ld de, $d02a
.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 ; $d0d7
ld a, $ff
ld [hli], a
ld [hl], a
ld a, $2
ld [$d05e], a
ret
.asm_33f8a
ld a, $1
ld [W_MOVEMISSED], a ; $d05f
ret
|