From 3e9311628001552a8c8f1cb2586ee537a36bd861 Mon Sep 17 00:00:00 2001 From: Erik Lunna Date: Thu, 26 Oct 2023 06:47:14 +0200 Subject: [PATCH] Fix issues with burden property. The weight wasn't calculated correctly when an item was transmogrified or had the property added. I doubled the weight penalty to 8x, 4x just didn't seem enough for ordinary items like helmets. I also removed this as an eligible property for rings since it wouldn't have much effect. --- include/obj.h | 6 +++--- src/artifact.c | 4 ++++ src/mkobj.c | 2 +- src/objnam.c | 6 +++++- src/read.c | 2 ++ 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/include/obj.h b/include/obj.h index efff0776d..c9762f65d 100644 --- a/include/obj.h +++ b/include/obj.h @@ -634,11 +634,11 @@ struct obj { /* Positive properties */ #define ITEM_GOOD_PROPS (ITEM_OILSKIN | ITEM_ESP | ITEM_SEARCH \ | ITEM_VIGIL | ITEM_EXCEL | ITEM_SUSTAIN \ - | ITEM_STEALTH | ITEM_INSIGHT | ITEM_BURDEN \ - | ITEM_SURF | ITEM_SWIM | ITEM_RAGE | ITEM_TOUGH) + | ITEM_STEALTH | ITEM_INSIGHT | ITEM_SURF \ + | ITEM_SWIM | ITEM_RAGE | ITEM_TOUGH) /* Negative properties */ #define ITEM_BAD_PROPS (ITEM_FUMBLE | ITEM_HUNGER | ITEM_STENCH \ - | ITEM_TELE | ITEM_SLOW | ITEM_DANGER) + | ITEM_TELE | ITEM_SLOW | ITEM_DANGER | ITEM_BURDEN) #define NON_WEP_PROPS (ITEM_FLEX) #define ONLY_WEP_PROPS (ITEM_RAGE | ITEM_PROWESS) diff --git a/src/artifact.c b/src/artifact.c index 352bc774b..6ca99d9b9 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -474,6 +474,10 @@ boolean allow_detrimental; && (j & ONLY_WEP_PROPS)) continue; + /* Burden doesn't really affect ring weight much */ + if (otmp->oclass == RING_CLASS && j & ITEM_BURDEN) + continue; + if ((otmp->oprops & ITEM_RES_PROPS) && (j & ITEM_RES_PROPS)) continue; /* these are mutually exclusive */ diff --git a/src/mkobj.c b/src/mkobj.c index e759368c8..021ba6af8 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -1841,7 +1841,7 @@ register struct obj *obj; /* Items with burden property */ if (obj->oprops & ITEM_BURDEN) - wt *= 4; + wt *= 8; return (wt ? wt * (int) obj->quan : ((int) obj->quan + 1) >> 1); } diff --git a/src/objnam.c b/src/objnam.c index c83ca1124..5a8af41d5 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -5440,7 +5440,11 @@ struct obj *no_wish; if (otmp->oclass == ARMOR_CLASS || otmp->oclass == RING_CLASS) objprops &= ~ONLY_WEP_PROPS; - + + /* Burden doesn't really affect ring weight much */ + if (otmp->oclass == RING_CLASS) + objprops &= ~ITEM_BURDEN; + objprops = rm_redundant_oprops(otmp, objprops); /* The player cannot wish for properties */ diff --git a/src/read.c b/src/read.c index 5d4269c23..646e4008c 100644 --- a/src/read.c +++ b/src/read.c @@ -4340,5 +4340,7 @@ struct obj *otmp; } set_wear(otmp); } + /* Handle burden property */ + otmp->owt = weight(otmp); } /*read.c*/