DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
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 {
8 }
9};
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
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};
protected float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
protected string m_Text
Definition ActionBase.c:49
protected bool m_FullBody
Definition ActionBase.c:52
protected int m_StanceMask
Definition ActionBase.c:53
class ActionTargets ActionTarget
protected ActionData m_ActionData
ref CABase m_ActionComponent
Definition ActionBase.c:30
private const float QUANTITY_USED_PER_SEC
override void CreateActionComponent()
override void OnFinishProgressServer(ActionData action_data)
override void CreateConditionComponents()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Super root of all classes in Enforce script.
Definition EnScript.c:11
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.