DayZ 1.24
Loading...
Searching...
No Matches
Ammo_40mm_Smoke_ColorBase Class Reference
Inheritance diagram for Ammo_40mm_Smoke_ColorBase:
[legend]
Collaboration diagram for Ammo_40mm_Smoke_ColorBase:
[legend]

Protected Member Functions

void Ammo_40mm_Smoke_ColorBase ()
 
override void OnVariablesSynchronized ()
 
void Activate ()
 
override void EEKilled (Object killer)
 special behaviour - do not call super
 
override void EEDelete (EntityAI parent)
 
override bool CanPutInCargo (EntityAI parent)
 
override void OnActivatedByItem (notnull ItemBase item)
 

Protected Attributes

Particle m_ParticleSmoke
 
float m_ParticleLifetime
 
int m_ParticleId
 
bool m_Activated
 

Detailed Description

Definition at line 239 of file AmmunitionPiles.c.

Constructor & Destructor Documentation

◆ Ammo_40mm_Smoke_ColorBase()

void Ammo_40mm_Smoke_ColorBase::Ammo_40mm_Smoke_ColorBase ( )
inlineprotected

Definition at line 246 of file AmmunitionPiles.c.

247 {
248 RegisterNetSyncVariableBool("m_Activated");
249 }

Member Function Documentation

◆ Activate()

void Ammo_40mm_Smoke_ColorBase::Activate ( )
inlineprotected

Definition at line 269 of file AmmunitionPiles.c.

270 {
271 m_ParticleLifetime = GetGame().ConfigGetFloat(string.Format("CfgMagazines %1 particleLifeTime", GetType()));
272 m_Activated = true;
273 SetSynchDirty();
274
275 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(DeleteSafe, m_ParticleLifetime * 1000);
276 }
eBleedingSourceType GetType()
proto native CGame GetGame()
const int CALL_CATEGORY_SYSTEM
Definition tools.c:8

References CALL_CATEGORY_SYSTEM, GetGame(), GetType(), m_Activated, and m_ParticleLifetime.

Referenced by OnActivatedByItem().

◆ CanPutInCargo()

override bool Ammo_40mm_Smoke_ColorBase::CanPutInCargo ( EntityAI parent)
inlineprotected

Definition at line 295 of file AmmunitionPiles.c.

296 {
297 return !m_Activated;
298 }

References m_Activated.

◆ EEDelete()

override void Ammo_40mm_Smoke_ColorBase::EEDelete ( EntityAI parent)
inlineprotected

Definition at line 285 of file AmmunitionPiles.c.

286 {
287#ifndef SERVER
288 if (m_ParticleSmoke)
290#endif
291
292 super.EEDelete(parent);
293 }
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
Definition Particle.c:262

References m_ParticleSmoke, and Particle::Stop().

◆ EEKilled()

override void Ammo_40mm_Smoke_ColorBase::EEKilled ( Object killer)
inlineprotected

special behaviour - do not call super

Definition at line 279 of file AmmunitionPiles.c.

280 {
281 //analytics (behaviour from EntityAI)
282 GetGame().GetAnalyticsServer().OnEntityKilled(killer, this);
283 }

References GetGame().

◆ OnActivatedByItem()

override void Ammo_40mm_Smoke_ColorBase::OnActivatedByItem ( notnull ItemBase item)
inlineprotected

Definition at line 300 of file AmmunitionPiles.c.

301 {
302 SetHealth("", "", 0.0);
303 Activate();
304 }

References Activate().

◆ OnVariablesSynchronized()

override void Ammo_40mm_Smoke_ColorBase::OnVariablesSynchronized ( )
inlineprotected

Definition at line 251 of file AmmunitionPiles.c.

252 {
253 super.OnVariablesSynchronized();
254
255 if (m_Activated)
256 {
257#ifndef SERVER
258 string particleStrIdentifier = GetGame().ConfigGetTextOut(string.Format("CfgMagazines %1 particleStrIdentifier", GetType()));
260 if (m_ParticleId > 0)
261 {
262 m_ParticleSmoke = ParticleManager.GetInstance().PlayOnObject(m_ParticleId, this);
264 }
265#endif
266 }
267 }
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
void SetWiggle(float random_angle, float random_interval)
Makes the particle change direction by random_angle every random_interval seconds.
Definition Particle.c:742
static int GetParticleIDByName(string name)
Returns particle's ID based on the filename (without .ptc suffix)

References GetGame(), ParticleList::GetParticleIDByName(), GetType(), m_Activated, m_ParticleId, m_ParticleSmoke, ParticleManager(), and Particle::SetWiggle().

Member Data Documentation

◆ m_Activated

bool Ammo_40mm_Smoke_ColorBase::m_Activated
protected

Definition at line 244 of file AmmunitionPiles.c.

Referenced by Activate(), CanPutInCargo(), and OnVariablesSynchronized().

◆ m_ParticleId

int Ammo_40mm_Smoke_ColorBase::m_ParticleId
protected

Definition at line 243 of file AmmunitionPiles.c.

Referenced by OnVariablesSynchronized().

◆ m_ParticleLifetime

float Ammo_40mm_Smoke_ColorBase::m_ParticleLifetime
protected

Definition at line 242 of file AmmunitionPiles.c.

Referenced by Activate().

◆ m_ParticleSmoke

Particle Ammo_40mm_Smoke_ColorBase::m_ParticleSmoke
protected

Definition at line 241 of file AmmunitionPiles.c.

Referenced by EEDelete(), and OnVariablesSynchronized().


The documentation for this class was generated from the following file: