From e0e3bf24538bd653b16ec9407c749cf12ee8ae93 Mon Sep 17 00:00:00 2001 From: "nethack.allison" Date: Wed, 10 May 2006 03:31:53 +0000 Subject: [PATCH] selling candelabrum in lighting store wrote: > * You can't sell a candelabrum (with candles attached) to a lighting store. You still can't sell the candelabrum after this, but acknowledge the situation by having Izchak say something unique. --- src/shk.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/shk.c b/src/shk.c index cff645b83..2354299a7 100644 --- a/src/shk.c +++ b/src/shk.c @@ -65,6 +65,7 @@ STATIC_DCL void FDECL(add_to_billobjs, (struct obj *)); STATIC_DCL void FDECL(bill_box_content, (struct obj *, BOOLEAN_P, BOOLEAN_P, struct monst *)); STATIC_DCL boolean FDECL(rob_shop, (struct monst *)); +STATIC_DCL boolean FDECL(special_stock, (struct obj *, struct monst *, BOOLEAN_P)); /* invariants: obj->unpaid iff onbill(obj) [unless bp->useup] @@ -1971,6 +1972,27 @@ register struct obj *obj; } } +STATIC_OVL boolean +special_stock(obj, shkp, quietly) +struct obj *obj; +struct monst *shkp; +boolean quietly; +{ + /* for unique situations */ + if ((strcmp(shkname(shkp), "Izchak") == 0) && + obj->otyp == CANDELABRUM_OF_INVOCATION) { + if (!quietly) { + if (!u.uevent.invoked) + verbalize( + "No thanks, I'd hang onto that if I were you."); + else + verbalize("Take that out of here!"); + } + return TRUE; + } + return FALSE; +} + /* calculate how much the shk will pay when buying [all of] an object */ STATIC_OVL long set_cost(obj, shkp) @@ -2558,7 +2580,8 @@ xchar x, y; subfrombill(obj, shkp); } else obj->no_charge = 1; - if(!unpaid && (sell_how != SELL_DONTSELL)) + if(!unpaid && (sell_how != SELL_DONTSELL) && + !special_stock(obj, shkp, FALSE)) pline("%s seems uninterested.", Monnam(shkp)); return; } -- 2.40.0