wake up a monster, possibly making it angry in the process */
| 4330 | |
| 4331 | /* wake up a monster, possibly making it angry in the process */ |
| 4332 | void |
| 4333 | wakeup(struct monst *mtmp, boolean via_attack) |
| 4334 | { |
| 4335 | boolean was_sleeping = mtmp->msleeping; |
| 4336 | |
| 4337 | wake_msg(mtmp, via_attack); |
| 4338 | mtmp->msleeping = 0; |
| 4339 | if (M_AP_TYPE(mtmp) != M_AP_NOTHING) { |
| 4340 | /* mimics come out of hiding, but disguised Wizard doesn't |
| 4341 | have to lose his disguise */ |
| 4342 | if (M_AP_TYPE(mtmp) != M_AP_MONSTER) |
| 4343 | seemimic(mtmp); |
| 4344 | } else if (svc.context.forcefight && !svc.context.mon_moving |
| 4345 | && mtmp->mundetected) { |
| 4346 | mtmp->mundetected = 0; |
| 4347 | newsym(mtmp->mx, mtmp->my); |
| 4348 | } |
| 4349 | finish_meating(mtmp); |
| 4350 | if (via_attack) { |
| 4351 | boolean was_peaceful = mtmp->mpeaceful; |
| 4352 | |
| 4353 | if (was_sleeping) |
| 4354 | growl(mtmp); |
| 4355 | setmangry(mtmp, TRUE); |
| 4356 | if (was_peaceful) { |
| 4357 | if (mtmp->ispriest && *in_rooms(mtmp->mx, mtmp->my, TEMPLE)) |
| 4358 | ghod_hitsu(mtmp); |
| 4359 | if (mtmp->isshk && !*u.ushops) |
| 4360 | hot_pursuit(mtmp); |
| 4361 | } |
| 4362 | } |
| 4363 | } |
| 4364 | |
| 4365 | /* Wake up nearby monsters without angering them. */ |
| 4366 | void |
no test coverage detected