131 {
137
138 m_abilities.Insert(
new AbilityRecord(
WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_CLOSED));
141
144
145
146
147
156
157
158 WeaponStateBase Mech =
new WeaponCharging(
this, NULL,
WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_CLOSED);
159
164
166
171
176
180
185
186 m_fsm = new WeaponFSM();
187
197
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))));
206
211 m_fsm.AddTransition(
new WeaponTransition( Chamber_E, _fin_,
L_E, NULL,
new WeaponGuardChamberEmpty(
this, MuzzleIndex.Second)));
213
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))));
220
221
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)));
227
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)));
233
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))));
243
248
253
258
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))));
266
271
276
281
286
287
288
289 SetInitialState(
E_E);
290
291 for(int i = 0; i < GetMuzzleCount(); i++)
292 {
293 HideBullet(i);
294 }
295 m_fsm.Start();
296
297 }
enum FSMTransition WeaponTransition
enum FSMTransition WeaponEventBase
void ChamberMultiBullet(Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int startActionType=-1, int endActionType=-1)
ref WeaponStableState L_L
ref WeaponStableState L_E
ref WeaponStableState E_E
ref WeaponStableState E_L
ref WeaponStableState F_L
ref WeaponStableState F_E
ref WeaponStableState F_F
ref WeaponStableState E_F
WeaponActionChamberingTypes
WeaponActionUnjammingTypes