weaponfx.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. //---------------------------------------------------------------------
  2. // Weapon FX equivalency Table for Mechs/Vehicles/Whatever
  3. //
  4. //---------------------------------------------------------------------------//
  5. // Copyright (C) Microsoft Corporation. All rights reserved. //
  6. //===========================================================================//
  7. #ifndef WEAPONFX_H
  8. #define WEAPONFX_H
  9. //---------------------------------------------------------------------------------
  10. // weapon FX Equivalancy. Now reads in data from CSV for GOS Effects
  11. #define BUILDING_EXPLOSION_ID 45
  12. #define VEHICLE_EXPLOSION_ID 40
  13. #define SPLASH_VEHICLE_EXPLOSION_ID 46
  14. #define DFA_BOOM_EFFECT 47
  15. #define MECH_EXPLOSION_ID 39
  16. #define MECH_CRITICAL_HIT_ID 35
  17. #define MECH_SMOKE_ID 48
  18. #define TURRET_EXPLOSION_ID 44
  19. #define MECH_DISABLE_EXPLOSION_ID 49
  20. #define LARGE_AIRSTRIKE_ID 50
  21. #define SMALL_AIRSTRIKE_ID 51
  22. #define SENSOR_AIRSTRIKE_ID 72
  23. #define MINE_EXPLOSION_ID 53
  24. #define EMPTY_EXPLOSION_ID 54
  25. #define JET_CONTRAIL_ID 58
  26. #define ARM_FLYING_ID 61
  27. #define SHOULDER_POP_ID 62
  28. #define CRITICAL_SMOKE_ID 65
  29. #define MECH_WATER_WAKE 34
  30. #define VEHICLE_WATER_WAKE 66
  31. #define VEHICLE_DUST_CLOUD 70
  32. #define VTOL_DUST_CLOUD 56
  33. #define KARNOV_DUST_CLOUD 73
  34. #define KARNOV_RECOVERY_BEAM 69
  35. #define MINELAYER_EFFECT_ID 68
  36. #define REPAIR_VEHICLE_EFFECT_ID 57
  37. #define HELICOPTER_DUST_CLOUD 67
  38. #define TURRET_POWER_DOWN_EFFECT 75
  39. #define WATER_MISS_FX 76
  40. #define INFANTRY_BOOM_EFFECT 55
  41. #define INFANTRY_BLOOD_EFFECT 82
  42. extern char mc2_word_none[];
  43. typedef struct _EffectData
  44. {
  45. char effectName[50];
  46. char muzzleFlashName[50];
  47. char hitEffectName[50];
  48. char missEffectName[50];
  49. long effectObjNum;
  50. } EffectData;
  51. class WeaponEffects
  52. {
  53. //Data Members
  54. //-------------
  55. protected:
  56. EffectData *effects;
  57. long numEffects;
  58. //Member Functions
  59. //----------------
  60. public:
  61. WeaponEffects (void)
  62. {
  63. init();
  64. }
  65. ~WeaponEffects (void)
  66. {
  67. destroy();
  68. }
  69. void init (void)
  70. {
  71. effects = NULL;
  72. numEffects = 0;
  73. }
  74. void destroy (void);
  75. void init (char *effectCSVFileName);
  76. char *GetEffectName (long effectId)
  77. {
  78. if ((effectId >= 0) && (effectId < numEffects))
  79. {
  80. return effects[effectId].effectName;
  81. }
  82. return mc2_word_none;
  83. }
  84. char *GetEffectMuzzleFlashName (long effectId)
  85. {
  86. if ((effectId >= 0) && (effectId < numEffects))
  87. {
  88. return effects[effectId].muzzleFlashName;
  89. }
  90. return mc2_word_none;
  91. }
  92. char *GetEffectHitName (long effectId)
  93. {
  94. if ((effectId >= 0) && (effectId < numEffects))
  95. {
  96. return effects[effectId].hitEffectName;
  97. }
  98. return mc2_word_none;
  99. }
  100. char *GetEffectMissName (long effectId)
  101. {
  102. if ((effectId >= 0) && (effectId < numEffects))
  103. {
  104. return effects[effectId].missEffectName;
  105. }
  106. return mc2_word_none;
  107. }
  108. long GetEffectObjNum (long effectId)
  109. {
  110. if ((effectId >= 0) && (effectId < numEffects))
  111. {
  112. return effects[effectId].effectObjNum;
  113. }
  114. return -1;
  115. }
  116. };
  117. extern WeaponEffects *weaponEffects;
  118. //---------------------------------------------------------------------------------
  119. #endif