summaryrefslogtreecommitdiff
path: root/src/macros/data.asm
diff options
context:
space:
mode:
authorxCrystal <rgr.crystal@gmail.com>2018-01-09 21:43:55 +0100
committerxCrystal <rgr.crystal@gmail.com>2018-01-09 21:43:55 +0100
commit7578d240c7de07403298d3491abb13babbaa222e (patch)
tree8fe699c428cfd3700e2488406dcf2fc71a35ec43 /src/macros/data.asm
parent866f59ee7186488770d2f712212437645a9a16c1 (diff)
Split macros
Diffstat (limited to 'src/macros/data.asm')
-rw-r--r--src/macros/data.asm48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/macros/data.asm b/src/macros/data.asm
new file mode 100644
index 0000000..1c73ac3
--- /dev/null
+++ b/src/macros/data.asm
@@ -0,0 +1,48 @@
+energy: MACRO
+fg = 0
+lw = 0
+fp = 0
+c_ = 0
+
+ if _NARG > 1
+
+ rept _NARG / 2
+
+ if \1 == FIRE
+fg = fg + \2 * $10
+ endc
+ if \1 == GRASS
+fg = fg + \2
+ endc
+ if \1 == LIGHTNING
+lw = lw + \2 * $10
+ endc
+ if \1 == WATER
+lw = lw + \2
+ endc
+ if \1 == FIGHTING
+fp = fp + \2 * $10
+ endc
+ if \1 == PSYCHIC
+fp = fp + \2
+ endc
+ if \1 == COLORLESS
+c_ = c_ + \2 * $10
+ endc
+
+ shift
+ shift
+
+ endr
+
+ endc
+ db fg, lw, fp, c_
+ENDM
+
+gfx: MACRO
+ dw ($4000 * (BANK(\1) - BANK(CardGraphics)) + (\1 - $4000)) / 8
+ENDM
+
+tx: MACRO
+ dw \1_
+ENDM