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

См. исходные тексты.

Структуры данных

class  ActionTakeItemToHands
 

Функции

override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override bool UseMainItem ()
 
override bool MainItemAlwaysInHands ()
 
override void CreateAndSetupActionCallback (ActionData action_data)
 
override void Start (ActionData action_data)
 
override void OnExecute (ActionData action_data)
 
override void OnEnd (ActionData action_data)
 
void PerformSwap (ActionData action_data)
 

Переменные

ActionTakeItemToHands m_Executable
 

Функции

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
124 {
125 ItemBase targetItem = ItemBase.Cast(target.GetObject());
126 if (!targetItem || !targetItem.IsTakeable() || targetItem.IsBeingPlaced())
127 return false;
128
129 return player.GetInventory().CanSwapEntitiesEx(targetItem,item);
130 }
Definition InventoryItem.c:731
Definition EntityAI.c:95

◆ CreateAndSetupActionCallback()

override void CreateAndSetupActionCallback ( ActionData action_data)
143 {
144 EntityAI target = EntityAI.Cast(action_data.m_Target.GetObject());
145 if (!target)
146 return;
147
149
150 if (target.IsHeavyBehaviour())
151 {
152 Class.CastTo(callback, action_data.m_Player.StartCommand_Action(DayZPlayerConstants.CMD_ACTIONFB_PICKUP_HEAVY,GetCallbackClassTypename(),DayZPlayerConstants.STANCEMASK_ERECT));
153 }
154 else
155 {
156 return;
157 }
158
159 callback.SetActionData(action_data);
160 callback.InitActionComponent();
161 action_data.m_Callback = callback;
162 }
Definition AnimatedActionBase.c:2
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition Building.c:6
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo().

◆ MainItemAlwaysInHands()

override bool MainItemAlwaysInHands ( )
138 {
139 return true;
140 }

◆ OnEnd()

override void OnEnd ( ActionData action_data)
195 {
196 super.OnEnd(action_data);
197
198 if (m_Executable)
199 {
200 m_Executable = false;
201 return;
202 }
203
204 if (GetGame().IsDedicatedServer())
205 {
206 ClearActionJuncture(action_data);
207 return;
208 }
209
211 }
ActionTakeItemToHands m_Executable
void PerformSwap(ActionData action_data)
Definition ActionTakeItemToHands.c:213
proto native CGame GetGame()

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

◆ OnExecute()

override void OnExecute ( ActionData action_data)
181 {
182 if (!m_Executable)
183 return;
184
185 if (GetGame().IsDedicatedServer())
186 {
187 ClearActionJuncture(action_data);
188 return;
189 }
190
192 }

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

◆ PerformSwap()

void PerformSwap ( ActionData action_data)
214 {
215 ClearInventoryReservationEx(action_data);
216
217 EntityAI ntarget = EntityAI.Cast(action_data.m_Target.GetObject());
218 if (action_data.m_Player)
219 {
221 if (!GetGame().IsMultiplayer())
222 invMode = InventoryMode.LOCAL;
223 else if (action_data.m_Player.NeedInventoryJunctureFromServer(ntarget, ntarget.GetHierarchyParent(), action_data.m_Player))
224 invMode = InventoryMode.JUNCTURE;
225
226 action_data.m_Player.TakeEntityToHandsImpl(invMode, ntarget);
227 }
228 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
Definition Inventory.c:22

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

Используется в OnEnd() и OnExecute().

◆ Start()

override void Start ( ActionData action_data)
165 {
166 super.Start(action_data);
167
168 bool b1 = action_data.m_MainItem.ConfigGetString("physLayer") == "item_large";
169 action_data.m_MainItem.m_ThrowItemOnDrop = b1;
170
171 EntityAI object = EntityAI.Cast(action_data.m_Target.GetObject());
172 if (!object || !object.IsHeavyBehaviour())
173 {
174 action_data.m_Player.GetActionManager().Interrupt();
175 }
176 else
177 m_Executable = true;
178 }
override bool IsHeavyBehaviour()
Definition ItemBase.c:8976

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

◆ UseMainItem()

override bool UseMainItem ( )
133 {
134 return true;
135 }

Переменные

◆ m_Executable

ActionTakeItemToHands m_Executable

Используется в OnEnd(), OnExecute() и Start().