DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс ContaminatedArea_Dynamic
+ Граф наследования:ContaminatedArea_Dynamic:

Защищенные члены

void ContaminatedArea_Dynamic ()
 
override void EEOnCECreate ()
 
float GetRemainingTime ()
 
float GetStartDecayLifetime ()
 
float GetFinishDecayLifetime ()
 
override void Tick ()
 
void SetDecayState (int newState)
 
override void EEInit ()
 
override void InitZone ()
 
override void InitZoneServer ()
 
void SpawnItems ()
 
override void InitZoneClient ()
 
override void OnParticleAllocation (ParticleManager pm, array< ParticleSource > particles)
 
override void CreateTrigger (vector pos, int radius)
 
void PlayFX ()
 
void PlayExplosionLight ()
 
void PlayFlareVFX ()
 
override void EEDelete (EntityAI parent)
 
override void OnVariablesSynchronized ()
 

Защищенные данные

ref Timer m_StartupTimer
 
ref Timer m_FXTimer
 
FlareLight m_FlareLight
 
ShellLight m_ShellLight
 
vector m_OffsetPos
 
int m_DecayState = eAreaDecayStage.INIT
 
const int AIRBORNE_EXPLOSION_DELAY = 20
 
const int AREA_SETUP_DELAY = 10
 
const float AIRBORNE_FX_OFFSET = 50
 
const float ARTILLERY_SHELL_SPEED = 100
 
const float DECAY_START_PART_SIZE = 32
 
const int DECAY_START_PART_BIRTH_RATE = 1
 
const float DECAY_END_PART_SIZE = 17
 
const int DECAY_END_PART_BIRTH_RATE = 1
 
const float START_DECAY_LIFETIME = 900
 
const float FINISH_DECAY_LIFETIME = 300
 
const ref array< stringSPAWN_ITEM_TYPE = {"Grenade_ChemGas"}
 
const ref array< intSPAWN_ITEM_COUNT = {Math.RandomIntInclusive(2,5)}
 
const ref array< floatSPAWN_ITEM_RAD_MIN = {5}
 
const ref array< floatSPAWN_ITEM_RAD_MAX = {15}
 

Подробное описание

Конструктор(ы)

◆ ContaminatedArea_Dynamic()

void ContaminatedArea_Dynamic ( )
inlineprotected
62 {
63 RegisterNetSyncVariableInt("m_DecayState");
64 }

Методы

◆ CreateTrigger()

override void CreateTrigger ( vector pos,
int radius )
inlineprotected
290 {
291 super.CreateTrigger( pos, radius );
292
293 // This handles the specific case of dynamic triggers as some additionnal parameters are present
295 if ( dynaTrigger )
296 {
298 dynaTrigger.SetAreaState( m_DecayState );
299 }
300 }
void ContaminatedTrigger_Dynamic()
Definition ContaminatedTrigger.c:91
int m_DecayState
Definition ContaminatedArea_Dynamic.c:38
Definition EntityAI.c:95

Перекрестные ссылки ContaminatedTrigger_Dynamic() и m_DecayState.

◆ EEDelete()

override void EEDelete ( EntityAI parent)
inlineprotected
342 {
343 super.EEDelete( parent );
344 }

◆ EEInit()

override void EEInit ( )
inlineprotected
171 {
172 // We make sure we have the particle array
173 if ( !m_ToxicClouds )
175
176 // We set the values for dynamic area as these are not set through JSON and are standardized
177 m_Name = "Default Dynamic";
178 m_Radius = 120;
180 m_NegativeHeight = 10;
181 m_InnerRings = 1;
182 m_InnerSpacing = 40;
183 m_OuterSpacing = 30;
185 m_Type = eZoneType.DYNAMIC;
186 m_TriggerType = "ContaminatedTrigger_Dynamic";
187
188 SetSynchDirty();
189
190 #ifdef DEVELOPER
191 // Debugs when placing entity by hand using internal tools
192 /*if ( GetGame().IsServer() && !GetGame().IsMultiplayer() )
193 {
194 Debug.Log("YOU CAN IGNORE THE FOLLOWING DUMP");
195 InitZone();
196 Debug.Log("YOU CAN USE FOLLOWING DATA PROPERLY");
197 }*/
198 #endif
199
202
203 // If a player arrives slightly later during the creation process we check if playing the flare FX is relevant
204 if ( m_DecayState == eAreaDecayStage.INIT )
205 PlayFlareVFX();
206
207 if ( m_DecayState == eAreaDecayStage.LIVE )
208 InitZone(); // If it has already been created, we simply do the normal setup, no cool effects, force the LIVE state
209 else if ( GetGame().IsClient() && m_DecayState > eAreaDecayStage.LIVE )
210 InitZoneClient(); // Same as before but without state forcing
211
212 super.EEInit();
213 }
float m_Radius
Definition AIGroupBehaviour.c:10
eAreaDecayStage
Definition ContaminatedArea_Dynamic.c:2
class DynamicMusicLocationTypes m_Type
eZoneType
Definition EffectArea.c:3
class SyncedValue m_Name
class JsonUndergroundAreaTriggerData GetPosition
Definition UndergroundAreaLoader.c:9
vector m_OffsetPos
Definition ContaminatedArea_Dynamic.c:37
void PlayFlareVFX()
Definition ContaminatedArea_Dynamic.c:329
override void InitZone()
Definition ContaminatedArea_Dynamic.c:216
override void InitZoneClient()
Definition ContaminatedArea_Dynamic.c:256
const float AIRBORNE_FX_OFFSET
Definition ContaminatedArea_Dynamic.c:43
proto native CGame GetGame()

Перекрестные ссылки AIRBORNE_FX_OFFSET, GetGame(), GetPosition, InitZone(), InitZoneClient(), m_DecayState, m_Name, m_OffsetPos, m_Radius, m_Type и PlayFlareVFX().

◆ EEOnCECreate()

override void EEOnCECreate ( )
inlineprotected
67 {
68 // We get the PPE index for future usage and synchronization ( we must do it here for dynamic as it is not read through file )
69 if ( GetGame().IsServer() )
71
72 SetSynchDirty();
73
74 // If this is the first initialization, we delay it in order to play cool effects
75 if ( m_DecayState == eAreaDecayStage.INIT )
76 {
80
81 // play artillery sound, sent to be played for everyone on server
82 array<vector> artilleryPoints = GetGame().GetMission().GetWorldData().GetArtyFiringPos();
84 int dist = 0;
85 int temp;
86 int index = 0;
87 for ( int i = 0; i < artilleryPoints.Count(); i++ )
88 {
90 if ( temp < dist || dist == 0 )
91 {
92 dist = temp;
93 index = i;
94 }
95 }
96
98
99 // We calculate the delay depending on distance from firing position to simulate shell travel time
102 delay += AIRBORNE_EXPLOSION_DELAY; // We add the base, minimum time ( no area can start before this delay )
103
104 Param3<vector, vector, float> pos; // The value to be sent through RPC
105 array<ref Param> params; // The RPC params
106
107 // We prepare to send the message
110
111 // We send the message with this set of coords
112 params.Insert( pos );
113 GetGame().RPC( null, ERPCs.RPC_SOUND_ARTILLERY_SINGLE, params, true );
114
116 m_FXTimer.Run( delay, this, "PlayFX" );
117
118 delay += AREA_SETUP_DELAY; // We have an additional delay between shell detonation and finalization of area creation
119 // setup zone
121 m_StartupTimer.Run( delay, this, "InitZone" );
122 }
123 }
ERPCs
Definition ERPCs.c:2
ref Timer m_FXTimer
Definition ContaminatedArea_Dynamic.c:34
const int AIRBORNE_EXPLOSION_DELAY
Definition ContaminatedArea_Dynamic.c:41
const int AREA_SETUP_DELAY
Definition ContaminatedArea_Dynamic.c:42
const float ARTILLERY_SHELL_SPEED
Definition ContaminatedArea_Dynamic.c:44
ref Timer m_StartupTimer
Definition ContaminatedArea_Dynamic.c:33
Definition DayZPlayerImplement.c:63
Definition EnConvert.c:106
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
const int CALL_CATEGORY_GAMEPLAY
Definition tools.c:10

Перекрестные ссылки AIRBORNE_EXPLOSION_DELAY, AIRBORNE_FX_OFFSET, AREA_SETUP_DELAY, ARTILLERY_SHELL_SPEED, CALL_CATEGORY_GAMEPLAY, vector::Distance(), vector::DistanceSq(), GetGame(), GetPosition, m_DecayState, m_FXTimer, m_OffsetPos и m_StartupTimer.

◆ GetFinishDecayLifetime()

float GetFinishDecayLifetime ( )
inlineprotected
136 {
138 }
const float FINISH_DECAY_LIFETIME
Definition ContaminatedArea_Dynamic.c:52

Перекрестные ссылки FINISH_DECAY_LIFETIME.

Используется в Tick().

◆ GetRemainingTime()

float GetRemainingTime ( )
inlineprotected
126 {
127 return GetLifetime();
128 }

Используется в Tick().

◆ GetStartDecayLifetime()

float GetStartDecayLifetime ( )
inlineprotected
131 {
133 }
const float START_DECAY_LIFETIME
Definition ContaminatedArea_Dynamic.c:51

Перекрестные ссылки START_DECAY_LIFETIME.

Используется в Tick().

◆ InitZone()

override void InitZone ( )
inlineprotected
217 {
219 SetSynchDirty();
220
221 super.InitZone();
222 }

Перекрестные ссылки m_DecayState.

Используется в EEInit().

◆ InitZoneClient()

override void InitZoneClient ( )
inlineprotected
257 {
258 super.InitZoneClient();
259
260 if ( !m_ToxicClouds )
262
263 // We spawn VFX on client
265 }

Перекрестные ссылки m_Radius.

Используется в EEInit() и OnVariablesSynchronized().

◆ InitZoneServer()

override void InitZoneServer ( )
inlineprotected
225 {
226 super.InitZoneServer();
227
228 SpawnItems();
229 // We create the trigger on server
230 if ( m_TriggerType != "" )
232 }
vector m_Position
Cached world position.
Definition Effect.c:41
void CreateTrigger()
Definition TrapBase.c:480
void SpawnItems()
Definition ContaminatedArea_Dynamic.c:234

Перекрестные ссылки CreateTrigger(), m_Position, m_Radius и SpawnItems().

◆ OnParticleAllocation()

override void OnParticleAllocation ( ParticleManager pm,
array< ParticleSource > particles )
inlineprotected
268 {
269 super.OnParticleAllocation(pm, particles);
270
271 if ( m_DecayState > eAreaDecayStage.LIVE )
272 {
273 foreach ( ParticleSource p : particles )
274 {
275 if ( m_DecayState == eAreaDecayStage.DECAY_END )
276 {
277 p.SetParameter( 0, EmitorParam.BIRTH_RATE, DECAY_END_PART_BIRTH_RATE );
278 p.SetParameter( 0, EmitorParam.SIZE, DECAY_END_PART_SIZE );
279 }
280 else
281 {
282 p.SetParameter( 0, EmitorParam.BIRTH_RATE, DECAY_START_PART_BIRTH_RATE );
283 p.SetParameter( 0, EmitorParam.SIZE, DECAY_START_PART_SIZE );
284 }
285 }
286 }
287 }
const int DECAY_START_PART_BIRTH_RATE
Definition ContaminatedArea_Dynamic.c:48
const float DECAY_START_PART_SIZE
Definition ContaminatedArea_Dynamic.c:47
const float DECAY_END_PART_SIZE
Definition ContaminatedArea_Dynamic.c:49
const int DECAY_END_PART_BIRTH_RATE
Definition ContaminatedArea_Dynamic.c:50
Entity which has the particle instance as an ObjectComponent.
Definition ParticleSource.c:124
EmitorParam
Definition EnVisual.c:114

Перекрестные ссылки DECAY_END_PART_BIRTH_RATE, DECAY_END_PART_SIZE, DECAY_START_PART_BIRTH_RATE, DECAY_START_PART_SIZE и m_DecayState.

◆ OnVariablesSynchronized()

override void OnVariablesSynchronized ( )
inlineprotected
347 {
348 super.OnVariablesSynchronized();
349
350 if ( !m_ToxicClouds )
352
353 switch ( m_DecayState )
354 {
355 case eAreaDecayStage.START:
357 break;
358 case eAreaDecayStage.LIVE:
360
361 break;
362 case eAreaDecayStage.DECAY_START:
363 {
364 // We go through all the particles bound to this area and update relevant parameters
365 //Debug.Log("We start decay");
366 foreach ( Particle p : m_ToxicClouds )
367 {
368 p.SetParameter( 0, EmitorParam.BIRTH_RATE, DECAY_START_PART_BIRTH_RATE );
369 p.SetParameter( 0, EmitorParam.SIZE, DECAY_START_PART_SIZE );
370 }
371
372 break;
373 }
374 case eAreaDecayStage.DECAY_END:
375 {
376 // We go through all the particles bound to this area and update relevant parameters
377 //Debug.Log("We finish decay");
378 foreach ( Particle prt : m_ToxicClouds )
379 {
380 prt.SetParameter( 0, EmitorParam.BIRTH_RATE, DECAY_END_PART_BIRTH_RATE );
381 prt.SetParameter( 0, EmitorParam.SIZE, DECAY_END_PART_SIZE );
382 }
383
384 break;
385 }
386 default:
387 break;
388 }
389 }
void PlayExplosionLight()
Definition ContaminatedArea_Dynamic.c:324
Legacy way of using particles in the game.
Definition Particle.c:7

Перекрестные ссылки DECAY_END_PART_BIRTH_RATE, DECAY_END_PART_SIZE, DECAY_START_PART_BIRTH_RATE, DECAY_START_PART_SIZE, InitZoneClient(), m_DecayState и PlayExplosionLight().

◆ PlayExplosionLight()

void PlayExplosionLight ( )
inlineprotected
325 {
327 }
void ShellLight()
Definition ContaminatedArea_Dynamic.c:16
ShellLight m_ShellLight
Definition ContaminatedArea_Dynamic.c:36
Definition PointLightBase.c:2

Перекрестные ссылки m_OffsetPos, m_ShellLight и ShellLight().

Используется в OnVariablesSynchronized().

◆ PlayFlareVFX()

void PlayFlareVFX ( )
inlineprotected
330 {
331 if ( GetGame().IsClient() || ( GetGame().IsServer() && !GetGame().IsMultiplayer() ) )
332 {
333 // We spawn locally the dummy object which will be used to move and manage the particle
334 DynamicArea_Flare dummy = DynamicArea_Flare.Cast( GetGame().CreateObjectEx( "DynamicArea_Flare", m_OffsetPos, ECE_SETUP | ECE_LOCAL ) );
335
336 // We add some light to reinforce the effect
337 m_FlareLight = FlareLightContamination.Cast(ScriptedLightBase.CreateLight( FlareLightContamination, m_OffsetPos ));
338 }
339 }
const int ECE_LOCAL
Definition CentralEconomy.c:24
const int ECE_SETUP
Definition CentralEconomy.c:9
FlareLight m_FlareLight
Definition ContaminatedArea_Dynamic.c:35
Definition DynamicArea_Flare.c:3

Перекрестные ссылки ECE_LOCAL, ECE_SETUP, GetGame(), m_FlareLight и m_OffsetPos.

Используется в EEInit().

◆ PlayFX()

void PlayFX ( )
inlineprotected
303 {
304 if ( GetGame().IsServer() )
305 {
306 Param1<vector> pos; // The value to be sent through RPC
307 array<ref Param> params; // The RPC params
308
309 // We prepare to send the message
310 pos = new Param1<vector>( vector.Zero );
312
313 // We send the message with this set of coords
314 pos.param1 = m_OffsetPos;
315 params.Insert( pos );
316 GetGame().RPC( null, ERPCs.RPC_SOUND_CONTAMINATION, params, true );
317
318 // We go to the next stage
320 SetSynchDirty();
321 }
322 }
static const vector Zero
Definition EnConvert.c:110

Перекрестные ссылки GetGame(), m_DecayState, m_OffsetPos и vector::Zero.

◆ SetDecayState()

void SetDecayState ( int newState)
inlineprotected
157 {
158 if (m_DecayState != newState)
159 {
161
162 // We update the trigger state values as we also want to update player bound effects
163 if ( m_Trigger )
164 ContaminatedTrigger_Dynamic.Cast( m_Trigger ).SetAreaState( m_DecayState );
165
166 SetSynchDirty();
167 }
168 }

Перекрестные ссылки ContaminatedTrigger_Dynamic() и m_DecayState.

Используется в Tick().

◆ SpawnItems()

void SpawnItems ( )
inlineprotected
235 {
236 //Print("---------============ Spawning items at pos:"+m_Position);
237 foreach (int j, string type:SPAWN_ITEM_TYPE)
238 {
239 //Print("----------------------------------");
240 for (int i = 0; i < SPAWN_ITEM_COUNT[j]; i++)
241 {
246 vector mat[4];
248 mat[3] = spawnPos;
249 il.SetGround(NULL, mat);
250 //Print("Spawning item:"+ type + " at position:" + il.GetPos());
251 GetGame().CreateObjectEx(type, il.GetPos(), ECE_PLACE_ON_SURFACE);
252 }
253 }
254 }
const int ECE_PLACE_ON_SURFACE
Definition CentralEconomy.c:37
const ref array< string > SPAWN_ITEM_TYPE
Definition ContaminatedArea_Dynamic.c:55
const ref array< int > SPAWN_ITEM_COUNT
Definition ContaminatedArea_Dynamic.c:56
const ref array< float > SPAWN_ITEM_RAD_MIN
Definition ContaminatedArea_Dynamic.c:57
const ref array< float > SPAWN_ITEM_RAD_MAX
Definition ContaminatedArea_Dynamic.c:58
InventoryLocation.
Definition InventoryLocation.c:29
Definition EnMath3D.c:28
Definition EnMath.c:7
static vector RandomDir2D()
Returns randomly generated XZ unit vector with the Y(up) axis set to 0.
Definition EnConvert.c:260
static void MatrixIdentity4(out vector mat[4])
Creates identity matrix.
Definition EnMath3D.c:256
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Definition EnMath.c:106

Перекрестные ссылки ECE_PLACE_ON_SURFACE, GetGame(), m_Position, Math3D::MatrixIdentity4(), vector::RandomDir2D(), Math::RandomFloatInclusive(), SPAWN_ITEM_COUNT, SPAWN_ITEM_RAD_MAX, SPAWN_ITEM_RAD_MIN и SPAWN_ITEM_TYPE.

Используется в InitZoneServer().

◆ Tick()

override void Tick ( )
inlineprotected
141 {
143 {
144 // The second state of decay, further reduction of particle density and size
145 SetDecayState( eAreaDecayStage.DECAY_END );
146 }
148 {
149 // The first state of decay, slight reduction in particle density and size
150 SetDecayState( eAreaDecayStage.DECAY_START );
151 }
152
153 }
float GetRemainingTime()
Definition ContaminatedArea_Dynamic.c:125
float GetFinishDecayLifetime()
Definition ContaminatedArea_Dynamic.c:135
float GetStartDecayLifetime()
Definition ContaminatedArea_Dynamic.c:130
void SetDecayState(int newState)
Definition ContaminatedArea_Dynamic.c:156

Перекрестные ссылки GetFinishDecayLifetime(), GetRemainingTime(), GetStartDecayLifetime() и SetDecayState().

Поля

◆ AIRBORNE_EXPLOSION_DELAY

const int AIRBORNE_EXPLOSION_DELAY = 20
protected

Используется в EEOnCECreate().

◆ AIRBORNE_FX_OFFSET

const float AIRBORNE_FX_OFFSET = 50
protected

Используется в EEInit() и EEOnCECreate().

◆ AREA_SETUP_DELAY

const int AREA_SETUP_DELAY = 10
protected

Используется в EEOnCECreate().

◆ ARTILLERY_SHELL_SPEED

const float ARTILLERY_SHELL_SPEED = 100
protected

Используется в EEOnCECreate().

◆ DECAY_END_PART_BIRTH_RATE

const int DECAY_END_PART_BIRTH_RATE = 1
protected

Используется в OnParticleAllocation() и OnVariablesSynchronized().

◆ DECAY_END_PART_SIZE

const float DECAY_END_PART_SIZE = 17
protected

Используется в OnParticleAllocation() и OnVariablesSynchronized().

◆ DECAY_START_PART_BIRTH_RATE

const int DECAY_START_PART_BIRTH_RATE = 1
protected

Используется в OnParticleAllocation() и OnVariablesSynchronized().

◆ DECAY_START_PART_SIZE

const float DECAY_START_PART_SIZE = 32
protected

Используется в OnParticleAllocation() и OnVariablesSynchronized().

◆ FINISH_DECAY_LIFETIME

const float FINISH_DECAY_LIFETIME = 300
protected

Используется в GetFinishDecayLifetime().

◆ m_DecayState

◆ m_FlareLight

FlareLight m_FlareLight
protected

Используется в PlayFlareVFX().

◆ m_FXTimer

ref Timer m_FXTimer
protected

Используется в EEOnCECreate().

◆ m_OffsetPos

vector m_OffsetPos
protected

◆ m_ShellLight

ShellLight m_ShellLight
protected

Используется в PlayExplosionLight().

◆ m_StartupTimer

ref Timer m_StartupTimer
protected

Используется в EEOnCECreate().

◆ SPAWN_ITEM_COUNT

const ref array<int> SPAWN_ITEM_COUNT = {Math.RandomIntInclusive(2,5)}
protected
56{Math.RandomIntInclusive(2,5)};//how many of each type
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
Definition EnMath.c:54

Используется в SpawnItems().

◆ SPAWN_ITEM_RAD_MAX

const ref array<float> SPAWN_ITEM_RAD_MAX = {15}
protected
58{15};//max distance the item will be spawned from the area position(epicenter)

Используется в SpawnItems().

◆ SPAWN_ITEM_RAD_MIN

const ref array<float> SPAWN_ITEM_RAD_MIN = {5}
protected
57{5};//min distance the item will be spawned from the area position(epicenter)

Используется в SpawnItems().

◆ SPAWN_ITEM_TYPE

const ref array<string> SPAWN_ITEM_TYPE = {"Grenade_ChemGas"}
protected
55{"Grenade_ChemGas"};//item classnames

Используется в SpawnItems().

◆ START_DECAY_LIFETIME

const float START_DECAY_LIFETIME = 900
protected

Используется в GetStartDecayLifetime().


Объявления и описания членов класса находятся в файле: