657 : ActionReciveData
658{
660}
661
663{
665};
666
668{
670 {
672 m_ActionData.m_ActionComponent =
new CAContinuousTime(time);
673 }
674
676 {
677 #ifdef DIAG_DEVELOPER
678 if (
m_ActionData.m_Player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.FAST)
679 return 1;
680 #endif
681
682 if (item)
683 return UATimeSpent.BASEBUILDING_CONSTRUCT_MEDIUM;
684 else
685 return UATimeSpent.BASEBUILDING_CONSTRUCT_SLOW;
686 }
687};
688
690{
692 {
697
701 }
702
704 {
707 }
708
710 {
711 ConstructionActionData cad = player.GetConstructionActionData();
713 if (part)
714 {
716 if (overrideText ==
string.
Empty)
718 else
720
721 #ifdef DIAG_DEVELOPER
722 if (DiagMenu.GetBool(
DiagMenuIDs.BASEBUILDING_FULLDEBUG))
723 {
725 }
726 #endif
727 }
728 }
729
731 {
732 m_InfoData =
new ActionInfoDataConstructionPossible();
733 }
734
736 {
737 return false;
738 }
739
741 {
742 return false;
743 }
744
746 {
747 #ifdef DIAG_DEVELOPER
748 if (player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.INSTANT)
749 return false;
750 #endif
751
753 if (!Class.CastTo(ent,target.GetObject()))
754 return false;
755
756 if (player.IsPlacingLocal() || player.IsPlacingServer())
757 return false;
758
759
760 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
761 return false;
762
763 if (!ent.CanUseConstruction() || !ent.CanUseConstructionBuild())
764 return false;
765
766 if ((!
GetGame().IsDedicatedServer()))
767 {
769 return false;
770
771 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item,
m_VariantID))
773
774 return false;
775 }
776 return true;
777 }
778
780 {
783 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
785
786 check_data.m_PartName = part_name;
788
789 bool canBuild = construction.CanBuildPart(part_name, action_data.
m_MainItem,
true);
790 #ifdef DIAG_DEVELOPER
791 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
792 canBuild = true;
793 #endif
795 {
796 bool collides = construction.IsCollidingEx(check_data);
797
798 return !collides && canBuild;
799 }
800 else
801 {
802 return canBuild;
803 }
804 }
805
807 {
810
811 string partName = BuildPartActionData.Cast(action_data).m_PartType;
814
815 checkData.m_PartName = partName;
817
819 #ifdef DIAG_DEVELOPER
820 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
821 canBuild = true;
822 #endif
823 if (!construction.IsCollidingEx(checkData) && canBuild)
824 {
825
827
828 #ifdef DIAG_DEVELOPER
829
830 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
831 return;
832 #endif
833
834
836 {
838 action_data.
m_MainItem.DecreaseHealth(UADamageApplied.BUILD,
false);
839 }
840 else
841 {
843 {
844 EntityAI gloves = action_data.
m_Player.GetInventory().FindAttachment(InventorySlots.GLOVES);
845 if (gloves && gloves.GetHealthLevel() < 4)
846 {
847 gloves.AddHealth("","", PlayerConstants.GLOVES_DAMAGE_HAND_CONSTRUCTION);
848 }
849 else if (Math.RandomFloat01() < PlayerConstants.CHANCE_TO_BLEED_HAND_CONSTRUCTION)
850 {
851 if (Math.RandomFloat01() < 0.5)
852 action_data.
m_Player.GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"LeftForeArmRoll");
853 else
854 action_data.
m_Player.GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"RightForeArmRoll");
856 }
857 }
858 }
859 }
860 }
861
863 {
864 return "Base_building";
865 }
866
868 {
869 BuildPartActionData action_data = new BuildPartActionData;
870 return action_data;
871 }
872
873
875 {
876 if (super.SetupAction(player, target, item, action_data, extra_data))
877 {
878 if (!
g_Game.IsDedicatedServer())
879 {
881 }
882
884 return true;
885 }
886
887 return false;
888 }
889
891 {
892 ConstructionActionData cad = action_data.m_Player.GetConstructionActionData();
894 BuildPartActionData.Cast(action_data).m_PartType = part.
GetPartName();
895 }
896
898 {
899 if (!item)
900 return;
901
902 switch (item.Type())
903 {
904 case Pickaxe:
905 case Shovel:
906 case FarmingHoe:
907 case FieldShovel:
909 break;
910 case Pliers:
912 break;
913 case SledgeHammer:
915 break;
916 case BrickTrowel:
918 break;
919 default:
921 break;
922 }
923 }
924
926 {
927 super.WriteToContext(ctx, action_data);
928
929 ctx.
Write(BuildPartActionData.Cast(action_data).m_PartType);
930 }
931
933 {
934 action_recive_data = new BuildPartActionReciveData;
935 super.ReadFromContext(ctx, action_recive_data);
936
937 string part_type;
938 if (ctx.
Read(part_type))
939 {
940 BuildPartActionReciveData.Cast(action_recive_data).m_PartType = part_type;
941 return true;
942 }
943 else
944 {
945 return false;
946 }
947 }
948
949 override void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
950 {
951 super.HandleReciveData(action_recive_data, action_data);
952
953 BuildPartActionData.Cast(action_data).m_PartType = BuildPartActionReciveData.Cast(action_recive_data).m_PartType;
954 }
955
957 {
958 string partName = BuildPartActionData.Cast(action_data).m_PartType;
959
960 string itemName = "hands";
962 itemName = action_data.
m_MainItem.GetDisplayName();
963
964 string message =
string.Format(
"Built %1 on %2 with %3", partName, action_data.
m_Target.GetObject().GetDisplayName(), itemName);
965 return message;
966 }
967
969 {
971 }
972
974 {
976
977 ActionInfoDataConstructionPossible info = ActionInfoDataConstructionPossible.Cast(
m_InfoData);
978 ConstructionActionData cad = player.GetConstructionActionData();
980 info.SetConstructionPart(part);
981 info.SetTool(item);
982
985
986 return info.CanDisplayInfo();
987 }
988
991 {
994 ConstructionActionData cad = player.GetConstructionActionData();
996
997 if (part)
998 {
1000 if (!ent.IsPlayerInsideEx(player, part.
GetPartName()))
1001 {
1003 return false;
1004 else if (!bbb)
1005 return false;
1006 }
1007 if (!construction.ConstructionDirectionCheck(player, part, EConstructionDirCheckType.INDOORS))
1008 return false;
1009 if (!construction.ConstructionInsiderBoxCheck(player, part))
1010 return false;
1011
1012 return true;
1013 }
1014 return false;
1015 }
1016
1019 {
1021 }
1022
1024
1026 [
Obsolete(
"Use 'SetBuildingAnimationEx' instead")]
1028 {
1030 }
1031}
1032
1034{
1036 {
1038 }
1039
1041 {
1044 }
1045
1047 {
1048 return false;
1049 }
1050
1052 {
1053 ConstructionActionData cad = player.GetConstructionActionData();
1055 if (part)
1056 {
1058 if (overrideText ==
string.
Empty)
1060 else
1062
1063 #ifdef DIAG_DEVELOPER
1064 if (DiagMenu.GetBool(
DiagMenuIDs.BASEBUILDING_FULLDEBUG))
1065 {
1067 }
1068 #endif
1069 }
1070 }
1071
1073 {
1074 #ifdef DIAG_DEVELOPER
1075 if (player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.INSTANT)
1076 return false;
1077 #endif
1078
1079 if (item)
1080 return false;
1081
1083 if (!Class.CastTo(ent,target.GetObject()))
1084 return false;
1085
1086 if (player.IsPlacingLocal() || player.IsPlacingServer())
1087 return false;
1088
1089
1090 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
1091 return false;
1092
1093 bool handConstructionCondition = ent.CanUseHandConstruction();
1094 #ifdef DIAG_DEVELOPER
1095 if (player.GetConstructionActionData().GetFastConstructionMode())
1096 handConstructionCondition = true;
1097 #endif
1098
1099 if (!ent.CanUseConstruction() || !ent.CanUseConstructionBuild() || !handConstructionCondition)
1100 return false;
1101
1102 if ((!
GetGame().IsDedicatedServer()))
1103 {
1105 return false;
1106
1107 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item,
m_VariantID))
1109
1110 return false;
1111 }
1112 return true;
1113 }
1114
1116 {
1119 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
1121
1122 check_data.m_PartName = part_name;
1124
1125 bool canBuild = construction.CanBuildPart(part_name, null, false);
1126 #ifdef DIAG_DEVELOPER
1127 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
1128 canBuild = true;
1129 #endif
1131 {
1132 bool collides = construction.IsCollidingEx(check_data);
1133
1134 return !collides && canBuild;
1135 }
1136 else
1137 {
1138 return canBuild;
1139 }
1140 }
1141
1143 {
1145
1146 ActionInfoDataConstructionPossible info = ActionInfoDataConstructionPossible.Cast(
m_InfoData);
1147 ConstructionActionData cad = player.GetConstructionActionData();
1149 info.SetConstructionPart(part);
1150 info.SetTool(item);
1151
1153
1154
1155
1156
1157
1158
1160
1161 return info.CanDisplayInfo();
1162 }
1163
1165 {
1166 ConstructionActionData cad = action_data.m_Player.GetConstructionActionData();
1168 }
1169
1172 {
1174 }
1175
1178 {
1179 if (item)
1180 return;
1181
1182 BuildPartActionData buildData;
1183 if (Class.CastTo(buildData, action_data))
1184 {
1187 ConstructionPart part = construction.GetConstructionPart(buildData.m_PartType);
1189
1190 if (animOverrideID >= 0)
1191 m_CommandUID = animOverrideID;
1192 else
1194 }
1195 }
1196}
1197
1198
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.