Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionfertilizeslot.c
Go to the documentation of this file.
2 {
3  private const float QUANTITY_USED_PER_SEC = 10;
4 
5  override void CreateActionComponent()
6  {
7  m_ActionData.m_ActionComponent = new CAContinuousFertilizeGardenSlot(QUANTITY_USED_PER_SEC);
8  }
9 };
10 
12 {
13  void ActionFertilizeSlot()
14  {
15  m_CallbackClass = ActionFertilizeSlotCB;
17 
18  m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
19  m_FullBody = true;
20  m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
21  m_Text = "#fertilize_slot";
22  }
23 
24  override void CreateConditionComponents()
25  {
28  }
29 
30 
31  override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
32  {
33  GardenBase garden_base;
34  if ( Class.CastTo(garden_base, target.GetObject()))
35  {
36  Slot slot;
37 
38  array<string> selections = new array<string>;
39  garden_base.GetActionComponentNameList(target.GetComponentIndex(), selections);
40  string selection;
41 
42  for (int s = 0; s < selections.Count(); s++)
43  {
44  selection = selections[s];
45  slot = garden_base.GetSlotBySelection( selection );
46  if (slot)
47  break;
48  }
49 
50  if ( garden_base.NeedsFertilization( selection ) )
51  {
52  if ( item.GetQuantity() > 0 )
53  {
54  return true;
55  }
56  }
57  }
58  return false;
59  }
60 
61  override void OnFinishProgressServer( ActionData action_data )
62  {
63  // The functionality is in the Execute event of this user action's component.
64  }
65 };
ItemBase
Definition: inventoryitem.c:730
UASoftSkillsWeight
Definition: actionconstants.c:118
CCTDummy
Definition: cctdummy.c:1
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
ActionFertilizeSlotCB
Definition: actionfertilizeslot.c:1
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
array< string >
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
CCINonRuined
Definition: ccinonruined.c:1
CAContinuousFertilizeGardenSlot
Definition: cacontinuousfertilizegardenslot.c:1
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
GardenBase
Definition: gardenplot.c:1
Class
Super root of all classes in Enforce script.
Definition: enscript.c:10
m_SpecialtyWeight
protected float m_SpecialtyWeight
Definition: actionbase.c:68
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53
ActionFertilizeSlot
Definition: actionfertilizeslot.c:11