614 : ActionReciveData
615{
617}
618
620{
622};
623
625{
627 {
629 m_ActionData.m_ActionComponent =
new CAContinuousTime(time);
630 }
631
633 {
634 #ifdef DIAG_DEVELOPER
635 if (
m_ActionData.m_Player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.FAST)
636 return 1;
637 #endif
638
639 if (item)
640 return UATimeSpent.BASEBUILDING_CONSTRUCT_MEDIUM;
641 else
642 return UATimeSpent.BASEBUILDING_CONSTRUCT_SLOW;
643 }
644};
645
647{
649 {
654
658 }
659
661 {
664 }
665
667 {
668 ConstructionActionData cad = player.GetConstructionActionData();
670 if (part)
671 {
673 if (overrideText ==
string.
Empty)
675 else
677
678 #ifdef DIAG_DEVELOPER
679 if (DiagMenu.GetBool(
DiagMenuIDs.BASEBUILDING_FULLDEBUG))
680 {
682 }
683 #endif
684 }
685 }
686
688 {
689 m_InfoData =
new ActionInfoDataConstructionPossible();
690 }
691
693 {
694 return false;
695 }
696
698 {
699 return false;
700 }
701
703 {
704 #ifdef DIAG_DEVELOPER
705 if (player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.INSTANT)
706 return false;
707 #endif
708
710 if (!Class.CastTo(ent,target.GetObject()))
711 return false;
712
713 if (player.IsPlacingLocal() || player.IsPlacingServer())
714 return false;
715
716
717 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
718 return false;
719
720 if (!ent.CanUseConstruction() || !ent.CanUseConstructionBuild())
721 return false;
722
723 if ((!
GetGame().IsDedicatedServer()))
724 {
726 return false;
727
728 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item,
m_VariantID))
730
731 return false;
732 }
733 return true;
734 }
735
737 {
740 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
742
743 check_data.m_PartName = part_name;
745
746 bool canBuild = construction.CanBuildPart(part_name, action_data.
m_MainItem,
true);
747 #ifdef DIAG_DEVELOPER
748 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
749 canBuild = true;
750 #endif
752 {
753 bool collides = construction.IsCollidingEx(check_data);
754
755 return !collides && canBuild;
756 }
757 else
758 {
759 return canBuild;
760 }
761 }
762
764 {
767
768 string partName = BuildPartActionData.Cast(action_data).m_PartType;
771
772 checkData.m_PartName = partName;
774
776 #ifdef DIAG_DEVELOPER
777 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
778 canBuild = true;
779 #endif
780 if (!construction.IsCollidingEx(checkData) && canBuild)
781 {
782
784
785 #ifdef DIAG_DEVELOPER
786
787 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
788 return;
789 #endif
790
791
793 {
795 action_data.
m_MainItem.DecreaseHealth(UADamageApplied.BUILD,
false);
796 }
797 else
798 {
800 {
801 EntityAI gloves = action_data.
m_Player.GetInventory().FindAttachment(InventorySlots.GLOVES);
802 if (gloves && gloves.GetHealthLevel() < 4)
803 {
804 gloves.AddHealth("","", PlayerConstants.GLOVES_DAMAGE_HAND_CONSTRUCTION);
805 }
806 else if (Math.RandomFloat01() < PlayerConstants.CHANCE_TO_BLEED_HAND_CONSTRUCTION)
807 {
808 if (Math.RandomFloat01() < 0.5)
809 action_data.
m_Player.GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"LeftForeArmRoll");
810 else
811 action_data.
m_Player.GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"RightForeArmRoll");
813 }
814 }
815 }
816 }
817 }
818
820 {
821 return "Base_building";
822 }
823
825 {
826 BuildPartActionData action_data = new BuildPartActionData;
827 return action_data;
828 }
829
830
832 {
833 if (super.SetupAction(player, target, item, action_data, extra_data))
834 {
835 if (!
g_Game.IsDedicatedServer())
836 {
838 }
839
841 return true;
842 }
843
844 return false;
845 }
846
848 {
849 ConstructionActionData cad = action_data.m_Player.GetConstructionActionData();
851 BuildPartActionData.Cast(action_data).m_PartType = part.
GetPartName();
852 }
853
855 {
856 if (!item)
857 return;
858
859 switch (item.Type())
860 {
861 case Pickaxe:
862 case Shovel:
863 case FarmingHoe:
864 case FieldShovel:
866 break;
867 case Pliers:
869 break;
870 case SledgeHammer:
872 break;
873 case BrickTrowel:
875 break;
876 default:
878 break;
879 }
880 }
881
883 {
884 super.WriteToContext(ctx, action_data);
885
886 ctx.
Write(BuildPartActionData.Cast(action_data).m_PartType);
887 }
888
890 {
891 action_recive_data = new BuildPartActionReciveData;
892 super.ReadFromContext(ctx, action_recive_data);
893
894 string part_type;
895 if (ctx.
Read(part_type))
896 {
897 BuildPartActionReciveData.Cast(action_recive_data).m_PartType = part_type;
898 return true;
899 }
900 else
901 {
902 return false;
903 }
904 }
905
906 override void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
907 {
908 super.HandleReciveData(action_recive_data, action_data);
909
910 BuildPartActionData.Cast(action_data).m_PartType = BuildPartActionReciveData.Cast(action_recive_data).m_PartType;
911 }
912
914 {
915 string partName = BuildPartActionData.Cast(action_data).m_PartType;
916
917 string itemName = "hands";
919 itemName = action_data.
m_MainItem.GetDisplayName();
920
921 string message =
string.Format(
"Built %1 on %2 with %3", partName, action_data.
m_Target.GetObject().GetDisplayName(), itemName);
922 return message;
923 }
924
926 {
928 }
929
931 {
933
934 ActionInfoDataConstructionPossible info = ActionInfoDataConstructionPossible.Cast(
m_InfoData);
935 ConstructionActionData cad = player.GetConstructionActionData();
937 info.SetConstructionPart(part);
938 info.SetTool(item);
939
942
943 return info.CanDisplayInfo();
944 }
945
948 {
951 ConstructionActionData cad = player.GetConstructionActionData();
953
954 if (part)
955 {
957 if (!ent.IsPlayerInsideEx(player, part.
GetPartName()))
958 {
960 return false;
961 else if (!bbb)
962 return false;
963 }
964 if (!construction.ConstructionDirectionCheck(player, part, EConstructionDirCheckType.INDOORS))
965 return false;
966 if (!construction.ConstructionInsiderBoxCheck(player, part))
967 return false;
968
969 return true;
970 }
971 return false;
972 }
973
976 {
978 }
979
981
983 [
Obsolete(
"Use 'SetBuildingAnimationEx' instead")]
985 {
987 }
988}
989
991{
993 {
995 }
996
998 {
1001 }
1002
1004 {
1005 return false;
1006 }
1007
1009 {
1010 ConstructionActionData cad = player.GetConstructionActionData();
1012 if (part)
1013 {
1015 if (overrideText ==
string.
Empty)
1017 else
1019
1020 #ifdef DIAG_DEVELOPER
1021 if (DiagMenu.GetBool(
DiagMenuIDs.BASEBUILDING_FULLDEBUG))
1022 {
1024 }
1025 #endif
1026 }
1027 }
1028
1030 {
1031 #ifdef DIAG_DEVELOPER
1032 if (player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.INSTANT)
1033 return false;
1034 #endif
1035
1036 if (item)
1037 return false;
1038
1040 if (!Class.CastTo(ent,target.GetObject()))
1041 return false;
1042
1043 if (player.IsPlacingLocal() || player.IsPlacingServer())
1044 return false;
1045
1046
1047 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
1048 return false;
1049
1050 bool handConstructionCondition = ent.CanUseHandConstruction();
1051 #ifdef DIAG_DEVELOPER
1052 if (player.GetConstructionActionData().GetFastConstructionMode())
1053 handConstructionCondition = true;
1054 #endif
1055
1056 if (!ent.CanUseConstruction() || !ent.CanUseConstructionBuild() || !handConstructionCondition)
1057 return false;
1058
1059 if ((!
GetGame().IsDedicatedServer()))
1060 {
1062 return false;
1063
1064 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item,
m_VariantID))
1066
1067 return false;
1068 }
1069 return true;
1070 }
1071
1073 {
1076 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
1078
1079 check_data.m_PartName = part_name;
1081
1082 bool canBuild = construction.CanBuildPart(part_name, null, false);
1083 #ifdef DIAG_DEVELOPER
1084 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
1085 canBuild = true;
1086 #endif
1088 {
1089 bool collides = construction.IsCollidingEx(check_data);
1090
1091 return !collides && canBuild;
1092 }
1093 else
1094 {
1095 return canBuild;
1096 }
1097 }
1098
1100 {
1102
1103 ActionInfoDataConstructionPossible info = ActionInfoDataConstructionPossible.Cast(
m_InfoData);
1104 ConstructionActionData cad = player.GetConstructionActionData();
1106 info.SetConstructionPart(part);
1107 info.SetTool(item);
1108
1110
1111
1112
1113
1114
1115
1117
1118 return info.CanDisplayInfo();
1119 }
1120
1122 {
1123 ConstructionActionData cad = action_data.m_Player.GetConstructionActionData();
1125 }
1126
1129 {
1131 }
1132
1135 {
1136 if (item)
1137 return;
1138
1139 BuildPartActionData buildData;
1140 if (Class.CastTo(buildData, action_data))
1141 {
1144 ConstructionPart part = construction.GetConstructionPart(buildData.m_PartType);
1146
1147 if (animOverrideID >= 0)
1148 m_CommandUID = animOverrideID;
1149 else
1151 }
1152 }
1153}
1154
1155
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.