DayZ 1.24
Loading...
Searching...
No Matches
FirearmActionBase.c
Go to the documentation of this file.
1class FirearmActionBase : ActionBase
2{
4
6 {
7 return DayZPlayerConstants.STANCEMASK_ALL;
8 }
9
10 override int GetActionCategory()
11 {
12 return AC_SINGLE_USE;
13 }
14
15 override typename GetInputType()
16 {
17 return DefaultActionInput;
18 }
19
21 {
22 Weapon_Base wpn = Weapon_Base.Cast(action_data.m_MainItem);
23 return !wpn.IsIdle();
24 }
25
26 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
27 {
29 return wpn && wpn.CanProcessWeaponEvents() && !player.GetDayZPlayerInventory().IsProcessing();
30 }
31
33 {
34 super.Start(action_data);
35
36 action_data.m_State = UA_PROCESSING;
37 }
38
40 {
41 return true;
42 }
43
44 override bool CanBeUsedOnBack()
45 {
46 return true;
47 }
48
49 override bool CanBeUsedRaised()
50 {
51 return true;
52 }
53
55 {
56 super.OnUpdate(action_data);
57
58 Weapon_Base wpn = Weapon_Base.Cast(action_data.m_MainItem);
59
60 if (!wpn || action_data.m_Player.GetItemInHands() != wpn || !action_data.m_Player.GetWeaponManager().IsRunning())
62 }
63
65 {
66 return -1;
67 }
68}
const int AC_SINGLE_USE
Definition _constants.c:2
void End()
called on surrender end request end
override bool CanBeUsedRaised()
override bool ActionConditionContinue(ActionData action_data)
void FirearmActionBase()
override bool CanBeUsedOnBack()
override float GetProgress(ActionData action_data)
override void Start(ActionData action_data)
override void OnUpdate(ActionData action_data)
override bool CanBePerformedFromInventory()
override int GetStanceMask(PlayerBase player)
override int GetActionCategory()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
const int UA_PROCESSING
Definition constants.c:434