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

Protected Member Functions

void CAContinuousWringClothes (float quantity_used_per_second, float time_to_repeat)
 
override void Setup (ActionData action_data)
 
override int Execute (ActionData action_data)
 
override float GetProgress ()
 

Protected Attributes

float m_InitItemQuantity
 
float m_SpentQuantityTotal
 

Additional Inherited Members

- Private Member Functions inherited from CAContinuousQuantityRepeat
void CAContinuousQuantityRepeat (float quantity_used_per_second, float time_to_repeat)
 
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)
 
- Private Attributes inherited from CAContinuousQuantityRepeat
float m_ItemQuantity
 
float m_SpentQuantity
 
float m_ItemMaxQuantity
 
float m_TimeElpased
 
float m_QuantityUsedPerSecond
 
float m_AdjustedQuantityUsedPerSecond
 
float m_DefaultTimeToRepeat
 
ref Param1< floatm_SpentUnits
 

Detailed Description

Definition at line 1 of file CAContinuousWringClothes.c.

Constructor & Destructor Documentation

◆ CAContinuousWringClothes()

Member Function Documentation

◆ Execute()

override int CAContinuousWringClothes::Execute ( ActionData action_data)
inlineprotected

Definition at line 22 of file CAContinuousWringClothes.c.

23 {
24 if (!action_data.m_Player)
25 return UA_ERROR;
26
27 float wetness = action_data.m_MainItem.GetWet();
28 int trim_wetness = wetness * 100;
29 float rounded_wetness = trim_wetness / 100;
30
31 if (rounded_wetness <= 0.25)
32 return UA_FINISHED;
33 else
34 {
36 {
37 m_AdjustedQuantityUsedPerSecond = action_data.m_Player.GetSoftSkillsManager().AddSpecialtyBonus(m_QuantityUsedPerSecond, m_Action.GetSpecialtyWeight(), true);
39 m_TimeElpased += action_data.m_Player.GetDeltaT();
40
42 {
45 }
46
47
48 if (GetGame().IsServer())
49 {
50 if (m_SpentUnits)
51 {
54 }
55
56 action_data.m_MainItem.AddWet(-m_SpentQuantity);
57 }
58
61
62 return UA_PROCESSING;
63 }
64 else
65 {
67 return UA_FINISHED;
68 }
69 }
70 }
void SetACData(Param units)
Definition CABase.c:38
ActionBase m_Action
Definition CABase.c:3
void OnCompletePogress(ActionData action_data)
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

References GetGame(), CABase::m_Action, CAContinuousQuantityRepeat::m_AdjustedQuantityUsedPerSecond, CAContinuousQuantityRepeat::m_DefaultTimeToRepeat, m_InitItemQuantity, CAContinuousQuantityRepeat::m_QuantityUsedPerSecond, CAContinuousQuantityRepeat::m_SpentQuantity, m_SpentQuantityTotal, CAContinuousQuantityRepeat::m_SpentUnits, CAContinuousQuantityRepeat::m_TimeElpased, CAContinuousBase::OnCompletePogress(), CABase::SetACData(), UA_ERROR, UA_FINISHED, and UA_PROCESSING.

◆ GetProgress()

override float CAContinuousWringClothes::GetProgress ( )
inlineprotected

◆ Setup()

override void CAContinuousWringClothes::Setup ( ActionData action_data)
inlineprotected

Definition at line 13 of file CAContinuousWringClothes.c.

14 {
15 super.Setup(action_data);
16
17 if (m_InitItemQuantity < 0)
18 m_InitItemQuantity = action_data.m_MainItem.GetWet();
19 }

References m_InitItemQuantity.

Member Data Documentation

◆ m_InitItemQuantity

float CAContinuousWringClothes::m_InitItemQuantity
protected

Definition at line 3 of file CAContinuousWringClothes.c.

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

◆ m_SpentQuantityTotal

float CAContinuousWringClothes::m_SpentQuantityTotal
protected

Definition at line 4 of file CAContinuousWringClothes.c.

Referenced by Execute().


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