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

Function kill_genocided_monsters

src/mon.c:5638–5677  ·  view source on GitHub ↗

kill all members of genocided species */

Source from the content-addressed store, hash-verified

5636
5637/* kill all members of genocided species */
5638void
5639kill_genocided_monsters(void)
5640{
5641 struct monst *mtmp, *mtmp2;
5642 boolean kill_cham;
5643 int mndx;
5644
5645 /*
5646 * Called during genocide, and again upon level change. The latter
5647 * catches up with any migrating monsters as they finally arrive at
5648 * their intended destinations, so possessions get deposited there.
5649 *
5650 * Chameleon handling:
5651 * 1) if chameleons have been genocided, destroy them
5652 * regardless of current form;
5653 * 2) otherwise, force every chameleon which is imitating
5654 * any genocided species to take on a new form.
5655 */
5656 for (mtmp = fmon; mtmp; mtmp = mtmp2) {
5657 mtmp2 = mtmp->nmon;
5658 if (DEADMONSTER(mtmp))
5659 continue;
5660 mndx = monsndx(mtmp->data);
5661 kill_cham = (ismnum(mtmp->cham)
5662 && (svm.mvitals[mtmp->cham].mvflags & G_GENOD));
5663 if ((svm.mvitals[mndx].mvflags & G_GENOD) || kill_cham) {
5664 if (ismnum(mtmp->cham) && !kill_cham)
5665 (void) newcham(mtmp, (struct permonst *) 0, NC_SHOW_MSG);
5666 else
5667 mondead(mtmp);
5668 }
5669 if (mtmp->minvent)
5670 kill_eggs(mtmp->minvent);
5671 }
5672
5673 kill_eggs(gi.invent);
5674 kill_eggs(fobj);
5675 kill_eggs(gm.migrating_objs);
5676 kill_eggs(svl.level.buriedobjlist);
5677}
5678
5679void
5680golemeffects(struct monst *mon, int damtype, int dam)

Callers 4

goto_levelFunction · 0.85
makemap_prepostFunction · 0.85
do_class_genocideFunction · 0.85
do_genocideFunction · 0.85

Calls 3

newchamFunction · 0.85
mondeadFunction · 0.85
kill_eggsFunction · 0.85

Tested by

no test coverage detected