destructioneffects.c 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. /*
  2. class TestDestructionEffect : DestructionEffectBase
  3. {
  4. ref AreaDamageManager m_AreaManager;
  5. override void Init()
  6. {
  7. m_EntityIsTakeable = true;
  8. m_ParticlePersistent = ParticleList.GRENADE_M18_GREEN_LOOP;
  9. m_ParticleOneTime = ParticleList.GRENADE_M84;
  10. m_SoundSetOneTime = "AlarmClock_Destroyed_SoundSet";
  11. m_SoundSetPersistent= "KitchenTimer_Ticking_Loop_SoundSet";
  12. m_ReplaceWithEntity = "";
  13. m_KeepHealthOnReplace = true;
  14. m_ReplaceDelay = 1000;
  15. m_HasExplosionDamage = true;
  16. m_AmmoType = "";
  17. m_DamageType = 0;
  18. }
  19. override void OnEntityDestroyedOneTimeClient(EntityAI entity, int oldLevel, string zone)
  20. {
  21. }
  22. override void OnEntityDestroyedOneTimeServer(EntityAI entity, int oldLevel, string zone)
  23. {
  24. }
  25. override void OnEntityDestroyedPersistentClient(EntityAI entity, string zone)
  26. {
  27. }
  28. override void OnEntityDestroyedPersistentServer(EntityAI entity, string zone)
  29. {
  30. AreaDamageLoopedDeferred_NoVehicle area_damage = new AreaDamageLoopedDeferred_NoVehicle( m_Entity );
  31. area_damage.SetDamageComponentType(AreaDamageComponentTypes.HITZONE);
  32. vector min, max;
  33. m_Entity.GetBounds(min, max);
  34. vector center = m_Entity.GetPosition();
  35. vector orientation = m_Entity.GetOrientation();
  36. area_damage.SetExtents( "-1 -1 -1", "1 1 1" );
  37. area_damage.SetAreaPosition( center );
  38. area_damage.SetAreaOrientation( orientation );
  39. area_damage.SetLoopInterval( 1.0 );
  40. area_damage.SetDeferDuration( 0.2 );
  41. area_damage.SetHitZones( { "Torso","LeftHand","LeftLeg","LeftFoot","RightHand","RightLeg","RightFoot" } );
  42. area_damage.SetAmmoName( "BarbedWireHit" );
  43. area_damage.Spawn();
  44. m_AreaManager = area_damage;
  45. }
  46. }
  47. //--------------------------------------------------------------------
  48. class TestDestructionEffect2 : DestructionEffectBase
  49. {
  50. override void Init()
  51. {
  52. m_EntityIsTakeable = false;
  53. m_ParticlePersistent = ParticleList.GRENADE_M18_GREEN_LOOP;
  54. m_ParticleOneTime = ParticleList.GRENADE_M84;
  55. m_SoundSetOneTime = "AlarmClock_Destroyed_SoundSet";
  56. m_SoundSetPersistent= "KitchenTimer_Ticking_Loop_SoundSet";
  57. m_ReplaceWithEntity = "";
  58. m_KeepHealthOnReplace = true;
  59. m_ReplaceDelay = 1000;
  60. m_HasExplosionDamage = true;
  61. m_AmmoType = "LandFuelFeed_Ammo";
  62. m_DamageType = DamageType.EXPLOSION;
  63. }
  64. override void OnEntityDestroyedOneTimeClient(EntityAI entity, int oldLevel, string zone)
  65. {
  66. }
  67. override void OnEntityDestroyedOneTimeServer(EntityAI entity, int oldLevel, string zone)
  68. {
  69. }
  70. override void OnEntityDestroyedPersistentClient(EntityAI entity, string zone)
  71. {
  72. }
  73. override void OnEntityDestroyedPersistentServer(EntityAI entity, string zone)
  74. {
  75. }
  76. override void OnExplosionEffects(Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal, float energyFactor, float explosionFactor, bool isWater, string ammoType)
  77. {
  78. if ( !GetGame().IsDedicatedServer() )
  79. {
  80. vector n = surfNormal.VectorToAngles() + "0 90 0";
  81. Particle p1 = ParticleManager.GetInstance().PlayInWorld(ParticleList.SMOKE_GENERIC_WRECK, pos);
  82. p1.SetOrientation(n);
  83. Particle p2 = ParticleManager.GetInstance().PlayInWorld(ParticleList.EXPLOSION_LANDMINE, pos);
  84. p2.SetOrientation(n);
  85. Particle p3 = ParticleManager.GetInstance().PlayInWorld(ParticleList.IMPACT_METAL_RICOCHET, pos);
  86. p3.SetOrientation(n);
  87. Particle p4 = ParticleManager.GetInstance().PlayInWorld(ParticleList.IMPACT_GRAVEL_RICOCHET, pos);
  88. p4.SetOrientation(n);
  89. }
  90. }
  91. }
  92. */
  93. class DestructionEffectGasCanister : DestructionEffectBase
  94. {
  95. override void Init()
  96. {
  97. m_EntityIsTakeable = true;
  98. m_ParticlePersistent = ParticleList.NONE;
  99. m_ParticleOneTime = ParticleList.RGD5;
  100. m_SoundSetOneTime = "";
  101. m_SoundSetPersistent= "";
  102. m_ReplaceWithEntity = "";
  103. m_KeepHealthOnReplace = true;
  104. m_ReplaceDelay = 1000;
  105. m_HasExplosionDamage = true;
  106. m_AmmoType = "GasCanister_Ammo";
  107. m_DamageType = DamageType.EXPLOSION;
  108. }
  109. override void OnEntityDestroyedOneTimeClient(EntityAI entity, int oldLevel, string zone)
  110. {
  111. }
  112. override void OnEntityDestroyedOneTimeServer(EntityAI entity, int oldLevel, string zone)
  113. {
  114. }
  115. override void OnEntityDestroyedPersistentClient(EntityAI entity, string zone)
  116. {
  117. }
  118. override void OnEntityDestroyedPersistentServer(EntityAI entity, string zone)
  119. {
  120. }
  121. override void OnExplosionEffects(Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal, float energyFactor, float explosionFactor, bool isWater, string ammoType)
  122. {
  123. }
  124. }
  125. class DestructionEffectMetalicMechanism : DestructionEffectBase
  126. {
  127. override void Init()
  128. {
  129. m_EntityIsTakeable = true;
  130. m_ParticlePersistent = ParticleList.NONE;
  131. m_ParticleOneTime = ParticleList.NONE;
  132. m_SoundSetOneTime = "AlarmClock_Destroyed_SoundSet";
  133. m_SoundSetPersistent= "";
  134. m_ReplaceWithEntity = "";
  135. m_KeepHealthOnReplace = true;
  136. m_ReplaceDelay = 1000;
  137. m_HasExplosionDamage = false;
  138. m_AmmoType = "";
  139. m_DamageType = DamageType.EXPLOSION;
  140. }
  141. override void OnEntityDestroyedOneTimeClient(EntityAI entity, int oldLevel, string zone)
  142. {
  143. }
  144. override void OnEntityDestroyedOneTimeServer(EntityAI entity, int oldLevel, string zone)
  145. {
  146. }
  147. override void OnEntityDestroyedPersistentClient(EntityAI entity, string zone)
  148. {
  149. }
  150. override void OnEntityDestroyedPersistentServer(EntityAI entity, string zone)
  151. {
  152. }
  153. override void OnExplosionEffects(Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal, float energyFactor, float explosionFactor, bool isWater, string ammoType)
  154. {
  155. }
  156. }
  157. class DestructionEffectSpookyGoat : DestructionEffectBase
  158. {
  159. override void Init()
  160. {
  161. m_EntityIsTakeable = false;
  162. m_ParticlePersistent = ParticleList.NONE;
  163. m_ParticleOneTime = ParticleList.EXPLOSION_GOAT;
  164. m_SoundSetOneTime = "";
  165. m_SoundSetPersistent= "";
  166. m_ReplaceWithEntity = "";
  167. m_KeepHealthOnReplace = false;
  168. m_ReplaceDelay = 0;
  169. m_HasExplosionDamage = false;
  170. m_AmmoType = "";
  171. m_DamageType = DamageType.EXPLOSION;
  172. }
  173. override void OnEntityDestroyedOneTimeClient(EntityAI entity, int oldLevel, string zone)
  174. {
  175. }
  176. override void OnEntityDestroyedOneTimeServer(EntityAI entity, int oldLevel, string zone)
  177. {
  178. }
  179. override void OnEntityDestroyedPersistentClient(EntityAI entity, string zone)
  180. {
  181. }
  182. override void OnEntityDestroyedPersistentServer(EntityAI entity, string zone)
  183. {
  184. }
  185. override void OnExplosionEffects(Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal, float energyFactor, float explosionFactor, bool isWater, string ammoType)
  186. {
  187. }
  188. }