Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
rifle_base.c
Go to the documentation of this file.
2{
3 DEFAULT = 0,
4};
5
10class 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
pair ( action, actionType )
Definition weapon_base.c:5
base for rifles @NOTE name copies config base class
Definition sks.c:70
charging of weapon without ammo to be chambered
signalize mechanism manipulation
Definition events.c:35
weapon finite state machine
represents weapon's stable state (i.e. the basic states that the weapon will spend the most time in)
Definition crossbow.c:27
represent weapon state base
Definition bullethide.c:2
DefaultAnimState
Definition rifle_base.c:2
@ DEFAULT
default weapon state, closed and discharged
Definition rifle_base.c:3
enum FSMTransition WeaponTransition
void WeaponStableState(Weapon_Base w=NULL, WeaponStateBase parent=NULL, int anim_state=-1)