unit: Added level and placeholders for dice display
authorLukas Krickl <lukas@krickl.dev>
Fri, 6 Jun 2025 04:06:30 +0000 (06:06 +0200)
committerLukas Krickl <lukas@krickl.dev>
Fri, 6 Jun 2025 04:06:30 +0000 (06:06 +0200)
src/defs.s
src/macros.inc
src/unit.s

index 29e9063fde9d7cf78c41c66f5760ef19815fb869..236bc4ee6ad96ec10acc9e1d858528f752c7a62d 100644 (file)
   ; act_effects_def or act_effects_empty
   ; act_st_def
   ; act_def_draw
+  ; act_rt_def
 .se 0
   ; copy of current state
 .de act_state, st_size
 
 
   ; stats
+.de act_level, 1
 .de act_hp, stat_size
 .de act_mp, stat_size
 .de act_ac, stat_size
 .de act_draw, 2
 .de act_oam_tile, 1
 .de act_oam_flags, 1
+
+  ; actor runtime values
+.de act_rt_dd_d16, 1 ; dice display value
+.de act_rt_dd_timer, 1
+.de act_rt_dd_flags, 1
+
 .de act_size, 0
   
   ; max bge queue size
index d65256aa62cf16bc486b5129334ca47c7a0f2a4d..71cc5f9bc6f764a5b59cb1495e1f7fc88be956c1 100644 (file)
 #endmacro
   
   ; defines an actor's stats
-  ;   $1 health points
-  ;   $2 mana points
-  ;   $3 armor
-  ;   $4 str
-  ;   $5 int
-  ;   $6 dex
-  ;   $7 moves
-  ;   $8 initiative
+  ;   $1 level
+  ;   $2 health points
+  ;   $3 mana points
+  ;   $4 armor
+  ;   $5 str
+  ;   $6 int
+  ;   $7 dex
+  ;   $8 moves
+  ;   $9 initiative
 #macro act_stat_def
-  .db $1, $1 ; hp hp max
-  .db $2, $2 ; mp mp max
-  .db $3, $3 ; ac ac max
-  .db $4, $4 ; str str max
-  .db $5, $5 ; int int max
-  .db $6, $6 ; dex dex max
-  .db $7, $7 ; moves moves max
-  .db $8 ; initiative
+  .db $1 ; level
+  .db $2, $2 ; hp hp max
+  .db $3, $3 ; mp mp max
+  .db $4, $4 ; ac ac max
+  .db $5, $5 ; str str max
+  .db $6, $6 ; int int max
+  .db $7, $7 ; dex dex max
+  .db $8, $8 ; moves moves max
+  .db $9 ; initiative
 #endmacro
 
   ; defines actor state callbacks
   dw $4
 #endmacro
 
+  ; defines default values for actor runtime values
+  ; these can generally not be set at build time
+#macro act_rt_def
+  .db 0, 0, 0 ; act_rt_dd_*
+#endmacro
+
   ; defines an actors inventory content
 #macro act_inventory_def
 #endmacro
index 3faf5cec8589ab29b05e81f07ba6957be9fa3f0c..bea03966c9faa3271726554d8d2d5e5c7725d4b0 100644 (file)
@@ -700,33 +700,35 @@ unit_dice_display_set:
 unit_demo_1:
   st_def 0x00, unit_demo_1_init, st_unit_idle
   act_def ACT_T_DEMO_1, 0, 2, 2, 0
-  act_stat_def 1, 2, 3, 0, 0, 0, 4, 6 
+  act_stat_def 1, 1, 2, 3, 0, 0, 0, 4, 6 
   act_inventory_empty
   act_equipment_empty
   act_effects_empty
   act_st_def NULL, NULL, st_unit_demo_1_update, st_unit_idle
   act_def_draw unit_draw, 0x84, 0
-
+  act_rt_def
 
 unit_demo_2:
   st_def 0x00, unit_demo_1_init, st_unit_idle
   act_def ACT_T_DEMO_1, 0, 3, 3, 0 
-  act_stat_def 1, 2, 3, 0, 0, 0, 0, 5  
+  act_stat_def 1, 1, 2, 3, 0, 0, 0, 0, 5  
   act_inventory_empty
   act_equipment_empty
   act_effects_empty
   act_st_def NULL, NULL, st_unit_demo_1_update, st_unit_idle
   act_def_draw unit_draw, 0x84, 0
+  act_rt_def
 
 unit_demo_3:
   st_def 0x00, unit_demo_1_init, st_unit_idle
   act_def ACT_T_DEMO_1, 0, 4, 4, 0 
-  act_stat_def 1, 2, 3, 0, 0, 0, 4, 5 
+  act_stat_def 1, 1, 2, 3, 0, 0, 0, 4, 5 
   act_inventory_empty
   act_equipment_empty
   act_effects_empty
   act_st_def NULL, NULL, st_unit_demo_1_update, st_unit_idle
   act_def_draw unit_draw, 0x84, 0
+  act_rt_def
 
 st_unit_demo_1_update:
   st_def 0x00, unit_demo_1_update, st_unit_demo_1_update