From 7487832860f53b942491ab1f1bcf358c5d80b164 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Sat, 22 Nov 2025 17:01:37 +0100 Subject: [PATCH] actors: Added combat stats ptr --- src/actor.s | 8 +++++++- src/defs.s | 14 ++++++++++++++ src/macros.inc | 16 ++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/src/actor.s b/src/actor.s index 0072e63..74bf10e 100644 --- a/src/actor.s +++ b/src/actor.s @@ -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 diff --git a/src/defs.s b/src/defs.s index a060990..8af9aa4 100644 --- a/src/defs.s +++ b/src/defs.s @@ -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 @@ -50,7 +51,20 @@ .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 diff --git a/src/macros.inc b/src/macros.inc index c8324a5..18621d7 100644 --- a/src/macros.inc +++ b/src/macros.inc @@ -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 -- 2.30.2