shopkeeper feedback (trunk only)

Use verbalize instead of pline for shop "thank you, scum" message
(From a bug report.  Suppress shop "you sneaky cad" message
when removing a hero-owned pick-axe from a container inside a shop if the
shk is unable to speak; also give it at most one time per move (taking
multiple pick-axes out of a bag at once was way too verbose).  Honor
addtobill's silent flag for the bill overflow message when/if that occurs.

     Also adds a safe_qbuf usage for the #tip command that I had pending
for pickup.c.
This commit is contained in:
nethack.rankin
2006-11-07 02:49:09 +00:00
parent 1e0960f8ef
commit 0a7c5d6ad2
3 changed files with 27 additions and 7 deletions

View File

@@ -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;
}