From 1e0960f8ef2c6fe07a34a8646aeae4ba20e28030 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Sun, 5 Nov 2006 07:20:20 +0000 Subject: [PATCH] using unpaid horn of plenty (trunk only) Make objects created by applying or #tipping a horn of plenty which is owned by a shop also start out being owned by the shop. That's in addition to the usage charge for using an unpaid item. I think wishes conferred by unpaid objects, or by entities released from unpaid objects, should probably work that way too, but have left that alone. --- doc/fixes35.0 | 1 + src/mkobj.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 0b2e27463..73552e130 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -168,6 +168,7 @@ stop wielding cockatrice corpse which triggered own death followed by life-save format various prompts to avoid "Query truncated" entries in paniclog for inventory display, include cost info on hero-owned containers holding shop goods +shops now claim ownership of items created by using an unpaid horn of plenty Platform- and/or Interface-Specific Fixes diff --git a/src/mkobj.c b/src/mkobj.c index 0786fee26..5eea5b698 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -1826,6 +1826,14 @@ boolean tipping; /* caller emptying entire contents; affects shop handling */ obj->blessed = horn->blessed; obj->cursed = horn->cursed; obj->owt = weight(obj); + /* using a shop's horn of plenty entails a usage fee and also + confers ownership of the created item to the shopkeeper */ + if (carried(horn) ? horn->unpaid : + (costly_spot(u.ux, u.uy) && !horn->no_charge)) + addtobill(obj, FALSE, FALSE, tipping); + /* if it ended up on bill, we don't want "(unpaid, N zorkids)" + being included in its formatted name during next message */ + iflags.suppress_price++; if (!tipping) { obj = hold_another_object(obj, u.uswallow ? "Oops! %s out of your reach!" : @@ -1850,6 +1858,7 @@ boolean tipping; /* caller emptying entire contents; affects shop handling */ dropy(obj); } } + iflags.suppress_price--; if (horn->dknown) makeknown(HORN_OF_PLENTY); } return objcount;