From: Lukas Krickl Date: Sat, 20 Dec 2025 07:18:45 +0000 (+0100) Subject: defs: Added item struct X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=93607c83db21773ae990665df48f8a93c78204be;p=gbrg%2F.git defs: Added item struct --- diff --git a/src/defs.s b/src/defs.s index ef87af2..0b7037a 100644 --- a/src/defs.s +++ b/src/defs.s @@ -195,3 +195,30 @@ .def int ATTR_PROF_MAGIC = 0b00000001 .def int ITEM_NONE = 0 + + ; armor types +.se 0 +.de ARMOR_NULL, 1 + + ; weapon type +.se 0 +.de WEPAON_NULL, 1 + + ; ring type +.se 0 +.de RING_NULL, 1 + + ; ring type +.se 0 + + ; item struct +.se 0 +.de item_type, 1 + ; used for weapon damage +.de item_damage, 1 + ; proficiency mask needed to use the item +.de item_prof, 1 + ; bonus attributes provided by the item + ; attr struct pointer +.de item_attr, 2 +.de item_size, 0 diff --git a/src/item.s b/src/item.s new file mode 100644 index 0000000..b3d1b31 --- /dev/null +++ b/src/item.s @@ -0,0 +1,11 @@ +items_weapons: + dw null_item + +items_armor: + dw null_item + +items_ring: + dw null_item + +null_item: + itemdef 0, 0, 0, 0 diff --git a/src/macros.inc b/src/macros.inc index cc1a6b3..9450519 100644 --- a/src/macros.inc +++ b/src/macros.inc @@ -210,3 +210,14 @@ $1: #macro attrdef .db $1, $2, $3, $4, $5, $6 #endmacro + + ; defines an item + ; inputs: + ; $1: type + ; $2: damage + ; $3: prof mask + ; $4: attribute ptr (may be NULL) +#macro itemdef + .db $1, $2, $3 + dw $4 +#endmacro diff --git a/src/main.s b/src/main.s index 321a571..3884c34 100644 --- a/src/main.s +++ b/src/main.s @@ -69,6 +69,7 @@ main: #include "tiles.s" #include "levels.s" #include "attributes.s" +#include "item.s" #include "tiles.inc" #include "text.s"