candelabrum weight and burn out

Adjust the Candelabrum of Invocation's weight when it has candles
attached.  This has been a known issue ever since the candelabrum and
candles were introduced.

When the candelabrum burns out, update persistent inventory window to
show that it no longer has candles.
This commit is contained in:
PatR
2017-09-25 13:20:30 -07:00
parent a69e4d4ec4
commit 26dd891038
5 changed files with 31 additions and 10 deletions

View File

@@ -1339,7 +1339,7 @@ int
weight(obj)
register struct obj *obj;
{
int wt = objects[obj->otyp].oc_weight;
int wt = (int) objects[obj->otyp].oc_weight;
/* glob absorpsion means that merging globs accumulates weight while
quantity stays 1, so update 'wt' to reflect that, unless owt is 0,
@@ -1390,6 +1390,8 @@ register struct obj *obj;
return (int) ((obj->quan + 50L) / 100L);
} else if (obj->otyp == HEAVY_IRON_BALL && obj->owt != 0) {
return (int) obj->owt; /* kludge for "very" heavy iron ball */
} else if (obj->otyp == CANDELABRUM_OF_INVOCATION && obj->spe) {
return wt + obj->spe * (int) objects[TALLOW_CANDLE].oc_weight;
}
return (wt ? wt * (int) obj->quan : ((int) obj->quan + 1) >> 1);
}