From: Lukas Krickl Date: Thu, 17 Jul 2025 15:42:32 +0000 (+0200) Subject: stats: reworked stats X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=9b4f249c5efd8879a7cb77539cfd9d61a2b5f03c;p=gbrg%2F.git stats: reworked stats Removed a bunch of stats that are only derived from other stats and equipment. --- diff --git a/src/defs.s b/src/defs.s index d469462..ef3d711 100644 --- a/src/defs.s +++ b/src/defs.s @@ -165,23 +165,11 @@ .de act_ac, stat_size ; stats2 - ; str: increases health and heavy weapon damage - ; int: increases mana and spell damage - ; dex: increases dodge change and ranged/short weapon damage - ; hit: increases chance to hit - ; speed: decreases time between moves and attack speed - ; resistances: decrease how long a dot lasts and how much damage - ; is taken .de act_str, stat_size .de act_int, stat_size .de act_dex, stat_size - -.de act_hit, stat_size -.de act_poison_res, stat_size -.de act_fire_res, stat_size -.de act_lightning_res, stat_size -.de act_speed, stat_size +.de act_vit, stat_size diff --git a/src/macros.inc b/src/macros.inc index 7eb0e87..32b8cc8 100644 --- a/src/macros.inc +++ b/src/macros.inc @@ -203,20 +203,12 @@ ; $1 str ; $2 int ; $3 dex - ; $4 hit - ; $5 poison res - ; $6 fire res - ; $7 lightning res - ; $8 speed + ; $4 vit #macro act_stat_def2 - .db $1 ; str str max - .db $2 ; int int max - .db $3 ; dex dex max - .db $4 ; hit - .db $5 ; poison resist - .db $6 ; fire resist - .db $7 ; lightning resist - .db $8 ; speed speed max + .db $1 ; str + .db $2 ; int + .db $3 ; dex + .db $4 ; vit #endmacro ; defines actor state callbacks diff --git a/src/player.s b/src/player.s index ff28877..0ed1569 100644 --- a/src/player.s +++ b/src/player.s @@ -198,7 +198,7 @@ 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 - act_stat_def2 1, 1, 1, 1, 1, 1, 1, 90 + act_stat_def2 1, 1, 90, 1 act_inventory_empty act_equipment_empty act_effects_empty diff --git a/src/stats.s b/src/stats.s index 8f59cd6..965e78f 100644 --- a/src/stats.s +++ b/src/stats.s @@ -1,3 +1,22 @@ + ; main stats: + ; str: increases heavy weapon damage + ; increases heavy weapon speed + ; int: increases mana and spell damage + ; increases spell speed + ; dex: increases ranged/short weapon damage + ; increases ranged/short weapon speed + ; decreses time between moves and attack speed + ; vit: increases health + ; increases hit chance + + ; calculated stats based on gear/other stats: + ; hit: increases chance to hit + ; resistances: decrease how long a dot lasts and how much damage + ; is taken. + ; fire, lightning and poison resistance + ; health + ; mana + ; ac: armor value ; calculates the real strength stat ; inputs: @@ -13,7 +32,7 @@ stat_calc_str: ; returns: ; a: speed stat stat_calc_speed: - ld hl, act_speed + ld hl, act_dex add hl, de ; hl = speed stat ld a, [hl] ret diff --git a/src/unit_demo.s b/src/unit_demo.s index 1d0318b..1a5d51f 100644 --- a/src/unit_demo.s +++ b/src/unit_demo.s @@ -43,7 +43,7 @@ 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 - act_stat_def2 1, 1, 1, 1, 1, 1, 1, 32 + act_stat_def2 1, 1, 32, 1 act_inventory_empty act_equipment_empty act_effects_empty @@ -54,7 +54,7 @@ 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 - act_stat_def2 1, 1, 1, 1, 1, 1, 1, 32 + act_stat_def2 1, 1, 32, 1 act_inventory_empty act_equipment_empty act_effects_empty @@ -65,7 +65,7 @@ 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 - act_stat_def2 1, 1, 1, 1, 1, 1, 1, 32 + act_stat_def2 1, 1, 32, 1 act_inventory_empty act_equipment_empty act_effects_empty @@ -76,7 +76,7 @@ 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 - act_stat_def2 1, 1, 1, 1, 1, 1, 1, 32 + act_stat_def2 1, 1, 32, 1 act_inventory_empty act_equipment_empty act_effects_empty @@ -88,7 +88,7 @@ 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 - act_stat_def2 1, 1, 1, 1, 1, 1, 1, 32 + act_stat_def2 1, 1, 32, 1 act_inventory_empty act_equipment_empty act_effects_empty