DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
GardenLime.c
См. документацию.
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 {
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);
73 }
74}
void AddAction(typename actionName)
Определения AdvancedCommunication.c:220
Определения Building.c:6
override bool CanPutAsAttachment(EntityAI parent)
Определения GardenLime.c:3
override void SetActions()
Определения GardenLime.c:67
override bool CanDetachAttachment(EntityAI parent)
Определения GardenLime.c:42
Определения InventoryItem.c:731