32 if (
Class.
CastTo(targetIB, target.GetObject()) && targetIB.CanBeDigged())
34 if (player.IsPlacingLocal())
39 if (targetIB.IsRuined() || targetIB.GetInventory().IsAttachment())
44 if (targetIB.GetInventory().IsAttachment())
49 if (targetIB.IsInherited(UndergroundStash))
56 if (targetIB.GetInventory().IsInCargo());
57 entityToCheck = player;
61 excludedObjects.Insert(targetIB);
64 if (
GetGame().IsBoxColliding(entityToCheck.GetPosition(), entityToCheck.GetOrientation(),
"2 2 2", excludedObjects, nearbyObjects))
66 for (
int i = 0; i < nearbyObjects.Count(); i++)
68 if (nearbyObjects[i].IsInherited(UndergroundStash))
80 if (!
GetGame().IsSurfaceDigable(surfaceType))
87 vector position = entityToCheck.GetPosition();
90 positions.Insert(position +
"0.5 0 0.5");
91 positions.Insert(position +
"-0.5 0 0.5");
92 positions.Insert(position +
"0.5 0 -0.5");
93 positions.Insert(position +
"-0.5 0 -0.5");
106 super.OnExecuteClient(action_data);
113 super.OnExecuteServer(action_data);
115 if (!
GetGame().IsMultiplayer())
131 ErrorEx(
"Cannot get entity=" + targetEntity);
136 if (!targetEntity.GetInventory().GetCurrentInventoryLocation(targetIL))
138 ErrorEx(
"Cannot get inventory location of entity=" + targetEntity);
142 UndergroundStash stash = UndergroundStash.Cast(
GetGame().CreateObjectEx(
"UndergroundStash", targetEntity.GetPosition(),
ECE_PLACE_ON_SURFACE));
145 stash.PlaceOnGround();
148 action_data.
m_Player.ServerTakeEntityToTargetCargo(stash, targetEntity);
161 MiscGameplayFunctions.DealAbsoluteDmg(action_data.
m_MainItem, 10);
167 return string.
Format(
"Player %1 Dug in %2 at position %3", action_data.
m_Player, action_data.
m_Target.GetObject(), action_data.
m_Target.GetObject().GetPosition());
protected float m_SpecialtyWeight
ref CCIBase m_ConditionItem
ref CCTBase m_ConditionTarget
protected bool m_FullBody
protected int m_StanceMask
class ActionTargets ActionTarget
const int ECE_PLACE_ON_SURFACE
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
protected ActionData m_ActionData
ref CABase m_ActionComponent
ref ActionTarget m_Target
override void CreateActionComponent()
override void OnFinishProgressServer(ActionData action_data)
override void OnExecuteServer(ActionData action_data)
override string GetAdminLogMessage(ActionData action_data)
override void CreateConditionComponents()
override void OnExecuteClient(ActionData action_data)
void SpawnParticleShovelRaise(ActionData action_data)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
static float m_DigStashSlopeTolerance
protected int m_CommandUID
protected m_CallbackClass
proto void SurfaceUnderObject(notnull Object object, out string type, out int liquidType)
float GetHighestSurfaceYDifference(array< vector > positions)
Returns the largest height difference between the given positions.
Super root of all classes in Enforce script.
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
script counterpart to engine's class Inventory
static proto native bool LocationCanRemoveEntity(notnull InventoryLocation inv_loc)
queries if the entity contained in inv_loc.m_item can be removed from ground/attachment/cargo/hands/....
static string DumpToStringNullSafe(InventoryLocation loc)
static const int DIGGING_STASH
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
DayZPlayerConstants
defined in C++
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.