621 : ActionReciveData
622{
624}
625
627{
629};
630
632{
634 {
636 m_ActionData.m_ActionComponent =
new CAContinuousTime(time);
637 }
638
640 {
641 #ifdef DIAG_DEVELOPER
642 if (
m_ActionData.m_Player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.FAST)
643 return 1;
644 #endif
645
646 if (item)
647 return UATimeSpent.BASEBUILDING_CONSTRUCT_MEDIUM;
648 else
649 return UATimeSpent.BASEBUILDING_CONSTRUCT_SLOW;
650 }
651};
652
654{
656 {
661
665 }
666
668 {
671 }
672
674 {
675 ConstructionActionData cad = player.GetConstructionActionData();
677 if (part)
678 {
680 if (overrideText ==
string.
Empty)
682 else
684
685 #ifdef DIAG_DEVELOPER
686 if (DiagMenu.GetBool(
DiagMenuIDs.BASEBUILDING_FULLDEBUG))
687 {
689 }
690 #endif
691 }
692 }
693
695 {
696 m_InfoData =
new ActionInfoDataConstructionPossible();
697 }
698
700 {
701 return false;
702 }
703
705 {
706 return false;
707 }
708
710 {
711 #ifdef DIAG_DEVELOPER
712 if (player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.INSTANT)
713 return false;
714 #endif
715
717 if (!Class.CastTo(ent,target.GetObject()))
718 return false;
719
720 if (player.IsPlacingLocal() || player.IsPlacingServer())
721 return false;
722
723
724 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
725 return false;
726
727 if (!ent.CanUseConstruction() || !ent.CanUseConstructionBuild())
728 return false;
729
730 if ((!
GetGame().IsDedicatedServer()))
731 {
733 return false;
734
735 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item,
m_VariantID))
737
738 return false;
739 }
740 return true;
741 }
742
744 {
747 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
749
750 check_data.m_PartName = part_name;
752
753 bool canBuild = construction.CanBuildPart(part_name, action_data.
m_MainItem,
true);
754 #ifdef DIAG_DEVELOPER
755 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
756 canBuild = true;
757 #endif
759 {
760 bool collides = construction.IsCollidingEx(check_data);
761
762 return !collides && canBuild;
763 }
764 else
765 {
766 return canBuild;
767 }
768 }
769
771 {
774
775 string partName = BuildPartActionData.Cast(action_data).m_PartType;
778
779 checkData.m_PartName = partName;
781
783 #ifdef DIAG_DEVELOPER
784 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
785 canBuild = true;
786 #endif
787 if (!construction.IsCollidingEx(checkData) && canBuild)
788 {
789
791
792 #ifdef DIAG_DEVELOPER
793
794 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
795 return;
796 #endif
797
798
800 {
802 action_data.
m_MainItem.DecreaseHealth(UADamageApplied.BUILD,
false);
803 }
804 else
805 {
807 {
808 EntityAI gloves = action_data.
m_Player.GetInventory().FindAttachment(InventorySlots.GLOVES);
809 if (gloves && gloves.GetHealthLevel() < 4)
810 {
811 gloves.AddHealth("","", PlayerConstants.GLOVES_DAMAGE_HAND_CONSTRUCTION);
812 }
813 else if (Math.RandomFloat01() < PlayerConstants.CHANCE_TO_BLEED_HAND_CONSTRUCTION)
814 {
815 if (Math.RandomFloat01() < 0.5)
816 action_data.
m_Player.GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"LeftForeArmRoll");
817 else
818 action_data.
m_Player.GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"RightForeArmRoll");
820 }
821 }
822 }
823 }
824 }
825
827 {
828 return "Base_building";
829 }
830
832 {
833 BuildPartActionData action_data = new BuildPartActionData;
834 return action_data;
835 }
836
837
839 {
840 if (super.SetupAction(player, target, item, action_data, extra_data))
841 {
842 if (!
g_Game.IsDedicatedServer())
843 {
845 }
846
848 return true;
849 }
850
851 return false;
852 }
853
855 {
856 ConstructionActionData cad = action_data.m_Player.GetConstructionActionData();
858 BuildPartActionData.Cast(action_data).m_PartType = part.
GetPartName();
859 }
860
862 {
863 if (!item)
864 return;
865
866 switch (item.Type())
867 {
868 case Pickaxe:
869 case Shovel:
870 case FarmingHoe:
871 case FieldShovel:
873 break;
874 case Pliers:
876 break;
877 case SledgeHammer:
879 break;
880 case BrickTrowel:
882 break;
883 default:
885 break;
886 }
887 }
888
890 {
891 super.WriteToContext(ctx, action_data);
892
893 ctx.
Write(BuildPartActionData.Cast(action_data).m_PartType);
894 }
895
897 {
898 action_recive_data = new BuildPartActionReciveData;
899 super.ReadFromContext(ctx, action_recive_data);
900
901 string part_type;
902 if (ctx.
Read(part_type))
903 {
904 BuildPartActionReciveData.Cast(action_recive_data).m_PartType = part_type;
905 return true;
906 }
907 else
908 {
909 return false;
910 }
911 }
912
913 override void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
914 {
915 super.HandleReciveData(action_recive_data, action_data);
916
917 BuildPartActionData.Cast(action_data).m_PartType = BuildPartActionReciveData.Cast(action_recive_data).m_PartType;
918 }
919
921 {
922 string partName = BuildPartActionData.Cast(action_data).m_PartType;
923
924 string itemName = "hands";
926 itemName = action_data.
m_MainItem.GetDisplayName();
927
928 string message =
string.Format(
"Built %1 on %2 with %3", partName, action_data.
m_Target.GetObject().GetDisplayName(), itemName);
929 return message;
930 }
931
933 {
935 }
936
938 {
940
941 ActionInfoDataConstructionPossible info = ActionInfoDataConstructionPossible.Cast(
m_InfoData);
942 ConstructionActionData cad = player.GetConstructionActionData();
944 info.SetConstructionPart(part);
945 info.SetTool(item);
946
949
950 return info.CanDisplayInfo();
951 }
952
955 {
958 ConstructionActionData cad = player.GetConstructionActionData();
960
961 if (part)
962 {
964 if (!ent.IsPlayerInsideEx(player, part.
GetPartName()))
965 {
967 return false;
968 else if (!bbb)
969 return false;
970 }
971 if (!construction.ConstructionDirectionCheck(player, part, EConstructionDirCheckType.INDOORS))
972 return false;
973 if (!construction.ConstructionInsiderBoxCheck(player, part))
974 return false;
975
976 return true;
977 }
978 return false;
979 }
980
983 {
985 }
986
988
990 [
Obsolete(
"Use 'SetBuildingAnimationEx' instead")]
992 {
994 }
995}
996
998{
1000 {
1002 }
1003
1005 {
1008 }
1009
1011 {
1012 return false;
1013 }
1014
1016 {
1017 ConstructionActionData cad = player.GetConstructionActionData();
1019 if (part)
1020 {
1022 if (overrideText ==
string.
Empty)
1024 else
1026
1027 #ifdef DIAG_DEVELOPER
1028 if (DiagMenu.GetBool(
DiagMenuIDs.BASEBUILDING_FULLDEBUG))
1029 {
1031 }
1032 #endif
1033 }
1034 }
1035
1037 {
1038 #ifdef DIAG_DEVELOPER
1039 if (player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.INSTANT)
1040 return false;
1041 #endif
1042
1043 if (item)
1044 return false;
1045
1047 if (!Class.CastTo(ent,target.GetObject()))
1048 return false;
1049
1050 if (player.IsPlacingLocal() || player.IsPlacingServer())
1051 return false;
1052
1053
1054 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
1055 return false;
1056
1057 bool handConstructionCondition = ent.CanUseHandConstruction();
1058 #ifdef DIAG_DEVELOPER
1059 if (player.GetConstructionActionData().GetFastConstructionMode())
1060 handConstructionCondition = true;
1061 #endif
1062
1063 if (!ent.CanUseConstruction() || !ent.CanUseConstructionBuild() || !handConstructionCondition)
1064 return false;
1065
1066 if ((!
GetGame().IsDedicatedServer()))
1067 {
1069 return false;
1070
1071 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item,
m_VariantID))
1073
1074 return false;
1075 }
1076 return true;
1077 }
1078
1080 {
1083 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
1085
1086 check_data.m_PartName = part_name;
1088
1089 bool canBuild = construction.CanBuildPart(part_name, null, false);
1090 #ifdef DIAG_DEVELOPER
1091 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
1092 canBuild = true;
1093 #endif
1095 {
1096 bool collides = construction.IsCollidingEx(check_data);
1097
1098 return !collides && canBuild;
1099 }
1100 else
1101 {
1102 return canBuild;
1103 }
1104 }
1105
1107 {
1109
1110 ActionInfoDataConstructionPossible info = ActionInfoDataConstructionPossible.Cast(
m_InfoData);
1111 ConstructionActionData cad = player.GetConstructionActionData();
1113 info.SetConstructionPart(part);
1114 info.SetTool(item);
1115
1117
1118
1119
1120
1121
1122
1124
1125 return info.CanDisplayInfo();
1126 }
1127
1129 {
1130 ConstructionActionData cad = action_data.m_Player.GetConstructionActionData();
1132 }
1133
1136 {
1138 }
1139
1142 {
1143 if (item)
1144 return;
1145
1146 BuildPartActionData buildData;
1147 if (Class.CastTo(buildData, action_data))
1148 {
1151 ConstructionPart part = construction.GetConstructionPart(buildData.m_PartType);
1153
1154 if (animOverrideID >= 0)
1155 m_CommandUID = animOverrideID;
1156 else
1158 }
1159 }
1160}
1161
1162
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.