Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
weaponfirelast.c
Go to the documentation of this file.
1 
2 class WeaponFireLast extends WeaponStateBase
3 {
5  int m_actionType;
6 
7  float m_dtAccumulator;
8  ref WeaponFireWithEject m_fire;
9 
10  void WeaponFireLast (Weapon_Base w = NULL, WeaponStateBase parent = NULL, WeaponActions action = WeaponActions.NONE, int actionType = -1)
11  {
12  m_action = action;
13  m_actionType = actionType;
14 
15  // setup nested state machine
16  m_fire = new WeaponFireWithEject(m_weapon, this, m_action, m_actionType);
17 
18  // events
19  WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
20  WeaponEventReloadTimeout __to_ = new WeaponEventReloadTimeout;
21 
22  m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
23 
24  // transitions
25  m_fsm.AddTransition(new WeaponTransition(m_fire, _fin_, NULL));
26  m_fsm.AddTransition(new WeaponTransition(m_fire, __to_, NULL));
27 
28  m_fsm.SetInitialState(m_fire);
29  }
30 
31  override void OnEntry (WeaponEventBase e)
32  {
33  super.OnEntry(e);
34  if (e)
35  m_dtAccumulator = 0;
36  }
37 
38  override void OnExit (WeaponEventBase e)
39  {
40  m_dtAccumulator = 0;
41  super.OnExit(e);
42  }
43 };
44 
45 
OnExit
override void OnExit(HandEventBase e)
Definition: hand_states.c:28
m_dtAccumulator
class WeaponFireWithEject extends WeaponFire m_dtAccumulator
m_action
class WeaponEndAction extends WeaponStartAction m_action
WeaponActions
WeaponActions
actions
Definition: human.c:808
WeaponTransition
enum FSMTransition WeaponTransition
WeaponEventBase
signalize mechanism manipulation
Definition: events.c:34
WeaponStateBase
represent weapon state base
Definition: bullethide.c:1
m_weapon
class WeaponGuardIsDestroyed extends WeaponGuardBase m_weapon
Definition: guards.c:583
Weapon_Base
shorthand
Definition: boltactionrifle_base.c:5
WeaponFSM
weapon finite state machine
OnEntry
HandStateEquipped OnEntry
Definition: weaponchambering.c:208