; 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
.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
.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
dw null_item
null_item:
- itemdef 0, 0, 0, 0, 0, 0
+ itemdef 0, 0, 0, ITEM_ATTR_STR, 0, 0
; $1: strength
; $2: agility
; $3: wisdom
- ; $4: resistances
- ; $5: proficiency
+ ; $4: stamina
+ ; $5: resistances
#macro attrdef
.db $1, $2, $3, $4, $5
#endmacro
; $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