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

Function temp_resist

src/eat.c:452–469  ·  view source on GitHub ↗

if 'prop' is only set because of a timed value (so not an intrinsic attribute or because of polymorph shape or worn or carried gear), return its timeout, otherwise return 0; used by enlightenment */

Source from the content-addressed store, hash-verified

450 attribute or because of polymorph shape or worn or carried gear), return
451 its timeout, otherwise return 0; used by enlightenment */
452long
453temp_resist(int prop)
454{
455 struct prop *p = &u.uprops[prop];
456 long timeout = p->intrinsic & TIMEOUT;
457
458 if (timeout
459 /* and if not also protected by polymorph form */
460 && (p->intrinsic & ~TIMEOUT) == 0L
461 /* and not by worn gear (dragon armor) */
462 && !p->extrinsic
463 /* and property is not blocked; we don't expect this, but if it
464 is then the timeout doesn't matter so we won't extend that */
465 && !p->blocked) {
466 return timeout;
467 }
468 return 0L;
469}
470
471/* if temporary acid or stoning resistance is timing out while eating
472 something which that resistance is protecting against, caller will

Callers 2

attributes_enlightenmentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected