summaryrefslogtreecommitdiff
path: root/engine/battle/unused_stats_functions.asm
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2015-04-01 12:56:42 -0400
committeryenatch <yenatch@gmail.com>2015-04-01 12:56:42 -0400
commitc2efe700ac1c5cca88bac710b98388a99665741e (patch)
treeb30d2f676d5ad0d78b959c8ffcf0f8dcfca13943 /engine/battle/unused_stats_functions.asm
parent52add272c6bca00d2ea827ef7fa4611a4bc41b47 (diff)
parentce9940a2eb89caa9f53507a6d6071f8eaf85ee48 (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/unused_stats_functions.asm')
-rw-r--r--engine/battle/unused_stats_functions.asm62
1 files changed, 62 insertions, 0 deletions
diff --git a/engine/battle/unused_stats_functions.asm b/engine/battle/unused_stats_functions.asm
new file mode 100644
index 00000000..23ddbc20
--- /dev/null
+++ b/engine/battle/unused_stats_functions.asm
@@ -0,0 +1,62 @@
+; does nothing since no stats are ever selected (barring glitches)
+DoubleSelectedStats: ; 39680 (e:5680)
+ ld a, [H_WHOSETURN]
+ and a
+ ld a, [wPlayerStatsToDouble]
+ ld hl, wBattleMonAttack + 1
+ jr z, .notEnemyTurn
+ ld a, [wEnemyStatsToDouble]
+ ld hl, wEnemyMonAttack + 1
+.notEnemyTurn
+ ld c, 4
+ ld b, a
+.loop
+ srl b
+ call c, .doubleStat
+ inc hl
+ inc hl
+ dec c
+ ret z
+ jr .loop
+
+.doubleStat
+ ld a, [hl]
+ add a
+ ld [hld], a
+ ld a, [hl]
+ rl a
+ ld [hli], a
+ ret
+
+; does nothing since no stats are ever selected (barring glitches)
+HalveSelectedStats: ; 396a7 (e:56a7)
+ ld a, [H_WHOSETURN]
+ and a
+ ld a, [wPlayerStatsToHalve]
+ ld hl, wBattleMonAttack
+ jr z, .notEnemyTurn
+ ld a, [wEnemyStatsToHalve]
+ ld hl, wEnemyMonAttack
+.notEnemyTurn
+ ld c, 4
+ ld b, a
+.loop
+ srl b
+ call c, .halveStat
+ inc hl
+ inc hl
+ dec c
+ ret z
+ jr .loop
+
+.halveStat
+ ld a, [hl]
+ srl a
+ ld [hli], a
+ rr [hl]
+ or [hl]
+ jr nz, .nonzeroStat
+ ld [hl], 1
+.nonzeroStat
+ dec hl
+ ret