From 15e6a191e4f69f1dd08ffcb89f529b4889fe24a2 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Tue, 10 Jun 2025 20:41:11 +0200 Subject: [PATCH] unit: Added new stats --- src/defs.s | 18 ++++++++++++++---- src/macros.inc | 43 +++++++++++++++++++++++++++++-------------- src/unit.s | 9 ++++++--- 3 files changed, 49 insertions(+), 21 deletions(-) diff --git a/src/defs.s b/src/defs.s index a9121a6..6bc0c0f 100644 --- a/src/defs.s +++ b/src/defs.s @@ -113,7 +113,8 @@ ; to define an actor the following macros must be used in order ; st_def ; act_def - ; act_stat_def + ; act_stat_def1 + ; act_stat_def2 ; act_attr_def or act_attr_def_empty ; act_inventory_def or act_inventory_empty ; act_equipment_def or act_equipment_empty @@ -133,16 +134,25 @@ .de act_p0, 1 - ; stats + ; stats1 .de act_level, 1 .de act_hp, stat_size .de act_mp, stat_size +.de act_fatigue, stat_size .de act_ac, stat_size +.de act_moves, stat_size ; moves for each turn +.de act_init, 1 ; initiative value + + ; stats2 .de act_str, stat_size .de act_int, stat_size .de act_dex, stat_size -.de act_moves, stat_size ; moves for each turn -.de act_init, 1 ; initiative value +.de act_luck, stat_size +.de act_will, stat_size +.de act_charisma, stat_size +.de act_endurance, stat_size +.de act_speed, stat_size + ; attributes ; inventory diff --git a/src/macros.inc b/src/macros.inc index 5e3da34..2e0ddff 100644 --- a/src/macros.inc +++ b/src/macros.inc @@ -162,26 +162,41 @@ .db $5 ; p0 #endmacro - ; defines an actor's stats + ; defines an actor's stats (1/2) ; $1 level ; $2 health points ; $3 mana points - ; $4 armor - ; $5 str - ; $6 int - ; $7 dex - ; $8 moves - ; $9 initiative -#macro act_stat_def + ; $4 fatigue points + ; $5 armor + ; $6 moves + ; $7 initiative +#macro act_stat_def1 .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 + .db $4, $4 ; fatigue fatigue max + .db $5, $5 ; ac ac max + .db $6, $6 ; moves moves max + .db $7 ; initiative +#endmacro + + ; $1 str + ; $2 int + ; $3 dex + ; $4 luck + ; $5 willpower + ; $6 charisma + ; $7 endurance + ; $8 speed +#macro act_stat_def2 + .db $1, $1 ; str str max + .db $2, $2 ; int int max + .db $3, $3 ; dex dex max + .db $4, $4 ; luck luck max + .db $5, $5 ; will will max + .db $6, $6 ; char char max + .db $7, $7 ; endurance endurance max + .db $8, $8 ; speed speed max #endmacro ; defines actor state callbacks diff --git a/src/unit.s b/src/unit.s index 668ef1b..0de652a 100644 --- a/src/unit.s +++ b/src/unit.s @@ -801,7 +801,8 @@ 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, 1, 2, 3, 0, 0, 0, 4, 6 + act_stat_def1 1, 1, 1, 1, 1, 3, 3 + act_stat_def2 1, 1, 1, 1, 1, 1, 1, 1 act_attr_def_empty act_inventory_empty act_equipment_empty @@ -813,7 +814,8 @@ unit_demo_1: 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, 1, 2, 3, 0, 0, 0, 0, 5 + act_stat_def1 1, 1, 1, 1, 1, 0, 3 + act_stat_def2 1, 1, 1, 1, 1, 1, 1, 1 act_attr_def_empty act_inventory_empty act_equipment_empty @@ -825,7 +827,8 @@ unit_demo_2: 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, 1, 2, 3, 0, 0, 0, 4, 5 + act_stat_def1 1, 1, 1, 1, 1, 4, 5 + act_stat_def2 1, 1, 1, 1, 1, 1, 1, 1 act_attr_def_empty act_inventory_empty act_equipment_empty -- 2.30.2