34 override bool HasBullet () {
return true; }
36 override bool IsJammed () {
return false; }
45 override bool HasBullet () {
return true; }
47 override bool IsJammed () {
return false; }
56 override bool HasBullet () {
return true; }
58 override bool IsJammed () {
return true; }
75 override void InitStateMachine ()
77 m_abilities.Insert(
new AbilityRecord(WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_CLOSED));
78 m_abilities.Insert(
new AbilityRecord(WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_OPENED));
79 m_abilities.Insert(
new AbilityRecord(WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_STARTLOOPABLE_SHOTGUN_COCKED));
80 m_abilities.Insert(
new AbilityRecord(WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_STARTLOOPABLE_SHOTGUN_UNCOCKED));
81 m_abilities.Insert(
new AbilityRecord(WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_ENDLOOPABLE));
82 m_abilities.Insert(
new AbilityRecord(WeaponActions.UNJAMMING, WeaponActionUnjammingTypes.UNJAMMING_START));
83 m_abilities.Insert(
new AbilityRecord(WeaponActions.UNJAMMING, WeaponActionUnjammingTypes.UNJAMMING_END));
84 m_abilities.Insert(
new AbilityRecord(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_NORMAL));
85 m_abilities.Insert(
new AbilityRecord(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_COCKED));
86 m_abilities.Insert(
new AbilityRecord(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_UNCOCKED));
87 m_abilities.Insert(
new AbilityRecord(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_DRY));
89 D0 =
new RPTEmptyDischarged(
this, NULL,
RPTAnimState.DEFAULT);
90 C0 =
new RPTEmptyDischarged(
this, NULL,
RPTAnimState.CHARGED);
91 DF =
new RPTLoadedDischarged(
this, NULL,
RPTAnimState.DEFAULT);
92 C1 =
new RPTLoadedCharged(
this, NULL,
RPTAnimState.CHARGED);
93 JF =
new RPTLoadedJammed(
this, NULL,
RPTAnimState.JAMMED);
96 WeaponStateBase Mech_C1 =
new WeaponChargingInnerMag(
this, NULL, WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_OPENED);
97 WeaponStateBase Mech_DF =
new WeaponChargingInnerMag(
this, NULL, WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_CLOSED);
99 LoopedChamberingEjectLast Chamber_D0 =
new LoopedChamberingEjectLast(
this, NULL, WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_STARTLOOPABLE_SHOTGUN_UNCOCKED, WeaponActionChamberingTypes.CHAMBERING_ENDLOOPABLE);
100 LoopedChamberingEjectLast Chamber_C0 =
new LoopedChamberingEjectLast(
this, NULL, WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_STARTLOOPABLE_SHOTGUN_UNCOCKED, WeaponActionChamberingTypes.CHAMBERING_ENDLOOPABLE);
101 LoopedChamberingEjectLast Chamber_C1 =
new LoopedChamberingEjectLast(
this, NULL, WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_STARTLOOPABLE_SHOTGUN_COCKED, WeaponActionChamberingTypes.CHAMBERING_ENDLOOPABLE);
102 LoopedChamberingEjectLast Chamber_DF =
new LoopedChamberingEjectLast(
this, NULL, WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_STARTLOOPABLE_SHOTGUN_UNCOCKED, WeaponActionChamberingTypes.CHAMBERING_ENDLOOPABLE);
106 WeaponStateBase Trigger_D0 =
new WeaponDryFire(
this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_DRY);
107 WeaponStateBase Trigger_C0 =
new WeaponDryFire(
this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_NORMAL);
109 WeaponStateBase Trigger_DF =
new WeaponDryFire(
this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_DRY);
110 WeaponStateBase Trigger_JF =
new WeaponDryFire(
this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_DRY);
112 WeaponStateBase Trigger_C1J =
new WeaponFireToJam(
this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_JAM);
133 m_fsm.AddTransition(
new WeaponTransition( Mech_C1, _fin_, C0, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
135 m_fsm.AddTransition(
new WeaponTransition( Mech_C1, _abt_, C0, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
139 m_fsm.AddTransition(
new WeaponTransition( Mech_DF, _fin_, C0, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
140 m_fsm.AddTransition(
new WeaponTransition( Mech_DF, _fin_, DF, NULL,
new WeaponGuardCurrentChamberFiredOut(
this)));
142 m_fsm.AddTransition(
new WeaponTransition( Mech_DF, _abt_, C0, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
143 m_fsm.AddTransition(
new WeaponTransition( Mech_DF, _abt_, DF, NULL,
new WeaponGuardCurrentChamberFiredOut(
this)));
152 m_fsm.AddTransition(
new WeaponTransition( Chamber_D0, _abt_, C0, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
155 m_fsm.AddTransition(
new WeaponTransition( C1, __L__, Chamber_C1, NULL,
new GuardNot(
new WeaponGuardInnerMagazineFull(
this))));
159 m_fsm.AddTransition(
new WeaponTransition( DF, __L__, Chamber_DF, NULL,
new GuardNot(
new WeaponGuardInnerMagazineFull(
this))));
161 m_fsm.AddTransition(
new WeaponTransition( Chamber_DF, _abt_, DF, NULL,
new WeaponGuardCurrentChamberFiredOut(
this)));
167 m_fsm.AddTransition(
new WeaponTransition( Unjam_JF, _fin_, JF, NULL,
new WeaponGuardJammed(
this)));
168 m_fsm.AddTransition(
new WeaponTransition( Unjam_JF, _fin_, C0, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
170 m_fsm.AddTransition(
new WeaponTransition( Unjam_JF, _abt_, JF, NULL,
new WeaponGuardJammed(
this)));
171 m_fsm.AddTransition(
new WeaponTransition( Unjam_JF, _abt_, C0, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
213 SelectionBulletHide();
219 override bool CanChamberBullet (
int muzzleIndex, Magazine mag)
221 return CanChamberFromMag(muzzleIndex, mag) && !IsInternalMagazineFull(muzzleIndex);
241 override void OnDebugSpawn()
243 super.OnDebugSpawn();
246 if (
Class.CastTo(entity,
this) )
248 entity.SpawnEntityOnGroundPos(
"Ammo_357", entity.GetPosition());
void AddAction(typename actionName)
pair ( action, actionType )
Super root of all classes in Enforce script.
base for rifles @NOTE name copies config base class
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
override bool IsRepairEnabled()
override bool HasBullet()
override void InitMuzzleArray()
override bool HasMagazine()
class WeaponGuardIsDestroyed extends WeaponGuardBase m_weapon
override int GetCurrentStateID()
@ DEFAULT
default weapon state, closed and discharged
class SSPFireout extends WeaponStableState OnEntry
enum FSMTransition WeaponTransition
class WeaponChambering_Chamber_OnEntry extends WeaponChambering_Base OnExit
ref array< MuzzleState > m_muzzleHasBullet