actors: Added combat stats ptr
authorLukas Krickl <lukas@krickl.dev>
Sat, 22 Nov 2025 16:01:37 +0000 (17:01 +0100)
committerLukas Krickl <lukas@krickl.dev>
Sat, 22 Nov 2025 16:01:37 +0000 (17:01 +0100)
src/actor.s
src/defs.s
src/macros.inc

index 0072e63516b541bcb743aebfc8eb57bc310abd3e..74bf10ed962ea0da8dd16950955e2a3e3d1088e0 100644 (file)
@@ -29,4 +29,10 @@ actors_combat_update:
        ret
 
 act_shop_keeper:
-       actdef ACT_T_SHOP_KEEPER, 0, 10, 10, 0, 0
+       actdef ACT_T_SHOP_KEEPER, 0, 10, 10, 0, 0, NULL
+
+act_bat:
+       actdef ACT_T_BAT, 0, 10, 10, 0, 0, act_bat_cb
+
+act_bat_cb:
+       actcbdef 1, 1, 1, 2, 0
index a06099092bae52a39817e7377cfb2f0910e048bf..8af9aa412cf7d8714cf2bdfff68fc16067a022aa 100644 (file)
@@ -36,6 +36,7 @@
 .de ACT_T_NULL, 1
 .de ACT_T_PLAYER, 1
 .de ACT_T_SHOP_KEEPER, 1
+.de ACT_T_BAT, 1
        
        ; actor struct 
   ; act_def
 .de act_state, 1
 .de act_hp, 1
 .de act_mp, 1
+.de act_cb, 2
 .de act_size, 0
+
+       ; actor combat stats struct
+       ; this can be shared by many actors
+.se 0
+.de act_cb_lvl, 1
+.de act_cb_exp, 2
+.de act_cb_atk, 1
+.de act_cb_def, 1
+.de act_cb_hp_max, 1
+.de act_cb_mp_max, 1
+.de act_cb_size, 0
+
   
 
   ; map header struct
index c8324a5067e3855ed424bef67fdbc97b3f1a85ed..18621d78f0de9d3d9f5b07390f8d1539ae4c8e40 100644 (file)
@@ -187,9 +187,25 @@ $1:
        ;               $4: x
        ;               $5: hp
        ;               $6: mp
+       ;               $7: combat stats ptr (or NULL)
 #macro actdef
        .db $1, $2, $3, $4
        ; p0 and state
        .db 0, 0 
        .db $5, $6
+       .db $7
+#endmacro
+
+       ; defines combat stats
+       ; inputs:
+       ;               $1: lvl
+       ;               $2: atk
+       ;               $3: def
+       ;               $4: hp max
+       ;               $5: mp max
+#macro actcbdef
+       .db $1, $2, $2
+       ; exp
+       .db 0, 0
+       .db $4, $5
 #endmacro