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

Function is_home_elemental

src/makemon.c:32–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30#define m_initlgrp(mtmp, x, y, mmf) m_initgrp(mtmp, x, y, 10, mmf)
31
32boolean
33is_home_elemental(struct permonst *ptr)
34{
35 if (ptr->mlet == S_ELEMENTAL) {
36 switch (monsndx(ptr)) {
37 case PM_AIR_ELEMENTAL:
38 return Is_airlevel(&u.uz);
39 case PM_FIRE_ELEMENTAL:
40 return Is_firelevel(&u.uz);
41 case PM_EARTH_ELEMENTAL:
42 return Is_earthlevel(&u.uz);
43 case PM_WATER_ELEMENTAL:
44 return Is_waterlevel(&u.uz);
45 default:
46 break;
47 }
48 }
49 return FALSE;
50}
51
52/*
53 * Return true if the given monster cannot exist on this elemental level.

Callers 7

mlevel_tele_trapFunction · 0.85
polymonFunction · 0.85
elemental_clogFunction · 0.85
wrong_elem_typeFunction · 0.85
newmonhpFunction · 0.85
grow_upFunction · 0.85
getmattkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected