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

Private Member Functions

void ~DestructionEffectBase ()
 
void Init ()
 
bool HasExplosionDamage ()
 
void DealExplosionDamage ()
 
void OnHealthLevelChanged (notnull EntityAI entity, int oldLevel, int newLevel, string zone)
 
void ReplaceEntityServer ()
 
ParticleSource PlayParticle (int particleType, bool attach=false)
 
void OnEntityDestroyedOneTimeClient (EntityAI entity, int oldLevel, string zone)
 
void OnEntityDestroyedOneTimeServer (EntityAI entity, int oldLevel, string zone)
 
void OnEntityDestroyedPersistentClient (EntityAI entity, string zone)
 
void OnEntityDestroyedPersistentServer (EntityAI entity, string zone)
 
void OnExplosionEffects (Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal, float energyFactor, float explosionFactor, bool isWater, string ammoType)
 

Private Attributes

EntityAI m_Entity
 
bool m_EntityIsTakeable
 
ParticleSource m_POneTime
 
ParticleSource m_PPersistent
 
int m_ParticleOneTime
 
int m_ParticlePersistent
 
EffectSound m_SOneTime
 
EffectSound m_SPersistent
 
string m_SoundSetOneTime
 
string m_SoundSetPersistent
 
bool m_KeepHealthOnReplace
 
string m_ReplaceWithEntity
 
int m_ReplaceDelay
 
bool m_HasExplosionDamage
 
DamageType m_DamageType
 
string m_AmmoType
 

Detailed Description

Definition at line 1 of file DestructionEffectBase.c.

Constructor & Destructor Documentation

◆ ~DestructionEffectBase()

void DestructionEffectBase::~DestructionEffectBase ( )
inlineprivate

Definition at line 28 of file DestructionEffectBase.c.

29 {
30 if (m_POneTime)
32 if (m_PPersistent)
34
37 }
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
Definition Particle.c:262
Manager class for managing Effect (EffectParticle, EffectSound)
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.

References SEffectManager::DestroyEffect(), m_POneTime, m_PPersistent, m_SOneTime, m_SPersistent, and Particle::Stop().

Member Function Documentation

◆ DealExplosionDamage()

void DestructionEffectBase::DealExplosionDamage ( )
inlineprivate

Definition at line 46 of file DestructionEffectBase.c.

References m_AmmoType, m_DamageType, and m_Entity.

Referenced by OnHealthLevelChanged().

◆ HasExplosionDamage()

bool DestructionEffectBase::HasExplosionDamage ( )
inlineprivate

Definition at line 41 of file DestructionEffectBase.c.

42 {
44 }

References m_AmmoType, and m_HasExplosionDamage.

Referenced by OnHealthLevelChanged().

◆ Init()

void DestructionEffectBase::Init ( )
private

Referenced by OnHealthLevelChanged().

◆ OnEntityDestroyedOneTimeClient()

void DestructionEffectBase::OnEntityDestroyedOneTimeClient ( EntityAI entity,
int oldLevel,
string zone )
private

Referenced by OnHealthLevelChanged().

◆ OnEntityDestroyedOneTimeServer()

void DestructionEffectBase::OnEntityDestroyedOneTimeServer ( EntityAI entity,
int oldLevel,
string zone )
private

Referenced by OnHealthLevelChanged().

◆ OnEntityDestroyedPersistentClient()

void DestructionEffectBase::OnEntityDestroyedPersistentClient ( EntityAI entity,
string zone )
private

Referenced by OnHealthLevelChanged().

◆ OnEntityDestroyedPersistentServer()

void DestructionEffectBase::OnEntityDestroyedPersistentServer ( EntityAI entity,
string zone )
private

Referenced by OnHealthLevelChanged().

◆ OnExplosionEffects()

void DestructionEffectBase::OnExplosionEffects ( Object source,
Object directHit,
int componentIndex,
string surface,
vector pos,
vector surfNormal,
float energyFactor,
float explosionFactor,
bool isWater,
string ammoType )
private

◆ OnHealthLevelChanged()

void DestructionEffectBase::OnHealthLevelChanged ( notnull EntityAI entity,
int oldLevel,
int newLevel,
string zone )
inlineprivate

Definition at line 51 of file DestructionEffectBase.c.

52 {
54 Init();
55
56 if (GetGame().IsServer())
57 {
58 entity.SetTakeable(m_EntityIsTakeable);
59
60 if (oldLevel != -1 || entity.m_Initialized)
61 {
63 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(ReplaceEntityServer, m_ReplaceDelay, false);
67 }
69 }
70#ifndef SERVER//client OR single
71 {
72 if (oldLevel != -1 || entity.m_Initialized)//one time
73 {
75
76 if (m_POneTime)
77 m_POneTime.SetOwner(this);
78
80
81 m_Entity.PlaySoundSet(m_SOneTime, m_SoundSetOneTime, 0, 0);
82 m_Entity.PlaySoundSetLoop(m_SPersistent, m_SoundSetPersistent, 0, 0);
83 }
84 else//Persistent
85 {
87 m_Entity.PlaySoundSetLoop(m_SPersistent, m_SoundSetPersistent, 0, 0);
88 }
89
91
92 if (m_PPersistent)
94 }
95#endif
96 }
void OnEntityDestroyedPersistentClient(EntityAI entity, string zone)
ParticleSource PlayParticle(int particleType, bool attach=false)
void OnEntityDestroyedOneTimeServer(EntityAI entity, int oldLevel, string zone)
void OnEntityDestroyedOneTimeClient(EntityAI entity, int oldLevel, string zone)
void OnEntityDestroyedPersistentServer(EntityAI entity, string zone)
proto native void SetOwner(Class owner)
Set the owner of this ParticleSource.
proto native CGame GetGame()
const int CALL_CATEGORY_SYSTEM
Definition tools.c:8

References CALL_CATEGORY_SYSTEM, DealExplosionDamage(), GetGame(), HasExplosionDamage(), Init(), m_Entity, m_EntityIsTakeable, m_ParticleOneTime, m_ParticlePersistent, m_POneTime, m_PPersistent, m_ReplaceDelay, m_ReplaceWithEntity, m_SOneTime, m_SoundSetOneTime, m_SoundSetPersistent, m_SPersistent, OnEntityDestroyedOneTimeClient(), OnEntityDestroyedOneTimeServer(), OnEntityDestroyedPersistentClient(), OnEntityDestroyedPersistentServer(), PlayParticle(), ReplaceEntityServer(), and ParticleSource::SetOwner().

◆ PlayParticle()

ParticleSource DestructionEffectBase::PlayParticle ( int particleType,
bool attach = false )
inlineprivate

Definition at line 107 of file DestructionEffectBase.c.

108 {
109 if (!m_Entity)
110 {
111 ErrorEx("Missing entity - something went wrong");
112 return null;
113 }
114 if (particleType)
115 {
116 ParticleSource p = ParticleManager.GetInstance().PlayInWorld(particleType, m_Entity.GetPosition());
117 if (attach && p)
118 {
119 p.AddAsChild(m_Entity);//Note: it's also possible to directly play on object: Particle.PlayOnObject
120 }
121 return p;
122 }
123 return null;
124 }
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Entity which has the particle instance as an ObjectComponent.
enum ShapeType ErrorEx

References ErrorEx, m_Entity, and ParticleManager().

Referenced by OnHealthLevelChanged().

◆ ReplaceEntityServer()

void DestructionEffectBase::ReplaceEntityServer ( )
inlineprivate

Definition at line 98 of file DestructionEffectBase.c.

99 {
101 dead_entity.SetOrientation(m_Entity.GetOrientation());
103 dead_entity.SetHealth(m_Entity.GetHealth());
104 m_Entity.Delete();
105 }
const int ECE_OBJECT_SWAP
const int RF_ORIGINAL

References ECE_OBJECT_SWAP, GetGame(), m_Entity, m_KeepHealthOnReplace, m_ReplaceWithEntity, and RF_ORIGINAL.

Referenced by OnHealthLevelChanged().

Member Data Documentation

◆ m_AmmoType

string DestructionEffectBase::m_AmmoType
private

◆ m_DamageType

DamageType DestructionEffectBase::m_DamageType
private

◆ m_Entity

EntityAI DestructionEffectBase::m_Entity
private

◆ m_EntityIsTakeable

bool DestructionEffectBase::m_EntityIsTakeable
private

◆ m_HasExplosionDamage

bool DestructionEffectBase::m_HasExplosionDamage
private

◆ m_KeepHealthOnReplace

bool DestructionEffectBase::m_KeepHealthOnReplace
private

◆ m_ParticleOneTime

int DestructionEffectBase::m_ParticleOneTime
private

◆ m_ParticlePersistent

int DestructionEffectBase::m_ParticlePersistent
private

◆ m_POneTime

ParticleSource DestructionEffectBase::m_POneTime
private

Definition at line 7 of file DestructionEffectBase.c.

Referenced by OnHealthLevelChanged(), and ~DestructionEffectBase().

◆ m_PPersistent

ParticleSource DestructionEffectBase::m_PPersistent
private

Definition at line 8 of file DestructionEffectBase.c.

Referenced by OnHealthLevelChanged(), and ~DestructionEffectBase().

◆ m_ReplaceDelay

int DestructionEffectBase::m_ReplaceDelay
private

◆ m_ReplaceWithEntity

string DestructionEffectBase::m_ReplaceWithEntity
private

◆ m_SOneTime

EffectSound DestructionEffectBase::m_SOneTime
private

Definition at line 13 of file DestructionEffectBase.c.

Referenced by OnHealthLevelChanged(), and ~DestructionEffectBase().

◆ m_SoundSetOneTime

string DestructionEffectBase::m_SoundSetOneTime
private

◆ m_SoundSetPersistent

string DestructionEffectBase::m_SoundSetPersistent
private

◆ m_SPersistent

EffectSound DestructionEffectBase::m_SPersistent
private

Definition at line 14 of file DestructionEffectBase.c.

Referenced by OnHealthLevelChanged(), and ~DestructionEffectBase().


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