DayZ 1.24
Loading...
Searching...
No Matches
ActionWaterGardenSlot.c
Go to the documentation of this file.
10
12{
14 {
16 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_EMPTY_VESSEL;
17 m_FullBody = true;
19 m_Text = "#water_slot";
20 }
21
27
28 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
29 {
30 Object targetObject = target.GetObject();
31
32 if (item.GetQuantity() == 0)
33 return false;
34
35 // Get the liquid
36 int liquid_type = item.GetLiquidType();
37
39 {
40 return false; // Forbid watering of plants with gasoline and other fluids
41 }
42
43 if (targetObject.IsInherited(GardenBase))
44 {
46
47 Slot slot;
48
50 targetObject.GetActionComponentNameList(target.GetComponentIndex(), selections);
51
52 for (int s = 0; s < selections.Count(); s++)
53 {
54 string selection = selections[s];
55 slot = garden_base.GetSlotBySelection(selection);
56 if (slot)
57 break;
58 }
59
60 if (slot && !slot.GetPlant() && slot.CanBeWatered() && slot.GetWateredState() == 0)
61 return true;
62 else
63 return false;
64 }
65
66 return false;
67 }
68};
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
ActionData m_ActionData
ref CABase m_ActionComponent
Definition ActionBase.c:30
override void CreateActionComponent()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void CreateConditionComponents()
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
const int LIQUID_WATER
Definition constants.c:504