Can build from the inside only, if applicable.
679 : ActionReciveData
680{
682}
683
685{
687};
688
690{
692 {
694 m_ActionData.m_ActionComponent =
new CAContinuousTime(time);
695 }
696
698 {
699 #ifdef DIAG_DEVELOPER
700 if (
m_ActionData.m_Player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.FAST)
701 return 1;
702 #endif
703
704 if (item)
705 return UATimeSpent.BASEBUILDING_CONSTRUCT_MEDIUM;
706 else
707 return UATimeSpent.BASEBUILDING_CONSTRUCT_SLOW;
708 }
709};
710
712{
714 {
719
723 }
724
726 {
729 }
730
732 {
733 ConstructionActionData cad = player.GetConstructionActionData();
735 if (part)
736 {
738 if (overrideText ==
string.
Empty)
740 else
742
743 #ifdef DIAG_DEVELOPER
744 if (DiagMenu.GetBool(
DiagMenuIDs.BASEBUILDING_FULLDEBUG))
745 {
747 }
748 #endif
749 }
750 }
751
753 {
754 m_InfoData =
new ActionInfoDataConstructionPossible();
755 }
756
758 {
759 return false;
760 }
761
763 {
764 return false;
765 }
766
768 {
769 #ifdef DIAG_DEVELOPER
770 if (player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.INSTANT)
771 return false;
772 #endif
773
775 if (!Class.CastTo(ent,target.GetObject()))
776 return false;
777
778 if (player.IsPlacingLocal() || player.IsPlacingServer())
779 return false;
780
781
782 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
783 return false;
784
785 if (!ent.CanUseConstruction() || !ent.CanUseConstructionBuild())
786 return false;
787
788 if ((!
GetGame().IsDedicatedServer()))
789 {
791 return false;
792
793 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item,
m_VariantID))
795
796 return false;
797 }
798 return true;
799 }
800
802 {
805 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
807
808 check_data.m_PartName = part_name;
810
811 bool canBuild = construction.CanBuildPart(part_name, action_data.
m_MainItem,
true);
812 #ifdef DIAG_DEVELOPER
813 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
814 canBuild = true;
815 #endif
817 {
818 bool collides = construction.IsCollidingEx(check_data);
819
820 return !collides && canBuild;
821 }
822 else
823 {
824 return canBuild;
825 }
826 }
827
829 {
832
833 string partName = BuildPartActionData.Cast(action_data).m_PartType;
836
837 checkData.m_PartName = partName;
839
841 #ifdef DIAG_DEVELOPER
842 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
843 canBuild = true;
844 #endif
845 if (!construction.IsCollidingEx(checkData) && canBuild)
846 {
847
849
850 #ifdef DIAG_DEVELOPER
851
852 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
853 return;
854 #endif
855
856
858 {
860 action_data.
m_MainItem.DecreaseHealth(UADamageApplied.BUILD,
false);
861 }
862 else
863 {
865 {
866 EntityAI gloves = action_data.
m_Player.GetInventory().FindAttachment(InventorySlots.GLOVES);
867 if (gloves && gloves.GetHealthLevel() < 4)
868 {
869 gloves.AddHealth("","", PlayerConstants.GLOVES_DAMAGE_HAND_CONSTRUCTION);
870 }
871 else if (Math.RandomFloat01() < PlayerConstants.CHANCE_TO_BLEED_HAND_CONSTRUCTION)
872 {
873 if (Math.RandomFloat01() < 0.5)
874 action_data.
m_Player.GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"LeftForeArmRoll");
875 else
876 action_data.
m_Player.GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"RightForeArmRoll");
878 }
879 }
880 }
881 }
882 }
883
885 {
886 return "Base_building";
887 }
888
890 {
891 BuildPartActionData action_data = new BuildPartActionData;
892 return action_data;
893 }
894
895
897 {
898 if (super.SetupAction(player, target, item, action_data, extra_data))
899 {
900 if (!
g_Game.IsDedicatedServer())
901 {
903 }
904
906 return true;
907 }
908
909 return false;
910 }
911
913 {
914 ConstructionActionData cad = action_data.m_Player.GetConstructionActionData();
916 BuildPartActionData.Cast(action_data).m_PartType = part.
GetPartName();
917 }
918
920 {
921 if (!item)
922 return;
923
924 switch (item.Type())
925 {
926 case Pickaxe:
927 case Shovel:
928 case FarmingHoe:
929 case FieldShovel:
931 break;
932 case Pliers:
934 break;
935 case SledgeHammer:
937 break;
938 case BrickTrowel:
940 break;
941 default:
943 break;
944 }
945 }
946
948 {
949 super.WriteToContext(ctx, action_data);
950
951 ctx.
Write(BuildPartActionData.Cast(action_data).m_PartType);
952 }
953
955 {
956 action_recive_data = new BuildPartActionReciveData;
957 super.ReadFromContext(ctx, action_recive_data);
958
959 string part_type;
960 if (ctx.
Read(part_type))
961 {
962 BuildPartActionReciveData.Cast(action_recive_data).m_PartType = part_type;
963 return true;
964 }
965 else
966 {
967 return false;
968 }
969 }
970
971 override void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
972 {
973 super.HandleReciveData(action_recive_data, action_data);
974
975 BuildPartActionData.Cast(action_data).m_PartType = BuildPartActionReciveData.Cast(action_recive_data).m_PartType;
976 }
977
979 {
980 string partName = BuildPartActionData.Cast(action_data).m_PartType;
981
982 string itemName = "hands";
984 itemName = action_data.
m_MainItem.GetDisplayName();
985
986 string message =
string.Format(
"Built %1 on %2 with %3", partName, action_data.
m_Target.GetObject().GetDisplayName(), itemName);
987 return message;
988 }
989
991 {
993 }
994
996 {
998
999 ActionInfoDataConstructionPossible info = ActionInfoDataConstructionPossible.Cast(
m_InfoData);
1000 ConstructionActionData cad = player.GetConstructionActionData();
1002 info.SetConstructionPart(part);
1003 info.SetTool(item);
1004
1007
1008 return info.CanDisplayInfo();
1009 }
1010
1013 {
1016 ConstructionActionData cad = player.GetConstructionActionData();
1018
1019 if (part)
1020 {
1022 if (!ent.IsPlayerInsideEx(player, part.
GetPartName()))
1023 {
1025 return false;
1026 else if (!bbb)
1027 return false;
1028 }
1029 if (!construction.ConstructionDirectionCheck(player, part, EConstructionDirCheckType.INDOORS))
1030 return false;
1031 if (!construction.ConstructionInsiderBoxCheck(player, part))
1032 return false;
1033
1034 return true;
1035 }
1036 return false;
1037 }
1038
1041 {
1043 }
1044
1046
1048 [
Obsolete(
"Use 'SetBuildingAnimationEx' instead")]
1050 {
1052 }
1053}
1054
1056{
1058 {
1060 }
1061
1063 {
1066 }
1067
1069 {
1070 return false;
1071 }
1072
1074 {
1075 ConstructionActionData cad = player.GetConstructionActionData();
1077 if (part)
1078 {
1080 if (overrideText ==
string.
Empty)
1082 else
1084
1085 #ifdef DIAG_DEVELOPER
1086 if (DiagMenu.GetBool(
DiagMenuIDs.BASEBUILDING_FULLDEBUG))
1087 {
1089 }
1090 #endif
1091 }
1092 }
1093
1095 {
1096 #ifdef DIAG_DEVELOPER
1097 if (player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.INSTANT)
1098 return false;
1099 #endif
1100
1101 if (item)
1102 return false;
1103
1105 if (!Class.CastTo(ent,target.GetObject()))
1106 return false;
1107
1108 if (player.IsPlacingLocal() || player.IsPlacingServer())
1109 return false;
1110
1111
1112 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
1113 return false;
1114
1115 bool handConstructionCondition = ent.CanUseHandConstruction();
1116 #ifdef DIAG_DEVELOPER
1117 if (player.GetConstructionActionData().GetFastConstructionMode())
1118 handConstructionCondition = true;
1119 #endif
1120
1121 if (!ent.CanUseConstruction() || !ent.CanUseConstructionBuild() || !handConstructionCondition)
1122 return false;
1123
1124 if ((!
GetGame().IsDedicatedServer()))
1125 {
1127 return false;
1128
1129 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item,
m_VariantID))
1131
1132 return false;
1133 }
1134 return true;
1135 }
1136
1138 {
1141 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
1143
1144 check_data.m_PartName = part_name;
1146
1147 bool canBuild = construction.CanBuildPart(part_name, null, false);
1148 #ifdef DIAG_DEVELOPER
1149 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
1150 canBuild = true;
1151 #endif
1153 {
1154 bool collides = construction.IsCollidingEx(check_data);
1155
1156 return !collides && canBuild;
1157 }
1158 else
1159 {
1160 return canBuild;
1161 }
1162 }
1163
1165 {
1167
1168 ActionInfoDataConstructionPossible info = ActionInfoDataConstructionPossible.Cast(
m_InfoData);
1169 ConstructionActionData cad = player.GetConstructionActionData();
1171 info.SetConstructionPart(part);
1172 info.SetTool(item);
1173
1175
1176
1177
1178
1179
1180
1182
1183 return info.CanDisplayInfo();
1184 }
1185
1187 {
1188 ConstructionActionData cad = action_data.m_Player.GetConstructionActionData();
1190 }
1191
1194 {
1196 }
1197
1200 {
1201 if (item)
1202 return;
1203
1204 BuildPartActionData buildData;
1205 if (Class.CastTo(buildData, action_data))
1206 {
1209 ConstructionPart part = construction.GetConstructionPart(buildData.m_PartType);
1211
1212 if (animOverrideID >= 0)
1213 m_CommandUID = animOverrideID;
1214 else
1216 }
1217 }
1218}
1219
1220
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.