Skip to content

Commit

Permalink
Fix issues with burden property. The weight wasn't calculated correct…
Browse files Browse the repository at this point in the history
…ly 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.
  • Loading branch information
elunna committed Oct 26, 2023
1 parent 537f8fb commit 3e93116
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
6 changes: 3 additions & 3 deletions include/obj.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions src/artifact.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
2 changes: 1 addition & 1 deletion src/mkobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
6 changes: 5 additions & 1 deletion src/objnam.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 2 additions & 0 deletions src/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -4340,5 +4340,7 @@ struct obj *otmp;
}
set_wear(otmp);
}
/* Handle burden property */
otmp->owt = weight(otmp);
}
/*read.c*/

0 comments on commit 3e93116

Please sign in to comment.