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

Function pacify_shk

src/shk.c:1343–1358  ·  view source on GitHub ↗

remove previously applied surcharge from all billed items */

Source from the content-addressed store, hash-verified

1341
1342/* remove previously applied surcharge from all billed items */
1343staticfn void
1344pacify_shk(struct monst *shkp, boolean clear_surcharge)
1345{
1346 NOTANGRY(shkp) = TRUE; /* make peaceful */
1347 if (clear_surcharge && ESHK(shkp)->surcharge) {
1348 struct bill_x *bp = ESHK(shkp)->bill_p;
1349 int ct = ESHK(shkp)->billct;
1350
1351 ESHK(shkp)->surcharge = FALSE;
1352 while (ct-- > 0) {
1353 long reduction = (bp->price + 3L) / 4L;
1354 bp->price -= reduction; /* undo 33% increase */
1355 bp++;
1356 }
1357 }
1358}
1359
1360/* add aggravation surcharge to all billed items */
1361staticfn void

Callers 5

restshkFunction · 0.85
u_entered_shopFunction · 0.85
make_happy_shkFunction · 0.85
inheritsFunction · 0.85
pay_for_damageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected