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

Go to the source code of this file.

Classes

class  BuildPartActionReciveData
 
class  ActionBuildPartCB
 
class  ActionBuildPart
 

Functions

ActionBuildPart ActionContinuousBase GetInputType ()
 
void ActionBuildPart ()
 
override void CreateConditionComponents ()
 
override void OnActionInfoUpdate (PlayerBase player, ActionTarget target, ItemBase item)
 
override bool CanBeUsedLeaning ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override bool ActionConditionContinue (ActionData action_data)
 
override void OnFinishProgressServer (ActionData action_data)
 
override string GetSoundCategory (ActionData action_data)
 
override ActionData CreateActionData ()
 
override bool SetupAction (PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data=NULL)
 
void SetBuildingAnimation (ItemBase item)
 
override void WriteToContext (ParamsWriteContext ctx, ActionData action_data)
 
override bool ReadFromContext (ParamsReadContext ctx, out ActionReciveData action_recive_data)
 
override void HandleReciveData (ActionReciveData action_recive_data, ActionData action_data)
 
override string GetAdminLogMessage (ActionData action_data)
 
override bool UseMainItem ()
 
override bool HasProgress ()
 
override bool HasAlternativeInterrupt ()
 

Variables

BuildPartActionReciveData m_PartType
 

Function Documentation

◆ ActionBuildPart()

void GetInputType::ActionBuildPart ( )

Definition at line 215 of file ActionBuildPart.c.

215 {
217 }
218
219 override bool UseMainItem()
220 {
221 return false;
222 }
223
224 override bool HasProgress()
override bool HasProgress()
override bool UseMainItem()

◆ ActionCondition()

override bool GetInputType::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )

Definition at line 246 of file ActionBuildPart.c.

246 : ActionReciveData
247{
248 string m_PartType;
249}
250
252{
253 string m_PartType;
254};
255
257{
258 override void CreateActionComponent()
259 {
262 }
263
265 {
267 }
268};
269
271{
272 void ActionBuildPart()
273 {
275 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
276 m_FullBody = true;
277 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
278
280 m_Text = "#build";
281 }
282
283 override void CreateConditionComponents()
284 {
287 }
288
289 override void OnActionInfoUpdate(PlayerBase player, ActionTarget target, ItemBase item)
290 {
291 ConstructionActionData construction_action_data = player.GetConstructionActionData();
293
295 m_Text = "#build " + constrution_part.GetName();
296 }
297
298 override bool CanBeUsedLeaning()
299 {
300 return false;
301 }
302
303 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
304 {
305 if (player.IsPlacingLocal() || player.IsPlacingServer())
306 return false;
307
308 //Action not allowed if player has broken legs
309 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
310 return false;
311
312 //gate..
313 if (target.GetObject() && (!target.GetObject().CanUseConstructionBuild() || target.GetObject().CanUseHandConstruction()))
314 return false;
315
316 if ((!GetGame().IsDedicatedServer()))
317 {
318 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item, m_VariantID))
319 return true;
320 return false;
321 }
322 return true;
323 }
324
326 {
327 BaseBuildingBase base_building = BaseBuildingBase.Cast(action_data.m_Target.GetObject());
328 Construction construction = base_building.GetConstruction();
329 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
331
332 check_data.m_PartName = part_name;
333 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
334
335 bool canBuild = construction.CanBuildPart(part_name, action_data.m_MainItem, true);
336 if (GetGame().IsServer())
337 {
338 bool collides = construction.IsCollidingEx(check_data);
339
340 return !collides && canBuild;
341 }
342 else
343 return canBuild;
344 }
345
347 {
348 BaseBuildingBase base_building = BaseBuildingBase.Cast(action_data.m_Target.GetObject());
349 Construction construction = base_building.GetConstruction();
350
351 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
353
354 check_data.m_PartName = part_name;
355 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
356
357 if (!construction.IsCollidingEx(check_data) && construction.CanBuildPart(part_name, action_data.m_MainItem, true)) //redundant at this point?
358 {
359 //build
360 construction.BuildPartServer(action_data.m_Player, part_name, AT_BUILD_PART);
361 //add damage to tool
362 action_data.m_MainItem.DecreaseHealth(UADamageApplied.BUILD, false);
363 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
364 }
365 }
366
368 {
369 return "Base_building";
370 }
371
373 {
375 return action_data;
376 }
377
378 //setup
380 {
381 if (super.SetupAction(player, target, item, action_data, extra_data))
382 {
384
385 if (!GetGame().IsDedicatedServer())
386 {
387 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
388 BuildPartActionData.Cast(action_data).m_PartType = construction_action_data.GetBuildPartAtIndex(m_VariantID).GetPartName();
389 }
390 return true;
391 }
392
393 return false;
394 }
395
396 protected void SetBuildingAnimation(ItemBase item)
397 {
398 switch (item.Type())
399 {
400 case Pickaxe:
401 case Shovel:
402 case FarmingHoe:
403 case FieldShovel:
404 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DIG;
405 break;
406 case Pliers:
407 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
408 break;
409 case SledgeHammer:
410 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_MINEROCK;
411 break;
412 default:
413 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
414 break;
415 }
416 }
417
419 {
420 super.WriteToContext(ctx, action_data);
421
422 ctx.Write(BuildPartActionData.Cast(action_data).m_PartType);
423 }
424
425 override bool ReadFromContext(ParamsReadContext ctx, out ActionReciveData action_recive_data)
426 {
428 super.ReadFromContext(ctx, action_recive_data);
429
430 string part_type;
431 if (ctx.Read(part_type))
432 {
434 return true;
435 }
436 else
437 return false;
438 }
439
440 override void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
441 {
442 super.HandleReciveData(action_recive_data, action_data);
443
445 }
446
448 {
449 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
450 string partName = BuildPartActionData.Cast(action_data).m_PartType;
451
452 string message = string.Format("Built %1 on %2 with %3", partName, action_data.m_Target.GetObject().GetDisplayName(), action_data.m_MainItem.GetDisplayName());
453 return message;
454 }
455}
456
458{
459 override typename GetInputType()
460 {
462 }
463
464 override bool UseMainItem()
465 {
466 return false;
467 }
468
469 override bool HasProgress()
470 {
471 return true;
472 }
473
474 override bool HasAlternativeInterrupt()
475 {
476 return false;
477 }
478}
const int AT_BUILD_PART
Definition _constants.c:6
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
int m_VariantID
Definition ActionBase.c:59
GetInputType()
Definition ActionBase.c:181
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
bool UseMainItem()
Definition ActionBase.c:335
int m_StanceMask
Definition ActionBase.c:53
bool HasProgress()
For UI: hiding of progress bar.
Definition ActionBase.c:216
BuildPartActionReciveData m_PartType
override bool HasAlternativeInterrupt()
void CollisionCheckData()
void Construction(BaseBuildingBase parent)
eBrokenLegs
Definition EBrokenLegs.c:2
ActionData m_ActionData
float SetCallbackDuration(ItemBase item)
override void CreateActionComponent()
override bool SetupAction(PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data=NULL)
override bool CanBeUsedLeaning()
override void CreateConditionComponents()
override string GetSoundCategory(ActionData action_data)
override bool ReadFromContext(ParamsReadContext ctx, out ActionReciveData action_recive_data)
void SetBuildingAnimation(ItemBase item)
override bool ActionConditionContinue(ActionData action_data)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override ActionData CreateActionData()
override void WriteToContext(ParamsWriteContext ctx, ActionData action_data)
override string GetAdminLogMessage(ActionData action_data)
override void OnFinishProgressServer(ActionData action_data)
override void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
override void OnActionInfoUpdate(PlayerBase player, ActionTarget target, ItemBase item)
ref CABase m_ActionComponent
Definition ActionBase.c:30
ItemBase m_MainItem
Definition ActionBase.c:28
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12
Serialization general interface. Serializer API works with:
Definition Serializer.c:56
const float BASEBUILDING_CONSTRUCT_MEDIUM
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
proto native CGame GetGame()

◆ ActionConditionContinue()

override bool GetInputType::ActionConditionContinue ( ActionData action_data)

Definition at line 268 of file ActionBuildPart.c.

268 : ActionReciveData
269{
270 string m_PartType;
271}
272
274{
275 string m_PartType;
276};
277
279{
280 override void CreateActionComponent()
281 {
284 }
285
287 {
289 }
290};
291
293{
294 void ActionBuildPart()
295 {
297 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
298 m_FullBody = true;
299 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
300
302 m_Text = "#build";
303 }
304
305 override void CreateConditionComponents()
306 {
309 }
310
311 override void OnActionInfoUpdate(PlayerBase player, ActionTarget target, ItemBase item)
312 {
313 ConstructionActionData construction_action_data = player.GetConstructionActionData();
315
317 m_Text = "#build " + constrution_part.GetName();
318 }
319
320 override bool CanBeUsedLeaning()
321 {
322 return false;
323 }
324
325 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
326 {
327 if (player.IsPlacingLocal() || player.IsPlacingServer())
328 return false;
329
330 //Action not allowed if player has broken legs
331 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
332 return false;
333
334 //gate..
335 if (target.GetObject() && (!target.GetObject().CanUseConstructionBuild() || target.GetObject().CanUseHandConstruction()))
336 return false;
337
338 if ((!GetGame().IsDedicatedServer()))
339 {
340 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item, m_VariantID))
341 return true;
342 return false;
343 }
344 return true;
345 }
346
348 {
349 BaseBuildingBase base_building = BaseBuildingBase.Cast(action_data.m_Target.GetObject());
350 Construction construction = base_building.GetConstruction();
351 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
353
354 check_data.m_PartName = part_name;
355 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
356
357 bool canBuild = construction.CanBuildPart(part_name, action_data.m_MainItem, true);
358 if (GetGame().IsServer())
359 {
360 bool collides = construction.IsCollidingEx(check_data);
361
362 return !collides && canBuild;
363 }
364 else
365 return canBuild;
366 }
367
369 {
370 BaseBuildingBase base_building = BaseBuildingBase.Cast(action_data.m_Target.GetObject());
371 Construction construction = base_building.GetConstruction();
372
373 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
375
376 check_data.m_PartName = part_name;
377 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
378
379 if (!construction.IsCollidingEx(check_data) && construction.CanBuildPart(part_name, action_data.m_MainItem, true)) //redundant at this point?
380 {
381 //build
382 construction.BuildPartServer(action_data.m_Player, part_name, AT_BUILD_PART);
383 //add damage to tool
384 action_data.m_MainItem.DecreaseHealth(UADamageApplied.BUILD, false);
385 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
386 }
387 }
388
390 {
391 return "Base_building";
392 }
393
395 {
397 return action_data;
398 }
399
400 //setup
402 {
403 if (super.SetupAction(player, target, item, action_data, extra_data))
404 {
406
407 if (!GetGame().IsDedicatedServer())
408 {
409 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
410 BuildPartActionData.Cast(action_data).m_PartType = construction_action_data.GetBuildPartAtIndex(m_VariantID).GetPartName();
411 }
412 return true;
413 }
414
415 return false;
416 }
417
418 protected void SetBuildingAnimation(ItemBase item)
419 {
420 switch (item.Type())
421 {
422 case Pickaxe:
423 case Shovel:
424 case FarmingHoe:
425 case FieldShovel:
426 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DIG;
427 break;
428 case Pliers:
429 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
430 break;
431 case SledgeHammer:
432 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_MINEROCK;
433 break;
434 default:
435 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
436 break;
437 }
438 }
439
441 {
442 super.WriteToContext(ctx, action_data);
443
444 ctx.Write(BuildPartActionData.Cast(action_data).m_PartType);
445 }
446
447 override bool ReadFromContext(ParamsReadContext ctx, out ActionReciveData action_recive_data)
448 {
450 super.ReadFromContext(ctx, action_recive_data);
451
452 string part_type;
453 if (ctx.Read(part_type))
454 {
456 return true;
457 }
458 else
459 return false;
460 }
461
462 override void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
463 {
464 super.HandleReciveData(action_recive_data, action_data);
465
467 }
468
470 {
471 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
472 string partName = BuildPartActionData.Cast(action_data).m_PartType;
473
474 string message = string.Format("Built %1 on %2 with %3", partName, action_data.m_Target.GetObject().GetDisplayName(), action_data.m_MainItem.GetDisplayName());
475 return message;
476 }
477}
478
480{
481 override typename GetInputType()
482 {
484 }
485
486 override bool UseMainItem()
487 {
488 return false;
489 }
490
491 override bool HasProgress()
492 {
493 return true;
494 }
495
496 override bool HasAlternativeInterrupt()
497 {
498 return false;
499 }
500}

◆ CanBeUsedLeaning()

override bool GetInputType::CanBeUsedLeaning ( )

Definition at line 241 of file ActionBuildPart.c.

241 : ActionReciveData
242{
243 string m_PartType;
244}
245
247{
248 string m_PartType;
249};
250
252{
253 override void CreateActionComponent()
254 {
257 }
258
260 {
262 }
263};
264
266{
267 void ActionBuildPart()
268 {
270 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
271 m_FullBody = true;
272 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
273
275 m_Text = "#build";
276 }
277
278 override void CreateConditionComponents()
279 {
282 }
283
284 override void OnActionInfoUpdate(PlayerBase player, ActionTarget target, ItemBase item)
285 {
286 ConstructionActionData construction_action_data = player.GetConstructionActionData();
288
290 m_Text = "#build " + constrution_part.GetName();
291 }
292
293 override bool CanBeUsedLeaning()
294 {
295 return false;
296 }
297
298 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
299 {
300 if (player.IsPlacingLocal() || player.IsPlacingServer())
301 return false;
302
303 //Action not allowed if player has broken legs
304 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
305 return false;
306
307 //gate..
308 if (target.GetObject() && (!target.GetObject().CanUseConstructionBuild() || target.GetObject().CanUseHandConstruction()))
309 return false;
310
311 if ((!GetGame().IsDedicatedServer()))
312 {
313 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item, m_VariantID))
314 return true;
315 return false;
316 }
317 return true;
318 }
319
321 {
322 BaseBuildingBase base_building = BaseBuildingBase.Cast(action_data.m_Target.GetObject());
323 Construction construction = base_building.GetConstruction();
324 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
326
327 check_data.m_PartName = part_name;
328 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
329
330 bool canBuild = construction.CanBuildPart(part_name, action_data.m_MainItem, true);
331 if (GetGame().IsServer())
332 {
333 bool collides = construction.IsCollidingEx(check_data);
334
335 return !collides && canBuild;
336 }
337 else
338 return canBuild;
339 }
340
342 {
343 BaseBuildingBase base_building = BaseBuildingBase.Cast(action_data.m_Target.GetObject());
344 Construction construction = base_building.GetConstruction();
345
346 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
348
349 check_data.m_PartName = part_name;
350 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
351
352 if (!construction.IsCollidingEx(check_data) && construction.CanBuildPart(part_name, action_data.m_MainItem, true)) //redundant at this point?
353 {
354 //build
355 construction.BuildPartServer(action_data.m_Player, part_name, AT_BUILD_PART);
356 //add damage to tool
357 action_data.m_MainItem.DecreaseHealth(UADamageApplied.BUILD, false);
358 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
359 }
360 }
361
363 {
364 return "Base_building";
365 }
366
368 {
370 return action_data;
371 }
372
373 //setup
375 {
376 if (super.SetupAction(player, target, item, action_data, extra_data))
377 {
379
380 if (!GetGame().IsDedicatedServer())
381 {
382 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
383 BuildPartActionData.Cast(action_data).m_PartType = construction_action_data.GetBuildPartAtIndex(m_VariantID).GetPartName();
384 }
385 return true;
386 }
387
388 return false;
389 }
390
391 protected void SetBuildingAnimation(ItemBase item)
392 {
393 switch (item.Type())
394 {
395 case Pickaxe:
396 case Shovel:
397 case FarmingHoe:
398 case FieldShovel:
399 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DIG;
400 break;
401 case Pliers:
402 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
403 break;
404 case SledgeHammer:
405 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_MINEROCK;
406 break;
407 default:
408 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
409 break;
410 }
411 }
412
414 {
415 super.WriteToContext(ctx, action_data);
416
417 ctx.Write(BuildPartActionData.Cast(action_data).m_PartType);
418 }
419
420 override bool ReadFromContext(ParamsReadContext ctx, out ActionReciveData action_recive_data)
421 {
423 super.ReadFromContext(ctx, action_recive_data);
424
425 string part_type;
426 if (ctx.Read(part_type))
427 {
429 return true;
430 }
431 else
432 return false;
433 }
434
435 override void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
436 {
437 super.HandleReciveData(action_recive_data, action_data);
438
440 }
441
443 {
444 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
445 string partName = BuildPartActionData.Cast(action_data).m_PartType;
446
447 string message = string.Format("Built %1 on %2 with %3", partName, action_data.m_Target.GetObject().GetDisplayName(), action_data.m_MainItem.GetDisplayName());
448 return message;
449 }
450}
451
453{
454 override typename GetInputType()
455 {
457 }
458
459 override bool UseMainItem()
460 {
461 return false;
462 }
463
464 override bool HasProgress()
465 {
466 return true;
467 }
468
469 override bool HasAlternativeInterrupt()
470 {
471 return false;
472 }
473}

◆ CreateActionData()

override ActionData GetInputType::CreateActionData ( )

Definition at line 315 of file ActionBuildPart.c.

315 : ActionReciveData
316{
317 string m_PartType;
318}
319
321{
322 string m_PartType;
323};
324
326{
327 override void CreateActionComponent()
328 {
331 }
332
334 {
336 }
337};
338
340{
341 void ActionBuildPart()
342 {
344 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
345 m_FullBody = true;
346 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
347
349 m_Text = "#build";
350 }
351
352 override void CreateConditionComponents()
353 {
356 }
357
358 override void OnActionInfoUpdate(PlayerBase player, ActionTarget target, ItemBase item)
359 {
360 ConstructionActionData construction_action_data = player.GetConstructionActionData();
362
364 m_Text = "#build " + constrution_part.GetName();
365 }
366
367 override bool CanBeUsedLeaning()
368 {
369 return false;
370 }
371
372 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
373 {
374 if (player.IsPlacingLocal() || player.IsPlacingServer())
375 return false;
376
377 //Action not allowed if player has broken legs
378 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
379 return false;
380
381 //gate..
382 if (target.GetObject() && (!target.GetObject().CanUseConstructionBuild() || target.GetObject().CanUseHandConstruction()))
383 return false;
384
385 if ((!GetGame().IsDedicatedServer()))
386 {
387 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item, m_VariantID))
388 return true;
389 return false;
390 }
391 return true;
392 }
393
395 {
396 BaseBuildingBase base_building = BaseBuildingBase.Cast(action_data.m_Target.GetObject());
397 Construction construction = base_building.GetConstruction();
398 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
400
401 check_data.m_PartName = part_name;
402 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
403
404 bool canBuild = construction.CanBuildPart(part_name, action_data.m_MainItem, true);
405 if (GetGame().IsServer())
406 {
407 bool collides = construction.IsCollidingEx(check_data);
408
409 return !collides && canBuild;
410 }
411 else
412 return canBuild;
413 }
414
416 {
417 BaseBuildingBase base_building = BaseBuildingBase.Cast(action_data.m_Target.GetObject());
418 Construction construction = base_building.GetConstruction();
419
420 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
422
423 check_data.m_PartName = part_name;
424 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
425
426 if (!construction.IsCollidingEx(check_data) && construction.CanBuildPart(part_name, action_data.m_MainItem, true)) //redundant at this point?
427 {
428 //build
429 construction.BuildPartServer(action_data.m_Player, part_name, AT_BUILD_PART);
430 //add damage to tool
431 action_data.m_MainItem.DecreaseHealth(UADamageApplied.BUILD, false);
432 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
433 }
434 }
435
437 {
438 return "Base_building";
439 }
440
442 {
444 return action_data;
445 }
446
447 //setup
449 {
450 if (super.SetupAction(player, target, item, action_data, extra_data))
451 {
453
454 if (!GetGame().IsDedicatedServer())
455 {
456 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
457 BuildPartActionData.Cast(action_data).m_PartType = construction_action_data.GetBuildPartAtIndex(m_VariantID).GetPartName();
458 }
459 return true;
460 }
461
462 return false;
463 }
464
465 protected void SetBuildingAnimation(ItemBase item)
466 {
467 switch (item.Type())
468 {
469 case Pickaxe:
470 case Shovel:
471 case FarmingHoe:
472 case FieldShovel:
473 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DIG;
474 break;
475 case Pliers:
476 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
477 break;
478 case SledgeHammer:
479 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_MINEROCK;
480 break;
481 default:
482 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
483 break;
484 }
485 }
486
488 {
489 super.WriteToContext(ctx, action_data);
490
491 ctx.Write(BuildPartActionData.Cast(action_data).m_PartType);
492 }
493
494 override bool ReadFromContext(ParamsReadContext ctx, out ActionReciveData action_recive_data)
495 {
497 super.ReadFromContext(ctx, action_recive_data);
498
499 string part_type;
500 if (ctx.Read(part_type))
501 {
503 return true;
504 }
505 else
506 return false;
507 }
508
509 override void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
510 {
511 super.HandleReciveData(action_recive_data, action_data);
512
514 }
515
517 {
518 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
519 string partName = BuildPartActionData.Cast(action_data).m_PartType;
520
521 string message = string.Format("Built %1 on %2 with %3", partName, action_data.m_Target.GetObject().GetDisplayName(), action_data.m_MainItem.GetDisplayName());
522 return message;
523 }
524}
525
527{
528 override typename GetInputType()
529 {
531 }
532
533 override bool UseMainItem()
534 {
535 return false;
536 }
537
538 override bool HasProgress()
539 {
540 return true;
541 }
542
543 override bool HasAlternativeInterrupt()
544 {
545 return false;
546 }
547}

◆ CreateConditionComponents()

override void GetInputType::CreateConditionComponents ( )

Definition at line 226 of file ActionBuildPart.c.

230 {

◆ GetAdminLogMessage()

override string GetInputType::GetAdminLogMessage ( ActionData action_data)
protected

Definition at line 390 of file ActionBuildPart.c.

390 : ActionReciveData
391{
392 string m_PartType;
393}
394
396{
397 string m_PartType;
398};
399
401{
402 override void CreateActionComponent()
403 {
406 }
407
409 {
411 }
412};
413
415{
416 void ActionBuildPart()
417 {
419 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
420 m_FullBody = true;
421 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
422
424 m_Text = "#build";
425 }
426
427 override void CreateConditionComponents()
428 {
431 }
432
433 override void OnActionInfoUpdate(PlayerBase player, ActionTarget target, ItemBase item)
434 {
435 ConstructionActionData construction_action_data = player.GetConstructionActionData();
437
439 m_Text = "#build " + constrution_part.GetName();
440 }
441
442 override bool CanBeUsedLeaning()
443 {
444 return false;
445 }
446
447 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
448 {
449 if (player.IsPlacingLocal() || player.IsPlacingServer())
450 return false;
451
452 //Action not allowed if player has broken legs
453 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
454 return false;
455
456 //gate..
457 if (target.GetObject() && (!target.GetObject().CanUseConstructionBuild() || target.GetObject().CanUseHandConstruction()))
458 return false;
459
460 if ((!GetGame().IsDedicatedServer()))
461 {
462 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item, m_VariantID))
463 return true;
464 return false;
465 }
466 return true;
467 }
468
470 {
471 BaseBuildingBase base_building = BaseBuildingBase.Cast(action_data.m_Target.GetObject());
472 Construction construction = base_building.GetConstruction();
473 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
475
476 check_data.m_PartName = part_name;
477 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
478
479 bool canBuild = construction.CanBuildPart(part_name, action_data.m_MainItem, true);
480 if (GetGame().IsServer())
481 {
482 bool collides = construction.IsCollidingEx(check_data);
483
484 return !collides && canBuild;
485 }
486 else
487 return canBuild;
488 }
489
491 {
492 BaseBuildingBase base_building = BaseBuildingBase.Cast(action_data.m_Target.GetObject());
493 Construction construction = base_building.GetConstruction();
494
495 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
497
498 check_data.m_PartName = part_name;
499 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
500
501 if (!construction.IsCollidingEx(check_data) && construction.CanBuildPart(part_name, action_data.m_MainItem, true)) //redundant at this point?
502 {
503 //build
504 construction.BuildPartServer(action_data.m_Player, part_name, AT_BUILD_PART);
505 //add damage to tool
506 action_data.m_MainItem.DecreaseHealth(UADamageApplied.BUILD, false);
507 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
508 }
509 }
510
512 {
513 return "Base_building";
514 }
515
517 {
519 return action_data;
520 }
521
522 //setup
524 {
525 if (super.SetupAction(player, target, item, action_data, extra_data))
526 {
528
529 if (!GetGame().IsDedicatedServer())
530 {
531 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
532 BuildPartActionData.Cast(action_data).m_PartType = construction_action_data.GetBuildPartAtIndex(m_VariantID).GetPartName();
533 }
534 return true;
535 }
536
537 return false;
538 }
539
540 protected void SetBuildingAnimation(ItemBase item)
541 {
542 switch (item.Type())
543 {
544 case Pickaxe:
545 case Shovel:
546 case FarmingHoe:
547 case FieldShovel:
548 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DIG;
549 break;
550 case Pliers:
551 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
552 break;
553 case SledgeHammer:
554 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_MINEROCK;
555 break;
556 default:
557 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
558 break;
559 }
560 }
561
563 {
564 super.WriteToContext(ctx, action_data);
565
566 ctx.Write(BuildPartActionData.Cast(action_data).m_PartType);
567 }
568
569 override bool ReadFromContext(ParamsReadContext ctx, out ActionReciveData action_recive_data)
570 {
572 super.ReadFromContext(ctx, action_recive_data);
573
574 string part_type;
575 if (ctx.Read(part_type))
576 {
578 return true;
579 }
580 else
581 return false;
582 }
583
584 override void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
585 {
586 super.HandleReciveData(action_recive_data, action_data);
587
589 }
590
592 {
593 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
594 string partName = BuildPartActionData.Cast(action_data).m_PartType;
595
596 string message = string.Format("Built %1 on %2 with %3", partName, action_data.m_Target.GetObject().GetDisplayName(), action_data.m_MainItem.GetDisplayName());
597 return message;
598 }
599}
600
602{
603 override typename GetInputType()
604 {
606 }
607
608 override bool UseMainItem()
609 {
610 return false;
611 }
612
613 override bool HasProgress()
614 {
615 return true;
616 }
617
618 override bool HasAlternativeInterrupt()
619 {
620 return false;
621 }
622}

◆ GetInputType()

Definition at line 1 of file ActionBuildPart.c.

215 {
217 }

◆ GetSoundCategory()

override string GetInputType::GetSoundCategory ( ActionData action_data)

Definition at line 310 of file ActionBuildPart.c.

310 : ActionReciveData
311{
312 string m_PartType;
313}
314
316{
317 string m_PartType;
318};
319
321{
322 override void CreateActionComponent()
323 {
326 }
327
329 {
331 }
332};
333
335{
336 void ActionBuildPart()
337 {
339 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
340 m_FullBody = true;
341 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
342
344 m_Text = "#build";
345 }
346
347 override void CreateConditionComponents()
348 {
351 }
352
353 override void OnActionInfoUpdate(PlayerBase player, ActionTarget target, ItemBase item)
354 {
355 ConstructionActionData construction_action_data = player.GetConstructionActionData();
357
359 m_Text = "#build " + constrution_part.GetName();
360 }
361
362 override bool CanBeUsedLeaning()
363 {
364 return false;
365 }
366
367 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
368 {
369 if (player.IsPlacingLocal() || player.IsPlacingServer())
370 return false;
371
372 //Action not allowed if player has broken legs
373 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
374 return false;
375
376 //gate..
377 if (target.GetObject() && (!target.GetObject().CanUseConstructionBuild() || target.GetObject().CanUseHandConstruction()))
378 return false;
379
380 if ((!GetGame().IsDedicatedServer()))
381 {
382 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item, m_VariantID))
383 return true;
384 return false;
385 }
386 return true;
387 }
388
390 {
391 BaseBuildingBase base_building = BaseBuildingBase.Cast(action_data.m_Target.GetObject());
392 Construction construction = base_building.GetConstruction();
393 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
395
396 check_data.m_PartName = part_name;
397 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
398
399 bool canBuild = construction.CanBuildPart(part_name, action_data.m_MainItem, true);
400 if (GetGame().IsServer())
401 {
402 bool collides = construction.IsCollidingEx(check_data);
403
404 return !collides && canBuild;
405 }
406 else
407 return canBuild;
408 }
409
411 {
412 BaseBuildingBase base_building = BaseBuildingBase.Cast(action_data.m_Target.GetObject());
413 Construction construction = base_building.GetConstruction();
414
415 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
417
418 check_data.m_PartName = part_name;
419 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
420
421 if (!construction.IsCollidingEx(check_data) && construction.CanBuildPart(part_name, action_data.m_MainItem, true)) //redundant at this point?
422 {
423 //build
424 construction.BuildPartServer(action_data.m_Player, part_name, AT_BUILD_PART);
425 //add damage to tool
426 action_data.m_MainItem.DecreaseHealth(UADamageApplied.BUILD, false);
427 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
428 }
429 }
430
432 {
433 return "Base_building";
434 }
435
437 {
439 return action_data;
440 }
441
442 //setup
444 {
445 if (super.SetupAction(player, target, item, action_data, extra_data))
446 {
448
449 if (!GetGame().IsDedicatedServer())
450 {
451 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
452 BuildPartActionData.Cast(action_data).m_PartType = construction_action_data.GetBuildPartAtIndex(m_VariantID).GetPartName();
453 }
454 return true;
455 }
456
457 return false;
458 }
459
460 protected void SetBuildingAnimation(ItemBase item)
461 {
462 switch (item.Type())
463 {
464 case Pickaxe:
465 case Shovel:
466 case FarmingHoe:
467 case FieldShovel:
468 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DIG;
469 break;
470 case Pliers:
471 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
472 break;
473 case SledgeHammer:
474 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_MINEROCK;
475 break;
476 default:
477 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
478 break;
479 }
480 }
481
483 {
484 super.WriteToContext(ctx, action_data);
485
486 ctx.Write(BuildPartActionData.Cast(action_data).m_PartType);
487 }
488
489 override bool ReadFromContext(ParamsReadContext ctx, out ActionReciveData action_recive_data)
490 {
492 super.ReadFromContext(ctx, action_recive_data);
493
494 string part_type;
495 if (ctx.Read(part_type))
496 {
498 return true;
499 }
500 else
501 return false;
502 }
503
504 override void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
505 {
506 super.HandleReciveData(action_recive_data, action_data);
507
509 }
510
512 {
513 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
514 string partName = BuildPartActionData.Cast(action_data).m_PartType;
515
516 string message = string.Format("Built %1 on %2 with %3", partName, action_data.m_Target.GetObject().GetDisplayName(), action_data.m_MainItem.GetDisplayName());
517 return message;
518 }
519}
520
522{
523 override typename GetInputType()
524 {
526 }
527
528 override bool UseMainItem()
529 {
530 return false;
531 }
532
533 override bool HasProgress()
534 {
535 return true;
536 }
537
538 override bool HasAlternativeInterrupt()
539 {
540 return false;
541 }
542}

◆ HandleReciveData()

override void GetInputType::HandleReciveData ( ActionReciveData action_recive_data,
ActionData action_data )
protected

Definition at line 383 of file ActionBuildPart.c.

383 : ActionReciveData
384{
385 string m_PartType;
386}
387
389{
390 string m_PartType;
391};
392
394{
395 override void CreateActionComponent()
396 {
399 }
400
402 {
404 }
405};
406
408{
409 void ActionBuildPart()
410 {
412 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
413 m_FullBody = true;
414 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
415
417 m_Text = "#build";
418 }
419
420 override void CreateConditionComponents()
421 {
424 }
425
426 override void OnActionInfoUpdate(PlayerBase player, ActionTarget target, ItemBase item)
427 {
428 ConstructionActionData construction_action_data = player.GetConstructionActionData();
430
432 m_Text = "#build " + constrution_part.GetName();
433 }
434
435 override bool CanBeUsedLeaning()
436 {
437 return false;
438 }
439
440 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
441 {
442 if (player.IsPlacingLocal() || player.IsPlacingServer())
443 return false;
444
445 //Action not allowed if player has broken legs
446 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
447 return false;
448
449 //gate..
450 if (target.GetObject() && (!target.GetObject().CanUseConstructionBuild() || target.GetObject().CanUseHandConstruction()))
451 return false;
452
453 if ((!GetGame().IsDedicatedServer()))
454 {
455 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item, m_VariantID))
456 return true;
457 return false;
458 }
459 return true;
460 }
461
463 {
464 BaseBuildingBase base_building = BaseBuildingBase.Cast(action_data.m_Target.GetObject());
465 Construction construction = base_building.GetConstruction();
466 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
468
469 check_data.m_PartName = part_name;
470 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
471
472 bool canBuild = construction.CanBuildPart(part_name, action_data.m_MainItem, true);
473 if (GetGame().IsServer())
474 {
475 bool collides = construction.IsCollidingEx(check_data);
476
477 return !collides && canBuild;
478 }
479 else
480 return canBuild;
481 }
482
484 {
485 BaseBuildingBase base_building = BaseBuildingBase.Cast(action_data.m_Target.GetObject());
486 Construction construction = base_building.GetConstruction();
487
488 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
490
491 check_data.m_PartName = part_name;
492 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
493
494 if (!construction.IsCollidingEx(check_data) && construction.CanBuildPart(part_name, action_data.m_MainItem, true)) //redundant at this point?
495 {
496 //build
497 construction.BuildPartServer(action_data.m_Player, part_name, AT_BUILD_PART);
498 //add damage to tool
499 action_data.m_MainItem.DecreaseHealth(UADamageApplied.BUILD, false);
500 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
501 }
502 }
503
505 {
506 return "Base_building";
507 }
508
510 {
512 return action_data;
513 }
514
515 //setup
517 {
518 if (super.SetupAction(player, target, item, action_data, extra_data))
519 {
521
522 if (!GetGame().IsDedicatedServer())
523 {
524 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
525 BuildPartActionData.Cast(action_data).m_PartType = construction_action_data.GetBuildPartAtIndex(m_VariantID).GetPartName();
526 }
527 return true;
528 }
529
530 return false;
531 }
532
533 protected void SetBuildingAnimation(ItemBase item)
534 {
535 switch (item.Type())
536 {
537 case Pickaxe:
538 case Shovel:
539 case FarmingHoe:
540 case FieldShovel:
541 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DIG;
542 break;
543 case Pliers:
544 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
545 break;
546 case SledgeHammer:
547 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_MINEROCK;
548 break;
549 default:
550 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
551 break;
552 }
553 }
554
556 {
557 super.WriteToContext(ctx, action_data);
558
559 ctx.Write(BuildPartActionData.Cast(action_data).m_PartType);
560 }
561
562 override bool ReadFromContext(ParamsReadContext ctx, out ActionReciveData action_recive_data)
563 {
565 super.ReadFromContext(ctx, action_recive_data);
566
567 string part_type;
568 if (ctx.Read(part_type))
569 {
571 return true;
572 }
573 else
574 return false;
575 }
576
577 override void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
578 {
579 super.HandleReciveData(action_recive_data, action_data);
580
582 }
583
585 {
586 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
587 string partName = BuildPartActionData.Cast(action_data).m_PartType;
588
589 string message = string.Format("Built %1 on %2 with %3", partName, action_data.m_Target.GetObject().GetDisplayName(), action_data.m_MainItem.GetDisplayName());
590 return message;
591 }
592}
593
595{
596 override typename GetInputType()
597 {
599 }
600
601 override bool UseMainItem()
602 {
603 return false;
604 }
605
606 override bool HasProgress()
607 {
608 return true;
609 }
610
611 override bool HasAlternativeInterrupt()
612 {
613 return false;
614 }
615}

◆ HasAlternativeInterrupt()

override bool HasAlternativeInterrupt ( )

Definition at line 229 of file ActionBuildPart.c.

230 {
231 return false;
232 }

◆ HasProgress()

override bool HasProgress ( )

Definition at line 224 of file ActionBuildPart.c.

225 {
226 return true;
227 }

◆ OnActionInfoUpdate()

override void GetInputType::OnActionInfoUpdate ( PlayerBase player,
ActionTarget target,
ItemBase item )

Definition at line 232 of file ActionBuildPart.c.

◆ OnFinishProgressServer()

override void GetInputType::OnFinishProgressServer ( ActionData action_data)

Definition at line 289 of file ActionBuildPart.c.

289 : ActionReciveData
290{
291 string m_PartType;
292}
293
295{
296 string m_PartType;
297};
298
300{
301 override void CreateActionComponent()
302 {
305 }
306
308 {
310 }
311};
312
314{
315 void ActionBuildPart()
316 {
318 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
319 m_FullBody = true;
320 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
321
323 m_Text = "#build";
324 }
325
326 override void CreateConditionComponents()
327 {
330 }
331
332 override void OnActionInfoUpdate(PlayerBase player, ActionTarget target, ItemBase item)
333 {
334 ConstructionActionData construction_action_data = player.GetConstructionActionData();
336
338 m_Text = "#build " + constrution_part.GetName();
339 }
340
341 override bool CanBeUsedLeaning()
342 {
343 return false;
344 }
345
346 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
347 {
348 if (player.IsPlacingLocal() || player.IsPlacingServer())
349 return false;
350
351 //Action not allowed if player has broken legs
352 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
353 return false;
354
355 //gate..
356 if (target.GetObject() && (!target.GetObject().CanUseConstructionBuild() || target.GetObject().CanUseHandConstruction()))
357 return false;
358
359 if ((!GetGame().IsDedicatedServer()))
360 {
361 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item, m_VariantID))
362 return true;
363 return false;
364 }
365 return true;
366 }
367
369 {
370 BaseBuildingBase base_building = BaseBuildingBase.Cast(action_data.m_Target.GetObject());
371 Construction construction = base_building.GetConstruction();
372 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
374
375 check_data.m_PartName = part_name;
376 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
377
378 bool canBuild = construction.CanBuildPart(part_name, action_data.m_MainItem, true);
379 if (GetGame().IsServer())
380 {
381 bool collides = construction.IsCollidingEx(check_data);
382
383 return !collides && canBuild;
384 }
385 else
386 return canBuild;
387 }
388
390 {
391 BaseBuildingBase base_building = BaseBuildingBase.Cast(action_data.m_Target.GetObject());
392 Construction construction = base_building.GetConstruction();
393
394 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
396
397 check_data.m_PartName = part_name;
398 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
399
400 if (!construction.IsCollidingEx(check_data) && construction.CanBuildPart(part_name, action_data.m_MainItem, true)) //redundant at this point?
401 {
402 //build
403 construction.BuildPartServer(action_data.m_Player, part_name, AT_BUILD_PART);
404 //add damage to tool
405 action_data.m_MainItem.DecreaseHealth(UADamageApplied.BUILD, false);
406 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
407 }
408 }
409
411 {
412 return "Base_building";
413 }
414
416 {
418 return action_data;
419 }
420
421 //setup
423 {
424 if (super.SetupAction(player, target, item, action_data, extra_data))
425 {
427
428 if (!GetGame().IsDedicatedServer())
429 {
430 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
431 BuildPartActionData.Cast(action_data).m_PartType = construction_action_data.GetBuildPartAtIndex(m_VariantID).GetPartName();
432 }
433 return true;
434 }
435
436 return false;
437 }
438
439 protected void SetBuildingAnimation(ItemBase item)
440 {
441 switch (item.Type())
442 {
443 case Pickaxe:
444 case Shovel:
445 case FarmingHoe:
446 case FieldShovel:
447 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DIG;
448 break;
449 case Pliers:
450 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
451 break;
452 case SledgeHammer:
453 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_MINEROCK;
454 break;
455 default:
456 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
457 break;
458 }
459 }
460
462 {
463 super.WriteToContext(ctx, action_data);
464
465 ctx.Write(BuildPartActionData.Cast(action_data).m_PartType);
466 }
467
468 override bool ReadFromContext(ParamsReadContext ctx, out ActionReciveData action_recive_data)
469 {
471 super.ReadFromContext(ctx, action_recive_data);
472
473 string part_type;
474 if (ctx.Read(part_type))
475 {
477 return true;
478 }
479 else
480 return false;
481 }
482
483 override void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
484 {
485 super.HandleReciveData(action_recive_data, action_data);
486
488 }
489
491 {
492 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
493 string partName = BuildPartActionData.Cast(action_data).m_PartType;
494
495 string message = string.Format("Built %1 on %2 with %3", partName, action_data.m_Target.GetObject().GetDisplayName(), action_data.m_MainItem.GetDisplayName());
496 return message;
497 }
498}
499
501{
502 override typename GetInputType()
503 {
505 }
506
507 override bool UseMainItem()
508 {
509 return false;
510 }
511
512 override bool HasProgress()
513 {
514 return true;
515 }
516
517 override bool HasAlternativeInterrupt()
518 {
519 return false;
520 }
521}

◆ ReadFromContext()

override bool GetInputType::ReadFromContext ( ParamsReadContext ctx,
out ActionReciveData action_recive_data )
protected

Definition at line 368 of file ActionBuildPart.c.

368 : ActionReciveData
369{
370 string m_PartType;
371}
372
374{
375 string m_PartType;
376};
377
379{
380 override void CreateActionComponent()
381 {
384 }
385
387 {
389 }
390};
391
393{
394 void ActionBuildPart()
395 {
397 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
398 m_FullBody = true;
399 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
400
402 m_Text = "#build";
403 }
404
405 override void CreateConditionComponents()
406 {
409 }
410
411 override void OnActionInfoUpdate(PlayerBase player, ActionTarget target, ItemBase item)
412 {
413 ConstructionActionData construction_action_data = player.GetConstructionActionData();
415
417 m_Text = "#build " + constrution_part.GetName();
418 }
419
420 override bool CanBeUsedLeaning()
421 {
422 return false;
423 }
424
425 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
426 {
427 if (player.IsPlacingLocal() || player.IsPlacingServer())
428 return false;
429
430 //Action not allowed if player has broken legs
431 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
432 return false;
433
434 //gate..
435 if (target.GetObject() && (!target.GetObject().CanUseConstructionBuild() || target.GetObject().CanUseHandConstruction()))
436 return false;
437
438 if ((!GetGame().IsDedicatedServer()))
439 {
440 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item, m_VariantID))
441 return true;
442 return false;
443 }
444 return true;
445 }
446
448 {
449 BaseBuildingBase base_building = BaseBuildingBase.Cast(action_data.m_Target.GetObject());
450 Construction construction = base_building.GetConstruction();
451 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
453
454 check_data.m_PartName = part_name;
455 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
456
457 bool canBuild = construction.CanBuildPart(part_name, action_data.m_MainItem, true);
458 if (GetGame().IsServer())
459 {
460 bool collides = construction.IsCollidingEx(check_data);
461
462 return !collides && canBuild;
463 }
464 else
465 return canBuild;
466 }
467
469 {
470 BaseBuildingBase base_building = BaseBuildingBase.Cast(action_data.m_Target.GetObject());
471 Construction construction = base_building.GetConstruction();
472
473 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
475
476 check_data.m_PartName = part_name;
477 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
478
479 if (!construction.IsCollidingEx(check_data) && construction.CanBuildPart(part_name, action_data.m_MainItem, true)) //redundant at this point?
480 {
481 //build
482 construction.BuildPartServer(action_data.m_Player, part_name, AT_BUILD_PART);
483 //add damage to tool
484 action_data.m_MainItem.DecreaseHealth(UADamageApplied.BUILD, false);
485 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
486 }
487 }
488
490 {
491 return "Base_building";
492 }
493
495 {
497 return action_data;
498 }
499
500 //setup
502 {
503 if (super.SetupAction(player, target, item, action_data, extra_data))
504 {
506
507 if (!GetGame().IsDedicatedServer())
508 {
509 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
510 BuildPartActionData.Cast(action_data).m_PartType = construction_action_data.GetBuildPartAtIndex(m_VariantID).GetPartName();
511 }
512 return true;
513 }
514
515 return false;
516 }
517
518 protected void SetBuildingAnimation(ItemBase item)
519 {
520 switch (item.Type())
521 {
522 case Pickaxe:
523 case Shovel:
524 case FarmingHoe:
525 case FieldShovel:
526 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DIG;
527 break;
528 case Pliers:
529 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
530 break;
531 case SledgeHammer:
532 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_MINEROCK;
533 break;
534 default:
535 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
536 break;
537 }
538 }
539
541 {
542 super.WriteToContext(ctx, action_data);
543
544 ctx.Write(BuildPartActionData.Cast(action_data).m_PartType);
545 }
546
547 override bool ReadFromContext(ParamsReadContext ctx, out ActionReciveData action_recive_data)
548 {
550 super.ReadFromContext(ctx, action_recive_data);
551
552 string part_type;
553 if (ctx.Read(part_type))
554 {
556 return true;
557 }
558 else
559 return false;
560 }
561
562 override void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
563 {
564 super.HandleReciveData(action_recive_data, action_data);
565
567 }
568
570 {
571 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
572 string partName = BuildPartActionData.Cast(action_data).m_PartType;
573
574 string message = string.Format("Built %1 on %2 with %3", partName, action_data.m_Target.GetObject().GetDisplayName(), action_data.m_MainItem.GetDisplayName());
575 return message;
576 }
577}
578
580{
581 override typename GetInputType()
582 {
584 }
585
586 override bool UseMainItem()
587 {
588 return false;
589 }
590
591 override bool HasProgress()
592 {
593 return true;
594 }
595
596 override bool HasAlternativeInterrupt()
597 {
598 return false;
599 }
600}

◆ SetBuildingAnimation()

void GetInputType::SetBuildingAnimation ( ItemBase item)
protected

Definition at line 339 of file ActionBuildPart.c.

339 : ActionReciveData
340{
341 string m_PartType;
342}
343
345{
346 string m_PartType;
347};
348
350{
351 override void CreateActionComponent()
352 {
355 }
356
358 {
360 }
361};
362
364{
365 void ActionBuildPart()
366 {
368 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
369 m_FullBody = true;
370 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
371
373 m_Text = "#build";
374 }
375
376 override void CreateConditionComponents()
377 {
380 }
381
382 override void OnActionInfoUpdate(PlayerBase player, ActionTarget target, ItemBase item)
383 {
384 ConstructionActionData construction_action_data = player.GetConstructionActionData();
386
388 m_Text = "#build " + constrution_part.GetName();
389 }
390
391 override bool CanBeUsedLeaning()
392 {
393 return false;
394 }
395
396 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
397 {
398 if (player.IsPlacingLocal() || player.IsPlacingServer())
399 return false;
400
401 //Action not allowed if player has broken legs
402 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
403 return false;
404
405 //gate..
406 if (target.GetObject() && (!target.GetObject().CanUseConstructionBuild() || target.GetObject().CanUseHandConstruction()))
407 return false;
408
409 if ((!GetGame().IsDedicatedServer()))
410 {
411 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item, m_VariantID))
412 return true;
413 return false;
414 }
415 return true;
416 }
417
419 {
420 BaseBuildingBase base_building = BaseBuildingBase.Cast(action_data.m_Target.GetObject());
421 Construction construction = base_building.GetConstruction();
422 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
424
425 check_data.m_PartName = part_name;
426 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
427
428 bool canBuild = construction.CanBuildPart(part_name, action_data.m_MainItem, true);
429 if (GetGame().IsServer())
430 {
431 bool collides = construction.IsCollidingEx(check_data);
432
433 return !collides && canBuild;
434 }
435 else
436 return canBuild;
437 }
438
440 {
441 BaseBuildingBase base_building = BaseBuildingBase.Cast(action_data.m_Target.GetObject());
442 Construction construction = base_building.GetConstruction();
443
444 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
446
447 check_data.m_PartName = part_name;
448 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
449
450 if (!construction.IsCollidingEx(check_data) && construction.CanBuildPart(part_name, action_data.m_MainItem, true)) //redundant at this point?
451 {
452 //build
453 construction.BuildPartServer(action_data.m_Player, part_name, AT_BUILD_PART);
454 //add damage to tool
455 action_data.m_MainItem.DecreaseHealth(UADamageApplied.BUILD, false);
456 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
457 }
458 }
459
461 {
462 return "Base_building";
463 }
464
466 {
468 return action_data;
469 }
470
471 //setup
473 {
474 if (super.SetupAction(player, target, item, action_data, extra_data))
475 {
477
478 if (!GetGame().IsDedicatedServer())
479 {
480 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
481 BuildPartActionData.Cast(action_data).m_PartType = construction_action_data.GetBuildPartAtIndex(m_VariantID).GetPartName();
482 }
483 return true;
484 }
485
486 return false;
487 }
488
489 protected void SetBuildingAnimation(ItemBase item)
490 {
491 switch (item.Type())
492 {
493 case Pickaxe:
494 case Shovel:
495 case FarmingHoe:
496 case FieldShovel:
497 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DIG;
498 break;
499 case Pliers:
500 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
501 break;
502 case SledgeHammer:
503 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_MINEROCK;
504 break;
505 default:
506 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
507 break;
508 }
509 }
510
512 {
513 super.WriteToContext(ctx, action_data);
514
515 ctx.Write(BuildPartActionData.Cast(action_data).m_PartType);
516 }
517
518 override bool ReadFromContext(ParamsReadContext ctx, out ActionReciveData action_recive_data)
519 {
521 super.ReadFromContext(ctx, action_recive_data);
522
523 string part_type;
524 if (ctx.Read(part_type))
525 {
527 return true;
528 }
529 else
530 return false;
531 }
532
533 override void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
534 {
535 super.HandleReciveData(action_recive_data, action_data);
536
538 }
539
541 {
542 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
543 string partName = BuildPartActionData.Cast(action_data).m_PartType;
544
545 string message = string.Format("Built %1 on %2 with %3", partName, action_data.m_Target.GetObject().GetDisplayName(), action_data.m_MainItem.GetDisplayName());
546 return message;
547 }
548}
549
551{
552 override typename GetInputType()
553 {
555 }
556
557 override bool UseMainItem()
558 {
559 return false;
560 }
561
562 override bool HasProgress()
563 {
564 return true;
565 }
566
567 override bool HasAlternativeInterrupt()
568 {
569 return false;
570 }
571}

◆ SetupAction()

override bool GetInputType::SetupAction ( PlayerBase player,
ActionTarget target,
ItemBase item,
out ActionData action_data,
Param extra_data = NULL )

Definition at line 322 of file ActionBuildPart.c.

322 : ActionReciveData
323{
324 string m_PartType;
325}
326
328{
329 string m_PartType;
330};
331
333{
334 override void CreateActionComponent()
335 {
338 }
339
341 {
343 }
344};
345
347{
348 void ActionBuildPart()
349 {
351 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
352 m_FullBody = true;
353 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
354
356 m_Text = "#build";
357 }
358
359 override void CreateConditionComponents()
360 {
363 }
364
365 override void OnActionInfoUpdate(PlayerBase player, ActionTarget target, ItemBase item)
366 {
367 ConstructionActionData construction_action_data = player.GetConstructionActionData();
369
371 m_Text = "#build " + constrution_part.GetName();
372 }
373
374 override bool CanBeUsedLeaning()
375 {
376 return false;
377 }
378
379 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
380 {
381 if (player.IsPlacingLocal() || player.IsPlacingServer())
382 return false;
383
384 //Action not allowed if player has broken legs
385 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
386 return false;
387
388 //gate..
389 if (target.GetObject() && (!target.GetObject().CanUseConstructionBuild() || target.GetObject().CanUseHandConstruction()))
390 return false;
391
392 if ((!GetGame().IsDedicatedServer()))
393 {
394 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item, m_VariantID))
395 return true;
396 return false;
397 }
398 return true;
399 }
400
402 {
403 BaseBuildingBase base_building = BaseBuildingBase.Cast(action_data.m_Target.GetObject());
404 Construction construction = base_building.GetConstruction();
405 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
407
408 check_data.m_PartName = part_name;
409 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
410
411 bool canBuild = construction.CanBuildPart(part_name, action_data.m_MainItem, true);
412 if (GetGame().IsServer())
413 {
414 bool collides = construction.IsCollidingEx(check_data);
415
416 return !collides && canBuild;
417 }
418 else
419 return canBuild;
420 }
421
423 {
424 BaseBuildingBase base_building = BaseBuildingBase.Cast(action_data.m_Target.GetObject());
425 Construction construction = base_building.GetConstruction();
426
427 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
429
430 check_data.m_PartName = part_name;
431 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
432
433 if (!construction.IsCollidingEx(check_data) && construction.CanBuildPart(part_name, action_data.m_MainItem, true)) //redundant at this point?
434 {
435 //build
436 construction.BuildPartServer(action_data.m_Player, part_name, AT_BUILD_PART);
437 //add damage to tool
438 action_data.m_MainItem.DecreaseHealth(UADamageApplied.BUILD, false);
439 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
440 }
441 }
442
444 {
445 return "Base_building";
446 }
447
449 {
451 return action_data;
452 }
453
454 //setup
456 {
457 if (super.SetupAction(player, target, item, action_data, extra_data))
458 {
460
461 if (!GetGame().IsDedicatedServer())
462 {
463 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
464 BuildPartActionData.Cast(action_data).m_PartType = construction_action_data.GetBuildPartAtIndex(m_VariantID).GetPartName();
465 }
466 return true;
467 }
468
469 return false;
470 }
471
472 protected void SetBuildingAnimation(ItemBase item)
473 {
474 switch (item.Type())
475 {
476 case Pickaxe:
477 case Shovel:
478 case FarmingHoe:
479 case FieldShovel:
480 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DIG;
481 break;
482 case Pliers:
483 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
484 break;
485 case SledgeHammer:
486 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_MINEROCK;
487 break;
488 default:
489 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
490 break;
491 }
492 }
493
495 {
496 super.WriteToContext(ctx, action_data);
497
498 ctx.Write(BuildPartActionData.Cast(action_data).m_PartType);
499 }
500
501 override bool ReadFromContext(ParamsReadContext ctx, out ActionReciveData action_recive_data)
502 {
504 super.ReadFromContext(ctx, action_recive_data);
505
506 string part_type;
507 if (ctx.Read(part_type))
508 {
510 return true;
511 }
512 else
513 return false;
514 }
515
516 override void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
517 {
518 super.HandleReciveData(action_recive_data, action_data);
519
521 }
522
524 {
525 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
526 string partName = BuildPartActionData.Cast(action_data).m_PartType;
527
528 string message = string.Format("Built %1 on %2 with %3", partName, action_data.m_Target.GetObject().GetDisplayName(), action_data.m_MainItem.GetDisplayName());
529 return message;
530 }
531}
532
534{
535 override typename GetInputType()
536 {
538 }
539
540 override bool UseMainItem()
541 {
542 return false;
543 }
544
545 override bool HasProgress()
546 {
547 return true;
548 }
549
550 override bool HasAlternativeInterrupt()
551 {
552 return false;
553 }
554}

◆ UseMainItem()

override bool UseMainItem ( )

Definition at line 219 of file ActionBuildPart.c.

220 {
221 return false;
222 }

◆ WriteToContext()

override void GetInputType::WriteToContext ( ParamsWriteContext ctx,
ActionData action_data )
protected

Definition at line 361 of file ActionBuildPart.c.

361 : ActionReciveData
362{
363 string m_PartType;
364}
365
367{
368 string m_PartType;
369};
370
372{
373 override void CreateActionComponent()
374 {
377 }
378
380 {
382 }
383};
384
386{
387 void ActionBuildPart()
388 {
390 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
391 m_FullBody = true;
392 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
393
395 m_Text = "#build";
396 }
397
398 override void CreateConditionComponents()
399 {
402 }
403
404 override void OnActionInfoUpdate(PlayerBase player, ActionTarget target, ItemBase item)
405 {
406 ConstructionActionData construction_action_data = player.GetConstructionActionData();
408
410 m_Text = "#build " + constrution_part.GetName();
411 }
412
413 override bool CanBeUsedLeaning()
414 {
415 return false;
416 }
417
418 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
419 {
420 if (player.IsPlacingLocal() || player.IsPlacingServer())
421 return false;
422
423 //Action not allowed if player has broken legs
424 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
425 return false;
426
427 //gate..
428 if (target.GetObject() && (!target.GetObject().CanUseConstructionBuild() || target.GetObject().CanUseHandConstruction()))
429 return false;
430
431 if ((!GetGame().IsDedicatedServer()))
432 {
433 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item, m_VariantID))
434 return true;
435 return false;
436 }
437 return true;
438 }
439
441 {
442 BaseBuildingBase base_building = BaseBuildingBase.Cast(action_data.m_Target.GetObject());
443 Construction construction = base_building.GetConstruction();
444 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
446
447 check_data.m_PartName = part_name;
448 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
449
450 bool canBuild = construction.CanBuildPart(part_name, action_data.m_MainItem, true);
451 if (GetGame().IsServer())
452 {
453 bool collides = construction.IsCollidingEx(check_data);
454
455 return !collides && canBuild;
456 }
457 else
458 return canBuild;
459 }
460
462 {
463 BaseBuildingBase base_building = BaseBuildingBase.Cast(action_data.m_Target.GetObject());
464 Construction construction = base_building.GetConstruction();
465
466 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
468
469 check_data.m_PartName = part_name;
470 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
471
472 if (!construction.IsCollidingEx(check_data) && construction.CanBuildPart(part_name, action_data.m_MainItem, true)) //redundant at this point?
473 {
474 //build
475 construction.BuildPartServer(action_data.m_Player, part_name, AT_BUILD_PART);
476 //add damage to tool
477 action_data.m_MainItem.DecreaseHealth(UADamageApplied.BUILD, false);
478 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
479 }
480 }
481
483 {
484 return "Base_building";
485 }
486
488 {
490 return action_data;
491 }
492
493 //setup
495 {
496 if (super.SetupAction(player, target, item, action_data, extra_data))
497 {
499
500 if (!GetGame().IsDedicatedServer())
501 {
502 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
503 BuildPartActionData.Cast(action_data).m_PartType = construction_action_data.GetBuildPartAtIndex(m_VariantID).GetPartName();
504 }
505 return true;
506 }
507
508 return false;
509 }
510
511 protected void SetBuildingAnimation(ItemBase item)
512 {
513 switch (item.Type())
514 {
515 case Pickaxe:
516 case Shovel:
517 case FarmingHoe:
518 case FieldShovel:
519 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DIG;
520 break;
521 case Pliers:
522 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
523 break;
524 case SledgeHammer:
525 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_MINEROCK;
526 break;
527 default:
528 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
529 break;
530 }
531 }
532
534 {
535 super.WriteToContext(ctx, action_data);
536
537 ctx.Write(BuildPartActionData.Cast(action_data).m_PartType);
538 }
539
540 override bool ReadFromContext(ParamsReadContext ctx, out ActionReciveData action_recive_data)
541 {
543 super.ReadFromContext(ctx, action_recive_data);
544
545 string part_type;
546 if (ctx.Read(part_type))
547 {
549 return true;
550 }
551 else
552 return false;
553 }
554
555 override void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
556 {
557 super.HandleReciveData(action_recive_data, action_data);
558
560 }
561
563 {
564 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
565 string partName = BuildPartActionData.Cast(action_data).m_PartType;
566
567 string message = string.Format("Built %1 on %2 with %3", partName, action_data.m_Target.GetObject().GetDisplayName(), action_data.m_MainItem.GetDisplayName());
568 return message;
569 }
570}
571
573{
574 override typename GetInputType()
575 {
577 }
578
579 override bool UseMainItem()
580 {
581 return false;
582 }
583
584 override bool HasProgress()
585 {
586 return true;
587 }
588
589 override bool HasAlternativeInterrupt()
590 {
591 return false;
592 }
593}

Variable Documentation

◆ m_PartType