DayZ 1.24
Loading...
Searching...
No Matches
CAContinuousEmpty Class Reference
Inheritance diagram for CAContinuousEmpty:
[legend]
Collaboration diagram for CAContinuousEmpty:
[legend]

Protected Member Functions

void CAContinuousEmpty (float quantity_emptied_per_second)
 
override void Setup (ActionData action_data)
 
override int Execute (ActionData action_data)
 
override int Cancel (ActionData action_data)
 
override float GetProgress ()
 
void CalcAndSetQuantity (ActionData action_data)
 

Protected Attributes

float m_TargetUnits
 
float m_SpentQuantity
 
float m_SpentQuantity_total
 
float m_AdjustedQuantityEmptiedPerSecond
 
float m_QuantityEmptiedPerSecond
 
bool m_WringingClothes
 
ref Param1< floatm_SpentUnits
 
float m_TimeElpased
 
float m_DefaultTimeStep = 0.25
 

Detailed Description

Definition at line 1 of file CAContinuousEmpty.c.

Constructor & Destructor Documentation

◆ CAContinuousEmpty()

void CAContinuousEmpty::CAContinuousEmpty ( float quantity_emptied_per_second)
inlineprotected

Member Function Documentation

◆ CalcAndSetQuantity()

void CAContinuousEmpty::CalcAndSetQuantity ( ActionData action_data)
inlineprotected

Definition at line 89 of file CAContinuousEmpty.c.

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 }
void SetACData(Param units)
Definition CABase.c:38
ref Param1< float > m_SpentUnits
proto native CGame GetGame()

References GetGame(), m_SpentQuantity, m_SpentQuantity_total, m_SpentUnits, and CABase::SetACData().

◆ Cancel()

override int CAContinuousEmpty::Cancel ( ActionData action_data)
inlineprotected

Definition at line 73 of file CAContinuousEmpty.c.

74 {
75 if (!action_data.m_Player || !action_data.m_MainItem)
76 return UA_ERROR;
77
79 return UA_CANCEL;
80 }
void CalcAndSetQuantity()
const int UA_ERROR
Definition constants.c:455
const int UA_CANCEL
Definition constants.c:437

References CalcAndSetQuantity(), UA_CANCEL, and UA_ERROR.

◆ Execute()

override int CAContinuousEmpty::Execute ( ActionData action_data)
inlineprotected

Definition at line 43 of file CAContinuousEmpty.c.

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 }
void OnCompletePogress(ActionData action_data)
float m_AdjustedQuantityEmptiedPerSecond
const int UA_FINISHED
Definition constants.c:436
const int UA_PROCESSING
Definition constants.c:434

References CalcAndSetQuantity(), m_AdjustedQuantityEmptiedPerSecond, m_DefaultTimeStep, m_SpentQuantity, m_SpentQuantity_total, m_TargetUnits, m_TimeElpased, m_WringingClothes, CAContinuousBase::OnCompletePogress(), UA_ERROR, UA_FINISHED, and UA_PROCESSING.

◆ GetProgress()

override float CAContinuousEmpty::GetProgress ( )
inlineprotected

Definition at line 82 of file CAContinuousEmpty.c.

83 {
85 }

References m_SpentQuantity_total, and m_TargetUnits.

◆ Setup()

override void CAContinuousEmpty::Setup ( ActionData action_data)
inlineprotected

Definition at line 18 of file CAContinuousEmpty.c.

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 }
ActionBase m_Action
Definition CABase.c:3

References CABase::m_Action, m_AdjustedQuantityEmptiedPerSecond, m_QuantityEmptiedPerSecond, m_SpentQuantity, m_SpentUnits, m_TargetUnits, and m_WringingClothes.

Member Data Documentation

◆ m_AdjustedQuantityEmptiedPerSecond

float CAContinuousEmpty::m_AdjustedQuantityEmptiedPerSecond
protected

Definition at line 6 of file CAContinuousEmpty.c.

Referenced by Execute(), and Setup().

◆ m_DefaultTimeStep

float CAContinuousEmpty::m_DefaultTimeStep = 0.25
protected

Definition at line 11 of file CAContinuousEmpty.c.

Referenced by Execute().

◆ m_QuantityEmptiedPerSecond

float CAContinuousEmpty::m_QuantityEmptiedPerSecond
protected

Definition at line 7 of file CAContinuousEmpty.c.

Referenced by CAContinuousEmpty(), and Setup().

◆ m_SpentQuantity

float CAContinuousEmpty::m_SpentQuantity
protected

Definition at line 4 of file CAContinuousEmpty.c.

Referenced by CalcAndSetQuantity(), Execute(), and Setup().

◆ m_SpentQuantity_total

float CAContinuousEmpty::m_SpentQuantity_total
protected

Definition at line 5 of file CAContinuousEmpty.c.

Referenced by CalcAndSetQuantity(), Execute(), and GetProgress().

◆ m_SpentUnits

ref Param1<float> CAContinuousEmpty::m_SpentUnits
protected

Definition at line 9 of file CAContinuousEmpty.c.

Referenced by CalcAndSetQuantity(), and Setup().

◆ m_TargetUnits

float CAContinuousEmpty::m_TargetUnits
protected

Definition at line 3 of file CAContinuousEmpty.c.

Referenced by Execute(), GetProgress(), and Setup().

◆ m_TimeElpased

float CAContinuousEmpty::m_TimeElpased
protected

Definition at line 10 of file CAContinuousEmpty.c.

Referenced by Execute().

◆ m_WringingClothes

bool CAContinuousEmpty::m_WringingClothes
protected

Definition at line 8 of file CAContinuousEmpty.c.

Referenced by Execute(), and Setup().


The documentation for this class was generated from the following file: