563 : ActionReciveData
564{
566}
567
569{
571};
572
574{
576 {
578 m_ActionData.m_ActionComponent =
new CAContinuousTime(time);
579 }
580
582 {
583 #ifdef DIAG_DEVELOPER
584 if (
m_ActionData.m_Player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.FAST)
585 return 1;
586 #endif
587
588 if (item)
589 return UATimeSpent.BASEBUILDING_CONSTRUCT_MEDIUM;
590 else
591 return UATimeSpent.BASEBUILDING_CONSTRUCT_SLOW;
592 }
593};
594
596{
598 {
603
607 }
608
610 {
613 }
614
616 {
617 ConstructionActionData cad = player.GetConstructionActionData();
619 if (part)
620 {
622 if (overrideText ==
string.
Empty)
624 else
626
627 #ifdef DIAG_DEVELOPER
628 if (DiagMenu.GetBool(
DiagMenuIDs.BASEBUILDING_FULLDEBUG))
629 {
631 }
632 #endif
633 }
634 }
635
637 {
638 m_InfoData =
new ActionInfoDataConstructionPossible();
639 }
640
642 {
643 return false;
644 }
645
647 {
648 return false;
649 }
650
652 {
653 #ifdef DIAG_DEVELOPER
654 if (player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.INSTANT)
655 return false;
656 #endif
657
659 if (!Class.CastTo(ent,target.GetObject()))
660 return false;
661
662 if (player.IsPlacingLocal() || player.IsPlacingServer())
663 return false;
664
665
666 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
667 return false;
668
669 if (!ent.CanUseConstruction() || !ent.CanUseConstructionBuild())
670 return false;
671
672 if ((!
GetGame().IsDedicatedServer()))
673 {
675 return false;
676
677 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item,
m_VariantID))
679
680 return false;
681 }
682 return true;
683 }
684
686 {
689 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
691
692 check_data.m_PartName = part_name;
694
695 bool canBuild = construction.CanBuildPart(part_name, action_data.
m_MainItem,
true);
696 #ifdef DIAG_DEVELOPER
697 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
698 canBuild = true;
699 #endif
701 {
702 bool collides = construction.IsCollidingEx(check_data);
703
704 return !collides && canBuild;
705 }
706 else
707 {
708 return canBuild;
709 }
710 }
711
713 {
716
717 string partName = BuildPartActionData.Cast(action_data).m_PartType;
720
721 checkData.m_PartName = partName;
723
725 #ifdef DIAG_DEVELOPER
726 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
727 canBuild = true;
728 #endif
729 if (!construction.IsCollidingEx(checkData) && canBuild)
730 {
731
733
734 #ifdef DIAG_DEVELOPER
735
736 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
737 return;
738 #endif
739
740
742 {
744 action_data.
m_MainItem.DecreaseHealth(UADamageApplied.BUILD,
false);
745 }
746 else
747 {
749 {
750 EntityAI gloves = action_data.
m_Player.GetInventory().FindAttachment(InventorySlots.GLOVES);
751 if (gloves && gloves.GetHealthLevel() < 4)
752 {
753 gloves.AddHealth("","", PlayerConstants.GLOVES_DAMAGE_HAND_CONSTRUCTION);
754 }
755 else if (Math.RandomFloat01() < PlayerConstants.CHANCE_TO_BLEED_HAND_CONSTRUCTION)
756 {
757 if (Math.RandomFloat01() < 0.5)
758 action_data.
m_Player.GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"LeftForeArmRoll");
759 else
760 action_data.
m_Player.GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"RightForeArmRoll");
762 }
763 }
764 }
765 }
766 }
767
769 {
770 return "Base_building";
771 }
772
774 {
775 BuildPartActionData action_data = new BuildPartActionData;
776 return action_data;
777 }
778
779
781 {
782 if (super.SetupAction(player, target, item, action_data, extra_data))
783 {
784 if (!
g_Game.IsDedicatedServer())
785 {
787 }
788
790 return true;
791 }
792
793 return false;
794 }
795
797 {
798 ConstructionActionData cad = action_data.m_Player.GetConstructionActionData();
800 BuildPartActionData.Cast(action_data).m_PartType = part.
GetPartName();
801 }
802
804 {
805 if (!item)
806 return;
807
808 switch (item.Type())
809 {
810 case Pickaxe:
811 case Shovel:
812 case FarmingHoe:
813 case FieldShovel:
815 break;
816 case Pliers:
818 break;
819 case SledgeHammer:
821 break;
822 case BrickTrowel:
824 break;
825 default:
827 break;
828 }
829 }
830
832 {
833 super.WriteToContext(ctx, action_data);
834
835 ctx.
Write(BuildPartActionData.Cast(action_data).m_PartType);
836 }
837
839 {
840 action_recive_data = new BuildPartActionReciveData;
841 super.ReadFromContext(ctx, action_recive_data);
842
843 string part_type;
844 if (ctx.
Read(part_type))
845 {
846 BuildPartActionReciveData.Cast(action_recive_data).m_PartType = part_type;
847 return true;
848 }
849 else
850 {
851 return false;
852 }
853 }
854
855 override void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
856 {
857 super.HandleReciveData(action_recive_data, action_data);
858
859 BuildPartActionData.Cast(action_data).m_PartType = BuildPartActionReciveData.Cast(action_recive_data).m_PartType;
860 }
861
863 {
864 string partName = BuildPartActionData.Cast(action_data).m_PartType;
865
866 string itemName = "hands";
868 itemName = action_data.
m_MainItem.GetDisplayName();
869
870 string message =
string.Format(
"Built %1 on %2 with %3", partName, action_data.
m_Target.GetObject().GetDisplayName(), itemName);
871 return message;
872 }
873
875 {
877 }
878
880 {
882
883 ActionInfoDataConstructionPossible info = ActionInfoDataConstructionPossible.Cast(
m_InfoData);
884 ConstructionActionData cad = player.GetConstructionActionData();
886 info.SetConstructionPart(part);
887 info.SetTool(item);
888
891
892 return info.CanDisplayInfo();
893 }
894
897 {
900 ConstructionActionData cad = player.GetConstructionActionData();
902
903 if (part)
904 {
906 if (!ent.IsPlayerInsideEx(player, part.
GetPartName()))
907 {
909 return false;
910 else if (!bbb)
911 return false;
912 }
913 if (!construction.ConstructionDirectionCheck(player, part, EConstructionDirCheckType.INDOORS))
914 return false;
915 if (!construction.ConstructionInsiderBoxCheck(player, part))
916 return false;
917
918 return true;
919 }
920 return false;
921 }
922
925 {
927 }
928
930
932 [
Obsolete(
"Use 'SetBuildingAnimationEx' instead")]
934 {
936 }
937}
938
940{
942 {
944 }
945
947 {
950 }
951
953 {
954 return false;
955 }
956
958 {
959 ConstructionActionData cad = player.GetConstructionActionData();
961 if (part)
962 {
964 if (overrideText ==
string.
Empty)
966 else
968
969 #ifdef DIAG_DEVELOPER
970 if (DiagMenu.GetBool(
DiagMenuIDs.BASEBUILDING_FULLDEBUG))
971 {
973 }
974 #endif
975 }
976 }
977
979 {
980 #ifdef DIAG_DEVELOPER
981 if (player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.INSTANT)
982 return false;
983 #endif
984
985 if (item)
986 return false;
987
989 if (!Class.CastTo(ent,target.GetObject()))
990 return false;
991
992 if (player.IsPlacingLocal() || player.IsPlacingServer())
993 return false;
994
995
996 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
997 return false;
998
999 bool handConstructionCondition = ent.CanUseHandConstruction();
1000 #ifdef DIAG_DEVELOPER
1001 if (player.GetConstructionActionData().GetFastConstructionMode())
1002 handConstructionCondition = true;
1003 #endif
1004
1005 if (!ent.CanUseConstruction() || !ent.CanUseConstructionBuild() || !handConstructionCondition)
1006 return false;
1007
1008 if ((!
GetGame().IsDedicatedServer()))
1009 {
1011 return false;
1012
1013 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item,
m_VariantID))
1015
1016 return false;
1017 }
1018 return true;
1019 }
1020
1022 {
1025 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
1027
1028 check_data.m_PartName = part_name;
1030
1031 bool canBuild = construction.CanBuildPart(part_name, null, false);
1032 #ifdef DIAG_DEVELOPER
1033 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
1034 canBuild = true;
1035 #endif
1037 {
1038 bool collides = construction.IsCollidingEx(check_data);
1039
1040 return !collides && canBuild;
1041 }
1042 else
1043 {
1044 return canBuild;
1045 }
1046 }
1047
1049 {
1051
1052 ActionInfoDataConstructionPossible info = ActionInfoDataConstructionPossible.Cast(
m_InfoData);
1053 ConstructionActionData cad = player.GetConstructionActionData();
1055 info.SetConstructionPart(part);
1056 info.SetTool(item);
1057
1059
1060
1061
1062
1063
1064
1066
1067 return info.CanDisplayInfo();
1068 }
1069
1071 {
1072 ConstructionActionData cad = action_data.m_Player.GetConstructionActionData();
1074 }
1075
1078 {
1080 }
1081
1084 {
1085 if (item)
1086 return;
1087
1088 BuildPartActionData buildData;
1089 if (Class.CastTo(buildData, action_data))
1090 {
1093 ConstructionPart part = construction.GetConstructionPart(buildData.m_PartType);
1095
1096 if (animOverrideID >= 0)
1097 m_CommandUID = animOverrideID;
1098 else
1100 }
1101 }
1102}
1103
1104
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.