DayZ 1.24
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{
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
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
DefaultAnimState
Definition Rifle_Base.c:2
@ DEFAULT
default weapon state, closed and discharged
Definition Rifle_Base.c:3
enum FSMTransition WeaponTransition
@ E
EMPTY.
void WeaponStableState(Weapon_Base w=NULL, WeaponStateBase parent=NULL, int anim_state=-1)
pair ( action, actionType )
Definition Weapon_Base.c:5
base for rifles @NOTE name copies config base class
Definition SKS.c:70
override void InitStateMachine()
Definition Rifle_Base.c:16
void Rifle_Base()
Definition Rifle_Base.c:12
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
WeaponActions
actions
Definition human.c:796