39 override bool HasBullet () {
return false; }
41 override bool IsJammed () {
return false; }
53 override bool HasBullet () {
return false; }
55 override bool IsJammed () {
return false; }
67 override bool HasBullet () {
return true; }
69 override bool IsJammed () {
return false; }
81 override bool HasBullet () {
return false; }
83 override bool IsJammed () {
return false; }
95 override bool HasBullet () {
return true; }
97 override bool IsJammed () {
return true; }
109 override bool HasBullet () {
return true; }
111 override bool IsJammed () {
return true; }
136 override void InitStateMachine()
138 m_abilities.Insert(
new AbilityRecord(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_MAGAZINE_BULLET));
139 m_abilities.Insert(
new AbilityRecord(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_NOMAGAZINE_BULLET));
140 m_abilities.Insert(
new AbilityRecord(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_MAGAZINE_NOBULLET_OPEN));
141 m_abilities.Insert(
new AbilityRecord(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_NOMAGAZINE_NOBULLET_OPEN));
143 m_abilities.Insert(
new AbilityRecord(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOAD_MAGAZINE_DETACH));
145 m_abilities.Insert(
new AbilityRecord(WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_OPENED));
147 m_abilities.Insert(
new AbilityRecord(WeaponActions.UNJAMMING, WeaponActionUnjammingTypes.UNJAMMING_START));
148 m_abilities.Insert(
new AbilityRecord(WeaponActions.UNJAMMING, WeaponActionUnjammingTypes.UNJAMMING_END));
150 m_abilities.Insert(
new AbilityRecord(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_NORMAL));
151 m_abilities.Insert(
new AbilityRecord(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_DRY));
152 m_abilities.Insert(
new AbilityRecord(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_COCKED));
153 m_abilities.Insert(
new AbilityRecord(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_JAM));
169 WeaponCharging Mech_C1 =
new WeaponCharging(
this, NULL, WeaponActions.MECHANISM, GetWeaponSpecificCommand(WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_OPENED));
173 WeaponStateBase Trigger_C0 =
new WeaponDryFire(
this, NULL, WeaponActions.FIRE, GetWeaponSpecificCommand(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_DRY));
174 WeaponStateBase Trigger_C1 =
new WeaponDryFire(
this, NULL, WeaponActions.FIRE, GetWeaponSpecificCommand(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_DRY));
175 WeaponStateBase Trigger_O1E =
new WeaponDryFire(
this, NULL, WeaponActions.FIRE, GetWeaponSpecificCommand(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_COCKED));
176 WeaponStateBase Trigger_O0 =
new WeaponDryFire(
this, NULL, WeaponActions.FIRE, GetWeaponSpecificCommand(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_COCKED));
178 WeaponFireAndChamberNext Trigger_O1 =
new WeaponFireAndChamberNext(
this, NULL, WeaponActions.FIRE, GetWeaponSpecificCommand(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_NORMAL));
179 WeaponStateBase Trigger_O1L =
new WeaponFireLast(
this, NULL, WeaponActions.FIRE, GetWeaponSpecificCommand(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_NORMAL));
180 WeaponStateBase Trigger_O1J =
new WeaponFireToJam(
this, NULL, WeaponActions.FIRE, GetWeaponSpecificCommand(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_JAM));
182 WeaponStateBase Trigger_J0 =
new WeaponDryFire(
this, NULL, WeaponActions.FIRE, GetWeaponSpecificCommand(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_DRY));
183 WeaponStateBase Trigger_J1 =
new WeaponDryFire(
this, NULL, WeaponActions.FIRE, GetWeaponSpecificCommand(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_DRY));
187 WeaponStateBase Unjam_J0 =
new WeaponUnjamming(
this, NULL, WeaponActions.UNJAMMING, GetWeaponSpecificCommand(WeaponActions.UNJAMMING, WeaponActionUnjammingTypes.UNJAMMING_START));
188 WeaponStateBase Unjam_J1 =
new WeaponUnjamming(
this, NULL, WeaponActions.UNJAMMING, GetWeaponSpecificCommand(WeaponActions.UNJAMMING, WeaponActionUnjammingTypes.UNJAMMING_START));
192 WeaponAttachMagazineOpenBoltCharged Attach_C0 =
new WeaponAttachMagazineOpenBoltCharged(
this, NULL, WeaponActions.RELOAD, GetWeaponSpecificCommand(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_NOMAGAZINE_NOBULLET_OPEN));
193 WeaponAttachMagazineOpenBoltCharged Attach_O0 =
new WeaponAttachMagazineOpenBoltCharged(
this, NULL, WeaponActions.RELOAD, GetWeaponSpecificCommand(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_NOMAGAZINE_BULLET));
194 WeaponAttachMagazineOpenBoltCharged Attach_J0 =
new WeaponAttachMagazineOpenBoltCharged(
this, NULL, WeaponActions.RELOAD, GetWeaponSpecificCommand(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_NOMAGAZINE_BULLET));
200 WeaponDetachingMagOpenBolt Detach_C1 =
new WeaponDetachingMagOpenBolt(
this, NULL, WeaponActions.RELOAD, GetWeaponSpecificCommand(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_MAGAZINE_DETACH));
201 WeaponDetachingMagOpenBolt Detach_O1 =
new WeaponDetachingMagOpenBolt(
this, NULL, WeaponActions.RELOAD, GetWeaponSpecificCommand(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_MAGAZINE_DETACH));
202 WeaponDetachingMagOpenBolt Detach_J1 =
new WeaponDetachingMagOpenBolt(
this, NULL, WeaponActions.RELOAD, GetWeaponSpecificCommand(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_MAGAZINE_DETACH));
223 m_fsm.AddTransition(
new WeaponTransition( Mech_C1, _fin_, O1E, NULL,
new WeaponGuardCurrentChamberEmpty(
this) ));
226 m_fsm.AddTransition(
new WeaponTransition( Mech_C1, _abt_, O1E, NULL,
new WeaponGuardCurrentChamberEmpty(
this) ));
283 m_fsm.AddTransition(
new WeaponTransition( C0, __A__, Attach_C0, NULL,
new WeaponGuardCanAttachMag(
this)));
284 m_fsm.AddTransition(
new WeaponTransition( Attach_C0, _fin_, C0, NULL,
new GuardNot(
new WeaponGuardHasMag(
this))) );
286 m_fsm.AddTransition(
new WeaponTransition( Attach_C0, _fin_, O1E, NULL,
new WeaponGuardChamberEmpty(
this)) );
288 m_fsm.AddTransition(
new WeaponTransition( Attach_C0, _abt_, C0, NULL,
new GuardNot(
new WeaponGuardHasMag(
this))) );
290 m_fsm.AddTransition(
new WeaponTransition( Attach_C0, _abt_, O1E, NULL,
new WeaponGuardChamberEmpty(
this)) );
293 m_fsm.AddTransition(
new WeaponTransition( O0, __A__, Attach_O0, NULL,
new WeaponGuardCanAttachMag(
this)));
294 m_fsm.AddTransition(
new WeaponTransition( Attach_O0, _fin_, O0, NULL,
new GuardNot(
new WeaponGuardHasMag(
this))));
295 m_fsm.AddTransition(
new WeaponTransition( Attach_O0, _fin_, O1E, NULL,
new WeaponGuardChamberEmpty(
this)));
297 m_fsm.AddTransition(
new WeaponTransition( Attach_O0, _abt_, O0, NULL,
new GuardNot(
new WeaponGuardHasMag(
this))));
298 m_fsm.AddTransition(
new WeaponTransition( Attach_O0, _abt_, O1E, NULL,
new WeaponGuardChamberEmpty(
this)));
301 m_fsm.AddTransition(
new WeaponTransition( J0, __A__, Attach_J0, NULL,
new WeaponGuardCanAttachMag(
this)));
302 m_fsm.AddTransition(
new WeaponTransition( Attach_J0, _fin_, J1, NULL,
new WeaponGuardHasMag(
this)));
304 m_fsm.AddTransition(
new WeaponTransition( Attach_J0, _abt_, J1, NULL,
new WeaponGuardHasMag(
this)));
309 m_fsm.AddTransition(
new WeaponTransition( C1, __S__, Reload_C1, NULL,
new WeaponGuardCanSwapMag(
this)));
310 m_fsm.AddTransition(
new WeaponTransition( Reload_C1, _fin_, C0, NULL,
new GuardNot(
new WeaponGuardHasMag(
this))) );
312 m_fsm.AddTransition(
new WeaponTransition( Reload_C1, _fin_, O1E, NULL,
new WeaponGuardChamberEmpty(
this)));
314 m_fsm.AddTransition(
new WeaponTransition( Reload_C1, _abt_, C0, NULL,
new GuardNot(
new WeaponGuardHasMag(
this))) );
316 m_fsm.AddTransition(
new WeaponTransition( Reload_C1, _abt_, O1E, NULL,
new WeaponGuardChamberEmpty(
this)));
319 m_fsm.AddTransition(
new WeaponTransition( O1, __S__, Reload_O1, NULL,
new WeaponGuardCanSwapMag(
this)));
320 m_fsm.AddTransition(
new WeaponTransition( O1E, __S__, Reload_O1, NULL,
new WeaponGuardCanSwapMag(
this)));
321 m_fsm.AddTransition(
new WeaponTransition( Reload_O1, _fin_, O0, NULL,
new GuardNot(
new WeaponGuardHasMag(
this))) );
322 m_fsm.AddTransition(
new WeaponTransition( Reload_O1, _fin_, O1E, NULL,
new WeaponGuardChamberEmpty(
this)) );
324 m_fsm.AddTransition(
new WeaponTransition( Reload_O1, _abt_, O0, NULL,
new GuardNot(
new WeaponGuardHasMag(
this))) );
325 m_fsm.AddTransition(
new WeaponTransition( Reload_O1, _abt_, O1E, NULL,
new WeaponGuardChamberEmpty(
this)) );
328 m_fsm.AddTransition(
new WeaponTransition( J1, __S__, Reload_J1, NULL,
new WeaponGuardCanSwapMag(
this)));
329 m_fsm.AddTransition(
new WeaponTransition( Reload_J1, _fin_, J1, NULL,
new WeaponGuardHasMag(
this)));
331 m_fsm.AddTransition(
new WeaponTransition( Reload_J1, _abt_, J1, NULL,
new WeaponGuardHasMag(
this)));
337 m_fsm.AddTransition(
new WeaponTransition( C1, __D__, Detach_C1, NULL,
new WeaponGuardCanDetachMag(
this)));
338 m_fsm.AddTransition(
new WeaponTransition( Detach_C1, _fin_, C1, NULL,
new WeaponGuardHasMag(
this)));
340 m_fsm.AddTransition(
new WeaponTransition( Detach_C1, _abt_, C1, NULL,
new WeaponGuardHasMag(
this)));
343 m_fsm.AddTransition(
new WeaponTransition( O1E, __D__, Detach_O1, NULL,
new WeaponGuardCanDetachMag(
this)));
344 m_fsm.AddTransition(
new WeaponTransition( O1, __D__, Detach_O1, NULL,
new WeaponGuardCanDetachMag(
this)));
345 m_fsm.AddTransition(
new WeaponTransition( Detach_O1, _fin_, O0, NULL,
new GuardNot(
new WeaponGuardHasMag(
this))));
346 m_fsm.AddTransition(
new WeaponTransition( Detach_O1, _fin_, O1E, NULL,
new WeaponGuardChamberEmpty(
this)));
348 m_fsm.AddTransition(
new WeaponTransition( Detach_O1, _abt_, O0, NULL,
new GuardNot(
new WeaponGuardHasMag(
this))));
349 m_fsm.AddTransition(
new WeaponTransition( Detach_O1, _abt_, O1E, NULL,
new WeaponGuardChamberEmpty(
this)));
352 m_fsm.AddTransition(
new WeaponTransition( J1, __D__, Detach_J1, NULL,
new WeaponGuardCanDetachMag(
this)));
353 m_fsm.AddTransition(
new WeaponTransition( Detach_J1, _fin_, J1, NULL,
new WeaponGuardHasMag(
this)));
355 m_fsm.AddTransition(
new WeaponTransition( Detach_J1, _abt_, J1, NULL,
new WeaponGuardHasMag(
this)));
361 m_fsm.AddTransition(
new WeaponTransition( Unjam_J0, _fin_, J0, NULL,
new WeaponGuardJammed(
this)));
363 m_fsm.AddTransition(
new WeaponTransition( Unjam_J0, _abt_, J0, NULL,
new WeaponGuardJammed(
this)));
367 m_fsm.AddTransition(
new WeaponTransition( Unjam_J1, _fin_, J1, NULL,
new WeaponGuardJammed(
this)));
368 m_fsm.AddTransition(
new WeaponTransition( Unjam_J1, _fin_, O1E, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
370 m_fsm.AddTransition(
new WeaponTransition( Unjam_J1, _abt_, J1, NULL,
new WeaponGuardJammed(
this)));
371 m_fsm.AddTransition(
new WeaponTransition( Unjam_J1, _abt_, O1E, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
376 SelectionBulletHide();
void RemoveAction(typename actionName)
pair ( action, actionType )
base for automatic weapons fireing from open bolt position @NOTE name copies config base class
base for rifles @NOTE name copies config base class
charging of weapon without ammo to be chambered
signalize mechanism manipulation
weapon finite state machine
replace current magazine with new one for weapon charged with open position bolt
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()
FirearmActionLoadBullet FirearmActionBase FirearmActionLoadBulletQuick()
class WeaponGuardIsDestroyed extends WeaponGuardBase m_weapon
void WeaponGuardHasAmmo(Weapon_Base w=NULL)
void WeaponGuardWeaponDischarged(Weapon_Base w=NULL)
override int GetCurrentStateID()
override bool IsBoltOpen()
@ CLOSED
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
bool IsDischarged()
Whether the gun is discharged.