DayZ 1.24
Loading...
Searching...
No Matches
CAContinuousEmpty.c
Go to the documentation of this file.
2{
3 protected float m_TargetUnits;
4 protected float m_SpentQuantity;
5 protected float m_SpentQuantity_total;
8 protected bool m_WringingClothes;
10 protected float m_TimeElpased;
11 protected float m_DefaultTimeStep = 0.25;
12
17
19 {
20 if (!m_SpentUnits)
22 else
23 m_SpentUnits.param1 = 0;
24
25 if (action_data.m_MainItem.IsClothing())
26 {
27 m_WringingClothes = true;
28
29 m_SpentQuantity = action_data.m_MainItem.GetWetMax() - action_data.m_MainItem.GetWet();
30 m_TargetUnits = action_data.m_MainItem.GetWetMax();
31 }
32 else
33 {
34 m_WringingClothes = false;
35
36 m_SpentQuantity = action_data.m_MainItem.GetQuantityMin();
37 m_TargetUnits = action_data.m_MainItem.GetQuantity();
38 }
39
40 m_AdjustedQuantityEmptiedPerSecond = action_data.m_Player.GetSoftSkillsManager().AddSpecialtyBonus(m_QuantityEmptiedPerSecond, m_Action.GetSpecialtyWeight(), true);
41 }
42
44 {
45 if (!action_data.m_Player)
46 return UA_ERROR;
47
48 if (m_WringingClothes && action_data.m_MainItem.GetWet() >= action_data.m_MainItem.GetWetMax())
49 return UA_FINISHED;
50 else
51 {
53 {
55 m_TimeElpased += action_data.m_Player.GetDeltaT();
56
58 {
60 m_TimeElpased = 0;
61 }
62 return UA_PROCESSING;
63 }
64 else
65 {
68 return UA_FINISHED;
69 }
70 }
71 }
72
74 {
75 if (!action_data.m_Player || !action_data.m_MainItem)
76 return UA_ERROR;
77
79 return UA_CANCEL;
80 }
81
82 override float GetProgress()
83 {
85 }
86
87 //---------------------------------------------------------------------------
88
90 {
92 if (GetGame().IsServer())
93 {
94 if (m_SpentUnits)
95 {
98 }
99
100 action_data.m_MainItem.AddQuantity(-m_SpentQuantity);
101 }
102 m_SpentQuantity = 0;
103 }
104};
void CalcAndSetQuantity()
void SetACData(Param units)
Definition CABase.c:38
ActionBase m_Action
Definition CABase.c:3
void OnCompletePogress(ActionData action_data)
override void Setup(ActionData action_data)
override int Execute(ActionData action_data)
float m_AdjustedQuantityEmptiedPerSecond
void CAContinuousEmpty(float quantity_emptied_per_second)
void CalcAndSetQuantity(ActionData action_data)
override int Cancel(ActionData action_data)
override float GetProgress()
ref Param1< float > m_SpentUnits
proto native CGame GetGame()
const int UA_FINISHED
Definition constants.c:436
const int UA_ERROR
Definition constants.c:455
const int UA_PROCESSING
Definition constants.c:434
const int UA_CANCEL
Definition constants.c:437