579 : ActionReciveData
580{
582}
583
585{
587};
588
590{
592 {
594 m_ActionData.m_ActionComponent =
new CAContinuousTime(time);
595 }
596
598 {
599 #ifdef DIAG_DEVELOPER
600 if (
m_ActionData.m_Player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.FAST)
601 return 1;
602 #endif
603
604 if (item)
605 return UATimeSpent.BASEBUILDING_CONSTRUCT_MEDIUM;
606 else
607 return UATimeSpent.BASEBUILDING_CONSTRUCT_SLOW;
608 }
609};
610
612{
614 {
619
623 }
624
626 {
629 }
630
632 {
633 ConstructionActionData cad = player.GetConstructionActionData();
635 if (part)
636 {
638 if (overrideText ==
string.
Empty)
640 else
642
643 #ifdef DIAG_DEVELOPER
644 if (DiagMenu.GetBool(
DiagMenuIDs.BASEBUILDING_FULLDEBUG))
645 {
647 }
648 #endif
649 }
650 }
651
653 {
654 m_InfoData =
new ActionInfoDataConstructionPossible();
655 }
656
658 {
659 return false;
660 }
661
663 {
664 return false;
665 }
666
668 {
669 #ifdef DIAG_DEVELOPER
670 if (player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.INSTANT)
671 return false;
672 #endif
673
675 if (!Class.CastTo(ent,target.GetObject()))
676 return false;
677
678 if (player.IsPlacingLocal() || player.IsPlacingServer())
679 return false;
680
681
682 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
683 return false;
684
685 if (!ent.CanUseConstruction() || !ent.CanUseConstructionBuild())
686 return false;
687
688 if ((!
GetGame().IsDedicatedServer()))
689 {
691 return false;
692
693 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item,
m_VariantID))
695
696 return false;
697 }
698 return true;
699 }
700
702 {
705 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
707
708 check_data.m_PartName = part_name;
710
711 bool canBuild = construction.CanBuildPart(part_name, action_data.
m_MainItem,
true);
712 #ifdef DIAG_DEVELOPER
713 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
714 canBuild = true;
715 #endif
717 {
718 bool collides = construction.IsCollidingEx(check_data);
719
720 return !collides && canBuild;
721 }
722 else
723 {
724 return canBuild;
725 }
726 }
727
729 {
732
733 string partName = BuildPartActionData.Cast(action_data).m_PartType;
736
737 checkData.m_PartName = partName;
739
741 #ifdef DIAG_DEVELOPER
742 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
743 canBuild = true;
744 #endif
745 if (!construction.IsCollidingEx(checkData) && canBuild)
746 {
747
749
750 #ifdef DIAG_DEVELOPER
751
752 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
753 return;
754 #endif
755
756
758 {
760 action_data.
m_MainItem.DecreaseHealth(UADamageApplied.BUILD,
false);
761 }
762 else
763 {
765 {
766 EntityAI gloves = action_data.
m_Player.GetInventory().FindAttachment(InventorySlots.GLOVES);
767 if (gloves && gloves.GetHealthLevel() < 4)
768 {
769 gloves.AddHealth("","", PlayerConstants.GLOVES_DAMAGE_HAND_CONSTRUCTION);
770 }
771 else if (Math.RandomFloat01() < PlayerConstants.CHANCE_TO_BLEED_HAND_CONSTRUCTION)
772 {
773 if (Math.RandomFloat01() < 0.5)
774 action_data.
m_Player.GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"LeftForeArmRoll");
775 else
776 action_data.
m_Player.GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"RightForeArmRoll");
778 }
779 }
780 }
781 }
782 }
783
785 {
786 return "Base_building";
787 }
788
790 {
791 BuildPartActionData action_data = new BuildPartActionData;
792 return action_data;
793 }
794
795
797 {
798 if (super.SetupAction(player, target, item, action_data, extra_data))
799 {
800 if (!
g_Game.IsDedicatedServer())
801 {
803 }
804
806 return true;
807 }
808
809 return false;
810 }
811
813 {
814 ConstructionActionData cad = action_data.m_Player.GetConstructionActionData();
816 BuildPartActionData.Cast(action_data).m_PartType = part.
GetPartName();
817 }
818
820 {
821 if (!item)
822 return;
823
824 switch (item.Type())
825 {
826 case Pickaxe:
827 case Shovel:
828 case FarmingHoe:
829 case FieldShovel:
831 break;
832 case Pliers:
834 break;
835 case SledgeHammer:
837 break;
838 case BrickTrowel:
840 break;
841 default:
843 break;
844 }
845 }
846
848 {
849 super.WriteToContext(ctx, action_data);
850
851 ctx.
Write(BuildPartActionData.Cast(action_data).m_PartType);
852 }
853
855 {
856 action_recive_data = new BuildPartActionReciveData;
857 super.ReadFromContext(ctx, action_recive_data);
858
859 string part_type;
860 if (ctx.
Read(part_type))
861 {
862 BuildPartActionReciveData.Cast(action_recive_data).m_PartType = part_type;
863 return true;
864 }
865 else
866 {
867 return false;
868 }
869 }
870
871 override void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
872 {
873 super.HandleReciveData(action_recive_data, action_data);
874
875 BuildPartActionData.Cast(action_data).m_PartType = BuildPartActionReciveData.Cast(action_recive_data).m_PartType;
876 }
877
879 {
880 string partName = BuildPartActionData.Cast(action_data).m_PartType;
881
882 string itemName = "hands";
884 itemName = action_data.
m_MainItem.GetDisplayName();
885
886 string message =
string.Format(
"Built %1 on %2 with %3", partName, action_data.
m_Target.GetObject().GetDisplayName(), itemName);
887 return message;
888 }
889
891 {
893 }
894
896 {
898
899 ActionInfoDataConstructionPossible info = ActionInfoDataConstructionPossible.Cast(
m_InfoData);
900 ConstructionActionData cad = player.GetConstructionActionData();
902 info.SetConstructionPart(part);
903 info.SetTool(item);
904
907
908 return info.CanDisplayInfo();
909 }
910
913 {
916 ConstructionActionData cad = player.GetConstructionActionData();
918
919 if (part)
920 {
922 if (!ent.IsPlayerInsideEx(player, part.
GetPartName()))
923 {
925 return false;
926 else if (!bbb)
927 return false;
928 }
929 if (!construction.ConstructionDirectionCheck(player, part, EConstructionDirCheckType.INDOORS))
930 return false;
931 if (!construction.ConstructionInsiderBoxCheck(player, part))
932 return false;
933
934 return true;
935 }
936 return false;
937 }
938
941 {
943 }
944
946
948 [
Obsolete(
"Use 'SetBuildingAnimationEx' instead")]
950 {
952 }
953}
954
956{
958 {
960 }
961
963 {
966 }
967
969 {
970 return false;
971 }
972
974 {
975 ConstructionActionData cad = player.GetConstructionActionData();
977 if (part)
978 {
980 if (overrideText ==
string.
Empty)
982 else
984
985 #ifdef DIAG_DEVELOPER
986 if (DiagMenu.GetBool(
DiagMenuIDs.BASEBUILDING_FULLDEBUG))
987 {
989 }
990 #endif
991 }
992 }
993
995 {
996 #ifdef DIAG_DEVELOPER
997 if (player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.INSTANT)
998 return false;
999 #endif
1000
1001 if (item)
1002 return false;
1003
1005 if (!Class.CastTo(ent,target.GetObject()))
1006 return false;
1007
1008 if (player.IsPlacingLocal() || player.IsPlacingServer())
1009 return false;
1010
1011
1012 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
1013 return false;
1014
1015 bool handConstructionCondition = ent.CanUseHandConstruction();
1016 #ifdef DIAG_DEVELOPER
1017 if (player.GetConstructionActionData().GetFastConstructionMode())
1018 handConstructionCondition = true;
1019 #endif
1020
1021 if (!ent.CanUseConstruction() || !ent.CanUseConstructionBuild() || !handConstructionCondition)
1022 return false;
1023
1024 if ((!
GetGame().IsDedicatedServer()))
1025 {
1027 return false;
1028
1029 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item,
m_VariantID))
1031
1032 return false;
1033 }
1034 return true;
1035 }
1036
1038 {
1041 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
1043
1044 check_data.m_PartName = part_name;
1046
1047 bool canBuild = construction.CanBuildPart(part_name, null, false);
1048 #ifdef DIAG_DEVELOPER
1049 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
1050 canBuild = true;
1051 #endif
1053 {
1054 bool collides = construction.IsCollidingEx(check_data);
1055
1056 return !collides && canBuild;
1057 }
1058 else
1059 {
1060 return canBuild;
1061 }
1062 }
1063
1065 {
1067
1068 ActionInfoDataConstructionPossible info = ActionInfoDataConstructionPossible.Cast(
m_InfoData);
1069 ConstructionActionData cad = player.GetConstructionActionData();
1071 info.SetConstructionPart(part);
1072 info.SetTool(item);
1073
1075
1076
1077
1078
1079
1080
1082
1083 return info.CanDisplayInfo();
1084 }
1085
1087 {
1088 ConstructionActionData cad = action_data.m_Player.GetConstructionActionData();
1090 }
1091
1094 {
1096 }
1097
1100 {
1101 if (item)
1102 return;
1103
1104 BuildPartActionData buildData;
1105 if (Class.CastTo(buildData, action_data))
1106 {
1109 ConstructionPart part = construction.GetConstructionPart(buildData.m_PartType);
1111
1112 if (animOverrideID >= 0)
1113 m_CommandUID = animOverrideID;
1114 else
1116 }
1117 }
1118}
1119
1120
bool ActionConditionContinue(ActionData action_data)
ref ActionInfoDataBase m_InfoData
void OnActionInfoUpdate(PlayerBase player, ActionTarget target, ItemBase item)
void CreateConditionComponents()
ref CCIBase m_ConditionItem
ref CCTBase m_ConditionTarget
bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
BuildPartActionReciveData m_PartType
void ComposeBuildActionDataClient(PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data=NULL)
bool GatherInfoData(PlayerBase player, ActionTarget target, ItemBase item)
bool PositioningCheck(PlayerBase player, ActionTarget target)
Can build from the inside only, if applicable.
override bool UseMainItem()
ConstructionPart GetTargetPart(ConstructionActionData cad)
Does not work on server, since variants are not updated there (invoker does not invoke)
ActionBuildPart ActionContinuousBase ActionBuildPartHandsGeneric()
void SetBuildingAnimationEx(PlayerBase player, ActionTarget target, ItemBase item, ActionData action_data, Param extra_data=NULL)
here we base anims on targeted part
void ActionTarget(Object object, Object parent, int componentIndex, vector cursorHitPos, float utility, string surfaceName="")
void ConstructionBase(EntityAI parent)
void CollisionCheckData()
EConstructionInfoCategories
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)
class GP5GasMask extends MaskBase ItemBase
override bool SetupAction(PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data=NULL)
override bool CanBeUsedInFreelook()
void ComposeBuildActionDataClient(PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data=NULL)
override bool CanBeUsedLeaning()
bool PositioningCheck(PlayerBase player, ActionTarget target)
Can build from the inside only, if applicable.
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)
void SetBuildingAnimationEx(PlayerBase player, ActionTarget target, ItemBase item, ActionData action_data, Param extra_data=NULL)
override ActionData CreateActionData()
ConstructionPart GetTargetPart(ConstructionActionData cad)
Does not work on server, since variants are not updated there (invoker does not invoke)
override void WriteToContext(ParamsWriteContext ctx, ActionData action_data)
override void InitInfoData()
override string GetAdminLogMessage(ActionData action_data)
override void OnFinishProgressServer(ActionData action_data)
bool GatherInfoData(PlayerBase player, ActionTarget target, ItemBase item)
override void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
override void OnActionInfoUpdate(PlayerBase player, ActionTarget target, ItemBase item)
float SetCallbackDuration(ItemBase item)
override void CreateActionComponent()
ref ActionTarget m_Target
override bool MustBeBuiltFromOutside()
ConstructionPart GetBuildPartHandsGenericAtIndex(int idx)
ConstructionPart GetBuildPartAtIndex(int idx)
int GetHandBuildFBAnimOverride()
string GetBuildTextOverride()
bool DamageHandsOnBuild()
proto bool Write(void value_out)
proto bool Read(void value_in)
DayZPlayerConstants
defined in C++
Serializer ParamsReadContext
Serializer ParamsWriteContext
void Obsolete(string msg="")
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.