| 6422 | } |
| 6423 | |
| 6424 | void |
| 6425 | light_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*/ |
no test coverage detected