Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionwaterplant.c
Go to the documentation of this file.
2 {
3  private const float QUANTITY_USED_PER_SEC = 150;
4 
5  override void CreateActionComponent()
6  {
7  m_ActionData.m_ActionComponent = new CAContinuousWaterPlant(QUANTITY_USED_PER_SEC);
8  }
9 };
10 
12 {
13  void ActionWaterPlant()
14  {
15  m_CallbackClass = ActionWaterPlantCB;
16  m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_EMPTY_VESSEL;
17  m_FullBody = true;
19  m_Text = "#water_plant";
20  m_LockTargetOnUse = false;
21  }
22 
23  override void CreateConditionComponents()
24  {
27  }
28 
29  override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
30  {
31  Object targetObject = target.GetObject();
32 
33  if ( targetObject != NULL && targetObject.IsInherited(PlantBase) && item != NULL && !item.IsDamageDestroyed() )
34  {
35  PlantBase plant = PlantBase.Cast( targetObject );
36 
37  if ( plant.NeedsWater() && item.GetQuantity() > 0 )
38  {
39  return true;
40  }
41  }
42 
43  return false;
44  }
45 
46  override void OnFinishProgressServer( ActionData action_data )
47  {
48  Object targetObject = action_data.m_Target.GetObject();
49 
50  if ( targetObject != NULL && targetObject.IsInherited(PlantBase) )
51  {
52  PlantBase plant = PlantBase.Cast( targetObject );
53  Param1<float> nacdata = Param1<float>.Cast( action_data.m_ActionComponent.GetACData() );
54  float water = nacdata.param1;
55  Slot slot = plant.GetSlot();
56  water = action_data.m_Player.GetSoftSkillsManager().AddSpecialtyBonus( water, this.GetSpecialtyWeight() );
57  slot.GiveWater( water );
58  action_data.m_Player.GetSoftSkillsManager().AddSpecialty( m_SpecialtyWeight );
59  }
60  }
61 
62  override void OnFinishProgressClient( ActionData action_data )
63  {
64  Object targetObject = action_data.m_Target.GetObject();
65 
66  if ( targetObject != NULL && targetObject.IsInherited(PlantBase) )
67  {
68  PlantBase plant = PlantBase.Cast( targetObject );
69  Param1<float> nacdata = Param1<float>.Cast( action_data.m_ActionComponent.GetACData() );
70  float water = nacdata.param1;
71  Slot slot = plant.GetSlot();
72  water = action_data.m_Player.GetSoftSkillsManager().AddSpecialtyBonus( water, this.GetSpecialtyWeight() );
73  slot.GiveWater( water );
74  action_data.m_Player.GetSoftSkillsManager().AddSpecialty( m_SpecialtyWeight );
75  }
76  }
77 };
ItemBase
Definition: inventoryitem.c:730
GetSpecialtyWeight
float GetSpecialtyWeight()
Definition: actionbase.c:1044
ActionWaterPlantCB
Definition: actionwaterplant.c:1
UASoftSkillsWeight
Definition: actionconstants.c:118
UAMaxDistances
Definition: actionconstants.c:104
m_FullBody
protected bool m_FullBody
Definition: actionbase.c:52
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
CCTNonRuined
Definition: cctnonruined.c:1
Object
Definition: objecttyped.c:1
ActionWaterPlant
Definition: actionwaterplant.c:11
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
m_LockTargetOnUse
protected bool m_LockTargetOnUse
Definition: actionbase.c:51
CCINotRuinedAndEmpty
Definition: ccinotruinedandempty.c:1
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
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
m_SpecialtyWeight
protected float m_SpecialtyWeight
Definition: actionbase.c:68
CAContinuousWaterPlant
Definition: cacontinuouswaterplant.c:1