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

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

void ActionTakeArrow ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override Object GetDisplayInteractObject (PlayerBase player, ActionTarget target)
 
override bool CanBeUsedOnBack ()
 
override bool InventoryReservation (ActionData action_data)
 
override void OnExecute (ActionData action_data)
 

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

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

◆ ActionTakeArrow()

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

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

Методы

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
16 {
17 EntityAI targetEntity = EntityAI.Cast(target.GetObject());
18 if (!targetEntity || (targetEntity && targetEntity.IsManagingArrows() && !targetEntity.IsDamageDestroyed()))
19 return false;
20
21 ArrowManagerBase arrowManager = targetEntity.GetArrowManager();
22 if (arrowManager)
23 {
24 ItemBase arrow = ItemBase.Cast(arrowManager.GetFirstArrow());
25 if (arrow)
26 {
27 if (player.GetInventory().CanAddEntityIntoInventory(arrow))
28 return true;
29 }
30 }
31
32 return false;
33 }
Definition ArrowManagerBase.c:2
Definition Building.c:6
Definition InventoryItem.c:731
Definition EntityAI.c:95

◆ CanBeUsedOnBack()

override bool CanBeUsedOnBack ( )
inlineprivate
51 {
52 return false;
53 }

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
inlineprivate
10 {
13 }
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
36 {
37 EntityAI targetEntity = EntityAI.Cast(target.GetObject());
38 if (!targetEntity || (targetEntity && targetEntity.IsManagingArrows() && !targetEntity.IsDamageDestroyed()))
39 return null;
40
41 ArrowManagerBase arrowManager = targetEntity.GetArrowManager();
42 if (arrowManager)
43 {
44 return arrowManager.GetFirstArrow();
45 }
46
47 return null;
48 }

◆ InventoryReservation()

override bool InventoryReservation ( ActionData action_data)
inlineprivate
56 {
57 bool success = true;
58
60
62 if (EntityAI.CastTo(targetEntity, action_data.m_Target.GetObject()))
63 {
64 ArrowManagerBase arrowManager = targetEntity.GetArrowManager();
65 if (arrowManager)
66 {
67 ItemBase targetArrow = ItemBase.Cast(arrowManager.GetFirstArrow());
68 if (targetArrow)
69 {
70 action_data.m_Player.GetInventory().FindFreeLocationFor(targetArrow , FindInventoryLocationType.ANY, il);
71 if (action_data.m_Player.GetInventory().HasInventoryReservation(targetArrow, il))
72 {
73 success = false;
74 }
75 else
76 {
77 action_data.m_Player.GetInventory().AddInventoryReservationEx(targetArrow, il, GameInventory.c_InventoryReservationTimeoutMS);
78 }
79 }
80 }
81 }
82
83 if (success)
84 {
85 if (il)
86 action_data.m_ReservedInventoryLocations.Insert(il);
87 }
88
89 return success;
90 }
FindInventoryLocationType
flags for searching locations in inventory
Definition InventoryLocation.c:17
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
94 {
95 if (GetGame().IsDedicatedServer())
96 {
98 return;
99 }
100
101 InventoryLocation il = action_data.m_ReservedInventoryLocations.Get(0);
102
104
105 ItemBase arrow = ItemBase.Cast(il.GetItem());
107 arrow.GetInventory().GetCurrentInventoryLocation(arrowInventoryLocation);
108
109 float stackable = arrow.GetTargetQuantityMax(il.GetSlot());
110
111 if ( stackable == 0 || stackable >= arrow.GetQuantity() )
112 {
113 action_data.m_Player.PredictiveTakeToDst(arrowInventoryLocation, il);
114 }
115 else
116 {
117 arrow.SplitIntoStackMaxToInventoryLocationClient( il );
118 }
119 }
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().


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