31 if (!super.Can(player, target, item, condition_mask))
40 if (
Class.
CastTo(targetIB, target.GetObject()) && targetIB.CanBeDigged())
42 if (player.IsPlacingLocal())
47 if (targetIB.IsRuined() || targetIB.GetInventory().IsAttachment())
52 if (targetIB.GetInventory().IsAttachment())
57 if (targetIB.IsInherited(UndergroundStash))
64 if (targetIB.GetInventory().IsInCargo())
65 entityToCheck = player;
69 excludedObjects.Insert(targetIB);
72 if (
g_Game.IsBoxColliding(entityToCheck.GetPosition(), entityToCheck.GetOrientation(),
"2 2 2", excludedObjects, nearbyObjects))
74 foreach (
Object nearbyObject : nearbyObjects)
76 if (nearbyObject.IsInherited(UndergroundStash))
84 g_Game.SurfaceUnderObject(entityToCheck, surfaceType, liquidType);
85 if (!
g_Game.IsSurfaceDigable(surfaceType))
92 vector position = entityToCheck.GetPosition();
95 positions.Insert(position +
"0.5 0 0.5");
96 positions.Insert(position +
"-0.5 0 0.5");
97 positions.Insert(position +
"0.5 0 -0.5");
98 positions.Insert(position +
"-0.5 0 -0.5");
100 float difference =
g_Game.GetHighestSurfaceYDifference(positions);
111 super.OnExecuteClient(action_data);
118 super.OnExecuteServer(action_data);
120 if (!
g_Game.IsMultiplayer())
136 ErrorEx(
"Cannot get entity=" + targetEntity);
141 if (!targetEntity.GetInventory().GetCurrentInventoryLocation(targetIL))
143 ErrorEx(
"Cannot get inventory location of entity=" + targetEntity);
147 EntityAI entityToCheck = targetEntity;
148 if (targetEntity.GetInventory().IsInCargo())
149 entityToCheck = action_data.m_Player;
153 g_Game.SurfaceUnderObject(entityToCheck, surfaceType, liquidType);
154 string undergroundStashType;
156 g_Game.GetSurfaceDigPile(surfaceType, undergroundStashType);
158 if (undergroundStashType ==
"")
159 undergroundStashType =
"UndergroundStash";
161 UndergroundStash stash = UndergroundStash.Cast(
g_Game.CreateObjectEx(undergroundStashType, targetEntity.GetPosition(),
ECE_PLACE_ON_SURFACE));
165 stash.PlaceOnGround();
167 stash.GetInventory().GetCurrentInventoryLocation(ilj);
171 if (!
g_Game.IsMultiplayer())
174 action_data.m_Player.LocalTakeEntityToTargetCargo(stash, targetEntity);
177 action_data.m_Player.ServerTakeEntityToTargetCargo(stash, targetEntity);
190 MiscGameplayFunctions.DealEvinronmentAdjustedDmg(action_data.m_MainItem, action_data.m_Player, 10);
195 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());
class ActionTargets ActionTarget
const int ECE_PLACE_ON_SURFACE
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
void ClearActionJuncture(ActionData action_data)
ref CCIBase m_ConditionItem
void ClearInventoryReservationEx(ActionData action_data)
ref CCTBase m_ConditionTarget
void ActionContinuousBase()
override void OnExecuteServer(ActionData action_data)
void SpawnParticleShovelRaise(ActionData action_data)
override void CreateConditionComponents()
override void OnFinishProgressServer(ActionData action_data)
override void OnExecuteClient(ActionData action_data)
static float m_DigStashSlopeTolerance
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override string GetAdminLogMessage(ActionData action_data)
override bool Can(PlayerBase player, ActionTarget target, ItemBase item, int condition_mask)
override void CreateActionComponent()
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.
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/....
script counterpart to engine's class Inventory
static string DumpToStringNullSafe(InventoryLocation loc)
static const int DIGGING_STASH
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static const vector Forward
DayZPlayerConstants
defined in C++
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.