51class Land_Underground_EntranceBase : House
57 ref
Timer m_NavmeshTimer;
59 EUndegroundDoorType m_DoorType;
66 private ref
Timer m_TempHotfixTimer;
68 private const float TEMP_HOTIX_TIMESLICE = 0.01;
70 void Land_Underground_EntranceBase()
72 m_DoorType = EUndegroundDoorType.MAIN;
74 RegisterNetSyncVariableFloat(
"m_AnimPhase", 0,1,5);
81 m_TempHotfixTimer =
new Timer();
82 m_TempHotfixTimer.Run(TEMP_HOTIX_TIMESLICE,
this,
"EOnPostSimulate", null,
true);
88 void ~Land_Underground_EntranceBase()
92 CleanUpOnDeleteClient();
94 if (m_TempHotfixTimer)
96 m_TempHotfixTimer.Stop();
97 m_TempHotfixTimer = null;
104 void CleanUpOnDeleteClient()
113 bool CanManipulate(
Param param = null)
118 void Manipulate(
Param param = null)
127 void OnUpdateClient(
float timeSlice);
129 override void EOnPostSimulate(
IEntity other,
float timeSlice)
132 OnUpdateClient(TEMP_HOTIX_TIMESLICE);
136 void OnUpdateServer()
138 m_AnimPhase = m_AnimTimerDoorServer.GetValue() / AdjustTime(GetOpeningTime());
139 SetAnimationPhaseNow(
"EntranceDoor",m_AnimPhase);
141 g_Game.GetWorld().UpdatePathgraphDoorByAnimationSourceName(
this,
"EntranceDoor");
154 if (p.GetClosestDoor() ==
this)
166 return m_DoorState == state || ( IsInitDoorStateSync() && m_DoorState > state && m_DoorState <= lastValidState);
169 float AdjustTime(
float originalTime,
float adjustedTime = -1)
171 #ifdef DIAG_DEVELOPER
174 if (adjustedTime != -1)
178 if (FeatureTimeAccel.GetFeatureTimeAccelEnabled(ETimeAccelCategories.UNDERGROUND_ENTRANCE))
180 timeAccel = FeatureTimeAccel.GetFeatureTimeAccelValue();
181 return originalTime / timeAccel;
187 float GetOpeningTime()
196 targetState = m_DoorState + 1;
203 m_DoorState = newState;
204 OnDoorStateChangedServer(newState);
222 HandleAudioPlayback(newState, prevState);
223 HandleVisualPlayback(newState, prevState);
225 if (!m_ConnectedPanels)
228 GetConnectedPanels(m_ConnectedPanels);
232 p.OnDoorStateChangedClient(newState, prevState);
236 void OpenServer(
bool force =
false)
238 g_Game.RegisterNetworkStaticObject(
this);
248 void OnFinishedTimerServer();
252 super.OnVariablesSynchronized();
254 if (m_DoorState != m_DoorStatePrev)
256 OnDoorStateChangedClient(m_DoorState, m_DoorStatePrev);
257 m_DoorStatePrev = m_DoorState;
261 bool IsInitDoorStateSync()
272 if (
g_Game.IsDedicatedServer())
287 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
293 super.GetDebugActions(outputList);
298 if (super.OnAction(action_id, player, ctx))
302 if (action_id ==
EActions.ACTIVATE_ENTITY)
307 else if (action_id ==
EActions.DEACTIVATE_ENTITY)
310 if (!m_AnimTimerDoorServer)
proto native vector Vector(float x, float y, float z)
Vector constructor from components.