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

Function mkundead

src/mkroom.c:455–475  ·  view source on GitHub ↗

make a swarm of undead around mm */

Source from the content-addressed store, hash-verified

453
454/* make a swarm of undead around mm */
455void
456mkundead(
457 coord *mm,
458 boolean revive_corpses,
459 int mm_flags)
460{
461 int cnt = (level_difficulty() + 1) / 10 + rnd(5);
462 struct permonst *mdat;
463 struct obj *otmp;
464 coord cc;
465
466 while (cnt--) {
467 mdat = morguemon();
468 if (mdat && enexto(&cc, mm->x, mm->y, mdat)
469 && (!revive_corpses
470 || !(otmp = sobj_at(CORPSE, cc.x, cc.y))
471 || !revive(otmp, FALSE)))
472 (void) makemon(mdat, cc.x, cc.y, mm_flags);
473 }
474 svl.level.flags.graveyard = TRUE; /* reduced chance for undead corpse */
475}
476
477staticfn struct permonst *
478morguemon(void)

Callers 2

deadbookFunction · 0.85
use_bellFunction · 0.85

Calls 7

level_difficultyFunction · 0.85
rndFunction · 0.85
morguemonFunction · 0.85
enextoFunction · 0.85
sobj_atFunction · 0.85
reviveFunction · 0.85
makemonFunction · 0.85

Tested by

no test coverage detected