44 override bool HasBullet () {
return false; }
46 override bool IsJammed () {
return false; }
55 override bool HasBullet () {
return true; }
57 override bool IsJammed () {
return false; }
66 override bool HasBullet () {
return true; }
68 override bool IsJammed () {
return true; }
78 override bool HasBullet () {
return false; }
80 override bool IsJammed () {
return false; }
91 override bool HasBullet () {
return false; }
93 override bool IsJammed () {
return false; }
102 override bool HasBullet () {
return false; }
104 override bool IsJammed () {
return false; }
113 override bool HasBullet () {
return true; }
115 override bool IsJammed () {
return true; }
125 override bool HasBullet () {
return true; }
127 override bool IsJammed () {
return false; }
136 override bool HasBullet () {
return false; }
138 override bool IsJammed () {
return false; }
162 override bool CanChamberBullet (
int muzzleIndex, Magazine mag)
164 return super.CanChamberBullet(muzzleIndex,mag) && IsChamberEmpty(muzzleIndex);
171 override void InitStateMachine ()
203 CD00 =
new Pistol_CLO_DIS_BU0_MA0(
this, NULL,
PistolAnimState.DEFAULT);
204 CC00 =
new Pistol_CLO_CHG_BU0_MA0(
this, NULL,
PistolAnimState.CLOSED_CHARGED);
205 CC10 =
new Pistol_CLO_CHG_BU1_MA0(
this, NULL,
PistolAnimState.CLOSED_CHARGED);
207 OD00 =
new Pistol_OPE_DIS_BU0_MA0(
this, NULL,
PistolAnimState.OPENED_DISCHARGED);
208 CD01 =
new Pistol_CLO_DIS_BU0_MA1(
this, NULL,
PistolAnimState.DEFAULT);
209 CC01 =
new Pistol_CLO_CHG_BU0_MA1(
this, NULL,
PistolAnimState.CLOSED_CHARGED);
210 CC11 =
new Pistol_CLO_CHG_BU1_MA1(
this, NULL,
PistolAnimState.CLOSED_CHARGED);
212 OD01 =
new Pistol_OPE_DIS_BU0_MA1(
this, NULL,
PistolAnimState.OPENED_DISCHARGED);
308 m_fsm.AddTransition(
new WeaponTransition( Mech_OD01, _fin_, CC01, NULL,
new WeaponGuardCurrentChamberEmpty(
this) ));
311 m_fsm.AddTransition(
new WeaponTransition( Mech_OD01, _abt_, CC01, NULL,
new WeaponGuardCurrentChamberEmpty(
this) ));
316 m_fsm.AddTransition(
new WeaponTransition( Mech_CD01, _fin_, CC01, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
319 m_fsm.AddTransition(
new WeaponTransition( Mech_CD01, _abt_, CC01, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
323 m_fsm.AddTransition(
new WeaponTransition( Mech_CC01, _fin_, CC01, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
325 m_fsm.AddTransition(
new WeaponTransition( Mech_CC01, _abt_, CC01, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
330 m_fsm.AddTransition(
new WeaponTransition( Mech_CC10, _fin_, CC00, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
332 m_fsm.AddTransition(
new WeaponTransition( Mech_CC10, _abt_, CC00, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
336 m_fsm.AddTransition(
new WeaponTransition( Mech_CC11, _fin_, CC01, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
338 m_fsm.AddTransition(
new WeaponTransition( Mech_CC11, _abt_, CC01, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
426 m_fsm.AddTransition(
new WeaponTransition( Chamber_CC00, _fin_, CC00, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
429 m_fsm.AddTransition(
new WeaponTransition( Chamber_CC00, _abt_, CC00, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
433 m_fsm.AddTransition(
new WeaponTransition( CD01, __L__, Chamber_CD01, NULL,
new WeaponGuardHasMag(
this)));
435 m_fsm.AddTransition(
new WeaponTransition( Chamber_CD01, _fin_, CD01, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
438 m_fsm.AddTransition(
new WeaponTransition( Chamber_CD01, _abt_, CD01, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
441 m_fsm.AddTransition(
new WeaponTransition( CC01, __L__, Chamber_CC01, NULL,
new WeaponGuardHasMag(
this)));
443 m_fsm.AddTransition(
new WeaponTransition( Chamber_CC01, _fin_, CC01, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
446 m_fsm.AddTransition(
new WeaponTransition( Chamber_CC01, _abt_, CC01, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
449 m_fsm.AddTransition(
new WeaponTransition( OD01, __L__, Chamber_OD01, NULL,
new WeaponGuardHasMag(
this)));
450 m_fsm.AddTransition(
new WeaponTransition( Chamber_OD01, _fin_, OD01, NULL,
new WeaponGuardCurrentChamberEmpty(
this) ));
452 m_fsm.AddTransition(
new WeaponTransition( Chamber_OD01, _abt_, OD01, NULL,
new WeaponGuardCurrentChamberEmpty(
this) ));
455 m_fsm.AddTransition(
new WeaponTransition( CJF0, __A__, Attach_CJF0, NULL,
new WeaponGuardCanAttachMag(
this)));
456 m_fsm.AddTransition(
new WeaponTransition( Attach_CJF0, _fin_, CJF1, NULL,
new WeaponGuardHasMag(
this)));
458 m_fsm.AddTransition(
new WeaponTransition( Attach_CJF0, _abt_, CJF1, NULL,
new WeaponGuardHasMag(
this)));
463 m_fsm.AddTransition(
new WeaponTransition( CD00, __A__, Attach_CD00, NULL,
new WeaponGuardCanAttachMag(
this)));
464 m_fsm.AddTransition(
new WeaponTransition( Attach_CD00, _fin_, CD00, NULL,
new GuardNot(
new WeaponGuardHasMag(
this))));
466 m_fsm.AddTransition(
new WeaponTransition( Attach_CD00, _fin_, CC01, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
468 m_fsm.AddTransition(
new WeaponTransition( Attach_CD00, _abt_, CD00, NULL,
new GuardNot(
new WeaponGuardHasMag(
this))));
470 m_fsm.AddTransition(
new WeaponTransition( Attach_CD00, _abt_, CC01, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
473 m_fsm.AddTransition(
new WeaponTransition( CC10, __A__, Attach_CC10, NULL,
new WeaponGuardCanAttachMag(
this)));
474 m_fsm.AddTransition(
new WeaponTransition( Attach_CC10, _fin_, CC11, NULL,
new WeaponGuardHasMag(
this)));
476 m_fsm.AddTransition(
new WeaponTransition( Attach_CC10, _abt_, CC11, NULL,
new WeaponGuardHasMag(
this)));
479 m_fsm.AddTransition(
new WeaponTransition( OD00, __A__, Attach_OD00, NULL,
new WeaponGuardCanAttachMag(
this)));
480 m_fsm.AddTransition(
new WeaponTransition( Attach_OD00, _fin_, OD00, NULL,
new GuardNot(
new WeaponGuardHasMag(
this))));
482 m_fsm.AddTransition(
new WeaponTransition( Attach_OD00, _fin_, CC01, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
484 m_fsm.AddTransition(
new WeaponTransition( Attach_OD00, _abt_, OD00, NULL,
new GuardNot(
new WeaponGuardHasMag(
this))));
486 m_fsm.AddTransition(
new WeaponTransition( Attach_OD00, _abt_, CC01, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
489 m_fsm.AddTransition(
new WeaponTransition( CC00, __A__, Attach_CC00, NULL,
new WeaponGuardCanAttachMag(
this)));
490 m_fsm.AddTransition(
new WeaponTransition( Attach_CC00, _fin_, CC11, NULL,
new WeaponGuardCurrentChamberFull(
this)));
491 m_fsm.AddTransition(
new WeaponTransition( Attach_CC00, _fin_, CC01, NULL,
new WeaponGuardHasMag(
this)));
493 m_fsm.AddTransition(
new WeaponTransition( Attach_CC00, _abt_, CC11, NULL,
new WeaponGuardCurrentChamberFull(
this)));
494 m_fsm.AddTransition(
new WeaponTransition( Attach_CC00, _abt_, CC01, NULL,
new WeaponGuardHasMag(
this)));
498 m_fsm.AddTransition(
new WeaponTransition( CD01, __S__, Reload_CD01, NULL,
new WeaponGuardCanSwapMag(
this)));
499 m_fsm.AddTransition(
new WeaponTransition( Reload_CD01, _fin_, CC11, NULL,
new WeaponGuardCurrentChamberFull(
this)));
500 m_fsm.AddTransition(
new WeaponTransition( Reload_CD01, _fin_, CC01, NULL,
new WeaponGuardWeaponCharged(
this)));
501 m_fsm.AddTransition(
new WeaponTransition( Reload_CD01, _fin_, CD01, NULL,
new WeaponGuardHasMag(
this)));
503 m_fsm.AddTransition(
new WeaponTransition( Reload_CD01, _abt_, CC11, NULL,
new WeaponGuardCurrentChamberFull(
this)));
504 m_fsm.AddTransition(
new WeaponTransition( Reload_CD01, _abt_, CC01, NULL,
new WeaponGuardWeaponCharged(
this)));
505 m_fsm.AddTransition(
new WeaponTransition( Reload_CD01, _abt_, CD01, NULL,
new WeaponGuardHasMag(
this)));
509 m_fsm.AddTransition(
new WeaponTransition( CC11, __S__, Reload_CC11, NULL,
new WeaponGuardCanSwapMag(
this)));
510 m_fsm.AddTransition(
new WeaponTransition( Reload_CC11, _fin_, CC11, NULL,
new WeaponGuardHasMag(
this)));
512 m_fsm.AddTransition(
new WeaponTransition( Reload_CC11, _abt_, CC11, NULL,
new WeaponGuardHasMag(
this)));
515 m_fsm.AddTransition(
new WeaponTransition( CC01, __S__, Reload_CC01, NULL,
new WeaponGuardCanSwapMag(
this)));
516 m_fsm.AddTransition(
new WeaponTransition( Reload_CC01, _fin_, CC11, NULL,
new WeaponGuardCurrentChamberFull(
this)) );
517 m_fsm.AddTransition(
new WeaponTransition( Reload_CC01, _fin_, CC01, NULL,
new WeaponGuardHasMag(
this)) );
519 m_fsm.AddTransition(
new WeaponTransition( Reload_CC01, _abt_, CC11, NULL,
new WeaponGuardCurrentChamberFull(
this)) );
520 m_fsm.AddTransition(
new WeaponTransition( Reload_CC01, _abt_, CC01, NULL,
new WeaponGuardHasMag(
this)) );
523 m_fsm.AddTransition(
new WeaponTransition( OD01, __S__, Reload_OD01, NULL,
new WeaponGuardCanSwapMag(
this)));
524 m_fsm.AddTransition(
new WeaponTransition( Reload_OD01, _fin_, OD00, NULL,
new GuardNot(
new WeaponGuardHasMag(
this))));
526 m_fsm.AddTransition(
new WeaponTransition( Reload_OD01, _fin_, CC01, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
528 m_fsm.AddTransition(
new WeaponTransition( Reload_OD01, _abt_, OD00, NULL,
new GuardNot(
new WeaponGuardHasMag(
this))));
530 m_fsm.AddTransition(
new WeaponTransition( Reload_OD01, _abt_, CC01, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
533 m_fsm.AddTransition(
new WeaponTransition( CJF1, __S__, Reload_CJF1, NULL,
new WeaponGuardCanSwapMag(
this)));
534 m_fsm.AddTransition(
new WeaponTransition( Reload_CJF1, _fin_, CJF1, NULL,
new WeaponGuardHasMag(
this)));
536 m_fsm.AddTransition(
new WeaponTransition( Reload_CJF1, _abt_, CJF1, NULL,
new WeaponGuardHasMag(
this)));
541 m_fsm.AddTransition(
new WeaponTransition( OD01, __D__, Detach_OD01, NULL,
new WeaponGuardCanDetachMag(
this)));
542 m_fsm.AddTransition(
new WeaponTransition( Detach_OD01, _fin_, OD01, NULL,
new WeaponGuardHasMag(
this)));
544 m_fsm.AddTransition(
new WeaponTransition( Detach_OD01, _abt_, OD01, NULL,
new WeaponGuardHasMag(
this)));
547 m_fsm.AddTransition(
new WeaponTransition( CC11, __D__, Detach_CC11, NULL,
new WeaponGuardCanDetachMag(
this)));
548 m_fsm.AddTransition(
new WeaponTransition( Detach_CC11, _fin_, CC11, NULL,
new WeaponGuardHasMag(
this)));
550 m_fsm.AddTransition(
new WeaponTransition( Detach_CC11, _abt_, CC11, NULL,
new WeaponGuardHasMag(
this)));
553 m_fsm.AddTransition(
new WeaponTransition( CC01, __D__, Detach_CC01, NULL,
new WeaponGuardCanDetachMag(
this)));
554 m_fsm.AddTransition(
new WeaponTransition( Detach_CC01, _fin_, CC01, NULL,
new WeaponGuardHasMag(
this)));
556 m_fsm.AddTransition(
new WeaponTransition( Detach_CC01, _abt_, CC01, NULL,
new WeaponGuardHasMag(
this)));
559 m_fsm.AddTransition(
new WeaponTransition( CD01, __D__, Detach_CD01, NULL,
new WeaponGuardCanDetachMag(
this)));
560 m_fsm.AddTransition(
new WeaponTransition( Detach_CD01, _fin_, CD01, NULL,
new WeaponGuardHasMag(
this)));
562 m_fsm.AddTransition(
new WeaponTransition( Detach_CD01, _abt_, CD01, NULL,
new WeaponGuardHasMag(
this)));
565 m_fsm.AddTransition(
new WeaponTransition( CJF1, __D__, Detach_CJF1, NULL,
new WeaponGuardCanDetachMag(
this)));
566 m_fsm.AddTransition(
new WeaponTransition( Detach_CJF1, _fin_, CJF1, NULL,
new WeaponGuardHasMag(
this)));
568 m_fsm.AddTransition(
new WeaponTransition( Detach_CJF1, _abt_, CJF1, NULL,
new WeaponGuardHasMag(
this)));
574 m_fsm.AddTransition(
new WeaponTransition( Unjam_CJF0, _fin_, CJF0, NULL,
new WeaponGuardJammed(
this)));
576 m_fsm.AddTransition(
new WeaponTransition( Unjam_CJF0, _abt_, CJF0, NULL,
new WeaponGuardJammed(
this)));
580 m_fsm.AddTransition(
new WeaponTransition( Unjam_CJF1, _fin_, CJF1, NULL,
new WeaponGuardJammed(
this)));
581 m_fsm.AddTransition(
new WeaponTransition( Unjam_CJF1, _fin_, CC01, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
583 m_fsm.AddTransition(
new WeaponTransition( Unjam_CJF1, _abt_, CJF1, NULL,
new WeaponGuardJammed(
this)));
584 m_fsm.AddTransition(
new WeaponTransition( Unjam_CJF1, _abt_, CC01, NULL,
new WeaponGuardCurrentChamberEmpty(
this)));
588 SetInitialState(CD00);
589 SelectionBulletHide();
594 override float GetChanceToJam()
596 float chanceToJam = super.GetChanceToJam();
597 Magazine mag = GetMagazine(GetCurrentMuzzle());
601 chanceToJam = chanceToJam + ((1.0 - chanceToJam) * mag.GetChanceToJam());
605 chanceToJam = chanceToJam + ((1.0 - chanceToJam) * 0.06);