Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionextinguishfireplacebyliquid.c
Go to the documentation of this file.
2 {
3  private const float TIME_TO_REPEAT = 0.5;
4  private const float WETNESS_GAIN_MULTIPLIER = 1.0;
5 
6  override void CreateActionComponent()
7  {
8  m_ActionData.m_ActionComponent = new CAContinuousQuantityExtinguish(UAQuantityConsumed.FIREPLACE_LIQUID, TIME_TO_REPEAT, WETNESS_GAIN_MULTIPLIER);
9  CAContinuousQuantityExtinguish.Cast(m_ActionData.m_ActionComponent).MultiplyQuantityUsed(m_ActionData.m_MainItem.GetLiquidThroughputCoef());
10  }
11 }
12 
14 {
16  {
17  m_CallbackClass = ActionExtinguishFireplaceByLiquidCB;
18  m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_EMPTY_VESSEL;
20  m_FullBody = true;
21 
22  m_Text = "#extinguish";
23  }
24 
25  override void CreateConditionComponents()
26  {
29  }
30 
31  override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
32  {
33  Object targetObject = target.GetObject();
34 
35  if (targetObject.IsFireplace())
36  {
37  FireplaceBase fireplace = FireplaceBase.Cast(targetObject);
38 
39  if (fireplace.CanExtinguishFire() && !item.IsDamageDestroyed() && (item.GetLiquidType() & (GROUP_LIQUID_BLOOD | LIQUID_WATER | LIQUID_RIVERWATER | LIQUID_BEER)))
40  {
41  return true;
42  }
43  }
44 
45  return false;
46  }
47 
48  override void OnStartAnimationLoop(ActionData action_data)
49  {
50  super.OnStartAnimationLoop(action_data);
51 
52  FireplaceBase fireplace = FireplaceBase.Cast(action_data.m_Target.GetObject());
53  fireplace.SetExtinguishingState();
54  }
55 
56  override void OnEndServer(ActionData action_data)
57  {
58  FireplaceBase fireplace = FireplaceBase.Cast(action_data.m_Target.GetObject());
59  fireplace.RefreshFireState();
60  }
61 }
ItemBase
Definition: inventoryitem.c:730
CAContinuousQuantityExtinguish
Definition: cacontinuousquantityextinguish.c:1
LIQUID_RIVERWATER
const int LIQUID_RIVERWATER
Definition: constants.c:506
UASoftSkillsWeight
Definition: actionconstants.c:118
CCTObject
Definition: cctobject.c:1
UAQuantityConsumed
Definition: actionconstants.c:3
LIQUID_WATER
const int LIQUID_WATER
Definition: constants.c:505
OnStartAnimationLoop
override void OnStartAnimationLoop(ActionData action_data)
Definition: actionextinguishfireplacebyliquid.c:48
FireplaceBase
Definition: barrelholes_colorbase.c:1
UAMaxDistances
Definition: actionconstants.c:104
LIQUID_BEER
const int LIQUID_BEER
Definition: constants.c:508
CreateConditionComponents
override void CreateConditionComponents()
Definition: actionextinguishfireplacebyliquid.c:25
m_FullBody
protected bool m_FullBody
Definition: actionbase.c:52
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
TIME_TO_REPEAT
const private float TIME_TO_REPEAT
Definition: actionextinguishfireplacebyextinguisher.c:2
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
ActionExtinguishFireplaceByLiquidCB
Definition: actionextinguishfireplacebyliquid.c:1
ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition: actionextinguishfireplacebyliquid.c:31
Object
Definition: objecttyped.c:1
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
OnEndServer
override void OnEndServer(ActionData action_data)
Definition: actionextinguishfireplacebyliquid.c:56
CCINotRuinedAndEmpty
Definition: ccinotruinedandempty.c:1
WETNESS_GAIN_MULTIPLIER
const private float WETNESS_GAIN_MULTIPLIER
Definition: actionextinguishfireplacebyextinguisher.c:3
m_Text
protected string m_Text
Definition: actionbase.c:49
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
ActionContinuousBase
Definition: actioncontinuousbase.c:132
ActionExtinguishFireplaceByLiquid
ActionExtinguishFireplaceByLiquidCB ActionContinuousBaseCB ActionExtinguishFireplaceByLiquid()
Definition: actionextinguishfireplacebyliquid.c:15
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
GROUP_LIQUID_BLOOD
const int GROUP_LIQUID_BLOOD
Definition: constants.c:515
m_SpecialtyWeight
protected float m_SpecialtyWeight
Definition: actionbase.c:68