22 if (
m_ActionData.m_Player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.FAST)
60 if (overrideText ==
string.
Empty)
92 if (player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.INSTANT)
100 if (player.IsPlacingLocal() || player.IsPlacingServer())
104 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
107 if (!ent.CanUseConstruction() || !ent.CanUseConstructionBuild())
110 if ((!
GetGame().IsDedicatedServer()))
115 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item,
m_VariantID))
127 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
130 check_data.m_PartName = part_name;
133 bool canBuild = construction.CanBuildPart(part_name, action_data.
m_MainItem,
true);
134 #ifdef DIAG_DEVELOPER
135 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
140 bool collides = construction.IsCollidingEx(check_data);
142 return !collides && canBuild;
155 string partName = BuildPartActionData.Cast(action_data).m_PartType;
159 checkData.m_PartName = partName;
163 #ifdef DIAG_DEVELOPER
164 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
167 if (!construction.IsCollidingEx(checkData) && canBuild)
172 #ifdef DIAG_DEVELOPER
174 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
189 if (gloves && gloves.GetHealthLevel() < 4)
196 action_data.
m_Player.GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"LeftForeArmRoll");
198 action_data.
m_Player.GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"RightForeArmRoll");
208 return "Base_building";
213 BuildPartActionData action_data =
new BuildPartActionData;
220 if (super.SetupAction(player, target, item, action_data, extra_data))
222 if (!
g_Game.IsDedicatedServer())
238 BuildPartActionData.Cast(action_data).m_PartType = part.
GetPartName();
271 super.WriteToContext(ctx, action_data);
273 ctx.
Write(BuildPartActionData.Cast(action_data).m_PartType);
279 super.ReadFromContext(ctx, action_recive_data);
282 if (ctx.
Read(part_type))
295 super.HandleReciveData(action_recive_data, action_data);
302 string partName = BuildPartActionData.Cast(action_data).m_PartType;
304 string itemName =
"hands";
306 itemName = action_data.
m_MainItem.GetDisplayName();
308 string message =
string.Format(
"Built %1 on %2 with %3", partName, action_data.
m_Target.GetObject().GetDisplayName(), itemName);
324 info.SetConstructionPart(part);
330 return info.CanDisplayInfo();
344 if (!ent.IsPlayerInsideEx(player, part.
GetPartName()))
351 if (!construction.ConstructionDirectionCheck(player, part, EConstructionDirCheckType.INDOORS))
353 if (!construction.ConstructionInsiderBoxCheck(player, part))
370 [
Obsolete(
"Use 'SetBuildingAnimationEx' instead")]
397 ConstructionActionData cad = player.GetConstructionActionData();
402 if (overrideText ==
string.
Empty)
407 #ifdef DIAG_DEVELOPER
418 #ifdef DIAG_DEVELOPER
419 if (player.GetConstructionActionData().GetFastConstructionMode() == EConstructionDebugModes.INSTANT)
430 if (player.IsPlacingLocal() || player.IsPlacingServer())
437 bool handConstructionCondition = ent.CanUseHandConstruction();
438 #ifdef DIAG_DEVELOPER
439 if (player.GetConstructionActionData().GetFastConstructionMode())
440 handConstructionCondition =
true;
443 if (!ent.CanUseConstruction() || !ent.CanUseConstructionBuild() || !handConstructionCondition)
446 if ((!
GetGame().IsDedicatedServer()))
451 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item,
m_VariantID))
463 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
466 check_data.m_PartName = part_name;
469 bool canBuild = construction.CanBuildPart(part_name, null,
false);
470 #ifdef DIAG_DEVELOPER
471 if (action_data.
m_Player.GetConstructionActionData().GetFastConstructionMode())
476 bool collides = construction.IsCollidingEx(check_data);
478 return !collides && canBuild;
490 ActionInfoDataConstructionPossible info = ActionInfoDataConstructionPossible.Cast(
m_InfoData);
491 ConstructionActionData cad = player.GetConstructionActionData();
493 info.SetConstructionPart(part);
505 return info.CanDisplayInfo();
510 ConstructionActionData cad = action_data.m_Player.GetConstructionActionData();
526 BuildPartActionData buildData;
527 if (Class.CastTo(buildData, action_data))
531 ConstructionPart part = construction.GetConstructionPart(buildData.m_PartType);
534 if (animOverrideID >= 0)
535 m_CommandUID = animOverrideID;
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()
void ActionContinuousBase()
ref ActionTarget m_Target
override bool MustBeBuiltFromOutside()
Super root of all classes in Enforce script.
ConstructionPart GetBuildPartHandsGenericAtIndex(int idx)
ConstructionPart GetBuildPartAtIndex(int idx)
int GetHandBuildFBAnimOverride()
string GetBuildTextOverride()
bool DamageHandsOnBuild()
Instanced construction part data classes for dynamic data, statics now stored on EntityType level in ...
provides access to slot configuration
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
static const float CHANCE_TO_BLEED_HAND_CONSTRUCTION
static const float GLOVES_DAMAGE_HAND_CONSTRUCTION
proto bool Write(void value_out)
proto bool Read(void value_in)
const float BASEBUILDING_CONSTRUCT_SLOW
const float BASEBUILDING_CONSTRUCT_MEDIUM
DayZPlayerConstants
defined in C++
Serializer ParamsReadContext
Serializer ParamsWriteContext
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
void Obsolete(string msg="")
static float RandomFloat01()
Returns a random float number between and min [inclusive] and max [inclusive].
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.