DayZ 1.24
Loading...
Searching...
No Matches
WoodBase.c File Reference

Go to the source code of this file.

Enumerations

enum  EHarvestType { NORMAL , BARK }
 

Functions

void WoodBase ()
 
void InitMiningValues ()
 
override bool IsWoodBase ()
 
override bool IsCuttable ()
 
int GetPrimaryDropsAmount ()
 
int GetSecondaryDropsAmount ()
 
float GetToolDamage ()
 
float GetCycleTimeOverride ()
 
string GetPrimaryOutput ()
 
string GetSecondaryOutput ()
 
string GetBarkType ()
 
int GetAmountOfDrops (ItemBase item)
 
int GetAmountOfDropsEx (ItemBase item, EHarvestType type)
 
void GetMaterialAndQuantityMap (ItemBase item, out map< string, int > output_map)
 
void GetMaterialAndQuantityMapEx (ItemBase item, out map< string, int > output_map, EHarvestType type)
 
float GetDamageToMiningItemEachDrop (ItemBase item)
 
float GetDamageToMiningItemEachDropEx (ItemBase item, EHarvestType type)
 
override bool CanBeActionTarget ()
 

Variables

enum EHarvestType m_IsCuttable
 
static int m_PrimaryDropsAmount = -1
 
static int m_SecondaryDropsAmount = -1
 
static float m_ToolDamage = -1.0
 
static float m_CycleTimeOverride = -1.0
 
static string m_PrimaryOutput = ""
 
static string m_SecondaryOutput = ""
 
static string m_BarkType = ""
 

Enumeration Type Documentation

◆ EHarvestType

Enumerator
NORMAL 
BARK 

Definition at line 1 of file WoodBase.c.

2{
3 NORMAL,
4 BARK
5}
@ BARK
Definition WoodBase.c:4
@ NORMAL
Definition WoodBase.c:3

Function Documentation

◆ CanBeActionTarget()

override bool CanBeActionTarget ( )

Definition at line 193 of file WoodBase.c.

194 {
195 return super.CanBeActionTarget() && !IsDamageDestroyed();
196 }
bool IsDamageDestroyed(ActionTarget target)
Definition ActionBase.c:841

References IsDamageDestroyed().

Referenced by VicinityObjects::TransformToVicinityObjects().

◆ GetAmountOfDrops()

int GetAmountOfDrops ( ItemBase item)

Definition at line 87 of file WoodBase.c.

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 }
int GetPrimaryDropsAmount()
Definition WoodBase.c:51

References GetPrimaryDropsAmount().

◆ GetAmountOfDropsEx()

int GetAmountOfDropsEx ( ItemBase item,
EHarvestType type )

Definition at line 107 of file WoodBase.c.

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 }
EHarvestType
Definition WoodBase.c:2

References GetPrimaryDropsAmount().

◆ GetBarkType()

string GetBarkType ( )

Definition at line 81 of file WoodBase.c.

82 {
83 return ConfigGetString("barkType");
84 }

Referenced by GetMaterialAndQuantityMap(), and GetMaterialAndQuantityMapEx().

◆ GetCycleTimeOverride()

float GetCycleTimeOverride ( )

Definition at line 66 of file WoodBase.c.

67 {
68 return ConfigGetFloat("cycleTimeOverride");
69 }

◆ GetDamageToMiningItemEachDrop()

float GetDamageToMiningItemEachDrop ( ItemBase item)

Definition at line 143 of file WoodBase.c.

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 }
float GetToolDamage()
Definition WoodBase.c:61

References GetToolDamage().

◆ GetDamageToMiningItemEachDropEx()

float GetDamageToMiningItemEachDropEx ( ItemBase item,
EHarvestType type )

Definition at line 168 of file WoodBase.c.

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 }

References GetToolDamage().

◆ GetMaterialAndQuantityMap()

void GetMaterialAndQuantityMap ( ItemBase item,
out map< string, int > output_map )

Definition at line 127 of file WoodBase.c.

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 }
string GetBarkType()
Definition WoodBase.c:81
string GetPrimaryOutput()
Definition WoodBase.c:71

References GetBarkType(), and GetPrimaryOutput().

◆ GetMaterialAndQuantityMapEx()

void GetMaterialAndQuantityMapEx ( ItemBase item,
out map< string, int > output_map,
EHarvestType type )

Definition at line 135 of file WoodBase.c.

136 {
137 if (IsTree() && item && type == EHarvestType.BARK && GetBarkType() != "")
138 output_map.Insert(GetBarkType(), 1);
139 else
140 output_map.Insert(GetPrimaryOutput(), 1);
141 }

References GetBarkType(), and GetPrimaryOutput().

◆ GetPrimaryDropsAmount()

int GetPrimaryDropsAmount ( )

Definition at line 51 of file WoodBase.c.

52 {
53 return ConfigGetInt("primaryDropsAmount");
54 }

Referenced by GetAmountOfDrops(), and GetAmountOfDropsEx().

◆ GetPrimaryOutput()

string GetPrimaryOutput ( )

Definition at line 71 of file WoodBase.c.

72 {
73 return ConfigGetString("primaryOutput");
74 }

Referenced by GetMaterialAndQuantityMap(), and GetMaterialAndQuantityMapEx().

◆ GetSecondaryDropsAmount()

int GetSecondaryDropsAmount ( )

Definition at line 56 of file WoodBase.c.

57 {
58 return ConfigGetInt("secondaryDropsAmount");
59 }

◆ GetSecondaryOutput()

string GetSecondaryOutput ( )

Definition at line 76 of file WoodBase.c.

77 {
78 return ConfigGetString("secondaryOutput");
79 }

◆ GetToolDamage()

float GetToolDamage ( )

Definition at line 61 of file WoodBase.c.

62 {
63 return ConfigGetFloat("toolDamage");
64 }

Referenced by GetDamageToMiningItemEachDrop(), and GetDamageToMiningItemEachDropEx().

◆ InitMiningValues()

void InitMiningValues ( )

Definition at line 36 of file WoodBase.c.

37 {
38 //m_IsCuttable = false;
39 };

◆ IsCuttable()

override bool IsCuttable ( )

Definition at line 46 of file WoodBase.c.

47 {
48 return ConfigGetBool("isCuttable");
49 }

◆ IsWoodBase()

override bool IsWoodBase ( )

Definition at line 41 of file WoodBase.c.

42 {
43 return true;
44 }

◆ WoodBase()

void WoodBase ( )

Definition at line 30 of file WoodBase.c.

31 {
32 //InitMiningValues();
33 }

Referenced by CAContinuousMineWood::Execute(), CAContinuousMineWood::GetMiningData(), and ActionMineBase::GetYieldName().

Variable Documentation

◆ m_BarkType

string m_BarkType = ""
static

Definition at line 17 of file WoodBase.c.

◆ m_CycleTimeOverride

float m_CycleTimeOverride = -1.0
static

Definition at line 14 of file WoodBase.c.

◆ m_IsCuttable

enum EHarvestType m_IsCuttable

◆ m_PrimaryDropsAmount

int m_PrimaryDropsAmount = -1
static

Definition at line 11 of file WoodBase.c.

◆ m_PrimaryOutput

string m_PrimaryOutput = ""
static

Definition at line 15 of file WoodBase.c.

◆ m_SecondaryDropsAmount

int m_SecondaryDropsAmount = -1
static

Definition at line 12 of file WoodBase.c.

◆ m_SecondaryOutput

string m_SecondaryOutput = ""
static

Definition at line 16 of file WoodBase.c.

◆ m_ToolDamage

float m_ToolDamage = -1.0
static

Definition at line 13 of file WoodBase.c.