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

Function pick_animal

src/mon.c:4854–4869  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4852}
4853
4854staticfn int
4855pick_animal(void)
4856{
4857 int res;
4858
4859 if (!ga.animal_list)
4860 mon_animal_list(TRUE);
4861 assert(ga.animal_list != 0);
4862 res = ga.animal_list[rn2(ga.animal_list_count)];
4863 /* rogue level should use monsters represented by uppercase letters
4864 only, but since chameleons aren't generated there (not uppercase!)
4865 we don't perform a lot of retries */
4866 if (Is_rogue_level(&u.uz) && !isupper(monsym(&mons[res])))
4867 res = ga.animal_list[rn2(ga.animal_list_count)];
4868 return res;
4869}
4870
4871void
4872decide_to_shapeshift(struct monst *mon)

Callers 1

select_newcham_formFunction · 0.85

Calls 3

mon_animal_listFunction · 0.85
rn2Function · 0.85
isupperFunction · 0.85

Tested by

no test coverage detected