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

Function monster_census

src/minion.c:39–55  ·  view source on GitHub ↗

count the number of monsters on the level */

Source from the content-addressed store, hash-verified

37
38/* count the number of monsters on the level */
39int
40monster_census(boolean spotted) /* seen|sensed vs all */
41{
42 struct monst *mtmp;
43 int count = 0;
44
45 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
46 if (DEADMONSTER(mtmp))
47 continue;
48 if (mtmp->isgd && mtmp->mx == 0)
49 continue;
50 if (spotted && !canspotmon(mtmp))
51 continue;
52 ++count;
53 }
54 return count;
55}
56
57/* mon summons a monster */
58int

Callers 5

mcast_insectsFunction · 0.85
nastyFunction · 0.85
msummonFunction · 0.85
do_genocideFunction · 0.85
create_particular_parseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected