DayZ
1.30
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
#ifndef NO_GUI
73
// We spawn VFX on client
74
PlaceParticles(
m_Position
,
m_Radius
, m_InnerRings, m_InnerSpacing, m_OuterRingToggle, m_OuterSpacing, m_OuterRingOffset, m_ParticleID);
75
#endif
76
}
77
78
override
void
InitZoneServer
()
79
{
80
super.InitZoneServer();
81
82
// We create the trigger on server
83
if
(m_TriggerType !=
""
)
84
CreateTrigger
(m_PositionTrigger,
m_Radius
);
85
}
86
87
override
void
OnParticleAllocation
(
ParticleManager
pm,
array<ParticleSource>
particles)
88
{
89
super.OnParticleAllocation(pm, particles);
90
91
if
(
m_DecayState
>
eAreaDecayStage
.LIVE)
92
{
93
foreach
(
ParticleSource
p : particles)
94
{
95
if
(
m_DecayState
==
eAreaDecayStage
.DECAY_END)
96
{
97
p.SetParameter(0,
EmitorParam
.BIRTH_RATE,
DECAY_END_PART_BIRTH_RATE
);
98
p.SetParameter(0,
EmitorParam
.SIZE,
DECAY_END_PART_SIZE
);
99
}
100
else
101
{
102
p.SetParameter(0,
EmitorParam
.BIRTH_RATE,
DECAY_START_PART_BIRTH_RATE
);
103
p.SetParameter(0,
EmitorParam
.SIZE,
DECAY_START_PART_SIZE
);
104
}
105
}
106
}
107
}
108
109
override
void
CreateTrigger
(
vector
pos,
int
radius)
110
{
111
super.CreateTrigger(pos, radius);
112
113
// This handles the specific case of dynamic triggers as some additionnal parameters are present
114
ContaminatedTrigger_Dynamic
dynaTrigger =
ContaminatedTrigger_Dynamic
.Cast(m_Trigger);
115
if
(dynaTrigger)
116
{
117
dynaTrigger.SetLocalEffects(m_AroundParticleID, m_TinyParticleID, m_PPERequesterIdx);
118
dynaTrigger.SetAreaState(
m_DecayState
);
119
}
120
}
121
122
override
void
OnVariablesSynchronized
()
123
{
124
super.OnVariablesSynchronized();
125
126
if
(!m_ToxicClouds)
127
m_ToxicClouds =
new
array<Particle>
();
128
129
switch
(
m_DecayState
)
130
{
131
case
eAreaDecayStage
.LIVE:
132
InitZoneClient
();
133
break
;
134
135
case
eAreaDecayStage
.DECAY_START:
136
// We go through all the particles bound to this area and update relevant parameters
137
//Debug.Log("We start decay");
138
foreach
(
Particle
p : m_ToxicClouds )
139
{
140
p.SetParameter( 0,
EmitorParam
.BIRTH_RATE,
DECAY_START_PART_BIRTH_RATE
);
141
p.SetParameter( 0,
EmitorParam
.SIZE,
DECAY_START_PART_SIZE
);
142
}
143
144
break
;
145
146
case
eAreaDecayStage
.DECAY_END:
147
// We go through all the particles bound to this area and update relevant parameters
148
//Debug.Log("We finish decay");
149
foreach
(
Particle
prt : m_ToxicClouds )
150
{
151
prt.SetParameter( 0,
EmitorParam
.BIRTH_RATE,
DECAY_END_PART_BIRTH_RATE
);
152
prt.SetParameter( 0,
EmitorParam
.SIZE,
DECAY_END_PART_SIZE
);
153
}
154
155
break
;
156
157
default
:
158
break
;
159
}
160
}
161
}
m_Type
eBleedingSourceType m_Type
Определения
4_World/DayZ/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:87
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:474
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:128
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Определения
IsBoxCollidingGeometryProxyClasses.c:28
vector
Определения
EnConvert.c:119
INIT
@ INIT
Определения
EnEntity.c:81
EmitorParam
EmitorParam
Определения
EnVisual.c:114
Ishodniki
scripts
4_World
DayZ
Classes
ContaminatedArea
ContaminatedArea_DynamicBase.c
Создано системой
1.13.2