Dayz Explorer
1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
plantmaterial.c
Go to the documentation of this file.
1
class
PlantMaterial
extends
Inventory_Base
2
{
3
override
bool
CanPutAsAttachment
(
EntityAI
parent )
4
{
5
if
(!super.CanPutAsAttachment(parent))
6
{
7
return
false
;
8
}
9
/*const int SLOTS_ARRAY1 = 6;
10
const int SLOTS_ARRAY2 = 7;
11
bool is_barrel = false;
12
bool is_opened_barrel = false;
13
bool slot_test1 = true;
14
bool slot_test2 = true;
15
string slot_names1[SLOTS_ARRAY1] = { "Nails", "OakBark", "BirchBark", "Lime", "Disinfectant", "Guts" };
16
string slot_names2[SLOTS_ARRAY2] = { "BerryR", "BerryB", "Nails", "OakBark", "BirchBark", "Lime", "Disinfectant" };
17
18
19
// is barrel
20
if ( parent.IsKindOf("Barrel_ColorBase") )
21
{
22
is_barrel = true;
23
}
24
25
// is opened barrel
26
if ( is_barrel && parent.GetAnimationPhase("Lid") == 1 )
27
{
28
is_opened_barrel = true;
29
}
30
31
// all of the barrel attachment slots are empty (first set of ingredients)
32
for ( int idx1 = 0; idx1 < SLOTS_ARRAY1 ; idx1++ )
33
{
34
if ( parent.FindAttachmentBySlotName(slot_names1[idx1]) != NULL )
35
{
36
slot_test1 = false;
37
break;
38
}
39
}
40
41
// all of the barrel attachment slots are empty (second set of ingredients)
42
for ( int idx2 = 0; idx2 < SLOTS_ARRAY2 ; idx2++ )
43
{
44
if ( parent.FindAttachmentBySlotName(slot_names2[idx2]) != NULL )
45
{
46
slot_test2 = false;
47
break;
48
}
49
}
50
51
if ( ( is_opened_barrel && slot_test1 ) || ( is_opened_barrel && slot_test2) || !is_barrel )
52
{
53
return true;
54
}*/
55
56
return
false
;
57
}
58
59
override
bool
CanDetachAttachment(
EntityAI
parent )
60
{
61
62
/*bool is_barrel = false;
63
bool is_opened_barrel = false;
64
65
// is barrel
66
if ( parent.IsKindOf("Barrel_ColorBase") )
67
{
68
is_barrel = true;
69
}
70
71
// is opened barrel
72
if ( is_barrel && parent.GetAnimationPhase("Lid") == 1 )
73
{
74
is_opened_barrel = true;
75
}
76
77
if ( is_opened_barrel || !is_barrel )
78
{
79
return true;
80
}*/
81
return
false
;
82
}
83
84
override
void
SetActions
()
85
{
86
super.SetActions();
87
88
AddAction
(
ActionFertilizeSlot
);
89
}
90
91
override
void
InitItemVariables
()
92
{
93
super.InitItemVariables();
94
can_this_be_combined
=
true
;
95
}
96
}
can_this_be_combined
bool can_this_be_combined
Definition:
itembase.c:62
CanPutAsAttachment
override bool CanPutAsAttachment(EntityAI parent)
Definition:
itembase.c:4021
InitItemVariables
void InitItemVariables()
Definition:
itembase.c:182
AddAction
void AddAction(typename actionName)
Definition:
advancedcommunication.c:86
SetActions
void SetActions()
Definition:
advancedcommunication.c:79
Inventory_Base
Definition:
barbedbaseballbat.c:1
ActionFertilizeSlot
Definition:
actionfertilizeslot.c:11
EntityAI
Definition:
building.c:5
DAYZ
scripts_v1.24.157551
scripts
world
entities
itembase
inventory_base
plantmaterial.c
Generated by
1.8.17