DayZ 1.24
Loading...
Searching...
No Matches
GardenLime.c
Go to the documentation of this file.
1class 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 is_barrel = true;
16
17 // is opened barrel
18 if (is_barrel && parent.GetAnimationPhase("Lid") == 1)
19 is_opened_barrel = true;
20
21 // all of the barrel slots are empty
22 for (int i = 0; i < SLOTS_ARRAY ; i++)
23 {
24 if (parent.FindAttachmentBySlotName(slot_names[i]) != NULL)
25 {
26 slot_test = false;
27 break;
28 }
29 }
30
32 return true;
33 return false;
34 }
35
36 override bool CanDetachAttachment(EntityAI parent)
37 {
38
39 bool is_barrel = false;
40 bool is_opened_barrel = false;
41
42 // is barrel
43 if (parent.IsKindOf("Barrel_ColorBase"))
44 is_barrel = true;
45
46 // is opened barrel
47 if (is_barrel && parent.GetAnimationPhase("Lid") == 1)
48 is_opened_barrel = true;
49
51 return true;
52 return false;
53 }
54
55 override void SetActions()
56 {
57 super.SetActions();
58
59 //AddAction(ActionClapBearTrapWithThisItem);
61 }
62}
void AddAction(typename actionName)
override bool CanPutAsAttachment(EntityAI parent)
Definition GardenLime.c:3
override void SetActions()
Definition GardenLime.c:55
override bool CanDetachAttachment(EntityAI parent)
Definition GardenLime.c:36