DayZ
1.24
Loading...
Searching...
No Matches
CAInteractLoop.c
Go to the documentation of this file.
1
class
CAInteractLoop
:
CABase
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
m_SpentUnits
=
new
Param1<float>
(0);
19
else
20
m_SpentUnits
.param1 = 0;
21
22
m_TimeToComplete
=
action_data
.m_Player.GetSoftSkillsManager().SubtractSpecialtyBonus(
m_DefaultTimeToComplete
,
m_Action
.GetSpecialtyWeight(),
true
);
23
}
24
25
override
int
Execute
(
ActionData
action_data
)
26
{
27
if
(!
action_data
.m_Player)
28
return
UA_ERROR
;
29
30
if
(
m_TimeElpased
<
m_TimeToComplete
)
31
{
32
m_TimeElpased
+=
action_data
.m_Player.GetDeltaT();
33
return
UA_PROCESSING
;
34
}
35
else
36
{
37
if
(
m_SpentUnits
)
38
{
39
m_SpentUnits
.param1 =
m_TimeElpased
;
40
SetACData
(
m_SpentUnits
);
41
}
42
return
UA_FINISHED
;
43
}
44
}
45
46
};
ActionData
Definition
ActionBase.c:21
CABase
Definition
CABase.c:2
CABase::SetACData
void SetACData(Param units)
Definition
CABase.c:38
CABase::m_Action
ActionBase m_Action
Definition
CABase.c:3
CAInteractLoop
Definition
CAInteractLoop.c:2
CAInteractLoop::m_TimeElpased
float m_TimeElpased
Definition
CAInteractLoop.c:4
CAInteractLoop::Execute
override int Execute(ActionData action_data)
Definition
CAInteractLoop.c:25
CAInteractLoop::m_TimeToComplete
float m_TimeToComplete
Definition
CAInteractLoop.c:5
CAInteractLoop::Setup
override void Setup(ActionData action_data)
Definition
CAInteractLoop.c:14
CAInteractLoop::m_SpentUnits
ref Param1< float > m_SpentUnits
Definition
CAInteractLoop.c:7
CAInteractLoop::CAInteractLoop
void CAInteractLoop(float time_to_complete_action)
Definition
CAInteractLoop.c:9
CAInteractLoop::m_DefaultTimeToComplete
float m_DefaultTimeToComplete
Definition
CAInteractLoop.c:6
CAInteractLoop::m_LocalTimeElpased
float m_LocalTimeElpased
Definition
CAInteractLoop.c:3
Param3
Definition
EntityAI.c:95
UA_FINISHED
const int UA_FINISHED
Definition
constants.c:436
UA_ERROR
const int UA_ERROR
Definition
constants.c:455
UA_PROCESSING
const int UA_PROCESSING
Definition
constants.c:434
scripts
4_World
Classes
UserActionsComponent
ActionComponents
CAInteractLoop.c
Generated by
1.10.0