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

Function mk_gen_ok

src/makemon.c:1735–1752  ·  view source on GitHub ↗

decide whether it's ok to generate a candidate monster by mkclass() */

Source from the content-addressed store, hash-verified

1733
1734/* decide whether it's ok to generate a candidate monster by mkclass() */
1735staticfn boolean
1736mk_gen_ok(int mndx, unsigned mvflagsmask, unsigned genomask)
1737{
1738 struct permonst *ptr = &mons[mndx];
1739
1740 if (svm.mvitals[mndx].mvflags & mvflagsmask)
1741 return FALSE;
1742 if (ptr->geno & genomask)
1743 return FALSE;
1744 if (is_placeholder(ptr))
1745 return FALSE;
1746#ifdef MAIL_STRUCTURES
1747 /* special levels might ask for random demon type; reject this one */
1748 if (ptr == &mons[PM_MAIL_DAEMON])
1749 return FALSE;
1750#endif
1751 return TRUE;
1752}
1753
1754/* monsters in order by mlet & difficulty for mkclass() */
1755static int mongen_order[NUMMONS];

Callers 3

mkclass_alignedFunction · 0.85
mkclass_polyFunction · 0.85
summon_furiesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected