DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ EEOnCECreate()

override void EEOnCECreate ( )
protected

См. определение в файле ContaminatedArea_Dynamic.c строка 42

43 {
44 // We get the PPE index for future usage and synchronization ( we must do it here for dynamic as it is not read through file )
45 m_PPERequesterIdx = GetRequesterIndex(m_PPERequesterType);
46
47 // If this is the first initialization, we delay it in order to play cool effects
48 if (m_DecayState == eAreaDecayStage.INIT)
49 {
50 vector areaPos = GetPosition();
51 m_OffsetPos = areaPos;
53 vector closestPoint = areaPos;
54
55 // play artillery sound, sent to be played for everyone on server
56 array<vector> artilleryPoints = g_Game.GetMission().GetWorldData().GetArtyFiringPos();
57 int index = 0;
58 foreach (int i, vector artilleryPoint : artilleryPoints)
59 {
60 int dist = 0;
61 int temp = vector.DistanceSq(artilleryPoint, areaPos);
62 if (temp < dist || dist == 0)
63 {
64 dist = temp;
65 index = i;
66 }
67 }
68
69 closestPoint = artilleryPoints.Get(index);
70
71 // We calculate the delay depending on distance from firing position to simulate shell travel time
72 float delay = vector.Distance(closestPoint, areaPos);
73 delay = delay / ARTILLERY_SHELL_SPEED;
74 delay += AIRBORNE_EXPLOSION_DELAY; // We add the base, minimum time ( no area can start before this delay )
75
76 Param3<vector, vector, float> pos = new Param3<vector, vector, float>(closestPoint, areaPos, delay);
78 // We send the message with this set of coords
79 params.Insert(pos);
80 g_Game.RPC(null, ERPCs.RPC_SOUND_ARTILLERY_SINGLE, params, true);
81
83 m_FXTimer.Run(delay, this, "PlayFX");
84
85 delay += AREA_SETUP_DELAY; // We have an additional delay between shell detonation and finalization of area creation
86 // setup zone
88 m_StartupTimer.Run(delay, this, "InitZone");
89 }
90
91 SetSynchDirty();
92 }
ref Timer m_FXTimer
Определения ContaminatedArea_Dynamic.c:26
const int AIRBORNE_EXPLOSION_DELAY
Определения ContaminatedArea_Dynamic.c:31
const int AREA_SETUP_DELAY
Определения ContaminatedArea_Dynamic.c:32
ShellLight m_OffsetPos
const float AIRBORNE_FX_OFFSET
Определения ContaminatedArea_Dynamic.c:33
const float ARTILLERY_SHELL_SPEED
Определения ContaminatedArea_Dynamic.c:34
ref Timer m_StartupTimer
Определения ContaminatedArea_Dynamic.c:25
enum eAreaDecayStage m_DecayState
eAreaDecayStage
Определения ContaminatedArea_DynamicBase.c:2
DayZGame g_Game
Определения DayZGame.c:3942
ERPCs
Определения ERPCs.c:2
Определения DayZPlayerImplement.c:39
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
Определения EnConvert.c:119
vector GetPosition()
Get the world position of the Effect.
Определения Effect.c:473
const int CALL_CATEGORY_GAMEPLAY
Определения 3_Game/DayZ/tools/tools.c:10

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