| 2317 | } |
| 2318 | |
| 2319 | staticfn uchar |
| 2320 | abil_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 | |
| 2343 | staticfn unsigned long |
| 2344 | abil_to_spfx(long *abil) |