|
3 | 3 |
|
4 | 4 | namespace ALife |
5 | 5 | { |
6 | | -xr_token hit_types_token[] = {{"burn", eHitTypeBurn}, {"shock", eHitTypeShock}, {"strike", eHitTypeStrike}, |
7 | | - {"wound", eHitTypeWound}, {"radiation", eHitTypeRadiation}, {"telepatic", eHitTypeTelepatic}, |
8 | | - {"fire_wound", eHitTypeFireWound}, {"chemical_burn", eHitTypeChemicalBurn}, {"explosion", eHitTypeExplosion}, |
| 6 | +const xr_token hit_types_token[] = |
| 7 | +{ |
| 8 | + {"burn", eHitTypeBurn}, |
| 9 | + {"shock", eHitTypeShock}, |
| 10 | + {"strike", eHitTypeStrike}, |
| 11 | + {"wound", eHitTypeWound}, |
| 12 | + {"radiation", eHitTypeRadiation}, |
| 13 | + {"telepatic", eHitTypeTelepatic}, |
| 14 | + {"fire_wound", eHitTypeFireWound}, |
| 15 | + {"chemical_burn", eHitTypeChemicalBurn}, |
| 16 | + {"explosion", eHitTypeExplosion}, |
9 | 17 | {"wound_2", eHitTypeWound_2}, |
10 | | - // { "physic_strike", eHitTypePhysicStrike }, |
11 | | - {"light_burn", eHitTypeLightBurn}, {0, 0}}; |
| 18 | + //{"physic_strike", eHitTypePhysicStrike}, |
| 19 | + {"light_burn", eHitTypeLightBurn}, |
| 20 | + {0, 0} |
12 | 21 | }; |
| 22 | + |
| 23 | +EHitType g_tfString2HitType(LPCSTR caHitType) |
| 24 | +{ |
| 25 | + if (!_stricmp(caHitType, "burn")) |
| 26 | + return eHitTypeBurn; |
| 27 | + if (!_stricmp(caHitType, "light_burn")) |
| 28 | + return eHitTypeLightBurn; |
| 29 | + if (!_stricmp(caHitType, "shock")) |
| 30 | + return eHitTypeShock; |
| 31 | + if (!_stricmp(caHitType, "strike")) |
| 32 | + return eHitTypeStrike; |
| 33 | + if (!_stricmp(caHitType, "wound")) |
| 34 | + return eHitTypeWound; |
| 35 | + if (!_stricmp(caHitType, "radiation")) |
| 36 | + return eHitTypeRadiation; |
| 37 | + if (!_stricmp(caHitType, "telepatic")) |
| 38 | + return eHitTypeTelepatic; |
| 39 | + if (!_stricmp(caHitType, "fire_wound")) |
| 40 | + return eHitTypeFireWound; |
| 41 | + if (!_stricmp(caHitType, "chemical_burn")) |
| 42 | + return eHitTypeChemicalBurn; |
| 43 | + if (!_stricmp(caHitType, "explosion")) |
| 44 | + return eHitTypeExplosion; |
| 45 | + if (!_stricmp(caHitType, "wound_2")) |
| 46 | + return eHitTypeWound_2; |
| 47 | + |
| 48 | + FATAL("Unsupported hit type!"); |
| 49 | + NODEFAULT; |
| 50 | +#ifdef DEBUG |
| 51 | + return eHitTypeMax; |
| 52 | +#endif |
| 53 | +} |
| 54 | + |
| 55 | +} // namespace ALife |
0 commit comments