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

Function make_angry_shk

src/shk.c:1469–1489  ·  view source on GitHub ↗

Used when the shkp is teleported or falls (ox == 0) out of his shop, or when the player is not on a costly_spot and he damages something inside the shop. These conditions must be checked by the calling function. */ ARGSUSED*/

Source from the content-addressed store, hash-verified

1467 the shop. These conditions must be checked by the calling function. */
1468/*ARGSUSED*/
1469void
1470make_angry_shk(
1471 struct monst *shkp,
1472 coordxy ox UNUSED, coordxy oy UNUSED)
1473 /* <ox,oy> predate 'noit_Monnam()', let alone Shknam() */
1474{
1475 struct eshk *eshkp = ESHK(shkp);
1476
1477 /* all pending shop transactions are now "past due" */
1478 if (eshkp->billct || eshkp->debit || eshkp->loan || eshkp->credit) {
1479 eshkp->robbed += (addupbill(shkp) + eshkp->debit + eshkp->loan);
1480 eshkp->robbed -= eshkp->credit;
1481 if (eshkp->robbed < 0L)
1482 eshkp->robbed = 0L;
1483 /* billct, debit, loan, and credit will be cleared by setpaid */
1484 setpaid(shkp);
1485 }
1486
1487 pline("%s %s!", Shknam(shkp), !ANGRY(shkp) ? "gets angry" : "is furious");
1488 hot_pursuit(shkp);
1489}
1490
1491static const char
1492 no_money[] = "Moreover, you%s have no gold.",

Callers 6

rloc_to_coreFunction · 0.85
digactualholeFunction · 0.85
breakobjFunction · 0.85
chest_trapFunction · 0.85
poly_objFunction · 0.85
container_impact_dmgFunction · 0.85

Calls 5

addupbillFunction · 0.85
setpaidFunction · 0.85
ShknamFunction · 0.85
hot_pursuitFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected