| 2341 | } |
| 2342 | |
| 2343 | staticfn unsigned long |
| 2344 | abil_to_spfx(long *abil) |
| 2345 | { |
| 2346 | static const struct abil2spfx_tag { |
| 2347 | long *abil; |
| 2348 | unsigned long spfx; |
| 2349 | } abil2spfx[] = { |
| 2350 | { &ESearching, SPFX_SEARCH }, |
| 2351 | { &EHalluc_resistance, SPFX_HALRES }, |
| 2352 | { &ETelepat, SPFX_ESP }, |
| 2353 | { &EStealth, SPFX_STLTH }, |
| 2354 | { &ERegeneration, SPFX_REGEN }, |
| 2355 | { &ETeleport_control, SPFX_TCTRL }, |
| 2356 | { &EWarn_of_mon, SPFX_WARN }, |
| 2357 | { &EWarning, SPFX_WARN }, |
| 2358 | { &EEnergy_regeneration, SPFX_EREGEN }, |
| 2359 | { &EHalf_spell_damage, SPFX_HSPDAM }, |
| 2360 | { &EHalf_physical_damage, SPFX_HPHDAM }, |
| 2361 | { &EReflecting, SPFX_REFLECT }, |
| 2362 | }; |
| 2363 | int k; |
| 2364 | |
| 2365 | for (k = 0; k < SIZE(abil2spfx); k++) { |
| 2366 | if (abil2spfx[k].abil == abil) |
| 2367 | return abil2spfx[k].spfx; |
| 2368 | } |
| 2369 | return 0L; |
| 2370 | } |
| 2371 | |
| 2372 | /* |
| 2373 | * Return the first item that is conveying a particular intrinsic. |