Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
cacontinuousquantityextinguish.c
Go to the documentation of this file.
2 {
3  private float m_WetnessGainMultiplier = 1.0;
4 
5  void CAContinuousQuantityExtinguish(float quantity_used_per_second, float time_to_repeat, float wetness_gain_multiplier)
6  {
7  m_QuantityUsedPerSecond = quantity_used_per_second;
8  m_DefaultTimeToRepeat = time_to_repeat;
9  m_WetnessGainMultiplier = wetness_gain_multiplier;
10  }
11 
12  override void CalcAndSetQuantity(ActionData action_data)
13  {
14  if (GetGame().IsServer())
15  {
16  if ( m_SpentUnits )
17  {
18  m_SpentUnits.param1 = m_SpentQuantity;
19  SetACData(m_SpentUnits);
20  }
21 
22  Object targetObject = action_data.m_Target.GetObject();
23  if ( targetObject )
24  {
25  FireplaceBase fireplace = FireplaceBase.Cast(targetObject);
26 
27  //add wetness to fireplace targets
28  float wetness = (m_SpentQuantity / 1000) * m_WetnessGainMultiplier;
29  fireplace.AddWetnessToFireplace(wetness);
30 
31  //subtract quantity from water source
32  action_data.m_MainItem.AddQuantity(-m_SpentQuantity);
33  }
34  }
35  }
36 
37  override int Interrupt(ActionData action_data)
38  {
39  if (GetGame().IsServer())
40  action_data.m_Player.GetSoftSkillsManager().AddSpecialty(UASoftSkillsWeight.ROUGH_MEDIUM);
41 
42  return super.Interrupt(action_data);
43  }
44 
45  void MultiplyQuantityUsed(float coef)
46  {
47  m_QuantityUsedPerSecond *= coef;
48  }
49 }
GetGame
proto native CGame GetGame()
CAContinuousQuantityExtinguish
Definition: cacontinuousquantityextinguish.c:1
UASoftSkillsWeight
Definition: actionconstants.c:118
FireplaceBase
Definition: barrelholes_colorbase.c:1
CAContinuousQuantityRepeat
Definition: cacontinuousquantityrepeat.c:1
ActionData
Definition: actionbase.c:20
Object
Definition: objecttyped.c:1