Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
actionremoveplant.c
Go to the documentation of this file.
1
class
ActionRemovePlant
:
ActionInteractBase
2
{
3
PlantBase
m_Plant
;
4
5
void
ActionRemovePlant
()
6
{
7
m_Text
=
"#remove_plant"
;
8
}
9
10
override
typename
GetInputType
()
11
{
12
return
ContinuousInteractActionInput
;
13
}
14
15
override
void
CreateConditionComponents
()
16
{
17
m_ConditionItem
=
new
CCINone
;
18
m_ConditionTarget
=
new
CCTCursor
(
UAMaxDistances
.
SMALL
);
19
}
20
21
override
bool
ActionCondition
(
PlayerBase
player,
ActionTarget
target,
ItemBase
item)
22
{
23
if
(!super.ActionCondition(player, target, item))
24
return
false
;
25
26
GardenBase
garden_base;
27
if
(
Class
.
CastTo
(garden_base, target.GetObject()))
28
{
29
Slot slot;
30
31
array<string>
selections =
new
array<string>
;
32
garden_base.GetActionComponentNameList(target.GetComponentIndex(), selections);
33
string
selection;
34
35
for
(
int
s = 0; s < selections.Count(); s++)
36
{
37
selection = selections[s];
38
slot = garden_base.GetSlotBySelection( selection );
39
if
(slot)
40
break
;
41
}
42
43
if
( slot && slot.GetPlant() )
44
{
45
m_Plant
=
PlantBase
.Cast(slot.GetPlant());
46
if
(!
m_Plant
.IsHarvestable())
47
return
true
;
48
}
49
}
50
return
false
;
51
}
52
53
override
void
OnExecuteServer
(
ActionData
action_data)
54
{
55
super.OnExecuteServer(action_data);
56
57
if
(
m_Plant
)
58
m_Plant
.RemovePlantEx(action_data.m_Player.GetPosition());
59
}
60
};
ActionData
ActionBase ActionData
Definition
actionbase.c:30
ActionTarget
class ActionTargets ActionTarget
ActionBase::m_Text
string m_Text
Definition
actionbase.c:64
ActionBase::m_ConditionItem
ref CCIBase m_ConditionItem
Definition
actionbase.c:70
ActionBase::m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition
actionbase.c:71
ActionInteractBase::ActionInteractBase
void ActionInteractBase()
Definition
actioninteractbase.c:43
ActionRemovePlant::OnExecuteServer
override void OnExecuteServer(ActionData action_data)
Definition
actionremoveplant.c:53
ActionRemovePlant::CreateConditionComponents
override void CreateConditionComponents()
Definition
actionremoveplant.c:15
ActionRemovePlant::m_Plant
PlantBase m_Plant
Definition
actionremoveplant.c:3
ActionRemovePlant::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
actionremoveplant.c:21
ActionRemovePlant::GetInputType
override GetInputType()
Definition
actionremoveplant.c:10
ActionRemovePlant::ActionRemovePlant
void ActionRemovePlant()
Definition
actionremoveplant.c:5
CCINone
Definition
ccinone.c:2
CCTCursor
Definition
cctcursor.c:2
Class
Super root of all classes in Enforce script.
Definition
enscript.c:11
ContinuousInteractActionInput
Definition
actioninput.c:523
GardenBase
Definition
gardenplot.c:2
ItemBase
Definition
inventoryitem.c:742
PlayerBase
Definition
playerbaseclient.c:2
UAMaxDistances
Definition
actionconstants.c:110
UAMaxDistances::SMALL
const float SMALL
Definition
actionconstants.c:111
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition
isboxcollidinggeometryproxyclasses.c:28
Class::CastTo
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
PlantBase
void PlantBase()
Definition
plantbase.c:54
Games
Dayz
scripts
4_world
classes
useractionscomponent
actions
interact
actionremoveplant.c
Generated by
1.17.0