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)
92 return this.ClassName();
105 void SetParam(
Param p)
110 bool IsSyncToClient()
112 return m_SyncToClient;
117 for (
int i = 0; i < m_PersistentParams.Count(); i++)
119 params.Insert(m_PersistentParams.Get(i));
123 void MakeParamObjectPersistent(
Param object)
125 if ( !
GetGame().IsServer() && !
GetGame().IsMultiplayer() )
return;
127 m_PersistentParams.Insert(
object);
159 if ( IsActivated() ) Deactivate();
160 if ( GetManager() )
m_Manager.OnSymptomExit(
this, m_UID);
165 m_IsActivated =
true;
169 if (
GetGame().IsMultiplayer() )
171 if ( IsSyncToClient() )
172 SyncToClientActivated( GetType(), GetUID() );
173 #ifdef DIAG_DEVELOPER
174 GetManager().SendServerDebugToClient();
178 if ( !
GetGame().IsDedicatedServer() )
187 m_IsActivated =
false;
191 if (
GetGame().IsMultiplayer() && IsSyncToClient() )
193 SyncToClientDeactivated( GetType(), GetUID() );
196 if ( !
GetGame().IsDedicatedServer() )
205 return m_IsActivated;
210 void Update(
float deltatime)
214 m_ServerUpdateDelta += deltatime;
215 if (m_ServerUpdateDelta > m_ServerUpdateInterval )
218 OnUpdateServer(
m_Player, m_ServerUpdateDelta);
219 m_ServerUpdateDelta = 0;
224 OnUpdateClient(
m_Player, deltatime);
228 OnUpdateClient(
m_Player, deltatime);
233 void PlayAnimationFB(
int animation,
int stance_mask,
float running_time = -1)
236 m_AnimPlayRequested =
true;
239 void PlayAnimationADD(
int type)
242 m_AnimPlayRequested =
true;
247 GetPlayer().RequestSoundEvent(
id);
248 m_PlayedSound =
true;
251 void SyncToClientActivated(
int SYMPTOM_id,
int uid )
253 if ( !GetPlayer() )
return;
260 void SyncToClientDeactivated(
int SYMPTOM_id,
int uid )
262 if ( !GetPlayer() )
return;
268 void CheckSoundFinished()
279 CheckSoundFinished();
295 void RequestDestroy()
308 void AnimationFinish()
311 if ( m_DestroyOnAnimFinish ) RequestDestroy();
315 void AnimationPlayFailed()
317 OnAnimationPlayFailed();
321 void AnimationStart()
326 protected void OnAnimationFinish();
327 protected void OnAnimationStart();
328 protected void OnAnimationPlayFailed();
335 void OnUpdateServer(
PlayerBase player,
float deltatime);
336 bool CanActivate(){
return true;}
338 void OnUpdateClient(
PlayerBase player,
float deltatime);
343 void OnGetDeactivatedServer(
PlayerBase player);
344 void OnGetDeactivatedClient(
PlayerBase player);