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:
@@ -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(u_left_shop, (char *,BOOLEAN_P));
|
||||||
E void FDECL(remote_burglary, (XCHAR_P,XCHAR_P));
|
E void FDECL(remote_burglary, (XCHAR_P,XCHAR_P));
|
||||||
E void FDECL(u_entered_shop, (char *));
|
E void FDECL(u_entered_shop, (char *));
|
||||||
|
E void FDECL(pick_pick, (struct obj *));
|
||||||
E boolean FDECL(same_price, (struct obj *,struct obj *));
|
E boolean FDECL(same_price, (struct obj *,struct obj *));
|
||||||
E void NDECL(shopper_financial_report);
|
E void NDECL(shopper_financial_report);
|
||||||
E int FDECL(inhishop, (struct monst *));
|
E int FDECL(inhishop, (struct monst *));
|
||||||
|
|||||||
@@ -1959,8 +1959,7 @@ register struct obj *obj;
|
|||||||
obj->oy = current_container->oy;
|
obj->oy = current_container->oy;
|
||||||
addtobill(obj, FALSE, FALSE, FALSE);
|
addtobill(obj, FALSE, FALSE, FALSE);
|
||||||
}
|
}
|
||||||
if (is_pick(obj) && !obj->unpaid && *u.ushops && shop_keeper(*u.ushops))
|
if (is_pick(obj)) pick_pick(obj); /* shopkeeper feedback */
|
||||||
verbalize("You sneaky cad! Get out of here with that pick!");
|
|
||||||
|
|
||||||
otmp = addinv(obj);
|
otmp = addinv(obj);
|
||||||
loadlev = near_capacity();
|
loadlev = near_capacity();
|
||||||
@@ -2440,7 +2439,7 @@ dotip()
|
|||||||
struct obj *cobj, *nobj;
|
struct obj *cobj, *nobj;
|
||||||
coord cc;
|
coord cc;
|
||||||
int boxes;
|
int boxes;
|
||||||
char c, buf[BUFSZ];
|
char c, buf[BUFSZ], qbuf[BUFSZ];
|
||||||
const char *spillage = 0;
|
const char *spillage = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -2463,8 +2462,8 @@ dotip()
|
|||||||
nobj = cobj->nexthere;
|
nobj = cobj->nexthere;
|
||||||
if (!Is_container(cobj)) continue;
|
if (!Is_container(cobj)) continue;
|
||||||
|
|
||||||
Sprintf(buf, "There is %s here, tip it?", doname(cobj));
|
c = ynq(safe_qbuf(qbuf, "There is ", " here, tip it?",
|
||||||
c = ynq(buf);
|
cobj, doname, ansimpleoname, "container"));
|
||||||
if (c == 'q') return 0;
|
if (c == 'q') return 0;
|
||||||
if (c == 'n') continue;
|
if (c == 'n') continue;
|
||||||
|
|
||||||
|
|||||||
24
src/shk.c
24
src/shk.c
@@ -603,6 +603,26 @@ register char *enterstring;
|
|||||||
return;
|
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
|
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
|
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);
|
costly_gold(obj->ox, obj->oy, obj->quan);
|
||||||
return;
|
return;
|
||||||
} else if (ESHK(shkp)->billct == BILLSZ) {
|
} else if (ESHK(shkp)->billct == BILLSZ) {
|
||||||
You("got that for free!");
|
if (!silent) You("got that for free!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2622,7 +2642,7 @@ xchar x, y;
|
|||||||
|
|
||||||
if (ANGRY(shkp)) { /* they become shop-objects, no pay */
|
if (ANGRY(shkp)) { /* they become shop-objects, no pay */
|
||||||
if (!muteshk(shkp))
|
if (!muteshk(shkp))
|
||||||
pline("Thank you, scum!");
|
verbalize("Thank you, scum!");
|
||||||
subfrombill(obj, shkp);
|
subfrombill(obj, shkp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user