DayZ 1.24
Loading...
Searching...
No Matches
FirearmActionLoadBullet Class Reference
Inheritance diagram for FirearmActionLoadBullet:
[legend]
Collaboration diagram for FirearmActionLoadBullet:
[legend]

Private Member Functions

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 ()
 

Detailed Description

Definition at line 1 of file FirearmActionLoadBullet.c.

Constructor & Destructor Documentation

◆ FirearmActionLoadBullet()

void FirearmActionLoadBullet::FirearmActionLoadBullet ( )
inlineprivate

Definition at line 3 of file FirearmActionLoadBullet.c.

4 {
5 m_Text = "#load_bullet";
6 }
string m_Text
Definition ActionBase.c:49

Member Function Documentation

◆ ActionCondition()

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

Definition at line 13 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
34 return mag && player.GetWeaponManager().CanLoadBullet(weapon, mag) && hcw && hcw.GetRunningAction() != WeaponActions.CHAMBERING;
35 }
WeaponActions
actions
Definition human.c:796

◆ CanBePerformedFromInventory()

override bool FirearmActionLoadBullet::CanBePerformedFromInventory ( )
inlineprivate

Definition at line 68 of file FirearmActionLoadBullet.c.

69 {
70 return true;
71 }

◆ CanBePerformedFromQuickbar()

override bool FirearmActionLoadBullet::CanBePerformedFromQuickbar ( )
inlineprivate

Definition at line 73 of file FirearmActionLoadBullet.c.

74 {
75 return true;
76 }

◆ GetActionCategory()

override int FirearmActionLoadBullet::GetActionCategory ( )
inlineprivate

Definition at line 8 of file FirearmActionLoadBullet.c.

9 {
10 return AC_SINGLE_USE;
11 }
const int AC_SINGLE_USE
Definition _constants.c:2

◆ GetDisplayInteractObject()

override Object FirearmActionLoadBullet::GetDisplayInteractObject ( PlayerBase player,
ActionTarget target )
inlineprivate

Definition at line 55 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();
64
65 return null;
66 }

◆ Start()

override void FirearmActionLoadBullet::Start ( ActionData action_data)
inlineprivate

Definition at line 37 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());
51
52 action_data.m_Player.GetWeaponManager().LoadBullet(mag, this);
53 }

The documentation for this class was generated from the following file: