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

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

void ActionTakeItem ()
 
override void CreateConditionComponents ()
 
override bool HasProneException ()
 
override bool ActionConditionContinue (ActionData action_data)
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override bool CanBeUsedOnBack ()
 
override bool InventoryReservation (ActionData action_data)
 
override void OnExecute (ActionData action_data)
 

Закрытые данные

string m_ItemName = ""
 

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

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

◆ ActionTakeItem()

void ActionTakeItem ( )
inlineprivate
11 {
12 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_PICKUP_INVENTORY;
13 m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_PICKUP_INVENTORY;
14 m_Text = "#take";
15 }
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
34 {
35 ItemBase tgt_item = ItemBase.Cast( target.GetObject() );
36 if ( tgt_item && !tgt_item.IsTakeable() ) return false;
37 if ( tgt_item && tgt_item.IsBeingPlaced() ) return false;
38
39 EntityAI tgt_parent = EntityAI.Cast( target.GetParent() );
40 EntityAI tgt_entity = EntityAI.Cast( target.GetObject() );
41
43 {
44 if ( tgt_entity && tgt_entity.IsItemBase() && player.GetInventory().CanAddEntityIntoInventory(tgt_entity) && tgt_entity.GetHierarchyRootPlayer() != player )
45 {
46 if ( tgt_parent && (!tgt_item.CanDetachAttachment(tgt_parent) || !tgt_parent.CanReleaseAttachment(tgt_item)) )
47 return false;
48
49 return true;
50 }
51 }
52 return false;
53 }
Definition Fence.c:2
Definition Building.c:6
Definition InventoryItem.c:731
Definition EntityAI.c:95

◆ ActionConditionContinue()

override bool ActionConditionContinue ( ActionData action_data)
inlineprivate
29 {
30 return true;
31 }

◆ CanBeUsedOnBack()

override bool CanBeUsedOnBack ( )
inlineprivate
56 {
57 return true;
58 }

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
inlineprivate
18 {
21 }
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.

◆ HasProneException()

override bool HasProneException ( )
inlineprivate
24 {
25 return true;
26 }

◆ InventoryReservation()

override bool InventoryReservation ( ActionData action_data)
inlineprivate
97 {
98 bool success = true;
99
101
103 if ( ItemBase.CastTo(targetItem, action_data.m_Target.GetObject()) )
104 {
105 action_data.m_Player.GetInventory().FindFreeLocationFor( targetItem , FindInventoryLocationType.ANY, il );
106 if ( action_data.m_Player.GetInventory().HasInventoryReservation( targetItem, il) )
107 {
108 success = false;
109 }
110 else
111 {
112 action_data.m_Player.GetInventory().AddInventoryReservationEx( targetItem, il, GameInventory.c_InventoryReservationTimeoutMS);
113 }
114 }
115
116 if ( success )
117 {
118 if( il )
119 action_data.m_ReservedInventoryLocations.Insert(il);
120 }
121
122 return success;
123 }
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
126 {
127 if (GetGame().IsDedicatedServer())
128 {
130 return;
131 }
132
133 //Debug.Log("[Action DEBUG] Start time stamp: " + action_data.m_Player.GetSimulationTimeStamp());
134 ItemBase ntarget = ItemBase.Cast(action_data.m_Target.GetObject());
135 InventoryLocation il = action_data.m_ReservedInventoryLocations.Get(0);
137 ntarget.GetInventory().GetCurrentInventoryLocation(targetInventoryLocation);
138
140
141 //SplitItemUtils.TakeOrSplitToInventoryLocation( action_data.m_Player, il );
142
143 float stackable = ntarget.GetTargetQuantityMax(il.GetSlot());
144
145 if( stackable == 0 || stackable >= ntarget.GetQuantity() )
146 {
147 action_data.m_Player.PredictiveTakeToDst(targetInventoryLocation, il);
148 }
149 else
150 {
152 ntarget.SplitIntoStackMaxToInventoryLocationClient( il );
153 }
154
155 //action_data.m_Player.PredictiveTakeToDst(targetInventoryLocation, il);
156 }
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().

Поля

◆ m_ItemName

string m_ItemName = ""
private

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