37 override bool HasBullet () {
return true; }
39 override bool IsJammed () {
return false; }
48 override bool HasBullet () {
return true; }
50 override bool IsJammed () {
return false; }
59 override bool HasBullet () {
return false; }
61 override bool IsJammed () {
return false; }
70 override bool HasBullet () {
return false; }
72 override bool IsJammed () {
return false; }
82 override bool HasBullet () {
return false; }
84 override bool IsJammed () {
return false; }
94 override bool HasBullet () {
return true; }
96 override bool IsJammed () {
return true; }
106 override bool HasBullet () {
return true; }
108 override bool IsJammed () {
return true; }
130 void RifleBoltLock_Base ()
134 override void InitStateMachine()
246 m_fsm.AddTransition(
new WeaponTransition( Mech_C10, _fin_, C00, NULL,
new WeaponGuardCurrentChamberEmpty(
this) ));
248 m_fsm.AddTransition(
new WeaponTransition( Mech_C10, _abt_, C00, NULL,
new WeaponGuardCurrentChamberEmpty(
this) ));
252 m_fsm.AddTransition(
new WeaponTransition( Mech_C11, _fin_, C01, NULL,
new WeaponGuardCurrentChamberEmpty(
this) ));
254 m_fsm.AddTransition(
new WeaponTransition( Mech_C11, _abt_, C01, NULL,
new WeaponGuardCurrentChamberEmpty(
this) ));
259 m_fsm.AddTransition(
new WeaponTransition( Mech_C01, _fin_, C01, NULL,
new WeaponGuardCurrentChamberEmpty(
this) ));
261 m_fsm.AddTransition(
new WeaponTransition( Mech_C01, _abt_, C01, NULL,
new WeaponGuardCurrentChamberEmpty(
this) ));
272 m_fsm.AddTransition(
new WeaponTransition( Mech_O01, _fin_, C01, NULL,
new WeaponGuardCurrentChamberEmpty(
this) ));
275 m_fsm.AddTransition(
new WeaponTransition( Mech_O01, _abt_, C01, NULL,
new WeaponGuardCurrentChamberEmpty(
this) ));
339 m_fsm.AddTransition(
new WeaponTransition( Chamber_C00, _fin_, C00, NULL,
new WeaponGuardChamberEmpty(
this)));
342 m_fsm.AddTransition(
new WeaponTransition( Chamber_C00, _abt_, C00, NULL,
new WeaponGuardChamberEmpty(
this)));
347 m_fsm.AddTransition(
new WeaponTransition( Chamber_C01, _fin_, C01, NULL,
new WeaponGuardChamberEmpty(
this)));
350 m_fsm.AddTransition(
new WeaponTransition( Chamber_C01, _abt_, C01, NULL,
new WeaponGuardChamberEmpty(
this)));
354 m_fsm.AddTransition(
new WeaponTransition( Chamber_O00, _fin_ , O00, NULL,
new WeaponGuardCurrentChamberEmpty(
this) ));
356 m_fsm.AddTransition(
new WeaponTransition( Chamber_O00, _abt_ , O00, NULL,
new WeaponGuardCurrentChamberEmpty(
this) ));
360 m_fsm.AddTransition(
new WeaponTransition( Chamber_O01, _fin_, O01, NULL,
new WeaponGuardCurrentChamberEmpty(
this) ));
362 m_fsm.AddTransition(
new WeaponTransition( Chamber_O01, _abt_, O01, NULL,
new WeaponGuardCurrentChamberEmpty(
this) ));
366 m_fsm.AddTransition(
new WeaponTransition( C00, __A__, Attach_C00, NULL,
new WeaponGuardCanAttachMag(
this)));
367 m_fsm.AddTransition(
new WeaponTransition( Attach_C00, _fin_, C00, NULL,
new GuardNot(
new WeaponGuardHasMag(
this))) );
368 m_fsm.AddTransition(
new WeaponTransition( Attach_C00, _fin_, C01, NULL,
new WeaponGuardCurrentChamberEmpty(
this)) );
370 m_fsm.AddTransition(
new WeaponTransition( Attach_C00, _abt_, C00, NULL,
new GuardNot(
new WeaponGuardHasMag(
this))) );
371 m_fsm.AddTransition(
new WeaponTransition( Attach_C00, _abt_, C01, NULL,
new WeaponGuardCurrentChamberEmpty(
this)) );
374 m_fsm.AddTransition(
new WeaponTransition( C10, __A__, Attach_C10, NULL,
new WeaponGuardCanAttachMag(
this)));
375 m_fsm.AddTransition(
new WeaponTransition( Attach_C10, _fin_, C11, NULL,
new WeaponGuardHasMag(
this)) );
377 m_fsm.AddTransition(
new WeaponTransition( Attach_C10, _abt_, C11, NULL,
new WeaponGuardHasMag(
this)) );
380 m_fsm.AddTransition(
new WeaponTransition( O00, __A__, Attach_O00, NULL,
new WeaponGuardCanAttachMag(
this)));
381 m_fsm.AddTransition(
new WeaponTransition( Attach_O00, _fin_, O00, NULL,
new GuardNot(
new WeaponGuardHasMag(
this))));
383 m_fsm.AddTransition(
new WeaponTransition( Attach_O00, _fin_, C01, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
385 m_fsm.AddTransition(
new WeaponTransition( Attach_O00, _abt_, O00, NULL,
new GuardNot(
new WeaponGuardHasMag(
this))));
387 m_fsm.AddTransition(
new WeaponTransition( Attach_O00, _abt_, C01, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
390 m_fsm.AddTransition(
new WeaponTransition( JF0, __A__, Attach_JF0, NULL,
new WeaponGuardCanAttachMag(
this)));
391 m_fsm.AddTransition(
new WeaponTransition( Attach_JF0, _fin_, JF1, NULL,
new WeaponGuardHasMag(
this)));
393 m_fsm.AddTransition(
new WeaponTransition( Attach_JF0, _abt_, JF1, NULL,
new WeaponGuardHasMag(
this)));
398 m_fsm.AddTransition(
new WeaponTransition( C11, __S__, Reload_C11, NULL,
new WeaponGuardCanSwapMag(
this)));
399 m_fsm.AddTransition(
new WeaponTransition( Reload_C11, _fin_, C11, NULL,
new WeaponGuardHasMag(
this)));
401 m_fsm.AddTransition(
new WeaponTransition( Reload_C11, _abt_, C11, NULL,
new WeaponGuardHasMag(
this)));
405 m_fsm.AddTransition(
new WeaponTransition( C01, __S__, Reload_C01, NULL,
new WeaponGuardCanSwapMag(
this)));
406 m_fsm.AddTransition(
new WeaponTransition( Reload_C01, _fin_, C11, NULL,
new WeaponGuardCurrentChamberFull(
this)) );
407 m_fsm.AddTransition(
new WeaponTransition( Reload_C01, _fin_, C01, NULL,
new WeaponGuardHasMag(
this)) );
409 m_fsm.AddTransition(
new WeaponTransition( Reload_C01, _abt_, C11, NULL,
new WeaponGuardCurrentChamberFull(
this)) );
410 m_fsm.AddTransition(
new WeaponTransition( Reload_C01, _abt_, C01, NULL,
new WeaponGuardHasMag(
this)) );
414 m_fsm.AddTransition(
new WeaponTransition( O01, __S__, Reload_O01, NULL,
new WeaponGuardCanSwapMag(
this)));
415 m_fsm.AddTransition(
new WeaponTransition( Reload_O01, _fin_, O00, NULL,
new GuardNot(
new WeaponGuardHasMag(
this))) );
417 m_fsm.AddTransition(
new WeaponTransition( Reload_O01, _fin_, C01, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
419 m_fsm.AddTransition(
new WeaponTransition( Reload_O01, _abt_, O00, NULL,
new GuardNot(
new WeaponGuardHasMag(
this))) );
421 m_fsm.AddTransition(
new WeaponTransition( Reload_O01, _abt_, C01, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
424 m_fsm.AddTransition(
new WeaponTransition( JF1, __S__, Reload_JF1, NULL,
new WeaponGuardCanSwapMag(
this)));
425 m_fsm.AddTransition(
new WeaponTransition( Reload_JF1, _fin_, JF1, NULL,
new WeaponGuardHasMag(
this)));
427 m_fsm.AddTransition(
new WeaponTransition( Reload_JF1, _abt_, JF1, NULL,
new WeaponGuardHasMag(
this)));
433 m_fsm.AddTransition(
new WeaponTransition( C11, __D__, Detach_C11, NULL,
new WeaponGuardCanDetachMag(
this)));
434 m_fsm.AddTransition(
new WeaponTransition( Detach_C11, _fin_, C11, NULL,
new WeaponGuardHasMag(
this)));
436 m_fsm.AddTransition(
new WeaponTransition( Detach_C11, _abt_, C11, NULL,
new WeaponGuardHasMag(
this)));
439 m_fsm.AddTransition(
new WeaponTransition( C01, __D__, Detach_C01, NULL,
new WeaponGuardCanDetachMag(
this)));
440 m_fsm.AddTransition(
new WeaponTransition( Detach_C01, _fin_, C01, NULL,
new WeaponGuardHasMag(
this)));
442 m_fsm.AddTransition(
new WeaponTransition( Detach_C01, _abt_, C01, NULL,
new WeaponGuardHasMag(
this)));
445 m_fsm.AddTransition(
new WeaponTransition( O01, __D__, Detach_O01, NULL,
new WeaponGuardCanDetachMag(
this)));
446 m_fsm.AddTransition(
new WeaponTransition( Detach_O01, _fin_, O01, NULL,
new WeaponGuardHasMag(
this)));
448 m_fsm.AddTransition(
new WeaponTransition( Detach_O01, _abt_, O01, NULL,
new WeaponGuardHasMag(
this)));
451 m_fsm.AddTransition(
new WeaponTransition( JF1, __D__, Detach_JF1, NULL,
new WeaponGuardCanDetachMag(
this)));
452 m_fsm.AddTransition(
new WeaponTransition( Detach_JF1, _fin_, JF1, NULL,
new WeaponGuardHasMag(
this)));
454 m_fsm.AddTransition(
new WeaponTransition( Detach_JF1, _abt_, JF1, NULL,
new WeaponGuardHasMag(
this)));
461 m_fsm.AddTransition(
new WeaponTransition( Unjam_JF0, _fin_, JF0, NULL,
new WeaponGuardJammed(
this)));
463 m_fsm.AddTransition(
new WeaponTransition( Unjam_JF0, _abt_, JF0, NULL,
new WeaponGuardJammed(
this)));
467 m_fsm.AddTransition(
new WeaponTransition( Unjam_JF1, _fin_, JF1, NULL,
new WeaponGuardJammed(
this)));
468 m_fsm.AddTransition(
new WeaponTransition( Unjam_JF1, _fin_, C01, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
470 m_fsm.AddTransition(
new WeaponTransition( Unjam_JF1, _abt_, JF1, NULL,
new WeaponGuardJammed(
this)));
471 m_fsm.AddTransition(
new WeaponTransition( Unjam_JF1, _abt_, C01, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
474 SetInitialState(C00);
476 SelectionBulletHide();
482 override float GetChanceToJam()
484 float chanceToJam = super.GetChanceToJam();
485 Magazine mag = GetMagazine(GetCurrentMuzzle());
489 chanceToJam = chanceToJam + ((1.0 - chanceToJam) * mag.GetChanceToJam());
493 chanceToJam = chanceToJam + ((1.0 - chanceToJam) * 0.06);