DayZ 1.24
Loading...
Searching...
No Matches
ActionFertilizeSlot.c
Go to the documentation of this file.
10
12{
14 {
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
29
30
31 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
32 {
34 if (Class.CastTo(garden_base, target.GetObject()))
35 {
36 Slot slot;
37
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 return true;
54 }
55 }
56 return false;
57 }
58
60 {
61 // The functionality is in the Execute event of this user action's component.
62 }
63};
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
int m_StanceMask
Definition ActionBase.c:53
ActionData m_ActionData
ref CABase m_ActionComponent
Definition ActionBase.c:30
override void CreateActionComponent()
override void CreateConditionComponents()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void OnFinishProgressServer(ActionData action_data)
Super root of all classes in Enforce script.
Definition EnScript.c:11
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.