DayZ
1.24
Loading...
Searching...
No Matches
ActionWaterGardenSlot.c
Go to the documentation of this file.
1
class
ActionWaterGardenSlotCB
:
ActionContinuousBaseCB
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
11
class
ActionWaterGardenSlot
:
ActionContinuousBase
12
{
13
void
ActionWaterGardenSlot
()
14
{
15
m_CallbackClass
=
ActionWaterGardenSlotCB
;
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
{
24
m_ConditionTarget
=
new
CCTDummy
;
25
m_ConditionItem
=
new
CCINonRuined
;
26
}
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
38
if
(
liquid_type
!=
LIQUID_WATER
)
39
{
40
return
false
;
// Forbid watering of plants with gasoline and other fluids
41
}
42
43
if
(
targetObject
.IsInherited(
GardenBase
))
44
{
45
GardenBase
garden_base
=
GardenBase
.Cast(
targetObject
);
46
47
Slot
slot;
48
49
array<string>
selections
=
new
array<string>
;
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
};
m_FullBody
bool m_FullBody
Definition
ActionBase.c:52
m_Text
string m_Text
Definition
ActionBase.c:49
m_ConditionItem
ref CCIBase m_ConditionItem
Definition
ActionBase.c:55
m_SpecialtyWeight
float m_SpecialtyWeight
Definition
ActionBase.c:68
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition
ActionBase.c:56
ActionBaseCB::m_ActionData
ActionData m_ActionData
Definition
AnimatedActionBase.c:3
ActionContinuousBaseCB
Definition
ActionContinuousBase.c:2
ActionContinuousBase
Definition
ActionContinuousBase.c:119
ActionData::m_ActionComponent
ref CABase m_ActionComponent
Definition
ActionBase.c:30
ActionWaterGardenSlotCB
Definition
ActionWaterGardenSlot.c:2
ActionWaterGardenSlotCB::QUANTITY_USED_PER_SEC
const float QUANTITY_USED_PER_SEC
Definition
ActionWaterGardenSlot.c:3
ActionWaterGardenSlotCB::CreateActionComponent
override void CreateActionComponent()
Definition
ActionWaterGardenSlot.c:5
ActionWaterGardenSlot
Definition
ActionWaterGardenSlot.c:12
ActionWaterGardenSlot::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
ActionWaterGardenSlot.c:28
ActionWaterGardenSlot::CreateConditionComponents
override void CreateConditionComponents()
Definition
ActionWaterGardenSlot.c:22
ActionWaterGardenSlot::ActionWaterGardenSlot
void ActionWaterGardenSlot()
Definition
ActionWaterGardenSlot.c:13
AnimatedActionBase::m_CommandUID
int m_CommandUID
Definition
AnimatedActionBase.c:122
AnimatedActionBase::m_CallbackClass
m_CallbackClass
Definition
AnimatedActionBase.c:124
CAContinuousWaterSlot
Definition
CAContinuousWaterSlot.c:2
CCINonRuined
Definition
CCINonRuined.c:2
CCTDummy
Definition
CCTDummy.c:2
GardenBase
Definition
GardenPlot.c:2
ItemBase
Definition
InventoryItem.c:697
Object
Definition
ObjectTyped.c:2
Param3
Definition
EntityAI.c:95
PlayerBase
Definition
PlayerBaseClient.c:2
UASoftSkillsWeight
Definition
ActionConstants.c:119
UASoftSkillsWeight::ROUGH_LOW
const float ROUGH_LOW
Definition
ActionConstants.c:120
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition
dayzplayer.c:597
LIQUID_WATER
const int LIQUID_WATER
Definition
constants.c:504
scripts
4_World
Classes
UserActionsComponent
Actions
Continuous
ActionWaterGardenSlot.c
Generated by
1.10.0