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

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

override void CreateConditionComponents ()
 
void ActionDetachFromTarget ()
 
override GetInputType ()
 
override ActionData CreateActionData ()
 
int FindSlotIdToDetach (PlayerBase player, ActionTarget target, ItemBase item)
 
override bool SetupAction (PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data=NULL)
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override Object GetDisplayInteractObject (PlayerBase player, ActionTarget target)
 
override void OnExecute (ActionData action_data)
 
void Process (ActionData action_data)
 

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

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

◆ ActionDetachFromTarget()

void ActionDetachFromTarget ( )
inlineprivate
11 {
12 m_Text = "#take_to_hands";
13 }
string m_Text
Definition ActionBase.c:58

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

Методы

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
79 {
80 if ( GetGame().IsMultiplayer() && GetGame().IsServer() ) return true;
81
83 }
int FindSlotIdToDetach(PlayerBase player, ActionTarget target, ItemBase item)
Definition ActionDetachFromTarget.c:26
provides access to slot configuration
Definition InventorySlots.c:6
const int INVALID
Invalid slot (-1)
Definition InventorySlots.c:17
Definition EntityAI.c:95
proto native CGame GetGame()

Перекрестные ссылки FindSlotIdToDetach(), GetGame() и InventorySlots::INVALID.

◆ CreateActionData()

override ActionData CreateActionData ( )
inlineprivate
21 {
23 return action_data;
24 }
Definition ActionDetach.c:2

◆ CreateConditionComponents()

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

◆ FindSlotIdToDetach()

int FindSlotIdToDetach ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
27 {
28 EntityAI target_entity = EntityAI.Cast(target.GetObject());
29
30 if ( player && target_entity )
31 {
33 target_entity.GetActionComponentNameList( target.GetComponentIndex(),selections );
34
35 if ( target_entity && target_entity.GetInventory() && target_entity.GetInventory().AttachmentCount() > 0 )
36 {
37 for(int i = 0; i < selections.Count(); i++ )
38 {
40 EntityAI att = target_entity.GetInventory().FindAttachment(target_slot_id);
41
42 if ( att && player.GetInventory().CanAddEntityIntoHands(att) )
43 {
44 if ( att.CanDetachAttachment( target_entity ) && target_entity.CanReleaseAttachment( att ) )
45 return target_slot_id;
46 }
47 }
48 }
49 }
51 }
Definition Building.c:6
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id

Перекрестные ссылки InventorySlots::GetSlotIdFromString() и InventorySlots::INVALID.

Используется в ActionCondition(), GetDisplayInteractObject() и SetupAction().

◆ GetDisplayInteractObject()

override Object GetDisplayInteractObject ( PlayerBase player,
ActionTarget target )
inlineprivate
86 {
88 EntityAI target_entity = EntityAI.Cast( target.GetObject() );
89
91 {
92 return target_entity.GetInventory().FindAttachment(target_slot_id);
93 }
94 return null;
95 }

Перекрестные ссылки FindSlotIdToDetach() и InventorySlots::INVALID.

◆ GetInputType()

override GetInputType ( )
inlineprivate
16 {
18 }
Definition ActionInput.c:522

◆ OnExecute()

override void OnExecute ( ActionData action_data)
inlineprivate
98 {
99 if (GetGame().IsDedicatedServer())
100 {
102 return;
103 }
104
106 }
void Process()
Definition EffectManager.c:743
void ClearActionJuncture(ActionData action_data)
Definition ActionBase.c:979

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

◆ Process()

void Process ( ActionData action_data)
inlineprivate
109 {
111
113 EntityAI target_entity = EntityAI.Cast( action_data_a.m_Target.GetObject() );
114
115 ItemBase attachment = ItemBase.Cast(target_entity.GetInventory().FindAttachment(action_data_a.m_AttSlot));
116
117 if(attachment)
118 {
119 float stackable = attachment.GetTargetQuantityMax();
120 if( stackable == 0 || stackable >= attachment.GetQuantity() )
121 {
122 //take to hands
123 action_data.m_Player.PredictiveTakeEntityToHands( attachment );
124 }
125 else if( stackable != 0 && stackable < attachment.GetQuantity() )
126 {
127 //split and take to hands
128 attachment.SplitIntoStackMaxHandsClient( action_data.m_Player );
129 }
130 }
131 }
void ClearInventoryReservationEx(ActionData action_data)
Definition ActionBase.c:921
Definition InventoryItem.c:731

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

◆ SetupAction()

override bool SetupAction ( PlayerBase player,
ActionTarget target,
ItemBase item,
out ActionData action_data,
Param extra_data = NULL )
inlineprivate
54 {
56 if (!GetGame().IsDedicatedServer() )
57 {
59 }
60
61 if ( super.SetupAction( player, target, item, action_data, extra_data))
62 {
63 if (!GetGame().IsDedicatedServer())
64 {
66 {
68 action_data_a.m_AttSlot = attSlotId;
69 return true;
70 }
71 return false;
72 }
73 return true;
74 }
75 return false;
76 }

Перекрестные ссылки FindSlotIdToDetach(), GetGame() и InventorySlots::INVALID.


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