Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
cainteractloop.c
Go to the documentation of this file.
2 {
3  protected float m_LocalTimeElpased;
4  protected float m_TimeElpased;
5  protected float m_TimeToComplete;
6  protected float m_DefaultTimeToComplete;
7  protected ref Param1<float> m_SpentUnits;
8 
9  void CAInteractLoop( float time_to_complete_action )
10  {
11  m_DefaultTimeToComplete = time_to_complete_action;
12  }
13 
14  override void Setup( ActionData action_data )
15  {
16  m_TimeElpased = 0;
17  if ( !m_SpentUnits )
18  {
19  m_SpentUnits = new Param1<float>(0);
20  }
21  else
22  {
23  m_SpentUnits.param1 = 0;
24  }
25 
26  m_TimeToComplete = action_data.m_Player.GetSoftSkillsManager().SubtractSpecialtyBonus( m_DefaultTimeToComplete, m_Action.GetSpecialtyWeight(), true);
27  }
28 
29  override int Execute( ActionData action_data )
30  {
31  if ( !action_data.m_Player )
32  {
33  return UA_ERROR;
34  }
35 
36  if ( m_TimeElpased < m_TimeToComplete )
37  {
38  m_TimeElpased += action_data.m_Player.GetDeltaT();
39  return UA_PROCESSING;
40  }
41  else
42  {
43  if ( m_SpentUnits )
44  {
45  m_SpentUnits.param1 = m_TimeElpased;
46  SetACData(m_SpentUnits);
47  }
48  return UA_FINISHED;
49  }
50  }
51 
52 };
UA_ERROR
const int UA_ERROR
Definition: constants.c:455
CABase
Definition: cabase.c:1
UA_FINISHED
const int UA_FINISHED
Definition: constants.c:436
ActionData
Definition: actionbase.c:20
CAInteractLoop
Definition: cainteractloop.c:1
UA_PROCESSING
const int UA_PROCESSING
Definition: constants.c:434
m_Action
enum ActionInputType m_Action