DayZ 1.24
Loading...
Searching...
No Matches
CAContinuousQuantity.c
Go to the documentation of this file.
2{
3 protected float m_ItemQuantity;
4 protected float m_SpentQuantity;
5 protected float m_ItemMaxQuantity;
6 protected float m_QuantityUsedPerSecond;
9
14
16 {
18 if (!m_SpentUnits)
20 else
21 m_SpentUnits.param1 = 0;
22 m_ItemMaxQuantity = action_data.m_MainItem.GetQuantityMax();
23 m_ItemQuantity = action_data.m_MainItem.GetQuantity();
24 }
25
26
28 {
29 if (!action_data.m_Player)
30 return UA_ERROR;
31
32 if (m_ItemQuantity <= 0)
33 return UA_FINISHED;
34 else
35 {
37 {
38 m_AdjustedQuantityUsedPerSecond = action_data.m_Player.GetSoftSkillsManager().AddSpecialtyBonus(m_QuantityUsedPerSecond, m_Action.GetSpecialtyWeight(), true);
40 return UA_PROCESSING;
41 }
42 else
43 {
46 return UA_FINISHED;
47 }
48 }
49 }
50
52 {
53 if (!action_data.m_Player)
54 return UA_ERROR;
55
57 return UA_INTERRUPT;
58 }
59
60 override float GetProgress()
61 {
62 //float progress = m_SpentQuantity/m_ItemQuantity;
64 }
65
66 //---------------------------------------------------------------------------
67
68
70 {
71 if (GetGame().IsServer())
72 {
73 if (m_SpentUnits)
74 {
77 }
78
79 if (action_data.m_MainItem)
80 action_data.m_MainItem.AddQuantity(- m_SpentQuantity, false, false);
81 }
82 }
83};
void CalcAndSetQuantity()
void SetACData(Param units)
Definition CABase.c:38
ActionBase m_Action
Definition CABase.c:3
void OnCompletePogress(ActionData action_data)
ref Param1< float > m_SpentUnits
override int Execute(ActionData action_data)
override float GetProgress()
override int Cancel(ActionData action_data)
void CalcAndSetQuantity(ActionData action_data)
override void Setup(ActionData action_data)
void CAContinuousQuantity(float quantity_used_per_second)
proto native CGame GetGame()
const int UA_FINISHED
Definition constants.c:436
const int UA_ERROR
Definition constants.c:455
const int UA_INTERRUPT
Definition constants.c:438
const int UA_PROCESSING
Definition constants.c:434