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

Function is_innate

src/attrib.c:879–900  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

877}
878
879int
880is_innate(int propidx)
881{
882 int innateness;
883
884 /* innately() would report FROM_FORM for this; caller wants specificity */
885 if (propidx == DRAIN_RES && ismnum(u.ulycn))
886 return FROM_LYCN;
887 if (propidx == FAST && Very_fast)
888 return FROM_NONE; /* can't become very fast innately */
889 if ((innateness = innately(&u.uprops[propidx].intrinsic)) != FROM_NONE)
890 return innateness;
891 if (propidx == JUMPING && Role_if(PM_KNIGHT)
892 /* knight has intrinsic jumping, but extrinsic is more versatile so
893 ignore innateness if equipment is going to claim responsibility */
894 && !u.uprops[propidx].extrinsic)
895 return FROM_ROLE;
896 if ((propidx == BLINDED && !haseyes(gy.youmonst.data))
897 || (propidx == BLND_RES && (HBlnd_resist & FROMFORM) != 0))
898 return FROM_FORM;
899 return FROM_NONE;
900}
901
902DISABLE_WARNING_FORMAT_NONLITERAL
903

Callers 1

from_whatFunction · 0.85

Calls 1

innatelyFunction · 0.85

Tested by

no test coverage detected