131 {
138
139
140 m_abilities.Insert(
new AbilityRecord(
WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_CLOSED));
143
146
147
148
149
158
159
160 WeaponStateBase Mech =
new WeaponCharging(
this, NULL,
WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_CLOSED);
161
164
168
170
175
180
184
189
190 m_fsm = new WeaponFSM();
191
201
202 m_fsm.AddTransition(
new WeaponTransition( Mech, _abt_,
F_F, NULL,
new GuardAnd(
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.First),
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.Second))));
203 m_fsm.AddTransition(
new WeaponTransition( Mech, _abt_,
F_E, NULL,
new GuardAnd(
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.First),
new WeaponGuardChamberEmpty(
this, MuzzleIndex.Second))));
204 m_fsm.AddTransition(
new WeaponTransition( Mech, _abt_,
E_F, NULL,
new GuardAnd(
new WeaponGuardChamberEmpty(
this, MuzzleIndex.First),
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.Second))));
205 m_fsm.AddTransition(
new WeaponTransition( Mech, _abt_,
F_L, NULL,
new GuardAnd(
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.First),
new WeaponGuardChamberFull(
this, MuzzleIndex.Second))));
206 m_fsm.AddTransition(
new WeaponTransition( Mech, _abt_,
L_L, NULL,
new GuardAnd(
new WeaponGuardChamberFull(
this, MuzzleIndex.First),
new WeaponGuardChamberFull(
this, MuzzleIndex.Second))));
207 m_fsm.AddTransition(
new WeaponTransition( Mech, _abt_,
L_E, NULL,
new GuardAnd(
new WeaponGuardChamberFull(
this, MuzzleIndex.First),
new WeaponGuardChamberEmpty(
this, MuzzleIndex.Second))));
208 m_fsm.AddTransition(
new WeaponTransition( Mech, _abt_,
E_L, NULL,
new GuardAnd(
new WeaponGuardChamberEmpty(
this, MuzzleIndex.First),
new WeaponGuardChamberFull(
this, MuzzleIndex.Second))));
210
212 m_fsm.AddTransition(
new WeaponTransition( Chamber_E, _fin_,
L_E, NULL,
new WeaponGuardChamberEmpty(
this, MuzzleIndex.Second)));
214
215 m_fsm.AddTransition(
new WeaponTransition( Chamber_E, _abt_,
L_L, NULL,
new GuardAnd(
new WeaponGuardChamberFull(
this, MuzzleIndex.First),
new WeaponGuardChamberFull(
this, MuzzleIndex.Second))));
216 m_fsm.AddTransition(
new WeaponTransition( Chamber_E, _abt_,
L_E, NULL,
new GuardAnd(
new WeaponGuardChamberFull(
this, MuzzleIndex.First),
new WeaponGuardChamberEmpty(
this, MuzzleIndex.Second))));
218
222
223 m_fsm.AddTransition(
new WeaponTransition( Chamber_F, _fin_,
L_E, NULL,
new WeaponGuardChamberEmpty(
this, MuzzleIndex.Second)));
225
226 m_fsm.AddTransition(
new WeaponTransition( Chamber_F, _abt_,
F_F, NULL,
new GuardAnd(
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.First),
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.Second))));
227 m_fsm.AddTransition(
new WeaponTransition( Chamber_F, _abt_,
F_E, NULL,
new GuardAnd(
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.First),
new WeaponGuardChamberEmpty(
this, MuzzleIndex.Second))));
228 m_fsm.AddTransition(
new WeaponTransition( Chamber_F, _abt_,
E_F, NULL,
new GuardAnd(
new WeaponGuardChamberEmpty(
this, MuzzleIndex.First),
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.Second))));
229 m_fsm.AddTransition(
new WeaponTransition( Chamber_F, _abt_,
L_L, NULL,
new GuardAnd(
new WeaponGuardChamberFull(
this, MuzzleIndex.First),
new WeaponGuardChamberFull(
this, MuzzleIndex.Second))));
230 m_fsm.AddTransition(
new WeaponTransition( Chamber_F, _abt_,
L_E, NULL,
new GuardAnd(
new WeaponGuardChamberFull(
this, MuzzleIndex.First),
new WeaponGuardChamberEmpty(
this, MuzzleIndex.Second))));
232
233
235 m_fsm.AddTransition(
new WeaponTransition( Chamber_L_E, _abt_,
L_L, NULL,
new WeaponGuardChamberFull(
this, MuzzleIndex.Second)));
237 m_fsm.AddTransition(
new WeaponTransition( Chamber_L_E, _fin_,
L_L, NULL,
new WeaponGuardChamberFull(
this, MuzzleIndex.Second)));
239
241 m_fsm.AddTransition(
new WeaponTransition( Chamber_E_L, _abt_,
L_L, NULL,
new WeaponGuardChamberFull(
this, MuzzleIndex.First)));
243 m_fsm.AddTransition(
new WeaponTransition( Chamber_E_L, _fin_,
L_L, NULL,
new WeaponGuardChamberFull(
this, MuzzleIndex.First)));
245
247 m_fsm.AddTransition(
new WeaponTransition( Chamber_F_L, _abt_,
F_L, NULL,
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.First)));
248 m_fsm.AddTransition(
new WeaponTransition( Chamber_F_L, _abt_,
L_L, NULL,
new GuardAnd(
new WeaponGuardChamberFull(
this, MuzzleIndex.First),
new WeaponGuardChamberFull(
this, MuzzleIndex.Second))));
249 m_fsm.AddTransition(
new WeaponTransition( Chamber_F_L, _abt_,
E_L, NULL,
new GuardAnd(
new WeaponGuardChamberEmpty(
this, MuzzleIndex.First),
new WeaponGuardChamberFull(
this, MuzzleIndex.Second))));
251 m_fsm.AddTransition(
new WeaponTransition( Chamber_F_L, _fin_,
F_L, NULL,
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.First)));
252 m_fsm.AddTransition(
new WeaponTransition( Chamber_F_L, _fin_,
L_L, NULL,
new GuardAnd(
new WeaponGuardChamberFull(
this, MuzzleIndex.First),
new WeaponGuardChamberFull(
this, MuzzleIndex.Second))));
253 m_fsm.AddTransition(
new WeaponTransition( Chamber_F_L, _fin_,
E_L, NULL,
new GuardAnd(
new WeaponGuardChamberEmpty(
this, MuzzleIndex.First),
new WeaponGuardChamberFull(
this, MuzzleIndex.Second))));
255
260
265
270
272 m_fsm.AddTransition(
new WeaponTransition( Trigger_L_L, _fin_,
F_F, NULL,
new GuardAnd(
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.First),
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.Second))));
273 m_fsm.AddTransition(
new WeaponTransition( Trigger_L_L, _rto_,
F_F, NULL,
new GuardAnd(
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.First),
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.Second))));
274 m_fsm.AddTransition(
new WeaponTransition( Trigger_L_L, _abt_,
F_F, NULL,
new GuardAnd(
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.First),
new WeaponGuardChamberFiredOut(
this, MuzzleIndex.Second))));
278
283
288
293
298
299
300
301 SetInitialState(
E_E);
302
303 for(int i = 0; i < GetMuzzleCount(); i++)
304 {
305 HideBullet(i);
306 }
307 m_fsm.Start();
308
309 }
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
int GetAnimationForChamberingWithEjection()
ref WeaponStableState E_F
WeaponActionChamberingTypes
WeaponActionUnjammingTypes