MCPcopy Create free account
hub / github.com/NetHack/NetHack / shk_chat

Function shk_chat

src/shk.c:5520–5601  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5518};
5519
5520void
5521shk_chat(struct monst *shkp)
5522{
5523 struct eshk *eshk;
5524 long shkmoney;
5525
5526 if (!shkp->isshk) {
5527 /* The monster type is shopkeeper, but this monster is
5528 not actually a shk, which could happen if someone
5529 wishes for a shopkeeper statue and then animates it.
5530 (Note: shkname() would be "" in a case like this.) */
5531 pline("%s asks whether you've seen any untended shops recently.",
5532 Monnam(shkp));
5533 /* [Perhaps we ought to check whether this conversation
5534 is taking place inside an untended shop, but a shopless
5535 shk can probably be expected to be rather disoriented.] */
5536 return;
5537 }
5538
5539 eshk = ESHK(shkp);
5540 if (ANGRY(shkp)) {
5541 pline("%s %s how much %s dislikes %s customers.",
5542 Shknam(shkp),
5543 (!Deaf && !muteshk(shkp)) ? "mentions" : "indicates",
5544 noit_mhe(shkp), eshk->robbed ? "non-paying" : "rude");
5545 } else if (eshk->following) {
5546 if (strncmp(eshk->customer, svp.plname, PL_NSIZ)) {
5547 if (!Deaf && !muteshk(shkp)) {
5548 SetVoice(shkp, 0, 80, 0);
5549 verbalize("%s %s! I was looking for %s.",
5550 Hello(shkp), svp.plname, eshk->customer);
5551 }
5552 eshk->following = 0;
5553 } else {
5554 if (!Deaf && !muteshk(shkp)) {
5555 SetVoice(shkp, 0, 80, 0);
5556 verbalize("%s %s! Didn't you forget to pay?",
5557 Hello(shkp), svp.plname);
5558 } else {
5559 pline("%s taps you on the %s.",
5560 Shknam(shkp), body_part(ARM));
5561 }
5562 }
5563 } else if (eshk->billct) {
5564 long total = addupbill(shkp) + eshk->debit;
5565
5566 pline("%s %s that your bill comes to %ld %s.",
5567 Shknam(shkp),
5568 (!Deaf && !muteshk(shkp)) ? "says" : "indicates",
5569 total, currency(total));
5570 } else if (eshk->debit) {
5571 pline("%s %s that you owe %s %ld %s.",
5572 Shknam(shkp),
5573 (!Deaf && !muteshk(shkp)) ? "reminds you" : "indicates",
5574 noit_mhim(shkp), eshk->debit, currency(eshk->debit));
5575 } else if (eshk->credit) {
5576 pline("%s encourages you to use your %ld %s of credit.",
5577 Shknam(shkp), eshk->credit, currency(eshk->credit));

Callers 1

domonnoiseFunction · 0.85

Calls 11

MonnamFunction · 0.85
ShknamFunction · 0.85
verbalizeFunction · 0.85
HelloFunction · 0.85
body_partFunction · 0.85
addupbillFunction · 0.85
currencyFunction · 0.85
money_cntFunction · 0.85
is_izchakFunction · 0.85
shknameFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected