summaryrefslogtreecommitdiff
path: root/src/macros.asm
diff options
context:
space:
mode:
authorxCrystal <rgr.crystal@gmail.com>2016-01-14 21:54:47 +0100
committerxCrystal <rgr.crystal@gmail.com>2016-01-14 21:54:47 +0100
commit8ef106a89157713b7ca09160ef929ffec31312c5 (patch)
treeda4151193988d9b3f188a758f2f23df4c5ec63fb /src/macros.asm
parent9954aebc888e23f3b124284ab212fa75f20d7361 (diff)
energy macro
Diffstat (limited to 'src/macros.asm')
-rwxr-xr-xsrc/macros.asm41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/macros.asm b/src/macros.asm
index 8fbf35c..ad6dde7 100755
--- a/src/macros.asm
+++ b/src/macros.asm
@@ -248,3 +248,44 @@ ENDM
sfx_end: MACRO
db $f0
ENDM
+
+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