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

Function shk_fixes_damage

src/shk.c:4555–4577  ·  view source on GitHub ↗

Shopkeeper tries to repair damage belonging to them */

Source from the content-addressed store, hash-verified

4553
4554/* Shopkeeper tries to repair damage belonging to them */
4555staticfn void
4556shk_fixes_damage(struct monst *shkp)
4557{
4558 struct damage *dam = find_damage(shkp);
4559 boolean shk_closeby;
4560
4561 if (!dam)
4562 return;
4563
4564 shk_closeby = (mdistu(shkp) <= (BOLT_LIM / 2) * (BOLT_LIM / 2));
4565
4566 if (canseemon(shkp)) {
4567 pline("%s whispers %s.", Shknam(shkp),
4568 shk_closeby ? "an incantation" : "something");
4569 } else if (!Deaf && shk_closeby) {
4570 Soundeffect(se_mutter_incantation, 100);
4571 You_hear("someone muttering an incantation.");
4572 }
4573
4574 (void) repair_damage(shkp, dam, FALSE);
4575
4576 discard_damage_struct(dam);
4577}
4578
4579#define LITTER_UPDATE 0x01U
4580#define LITTER_OPEN 0x02U

Callers 1

shk_moveFunction · 0.85

Calls 7

find_damageFunction · 0.85
canseemonFunction · 0.85
ShknamFunction · 0.85
You_hearFunction · 0.85
repair_damageFunction · 0.85
discard_damage_structFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected