Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
destructioneffects.c
Go to the documentation of this file.
1 /*
2 class TestDestructionEffect : DestructionEffectBase
3 {
4  ref AreaDamageManager m_AreaManager;
5  override void Init()
6  {
7  m_EntityIsTakeable = true;
8 
9  m_ParticlePersistent = ParticleList.GRENADE_M18_GREEN_LOOP;
10  m_ParticleOneTime = ParticleList.GRENADE_M84;
11 
12  m_SoundSetOneTime = "AlarmClock_Destroyed_SoundSet";
13  m_SoundSetPersistent= "KitchenTimer_Ticking_Loop_SoundSet";
14 
15  m_ReplaceWithEntity = "";
16  m_KeepHealthOnReplace = true;
17  m_ReplaceDelay = 1000;
18 
19  m_HasExplosionDamage = true;
20  m_AmmoType = "";
21  m_DamageType = 0;
22  }
23 
24  override void OnEntityDestroyedOneTimeClient(EntityAI entity, int oldLevel, string zone)
25  {
26  }
27 
28  override void OnEntityDestroyedOneTimeServer(EntityAI entity, int oldLevel, string zone)
29  {
30  }
31 
32  override void OnEntityDestroyedPersistentClient(EntityAI entity, string zone)
33  {
34  }
35 
36  override void OnEntityDestroyedPersistentServer(EntityAI entity, string zone)
37  {
38  AreaDamageLoopedDeferred_NoVehicle area_damage = new AreaDamageLoopedDeferred_NoVehicle( m_Entity );
39  area_damage.SetDamageComponentType(AreaDamageComponentTypes.HITZONE);
40 
41  vector min, max;
42  m_Entity.GetBounds(min, max);
43  vector center = m_Entity.GetPosition();
44 
45  vector orientation = m_Entity.GetOrientation();
46 
47  area_damage.SetExtents( "-1 -1 -1", "1 1 1" );
48  area_damage.SetAreaPosition( center );
49  area_damage.SetAreaOrientation( orientation );
50  area_damage.SetLoopInterval( 1.0 );
51  area_damage.SetDeferDuration( 0.2 );
52  area_damage.SetHitZones( { "Torso","LeftHand","LeftLeg","LeftFoot","RightHand","RightLeg","RightFoot" } );
53  area_damage.SetAmmoName( "BarbedWireHit" );
54  area_damage.Spawn();
55 
56  m_AreaManager = area_damage;
57 
58  }
59 }
60 
61 //--------------------------------------------------------------------
62 
63 
64 
65 class TestDestructionEffect2 : DestructionEffectBase
66 {
67  override void Init()
68  {
69  m_EntityIsTakeable = false;
70 
71 
72  m_ParticlePersistent = ParticleList.GRENADE_M18_GREEN_LOOP;
73  m_ParticleOneTime = ParticleList.GRENADE_M84;
74 
75  m_SoundSetOneTime = "AlarmClock_Destroyed_SoundSet";
76  m_SoundSetPersistent= "KitchenTimer_Ticking_Loop_SoundSet";
77 
78  m_ReplaceWithEntity = "";
79  m_KeepHealthOnReplace = true;
80  m_ReplaceDelay = 1000;
81 
82  m_HasExplosionDamage = true;
83  m_AmmoType = "LandFuelFeed_Ammo";
84  m_DamageType = DamageType.EXPLOSION;
85  }
86 
87 
88  override void OnEntityDestroyedOneTimeClient(EntityAI entity, int oldLevel, string zone)
89  {
90  }
91 
92  override void OnEntityDestroyedOneTimeServer(EntityAI entity, int oldLevel, string zone)
93  {
94  }
95 
96  override void OnEntityDestroyedPersistentClient(EntityAI entity, string zone)
97  {
98  }
99 
100  override void OnEntityDestroyedPersistentServer(EntityAI entity, string zone)
101  {
102  }
103 
104  override void OnExplosionEffects(Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal, float energyFactor, float explosionFactor, bool isWater, string ammoType)
105  {
106  if ( !GetGame().IsDedicatedServer() )
107  {
108  vector n = surfNormal.VectorToAngles() + "0 90 0";
109  Particle p1 = ParticleManager.GetInstance().PlayInWorld(ParticleList.SMOKE_GENERIC_WRECK, pos);
110  p1.SetOrientation(n);
111 
112  Particle p2 = ParticleManager.GetInstance().PlayInWorld(ParticleList.EXPLOSION_LANDMINE, pos);
113  p2.SetOrientation(n);
114 
115  Particle p3 = ParticleManager.GetInstance().PlayInWorld(ParticleList.IMPACT_METAL_RICOCHET, pos);
116  p3.SetOrientation(n);
117 
118  Particle p4 = ParticleManager.GetInstance().PlayInWorld(ParticleList.IMPACT_GRAVEL_RICOCHET, pos);
119  p4.SetOrientation(n);
120  }
121  }
122 }
123 */
125 {
126  override void Init()
127  {
128  m_EntityIsTakeable = true;
129 
130 
131  m_ParticlePersistent = ParticleList.NONE;
132  m_ParticleOneTime = ParticleList.RGD5;
133 
134  m_SoundSetOneTime = "";
135  m_SoundSetPersistent= "";
136 
137  m_ReplaceWithEntity = "";
138  m_KeepHealthOnReplace = true;
139  m_ReplaceDelay = 1000;
140 
141  m_HasExplosionDamage = true;
142  m_AmmoType = "GasCanister_Ammo";
143  m_DamageType = DamageType.EXPLOSION;
144  }
145 
146 
147  override void OnEntityDestroyedOneTimeClient(EntityAI entity, int oldLevel, string zone)
148  {
149  }
150 
151  override void OnEntityDestroyedOneTimeServer(EntityAI entity, int oldLevel, string zone)
152  {
153  }
154 
155  override void OnEntityDestroyedPersistentClient(EntityAI entity, string zone)
156  {
157  }
158 
159  override void OnEntityDestroyedPersistentServer(EntityAI entity, string zone)
160  {
161  }
162 
163  override void OnExplosionEffects(Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal, float energyFactor, float explosionFactor, bool isWater, string ammoType)
164  {
165  }
166 }
167 
168 class DestructionEffectMetalicMechanism : DestructionEffectBase
169 {
170  override void Init()
171  {
172  m_EntityIsTakeable = true;
173 
174 
175  m_ParticlePersistent = ParticleList.NONE;
176  m_ParticleOneTime = ParticleList.NONE;
177 
178  m_SoundSetOneTime = "AlarmClock_Destroyed_SoundSet";
179  m_SoundSetPersistent= "";
180 
181  m_ReplaceWithEntity = "";
182  m_KeepHealthOnReplace = true;
183  m_ReplaceDelay = 1000;
184 
185  m_HasExplosionDamage = false;
186  m_AmmoType = "";
187  m_DamageType = DamageType.EXPLOSION;
188  }
189 
190 
191  override void OnEntityDestroyedOneTimeClient(EntityAI entity, int oldLevel, string zone)
192  {
193  }
194 
195  override void OnEntityDestroyedOneTimeServer(EntityAI entity, int oldLevel, string zone)
196  {
197  }
198 
199  override void OnEntityDestroyedPersistentClient(EntityAI entity, string zone)
200  {
201  }
202 
203  override void OnEntityDestroyedPersistentServer(EntityAI entity, string zone)
204  {
205  }
206 
207  override void OnExplosionEffects(Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal, float energyFactor, float explosionFactor, bool isWater, string ammoType)
208  {
209  }
210 }
211 
213 {
214  override void Init()
215  {
216  m_EntityIsTakeable = false;
217 
218  m_ParticlePersistent = ParticleList.NONE;
219  m_ParticleOneTime = ParticleList.EXPLOSION_GOAT;
220 
221  m_SoundSetOneTime = "";
222  m_SoundSetPersistent= "";
223 
224  m_ReplaceWithEntity = "";
225  m_KeepHealthOnReplace = false;
226  m_ReplaceDelay = 0;
227 
228  m_HasExplosionDamage = false;
229  m_AmmoType = "";
230  m_DamageType = DamageType.EXPLOSION;
231  }
232 
233 
234  override void OnEntityDestroyedOneTimeClient(EntityAI entity, int oldLevel, string zone)
235  {
236  }
237 
238  override void OnEntityDestroyedOneTimeServer(EntityAI entity, int oldLevel, string zone)
239  {
240  }
241 
242  override void OnEntityDestroyedPersistentClient(EntityAI entity, string zone)
243  {
244  }
245 
246  override void OnEntityDestroyedPersistentServer(EntityAI entity, string zone)
247  {
248  }
249 
250  override void OnExplosionEffects(Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal, float energyFactor, float explosionFactor, bool isWater, string ammoType)
251  {
252  }
253 }
OnEntityDestroyedPersistentClient
override void OnEntityDestroyedPersistentClient(EntityAI entity, string zone)
Definition: destructioneffects.c:31
ParticleList
Definition: particlelist.c:11
OnEntityDestroyedPersistentServer
override void OnEntityDestroyedPersistentServer(EntityAI entity, string zone)
Definition: destructioneffects.c:35
vector
Definition: enconvert.c:105
OnEntityDestroyedOneTimeClient
override void OnEntityDestroyedOneTimeClient(EntityAI entity, int oldLevel, string zone)
Definition: destructioneffects.c:23
OnEntityDestroyedOneTimeServer
override void OnEntityDestroyedOneTimeServer(EntityAI entity, int oldLevel, string zone)
Definition: destructioneffects.c:27
DamageType
DamageType
exposed from C++ (do not change)
Definition: damagesystem.c:10
Init
DestructionEffectGasCanister DestructionEffectBase Init()
Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside o...
Definition: destructioneffects.c:170
Object
Definition: objecttyped.c:1
m_AmmoType
string m_AmmoType
Definition: impacteffects.c:18
DestructionEffectSpookyGoat
Definition: destructioneffects.c:212
DestructionEffectBase
Definition: destructioneffectbase.c:1
DestructionEffectGasCanister
Definition: destructioneffects.c:124
m_DamageType
int m_DamageType
Definition: areadamagecomponent.c:11
EntityAI
Definition: building.c:5
OnExplosionEffects
override void OnExplosionEffects(Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal, float energyFactor, float explosionFactor, bool isWater, string ammoType)
Definition: destructioneffects.c:39