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

Function dead_species

src/mon.c:5586–5605  ·  view source on GitHub ↗

decide whether an egg of the indicated monster type is viable; also used to determine whether an egg or tin can be created... */

Source from the content-addressed store, hash-verified

5584/* decide whether an egg of the indicated monster type is viable;
5585 also used to determine whether an egg or tin can be created... */
5586boolean
5587dead_species(int m_idx, boolean egg)
5588{
5589 int alt_idx;
5590
5591 /* generic eggs are unhatchable and have corpsenm of NON_PM */
5592 if (m_idx < LOW_PM)
5593 return TRUE;
5594 /*
5595 * For monsters with both baby and adult forms, genociding either
5596 * form kills all eggs of that monster. Monsters with more than
5597 * two forms (small->large->giant mimics) are more or less ignored;
5598 * fortunately, none of them have eggs. Species extinction due to
5599 * overpopulation does not kill eggs.
5600 */
5601 /* assert(ismnum(m_idx)); */
5602 alt_idx = egg ? big_to_little(m_idx) : m_idx;
5603 return (boolean) ((svm.mvitals[m_idx].mvflags & G_GENOD) != 0
5604 || (svm.mvitals[alt_idx].mvflags & G_GENOD) != 0);
5605}
5606
5607/* kill off any eggs of genocided monsters */
5608staticfn void

Callers 8

readobjnamFunction · 0.85
carry_obj_effectsFunction · 0.85
kill_eggsFunction · 0.85
mksobj_initFunction · 0.85
set_corpsenmFunction · 0.85
curseFunction · 0.85
revive_eggFunction · 0.85
poly_objFunction · 0.85

Calls 1

big_to_littleFunction · 0.85

Tested by

no test coverage detected