Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
contaminatedarea_local.c
Go to the documentation of this file.
1class ContaminatedArea_Local : ContaminatedArea_DynamicBase
2{
3 const float TICK_RATE = 1;
4 ref Timer m_Timer1 = new Timer;
5 float m_Lifetime = 360;
6
8 {
9 m_EffectsPriority = -10;
10 }
11
12 override void SetupZoneData(EffectAreaParams params)
13 {
14 params.m_ParamPartId = ParticleList.CONTAMINATED_AREA_GAS_AROUND;
15 params.m_ParamInnerRings = 0;
16 params.m_ParamPosHeight = 3;
17 params.m_ParamNegHeight = 3;
18 params.m_ParamRadius = 10;
19 params.m_ParamOuterToggle = false;
20 params.m_ParamTriggerType = "ContaminatedTrigger_Local";
21
22 params.m_ParamAroundPartId = 0;
23 params.m_ParamTinyPartId = 0;
24
25 super.SetupZoneData(params);
26
27 InitZone();
28 }
29
30 override void EEInit()
31 {
32 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
33 m_Timer1.Run(TICK_RATE, this, "Tick", NULL, true);
34 }
35
36 override void DeferredInit()
37 {
38 super.DeferredInit();
39
40 if (!m_ToxicClouds)
41 m_ToxicClouds = new array<Particle>();
42
43 SetupZoneData(new EffectAreaParams);
44 }
45
46 override void SpawnParticles(ParticlePropertiesArray props, vector centerPos, vector partPos, inout int count)
47 {
48 partPos[1] = GetGame().SurfaceRoadY(partPos[0], partPos[2]); // Snap particles to ground
49
50 // We make sure that spawned particle is inside the trigger
51 if (!Math.IsInRange(partPos[1], centerPos[1] - m_NegativeHeight, centerPos[1] + m_PositiveHeight))
52 partPos[1] = centerPos[1];
53
54 props.Insert(ParticleProperties(partPos, ParticlePropertiesFlags.PLAY_ON_CREATION, null, GetGame().GetSurfaceOrientation( partPos[0], partPos[2] ), this));
55 ++count;
56 }
57
58 override float GetStartDecayLifetime()
59 {
60 return 20;
61 }
62
63 override float GetFinishDecayLifetime()
64 {
65 return 10;
66 }
67
68 override float GetRemainingTime()
69 {
70 return m_Lifetime;
71 }
72
73 override void Tick()
74 {
75 m_Lifetime -= TICK_RATE;
76 if (m_Lifetime <= 0)
77 Delete();
78 }
79}
proto native float SurfaceRoadY(float x, float z, RoadSurfaceDetection rsd=RoadSurfaceDetection.LEGACY)
Definition enmath.c:7
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
override void InitZone()
proto native CGame GetGame()
class MuzzleFlashLight extends PointLightBase m_Lifetime