DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
DestructionEffectBase.c
См. документацию.
2{
4
6
9
12
15
18
22
25 string m_AmmoType;
26
27
29 {
30 if (m_POneTime)
31 {
32 m_POneTime.Stop();
33 }
34 if (m_PPersistent)
35 {
36 m_PPersistent.Stop();
37 }
38
41 }
42
43 private void Init();
44
46 {
48 }
49
50 private void DealExplosionDamage()
51 {
52 DamageSystem.ExplosionDamage(m_Entity, null, m_AmmoType, m_Entity.GetPosition(), m_DamageType);
53 }
54
55 void OnHealthLevelChanged(notnull EntityAI entity, int oldLevel, int newLevel, string zone)
56 {
57 m_Entity = entity;
58 Init();
59
60 if (GetGame().IsServer())
61 {
62 entity.SetTakeable(m_EntityIsTakeable);
63
64 if (oldLevel != -1 || entity.m_Initialized)
65 {
67 {
69 }
71 {
73 }
74 OnEntityDestroyedOneTimeServer(entity, oldLevel, zone);
75 }
77 }
78 #ifndef SERVER//client OR single
79 {
80 if (oldLevel != -1 || entity.m_Initialized)//one time
81 {
83
84 if (m_POneTime)
85 {
86 m_POneTime.SetOwner(this);
87 }
88
89 OnEntityDestroyedOneTimeClient(entity, oldLevel, zone);
90
91 m_Entity.PlaySoundSet(m_SOneTime, m_SoundSetOneTime, 0, 0 );
92 m_Entity.PlaySoundSetLoop(m_SPersistent, m_SoundSetPersistent, 0, 0 );
93 }
94 else//Persistent
95 {
97 m_Entity.PlaySoundSetLoop(m_SPersistent, m_SoundSetPersistent, 0, 0 );
98 }
99
101
102 if (m_PPersistent)
103 {
104 m_PPersistent.SetOwner(this);
105 }
106 }
107 #endif
108 }
109
110 private void ReplaceEntityServer()
111 {
112 EntityAI dead_entity = EntityAI.Cast(GetGame().CreateObjectEx(m_ReplaceWithEntity, m_Entity.GetPosition(), ECE_OBJECT_SWAP, RF_ORIGINAL));
113 dead_entity.SetOrientation(m_Entity.GetOrientation());
115 {
116 dead_entity.SetHealth(m_Entity.GetHealth());
117 }
118 m_Entity.Delete();
119 }
120
121 private ParticleSource PlayParticle(int particleType, bool attach = false)
122 {
123 if (!m_Entity)
124 {
125 ErrorEx("Missing entity - something went wrong");
126 return null;
127 }
128 if (particleType)
129 {
130 ParticleSource p = ParticleManager.GetInstance().PlayInWorld(particleType, m_Entity.GetPosition());
131 if (attach && p)
132 {
133 p.AddAsChild(m_Entity);//Note: it's also possible to directly play on object: Particle.PlayOnObject
134 }
135 return p;
136 }
137 return null;
138 }
139
140 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
141 // !!!!!!!!!! Override methods bellow !!!!!!!!!!!!!
142 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
143
144 // ! Client Event called the moment the entity is destroyed, best for explosion and other one-time effects
145 void OnEntityDestroyedOneTimeClient(EntityAI entity, int oldLevel,string zone);
146
147 // ! Server Event called the moment the entity is destroyed
148 void OnEntityDestroyedOneTimeServer(EntityAI entity, int oldLevel, string zone);
149
150 // ! Client Event called at the same moment as the one-time event, but also when the entity is loaded/spawned on client, typically as the player connects to the server or moves close enough so that previously non-existent client entity is now spawned in
152
153 // ! Server Event called at the same moment as the one time event, but also when the entity is loaded/spawned on Server, typically as the server is starting up
155
156 // !Relayed from entity when explosion happens
157 void OnExplosionEffects(Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal, float energyFactor, float explosionFactor, bool isWater, string ammoType);
158
159}
160
const int ECE_OBJECT_SWAP
Определения CentralEconomy.c:38
const int RF_ORIGINAL
Определения CentralEconomy.c:63
DamageType
exposed from C++ (do not change)
Определения DamageSystem.c:11
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Определения ParticleManager.c:88
override ScriptCallQueue GetCallQueue(int call_category)
Определения DayZGame.c:1187
void OnHealthLevelChanged(notnull EntityAI entity, int oldLevel, int newLevel, string zone)
Определения DestructionEffectBase.c:55
void ReplaceEntityServer()
Определения DestructionEffectBase.c:110
EffectSound m_SPersistent
Определения DestructionEffectBase.c:14
ParticleSource m_PPersistent
Определения DestructionEffectBase.c:8
string m_AmmoType
Определения DestructionEffectBase.c:25
bool m_KeepHealthOnReplace
Определения DestructionEffectBase.c:19
void OnEntityDestroyedPersistentClient(EntityAI entity, string zone)
ParticleSource PlayParticle(int particleType, bool attach=false)
Определения DestructionEffectBase.c:121
void ~DestructionEffectBase()
Определения DestructionEffectBase.c:28
int m_ParticlePersistent
Определения DestructionEffectBase.c:11
string m_SoundSetOneTime
Определения DestructionEffectBase.c:16
ParticleSource m_POneTime
Определения DestructionEffectBase.c:7
void DealExplosionDamage()
Определения DestructionEffectBase.c:50
string m_SoundSetPersistent
Определения DestructionEffectBase.c:17
int m_ParticleOneTime
Определения DestructionEffectBase.c:10
string m_ReplaceWithEntity
Определения DestructionEffectBase.c:20
void OnEntityDestroyedOneTimeServer(EntityAI entity, int oldLevel, string zone)
EffectSound m_SOneTime
Определения DestructionEffectBase.c:13
EntityAI m_Entity
Определения DestructionEffectBase.c:3
void OnEntityDestroyedOneTimeClient(EntityAI entity, int oldLevel, string zone)
bool HasExplosionDamage()
Определения DestructionEffectBase.c:45
DamageType m_DamageType
Определения DestructionEffectBase.c:24
bool m_HasExplosionDamage
Определения DestructionEffectBase.c:23
bool m_EntityIsTakeable
Определения DestructionEffectBase.c:5
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)
Wrapper class for managing sound through SEffectManager.
Определения EffectSound.c:5
Определения Building.c:6
Определения ObjectTyped.c:2
override void AddAsChild(Object parent, vector local_pos="0 0 0", vector local_ori="0 0 0", bool force_rotation_to_world=false)
Attaches this particle onto some object. If null value is provided then the particle will be detached...
Определения ParticleSource.c:783
Entity which has the particle instance as an ObjectComponent.
Определения ParticleSource.c:124
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
Определения EffectManager.c:271
Manager class for managing Effect (EffectParticle, EffectSound)
Определения EffectManager.c:6
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
Определения EnConvert.c:106
proto native CGame GetGame()
enum ShapeType ErrorEx
const int CALL_CATEGORY_SYSTEM
Определения tools.c:8