Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
firearmactionbase.c
Go to the documentation of this file.
2 {
3  void FirearmActionBase();
4 
5  override int GetStanceMask(PlayerBase player)
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 
20  override bool ActionConditionContinue(ActionData action_data)
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  {
28  Weapon_Base wpn = Weapon_Base.Cast(item);
29  return wpn && wpn.CanProcessWeaponEvents() && !player.GetDayZPlayerInventory().IsProcessing();
30  }
31 
32  override void Start(ActionData action_data)
33  {
34  super.Start(action_data);
35 
36  action_data.m_State = UA_PROCESSING;
37  }
38 
39  override bool CanBePerformedFromInventory()
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 
54  override void OnUpdate(ActionData action_data)
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())
61  {
62  End(action_data);
63  }
64  }
65 
66  override float GetProgress(ActionData action_data)
67  {
68  return -1;
69  }
70 }
ItemBase
Definition: inventoryitem.c:730
End
void End()
called on surrender end request end
DefaultActionInput
Definition: actioninput.c:630
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
AC_SINGLE_USE
const int AC_SINGLE_USE
Definition: _constants.c:2
ActionBase
void ActionBase()
Definition: actionbase.c:73
Weapon_Base
shorthand
Definition: boltactionrifle_base.c:5
UA_PROCESSING
const int UA_PROCESSING
Definition: constants.c:434
FirearmActionBase
Definition: firearmactionbase.c:1