151 {
154
155 string partName = BuildPartActionData.Cast(action_data).m_PartType;
158
159 checkData.m_PartName = partName;
161
163 #ifdef DIAG_DEVELOPER
164 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
165 canBuild = true;
166 #endif
167 if (!construction.IsCollidingEx(checkData) && canBuild)
168 {
169
171
172 #ifdef DIAG_DEVELOPER
173
174 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
175 return;
176 #endif
177
178
180 {
182 action_data.
m_MainItem.DecreaseHealth(UADamageApplied.BUILD,
false);
183 }
184 else
185 {
187 {
188 EntityAI gloves = action_data.
m_Player.GetInventory().FindAttachment(InventorySlots.GLOVES);
189 if (gloves && gloves.GetHealthLevel() < 4)
190 {
191 gloves.AddHealth("","", PlayerConstants.GLOVES_DAMAGE_HAND_CONSTRUCTION);
192 }
193 else if (Math.RandomFloat01() < PlayerConstants.CHANCE_TO_BLEED_HAND_CONSTRUCTION)
194 {
195 if (Math.RandomFloat01() < 0.5)
196 action_data.
m_Player.GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"LeftForeArmRoll");
197 else
198 action_data.
m_Player.GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"RightForeArmRoll");
200 }
201 }
202 }
203 }
204 }
override bool UseMainItem()
void ConstructionBase(EntityAI parent)
void CollisionCheckData()
void ConstructionPart(string name, string part_name, string main_part_name, int id, bool is_built, bool is_base, bool is_gate, array< string > required_parts)
ref ActionTarget m_Target
bool DamageHandsOnBuild()
proto void Insert(int index, string input)
Inserts a string into the n-th index, increasing the string length by the size of the input.