Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
disinfectantspray.c
Go to the documentation of this file.
2{
3 override void InitItemVariables()
4 {
5 super.InitItemVariables();
6
9 }
10
11 override bool CanPutAsAttachment(EntityAI parent)
12 {
13 if (!super.CanPutAsAttachment(parent))
14 return false;
15
16 const int SLOTS_ARRAY = 8;
17 bool isBarrel;
18 bool isBarrelOpened;
19 bool slotsEmptyTest = true;
20 string slotNames[SLOTS_ARRAY] = {"BerryR", "BerryB", "Plant", "Nails", "OakBark", "BirchBark", "Lime", "Guts"};
21
22 if (parent.IsKindOf("Barrel_ColorBase"))
23 isBarrel = true;
24
25 if (isBarrel && parent.GetAnimationPhase("Lid") == 1)
26 isBarrelOpened = true;
27
28 for (int i = 0; i < SLOTS_ARRAY ; ++i)
29 {
30 if (parent.FindAttachmentBySlotName(slotNames[i]) != null)
31 {
32 slotsEmptyTest = false;
33 break;
34 }
35 }
36
37 if ((isBarrelOpened && slotsEmptyTest) || !isBarrel)
38 return true;
39
40 return false;
41 }
42
43 override bool CanDetachAttachment( EntityAI parent )
44 {
45
46 bool isBarrel;
47 bool isBarrelOpened;
48
49 if (parent.IsKindOf("Barrel_ColorBase"))
50 isBarrel = true;
51
52 if (isBarrel && parent.GetAnimationPhase("Lid") == 1)
53 isBarrelOpened = true;
54
55 if (isBarrelOpened || !isBarrel)
56 return true;
57
58 return false;
59 }
60
61 override float GetDisinfectQuantity(int system = 0, Param param1 = null)
62 {
63 return (GetQuantityMax() * 0.15);
64 }
65
66 override void SetActions()
67 {
68 super.SetActions();
69
74 }
75}
void ActionDisinfectSelf()
void AddAction(typename actionName)
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12
int m_VarLiquidType
Definition itembase.c:4898
bool can_this_be_combined
Definition itembase.c:4908
override int GetQuantityMax()
Definition itembase.c:8248
int GetLiquidTypeInit()
Definition itembase.c:8684