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

Function olfaction

src/mondata.c:1506–1518  ·  view source on GitHub ↗

* Returns: * True if monster is presumed to have a sense of smell. * False if monster definitely does not have a sense of smell. * * Do not base this on presence of a head or nose, since many * creatures sense smells other ways (feelers, forked-tongues, etc). * We're assuming all insects can smell at a distance too. */

Source from the content-addressed store, hash-verified

1504 * We're assuming all insects can smell at a distance too.
1505 */
1506boolean
1507olfaction(struct permonst *mdat)
1508{
1509 if (is_golem(mdat)
1510 || mdat->mlet == S_EYE /* spheres */
1511 || mdat->mlet == S_JELLY || mdat->mlet == S_PUDDING
1512 || mdat->mlet == S_BLOB || mdat->mlet == S_VORTEX
1513 || mdat->mlet == S_ELEMENTAL
1514 || mdat->mlet == S_FUNGUS /* mushrooms and fungi */
1515 || mdat->mlet == S_LIGHT)
1516 return FALSE;
1517 return TRUE;
1518}
1519
1520/* Convert attack damage type AD_foo to M_SEEN_bar */
1521unsigned long

Callers 4

hellish_smoke_mesgFunction · 0.85
wiz_smellFunction · 0.85
garlic_breathFunction · 0.85
usmellmonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected