diff --git a/include/extern.h b/include/extern.h index c502f82e9..1412f1a87 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1969,6 +1969,7 @@ E char FDECL(inside_shop, (XCHAR_P,XCHAR_P)); E void FDECL(u_left_shop, (char *,BOOLEAN_P)); E void FDECL(remote_burglary, (XCHAR_P,XCHAR_P)); E void FDECL(u_entered_shop, (char *)); +E void FDECL(pick_pick, (struct obj *)); E boolean FDECL(same_price, (struct obj *,struct obj *)); E void NDECL(shopper_financial_report); E int FDECL(inhishop, (struct monst *)); diff --git a/src/pickup.c b/src/pickup.c index b119efe7a..320efa849 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -1959,8 +1959,7 @@ register struct obj *obj; obj->oy = current_container->oy; addtobill(obj, FALSE, FALSE, FALSE); } - if (is_pick(obj) && !obj->unpaid && *u.ushops && shop_keeper(*u.ushops)) - verbalize("You sneaky cad! Get out of here with that pick!"); + if (is_pick(obj)) pick_pick(obj); /* shopkeeper feedback */ otmp = addinv(obj); loadlev = near_capacity(); @@ -2440,7 +2439,7 @@ dotip() struct obj *cobj, *nobj; coord cc; int boxes; - char c, buf[BUFSZ]; + char c, buf[BUFSZ], qbuf[BUFSZ]; const char *spillage = 0; /* @@ -2463,8 +2462,8 @@ dotip() nobj = cobj->nexthere; if (!Is_container(cobj)) continue; - Sprintf(buf, "There is %s here, tip it?", doname(cobj)); - c = ynq(buf); + c = ynq(safe_qbuf(qbuf, "There is ", " here, tip it?", + cobj, doname, ansimpleoname, "container")); if (c == 'q') return 0; if (c == 'n') continue; diff --git a/src/shk.c b/src/shk.c index 5c65d63a1..b9cf51ede 100644 --- a/src/shk.c +++ b/src/shk.c @@ -603,6 +603,26 @@ register char *enterstring; return; } +/* called when removing a pick-axe or mattock from a container */ +void +pick_pick(obj) +struct obj *obj; +{ + struct monst *shkp; + + if (obj->unpaid || !is_pick(obj)) return; + shkp = shop_keeper(*u.ushops); + if (shkp && inhishop(shkp) && !muteshk(shkp)) { + static NEARDATA long pickmovetime = 0L; + + /* if you bring a sack of N picks into a shop to sell, + don't repeat this N times when they're taken out */ + if (moves != pickmovetime) + verbalize("You sneaky cad! Get out of here with that pick!"); + pickmovetime = moves; + } +} + /* Decide whether two unpaid items are mergable; caller is responsible for making sure they're unpaid and the same type of object; we check the price @@ -2222,7 +2242,7 @@ boolean ininv, dummy, silent; costly_gold(obj->ox, obj->oy, obj->quan); return; } else if (ESHK(shkp)->billct == BILLSZ) { - You("got that for free!"); + if (!silent) You("got that for free!"); return; } @@ -2622,7 +2642,7 @@ xchar x, y; if (ANGRY(shkp)) { /* they become shop-objects, no pay */ if (!muteshk(shkp)) - pline("Thank you, scum!"); + verbalize("Thank you, scum!"); subfrombill(obj, shkp); return; }