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

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

void ActionTakeArrowToHands ()
 
override void CreateConditionComponents ()
 
override bool HasProneException ()
 
override GetInputType ()
 
override bool HasProgress ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override Object GetDisplayInteractObject (PlayerBase player, ActionTarget target)
 
override bool CanContinue (ActionData action_data)
 
override bool InventoryReservation (ActionData action_data)
 
override void OnExecute (ActionData action_data)
 
override void CreateAndSetupActionCallback (ActionData action_data)
 
override bool CanBeUsedOnBack ()
 

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

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

◆ ActionTakeArrowToHands()

void ActionTakeArrowToHands ( )
inlineprivate
4 {
5 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_PICKUP_HANDS;
6 m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_PICKUP_HANDS;
7 m_Text = "#take_to_hands";
8 }
string m_Text
Definition ActionBase.c:58
int m_CommandUIDProne
Definition AnimatedActionBase.c:144
int m_CommandUID
Definition AnimatedActionBase.c:143
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

Перекрестные ссылки AnimatedActionBase::m_CommandUID, AnimatedActionBase::m_CommandUIDProne и ActionBase::m_Text.

Методы

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
32 {
33 EntityAI targetEntity = EntityAI.Cast(target.GetObject());
34 if (!targetEntity || (targetEntity && targetEntity.IsManagingArrows() && !targetEntity.IsDamageDestroyed()))
35 return false;
36
37 ArrowManagerBase arrowManager = targetEntity.GetArrowManager();
38 if (arrowManager)
39 {
40 ItemBase arrow = ItemBase.Cast(arrowManager.GetFirstArrow());
41 if (arrow && !arrow.IsSetForDeletion())
42 {
43 if (player.GetInventory().CanAddEntityIntoHands(arrow))
44 return true;
45 }
46 }
47
48 return false;
49 }
Definition ArrowManagerBase.c:2
Definition Building.c:6
Definition InventoryItem.c:731
Definition EntityAI.c:95

◆ CanBeUsedOnBack()

override bool CanBeUsedOnBack ( )
inlineprivate
165 {
166 return true;
167 }

◆ CanContinue()

override bool CanContinue ( ActionData action_data)
inlineprivate
67 {
68 return true;
69 }

◆ CreateAndSetupActionCallback()

override void CreateAndSetupActionCallback ( ActionData action_data)
inlineprivate
135 {
136 EntityAI target = EntityAI.Cast(action_data.m_Target.GetObject());
137 if (!target)
138 return;
139
141
142 if (target.IsHeavyBehaviour())
143 {
144 Class.CastTo(callback, action_data.m_Player.StartCommand_Action(DayZPlayerConstants.CMD_ACTIONFB_PICKUP_HEAVY,GetCallbackClassTypename(), DayZPlayerConstants.STANCEMASK_ERECT));
145 }
146 else
147 {
148 if (action_data.m_Player.IsPlayerInStance(DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT))
149 {
150 Class.CastTo(callback, action_data.m_Player.AddCommandModifier_Action(m_CommandUID,GetCallbackClassTypename()));
151 }
152 else
153 {
154 Class.CastTo(callback, action_data.m_Player.StartCommand_Action(m_CommandUIDProne,GetCallbackClassTypename(),DayZPlayerConstants.STANCEMASK_PRONE));
155 }
156 }
157
158 callback.SetActionData(action_data);
159 callback.InitActionComponent();
160 action_data.m_Callback = callback;
161 }
Definition AnimatedActionBase.c:2
GetCallbackClassTypename()
Definition AnimatedActionBase.c:307
Super root of all classes in Enforce script.
Definition EnScript.c:11
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo(), AnimatedActionBase::GetCallbackClassTypename(), AnimatedActionBase::m_CommandUID и AnimatedActionBase::m_CommandUIDProne.

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
inlineprivate
11 {
14 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:64
ref CCTBase m_ConditionTarget
Definition ActionBase.c:65
Definition CCINone.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.

◆ GetDisplayInteractObject()

override Object GetDisplayInteractObject ( PlayerBase player,
ActionTarget target )
inlineprivate
52 {
53 EntityAI targetEntity = EntityAI.Cast(target.GetObject());
54 if (!targetEntity || (targetEntity && targetEntity.IsManagingArrows() && !targetEntity.IsDamageDestroyed()))
55 return null;
56
57 ArrowManagerBase arrowManager = targetEntity.GetArrowManager();
58 if (arrowManager)
59 {
60 return arrowManager.GetFirstArrow();
61 }
62
63 return null;
64 }

◆ GetInputType()

override GetInputType ( )
inlineprivate
22 {
24 }
Definition ActionInput.c:522

◆ HasProgress()

override bool HasProgress ( )
inlineprivate
27 {
28 return false;
29 }

◆ HasProneException()

override bool HasProneException ( )
inlineprivate
17 {
18 return true;
19 }

◆ InventoryReservation()

override bool InventoryReservation ( ActionData action_data)
inlineprivate
72 {
73 bool success = true;
74
76
78 if (EntityAI.CastTo(targetEntity, action_data.m_Target.GetObject()))
79 {
80 ArrowManagerBase arrowManager = targetEntity.GetArrowManager();
81 if (arrowManager)
82 {
83 ItemBase targetArrow = ItemBase.Cast(arrowManager.GetFirstArrow());
84 if (targetArrow)
85 {
86 il.SetHands(action_data.m_Player,targetArrow);
87 if (action_data.m_Player.GetInventory().HasInventoryReservation(targetArrow, il))
88 {
89 success = false;
90 }
91 else
92 {
93 action_data.m_Player.GetInventory().AddInventoryReservationEx(targetArrow, il, GameInventory.c_InventoryReservationTimeoutMS);
94 }
95 }
96 }
97 }
98
99 if (success)
100 {
101 if (il)
102 action_data.m_ReservedInventoryLocations.Insert(il);
103 }
104
105 return success;
106 }
script counterpart to engine's class Inventory
Definition Inventory.c:79
const int c_InventoryReservationTimeoutMS
reservations
Definition Inventory.c:712
InventoryLocation.
Definition InventoryLocation.c:29

Перекрестные ссылки GameInventory::c_InventoryReservationTimeoutMS.

◆ OnExecute()

override void OnExecute ( ActionData action_data)
inlineprivate
110 {
111 if (GetGame().IsDedicatedServer())
112 {
114 return;
115 }
116
117 InventoryLocation il = action_data.m_ReservedInventoryLocations.Get(0);
118
119 ItemBase arrow = ItemBase.Cast(il.GetItem());
121
122 float stackable = arrow.GetTargetQuantityMax(-1);
123
124 if (stackable == 0 || stackable >= arrow.GetQuantity())
125 {
126 action_data.m_Player.PredictiveTakeEntityToHands(arrow);
127 }
128 else
129 {
130 arrow.SplitIntoStackMaxToInventoryLocationClient(il);
131 }
132 }
void ClearInventoryReservationEx(ActionData action_data)
Definition ActionBase.c:921
void ClearActionJuncture(ActionData action_data)
Definition ActionBase.c:979
proto native CGame GetGame()

Перекрестные ссылки ActionBase::ClearActionJuncture(), ActionBase::ClearInventoryReservationEx() и GetGame().


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