DayZ 1.24
Loading...
Searching...
No Matches
Bark_ColorBase Class Reference

Private Member Functions

override bool CanPutAsAttachment (EntityAI parent)
 
override bool CanDetachAttachment (EntityAI parent)
 
override bool CanPutAsAttachment (EntityAI parent)
 
override bool CanDetachAttachment (EntityAI parent)
 

Detailed Description

Definition at line 1 of file Bark_Birch.c.

Member Function Documentation

◆ CanDetachAttachment() [1/2]

override bool Bark_ColorBase::CanDetachAttachment ( EntityAI parent)
inlineprivate

Definition at line 36 of file Bark_Birch.c.

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 }

◆ CanDetachAttachment() [2/2]

override bool Bark_ColorBase::CanDetachAttachment ( EntityAI parent)
inlineprivate

Definition at line 36 of file Bark_Oak.c.

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 }

◆ CanPutAsAttachment() [1/2]

override bool Bark_ColorBase::CanPutAsAttachment ( EntityAI parent)
inlineprivate

Definition at line 3 of file Bark_Birch.c.

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", "Nails", "OakBark", "Lime", "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 }

◆ CanPutAsAttachment() [2/2]

override bool Bark_ColorBase::CanPutAsAttachment ( EntityAI parent)
inlineprivate

Definition at line 3 of file Bark_Oak.c.

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", "Nails", "BirchBark", "Lime", "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 }

The documentation for this class was generated from the following files: