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

Function morguemon

src/mkroom.c:477–499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

475}
476
477staticfn struct permonst *
478morguemon(void)
479{
480 int i = rn2(100), hd = rn2(level_difficulty());
481
482 if (hd > 10 && i < 10) {
483 if (Inhell || In_endgame(&u.uz)) {
484 return mkclass(S_DEMON, 0);
485 } else {
486 int ndemon_res = ndemon(A_NONE);
487 if (ndemon_res != NON_PM)
488 return &mons[ndemon_res];
489 /* else do what? As is, it will drop to ghost/wraith/zombie */
490 }
491 }
492
493 if (hd > 8 && i > 85)
494 return mkclass(S_VAMPIRE, 0);
495
496 return ((i < 20) ? &mons[PM_GHOST]
497 : (i < 40) ? &mons[PM_WRAITH]
498 : mkclass(S_ZOMBIE, 0));
499}
500
501struct permonst *
502antholemon(void)

Callers 2

fill_zooFunction · 0.85
mkundeadFunction · 0.85

Calls 4

rn2Function · 0.85
level_difficultyFunction · 0.85
mkclassFunction · 0.85
ndemonFunction · 0.85

Tested by

no test coverage detected