From: Lukas Krickl Date: Sat, 17 Jan 2026 07:46:32 +0000 (+0100) Subject: stats: stamina is now a stat X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=e8c9fa1d16163e60289baf66f8685b89bbea747b;p=gbrg%2F.git stats: stamina is now a stat Added item proficency as a stat requirement Removed proficency mask --- diff --git a/src/defs.s b/src/defs.s index 6e3926a..c203e6b 100644 --- a/src/defs.s +++ b/src/defs.s @@ -188,9 +188,6 @@ ; resistances are 2 bit values ; see resistance masks .de attr_res, 1 - ; proficiency are 1 bit values - ; see proficency masks -.de attr_prof, 1 .de attr_size, 0 ; resistance masks @@ -199,16 +196,6 @@ .def int ATTR_RES_FROST = 0b00001100 .def int ATTR_RES_LIGHTNING = 0b00000011 - ; proficiency masks -.def int ATTR_PROF_HEAVY_ARMOR = 0b10000000 -.def int ATTR_PROF_LIGHT_ARMOR = 0b01000000 -.def int ATTR_PROF_SHORT_BLADE = 0b00100000 -.def int ATTR_PROF_LONG_BLADE = 0b00010000 -.def int ATTR_PROF_BOW = 0b00001000 -.def int ATTR_PROF_AXE = 0b00000100 -.def int ATTR_PROF_MACE = 0b00000010 -.def int ATTR_PROF_MAGIC = 0b00000001 - .def int ITEM_NONE = 0 ; armor types @@ -241,14 +228,24 @@ .de ITEM_DT_FROST, 8 .de ITEM_DT_LIGHTNING, 16 + ; item proficency stat type +.se 0 +.de ITEM_ATTR_STR, 1 +.de ITEM_ATTR_AGI, 1 +.de ITEM_ATTR_WIS, 1 +.de ITEM_ATTR_STAM, 1 + ; item struct .se 0 .de item_type, 1 .de item_flags, 1 ; used for weapon damage .de item_damage, 1 - ; proficiency mask needed to use the item -.de item_prof, 1 + ; proficiency in attribute mask needed to use the item + ; byte 1: stat type + ; byte 2: minimum required +.de item_prof_stat, 1 +.de item_prof_value, 1 ; damage type of the item .de item_damage_type, 1 ; bonus attributes provided by the item diff --git a/src/item.s b/src/item.s index 3348946..b2fcc7f 100644 --- a/src/item.s +++ b/src/item.s @@ -8,4 +8,4 @@ items_ring: dw null_item null_item: - itemdef 0, 0, 0, 0, 0, 0 + itemdef 0, 0, 0, ITEM_ATTR_STR, 0, 0 diff --git a/src/macros.inc b/src/macros.inc index ef24e39..91c22d6 100644 --- a/src/macros.inc +++ b/src/macros.inc @@ -217,8 +217,8 @@ $1: ; $1: strength ; $2: agility ; $3: wisdom - ; $4: resistances - ; $5: proficiency + ; $4: stamina + ; $5: resistances #macro attrdef .db $1, $2, $3, $4, $5 #endmacro @@ -228,9 +228,10 @@ $1: ; $1: type ; $2: flags ; $3: damage - ; $4: prof mask - ; $5: damage type - ; $6: attribute ptr (may be NULL) + ; $5: proficency attribute + ; $6: proficency attribute value + ; $7: damage type + ; $8: attribute ptr (may be NULL) #macro itemdef .db $1, $2, $3, $4, $5 dw $6 diff --git a/src/player.s b/src/player.s index ac71ae1..97eafe4 100644 --- a/src/player.s +++ b/src/player.s @@ -116,8 +116,8 @@ player_handle_move: call act_move_to cp a, 0 - jp z, player_moved - jp player_collided + call z, player_moved + call player_collided @not_left: ld b, DIRRIGHT @@ -134,8 +134,8 @@ player_handle_move: call act_move_to cp a, 0 - jp z, player_moved - jp player_collided + call z, player_moved + call player_collided @not_right: ld b, DIRUP @@ -152,8 +152,8 @@ player_handle_move: call act_move_to cp a, 0 - jp z, player_moved - jp player_collided + call z, player_moved + call player_collided @not_up: ld b, DIRDOWN @@ -170,8 +170,8 @@ player_handle_move: call act_move_to cp a, 0 - jp z, player_moved - jp player_collided + call z, player_moved + call player_collided @not_down: ret