DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
WoodBase.c
Go to the documentation of this file.
2{
4 BARK
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
87
89 {
90 if ( GetPrimaryDropsAmount() > 0 )
91 {
92 if ( IsTree() && item && ( item.KindOf("Knife") || item.IsInherited(Screwdriver) ) )
93 {
94 return -1;
95 }
96 else
97 {
98 return GetPrimaryDropsAmount();
99 }
100 }
101 else
102 {
103 if ( item && ( item.KindOf("Knife") || item.IsInherited(Screwdriver) ) )
104 {
105 return -1;
106 }
107 else if ( item && item.KindOf("Axe") )
108 {
109 return 3;
110 }
111 else
112 {
113 return 100;
114 }
115 }
116 }
117
119 {
120 if ( GetPrimaryDropsAmount() > 0 )
121 {
122 if ( IsTree() && item && type == EHarvestType.BARK )
123 {
124 return -1;
125 }
126 else
127 {
128 return GetPrimaryDropsAmount();
129 }
130 }
131 else
132 {
133 if ( item && type == EHarvestType.BARK )
134 {
135 return -1;
136 }
137 else if ( item && type == EHarvestType.NORMAL )
138 {
139 return 3;
140 }
141 else
142 {
143 return 100;
144 }
145 }
146 }
147
149 {
150 if ( IsTree() && item && ( item.KindOf("Knife") || item.IsInherited(Screwdriver) ) && GetBarkType() != "" )
151 {
152 output_map.Insert(GetBarkType(),1);
153 }
154 else
155 {
156 output_map.Insert(GetPrimaryOutput(),1);
157 }
158 }
159
161 {
162 if ( IsTree() && item && type == EHarvestType.BARK && GetBarkType() != "" )
163 {
164 output_map.Insert(GetBarkType(),1);
165 }
166 else
167 {
168 output_map.Insert(GetPrimaryOutput(),1);
169 }
170 }
171
173 {
174 if (GetToolDamage() > -1)
175 return GetToolDamage();
176
177 if ( IsTree() )
178 {
179 if ( item && item.KindOf("Knife") )
180 {
181 return 20;
182 }
183 else if ( item && item.KindOf("Axe") )
184 {
185 return 20;
186 }
187 else
188 {
189 return 0;
190 }
191 }
192 else
193 {
194 if ( item && item.KindOf("Knife") )
195 {
196 return 30;
197 }
198 else if ( item && item.KindOf("Axe") )
199 {
200 return 30;
201 }
202 else
203 {
204 return 0;
205 }
206 }
207 }
208
210 {
211 if (GetToolDamage() > -1)
212 return GetToolDamage();
213
214 if ( IsTree() )
215 {
216 if ( item && type == EHarvestType.BARK )
217 {
218 return 20;
219 }
220 else if ( item && type == EHarvestType.NORMAL )
221 {
222 return 20;
223 }
224 else
225 {
226 return 0;
227 }
228 }
229 else
230 {
231 if ( item && type == EHarvestType.BARK )
232 {
233 return 30;
234 }
235 else if ( item && type == EHarvestType.NORMAL )
236 {
237 return 30;
238 }
239 else
240 {
241 return 0;
242 }
243 }
244 }
245
246 override bool CanBeActionTarget()
247 {
248 return super.CanBeActionTarget() && !IsDamageDestroyed();
249 }
250
251};
protected bool IsDamageDestroyed(ActionTarget target)
Definition ActionBase.c:912
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:172
int GetAmountOfDropsEx(ItemBase item, EHarvestType type)
Definition WoodBase.c:118
void GetMaterialAndQuantityMapEx(ItemBase item, out map< string, int > output_map, EHarvestType type)
Definition WoodBase.c:160
override bool IsCuttable()
Definition WoodBase.c:46
void GetMaterialAndQuantityMap(ItemBase item, out map< string, int > output_map)
Definition WoodBase.c:148
static int m_PrimaryDropsAmount
Definition WoodBase.c:11
float GetDamageToMiningItemEachDropEx(ItemBase item, EHarvestType type)
Definition WoodBase.c:209
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:246
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:88