unit: Added act_def macro
authorLukas Krickl <lukas@krickl.dev>
Tue, 6 May 2025 14:34:44 +0000 (16:34 +0200)
committerLukas Krickl <lukas@krickl.dev>
Tue, 6 May 2025 14:34:44 +0000 (16:34 +0200)
src/defs.s
src/macros.inc
src/unit.s

index f822ac2073fb296b1c91c7790b5290bdab78cd23..db8778b683b67703bf6993e12a67c85dfd01c7f7 100644 (file)
@@ -83,9 +83,6 @@
 .de act_moves, stat_size ; moves for each turn
 .de act_init, 1 ; initiative value
 
-.de act_melee, 2 ; melee weapon routine
-.de act_ranged, 2 ; ranged weapon routine
-
   ; custom parameter
 .de act_p0, 1
 .de act_size, 0
index caa533a8bf699d3dfc7fc515b34e61f390426464..7858fa2baae6e3a632932b3a9d23287812f7d093 100644 (file)
   dw $2
   dw $3
 #endmacro
-
+  
+  ; define an actor without state
+  ; to define an actor call 
+  ; st_def and act_def
+  ; inputs:
+  ;   $1 type
+  ;   $2 hp
+  ;   $3 atk
+  ;   $4 shiled
+  ;   $5 moves
+  ;   $6 initiative
+  ;   $7 custom p0 value
+#macro act_def
+  .db $1 ; type
+  .db $2, $2 ; hp hp max
+  .db $3, $3 ; atk atk max
+  .db $4, $4 ; shiled shield max
+  .db $5, $5 ; moves moves max
+  .db $6 ; initiative
+  .db $7 ; p0
+#endmacro
 
   ; loads NULL into a 16 bit register
   ; inputs:
index 15d06c7b30cdbae454e0fa06563a693520a4a792..0662dd907f8135306f6bc2eb3e5a93fd17393f5b 100644 (file)
@@ -40,3 +40,6 @@ units_update:
   ret
 
 
+unit_demo_1:
+  st_def 0xFF, st_null_fn, st_null
+  act_def ACT_T_NULL, 1, 1, 1, 1, 1, 0