DayZ 1.24
Loading...
Searching...
No Matches
DisinfectantSpray.c
Go to the documentation of this file.
2{
3
4 override void InitItemVariables()
5 {
6 super.InitItemVariables();
8 }
9
10 override bool CanPutAsAttachment(EntityAI parent)
11 {
12 if (!super.CanPutAsAttachment(parent)) return false;
13 const int SLOTS_ARRAY = 8;
14 bool is_barrel = false;
15 bool is_opened_barrel = false;
16 bool slot_test = true;
17 string slot_names[SLOTS_ARRAY] = { "BerryR", "BerryB", "Plant", "Nails", "OakBark", "BirchBark", "Lime", "Guts" };
18
19
20 // is barrel
21 if (parent.IsKindOf("Barrel_ColorBase"))
22 is_barrel = true;
23
24 // is opened barrel
25 if (is_barrel && parent.GetAnimationPhase("Lid") == 1)
26 is_opened_barrel = true;
27
28 // all of the barrel slots are empty
29 for (int i = 0; i < SLOTS_ARRAY ; i++)
30 {
31 if (parent.FindAttachmentBySlotName(slot_names[i]) != NULL)
32 {
33 slot_test = false;
34 break;
35 }
36 }
37
39 return true;
40 return false;
41 }
42
43 override bool CanDetachAttachment(EntityAI parent)
44 {
45
46 bool is_barrel = false;
47 bool is_opened_barrel = false;
48
49 // is barrel
50 if (parent.IsKindOf("Barrel_ColorBase"))
51 is_barrel = true;
52
53 // is opened barrel
54 if (is_barrel && parent.GetAnimationPhase("Lid") == 1)
55 is_opened_barrel = true;
56
58 return true;
59 return false;
60 }
61
62 override float GetDisinfectQuantity(int system = 0, Param param1 = null)
63 {
64 return (GetQuantityMax() * 0.15);
65 }
66
67 override void SetActions()
68 {
69 super.SetActions();
70
75 //AddAction(ActionForceDrinkDisinfectant);
76 //AddAction(ActionDrinkDisinfectant);
77
78
79 }
80}
void ActionDisinfectSelf()
void AddAction(typename actionName)
bool can_this_be_combined
Definition ItemBase.c:4741
override int GetQuantityMax()
Definition ItemBase.c:7941
override void SetActions()
override void InitItemVariables()
override bool CanDetachAttachment(EntityAI parent)
override bool CanPutAsAttachment(EntityAI parent)
override float GetDisinfectQuantity(int system=0, Param param1=null)
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12