DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс ActionDigInStash
+ Граф наследования:ActionDigInStash:

Закрытые члены

void ActionDigInStash ()
 
override void CreateConditionComponents ()
 
override bool Can (PlayerBase player, ActionTarget target, ItemBase item, int condition_mask)
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnExecuteClient (ActionData action_data)
 
override void OnExecuteServer (ActionData action_data)
 
void SpawnParticleShovelRaise (ActionData action_data)
 
override void OnFinishProgressServer (ActionData action_data)
 
override string GetAdminLogMessage (ActionData action_data)
 
- Закрытые члены унаследованные от ActionContinuousBase
void OnStartAnimationLoopServer (ActionData action_data)
 
void OnStartAnimationLoopClient (ActionData action_data)
 
void OnEndAnimationLoopServer (ActionData action_data)
 
void OnEndAnimationLoopClient (ActionData action_data)
 
void OnFinishProgressServer (ActionData action_data)
 
void OnFinishProgressClient (ActionData action_data)
 

Закрытые статические данные

static float m_DigStashSlopeTolerance = 0.6
 

Подробное описание

Конструктор(ы)

◆ ActionDigInStash()

void ActionDigInStash ( )
inlineprivate
14 {
16 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DIGMANIPULATE;
17 m_FullBody = true;
18 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
20 m_Text = "#bury";
21 }
bool m_FullBody
Definition ActionBase.c:61
string m_Text
Definition ActionBase.c:58
float m_SpecialtyWeight
Definition ActionBase.c:77
int m_StanceMask
Definition ActionBase.c:62
Definition ActionDigInStash.c:2
int m_CommandUID
Definition AnimatedActionBase.c:143
m_CallbackClass
Definition AnimatedActionBase.c:145
Definition EntityAI.c:95
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

Перекрестные ссылки AnimatedActionBase::m_CallbackClass, AnimatedActionBase::m_CommandUID, ActionBase::m_FullBody, ActionBase::m_SpecialtyWeight, ActionBase::m_StanceMask и ActionBase::m_Text.

Методы

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

was initialized from inventory?

Check slope angle

38 {
40 if (Class.CastTo(targetIB, target.GetObject()) && targetIB.CanBeDigged())
41 {
42 if (player.IsPlacingLocal())
43 {
44 return false;
45 }
46
47 if (targetIB.IsRuined() || targetIB.GetInventory().IsAttachment())
48 {
49 return false;
50 }
51
52 if (targetIB.GetInventory().IsAttachment())
53 {
54 return false;
55 }
56
57 if (targetIB.IsInherited(UndergroundStash))
58 {
59 return false;
60 }
61
64 if (targetIB.GetInventory().IsInCargo())
66
67 // here we check if a stash is nearby and block digging a new one in close proximity
71 // For now we exclude an area of 2 X 2 X 2 meters
72 if (GetGame().IsBoxColliding(entityToCheck.GetPosition(), entityToCheck.GetOrientation(), "2 2 2", excludedObjects, nearbyObjects))
73 {
75 {
76 if (nearbyObject.IsInherited(UndergroundStash))
77 return false;
78 }
79 }
80
81 // Check surface
82 int liquidType;
83 string surfaceType;
84 GetGame().SurfaceUnderObject(entityToCheck, surfaceType, liquidType);
85 if (!GetGame().IsSurfaceDigable(surfaceType))
86 {
87 return false;
88 }
89 else
90 {
92 vector position = entityToCheck.GetPosition();
93
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");
99
100 float difference = GetGame().GetHighestSurfaceYDifference(positions);
101
103 }
104 }
105
106 return false;
107 }
static float m_DigStashSlopeTolerance
Definition ActionDigInStash.c:11
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition Building.c:6
Definition InventoryItem.c:731
Definition ObjectTyped.c:2
Definition EnConvert.c:106
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo(), GetGame() и m_DigStashSlopeTolerance.

◆ Can()

override bool Can ( PlayerBase player,
ActionTarget target,
ItemBase item,
int condition_mask )
inlineprivate
30 {
32 return false;
33
34 return player.CheckFreeSpace(vector.Forward, 1.0, false);
35 }
static const vector Forward
Definition EnConvert.c:109

Перекрестные ссылки vector::Forward.

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
inlineprivate
24 {
27 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:64
ref CCTBase m_ConditionTarget
Definition ActionBase.c:65
Definition CCINonRuined.c:2
Definition CCTObject.c:2
Definition ActionConstants.c:106
const float DEFAULT
Definition ActionConstants.c:108

Перекрестные ссылки UAMaxDistances::DEFAULT, ActionBase::m_ConditionItem и ActionBase::m_ConditionTarget.

◆ GetAdminLogMessage()

override string GetAdminLogMessage ( ActionData action_data)
inlineprivate
197 {
198 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());
199 }

◆ OnExecuteClient()

override void OnExecuteClient ( ActionData action_data)
inlineprivate
110 {
111 super.OnExecuteClient(action_data);
112
114 }
void SpawnParticleShovelRaise(ActionData action_data)
Definition ActionDigInStash.c:126

Перекрестные ссылки SpawnParticleShovelRaise().

◆ OnExecuteServer()

override void OnExecuteServer ( ActionData action_data)
inlineprivate
117 {
118 super.OnExecuteServer(action_data);
119
120 if (!GetGame().IsMultiplayer())
121 {
123 }
124 }

Перекрестные ссылки GetGame() и SpawnParticleShovelRaise().

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)
inlineprivate
132 {
133 EntityAI targetEntity = EntityAI.Cast(action_data.m_Target.GetObject());
134 if (!targetEntity)
135 {
136 ErrorEx("Cannot get entity=" + targetEntity);
137 return;
138 }
139
141 if (!targetEntity.GetInventory().GetCurrentInventoryLocation(targetIL))
142 {
143 ErrorEx("Cannot get inventory location of entity=" + targetEntity);
144 return;
145 }
146
148 if (targetEntity.GetInventory().IsInCargo())
149 entityToCheck = action_data.m_Player;
150
151 int liquidType;
152 string surfaceType;
153 GetGame().SurfaceUnderObject(entityToCheck, surfaceType, liquidType);
155
156 GetGame().GetSurfaceDigPile(surfaceType, undergroundStashType);
157
158 if (undergroundStashType == "")
159 undergroundStashType = "UndergroundStash";
160
161 UndergroundStash stash = UndergroundStash.Cast(GetGame().CreateObjectEx(undergroundStashType, targetEntity.GetPosition(), ECE_PLACE_ON_SURFACE));
162 if (stash)
163 {
165 stash.PlaceOnGround();
167 stash.GetInventory().GetCurrentInventoryLocation(ilj);
168
170 {
171 GetGame().AddInventoryJunctureEx(action_data.m_Player, targetEntity, ilj, true, 10000);
172 GetGame().ClearJunctureEx(action_data.m_Player, targetEntity);
173
174 if (!GetGame().IsMultiplayer())
175 {
177 action_data.m_Player.LocalTakeEntityToTargetCargo(stash, targetEntity);
178 }
179 else
180 action_data.m_Player.ServerTakeEntityToTargetCargo(stash, targetEntity);
181 }
182 else
183 {
184 Debug.Log(string.Format("Cannot remove entity=%1 obj from current location=%2", targetEntity, InventoryLocation.DumpToStringNullSafe(targetIL)));
185 }
186 }
187 else
188 {
189 ErrorEx("Stash not spawned!");
190 }
191
192 //Apply tool damage
193 MiscGameplayFunctions.DealEvinronmentAdjustedDmg(action_data.m_MainItem, action_data.m_Player, 10);
194 }
const int ECE_PLACE_ON_SURFACE
Definition CentralEconomy.c:37
void ClearInventoryReservationEx(ActionData action_data)
Definition ActionBase.c:921
void ClearActionJuncture(ActionData action_data)
Definition ActionBase.c:979
Definition Debug.c:14
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.
Definition Debug.c:136
script counterpart to engine's class Inventory
Definition Inventory.c:79
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/....
InventoryLocation.
Definition InventoryLocation.c:29
static string DumpToStringNullSafe(InventoryLocation loc)
Definition InventoryLocation.c:226
enum ShapeType ErrorEx

Перекрестные ссылки ActionBase::ClearActionJuncture(), ActionBase::ClearInventoryReservationEx(), InventoryLocation::DumpToStringNullSafe(), ECE_PLACE_ON_SURFACE, ErrorEx, GetGame(), GameInventory::LocationCanRemoveEntity() и Debug::Log().

◆ SpawnParticleShovelRaise()

void SpawnParticleShovelRaise ( ActionData action_data)
inlineprivate
127 {
128 ParticleManager.GetInstance().PlayOnObject(ParticleList.DIGGING_STASH, action_data.m_Player);
129 }
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Definition ParticleManager.c:84
Definition ParticleList.c:12
static const int DIGGING_STASH
Definition ParticleList.c:96

Перекрестные ссылки ParticleList::DIGGING_STASH и ParticleManager().

Используется в OnExecuteClient() и OnExecuteServer().

Поля

◆ m_DigStashSlopeTolerance

float m_DigStashSlopeTolerance = 0.6
staticprivate

Используется в ActionCondition().


Объявления и описания членов класса находятся в файле: