3 const float MAX_TIME_ACTIVE_SAVEGUARD = 20;
5 SoundOnVehicle m_SoundObject;
9 float m_ServerUpdateInterval = 1;
10 float m_ServerUpdateDelta;
11 bool m_IsTemplate =
true;
12 float m_ActivatedTime;
16 bool m_DestroyOnAnimFinish =
true;
17 bool m_DestroyRequested =
false;
18 int m_SymptomType = -1;
19 bool m_IsPersistent =
false;
21 bool m_SyncToClient =
false;
23 bool m_AnimPlayRequested;
26 SymptomCB m_AnimCallback;
64 bool CanBeInterupted()
66 if (m_AnimPlayRequested)
76 return m_IsClientOnly;
80 void SetDuration(
float duration)
82 m_Duration = duration;
92 return this.ClassName();
105 void SetParam(
Param p)
110 bool IsSyncToClient()
112 return m_SyncToClient;
116 bool IsSyncToRemotes()
123 for (
int i = 0; i < m_PersistentParams.Count(); i++)
125 params.Insert(m_PersistentParams.Get(i));
129 void MakeParamObjectPersistent(
Param object)
131 if ( !
g_Game.IsServer() && !
g_Game.IsMultiplayer() )
return;
133 m_PersistentParams.Insert(
object);
138 return m_IsPersistent;
149 bool AllowInUnconscious()
171 if ( IsActivated() ) Deactivate();
172 if (
GetManager() ) m_Manager.OnSymptomExit(
this, m_UID);
177 m_IsActivated =
true;
181 if (
g_Game.IsMultiplayer() )
183 if ( IsSyncToClient() )
184 SyncToClientActivated(
GetType(), GetUID() );
185 #ifdef DIAG_DEVELOPER
190 if ( !
g_Game.IsDedicatedServer() )
199 m_IsActivated =
false;
203 if (
g_Game.IsMultiplayer() && IsSyncToClient() )
205 SyncToClientDeactivated(
GetType(), GetUID() );
208 if ( !
g_Game.IsDedicatedServer() )
217 return m_IsActivated;
222 void Update(
float deltatime)
226 m_ServerUpdateDelta += deltatime;
227 if (m_ServerUpdateDelta > m_ServerUpdateInterval )
229 m_ActivatedTime += m_ServerUpdateDelta;
231 m_ServerUpdateDelta = 0;
245 void PlayAnimationFB(
int animation,
int stance_mask,
float running_time = -1)
248 m_AnimPlayRequested =
true;
251 void PlayAnimationADD(
int type)
254 m_AnimPlayRequested =
true;
260 m_PlayedSound =
true;
266 m_PlayedSound =
false;
269 void SyncToClientActivated(
int SYMPTOM_id,
int uid )
278 void SyncToClientDeactivated(
int SYMPTOM_id,
int uid )
286 void CheckSoundFinished()
290 if (m_PlayedSound && m_ActivatedTime >= m_Duration)
297 CheckSoundFinished();
298 if ( IsPrimary() && m_ActivatedTime > MAX_TIME_ACTIVE_SAVEGUARD)
303 if (m_DestroyRequested)
313 void RequestDestroy()
315 m_DestroyRequested =
true;
326 void AnimationFinish()
329 if ( m_DestroyOnAnimFinish ) RequestDestroy();
333 void AnimationPlayFailed()
339 void AnimationStart()