From 16aa9d1db027cd85edc250599928ed5cdf25ce9b Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Wed, 16 Jul 2025 16:30:50 +0200 Subject: [PATCH] stats: cleaned up stats Replaced some stats with resistances --- TODO.md | 4 ++++ src/defs.s | 17 +++++++++-------- src/macros.inc | 26 +++++++------------------- src/player.s | 3 +-- src/unit_demo.s | 15 +++++---------- 5 files changed, 26 insertions(+), 39 deletions(-) diff --git a/TODO.md b/TODO.md index fc4f18a..b928605 100644 --- a/TODO.md +++ b/TODO.md @@ -47,6 +47,10 @@ [ ] Doors may be opened and can unveil more of the map [ ] Implement partial map redraws. Allow queueing up a map redraw which then is processed over several frames. Allow setting a start address, tiles per row and rows to redraw. +# Items + +[ ] Each item can have all stats either as a positive or negative effect +[ ] Each item can also increase or decrease attack damage ## Units diff --git a/src/defs.s b/src/defs.s index 3829502..439e30a 100644 --- a/src/defs.s +++ b/src/defs.s @@ -127,7 +127,6 @@ ; act_def ; act_stat_def1 ; act_stat_def2 - ; act_skill_def or act_skill_def_empty ; act_inventory_def or act_inventory_empty ; act_equipment_def or act_equipment_empty ; act_effects_def or act_effects_empty @@ -163,21 +162,23 @@ .de act_level, 1 .de act_hp, stat_size .de act_mp, stat_size -.de act_fatigue, stat_size .de act_ac, stat_size ; stats2 .de act_str, stat_size .de act_int, stat_size .de act_dex, stat_size + + ; increases chance to hit .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 - ; describes skills + ; resistances +.de act_poison_res, stat_size +.de act_fire_res, stat_size +.de act_lightning_res, stat_size + + ; decreases time between moves +.de act_speed, stat_size ; inventory ; stores items, for all actors but player diff --git a/src/macros.inc b/src/macros.inc index 6e2ec45..f21796d 100644 --- a/src/macros.inc +++ b/src/macros.inc @@ -192,32 +192,30 @@ ; $1 level ; $2 health points ; $3 mana points - ; $4 fatigue points ; $5 armor #macro act_stat_def1 .db $1 ; level .db $2 ; hp hp max .db $3 ; mp mp max - .db $4 ; fatigue fatigue max - .db $5 ; ac + .db $4 ; ac #endmacro ; $1 str ; $2 int ; $3 dex ; $4 luck - ; $5 willpower - ; $6 charisma - ; $7 endurance + ; $5 poison res + ; $6 fire res + ; $7 lightning res ; $8 speed #macro act_stat_def2 .db $1 ; str str max .db $2 ; int int max .db $3 ; dex dex max .db $4 ; luck luck max - .db $5 ; will will max - .db $6 ; char char max - .db $7 ; endurance endurance max + .db $5 ; poison resist + .db $6 ; fire resist + .db $7 ; lightning resist .db $8 ; speed speed max #endmacro @@ -235,16 +233,6 @@ #endmacro - ; defines an actors attributes - ; such as weapon skills -#macro act_skill_def -#endmacro - - ; default attributes -#macro act_skill_def_empty - act_skill_def -#endmacro - ; defines an actors inventory content #macro act_inventory_def #endmacro diff --git a/src/player.s b/src/player.s index be4b0f2..ff28877 100644 --- a/src/player.s +++ b/src/player.s @@ -197,9 +197,8 @@ map_exit_relative_adjust: unit_player: st_def 0x00, unit_player_init, st_unit_idle act_def ACT_T_DEMO_1, 0, 2, 2, 0 - act_stat_def1 1, 1, 1, 1, 1 + act_stat_def1 1, 1, 1, 1 act_stat_def2 1, 1, 1, 1, 1, 1, 1, 90 - act_skill_def_empty act_inventory_empty act_equipment_empty act_effects_empty diff --git a/src/unit_demo.s b/src/unit_demo.s index e1f5f9c..1d0318b 100644 --- a/src/unit_demo.s +++ b/src/unit_demo.s @@ -42,9 +42,8 @@ unit_demo_1_cpu_update_idle: 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_def1 1, 1, 1, 1, 1 + act_stat_def1 1, 1, 1, 1 act_stat_def2 1, 1, 1, 1, 1, 1, 1, 32 - act_skill_def_empty act_inventory_empty act_equipment_empty act_effects_empty @@ -54,9 +53,8 @@ unit_demo_2: unit_demo_warrior: st_def 0x00, unit_demo_1_init, st_unit_demo_1_cpu_update act_def ACT_T_DEMO_1, 0, 4, 4, 0 - act_stat_def1 1, 1, 1, 1, 1 + act_stat_def1 1, 1, 1, 1 act_stat_def2 1, 1, 1, 1, 1, 1, 1, 32 - act_skill_def_empty act_inventory_empty act_equipment_empty act_effects_empty @@ -66,9 +64,8 @@ unit_demo_warrior: unit_demo_mage: st_def 0x00, unit_demo_1_init, st_unit_demo_1_cpu_update act_def ACT_T_DEMO_1, 0, 4, 4, 0 - act_stat_def1 1, 1, 1, 1, 1 + act_stat_def1 1, 1, 1, 1 act_stat_def2 1, 1, 1, 1, 1, 1, 1, 32 - act_skill_def_empty act_inventory_empty act_equipment_empty act_effects_empty @@ -78,9 +75,8 @@ unit_demo_mage: unit_demo_thief: st_def 0x00, unit_demo_1_init, st_unit_demo_1_cpu_update act_def ACT_T_DEMO_1, 0, 4, 4, 0 - act_stat_def1 1, 1, 1, 1, 1 + act_stat_def1 1, 1, 1, 1 act_stat_def2 1, 1, 1, 1, 1, 1, 1, 32 - act_skill_def_empty act_inventory_empty act_equipment_empty act_effects_empty @@ -91,9 +87,8 @@ unit_demo_thief: unit_demo_priest: st_def 0x00, unit_demo_1_init, st_unit_demo_1_cpu_update act_def ACT_T_DEMO_1, 0, 4, 4, 0 - act_stat_def1 1, 1, 1, 1, 1 + act_stat_def1 1, 1, 1, 1 act_stat_def2 1, 1, 1, 1, 1, 1, 1, 32 - act_skill_def_empty act_inventory_empty act_equipment_empty act_effects_empty -- 2.30.2