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

Function light_hits_gremlin

src/uhitm.c:6424–6445  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6422}
6423
6424void
6425light_hits_gremlin(struct monst *mon, int dmg)
6426{
6427 if (!Deaf && mdistu(mon) <= 90) {
6428 /* cry of pain can be heard somewhat farther than the waking radius */
6429 pline_mon(mon, "%s %s!", Monnam(mon),
6430 (dmg > mon->mhp / 2) ? "wails in agony"
6431 : "cries out in pain");
6432 } else if (canseemon(mon)) {
6433 pline_mon(mon, "%s recoils from the light!", Monnam(mon));
6434 }
6435 mon->mhp -= dmg;
6436 wake_nearto(mon->mx, mon->my, 30);
6437 if (DEADMONSTER(mon)) {
6438 if (svc.context.mon_moving)
6439 monkilled(mon, (char *) 0, AD_BLND);
6440 else
6441 killed(mon);
6442 } else if (cansee(mon->mx, mon->my) && !canspotmon(mon)) {
6443 map_invisible(mon->mx, mon->my);
6444 }
6445}
6446
6447/*uhitm.c*/

Callers 2

flash_hits_monFunction · 0.85
litroomFunction · 0.85

Calls 7

pline_monFunction · 0.85
MonnamFunction · 0.85
canseemonFunction · 0.85
wake_neartoFunction · 0.85
monkilledFunction · 0.85
killedFunction · 0.85
map_invisibleFunction · 0.85

Tested by

no test coverage detected