DayZ 1.24
Loading...
Searching...
No Matches
FirearmActionLoadBullet.c File Reference

Go to the source code of this file.

Classes

class  FirearmActionLoadBullet
 

Functions

FirearmActionLoadBullet FirearmActionBase FirearmActionLoadBulletQuick ()
 
void FirearmActionLoadBullet ()
 
override int GetActionCategory ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void Start (ActionData action_data)
 
override Object GetDisplayInteractObject (PlayerBase player, ActionTarget target)
 
override bool CanBePerformedFromInventory ()
 
override bool CanBePerformedFromQuickbar ()
 
override GetInputType ()
 
override void CreateConditionComponents ()
 
override bool HasProgress ()
 
override bool SetupAction (PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data=NULL)
 

Function Documentation

◆ ActionCondition()

override bool FirearmActionLoadBulletQuick::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )

Definition at line 10 of file FirearmActionLoadBullet.c.

14 {
15 if (!super.ActionCondition(player, target, item))
16 return false;
17
18 HumanCommandWeapons hcw = player.GetCommandModifier_Weapons();
19 if (!target.GetObject())
20 return false;
21
23 EntityAI entity = EntityAI.Cast(target.GetObject());
24 if (entity && entity.IsManagingArrows() && entity.IsDamageDestroyed())
25 {
26 ArrowManagerBase arrowManager = ArrowManagerBase.Cast(entity.GetArrowManager());
27 if (arrowManager)
28 mag = Magazine.Cast(arrowManager.GetFirstArrow());
29 }
30 else
31 mag = Magazine.Cast(target.GetObject());
32

◆ CanBePerformedFromInventory()

override bool FirearmActionLoadBulletQuick::CanBePerformedFromInventory ( )

Definition at line 65 of file FirearmActionLoadBullet.c.

◆ CanBePerformedFromQuickbar()

override bool FirearmActionLoadBulletQuick::CanBePerformedFromQuickbar ( )

Definition at line 70 of file FirearmActionLoadBullet.c.

◆ CreateConditionComponents()

override void CreateConditionComponents ( )

Definition at line 88 of file FirearmActionLoadBullet.c.

89 {
92 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56

References m_ConditionItem, and m_ConditionTarget.

◆ FirearmActionLoadBullet()

void FirearmActionLoadBulletQuick::FirearmActionLoadBullet ( )

Definition at line 0 of file FirearmActionLoadBullet.c.

◆ FirearmActionLoadBulletQuick()

◆ GetActionCategory()

override int FirearmActionLoadBulletQuick::GetActionCategory ( )

Definition at line 5 of file FirearmActionLoadBullet.c.

◆ GetDisplayInteractObject()

override Object FirearmActionLoadBulletQuick::GetDisplayInteractObject ( PlayerBase player,
ActionTarget target )

Definition at line 52 of file FirearmActionLoadBullet.c.

56 {
57 EntityAI entity = EntityAI.Cast(target.GetObject());
58 if (!entity || (entity && entity.IsManagingArrows() && !entity.IsDamageDestroyed()))
59 return null;
60
61 ArrowManagerBase arrowManager = entity.GetArrowManager();
62 if (arrowManager)
63 return arrowManager.GetFirstArrow();

◆ GetInputType()

◆ HasProgress()

override bool HasProgress ( )

Definition at line 94 of file FirearmActionLoadBullet.c.

95 {
96 return false;
97 }

◆ SetupAction()

override bool SetupAction ( PlayerBase player,
ActionTarget target,
ItemBase item,
out ActionData action_data,
Param extra_data = NULL )

Definition at line 110 of file FirearmActionLoadBullet.c.

111 {
112 if (super.SetupAction(player, target, item, action_data, extra_data))
113 {
114#ifndef SERVER
115 ActionTarget newTarget = new ActionTarget(player.GetWeaponManager().GetPreparedMagazine(), null, -1, vector.Zero, -1);
116 action_data.m_Target = newTarget;
117#endif
118
119 return true;
120 }
121
122 return false;
123 }
class ActionTargets ActionTarget
static const vector Zero
Definition EnConvert.c:110

References ActionTarget, and vector::Zero.

◆ Start()

override void FirearmActionLoadBulletQuick::Start ( ActionData action_data)

Definition at line 34 of file FirearmActionLoadBullet.c.

38 {
39 super.Start(action_data);
40
42 EntityAI entity = EntityAI.Cast(action_data.m_Target.GetObject());
43 if (entity && entity.IsManagingArrows() && entity.IsDamageDestroyed())
44 {
45 ArrowManagerBase arrowManager = ArrowManagerBase.Cast(entity.GetArrowManager());
46 if (arrowManager)
47 mag = Magazine.Cast(arrowManager.AcquireFirstArrow(false));
48 }
49 else
50 mag = Magazine.Cast(action_data.m_Target.GetObject());