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

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

void FirearmActionDetachMagazine ()
 
override ActionData CreateActionData ()
 
override bool InventoryReservation (ActionData action_data)
 
override void WriteToContext (ParamsWriteContext ctx, ActionData action_data)
 
override bool ReadFromContext (ParamsReadContext ctx, out ActionReciveData action_recive_data)
 
override void HandleReciveData (ActionReciveData action_recive_data, ActionData action_data)
 
override GetInputType ()
 
override void CreateConditionComponents ()
 
override bool CanBePerformedFromQuickbar ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override bool ActionConditionContinue (ActionData action_data)
 
override void OnStageStart (SequentialActionData action_data)
 
override void OnUpdate (ActionData action_data)
 
override void OnStartServer (ActionData action_data)
 
override void OnEndServer (ActionData action_data)
 

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

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

◆ FirearmActionDetachMagazine()

void FirearmActionDetachMagazine ( )
inlineprivate
150 {
151 }

Методы

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
267 {
268 if (!super.ActionCondition( player, target, item ))
269 return false;
270
272 int mi = wpn.GetCurrentMuzzle();
273 return wpn && wpn.GetMagazine(mi) == target.GetObject();
274 }
Definition EntityAI.c:95
shorthand
Definition BoltActionRifle_Base.c:6

◆ ActionConditionContinue()

override bool ActionConditionContinue ( ActionData action_data)
inlineprivate
277 {
278 return true;
279 }

◆ CanBePerformedFromQuickbar()

override bool CanBePerformedFromQuickbar ( )
inlineprivate
262 {
263 return true;
264 }

◆ CreateActionData()

override ActionData CreateActionData ( )
inlineprivate
154 {
155 ActionData action_data = new AdvDetachMagActionData;
156 return action_data;
157 }

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
inlineprivate
256 {
257 m_ConditionItem = new CCIDummy;
258 m_ConditionTarget = new CCTNone;
259 }
Definition CCIDummy.c:2
Definition CCTNone.c:2

◆ GetInputType()

override GetInputType ( )
inlineprivate
251 {
253 }
Definition ActionInput.c:944

◆ HandleReciveData()

override void HandleReciveData ( ActionReciveData action_recive_data,
ActionData action_data )
inlineprivate
239 {
240 super.HandleReciveData(action_recive_data, action_data);
241
244
245 action_data_dm.m_ilWeapon.Copy(recive_data_dm.m_ilWeapon);
246 action_data_dm.m_ilMagazine.Copy(recive_data_dm.m_ilMagazine);
247 }
Definition FirearmActionDetachMagazine.c:137

◆ InventoryReservation()

override bool InventoryReservation ( ActionData action_data)
inlineprivate
161 {
162 Weapon_Base wpn = Weapon_Base.Cast(action_data.m_MainItem);
163 Magazine mag = Magazine.Cast(action_data.m_Target.GetObject());
164
167
168
169 int ur_index = action_data.m_Player.GetHumanInventory().FindUserReservedLocationIndex(wpn);
170
171 if(ur_index > -1)
172 action_data.m_Player.GetHumanInventory().GetUserReservedLocation(ur_index,ilWpn);
173 else
174 {
175 action_data.m_Player.GetInventory().FindFreeLocationFor(wpn, FindInventoryLocationType.ANY_CARGO | FindInventoryLocationType.ATTACHMENT, ilWpn);
176
177
178 //return false;
179 }
180
181 if( !action_data.m_Player.GetInventory().FindFreeLocationFor(mag, FindInventoryLocationType.ANY_CARGO, ilMag) )
182 return false;
183
184 if( !super.InventoryReservation( action_data ) )
185 return false;
186
188 if( !action_data.m_Player.GetInventory().AddInventoryReservationEx(wpn,ilWpn,10000) )
189 return false;
190
191 if( !action_data.m_Player.GetInventory().AddInventoryReservationEx(mag,ilMag,10000) )
192 return false;
193
194 action_data_dm.m_ReservedInventoryLocations.Insert(ilWpn);
195 action_data_dm.m_ReservedInventoryLocations.Insert(ilMag);
196 action_data_dm.m_ilWeapon = ilWpn;
197 action_data_dm.m_ilMagazine = ilMag;
198
199 return true;
200 }
FindInventoryLocationType
flags for searching locations in inventory
Definition InventoryLocation.c:17
InventoryLocation.
Definition InventoryLocation.c:29

◆ OnEndServer()

override void OnEndServer ( ActionData action_data)
inlineprivate
365 {
366 super.OnEndServer(action_data);
367
368 GetGame().ClearJuncture(action_data.m_Player, EntityAI.Cast(action_data.m_Target.GetObject()));
369 }
Definition Building.c:6
proto native CGame GetGame()

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

◆ OnStageStart()

override void OnStageStart ( SequentialActionData action_data)
inlineprivate
282 {
283 if( action_data.m_ReciveEndInput )
284 {
285 End( action_data );
286 return;
287 }
288 super.OnStageStart(action_data);
291 //InventoryLocation il = new InventoryLocation();
293
294 switch (action_data.m_Stage)
295 {
296 case 0:
297 action_data.m_Player.GetWeaponManager().DetachMagazine(action_data_dm.m_ilMagazine,this);
298 break;
299
300 case 1:
301 if ( !action_data_dm.m_ilWeapon.IsValid() )
302 {
303 End( action_data );
304 break;
305 }
306
307 wpn = Weapon_Base.Cast(action_data.m_MainItem);
308 mag = Magazine.Cast(action_data.m_Target.GetObject());
309
310 action_data.m_Player.GetHumanInventory().ClearUserReservedLocation(wpn);
311 if ( ( !GetGame().IsDedicatedServer() ) && !mag.GetHierarchyParent() )
312 {
314
315 if ( action_data.m_Player.NeedInventoryJunctureFromServer(mag, action_data.m_Player, action_data.m_Player) || action_data.m_Player.NeedInventoryJunctureFromServer(wpn, action_data.m_Player, action_data.m_Player) )
316 invMode = InventoryMode.JUNCTURE;
317
318 action_data.m_Player.GetInventory().ForceSwapEntities(invMode, mag, wpn, action_data_dm.m_ilWeapon);
319 }
320
321 End( action_data );
322 break;
323 default:
324 End( action_data );
325 break;
326 }
327 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
Definition Inventory.c:22
void End()
called on surrender end request end

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

◆ OnStartServer()

override void OnStartServer ( ActionData action_data)
inlineprivate
357 {
358 super.OnStartServer(action_data);
359
361 GetGame().AddInventoryJunctureEx(action_data.m_Player, EntityAI.Cast(action_data.m_Target.GetObject()),action_data_dm.m_ilMagazine, true, 10000);
362 }

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

◆ OnUpdate()

override void OnUpdate ( ActionData action_data)
inlineprivate
330 {
331 super.OnUpdate( action_data );
332
334 if(ad)
335 {
336 switch (ad.m_Stage)
337 {
338 case 0:
339 Weapon_Base wpn = Weapon_Base.Cast(action_data.m_MainItem);
340
341 if ( (!wpn || ad.m_Player.GetItemInHands()!=wpn || !ad.m_Player.GetWeaponManager().IsRunning()) && !ad.m_Player.IsJumpInProgress() )
342 {
343 SetStage(1, ad);
344 }
345 break;
346 case 1:
347 //action_data.m_Player.GetHandFs
348
349 break;
350 default:
351 break;
352 }
353 }
354 }
void SetStage(int stage, SequentialActionData action_data)
Definition ActionSequentialBase.c:60
Definition ActionSequentialBase.c:2

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

◆ ReadFromContext()

override bool ReadFromContext ( ParamsReadContext ctx,
out ActionReciveData action_recive_data )
inlineprivate
214 {
216 {
218 }
219
220 if(!super.ReadFromContext( ctx, action_recive_data ))
221 return false;
222
225
226 recive_data_dm.m_ilWeapon = new InventoryLocation;
227 recive_data_dm.m_ilMagazine = new InventoryLocation;
228
229 if(!recive_data_dm.m_ilWeapon.ReadFromContext(ctx))
230 return false;
231
232 if(!recive_data_dm.m_ilMagazine.ReadFromContext(ctx))
233 return false;
234
235 return true;
236 }

◆ WriteToContext()

override void WriteToContext ( ParamsWriteContext ctx,
ActionData action_data )
inlineprivate
203 {
204 super.WriteToContext(ctx, action_data);
205
208
209 action_data_dm.m_ilWeapon.WriteToContext(ctx);
210 action_data_dm.m_ilMagazine.WriteToContext(ctx);
211 }

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