130 override void InitStateMachine()
132 m_abilities.Insert(
new AbilityRecord(WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_END));
133 m_abilities.Insert(
new AbilityRecord(WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_DOUBLE_1));
134 m_abilities.Insert(
new AbilityRecord(WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_DOUBLE_2));
135 m_abilities.Insert(
new AbilityRecord(WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_DOUBLE_3));
136 m_abilities.Insert(
new AbilityRecord(WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_DOUBLE_4));
138 m_abilities.Insert(
new AbilityRecord(WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_CLOSED));
139 m_abilities.Insert(
new AbilityRecord(WeaponActions.UNJAMMING, WeaponActionUnjammingTypes.UNJAMMING_START));
140 m_abilities.Insert(
new AbilityRecord(WeaponActions.UNJAMMING, WeaponActionUnjammingTypes.UNJAMMING_END));
142 m_abilities.Insert(
new AbilityRecord(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_NORMAL));
143 m_abilities.Insert(
new AbilityRecord(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_DRY));
160 ChamberMultiBullet Chamber_E =
new ChamberMultiBullet(
this, NULL, WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_DOUBLE_2,WeaponActionChamberingTypes.CHAMBERING_END);
161 ChamberMultiBullet Chamber_L_E =
new ChamberMultiBullet(
this, NULL, WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_DOUBLE_3,WeaponActionChamberingTypes.CHAMBERING_END);
162 ChamberMultiBullet Chamber_F_L =
new ChamberMultiBullet(
this, NULL, WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_DOUBLE_4,WeaponActionChamberingTypes.CHAMBERING_END);
163 ChamberMultiBullet Chamber_E_L =
new ChamberMultiBullet(
this, NULL, WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_DOUBLE_1,WeaponActionChamberingTypes.CHAMBERING_END);
172 WeaponStateBase Trigger_F_F =
new WeaponDryFire(
this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_DRY);
173 WeaponStateBase Trigger_F_E =
new WeaponDryFire(
this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_DRY);
174 WeaponStateBase Trigger_E_F =
new WeaponDryFire(
this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_DRY);
175 WeaponStateBase Trigger_E_E =
new WeaponDryFire(
this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_DRY);
198 m_fsm.AddTransition(
new WeaponTransition( Mech, _abt_, F_F, NULL,
new GuardAnd(
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.First),
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.Second))));
199 m_fsm.AddTransition(
new WeaponTransition( Mech, _abt_, F_E, NULL,
new GuardAnd(
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.First),
new WeaponGuardChamberEmpty(
this, MuzzleIndex.Second))));
200 m_fsm.AddTransition(
new WeaponTransition( Mech, _abt_, E_F, NULL,
new GuardAnd(
new WeaponGuardChamberEmpty(
this, MuzzleIndex.First),
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.Second))));
201 m_fsm.AddTransition(
new WeaponTransition( Mech, _abt_, F_L, NULL,
new GuardAnd(
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.First),
new WeaponGuardChamberFull(
this, MuzzleIndex.Second))));
202 m_fsm.AddTransition(
new WeaponTransition( Mech, _abt_, L_L, NULL,
new GuardAnd(
new WeaponGuardChamberFull(
this, MuzzleIndex.First),
new WeaponGuardChamberFull(
this, MuzzleIndex.Second))));
203 m_fsm.AddTransition(
new WeaponTransition( Mech, _abt_, L_E, NULL,
new GuardAnd(
new WeaponGuardChamberFull(
this, MuzzleIndex.First),
new WeaponGuardChamberEmpty(
this, MuzzleIndex.Second))));
204 m_fsm.AddTransition(
new WeaponTransition( Mech, _abt_, E_L, NULL,
new GuardAnd(
new WeaponGuardChamberEmpty(
this, MuzzleIndex.First),
new WeaponGuardChamberFull(
this, MuzzleIndex.Second))));
211 m_fsm.AddTransition(
new WeaponTransition( Chamber_E, _fin_, L_E, NULL,
new WeaponGuardChamberEmpty(
this, MuzzleIndex.Second)));
214 m_fsm.AddTransition(
new WeaponTransition( Chamber_E, _abt_, F_F, NULL,
new GuardAnd(
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.First),
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.Second))));
215 m_fsm.AddTransition(
new WeaponTransition( Chamber_E, _abt_, F_E, NULL,
new GuardAnd(
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.First),
new WeaponGuardChamberEmpty(
this, MuzzleIndex.Second))));
216 m_fsm.AddTransition(
new WeaponTransition( Chamber_E, _abt_, E_F, NULL,
new GuardAnd(
new WeaponGuardChamberEmpty(
this, MuzzleIndex.First),
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.Second))));
217 m_fsm.AddTransition(
new WeaponTransition( Chamber_E, _abt_, L_L, NULL,
new GuardAnd(
new WeaponGuardChamberFull(
this, MuzzleIndex.First),
new WeaponGuardChamberFull(
this, MuzzleIndex.Second))));
218 m_fsm.AddTransition(
new WeaponTransition( Chamber_E, _abt_, L_E, NULL,
new GuardAnd(
new WeaponGuardChamberFull(
this, MuzzleIndex.First),
new WeaponGuardChamberEmpty(
this, MuzzleIndex.Second))));
223 m_fsm.AddTransition(
new WeaponTransition( Chamber_L_E, _abt_, L_L, NULL,
new WeaponGuardChamberFull(
this, MuzzleIndex.Second)));
225 m_fsm.AddTransition(
new WeaponTransition( Chamber_L_E, _fin_, L_L, NULL,
new WeaponGuardChamberFull(
this, MuzzleIndex.Second)));
229 m_fsm.AddTransition(
new WeaponTransition( Chamber_E_L, _abt_, L_L, NULL,
new WeaponGuardChamberFull(
this, MuzzleIndex.First)));
231 m_fsm.AddTransition(
new WeaponTransition( Chamber_E_L, _fin_, L_L, NULL,
new WeaponGuardChamberFull(
this, MuzzleIndex.First)));
235 m_fsm.AddTransition(
new WeaponTransition( Chamber_F_L, _abt_, F_L, NULL,
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.First)));
236 m_fsm.AddTransition(
new WeaponTransition( Chamber_F_L, _abt_, L_L, NULL,
new GuardAnd(
new WeaponGuardChamberFull(
this, MuzzleIndex.First),
new WeaponGuardChamberFull(
this, MuzzleIndex.Second))));
237 m_fsm.AddTransition(
new WeaponTransition( Chamber_F_L, _abt_, E_L, NULL,
new GuardAnd(
new WeaponGuardChamberEmpty(
this, MuzzleIndex.First),
new WeaponGuardChamberFull(
this, MuzzleIndex.Second))));
239 m_fsm.AddTransition(
new WeaponTransition( Chamber_F_L, _fin_, F_L, NULL,
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.First)));
240 m_fsm.AddTransition(
new WeaponTransition( Chamber_F_L, _fin_, L_L, NULL,
new GuardAnd(
new WeaponGuardChamberFull(
this, MuzzleIndex.First),
new WeaponGuardChamberFull(
this, MuzzleIndex.Second))));
241 m_fsm.AddTransition(
new WeaponTransition( Chamber_F_L, _fin_, E_L, NULL,
new GuardAnd(
new WeaponGuardChamberEmpty(
this, MuzzleIndex.First),
new WeaponGuardChamberFull(
this, MuzzleIndex.Second))));
260 m_fsm.AddTransition(
new WeaponTransition( Trigger_L_L, _fin_, F_F, NULL,
new GuardAnd(
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.First),
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.Second))));
261 m_fsm.AddTransition(
new WeaponTransition( Trigger_L_L, _rto_, F_F, NULL,
new GuardAnd(
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.First),
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.Second))));
262 m_fsm.AddTransition(
new WeaponTransition( Trigger_L_L, _abt_, F_F, NULL,
new GuardAnd(
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.First),
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.Second))));
289 SetInitialState(E_E);
291 for(
int i = 0; i < GetMuzzleCount(); i++)
299 override bool CanChamberBullet (
int muzzleIndex, Magazine mag)
301 if( CanChamberFromMag(muzzleIndex, mag) )
303 if(IsChamberEmpty(muzzleIndex))
312 override void SetActions()
319 override void SetNextWeaponMode(
int muzzleIndex)
321 for (
int i = 0; i < GetMuzzleCount(); i++)
323 SetNextMuzzleMode(i);