645 : ActionReciveData
646{
648}
649
651{
653};
654
656{
658 {
660 m_ActionData.m_ActionComponent =
new CAContinuousTime(time);
661 }
662
664 {
665 #ifdef DIAG_DEVELOPER
666 if (
m_ActionData.m_Player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.FAST)
667 return 1;
668 #endif
669
670 if (item)
671 return UATimeSpent.BASEBUILDING_CONSTRUCT_MEDIUM;
672 else
673 return UATimeSpent.BASEBUILDING_CONSTRUCT_SLOW;
674 }
675};
676
678{
680 {
685
689 }
690
692 {
695 }
696
698 {
699 ConstructionActionData cad = player.GetConstructionActionData();
701 if (part)
702 {
704 if (overrideText ==
string.
Empty)
706 else
708
709 #ifdef DIAG_DEVELOPER
710 if (DiagMenu.GetBool(
DiagMenuIDs.BASEBUILDING_FULLDEBUG))
711 {
713 }
714 #endif
715 }
716 }
717
719 {
720 m_InfoData =
new ActionInfoDataConstructionPossible();
721 }
722
724 {
725 return false;
726 }
727
729 {
730 return false;
731 }
732
734 {
735 #ifdef DIAG_DEVELOPER
736 if (player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.INSTANT)
737 return false;
738 #endif
739
741 if (!Class.CastTo(ent,target.GetObject()))
742 return false;
743
744 if (player.IsPlacingLocal() || player.IsPlacingServer())
745 return false;
746
747
748 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
749 return false;
750
751 if (!ent.CanUseConstruction() || !ent.CanUseConstructionBuild())
752 return false;
753
754 if ((!
GetGame().IsDedicatedServer()))
755 {
757 return false;
758
759 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item,
m_VariantID))
761
762 return false;
763 }
764 return true;
765 }
766
768 {
771 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
773
774 check_data.m_PartName = part_name;
776
777 bool canBuild = construction.CanBuildPart(part_name, action_data.
m_MainItem,
true);
778 #ifdef DIAG_DEVELOPER
779 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
780 canBuild = true;
781 #endif
783 {
784 bool collides = construction.IsCollidingEx(check_data);
785
786 return !collides && canBuild;
787 }
788 else
789 {
790 return canBuild;
791 }
792 }
793
795 {
798
799 string partName = BuildPartActionData.Cast(action_data).m_PartType;
802
803 checkData.m_PartName = partName;
805
807 #ifdef DIAG_DEVELOPER
808 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
809 canBuild = true;
810 #endif
811 if (!construction.IsCollidingEx(checkData) && canBuild)
812 {
813
815
816 #ifdef DIAG_DEVELOPER
817
818 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
819 return;
820 #endif
821
822
824 {
826 action_data.
m_MainItem.DecreaseHealth(UADamageApplied.BUILD,
false);
827 }
828 else
829 {
831 {
832 EntityAI gloves = action_data.
m_Player.GetInventory().FindAttachment(InventorySlots.GLOVES);
833 if (gloves && gloves.GetHealthLevel() < 4)
834 {
835 gloves.AddHealth("","", PlayerConstants.GLOVES_DAMAGE_HAND_CONSTRUCTION);
836 }
837 else if (Math.RandomFloat01() < PlayerConstants.CHANCE_TO_BLEED_HAND_CONSTRUCTION)
838 {
839 if (Math.RandomFloat01() < 0.5)
840 action_data.
m_Player.GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"LeftForeArmRoll");
841 else
842 action_data.
m_Player.GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"RightForeArmRoll");
844 }
845 }
846 }
847 }
848 }
849
851 {
852 return "Base_building";
853 }
854
856 {
857 BuildPartActionData action_data = new BuildPartActionData;
858 return action_data;
859 }
860
861
863 {
864 if (super.SetupAction(player, target, item, action_data, extra_data))
865 {
866 if (!
g_Game.IsDedicatedServer())
867 {
869 }
870
872 return true;
873 }
874
875 return false;
876 }
877
879 {
880 ConstructionActionData cad = action_data.m_Player.GetConstructionActionData();
882 BuildPartActionData.Cast(action_data).m_PartType = part.
GetPartName();
883 }
884
886 {
887 if (!item)
888 return;
889
890 switch (item.Type())
891 {
892 case Pickaxe:
893 case Shovel:
894 case FarmingHoe:
895 case FieldShovel:
897 break;
898 case Pliers:
900 break;
901 case SledgeHammer:
903 break;
904 case BrickTrowel:
906 break;
907 default:
909 break;
910 }
911 }
912
914 {
915 super.WriteToContext(ctx, action_data);
916
917 ctx.
Write(BuildPartActionData.Cast(action_data).m_PartType);
918 }
919
921 {
922 action_recive_data = new BuildPartActionReciveData;
923 super.ReadFromContext(ctx, action_recive_data);
924
925 string part_type;
926 if (ctx.
Read(part_type))
927 {
928 BuildPartActionReciveData.Cast(action_recive_data).m_PartType = part_type;
929 return true;
930 }
931 else
932 {
933 return false;
934 }
935 }
936
937 override void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
938 {
939 super.HandleReciveData(action_recive_data, action_data);
940
941 BuildPartActionData.Cast(action_data).m_PartType = BuildPartActionReciveData.Cast(action_recive_data).m_PartType;
942 }
943
945 {
946 string partName = BuildPartActionData.Cast(action_data).m_PartType;
947
948 string itemName = "hands";
950 itemName = action_data.
m_MainItem.GetDisplayName();
951
952 string message =
string.Format(
"Built %1 on %2 with %3", partName, action_data.
m_Target.GetObject().GetDisplayName(), itemName);
953 return message;
954 }
955
957 {
959 }
960
962 {
964
965 ActionInfoDataConstructionPossible info = ActionInfoDataConstructionPossible.Cast(
m_InfoData);
966 ConstructionActionData cad = player.GetConstructionActionData();
968 info.SetConstructionPart(part);
969 info.SetTool(item);
970
973
974 return info.CanDisplayInfo();
975 }
976
979 {
982 ConstructionActionData cad = player.GetConstructionActionData();
984
985 if (part)
986 {
988 if (!ent.IsPlayerInsideEx(player, part.
GetPartName()))
989 {
991 return false;
992 else if (!bbb)
993 return false;
994 }
995 if (!construction.ConstructionDirectionCheck(player, part, EConstructionDirCheckType.INDOORS))
996 return false;
997 if (!construction.ConstructionInsiderBoxCheck(player, part))
998 return false;
999
1000 return true;
1001 }
1002 return false;
1003 }
1004
1007 {
1009 }
1010
1012
1014 [
Obsolete(
"Use 'SetBuildingAnimationEx' instead")]
1016 {
1018 }
1019}
1020
1022{
1024 {
1026 }
1027
1029 {
1032 }
1033
1035 {
1036 return false;
1037 }
1038
1040 {
1041 ConstructionActionData cad = player.GetConstructionActionData();
1043 if (part)
1044 {
1046 if (overrideText ==
string.
Empty)
1048 else
1050
1051 #ifdef DIAG_DEVELOPER
1052 if (DiagMenu.GetBool(
DiagMenuIDs.BASEBUILDING_FULLDEBUG))
1053 {
1055 }
1056 #endif
1057 }
1058 }
1059
1061 {
1062 #ifdef DIAG_DEVELOPER
1063 if (player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.INSTANT)
1064 return false;
1065 #endif
1066
1067 if (item)
1068 return false;
1069
1071 if (!Class.CastTo(ent,target.GetObject()))
1072 return false;
1073
1074 if (player.IsPlacingLocal() || player.IsPlacingServer())
1075 return false;
1076
1077
1078 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
1079 return false;
1080
1081 bool handConstructionCondition = ent.CanUseHandConstruction();
1082 #ifdef DIAG_DEVELOPER
1083 if (player.GetConstructionActionData().GetFastConstructionMode())
1084 handConstructionCondition = true;
1085 #endif
1086
1087 if (!ent.CanUseConstruction() || !ent.CanUseConstructionBuild() || !handConstructionCondition)
1088 return false;
1089
1090 if ((!
GetGame().IsDedicatedServer()))
1091 {
1093 return false;
1094
1095 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item,
m_VariantID))
1097
1098 return false;
1099 }
1100 return true;
1101 }
1102
1104 {
1107 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
1109
1110 check_data.m_PartName = part_name;
1112
1113 bool canBuild = construction.CanBuildPart(part_name, null, false);
1114 #ifdef DIAG_DEVELOPER
1115 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
1116 canBuild = true;
1117 #endif
1119 {
1120 bool collides = construction.IsCollidingEx(check_data);
1121
1122 return !collides && canBuild;
1123 }
1124 else
1125 {
1126 return canBuild;
1127 }
1128 }
1129
1131 {
1133
1134 ActionInfoDataConstructionPossible info = ActionInfoDataConstructionPossible.Cast(
m_InfoData);
1135 ConstructionActionData cad = player.GetConstructionActionData();
1137 info.SetConstructionPart(part);
1138 info.SetTool(item);
1139
1141
1142
1143
1144
1145
1146
1148
1149 return info.CanDisplayInfo();
1150 }
1151
1153 {
1154 ConstructionActionData cad = action_data.m_Player.GetConstructionActionData();
1156 }
1157
1160 {
1162 }
1163
1166 {
1167 if (item)
1168 return;
1169
1170 BuildPartActionData buildData;
1171 if (Class.CastTo(buildData, action_data))
1172 {
1175 ConstructionPart part = construction.GetConstructionPart(buildData.m_PartType);
1177
1178 if (animOverrideID >= 0)
1179 m_CommandUID = animOverrideID;
1180 else
1182 }
1183 }
1184}
1185
1186
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.