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

Function check_innate_abil

src/attrib.c:817–851  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

815}
816
817staticfn const struct innate *
818check_innate_abil(long *ability, long frommask)
819{
820 const struct innate *abil = 0;
821
822 if (frommask == FROMEXPER)
823 abil = role_abil(Role_switch);
824 else if (frommask == FROMRACE)
825 switch (Race_switch) {
826 case PM_DWARF:
827 abil = dwa_abil;
828 break;
829 case PM_ELF:
830 abil = elf_abil;
831 break;
832 case PM_GNOME:
833 abil = gno_abil;
834 break;
835 case PM_ORC:
836 abil = orc_abil;
837 break;
838 case PM_HUMAN:
839 abil = hum_abil;
840 break;
841 default:
842 break;
843 }
844
845 while (abil && abil->ability) {
846 if ((abil->ability == ability) && (u.ulevel >= abil->ulevel))
847 return abil;
848 abil++;
849 }
850 return (struct innate *) 0;
851}
852
853/* reasons for innate ability */
854#define FROM_NONE 0

Callers 1

innatelyFunction · 0.85

Calls 1

role_abilFunction · 0.85

Tested by

no test coverage detected