From: Lukas Krickl Date: Tue, 6 May 2025 14:34:44 +0000 (+0200) Subject: unit: Added act_def macro X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=ab225a9be08909cc0e22c48688c4ba18aa6539a3;p=gbrg%2F.git unit: Added act_def macro --- diff --git a/src/defs.s b/src/defs.s index f822ac2..db8778b 100644 --- a/src/defs.s +++ b/src/defs.s @@ -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 diff --git a/src/macros.inc b/src/macros.inc index caa533a..7858fa2 100644 --- a/src/macros.inc +++ b/src/macros.inc @@ -133,7 +133,27 @@ 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: diff --git a/src/unit.s b/src/unit.s index 15d06c7..0662dd9 100644 --- a/src/unit.s +++ b/src/unit.s @@ -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