4 protected SoundOnVehicle m_SoundObject;
5 protected bool m_Canceled;
6 protected bool m_Interrupted;
13 int GetPossileStanceMask()
15 return m_ActionData.m_PossibleStanceMask;
19 override void OnFinish(
bool pCanceled)
24 Debug.ActionLog(
"Time stamp: " + m_ActionData.m_Player.GetSimulationTimeStamp(), m_ActionData.m_Action.ToString() ,
"n/a",
"OnFinish", m_ActionData.m_Player.ToString() );
26 Debug.ActionLog(
"n/a", this.
ToString() ,
"n/a",
"OnFinish",
"n/a" );
30 GetGame().ObjectDelete(m_SoundObject);
32 if ( m_ActionData && m_ActionData.m_Player )
36 m_ActionData.m_State = m_ActionData.m_ActionComponent.Interrupt(m_ActionData);
42 action.End(m_ActionData);
46 void SetCommand(
int command_uid )
53 void CreateActionComponent()
55 m_ActionData.m_ActionComponent =
new CADummy;
58 void InitActionComponent()
62 void ProgressActionComponent()
64 if ( m_ActionData.m_ActionComponent )
66 m_ActionData.m_State = m_ActionData.m_ActionComponent.Execute(m_ActionData);
70 void EndActionComponent()
81 Debug.ActionLog(
"n/a", this.
ToString() ,
"n/a",
"Interrupt", m_ActionData.m_Player.ToString() );
83 if (
GetGame().IsMultiplayer() )
103 m_ActionData = action_data;
106 override bool IsUserActionCallback()
111 float GetActionComponentProgress()
113 if ( m_ActionData.m_ActionComponent )
115 return m_ActionData.m_ActionComponent.GetProgress();
122 return m_ActionData.m_State;
127 return m_ActionData.m_Target;
135 protected int m_CommandUID;
136 protected int m_CommandUIDProne;
137 protected typename m_CallbackClass;
149 protected void OnAlternativeEndServer(
PlayerBase player )
152 protected void OnAlternativeEndClient(
PlayerBase player )
156 protected void OnInterruptServer(
PlayerBase player )
159 protected void OnInterruptClient(
PlayerBase player )
163 protected void OnExecute(
ActionData action_data )
167 protected void OnExecuteServer(
ActionData action_data )
171 protected void OnExecuteClient(
ActionData action_data )
176 void OnAnimationEvent(
ActionData action_data )
178 if (action_data && !action_data.m_WasExecuted)
182 if (action && ( !action.UseMainItem() || action_data.m_MainItem ) && ( !action.HasTarget() || action_data.m_Target ))
186 Debug.ActionLog(
"Time stamp: " + action_data.m_Player.GetSimulationTimeStamp(),
this.ToString() ,
"n/a",
"OnExecute", action_data.m_Player.ToString() );
188 OnExecute(action_data);
191 OnExecuteServer(action_data);
193 OnExecuteClient(action_data);
195 action_data.m_WasExecuted =
true;
196 action_data.m_WasActionStarted =
true;
201 override bool ActionConditionContinue(
ActionData action_data )
203 return ActionCondition(action_data.m_Player,action_data.m_Target,action_data.m_MainItem);
212 protected int GetActionCommand(
PlayerBase player )
214 if ( HasProneException() )
219 return m_CommandUIDProne;
224 protected typename GetCallbackClassTypename()
226 return m_CallbackClass;
230 override bool HasProneException()
236 protected void CreateAndSetupActionCallback(
ActionData action_data )
242 Class.CastTo(callback, action_data.m_Player.StartCommand_Action(GetActionCommand(action_data.m_Player),GetCallbackClassTypename(),
GetStanceMask(action_data.m_Player)));
247 Class.CastTo(callback, action_data.m_Player.AddCommandModifier_Action(GetActionCommand(action_data.m_Player),GetCallbackClassTypename()));
251 callback.SetActionData(action_data);
252 callback.InitActionComponent();
253 action_data.m_Callback = callback;
262 super.Start( action_data );
267 CreateAndSetupActionCallback(action_data);
276 override void Interrupt(
ActionData action_data )
278 if ( action_data.m_Callback )
280 action_data.m_Callback.Cancel();
296 if ( state ==
UA_ERROR || !action_data.m_Callback || !action_data.m_Player || !action_data.m_ActionComponent )
298 #ifdef DIAG_DEVELOPER
301 Debug.ActionLog(
"ABRUPT CANCEL, CONDITIONS NOT MET", this.
ToString() ,
"n/a",
"Do", action_data.m_Player.ToString() );
304 if ( action_data.m_Callback && action_data.m_Player )
306 action_data.m_Callback.Interrupt();
310 Debug.ActionLog(
"PLAYER LOST", this.
ToString() ,
"n/a",
"Do", action_data.m_Player.ToString() );
320 action_data.m_Callback.ProgressActionComponent();
325 action_data.m_Callback.Interrupt();
333 action_data.m_Callback.EndActionComponent();
338 action_data.m_Callback.EndActionComponent();
344 action_data.m_Callback.Interrupt();
349 Debug.ActionLog(
"Action component returned wrong value", this.
ToString() ,
"n/a",
"Do", action_data.m_Player.ToString() );
350 action_data.m_Callback.Interrupt();
359 if ( action_data.m_Player )
364 action_data.m_Player.SetSoundCategoryHash(0);
373 if ( action_data.m_WasActionStarted )
377 GetGame().GetAnalyticsClient().OnActionEat();
381 GetGame().GetAnalyticsClient().OnActionDrink();
384 action_data.m_WasActionStarted =
false;
387 action_data.m_Player.GetActionManager().OnActionEnd();
395 Debug.ActionLog(
"Ation could not be finished right at the end", this.
ToString() ,
"n/a",
"End", action_data.m_Player.ToString() );
397 action_data.m_Callback.Interrupt();
401 override float GetProgress(
ActionData action_data )
403 if ( action_data.m_ActionComponent )
405 return action_data.m_ActionComponent.GetProgress();