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

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

void ActionAttachWithSwitch ()
 
override void CreateConditionComponents ()
 
override GetInputType ()
 
override bool CanBePerformedFromInventory ()
 
override ActionData CreateActionData ()
 
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 void OnExecuteServer (ActionData action_data)
 
override void OnExecuteClient (ActionData action_data)
 

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

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

◆ ActionAttachWithSwitch()

void ActionAttachWithSwitch ( )
inlineprivate
4 {
5 }

Методы

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
65 {
66 EntityAI target_entity = EntityAI.Cast( target.GetObject() );
67 if( !item.CanSwitchDuringAttach(target_entity) )
68 return false;
69
70 if ( target_entity && item )
71 {
72 if ( target_entity.GetInventory() && target_entity.GetInventory().CanAddAttachment( item ) )
73 {
74 return true;
75 }
76 }
77 return false;
78 }
Definition Building.c:6
Definition EntityAI.c:95

◆ CanBePerformedFromInventory()

override bool CanBePerformedFromInventory ( )
inlineprivate
21 {
22 return true;
23 }

◆ CreateActionData()

override ActionData CreateActionData ( )
inlineprivate
26 {
28 return action_data;
29 }
Definition ActionAttach.c:2

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
inlineprivate
8 {
9 m_ConditionItem = new CCINonRuined;
10 m_ConditionTarget = new CCTNonRuined( UAMaxDistances.DEFAULT );
11 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_ATTACHITEM;
12 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
13 }
int m_CommandUID
Definition ActionBase.c:31
int m_StanceMask
Definition ActionBase.c:33
Definition CCINonRuined.c:2
Definition CCTNonRuined.c:2
Definition ActionConstants.c:106
const float DEFAULT
Definition ActionConstants.c:108
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

Перекрестные ссылки UAMaxDistances::DEFAULT, m_CommandUID и m_StanceMask.

◆ GetInputType()

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

◆ OnExecuteClient()

override void OnExecuteClient ( ActionData action_data)
inlineprivate
107 {
108 ClearInventoryReservationEx(action_data);
110
112
113 if ( action_data.m_Target.IsProxy() )
114 {
115 target_EAI = EntityAI.Cast( action_data_a.m_Target.GetParent() );
116 }
117 else
118 {
119 target_EAI = EntityAI.Cast( action_data_a.m_Target.GetObject() );
120 }
121
122 if (target_EAI && action_data_a.m_MainItem)
123 {
125 il.SetAttachment( target_EAI, action_data.m_MainItem, action_data_a.m_AttSlot );
126 action_data.m_Player.PredictiveForceSwapEntities( target_EAI, action_data.m_MainItem, il );
127 }
128 }
InventoryLocation.
Definition InventoryLocation.c:29

◆ OnExecuteServer()

override void OnExecuteServer ( ActionData action_data)
inlineprivate
81 {
82 if (GetGame().IsMultiplayer())
83 return;
84
85 ClearInventoryReservationEx(action_data);
88
89 if ( action_data.m_Target.IsProxy() )
90 {
91 target_EAI = EntityAI.Cast( action_data_a.m_Target.GetParent() );
92 }
93 else
94 {
95 target_EAI = EntityAI.Cast( action_data_a.m_Target.GetObject() );
96 }
97
98 if (target_EAI && action_data_a.m_MainItem)
99 {
101 il.SetAttachment( target_EAI, action_data.m_MainItem, action_data_a.m_AttSlot );
102 action_data.m_Player.PredictiveForceSwapEntities( target_EAI, action_data.m_MainItem, il );
103 }
104 }
proto native CGame GetGame()

Перекрестные ссылки GetGame().

◆ SetupAction()

override bool SetupAction ( PlayerBase player,
ActionTarget target,
ItemBase item,
out ActionData action_data,
Param extra_data = NULL )
inlineprivate
32 {
34 if (!GetGame().IsDedicatedServer())
35 {
37
38 if ( target.IsProxy() )
39 {
40 target_entity = EntityAI.Cast( target.GetParent() );
41 }
42 else
43 {
44 target_entity = EntityAI.Cast( target.GetObject() );
45 }
46
47 if (!target_entity.GetInventory().FindFreeLocationFor( item, FindInventoryLocationType.ATTACHMENT, il ))
48 return false;
49 }
50
51 if ( super.SetupAction( player, target, item, action_data, extra_data))
52 {
53 if (!GetGame().IsDedicatedServer())
54 {
56 action_data_a.m_AttSlot = il.GetSlot();
57 }
58 return true;
59 }
60 return false;
61 }
FindInventoryLocationType
flags for searching locations in inventory
Definition InventoryLocation.c:17

Перекрестные ссылки GetGame().


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