Does not work on server, since variants are not updated there (invoker does not invoke)
707 : ActionReciveData
708{
710}
711
713{
715};
716
718{
720 {
722 m_ActionData.m_ActionComponent =
new CAContinuousTime(time);
723 }
724
726 {
727 #ifdef DIAG_DEVELOPER
728 if (
m_ActionData.m_Player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.FAST)
729 return 1;
730 #endif
731
732 if (item)
733 return UATimeSpent.BASEBUILDING_CONSTRUCT_MEDIUM;
734 else
735 return UATimeSpent.BASEBUILDING_CONSTRUCT_SLOW;
736 }
737};
738
740{
742 {
747
751 }
752
754 {
757 }
758
760 {
761 ConstructionActionData cad = player.GetConstructionActionData();
763 if (part)
764 {
766 if (overrideText ==
string.
Empty)
768 else
770
771 #ifdef DIAG_DEVELOPER
772 if (DiagMenu.GetBool(
DiagMenuIDs.BASEBUILDING_FULLDEBUG))
773 {
775 }
776 #endif
777 }
778 }
779
781 {
782 m_InfoData =
new ActionInfoDataConstructionPossible();
783 }
784
786 {
787 return false;
788 }
789
791 {
792 return false;
793 }
794
796 {
797 #ifdef DIAG_DEVELOPER
798 if (player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.INSTANT)
799 return false;
800 #endif
801
803 if (!Class.CastTo(ent,target.GetObject()))
804 return false;
805
806 if (player.IsPlacingLocal() || player.IsPlacingServer())
807 return false;
808
809
810 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
811 return false;
812
813 if (!ent.CanUseConstruction() || !ent.CanUseConstructionBuild())
814 return false;
815
816 if ((!
GetGame().IsDedicatedServer()))
817 {
819 return false;
820
821 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item,
m_VariantID))
823
824 return false;
825 }
826 return true;
827 }
828
830 {
833 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
835
836 check_data.m_PartName = part_name;
838
839 bool canBuild = construction.CanBuildPart(part_name, action_data.
m_MainItem,
true);
840 #ifdef DIAG_DEVELOPER
841 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
842 canBuild = true;
843 #endif
845 {
846 bool collides = construction.IsCollidingEx(check_data);
847
848 return !collides && canBuild;
849 }
850 else
851 {
852 return canBuild;
853 }
854 }
855
857 {
860
861 string partName = BuildPartActionData.Cast(action_data).m_PartType;
864
865 checkData.m_PartName = partName;
867
869 #ifdef DIAG_DEVELOPER
870 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
871 canBuild = true;
872 #endif
873 if (!construction.IsCollidingEx(checkData) && canBuild)
874 {
875
877
878 #ifdef DIAG_DEVELOPER
879
880 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
881 return;
882 #endif
883
884
886 {
888 action_data.
m_MainItem.DecreaseHealth(UADamageApplied.BUILD,
false);
889 }
890 else
891 {
893 {
894 EntityAI gloves = action_data.
m_Player.GetInventory().FindAttachment(InventorySlots.GLOVES);
895 if (gloves && gloves.GetHealthLevel() < 4)
896 {
897 gloves.AddHealth("","", PlayerConstants.GLOVES_DAMAGE_HAND_CONSTRUCTION);
898 }
899 else if (Math.RandomFloat01() < PlayerConstants.CHANCE_TO_BLEED_HAND_CONSTRUCTION)
900 {
901 if (Math.RandomFloat01() < 0.5)
902 action_data.
m_Player.GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"LeftForeArmRoll");
903 else
904 action_data.
m_Player.GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"RightForeArmRoll");
906 }
907 }
908 }
909 }
910 }
911
913 {
914 return "Base_building";
915 }
916
918 {
919 BuildPartActionData action_data = new BuildPartActionData;
920 return action_data;
921 }
922
923
925 {
926 if (super.SetupAction(player, target, item, action_data, extra_data))
927 {
928 if (!
g_Game.IsDedicatedServer())
929 {
931 }
932
934 return true;
935 }
936
937 return false;
938 }
939
941 {
942 ConstructionActionData cad = action_data.m_Player.GetConstructionActionData();
944 BuildPartActionData.Cast(action_data).m_PartType = part.
GetPartName();
945 }
946
948 {
949 if (!item)
950 return;
951
952 switch (item.Type())
953 {
954 case Pickaxe:
955 case Shovel:
956 case FarmingHoe:
957 case FieldShovel:
959 break;
960 case Pliers:
962 break;
963 case SledgeHammer:
965 break;
966 case BrickTrowel:
968 break;
969 default:
971 break;
972 }
973 }
974
976 {
977 super.WriteToContext(ctx, action_data);
978
979 ctx.
Write(BuildPartActionData.Cast(action_data).m_PartType);
980 }
981
983 {
984 action_recive_data = new BuildPartActionReciveData;
985 super.ReadFromContext(ctx, action_recive_data);
986
987 string part_type;
988 if (ctx.
Read(part_type))
989 {
990 BuildPartActionReciveData.Cast(action_recive_data).m_PartType = part_type;
991 return true;
992 }
993 else
994 {
995 return false;
996 }
997 }
998
999 override void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
1000 {
1001 super.HandleReciveData(action_recive_data, action_data);
1002
1003 BuildPartActionData.Cast(action_data).m_PartType = BuildPartActionReciveData.Cast(action_recive_data).m_PartType;
1004 }
1005
1007 {
1008 string partName = BuildPartActionData.Cast(action_data).m_PartType;
1009
1010 string itemName = "hands";
1012 itemName = action_data.
m_MainItem.GetDisplayName();
1013
1014 string message =
string.Format(
"Built %1 on %2 with %3", partName, action_data.
m_Target.GetObject().GetDisplayName(), itemName);
1015 return message;
1016 }
1017
1019 {
1021 }
1022
1024 {
1026
1027 ActionInfoDataConstructionPossible info = ActionInfoDataConstructionPossible.Cast(
m_InfoData);
1028 ConstructionActionData cad = player.GetConstructionActionData();
1030 info.SetConstructionPart(part);
1031 info.SetTool(item);
1032
1035
1036 return info.CanDisplayInfo();
1037 }
1038
1041 {
1044 ConstructionActionData cad = player.GetConstructionActionData();
1046
1047 if (part)
1048 {
1050 if (!ent.IsPlayerInsideEx(player, part.
GetPartName()))
1051 {
1053 return false;
1054 else if (!bbb)
1055 return false;
1056 }
1057 if (!construction.ConstructionDirectionCheck(player, part, EConstructionDirCheckType.INDOORS))
1058 return false;
1059 if (!construction.ConstructionInsiderBoxCheck(player, part))
1060 return false;
1061
1062 return true;
1063 }
1064 return false;
1065 }
1066
1069 {
1071 }
1072
1074
1076 [
Obsolete(
"Use 'SetBuildingAnimationEx' instead")]
1078 {
1080 }
1081}
1082
1084{
1086 {
1088 }
1089
1091 {
1094 }
1095
1097 {
1098 return false;
1099 }
1100
1102 {
1103 ConstructionActionData cad = player.GetConstructionActionData();
1105 if (part)
1106 {
1108 if (overrideText ==
string.
Empty)
1110 else
1112
1113 #ifdef DIAG_DEVELOPER
1114 if (DiagMenu.GetBool(
DiagMenuIDs.BASEBUILDING_FULLDEBUG))
1115 {
1117 }
1118 #endif
1119 }
1120 }
1121
1123 {
1124 #ifdef DIAG_DEVELOPER
1125 if (player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.INSTANT)
1126 return false;
1127 #endif
1128
1129 if (item)
1130 return false;
1131
1133 if (!Class.CastTo(ent,target.GetObject()))
1134 return false;
1135
1136 if (player.IsPlacingLocal() || player.IsPlacingServer())
1137 return false;
1138
1139
1140 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
1141 return false;
1142
1143 bool handConstructionCondition = ent.CanUseHandConstruction();
1144 #ifdef DIAG_DEVELOPER
1145 if (player.GetConstructionActionData().GetFastConstructionMode())
1146 handConstructionCondition = true;
1147 #endif
1148
1149 if (!ent.CanUseConstruction() || !ent.CanUseConstructionBuild() || !handConstructionCondition)
1150 return false;
1151
1152 if ((!
GetGame().IsDedicatedServer()))
1153 {
1155 return false;
1156
1157 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item,
m_VariantID))
1159
1160 return false;
1161 }
1162 return true;
1163 }
1164
1166 {
1169 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
1171
1172 check_data.m_PartName = part_name;
1174
1175 bool canBuild = construction.CanBuildPart(part_name, null, false);
1176 #ifdef DIAG_DEVELOPER
1177 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
1178 canBuild = true;
1179 #endif
1181 {
1182 bool collides = construction.IsCollidingEx(check_data);
1183
1184 return !collides && canBuild;
1185 }
1186 else
1187 {
1188 return canBuild;
1189 }
1190 }
1191
1193 {
1195
1196 ActionInfoDataConstructionPossible info = ActionInfoDataConstructionPossible.Cast(
m_InfoData);
1197 ConstructionActionData cad = player.GetConstructionActionData();
1199 info.SetConstructionPart(part);
1200 info.SetTool(item);
1201
1203
1204
1205
1206
1207
1208
1210
1211 return info.CanDisplayInfo();
1212 }
1213
1215 {
1216 ConstructionActionData cad = action_data.m_Player.GetConstructionActionData();
1218 }
1219
1222 {
1224 }
1225
1228 {
1229 if (item)
1230 return;
1231
1232 BuildPartActionData buildData;
1233 if (Class.CastTo(buildData, action_data))
1234 {
1237 ConstructionPart part = construction.GetConstructionPart(buildData.m_PartType);
1239
1240 if (animOverrideID >= 0)
1241 m_CommandUID = animOverrideID;
1242 else
1244 }
1245 }
1246}
1247
1248
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.