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

Function polysense

src/polyself.c:2235–2261  ·  view source on GitHub ↗

some species have awareness of other species */

Source from the content-addressed store, hash-verified

2233
2234/* some species have awareness of other species */
2235staticfn void
2236polysense(void)
2237{
2238 short warnidx = NON_PM;
2239
2240 svc.context.warntype.speciesidx = NON_PM;
2241 svc.context.warntype.species = 0;
2242 svc.context.warntype.polyd = 0;
2243 HWarn_of_mon &= ~FROMRACE;
2244
2245 switch (u.umonnum) {
2246 case PM_PURPLE_WORM:
2247 case PM_BABY_PURPLE_WORM:
2248 warnidx = PM_SHRIEKER;
2249 break;
2250 case PM_VAMPIRE:
2251 case PM_VAMPIRE_LEADER:
2252 svc.context.warntype.polyd = M2_HUMAN | M2_ELF;
2253 HWarn_of_mon |= FROMRACE;
2254 return;
2255 }
2256 if (ismnum(warnidx)) {
2257 svc.context.warntype.speciesidx = warnidx;
2258 svc.context.warntype.species = &mons[warnidx];
2259 HWarn_of_mon |= FROMRACE;
2260 }
2261}
2262
2263/* True iff hero's role or race has been genocided */
2264boolean

Callers 1

set_uasmonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected