Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pret
GitHub Repository: pret/pokered
Path: blob/master/engine/battle/unused_stats_functions.asm
1271 views
1
; does nothing since no stats are ever selected (barring glitches)
2
DoubleSelectedStats:
3
ldh a, [hWhoseTurn]
4
and a
5
ld a, [wPlayerStatsToDouble]
6
ld hl, wBattleMonAttack + 1
7
jr z, .notEnemyTurn
8
ld a, [wEnemyStatsToDouble]
9
ld hl, wEnemyMonAttack + 1
10
.notEnemyTurn
11
ld c, 4
12
ld b, a
13
.loop
14
srl b
15
call c, .doubleStat
16
inc hl
17
inc hl
18
dec c
19
ret z
20
jr .loop
21
22
.doubleStat
23
ld a, [hl]
24
add a
25
ld [hld], a
26
ld a, [hl]
27
rl a
28
ld [hli], a
29
ret
30
31
; does nothing since no stats are ever selected (barring glitches)
32
HalveSelectedStats:
33
ldh a, [hWhoseTurn]
34
and a
35
ld a, [wPlayerStatsToHalve]
36
ld hl, wBattleMonAttack
37
jr z, .notEnemyTurn
38
ld a, [wEnemyStatsToHalve]
39
ld hl, wEnemyMonAttack
40
.notEnemyTurn
41
ld c, 4
42
ld b, a
43
.loop
44
srl b
45
call c, .halveStat
46
inc hl
47
inc hl
48
dec c
49
ret z
50
jr .loop
51
52
.halveStat
53
ld a, [hl]
54
srl a
55
ld [hli], a
56
rr [hl]
57
or [hl]
58
jr nz, .nonzeroStat
59
ld [hl], 1
60
.nonzeroStat
61
dec hl
62
ret
63
64