DayZ 1.24
Loading...
Searching...
No Matches
RainProcurementComponent.c
Go to the documentation of this file.
2{
5 protected bool m_IsUnderRoof;
6 protected bool m_IsActive;
7 protected int m_UpdateCounter;
8 protected const int UPDATE_ROOFCHECK_COUNT = 3; //do roofcheck every n updates
9
11 {
13 Reset();
14 m_Handler = MissionBaseWorld.Cast(GetGame().GetMission()).GetRainProcurementHandler();
15 }
16
19 {
20#ifdef SERVER
21 Reset();
22 SetActive(true);
24#endif
25 }
26
29 {
30#ifdef SERVER
31 if (IsActive())
32 {
33 SetActive(false);
34 m_Handler.QueueStop(this);
35 }
36#endif
37 }
38
39 void OnUpdate(float deltaTime, float amount)
40 {
43 {
46 }
47 ProcureLiquid(amount);
48 }
49
50 protected void Reset()
51 {
52 m_UpdateCounter = -1;
53 }
54
63
64 protected void UpdateIsUnderRoof()
65 {
67 }
68
74
75 bool IsActive()
76 {
77 return m_IsActive;
78 }
79
80 void SetActive(bool run)
81 {
82 //resets times on start
83 if (run)
84 Reset();
86 }
87};
88
void SetActive()
Definition TrapBase.c:409
Definition Liquid.c:2
static void FillContainerEnviro(ItemBase container, int liquid_type, float amount, bool inject_agents=false)
Definition Liquid.c:126
TODO doc.
Definition EnScript.c:118
void StartRainProcurement()
Called on server to queue rain procurement (on next cycle end)
void OnUpdate(float deltaTime, float amount)
void RainProcurementComponentBase(ItemBase procuringItem)
void ProcureLiquid(float amountBase, int liquidType=LIQUID_WATER)
void StopRainProcurement()
Called on server to queue rain procurement removal (on next cycle end)
float GetBaseLiquidAmount()
override this to get different amount per ProcureLiquid cycle
void QueueStart(RainProcurementComponentBase component)
void QueueStop(RainProcurementComponentBase component)
proto native CGame GetGame()
const float LIQUID_RAIN_AMOUNT_COEF_BASE
Definition constants.c:723
const int LIQUID_WATER
Definition constants.c:504