From 51bf2ed8b26bccf5251719818d498eb478b5f469 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Sat, 20 Dec 2025 07:21:36 +0100 Subject: [PATCH] actor: Added proficiency and item equipment slots --- src/attributes.s | 4 ++-- src/defs.s | 21 +++++++++++++++++++++ src/levels.s | 4 ++-- src/macros.inc | 7 ++++++- 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/src/attributes.s b/src/attributes.s index 1b25463..2f84a9a 100644 --- a/src/attributes.s +++ b/src/attributes.s @@ -6,7 +6,7 @@ act_attr_table: dw attr_bat attr_null: -attrdef 0, 0, 0, 0, 0 +attrdef 0, 0, 0, 0, 0, 0 attr_bat: -attrdef 1, 0, 0, 1, 0 +attrdef 1, 0, 0, 1, 0, 0 diff --git a/src/defs.s b/src/defs.s index 89c17c8..ef87af2 100644 --- a/src/defs.s +++ b/src/defs.s @@ -70,6 +70,12 @@ ; NNNN0000: debuff status ; 0000NNNN: debuff type .de act_debuff, 1 + ; item ids for each slot + ; each slot type has its own table + ; of items +.de act_armor, 1 +.de act_ring, 1 +.de act_weapon, 1 .de act_size, 0 @@ -167,6 +173,9 @@ ; 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 @@ -174,3 +183,15 @@ .def int ATTR_RES_FIRE = 0b00110000 .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 diff --git a/src/levels.s b/src/levels.s index 87a1d2a..e65f1e7 100644 --- a/src/levels.s +++ b/src/levels.s @@ -14,8 +14,8 @@ l1: ; l1 actor table l1_acts: - actdef ACT_T_BAT, 0, 4, 6, 2, 1 - actdef ACT_T_BAT, 0, 0, 2, 2, 1 + actdef ACT_T_BAT, 0, 4, 6, 2, 1, ITEM_NONE, ITEM_NONE, ITEM_NONE + actdef ACT_T_BAT, 0, 0, 2, 2, 1, ITEM_NONE, ITEM_NONE, ITEM_NONE .db 0 ; terminate diff --git a/src/macros.inc b/src/macros.inc index 16a57d5..cc1a6b3 100644 --- a/src/macros.inc +++ b/src/macros.inc @@ -185,6 +185,9 @@ $1: ; $4: x ; $5: hp ; $6: mp + ; $7: armor + ; $8: ring + ; $9: weapon #macro actdef .db $1, $2, $3, $4 ; dir, p0 and state @@ -193,6 +196,7 @@ $1: dw $6 ; buff/debuff .db 0, 0 + .db $7, $8, $9 #endmacro ; defines an attribute list @@ -202,6 +206,7 @@ $1: ; $3: wisdom ; $4: stamina ; $5: resistances + ; $6: proficiency #macro attrdef - .db $1, $2, $3, $4, $5 + .db $1, $2, $3, $4, $5, $6 #endmacro -- 2.30.2