551 : ActionReciveData
552{
554}
555
557{
559};
560
562{
564 {
566 m_ActionData.m_ActionComponent =
new CAContinuousTime(time);
567 }
568
570 {
571 #ifdef DIAG_DEVELOPER
572 if (
m_ActionData.m_Player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.FAST)
573 return 1;
574 #endif
575
576 if (item)
577 return UATimeSpent.BASEBUILDING_CONSTRUCT_MEDIUM;
578 else
579 return UATimeSpent.BASEBUILDING_CONSTRUCT_SLOW;
580 }
581};
582
584{
586 {
591
595 }
596
598 {
601 }
602
604 {
605 ConstructionActionData cad = player.GetConstructionActionData();
607 if (part)
608 {
610 if (overrideText ==
string.
Empty)
612 else
614
615 #ifdef DIAG_DEVELOPER
616 if (DiagMenu.GetBool(
DiagMenuIDs.BASEBUILDING_FULLDEBUG))
617 {
619 }
620 #endif
621 }
622 }
623
625 {
626 m_InfoData =
new ActionInfoDataConstructionPossible();
627 }
628
630 {
631 return false;
632 }
633
635 {
636 return false;
637 }
638
640 {
641 #ifdef DIAG_DEVELOPER
642 if (player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.INSTANT)
643 return false;
644 #endif
645
647 if (!Class.CastTo(ent,target.GetObject()))
648 return false;
649
650 if (player.IsPlacingLocal() || player.IsPlacingServer())
651 return false;
652
653
654 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
655 return false;
656
657 if (!ent.CanUseConstruction() || !ent.CanUseConstructionBuild())
658 return false;
659
660 if ((!
GetGame().IsDedicatedServer()))
661 {
663 return false;
664
665 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item,
m_VariantID))
667
668 return false;
669 }
670 return true;
671 }
672
674 {
677 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
679
680 check_data.m_PartName = part_name;
682
683 bool canBuild = construction.CanBuildPart(part_name, action_data.
m_MainItem,
true);
684 #ifdef DIAG_DEVELOPER
685 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
686 canBuild = true;
687 #endif
689 {
690 bool collides = construction.IsCollidingEx(check_data);
691
692 return !collides && canBuild;
693 }
694 else
695 {
696 return canBuild;
697 }
698 }
699
701 {
704
705 string partName = BuildPartActionData.Cast(action_data).m_PartType;
708
709 checkData.m_PartName = partName;
711
713 #ifdef DIAG_DEVELOPER
714 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
715 canBuild = true;
716 #endif
717 if (!construction.IsCollidingEx(checkData) && canBuild)
718 {
719
721
722 #ifdef DIAG_DEVELOPER
723
724 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
725 return;
726 #endif
727
728
730 {
732 action_data.
m_MainItem.DecreaseHealth(UADamageApplied.BUILD,
false);
733 }
734 else
735 {
737 {
738 EntityAI gloves = action_data.
m_Player.GetInventory().FindAttachment(InventorySlots.GLOVES);
739 if (gloves && gloves.GetHealthLevel() < 4)
740 {
741 gloves.AddHealth("","", PlayerConstants.GLOVES_DAMAGE_HAND_CONSTRUCTION);
742 }
743 else if (Math.RandomFloat01() < PlayerConstants.CHANCE_TO_BLEED_HAND_CONSTRUCTION)
744 {
745 if (Math.RandomFloat01() < 0.5)
746 action_data.
m_Player.GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"LeftForeArmRoll");
747 else
748 action_data.
m_Player.GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"RightForeArmRoll");
750 }
751 }
752 }
753 }
754 }
755
757 {
758 return "Base_building";
759 }
760
762 {
763 BuildPartActionData action_data = new BuildPartActionData;
764 return action_data;
765 }
766
767
769 {
770 if (super.SetupAction(player, target, item, action_data, extra_data))
771 {
772 if (!
g_Game.IsDedicatedServer())
773 {
775 }
776
778 return true;
779 }
780
781 return false;
782 }
783
785 {
786 ConstructionActionData cad = action_data.m_Player.GetConstructionActionData();
788 BuildPartActionData.Cast(action_data).m_PartType = part.
GetPartName();
789 }
790
792 {
793 if (!item)
794 return;
795
796 switch (item.Type())
797 {
798 case Pickaxe:
799 case Shovel:
800 case FarmingHoe:
801 case FieldShovel:
803 break;
804 case Pliers:
806 break;
807 case SledgeHammer:
809 break;
810 case BrickTrowel:
812 break;
813 default:
815 break;
816 }
817 }
818
820 {
821 super.WriteToContext(ctx, action_data);
822
823 ctx.
Write(BuildPartActionData.Cast(action_data).m_PartType);
824 }
825
827 {
828 action_recive_data = new BuildPartActionReciveData;
829 super.ReadFromContext(ctx, action_recive_data);
830
831 string part_type;
832 if (ctx.
Read(part_type))
833 {
834 BuildPartActionReciveData.Cast(action_recive_data).m_PartType = part_type;
835 return true;
836 }
837 else
838 {
839 return false;
840 }
841 }
842
843 override void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
844 {
845 super.HandleReciveData(action_recive_data, action_data);
846
847 BuildPartActionData.Cast(action_data).m_PartType = BuildPartActionReciveData.Cast(action_recive_data).m_PartType;
848 }
849
851 {
852 string partName = BuildPartActionData.Cast(action_data).m_PartType;
853
854 string itemName = "hands";
856 itemName = action_data.
m_MainItem.GetDisplayName();
857
858 string message =
string.Format(
"Built %1 on %2 with %3", partName, action_data.
m_Target.GetObject().GetDisplayName(), itemName);
859 return message;
860 }
861
863 {
865 }
866
868 {
870
871 ActionInfoDataConstructionPossible info = ActionInfoDataConstructionPossible.Cast(
m_InfoData);
872 ConstructionActionData cad = player.GetConstructionActionData();
874 info.SetConstructionPart(part);
875 info.SetTool(item);
876
879
880 return info.CanDisplayInfo();
881 }
882
885 {
888 ConstructionActionData cad = player.GetConstructionActionData();
890
891 if (part)
892 {
894 if (!ent.IsPlayerInsideEx(player, part.
GetPartName()))
895 {
897 return false;
898 else if (!bbb)
899 return false;
900 }
901 if (!construction.ConstructionDirectionCheck(player, part, EConstructionDirCheckType.INDOORS))
902 return false;
903 if (!construction.ConstructionInsiderBoxCheck(player, part))
904 return false;
905
906 return true;
907 }
908 return false;
909 }
910
913 {
915 }
916
918
920 [
Obsolete(
"Use 'SetBuildingAnimationEx' instead")]
922 {
924 }
925}
926
928{
930 {
932 }
933
935 {
938 }
939
941 {
942 return false;
943 }
944
946 {
947 ConstructionActionData cad = player.GetConstructionActionData();
949 if (part)
950 {
952 if (overrideText ==
string.
Empty)
954 else
956
957 #ifdef DIAG_DEVELOPER
958 if (DiagMenu.GetBool(
DiagMenuIDs.BASEBUILDING_FULLDEBUG))
959 {
961 }
962 #endif
963 }
964 }
965
967 {
968 #ifdef DIAG_DEVELOPER
969 if (player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.INSTANT)
970 return false;
971 #endif
972
973 if (item)
974 return false;
975
977 if (!Class.CastTo(ent,target.GetObject()))
978 return false;
979
980 if (player.IsPlacingLocal() || player.IsPlacingServer())
981 return false;
982
983
984 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
985 return false;
986
987 bool handConstructionCondition = ent.CanUseHandConstruction();
988 #ifdef DIAG_DEVELOPER
989 if (player.GetConstructionActionData().GetFastConstructionMode())
990 handConstructionCondition = true;
991 #endif
992
993 if (!ent.CanUseConstruction() || !ent.CanUseConstructionBuild() || !handConstructionCondition)
994 return false;
995
996 if ((!
GetGame().IsDedicatedServer()))
997 {
999 return false;
1000
1001 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item,
m_VariantID))
1003
1004 return false;
1005 }
1006 return true;
1007 }
1008
1010 {
1013 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
1015
1016 check_data.m_PartName = part_name;
1018
1019 bool canBuild = construction.CanBuildPart(part_name, null, false);
1020 #ifdef DIAG_DEVELOPER
1021 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
1022 canBuild = true;
1023 #endif
1025 {
1026 bool collides = construction.IsCollidingEx(check_data);
1027
1028 return !collides && canBuild;
1029 }
1030 else
1031 {
1032 return canBuild;
1033 }
1034 }
1035
1037 {
1039
1040 ActionInfoDataConstructionPossible info = ActionInfoDataConstructionPossible.Cast(
m_InfoData);
1041 ConstructionActionData cad = player.GetConstructionActionData();
1043 info.SetConstructionPart(part);
1044 info.SetTool(item);
1045
1047
1048
1049
1050
1051
1052
1054
1055 return info.CanDisplayInfo();
1056 }
1057
1059 {
1060 ConstructionActionData cad = action_data.m_Player.GetConstructionActionData();
1062 }
1063
1066 {
1068 }
1069
1072 {
1073 if (item)
1074 return;
1075
1076 BuildPartActionData buildData;
1077 if (Class.CastTo(buildData, action_data))
1078 {
1081 ConstructionPart part = construction.GetConstructionPart(buildData.m_PartType);
1083
1084 if (animOverrideID >= 0)
1085 m_CommandUID = animOverrideID;
1086 else
1088 }
1089 }
1090}
1091
1092
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.