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

DEPRECATED. Подробнее...

+ Граф наследования:ActionTakeHybridAttachment:

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

void ActionTakeHybridAttachment ()
 
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 = ""
 

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

DEPRECATED.

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

◆ ActionTakeHybridAttachment()

void ActionTakeHybridAttachment ( )
inlineprivate
7 {
8 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_PICKUP_INVENTORY;
9 m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_PICKUP_INVENTORY;
10 m_Text = "#take";
11 }
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
30 {
31 EntityAI tgt_entity = EntityAI.Cast( target.GetObject() );
32
33 if ( tgt_entity && BaseBuildingBase.Cast(tgt_entity) &&!tgt_entity.IsBeingPlaced() )
34 {
35 string component_name = tgt_entity.GetActionComponentName( target.GetComponentIndex() );
36
37 /*if (!tgt_entity.GetInventory().HasInventorySlot(InventorySlots.GetSlotIdFromString(component_name)))
38 return false;*/
39
40 ItemBase attachment = ItemBase.Cast(tgt_entity.FindAttachmentBySlotName(component_name));
41
42 if ( attachment && player.GetInventory().CanAddEntityIntoInventory(attachment) && attachment.IsTakeable() )
43 {
44 return true;
45 }
46 }
47 return false;
48 }
Definition Fence.c:2
Definition Building.c:6
Definition InventoryItem.c:731
Definition EntityAI.c:95

◆ ActionConditionContinue()

override bool ActionConditionContinue ( ActionData action_data)
inlineprivate
25 {
26 return true;
27 }

◆ CanBeUsedOnBack()

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

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
inlineprivate
14 {
17 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:64
ref CCTBase m_ConditionTarget
Definition ActionBase.c:65
Definition CCINone.c:2
Definition CCTCursor.c:2

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

◆ HasProneException()

override bool HasProneException ( )
inlineprivate
20 {
21 return true;
22 }

◆ InventoryReservation()

override bool InventoryReservation ( ActionData action_data)
inlineprivate
56 {
57 bool success = true;
58
60
61 EntityAI tgt_entity = EntityAI.Cast( action_data.m_Target.GetObject() );
62 string component_name = tgt_entity.GetActionComponentName( action_data.m_Target.GetComponentIndex() );
64
65 if ( tgt_entity && ItemBase.CastTo(attachment, tgt_entity.FindAttachmentBySlotName(component_name)) )
66 {
67 action_data.m_Player.GetInventory().FindFreeLocationFor( attachment , FindInventoryLocationType.ANY, il );
68 if ( action_data.m_Player.GetInventory().HasInventoryReservation( attachment, il) )
69 {
70 success = false;
71 }
72 else
73 {
74 action_data.m_Player.GetInventory().AddInventoryReservationEx( attachment, il, GameInventory.c_InventoryReservationTimeoutMS);
75 }
76 }
77
78 if ( success )
79 {
80 if( il )
81 action_data.m_ReservedInventoryLocations.Insert(il);
82 }
83
84 return success;
85 }
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
88 {
89 if (GetGame().IsDedicatedServer())
90 {
92 return;
93 }
94
95 //Debug.Log("[Action DEBUG] Start time stamp: " + action_data.m_Player.GetSimulationTimeStamp());
96 EntityAI tgt_entity = EntityAI.Cast( action_data.m_Target.GetObject() );
97 string component_name = tgt_entity.GetActionComponentName( action_data.m_Target.GetComponentIndex() );
99
100 if ( tgt_entity && ItemBase.CastTo(attachment, tgt_entity.FindAttachmentBySlotName(component_name)) )
101 {
102 InventoryLocation il = action_data.m_ReservedInventoryLocations.Get(0);
104 attachment.GetInventory().GetCurrentInventoryLocation(targetInventoryLocation);
106 //SplitItemUtils.TakeOrSplitToInventoryLocation( action_data.m_Player, il );
107
108 float stackable = attachment.GetTargetQuantityMax(il.GetSlot());
109
110 if( stackable == 0 || stackable >= attachment.GetQuantity() )
111 {
112 action_data.m_Player.PredictiveTakeToDst(targetInventoryLocation, il);
113 }
114 else
115 {
116 attachment.SplitIntoStackMaxToInventoryLocationClient( il );
117 }
118 }
119 //action_data.m_Player.PredictiveTakeToDst(targetInventoryLocation, il);
120 }
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

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