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

Function role_abil

src/attrib.c:788–815  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

786}
787
788staticfn const struct innate *
789role_abil(int r)
790{
791 const struct {
792 short role;
793 const struct innate *abil;
794 } roleabils[] = {
795 { PM_ARCHEOLOGIST, arc_abil },
796 { PM_BARBARIAN, bar_abil },
797 { PM_CAVE_DWELLER, cav_abil },
798 { PM_HEALER, hea_abil },
799 { PM_KNIGHT, kni_abil },
800 { PM_MONK, mon_abil },
801 { PM_CLERIC, pri_abil },
802 { PM_RANGER, ran_abil },
803 { PM_ROGUE, rog_abil },
804 { PM_SAMURAI, sam_abil },
805 { PM_TOURIST, tou_abil },
806 { PM_VALKYRIE, val_abil },
807 { PM_WIZARD, wiz_abil },
808 { 0, 0 }
809 };
810 int i;
811
812 for (i = 0; roleabils[i].abil && roleabils[i].role != r; i++)
813 continue;
814 return roleabils[i].abil;
815}
816
817staticfn const struct innate *
818check_innate_abil(long *ability, long frommask)

Callers 2

check_innate_abilFunction · 0.85
adjabilFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected