MCPcopy Index your code
hub / github.com/NetHack/NetHack / wakeup

Function wakeup

src/mon.c:4332–4363  ·  view source on GitHub ↗

wake up a monster, possibly making it angry in the process */

Source from the content-addressed store, hash-verified

4330
4331/* wake up a monster, possibly making it angry in the process */
4332void
4333wakeup(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. */
4366void

Callers 15

potionhitFunction · 0.85
attack_checksFunction · 0.85
hmon_hitmon_do_hitFunction · 0.85
hmon_hitmonFunction · 0.85
missumFunction · 0.85
hmonasFunction · 0.85
stumble_onto_mimicFunction · 0.85
flash_hits_monFunction · 0.85
bury_monstFunction · 0.85
hurtle_stepFunction · 0.85
mhurtle_stepFunction · 0.85
mhurtleFunction · 0.85

Calls 9

wake_msgFunction · 0.85
seemimicFunction · 0.85
newsymFunction · 0.85
finish_meatingFunction · 0.85
growlFunction · 0.85
setmangryFunction · 0.85
in_roomsFunction · 0.85
ghod_hitsuFunction · 0.85
hot_pursuitFunction · 0.85

Tested by

no test coverage detected