items: Added damage type to items
authorLukas Krickl <lukas@krickl.dev>
Mon, 22 Dec 2025 07:08:38 +0000 (08:08 +0100)
committerLukas Krickl <lukas@krickl.dev>
Mon, 22 Dec 2025 07:08:38 +0000 (08:08 +0100)
src/actor.s
src/defs.s
src/item.s
src/macros.inc

index 8238362667b15254b20e8cce317ea2a2d9bd1a69..8e13476cd041e0c89f00ab21f76fd847da9bace5 100644 (file)
@@ -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 
index 5ff9cd2b763ccfa3c5a5c057b59094a2a3236240..a0e455fe949429fb3e2e29b73681a903ddba7ae0 100644 (file)
        ; 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
 .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
 .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
index 70c10bfbbc6f6ee7b7cc19b75f5a0008693ea7df..334894650ec5c758507da1554f706a49eb53ceea 100644 (file)
@@ -8,4 +8,4 @@ items_ring:
        dw null_item
 
 null_item:
-       itemdef 0, 0, 0, 0, 0
+       itemdef 0, 0, 0, 0, 0, 0
index 6f71ef7e2545e76a2ea1fef904ea196cfd3ffbea..d587a13e426437ae28b6c68b6a3eca2033305408 100644 (file)
@@ -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