Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
actionwatergardenslot.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 CAContinuousWaterSlot(QUANTITY_USED_PER_SEC);
8 }
9};
10
12{
14 {
16 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_EMPTY_VESSEL;
17 m_FullBody = true;
18 m_SpecialtyWeight = UASoftSkillsWeight.ROUGH_LOW;
19 m_Text = "#water_slot";
20 }
21
22 override void CreateConditionComponents()
23 {
26 }
27
28 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
29 {
30 if (item.GetQuantity() == 0)
31 return false;
32
33 // Get the liquid
34 int liquidType = item.GetLiquidType();
35 if (liquidType != LIQUID_WATER)
36 {
37 return false; // Forbid watering of plants with gasoline and other fluids
38 }
39
40 if (item.GetIsFrozen())
41 {
42 return false;
43 }
44
45 Object targetObject = target.GetObject();
46 if (targetObject && targetObject.IsInherited(GardenBase))
47 {
48 GardenBase gardenBase = GardenBase.Cast(targetObject);
49 array<string> selections = new array<string>;
50 targetObject.GetActionComponentNameList(target.GetComponentIndex(), selections);
51
52 Slot slot;
53 for (int s = 0; s < selections.Count(); s++)
54 {
55 string selection = selections[s];
56 slot = gardenBase.GetSlotBySelection(selection);
57 if (slot)
58 break;
59 }
60
61 if ( slot && !slot.GetPlant() && slot.GetWateredState() == eWateredState.DRY )
62 {
63 return true;
64 }
65 else
66 {
67 return false;
68 }
69 }
70
71 return false;
72 }
73};
#define LIQUID_WATER
ActionData m_ActionData
float m_SpecialtyWeight
Definition actionbase.c:77
string m_Text
Definition actionbase.c:58
ref CCIBase m_ConditionItem
Definition actionbase.c:64
bool m_FullBody
Definition actionbase.c:61
ref CCTBase m_ConditionTarget
Definition actionbase.c:65
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602