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

◆ EEOnCECreate()

override void ContaminatedArea_Dynamic::EEOnCECreate ( )
inlineprotected

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

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() )
70 m_PPERequesterIdx = GetRequesterIndex(m_PPERequesterType);
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 {
77 vector areaPos = GetPosition();
78 m_OffsetPos = areaPos;
80
81 // play artillery sound, sent to be played for everyone on server
82 array<vector> artilleryPoints = GetGame().GetMission().GetWorldData().GetArtyFiringPos();
83 vector closestPoint = areaPos;
84 int dist = 0;
85 int temp;
86 int index = 0;
87 for ( int i = 0; i < artilleryPoints.Count(); i++ )
88 {
89 temp = vector.DistanceSq( artilleryPoints.Get( i ), areaPos );
90 if ( temp < dist || dist == 0 )
91 {
92 dist = temp;
93 index = i;
94 }
95 }
96
97 closestPoint = artilleryPoints.Get( index );
98
99 // We calculate the delay depending on distance from firing position to simulate shell travel time
100 float delay = vector.Distance( closestPoint, areaPos );
101 delay = delay / ARTILLERY_SHELL_SPEED;
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
108 pos = new Param3<vector, vector, float>( closestPoint, areaPos, delay );
109 params = new array<ref Param>;
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
115 m_FXTimer = new Timer( CALL_CATEGORY_GAMEPLAY );
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 }
eAreaDecayStage
Определения ContaminatedArea_Dynamic.c:2
ERPCs
Определения ERPCs.c:2
proto native void RPC(Object target, int rpcType, notnull array< ref Param > params, bool guaranteed, PlayerIdentity recipient=null)
Initiate remote procedure call. When called on client, RPC is evaluated on server; When called on ser...
proto native Mission GetMission()
const float ARTILLERY_SHELL_SPEED
Определения ContaminatedArea_Dynamic.c:44
ref Timer m_StartupTimer
Определения ContaminatedArea_Dynamic.c:33
const float AIRBORNE_FX_OFFSET
Определения ContaminatedArea_Dynamic.c:43
const int AREA_SETUP_DELAY
Определения ContaminatedArea_Dynamic.c:42
const int AIRBORNE_EXPLOSION_DELAY
Определения ContaminatedArea_Dynamic.c:41
WorldData GetWorldData()
Определения gameplay.c:743
array< vector > GetArtyFiringPos()
Определения WorldData.c:247
proto native CGame GetGame()
class JsonUndergroundAreaTriggerData GetPosition
Определения UndergroundAreaLoader.c:9
const int CALL_CATEGORY_GAMEPLAY
Определения tools.c:10

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