DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Файл ActionDigOutStash.c

См. исходные тексты.

Структуры данных

class  ActionDigOutStashCB
 
class  DigOutStashLambda
 

Функции

ActionDigOutStashCB ActionContinuousBaseCB ActionDigOutStash ()
 
override void CreateActionComponent ()
 
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)
 

Функции

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
37 {
39 if (Class.CastTo(target_IB, target.GetObject()))
40 {
41 if (target_IB.CanBeDigged())
42 {
43 return target_IB.IsInherited(UndergroundStash);
44 }
45 }
46
47 return false;
48 }
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition InventoryItem.c:731
Definition EntityAI.c:95
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

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

◆ ActionDigOutStash()

12 {
13 m_CallbackClass = ActionDigOutStashCB;
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DIGUPCACHE;
15 m_FullBody = true;
16 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
17 m_SpecialtyWeight = UASoftSkillsWeight.ROUGH_LOW;
18 m_Text = "#dig_stash";
19 }
int m_CommandUID
Definition ActionBase.c:31
int m_StanceMask
Definition ActionBase.c:33
Definition ActionDigOutStash.c:2
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

Используется в ActionConstructor::RegisterActions(), ItemBase::SetActions() и FarmingHoe::SetActions().

◆ Can()

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

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

◆ CreateActionComponent()

override void CreateActionComponent ( )
12 {
13 m_CallbackClass = ActionDigOutStashCB;
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DIGUPCACHE;
15 m_FullBody = true;

Перекрестные ссылки m_CommandUID и m_StanceMask.

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
22 {
23 m_ConditionTarget = new CCTObject(UAMaxDistances.DEFAULT);
24 m_ConditionItem = new CCINonRuined();
25 }
Definition CCINonRuined.c:2
Definition CCTObject.c:2
Definition ActionConstants.c:106
const float DEFAULT
Definition ActionConstants.c:108

Перекрестные ссылки UAMaxDistances::DEFAULT.

◆ GetAdminLogMessage()

override string GetAdminLogMessage ( ActionData action_data)
107 {
108 return string.Format("Player %1 Dug out %2 at position %3", action_data.m_Player, action_data.m_Target.GetObject(), action_data.m_Target.GetObject().GetPosition());
109 }

Перекрестные ссылки string::Format().

◆ OnExecuteClient()

override void OnExecuteClient ( ActionData action_data)
51 {
52 super.OnExecuteClient(action_data);
53
55 }
void SpawnParticleShovelRaise(ActionData action_data)
Definition ActionDigOutStash.c:67

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

◆ OnExecuteServer()

override void OnExecuteServer ( ActionData action_data)
58 {
59 super.OnExecuteServer(action_data);
60
61 if (!GetGame().IsMultiplayer())
62 {
64 }
65 }
proto native CGame GetGame()

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

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)
73 {
74 EntityAI targetEntity = EntityAI.Cast(action_data.m_Target.GetObject());
75 if (!targetEntity)
76 {
77 ErrorEx("Cannot get entity=" + targetEntity);
78 return;
79 }
80
82 if (!targetEntity.GetInventory().GetCurrentInventoryLocation(target_IL))
83 {
84 ErrorEx("Cannot get inventory location of entity=" + targetEntity);
85 return;
86 }
87
88 // Dig out of stash
89 UndergroundStash stash;
91 {
92 ItemBase stashedItem = stash.GetStashedItem();
93 if (stashedItem)
94 {
96 action_data.m_Player.ServerReplaceItemWithNew(lambda);
97 }
98 else
99 g_Game.ObjectDelete(stash);
100 }
101
102 //Apply tool damage
103 MiscGameplayFunctions.DealEvinronmentAdjustedDmg(action_data.m_MainItem, action_data.m_Player, 10);
104 }
DayZGame g_Game
Definition DayZGame.c:3815
Definition ActionDigOutStash.c:113
Definition Building.c:6
InventoryLocation.
Definition InventoryLocation.c:29
enum ShapeType ErrorEx

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

◆ SpawnParticleShovelRaise()

void SpawnParticleShovelRaise ( ActionData action_data)
68 {
69 ParticleManager.GetInstance().PlayOnObject(ParticleList.DIGGING_STASH, action_data.m_Player);
70 }
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().