23 enum EUndegroundDoorType
33 SetVisibleDuringDaylight(
true);
36 SetFlareVisible(
false);
37 SetAmbientColor(1.0, 0.0, 0.0);
38 SetDiffuseColor(1.0, 0.0, 0.0);
40 SetDisableShadowsWithinRadius(-1);
57 ref
Timer m_NavmeshTimer;
59 EUndegroundDoorType m_DoorType;
67 m_DoorType = EUndegroundDoorType.MAIN;
69 RegisterNetSyncVariableFloat(
"m_AnimPhase", 0,1,5);
83 CleanUpOnDeleteClient();
89 void CleanUpOnDeleteClient()
92 CleanUpOnClosedClient();
96 void CleanUpOnClosedClient();
98 bool CanManipulate(
Param param =
null)
103 void Manipulate(
Param param =
null)
112 void OnUpdateClient(
float timeSlice);
114 override void EOnPostSimulate(
IEntity other,
float timeSlice)
121 void OnUpdateServer()
123 m_AnimPhase = m_AnimTimerDoorServer.GetValue() / AdjustTime(GetOpeningTime());
124 SetAnimationPhaseNow(
"EntranceDoor",m_AnimPhase);
126 GetGame().GetWorld().UpdatePathgraphDoorByAnimationSourceName(
this,
"EntranceDoor");
139 if (p.GetClosestDoor() ==
this)
151 return m_DoorState == state || ( IsInitDoorStateSync() && m_DoorState > state && m_DoorState <= lastValidState);
154 float AdjustTime(
float originalTime,
float adjustedTime = -1)
156 #ifdef DIAG_DEVELOPER
159 if (adjustedTime != -1)
163 if (FeatureTimeAccel.GetFeatureTimeAccelEnabled(ETimeAccelCategories.UNDERGROUND_ENTRANCE))
165 timeAccel = FeatureTimeAccel.GetFeatureTimeAccelValue();
166 return originalTime / timeAccel;
172 float GetOpeningTime()
181 targetState = m_DoorState + 1;
188 m_DoorState = newState;
189 OnDoorStateChangedServer(newState);
207 HandleAudioPlayback(newState, prevState);
208 HandleVisualPlayback(newState, prevState);
210 if (!m_ConnectedPanels)
213 GetConnectedPanels(m_ConnectedPanels);
217 p.OnDoorStateChangedClient(newState, prevState);
221 void OpenServer(
bool force =
false)
223 GetGame().RegisterNetworkStaticObject(
this);
233 void OnFinishedTimerServer();
235 override void OnVariablesSynchronized()
237 super.OnVariablesSynchronized();
239 if (m_DoorState != m_DoorStatePrev)
241 OnDoorStateChangedClient(m_DoorState, m_DoorStatePrev);
242 m_DoorStatePrev = m_DoorState;
246 bool IsInitDoorStateSync()
257 if (
GetGame().IsDedicatedServer())
272 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
278 super.GetDebugActions(outputList);
283 if (super.OnAction(action_id, player, ctx))
287 if (action_id ==
EActions.ACTIVATE_ENTITY)
292 else if (action_id ==
EActions.DEACTIVATE_ENTITY)
295 if (!m_AnimTimerDoorServer)
378 m_AnimTimerDoorServer.Run(
AdjustTime(GetOpeningTime()),
this,
"OnUpdateServer",
"OnFinishedTimerServer",0,
false, 1);
379 m_NavmeshTimer =
new Timer();
380 m_NavmeshTimer.Run(3,
this,
"NavmeshUpdate", NULL,
true);
381 RequestLatentTransition(
AdjustTime(GetOpeningTime()));
384 m_AnimTimerDoorServer.Stop();
386 m_NavmeshTimer =
null;
402 m_NavmeshTimer =
new Timer();
403 m_NavmeshTimer.Run(3,
this,
"NavmeshUpdate", NULL,
true);
404 m_AnimTimerDoorServer.Run(0,
this,
"OnUpdateServer",
"OnFinishedTimerServer",
AdjustTime(GetOpeningTime()),
false, 1);
405 RequestLatentTransition(
AdjustTime(GetOpeningTime()));
409 m_NavmeshTimer =
null;
427 if (MemoryPointExists(
"SirenLightPos"))
429 pos = GetMemoryPointPos(
"SirenLightPos");
430 pos = ModelToWorld(pos);
434 ErrorEx(
"GetLightPosition could not locate memory point 'SirenLightPos'");
562 SetAnimationPhaseNow(
"EntranceDoor",m_AnimPhase);