DayZ 1.24
Loading...
Searching...
No Matches
WoodBase.c
Go to the documentation of this file.
6
7class WoodBase extends Plant
8{
9
10 static bool m_IsCuttable;
11 static int m_PrimaryDropsAmount = -1;
12 static int m_SecondaryDropsAmount = -1;
13 static float m_ToolDamage = -1.0;
14 static float m_CycleTimeOverride = -1.0;
15 static string m_PrimaryOutput = ""; //some nonsensical item for debugging purposes
16 static string m_SecondaryOutput = ""; //some nonsensical item for debugging purposes
17 static string m_BarkType = "";
18
19 /*
20 bool m_IsCuttable;
21 int m_PrimaryDropsAmount = -1;
22 int m_SecondaryDropsAmount = -1;
23 float m_ToolDamage = -1.0;
24 float m_CycleTimeOverride = -1.0;
25 string m_PrimaryOutput = ""; //some nonsensical item for debugging purposes
26 string m_SecondaryOutput = ""; //some nonsensical item for debugging purposes
27 string m_BarkType = "";
28 */
29
30 void WoodBase()
31 {
32 //InitMiningValues();
33 }
34
35
37 {
38 //m_IsCuttable = false;
39 };
40
41 override bool IsWoodBase()
42 {
43 return true;
44 }
45
46 override bool IsCuttable()
47 {
48 return ConfigGetBool("isCuttable");
49 }
50
52 {
53 return ConfigGetInt("primaryDropsAmount");
54 }
55
57 {
58 return ConfigGetInt("secondaryDropsAmount");
59 }
60
62 {
63 return ConfigGetFloat("toolDamage");
64 }
65
67 {
68 return ConfigGetFloat("cycleTimeOverride");
69 }
70
72 {
73 return ConfigGetString("primaryOutput");
74 }
75
77 {
78 return ConfigGetString("secondaryOutput");
79 }
80
81 string GetBarkType()
82 {
83 return ConfigGetString("barkType");
84 }
85
86
88 {
89 if (GetPrimaryDropsAmount() > 0)
90 {
91 if (IsTree() && item && (item.KindOf("Knife") || item.IsInherited(Screwdriver)))
92 return -1;
93 else
94 return GetPrimaryDropsAmount();
95 }
96 else
97 {
98 if (item && (item.KindOf("Knife") || item.IsInherited(Screwdriver)))
99 return -1;
100 else if (item && item.KindOf("Axe"))
101 return 3;
102 else
103 return 100;
104 }
105 }
106
108 {
109 if (GetPrimaryDropsAmount() > 0)
110 {
111 if (IsTree() && item && type == EHarvestType.BARK)
112 return -1;
113 else
114 return GetPrimaryDropsAmount();
115 }
116 else
117 {
118 if (item && type == EHarvestType.BARK)
119 return -1;
120 else if (item && type == EHarvestType.NORMAL)
121 return 3;
122 else
123 return 100;
124 }
125 }
126
128 {
129 if (IsTree() && item && (item.KindOf("Knife") || item.IsInherited(Screwdriver)) && GetBarkType() != "")
130 output_map.Insert(GetBarkType(), 1);
131 else
132 output_map.Insert(GetPrimaryOutput(), 1);
133 }
134
136 {
137 if (IsTree() && item && type == EHarvestType.BARK && GetBarkType() != "")
138 output_map.Insert(GetBarkType(), 1);
139 else
140 output_map.Insert(GetPrimaryOutput(), 1);
141 }
142
144 {
145 if (GetToolDamage() > -1)
146 return GetToolDamage();
147
148 if (IsTree())
149 {
150 if (item && item.KindOf("Knife"))
151 return 20;
152 else if (item && item.KindOf("Axe"))
153 return 20;
154 else
155 return 0;
156 }
157 else
158 {
159 if (item && item.KindOf("Knife"))
160 return 30;
161 else if (item && item.KindOf("Axe"))
162 return 30;
163 else
164 return 0;
165 }
166 }
167
169 {
170 if (GetToolDamage() > -1)
171 return GetToolDamage();
172
173 if (IsTree())
174 {
175 if (item && type == EHarvestType.BARK)
176 return 20;
177 else if (item && type == EHarvestType.NORMAL)
178 return 20;
179 else
180 return 0;
181 }
182 else
183 {
184 if (item && type == EHarvestType.BARK)
185 return 30;
186 else if (item && type == EHarvestType.NORMAL)
187 return 30;
188 else
189 return 0;
190 }
191 }
192
193 override bool CanBeActionTarget()
194 {
195 return super.CanBeActionTarget() && !IsDamageDestroyed();
196 }
197
198};
bool IsDamageDestroyed(ActionTarget target)
Definition ActionBase.c:841
static int m_SecondaryDropsAmount
Definition WoodBase.c:12
static string m_SecondaryOutput
Definition WoodBase.c:16
string GetSecondaryOutput()
Definition WoodBase.c:76
void InitMiningValues()
Definition WoodBase.c:36
string GetBarkType()
Definition WoodBase.c:81
float GetDamageToMiningItemEachDrop(ItemBase item)
Definition WoodBase.c:143
int GetAmountOfDropsEx(ItemBase item, EHarvestType type)
Definition WoodBase.c:107
void GetMaterialAndQuantityMapEx(ItemBase item, out map< string, int > output_map, EHarvestType type)
Definition WoodBase.c:135
override bool IsCuttable()
Definition WoodBase.c:46
void GetMaterialAndQuantityMap(ItemBase item, out map< string, int > output_map)
Definition WoodBase.c:127
static int m_PrimaryDropsAmount
Definition WoodBase.c:11
float GetDamageToMiningItemEachDropEx(ItemBase item, EHarvestType type)
Definition WoodBase.c:168
static string m_BarkType
Definition WoodBase.c:17
float GetToolDamage()
Definition WoodBase.c:61
static float m_ToolDamage
Definition WoodBase.c:13
string GetPrimaryOutput()
Definition WoodBase.c:71
override bool IsWoodBase()
Definition WoodBase.c:41
int GetPrimaryDropsAmount()
Definition WoodBase.c:51
enum EHarvestType m_IsCuttable
void WoodBase()
Definition WoodBase.c:30
override bool CanBeActionTarget()
Definition WoodBase.c:193
static float m_CycleTimeOverride
Definition WoodBase.c:14
static string m_PrimaryOutput
Definition WoodBase.c:15
EHarvestType
Definition WoodBase.c:2
@ BARK
Definition WoodBase.c:4
@ NORMAL
Definition WoodBase.c:3
int GetSecondaryDropsAmount()
Definition WoodBase.c:56
float GetCycleTimeOverride()
Definition WoodBase.c:66
int GetAmountOfDrops(ItemBase item)
Definition WoodBase.c:87