662 : ActionReciveData
663{
665}
666
668{
670};
671
673{
675 {
677 m_ActionData.m_ActionComponent =
new CAContinuousTime(time);
678 }
679
681 {
682 #ifdef DIAG_DEVELOPER
683 if (
m_ActionData.m_Player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.FAST)
684 return 1;
685 #endif
686
687 if (item)
688 return UATimeSpent.BASEBUILDING_CONSTRUCT_MEDIUM;
689 else
690 return UATimeSpent.BASEBUILDING_CONSTRUCT_SLOW;
691 }
692};
693
695{
697 {
702
706 }
707
709 {
712 }
713
715 {
716 ConstructionActionData cad = player.GetConstructionActionData();
718 if (part)
719 {
721 if (overrideText ==
string.
Empty)
723 else
725
726 #ifdef DIAG_DEVELOPER
727 if (DiagMenu.GetBool(
DiagMenuIDs.BASEBUILDING_FULLDEBUG))
728 {
730 }
731 #endif
732 }
733 }
734
736 {
737 m_InfoData =
new ActionInfoDataConstructionPossible();
738 }
739
741 {
742 return false;
743 }
744
746 {
747 return false;
748 }
749
751 {
752 #ifdef DIAG_DEVELOPER
753 if (player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.INSTANT)
754 return false;
755 #endif
756
758 if (!Class.CastTo(ent,target.GetObject()))
759 return false;
760
761 if (player.IsPlacingLocal() || player.IsPlacingServer())
762 return false;
763
764
765 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
766 return false;
767
768 if (!ent.CanUseConstruction() || !ent.CanUseConstructionBuild())
769 return false;
770
771 if ((!
GetGame().IsDedicatedServer()))
772 {
774 return false;
775
776 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item,
m_VariantID))
778
779 return false;
780 }
781 return true;
782 }
783
785 {
788 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
790
791 check_data.m_PartName = part_name;
793
794 bool canBuild = construction.CanBuildPart(part_name, action_data.
m_MainItem,
true);
795 #ifdef DIAG_DEVELOPER
796 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
797 canBuild = true;
798 #endif
800 {
801 bool collides = construction.IsCollidingEx(check_data);
802
803 return !collides && canBuild;
804 }
805 else
806 {
807 return canBuild;
808 }
809 }
810
812 {
815
816 string partName = BuildPartActionData.Cast(action_data).m_PartType;
819
820 checkData.m_PartName = partName;
822
824 #ifdef DIAG_DEVELOPER
825 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
826 canBuild = true;
827 #endif
828 if (!construction.IsCollidingEx(checkData) && canBuild)
829 {
830
832
833 #ifdef DIAG_DEVELOPER
834
835 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
836 return;
837 #endif
838
839
841 {
843 action_data.
m_MainItem.DecreaseHealth(UADamageApplied.BUILD,
false);
844 }
845 else
846 {
848 {
849 EntityAI gloves = action_data.
m_Player.GetInventory().FindAttachment(InventorySlots.GLOVES);
850 if (gloves && gloves.GetHealthLevel() < 4)
851 {
852 gloves.AddHealth("","", PlayerConstants.GLOVES_DAMAGE_HAND_CONSTRUCTION);
853 }
854 else if (Math.RandomFloat01() < PlayerConstants.CHANCE_TO_BLEED_HAND_CONSTRUCTION)
855 {
856 if (Math.RandomFloat01() < 0.5)
857 action_data.
m_Player.GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"LeftForeArmRoll");
858 else
859 action_data.
m_Player.GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"RightForeArmRoll");
861 }
862 }
863 }
864 }
865 }
866
868 {
869 return "Base_building";
870 }
871
873 {
874 BuildPartActionData action_data = new BuildPartActionData;
875 return action_data;
876 }
877
878
880 {
881 if (super.SetupAction(player, target, item, action_data, extra_data))
882 {
883 if (!
g_Game.IsDedicatedServer())
884 {
886 }
887
889 return true;
890 }
891
892 return false;
893 }
894
896 {
897 ConstructionActionData cad = action_data.m_Player.GetConstructionActionData();
899 BuildPartActionData.Cast(action_data).m_PartType = part.
GetPartName();
900 }
901
903 {
904 if (!item)
905 return;
906
907 switch (item.Type())
908 {
909 case Pickaxe:
910 case Shovel:
911 case FarmingHoe:
912 case FieldShovel:
914 break;
915 case Pliers:
917 break;
918 case SledgeHammer:
920 break;
921 case BrickTrowel:
923 break;
924 default:
926 break;
927 }
928 }
929
931 {
932 super.WriteToContext(ctx, action_data);
933
934 ctx.
Write(BuildPartActionData.Cast(action_data).m_PartType);
935 }
936
938 {
939 action_recive_data = new BuildPartActionReciveData;
940 super.ReadFromContext(ctx, action_recive_data);
941
942 string part_type;
943 if (ctx.
Read(part_type))
944 {
945 BuildPartActionReciveData.Cast(action_recive_data).m_PartType = part_type;
946 return true;
947 }
948 else
949 {
950 return false;
951 }
952 }
953
954 override void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
955 {
956 super.HandleReciveData(action_recive_data, action_data);
957
958 BuildPartActionData.Cast(action_data).m_PartType = BuildPartActionReciveData.Cast(action_recive_data).m_PartType;
959 }
960
962 {
963 string partName = BuildPartActionData.Cast(action_data).m_PartType;
964
965 string itemName = "hands";
967 itemName = action_data.
m_MainItem.GetDisplayName();
968
969 string message =
string.Format(
"Built %1 on %2 with %3", partName, action_data.
m_Target.GetObject().GetDisplayName(), itemName);
970 return message;
971 }
972
974 {
976 }
977
979 {
981
982 ActionInfoDataConstructionPossible info = ActionInfoDataConstructionPossible.Cast(
m_InfoData);
983 ConstructionActionData cad = player.GetConstructionActionData();
985 info.SetConstructionPart(part);
986 info.SetTool(item);
987
990
991 return info.CanDisplayInfo();
992 }
993
996 {
999 ConstructionActionData cad = player.GetConstructionActionData();
1001
1002 if (part)
1003 {
1005 if (!ent.IsPlayerInsideEx(player, part.
GetPartName()))
1006 {
1008 return false;
1009 else if (!bbb)
1010 return false;
1011 }
1012 if (!construction.ConstructionDirectionCheck(player, part, EConstructionDirCheckType.INDOORS))
1013 return false;
1014 if (!construction.ConstructionInsiderBoxCheck(player, part))
1015 return false;
1016
1017 return true;
1018 }
1019 return false;
1020 }
1021
1024 {
1026 }
1027
1029
1031 [
Obsolete(
"Use 'SetBuildingAnimationEx' instead")]
1033 {
1035 }
1036}
1037
1039{
1041 {
1043 }
1044
1046 {
1049 }
1050
1052 {
1053 return false;
1054 }
1055
1057 {
1058 ConstructionActionData cad = player.GetConstructionActionData();
1060 if (part)
1061 {
1063 if (overrideText ==
string.
Empty)
1065 else
1067
1068 #ifdef DIAG_DEVELOPER
1069 if (DiagMenu.GetBool(
DiagMenuIDs.BASEBUILDING_FULLDEBUG))
1070 {
1072 }
1073 #endif
1074 }
1075 }
1076
1078 {
1079 #ifdef DIAG_DEVELOPER
1080 if (player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.INSTANT)
1081 return false;
1082 #endif
1083
1084 if (item)
1085 return false;
1086
1088 if (!Class.CastTo(ent,target.GetObject()))
1089 return false;
1090
1091 if (player.IsPlacingLocal() || player.IsPlacingServer())
1092 return false;
1093
1094
1095 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
1096 return false;
1097
1098 bool handConstructionCondition = ent.CanUseHandConstruction();
1099 #ifdef DIAG_DEVELOPER
1100 if (player.GetConstructionActionData().GetFastConstructionMode())
1101 handConstructionCondition = true;
1102 #endif
1103
1104 if (!ent.CanUseConstruction() || !ent.CanUseConstructionBuild() || !handConstructionCondition)
1105 return false;
1106
1107 if ((!
GetGame().IsDedicatedServer()))
1108 {
1110 return false;
1111
1112 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item,
m_VariantID))
1114
1115 return false;
1116 }
1117 return true;
1118 }
1119
1121 {
1124 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
1126
1127 check_data.m_PartName = part_name;
1129
1130 bool canBuild = construction.CanBuildPart(part_name, null, false);
1131 #ifdef DIAG_DEVELOPER
1132 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
1133 canBuild = true;
1134 #endif
1136 {
1137 bool collides = construction.IsCollidingEx(check_data);
1138
1139 return !collides && canBuild;
1140 }
1141 else
1142 {
1143 return canBuild;
1144 }
1145 }
1146
1148 {
1150
1151 ActionInfoDataConstructionPossible info = ActionInfoDataConstructionPossible.Cast(
m_InfoData);
1152 ConstructionActionData cad = player.GetConstructionActionData();
1154 info.SetConstructionPart(part);
1155 info.SetTool(item);
1156
1158
1159
1160
1161
1162
1163
1165
1166 return info.CanDisplayInfo();
1167 }
1168
1170 {
1171 ConstructionActionData cad = action_data.m_Player.GetConstructionActionData();
1173 }
1174
1177 {
1179 }
1180
1183 {
1184 if (item)
1185 return;
1186
1187 BuildPartActionData buildData;
1188 if (Class.CastTo(buildData, action_data))
1189 {
1192 ConstructionPart part = construction.GetConstructionPart(buildData.m_PartType);
1194
1195 if (animOverrideID >= 0)
1196 m_CommandUID = animOverrideID;
1197 else
1199 }
1200 }
1201}
1202
1203
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.