11 override void InitStateMachine()
14 m_abilities.Insert(
new AbilityRecord(WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_CLOSED));
15 m_abilities.Insert(
new AbilityRecord(WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_OPENED));
16 m_abilities.Insert(
new AbilityRecord(WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_ONEBULLET_CLOSED));
17 m_abilities.Insert(
new AbilityRecord(WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_ONEBULLET_OPENED));
18 m_abilities.Insert(
new AbilityRecord(WeaponActions.UNJAMMING, WeaponActionUnjammingTypes.UNJAMMING_START));
19 m_abilities.Insert(
new AbilityRecord(WeaponActions.UNJAMMING, WeaponActionUnjammingTypes.UNJAMMING_END));
20 m_abilities.Insert(
new AbilityRecord(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_NORMAL));
21 m_abilities.Insert(
new AbilityRecord(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_COCKED));
32 WeaponStateBase Mech_L =
new WeaponEjectBullet(
this, NULL, WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_CLOSED);
34 WeaponChambering Chamber_E =
new WeaponChambering(
this, NULL, WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_ONEBULLET_CLOSED);
35 WeaponChambering Chamber_F =
new WeaponChambering(
this, NULL, WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_ONEBULLET_OPENED);
38 WeaponStateBase Trigger_E =
new WeaponDryFire(
this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_COCKED);
40 WeaponStateBase Trigger_F =
new WeaponDryFire(
this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_COCKED);
42 WeaponStateBase Trigger_LJ =
new WeaponFireToJam(
this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_JAM);
63 m_fsm.AddTransition(
new WeaponTransition( Mech_F, _fin_,
F, NULL,
new WeaponGuardCurrentChamberFiredOut(
this)));
65 m_fsm.AddTransition(
new WeaponTransition( Mech_F, _abt_,
F, NULL,
new WeaponGuardCurrentChamberFiredOut(
this)));
70 m_fsm.AddTransition(
new WeaponTransition( Mech_L, _fin_,
E, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
72 m_fsm.AddTransition(
new WeaponTransition( Mech_L, _abt_,
E, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
77 m_fsm.AddTransition(
new WeaponTransition( Chamber_E, _fin_,
E, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
79 m_fsm.AddTransition(
new WeaponTransition( Chamber_E, _abt_,
E, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
83 m_fsm.AddTransition(
new WeaponTransition( Chamber_F, _fin_,
F, NULL,
new WeaponGuardCurrentChamberFiredOut(
this)));
84 m_fsm.AddTransition(
new WeaponTransition( Chamber_F, _fin_,
E, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
86 m_fsm.AddTransition(
new WeaponTransition( Chamber_F, _abt_,
F, NULL,
new WeaponGuardCurrentChamberFiredOut(
this)));
87 m_fsm.AddTransition(
new WeaponTransition( Chamber_F, _abt_,
E, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
111 m_fsm.AddTransition(
new WeaponTransition( Unjam_J, _fin_, J, NULL,
new WeaponGuardJammed(
this)));
116 bool discharged =
false;
127 SetInitialState(init_state);
129 SelectionBulletHide();
pair ( action, actionType )
charging of weapon without ammo to be chambered
signalize mechanism manipulation
weapon finite state machine
represents weapon's stable state (i.e. the basic states that the weapon will spend the most time in)
represent weapon state base
enum FSMTransition WeaponTransition