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

Function resists_blnd

src/mondata.c:247–272  ·  view source on GitHub ↗

True if monster is resistant to light-induced blindness */

Source from the content-addressed store, hash-verified

245
246/* True if monster is resistant to light-induced blindness */
247boolean
248resists_blnd(struct monst *mon)
249{
250 struct permonst *ptr = mon->data;
251 boolean is_you = (mon == &gy.youmonst);
252
253 if (is_you ? (Blind || Unaware)
254 : (mon->mblinded || !mon->mcansee || !haseyes(ptr)
255 /* BUG: temporary sleep sets mfrozen, but since
256 paralysis does too, we can't check it */
257 || mon->msleeping))
258 return TRUE;
259 /* yellow light, Archon; !dust vortex, !cobra, !raven */
260 if (dmgtype_fromattack(ptr, AD_BLND, AT_EXPL)
261 || dmgtype_fromattack(ptr, AD_BLND, AT_GAZE))
262 return TRUE;
263 /* Sunsword */
264 if (resists_blnd_by_arti(mon))
265 return TRUE;
266 /* catchall */
267 if (is_you && Blnd_resist) {
268 impossible("'Blnd_resist' but not resists_blnd()?");
269 return TRUE;
270 }
271 return FALSE;
272}
273
274/* True iff monster is resistant to light-induced blindness due to worn
275 or wielded magical equipment (used to decide whether to show sparkle

Callers 14

Resists_ElemFunction · 0.85
can_blndFunction · 0.85
use_crystal_ballFunction · 0.85
explumFunction · 0.85
flash_hits_monFunction · 0.85
gazemmFunction · 0.85
doengraveFunction · 0.85
domagictrapFunction · 0.85
flashburnFunction · 0.85
zhitmFunction · 0.85
find_offensiveFunction · 0.85
use_offensiveFunction · 0.85

Calls 3

dmgtype_fromattackFunction · 0.85
resists_blnd_by_artiFunction · 0.85
impossibleFunction · 0.70

Tested by

no test coverage detected