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

Function abil_to_adtyp

src/artifact.c:2319–2341  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2317}
2318
2319staticfn uchar
2320abil_to_adtyp(long *abil)
2321{
2322 struct abil2adtyp_tag {
2323 long *abil;
2324 uchar adtyp;
2325 } abil2adtyp[] = {
2326 { &EFire_resistance, AD_FIRE },
2327 { &ECold_resistance, AD_COLD },
2328 { &EShock_resistance, AD_ELEC },
2329 { &EAntimagic, AD_MAGM },
2330 { &EDisint_resistance, AD_DISN },
2331 { &EPoison_resistance, AD_DRST },
2332 { &EDrain_resistance, AD_DRLI },
2333 };
2334 int k;
2335
2336 for (k = 0; k < SIZE(abil2adtyp); k++) {
2337 if (abil2adtyp[k].abil == abil)
2338 return abil2adtyp[k].adtyp;
2339 }
2340 return 0;
2341}
2342
2343staticfn unsigned long
2344abil_to_spfx(long *abil)

Callers 1

what_givesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected