Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
grenade_chemgas.c
Go to the documentation of this file.
2 {
3  protected bool m_Exploded;
4  protected ParticleSource m_ParticleExploded;
5  protected EffectSound m_ExplosionSound;
6 
7 
8  void Grenade_ChemGas()
9  {
11  SetGrenadeType(EGrenadeType.CHEMICAL);
12  m_Pinned = false;
13  SetPinnable(false);
14  Arm();
15  }
16 
17  void ~Grenade_ChemGas();
18 
19  override protected void OnExplode()
20  {
21  m_Exploded = true;
22 
23  if (GetGame().IsServer())
24  {
25  GetGame().CreateObject("ContaminatedArea_Local", GetPosition());
26  }
27  }
28 
29  protected string GetExplosionSoundSet()
30  {
31  return "Grenade_detonation_SoundSet";
32  }
33 
34  override void EOnContact(IEntity other, Contact extra)
35  {
36  if (GetGame().IsServer())
37  {
38  if (!m_Exploded)
39  {
41  }
42  }
43  }
44 
45  override void EEKilled(Object killer)
46  {
47  super.EEKilled(killer);
48  }
49 
50  override void OnDamageDestroyed(int oldLevel)
51  {
52  if (GetGame().IsServer() || !GetGame().IsMultiplayer())
53  {
54  GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(Delete, 1000);
55  }
56  #ifndef SERVER
57  ClearFlags(EntityFlags.VISIBLE, false);
58  m_ParticleExploded = ParticleManager.GetInstance().PlayInWorld(ParticleList.GRENADE_CHEM_BREAK, GetPosition());
59  PlaySoundSet( m_ExplosionSound, GetExplosionSoundSet(), 0, 0 );
60  #endif
61 
62  }
63 
64  override protected void Activate()
65  {
66  //we don't want base functionality here
67  }
68 
69 }
GetGame
proto native CGame GetGame()
CALL_CATEGORY_SYSTEM
const int CALL_CATEGORY_SYSTEM
Definition: tools.c:8
SetParticleExplosion
void SetParticleExplosion(int particle)
Definition: explosivesbase.c:294
ClearFlags
proto native int ClearFlags(int flags, bool immedUpdate=true)
EntityFlags
EntityFlags
Entity flags.
Definition: enentity.c:114
Grenade_Base
Definition: flashgrenade.c:1
OnActivateFinished
override void OnActivateFinished()
Definition: smokegrenadebase.c:166
Arm
void Arm()
Definition: explosivesbase.c:207
EGrenadeType
EGrenadeType
Definition: grenade_base.c:1
IEntity
Definition: enentity.c:164
GetPosition
class JsonUndergroundAreaTriggerData GetPosition
Definition: undergroundarealoader.c:9
EffectSound
Wrapper class for managing sound through SEffectManager.
Definition: effectsound.c:4
ParticleList
Definition: particlelist.c:11
Grenade_ChemGas
Definition: grenade_chemgas.c:1
Object
Definition: objecttyped.c:1
Contact
Definition: enphysics.c:300
ParticleSource
Entity which has the particle instance as an ObjectComponent.
Definition: particlesource.c:123
ParticleManager
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Definition: particlemanager.c:84