Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
rifle_base.c
Go to the documentation of this file.
2 {
3  DEFAULT = 0,
4 };
5 
10 class Rifle_Base extends Weapon_Base
11 {
12  void Rifle_Base ()
13  {
14  }
15 
16  override void InitStateMachine ()
17  {
18  m_abilities.Insert(new AbilityRecord(WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_CLOSED));
19 
20  // setup state machine
21  // basic weapon states
22  WeaponStableState E = new WeaponStableState(this, NULL, DefaultAnimState.DEFAULT);
23 
24  WeaponStateBase Mech = new WeaponCharging(this, NULL, WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_CLOSED);
25 
26  // events
27  WeaponEventBase __M__ = new WeaponEventMechanism;
28  WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
29  WeaponEventBase _abt_ = new WeaponEventHumanCommandActionAborted;
30 
31  m_fsm = new WeaponFSM();
32  // charging
33  m_fsm.AddTransition(new WeaponTransition(E , __M__, Mech));
34  m_fsm.AddTransition(new WeaponTransition(Mech , _fin_, E));
35  m_fsm.AddTransition(new WeaponTransition(Mech , _abt_, E));
36 
37  SetInitialState(E);
38 
39  SelectionBulletHide();
40 
41  m_fsm.Start();
42  }
43 
44 };
45 
46 
E
@ E
EMPTY.
Definition: weaponstablestate.c:19
DefaultAnimState
DefaultAnimState
Definition: rifle_base.c:1
WeaponStableState
void WeaponStableState(Weapon_Base w=NULL, WeaponStateBase parent=NULL, int anim_state=-1)
Definition: weaponstablestate.c:32
WeaponActions
WeaponActions
actions
Definition: human.c:808
Rifle_Base
base for rifles @NOTE name copies config base class
Definition: sks.c:69
WeaponCharging
charging of weapon without ammo to be chambered
WeaponTransition
enum FSMTransition WeaponTransition
AbilityRecord
pair ( action, actionType )
Definition: weapon_base.c:4
WeaponEventBase
signalize mechanism manipulation
Definition: events.c:34
WeaponStateBase
represent weapon state base
Definition: bullethide.c:1
Weapon_Base
shorthand
Definition: boltactionrifle_base.c:5
WeaponFSM
weapon finite state machine
DEFAULT
@ DEFAULT
default weapon state, closed and discharged
Definition: rifle_base.c:3
WeaponStableState
represents weapon's stable state (i.e. the basic states that the weapon will spend the most time in)
Definition: crossbow.c:26