DayZ
1.28
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
ContaminatedArea_DynamicBase.c
См. документацию.
1
enum
eAreaDecayStage
2
{
3
INIT
= 1,
// The dynamic area is initializing
4
START
= 2,
// The dynamic area is starting
5
LIVE
= 3,
// The dynamic area is live
6
DECAY_START
= 4,
// The dynamic area decay has started
7
DECAY_END
= 5,
// The dynamic area will soon be deleted
8
}
9
10
class
ContaminatedArea_DynamicBase
:
ContaminatedArea_Base
11
{
12
protected
int
m_DecayState
=
eAreaDecayStage
.INIT;
// The current state in which the area is
13
14
// Constants used for dissapearing events
15
const
float
DECAY_START_PART_SIZE
= 32;
16
const
int
DECAY_START_PART_BIRTH_RATE
= 1;
17
const
float
DECAY_END_PART_SIZE
= 17;
18
const
int
DECAY_END_PART_BIRTH_RATE
= 1;
19
const
float
START_DECAY_LIFETIME
= 900;
20
const
float
FINISH_DECAY_LIFETIME
= 300;
21
22
void
ContaminatedArea_DynamicBase
()
23
{
24
m_Type
=
eZoneType
.DYNAMIC;
25
26
RegisterNetSyncVariableInt(
"m_DecayState"
);
27
}
28
29
30
float
GetRemainingTime
()
31
{
32
return
GetLifetime();
33
}
34
35
float
GetStartDecayLifetime
()
36
{
37
return
START_DECAY_LIFETIME
;
38
}
39
40
float
GetFinishDecayLifetime
()
41
{
42
return
FINISH_DECAY_LIFETIME
;
43
}
44
45
// Set the new state of the Area
46
void
SetDecayState
(
int
newState)
47
{
48
if
(
m_DecayState
!= newState)
49
{
50
m_DecayState
= newState;
51
52
// We update the trigger state values as we also want to update player bound effects
53
if
( m_Trigger )
54
ContaminatedTrigger_Dynamic
.Cast( m_Trigger ).SetAreaState(
m_DecayState
);
55
56
SetSynchDirty();
57
}
58
}
59
60
// We spawn particles and setup trigger
61
override
void
InitZone
()
62
{
63
SetDecayState
(
eAreaDecayStage
.LIVE);
64
65
super.InitZone();
66
}
67
68
override
void
InitZoneClient
()
69
{
70
super.InitZoneClient();
71
72
// We spawn VFX on client
73
PlaceParticles(
m_Position
,
m_Radius
, m_InnerRings, m_InnerSpacing, m_OuterRingToggle, m_OuterSpacing, m_OuterRingOffset, m_ParticleID);
74
}
75
76
override
void
InitZoneServer
()
77
{
78
super.InitZoneServer();
79
80
// We create the trigger on server
81
if
(m_TriggerType !=
""
)
82
CreateTrigger
(m_PositionTrigger,
m_Radius
);
83
}
84
85
override
void
OnParticleAllocation
(
ParticleManager
pm,
array<ParticleSource>
particles)
86
{
87
super.OnParticleAllocation(pm, particles);
88
89
if
(
m_DecayState
>
eAreaDecayStage
.LIVE)
90
{
91
foreach
(
ParticleSource
p : particles)
92
{
93
if
(
m_DecayState
==
eAreaDecayStage
.DECAY_END)
94
{
95
p.SetParameter(0,
EmitorParam
.BIRTH_RATE,
DECAY_END_PART_BIRTH_RATE
);
96
p.SetParameter(0,
EmitorParam
.SIZE,
DECAY_END_PART_SIZE
);
97
}
98
else
99
{
100
p.SetParameter(0,
EmitorParam
.BIRTH_RATE,
DECAY_START_PART_BIRTH_RATE
);
101
p.SetParameter(0,
EmitorParam
.SIZE,
DECAY_START_PART_SIZE
);
102
}
103
}
104
}
105
}
106
107
override
void
CreateTrigger
(
vector
pos,
int
radius)
108
{
109
super.CreateTrigger(pos, radius);
110
111
// This handles the specific case of dynamic triggers as some additionnal parameters are present
112
ContaminatedTrigger_Dynamic
dynaTrigger =
ContaminatedTrigger_Dynamic
.Cast( m_Trigger );
113
if
(dynaTrigger)
114
{
115
dynaTrigger.SetLocalEffects( m_AroundParticleID, m_TinyParticleID, m_PPERequesterIdx );
116
dynaTrigger.SetAreaState(
m_DecayState
);
117
}
118
}
119
120
override
void
OnVariablesSynchronized
()
121
{
122
super.OnVariablesSynchronized();
123
124
if
(!m_ToxicClouds)
125
m_ToxicClouds =
new
array<Particle>
();
126
127
switch
(
m_DecayState
)
128
{
129
case
eAreaDecayStage
.LIVE:
130
InitZoneClient
();
131
break
;
132
case
eAreaDecayStage
.DECAY_START:
133
{
134
// We go through all the particles bound to this area and update relevant parameters
135
//Debug.Log("We start decay");
136
foreach
(
Particle
p : m_ToxicClouds )
137
{
138
p.SetParameter( 0,
EmitorParam
.BIRTH_RATE,
DECAY_START_PART_BIRTH_RATE
);
139
p.SetParameter( 0,
EmitorParam
.SIZE,
DECAY_START_PART_SIZE
);
140
}
141
142
break
;
143
}
144
case
eAreaDecayStage
.DECAY_END:
145
{
146
// We go through all the particles bound to this area and update relevant parameters
147
//Debug.Log("We finish decay");
148
foreach
(
Particle
prt : m_ToxicClouds )
149
{
150
prt.SetParameter( 0,
EmitorParam
.BIRTH_RATE,
DECAY_END_PART_BIRTH_RATE
);
151
prt.SetParameter( 0,
EmitorParam
.SIZE,
DECAY_END_PART_SIZE
);
152
}
153
154
break
;
155
}
156
default
:
157
break
;
158
}
159
}
160
}
m_Type
eBleedingSourceType m_Type
Определения
4_World/Classes/BleedingSources/BleedingSource.c:25
m_Radius
float m_Radius
Определения
AIGroupBehaviour.c:10
InitZoneServer
override void InitZoneServer()
Определения
ContaminatedArea.c:56
InitZoneClient
override void InitZoneClient()
Определения
ContaminatedArea.c:54
OnVariablesSynchronized
override void OnVariablesSynchronized()
Определения
ContaminatedArea_Dynamic.c:94
OnParticleAllocation
override void OnParticleAllocation(ParticleManager pm, array< ParticleSource > particles)
Определения
ContaminatedArea_DynamicBase.c:85
InitZone
override void InitZone()
Определения
ContaminatedArea_DynamicBase.c:61
DECAY_START_PART_BIRTH_RATE
const int DECAY_START_PART_BIRTH_RATE
Определения
ContaminatedArea_DynamicBase.c:16
GetFinishDecayLifetime
float GetFinishDecayLifetime()
Определения
ContaminatedArea_DynamicBase.c:40
DECAY_START_PART_SIZE
const float DECAY_START_PART_SIZE
Определения
ContaminatedArea_DynamicBase.c:15
ContaminatedArea_DynamicBase
void ContaminatedArea_DynamicBase()
Определения
ContaminatedArea_DynamicBase.c:22
FINISH_DECAY_LIFETIME
const float FINISH_DECAY_LIFETIME
Определения
ContaminatedArea_DynamicBase.c:20
m_DecayState
enum eAreaDecayStage m_DecayState
DECAY_END_PART_SIZE
const float DECAY_END_PART_SIZE
Определения
ContaminatedArea_DynamicBase.c:17
GetStartDecayLifetime
float GetStartDecayLifetime()
Определения
ContaminatedArea_DynamicBase.c:35
DECAY_END_PART_BIRTH_RATE
const int DECAY_END_PART_BIRTH_RATE
Определения
ContaminatedArea_DynamicBase.c:18
eAreaDecayStage
eAreaDecayStage
Определения
ContaminatedArea_DynamicBase.c:2
DECAY_START
@ DECAY_START
Определения
ContaminatedArea_DynamicBase.c:6
DECAY_END
@ DECAY_END
Определения
ContaminatedArea_DynamicBase.c:7
LIVE
@ LIVE
Определения
ContaminatedArea_DynamicBase.c:5
START_DECAY_LIFETIME
const float START_DECAY_LIFETIME
Определения
ContaminatedArea_DynamicBase.c:19
SetDecayState
void SetDecayState(int newState)
Определения
ContaminatedArea_DynamicBase.c:46
ContaminatedTrigger_Dynamic
void ContaminatedTrigger_Dynamic()
Определения
ContaminatedTrigger.c:96
m_Position
vector m_Position
Cached world position.
Определения
Effect.c:43
eZoneType
eZoneType
Определения
EffectArea.c:5
START
class SEffectManager START
GetRemainingTime
float GetRemainingTime()
Определения
NotificationSystem.c:40
ParticleManager
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Определения
ParticleManager.c:88
CreateTrigger
void CreateTrigger()
Определения
TrapBase.c:475
ContaminatedArea_Base
Определения
ContaminatedArea.c:2
Particle
Legacy way of using particles in the game.
Определения
Particle.c:7
ParticleSource
Entity which has the particle instance as an ObjectComponent.
Определения
ParticleSource.c:124
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Определения
IsBoxCollidingGeometryProxyClasses.c:28
vector
Определения
EnConvert.c:106
INIT
@ INIT
Определения
EnEntity.c:81
EmitorParam
EmitorParam
Определения
EnVisual.c:114
Ishodniki
scripts
4_World
Classes
ContaminatedArea
ContaminatedArea_DynamicBase.c
Создано системой
1.13.2