DayZ 1.30
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 (g_Game.IsServer())
61 {
62 entity.SetTakeable(m_EntityIsTakeable);
63
64 if (oldLevel != -1 || entity.m_Initialized)
65 {
67 {
68 g_Game.GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(ReplaceEntityServer, m_ReplaceDelay, false);
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 {
82 #ifndef NO_GUI
84
85 if (m_POneTime)
86 {
87 m_POneTime.SetOwner(this);
88 }
89 #endif
90
91 OnEntityDestroyedOneTimeClient(entity, oldLevel, zone);
92
93 #ifndef NO_GUI
94 m_Entity.PlaySoundSet(m_SOneTime, m_SoundSetOneTime, 0, 0 );
95 m_Entity.PlaySoundSetLoop(m_SPersistent, m_SoundSetPersistent, 0, 0 );
96 #endif
97 }
98 else//Persistent
99 {
101 #ifndef NO_GUI
102 m_Entity.PlaySoundSetLoop(m_SPersistent, m_SoundSetPersistent, 0, 0 );
103 #endif
104 }
105
106 #ifndef NO_GUI
108
109 if (m_PPersistent)
110 {
111 m_PPersistent.SetOwner(this);
112 }
113 #endif
114 }
115 #endif
116 }
117
118 private void ReplaceEntityServer()
119 {
120 EntityAI dead_entity = EntityAI.Cast(g_Game.CreateObjectEx(m_ReplaceWithEntity, m_Entity.GetPosition(), ECE_OBJECT_SWAP, RF_ORIGINAL));
121 dead_entity.SetOrientation(m_Entity.GetOrientation());
123 {
124 dead_entity.SetHealth(m_Entity.GetHealth());
125 }
126 m_Entity.Delete();
127 }
128
129 private ParticleSource PlayParticle(int particleType, bool attach = false)
130 {
131 if (!m_Entity)
132 {
133 ErrorEx("Missing entity - something went wrong");
134 return null;
135 }
136 if (particleType)
137 {
138 ParticleSource p = ParticleManager.GetInstance().PlayInWorld(particleType, m_Entity.GetPosition());
139 if (attach && p)
140 {
141 p.AddAsChild(m_Entity);//Note: it's also possible to directly play on object: Particle.PlayOnObject
142 }
143 return p;
144 }
145 return null;
146 }
147
148 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
149 // !!!!!!!!!! Override methods bellow !!!!!!!!!!!!!
150 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
151
152 // ! Client Event called the moment the entity is destroyed, best for explosion and other one-time effects
153 void OnEntityDestroyedOneTimeClient(EntityAI entity, int oldLevel,string zone);
154
155 // ! Server Event called the moment the entity is destroyed
156 void OnEntityDestroyedOneTimeServer(EntityAI entity, int oldLevel, string zone);
157
158 // ! 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
160
161 // ! 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
163
164 // !Relayed from entity when explosion happens
165 void OnExplosionEffects(Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal, float energyFactor, float explosionFactor, bool isWater, string ammoType);
166
167}
168
const int ECE_OBJECT_SWAP
Определения CentralEconomy.c:39
const int RF_ORIGINAL
Определения CentralEconomy.c:64
DamageType
exposed from C++ (do not change)
Определения DamageSystem.c:11
DayZGame g_Game
Определения DayZGame.c:4074
string ammoType
Определения DustKickupEffects.c:24
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Определения ParticleManager.c:88
void OnHealthLevelChanged(notnull EntityAI entity, int oldLevel, int newLevel, string zone)
Определения DestructionEffectBase.c:55
void ReplaceEntityServer()
Определения DestructionEffectBase.c:118
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:129
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
Определения 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:787
Entity which has the particle instance as an ObjectComponent.
Определения ParticleSource.c:128
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
Определения EffectManager.c:280
Manager class for managing Effect (EffectParticle, EffectSound)
Определения EffectManager.c:6
Определения EnConvert.c:119
enum ShapeType ErrorEx
const int CALL_CATEGORY_SYSTEM
Определения 3_Game/DayZ/tools/tools.c:8