Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
gardenlime.c
Go to the documentation of this file.
1
class
GardenLime
extends
ItemBase
2
{
3
override
bool
CanPutAsAttachment
(
EntityAI
parent )
4
{
5
if
(!super.CanPutAsAttachment(parent)) {
return
false
;}
6
const
int
SLOTS_ARRAY = 8;
7
bool
is_barrel =
false
;
8
bool
is_opened_barrel =
false
;
9
bool
slot_test =
true
;
10
string
slot_names[SLOTS_ARRAY] = {
"BerryR"
,
"BerryB"
,
"Plant"
,
"OakBark"
,
"BirchBark"
,
"Nails"
,
"Disinfectant"
,
"Guts"
};
11
12
13
// is barrel
14
if
( parent.IsKindOf(
"Barrel_ColorBase"
) )
15
{
16
is_barrel =
true
;
17
}
18
19
// is opened barrel
20
if
( is_barrel && parent.GetAnimationPhase(
"Lid"
) == 1 )
21
{
22
is_opened_barrel =
true
;
23
}
24
25
// all of the barrel slots are empty
26
for
(
int
i = 0; i < SLOTS_ARRAY ; i++ )
27
{
28
if
( parent.FindAttachmentBySlotName(slot_names[i]) != NULL )
29
{
30
slot_test =
false
;
31
break
;
32
}
33
}
34
35
if
( ( is_opened_barrel && slot_test ) || !is_barrel )
36
{
37
return
true
;
38
}
39
return
false
;
40
}
41
42
override
bool
CanDetachAttachment
(
EntityAI
parent )
43
{
44
45
bool
is_barrel =
false
;
46
bool
is_opened_barrel =
false
;
47
48
// is barrel
49
if
( parent.IsKindOf(
"Barrel_ColorBase"
) )
50
{
51
is_barrel =
true
;
52
}
53
54
// is opened barrel
55
if
( is_barrel && parent.GetAnimationPhase(
"Lid"
) == 1 )
56
{
57
is_opened_barrel =
true
;
58
}
59
60
if
( is_opened_barrel || !is_barrel )
61
{
62
return
true
;
63
}
64
return
false
;
65
}
66
67
override
void
SetActions
()
68
{
69
super.SetActions();
70
71
//AddAction(ActionClapBearTrapWithThisItem);
72
AddAction
(
ActionFertilizeSlot
);
73
}
74
}
AddAction
void AddAction(typename actionName)
Definition
advancedcommunication.c:220
ActionFertilizeSlot
Definition
actionfertilizeslot.c:12
EntityAI
Definition
inventoryitem.c:2
ItemBase
Definition
inventoryitem.c:742
ItemBase::CanPutAsAttachment
override bool CanPutAsAttachment(EntityAI parent)
Definition
gardenlime.c:3
ItemBase::CanDetachAttachment
override bool CanDetachAttachment(EntityAI parent)
Definition
gardenlime.c:42
ItemBase::SetActions
override void SetActions()
Definition
gardenlime.c:67
Games
Dayz
scripts
4_world
entities
itembase
inventory_base
gardenlime.c
Generated by
1.17.0