shopkeeper vs boulder

Noticed when testing boulder pushing into/out of shops yesterday:
a shopkeeper can "mutter incantations" and fracture a boulder in the
shop, transforming it to rocks.  If hero owed shk for the boulder
(happens when it has been further inside the shop and then gets pushed
to the shop's free spot), it would disappear from the shop's bill and
hero would then owe for the resulting rocks (which cost more than the
boulder!).  That seemed confusing, especially since neither Iu nor Ix
would show the rocks (which are on the floor rather than in invent;
the $ command reported the amount owed, but not what the item was).

When such fracturing happens move the boulder from the unpaid section
of the shop bill to the used-up section before creating the rocks,
which are no longer interesting.
This commit is contained in:
PatR
2024-09-04 13:22:14 -07:00
parent bd10bf36ec
commit 447da0948f
3 changed files with 12 additions and 1 deletions

View File

@@ -1162,6 +1162,8 @@ prevent hug attacks and touch or engulf attacks for wrap, stick-to, and
vortices, a few others) or against worm tails
wand of speed gives temporary speed, potion gives intrinsic
some monsters (riders, shopkeepers, priests, quest leader) can break boulders
if hero owes shop for a boulder and shopkeeper breaks it, continue to bill hero
for the boulder rather than switching to the resulting rocks
corpse-eating monsters will go out of their way to eat corpses on the floor
warnings via impossible() would be unseen if message suppression via ESC at
--More-- prompt was in effect

View File

@@ -159,6 +159,15 @@ m_break_boulder(struct monst *mtmp, coordxy x, coordxy y)
set_msg_xy(x, y);
pline_The("boulder falls apart.");
}
/* boulders pushed onto shop's boundary or free spot are cases where
an item not in hero's inventory can have its unpaid flag set;
if the boulder isn't already on the bill, don't charge for it */
if (otmp->unpaid) {
/* remove original from bill and add cloned copy to used-up bill */
bill_dummy_object(otmp);
}
/* fracturing keeps otmp, changing its otyp from BOULDER to ROCK */
fracture_rock(otmp);
}
}

View File

@@ -5416,7 +5416,7 @@ mon_spell_hits_spot(
}
}
/* fractured by pick-axe or wand of striking or by vault guard */
/* fractured by pick-axe or wand of striking or by vault guard or shopkeeper */
void
fracture_rock(struct obj *obj) /* no texts here! */
{