Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
actionfertilizeslot.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 CAContinuousFertilizeGardenSlot(QUANTITY_USED_PER_SEC);
8 }
9};
10
12{
14 {
16 m_SpecialtyWeight = UASoftSkillsWeight.ROUGH_MEDIUM;
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 if (item.GetQuantity() == 0)
34 return false;
35
36 Object targetObject = target.GetObject();
37 if (targetObject.IsInherited(GardenBase))
38 {
39 GardenBase gardenBase = GardenBase.Cast(targetObject);
40 Slot slot;
41
42 array<string> selections = new array<string>;
43 gardenBase.GetActionComponentNameList(target.GetComponentIndex(), selections);
44
45 foreach(string selection: selections)
46 {
47 slot = gardenBase.GetSlotBySelection(selection);
48 if (slot)
49 break;
50 }
51
52 if (slot)
53 {
54 if (slot.GetPlant())
55 return false;
56
57 if (slot.GetFertilityState() == eFertlityState.NONE)
58 return true;
59 }
60 }
61
62 return false;
63 }
64
65 override void OnFinishProgressServer( ActionData action_data )
66 {
67 // The functionality is in the Execute event of this user action's component.
68 }
69};
ActionData m_ActionData
float m_SpecialtyWeight
Definition actionbase.c:77
int m_StanceMask
Definition actionbase.c:62
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
eFertlityState
Definition slot.c:2