From: Lukas Krickl Date: Mon, 22 Dec 2025 07:08:38 +0000 (+0100) Subject: items: Added damage type to items X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=f6c37f86ca1b9880a0f5d5533331a8b6ac1bbe69;p=gbrg%2F.git items: Added damage type to items --- diff --git a/src/actor.s b/src/actor.s index 8238362..8e13476 100644 --- a/src/actor.s +++ b/src/actor.s @@ -731,6 +731,7 @@ act_move_back: ; combat_src_act: ptr to source actor ; combat_dst_act: the target actor act_combat: + ret ; loads attribute table of an actor diff --git a/src/defs.s b/src/defs.s index 5ff9cd2..a0e455f 100644 --- a/src/defs.s +++ b/src/defs.s @@ -219,6 +219,15 @@ ; e.g. weapon attacks with bow .de ITEM_F_RANGE, 1 + ; item damage types + ; flags +.se 1 +.de ITEM_DT_PHYSICAL, 1 +.de ITEM_DT_POISON, 2 +.de ITEM_DT_FIRE, 4 +.de ITEM_DT_FROST, 8 +.de ITEM_DT_LIGHTNING, 16 + ; item struct .se 0 .de item_type, 1 @@ -227,11 +236,21 @@ .de item_damage, 1 ; proficiency mask needed to use the item .de item_prof, 1 + ; damage type of the item +.de item_damage_type, 1 ; bonus attributes provided by the item ; attr struct pointer .de item_attr, 2 .de item_size, 0 + ; combat res flags +.se 0 +.de COMBAT_RES_HIT, 1 +.de COMBAT_RES_MISS, 1 +.de COMBAT_RES_GLANCING_BLOW, 1 +.de COMBAT_RES_DODGE, 1 +.de COMBAT_RES_CRIT, 1 + ; combat struct .se 0 ; ptr sto source and dst actor @@ -244,5 +263,5 @@ .de combat_res_damage, 1 ; the attack type (e.g. critical, dodge, miss) ; if all flags are 0 == normal hit -.de combat_res_flags, 1 +.de combat_res_hit_type, 1 .de combat_size, 0 diff --git a/src/item.s b/src/item.s index 70c10bf..3348946 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 + itemdef 0, 0, 0, 0, 0, 0 diff --git a/src/macros.inc b/src/macros.inc index 6f71ef7..d587a13 100644 --- a/src/macros.inc +++ b/src/macros.inc @@ -219,8 +219,9 @@ $1: ; $2: flags ; $3: damage ; $4: prof mask - ; $5: attribute ptr (may be NULL) + ; $5: damage type + ; $6: attribute ptr (may be NULL) #macro itemdef - .db $1, $2, $3, $4 - dw $5 + .db $1, $2, $3, $4, $5 + dw $6 #endmacro