Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс Bark_ColorBase

Закрытые члены

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

Подробное описание

Методы

◆ CanDetachAttachment() [1/2]

override bool CanDetachAttachment ( EntityAI parent)
inlineprivate
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
61 {
62 return true;
63 }
64 return false;
65 }
Definition EntityAI.c:95

◆ CanDetachAttachment() [2/2]

override bool CanDetachAttachment ( EntityAI parent)
inlineprivate
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
61 {
62 return true;
63 }
64 return false;
65 }

◆ CanPutAsAttachment() [1/2]

override bool CanPutAsAttachment ( EntityAI parent)
inlineprivate
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 {
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 }

◆ CanPutAsAttachment() [2/2]

override bool CanPutAsAttachment ( EntityAI parent)
inlineprivate
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 {
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 }

Объявления и описания членов классов находятся в файлах: