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 ()
173 m_abilities.Insert(
new AbilityRecord(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADPISTOL_MAGAZINE_BULLET_CLOSED));
174 m_abilities.Insert(
new AbilityRecord(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADPISTOL_NOMAGAZINE_BULLET_CLOSED));
175 m_abilities.Insert(
new AbilityRecord(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADPISTOL_MAGAZINE_NOBULLET_CLOSED_COCKED));
176 m_abilities.Insert(
new AbilityRecord(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADPISTOL_NOMAGAZINE_NOBULLET_CLOSED_COCKED));
177 m_abilities.Insert(
new AbilityRecord(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADPISTOL_MAGAZINE_NOBULLET_CLOSED_UNCOCKED));
178 m_abilities.Insert(
new AbilityRecord(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADPISTOL_NOMAGAZINE_NOBULLET_CLOSED_UNCOCKED));
179 m_abilities.Insert(
new AbilityRecord(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADPISTOL_NOMAGAZINE_NOBULLET_OPENED));
180 m_abilities.Insert(
new AbilityRecord(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADPISTOL_MAGAZINE_NOBULLET_OPENED));
181 m_abilities.Insert(
new AbilityRecord(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOAD_MAGAZINE_DETACH));
183 m_abilities.Insert(
new AbilityRecord(WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_ONEBULLET_CLOSED));
184 m_abilities.Insert(
new AbilityRecord(WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_ONEBULLET_OPENED));
186 m_abilities.Insert(
new AbilityRecord(WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_CLOSED));
187 m_abilities.Insert(
new AbilityRecord(WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_OPENED));
188 m_abilities.Insert(
new AbilityRecord(WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_CLOSED_UNCOCKED));
190 m_abilities.Insert(
new AbilityRecord(WeaponActions.UNJAMMING, WeaponActionUnjammingTypes.UNJAMMING_START));
191 m_abilities.Insert(
new AbilityRecord(WeaponActions.UNJAMMING, WeaponActionUnjammingTypes.UNJAMMING_END));
193 m_abilities.Insert(
new AbilityRecord(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_NORMAL));
194 m_abilities.Insert(
new AbilityRecord(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_LAST));
195 m_abilities.Insert(
new AbilityRecord(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_COCKED));
196 m_abilities.Insert(
new AbilityRecord(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_UNCOCKED));
197 m_abilities.Insert(
new AbilityRecord(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_JAM));
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);
215 WeaponCharging Mech_CD00 =
new WeaponCharging(
this, NULL, WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_CLOSED_UNCOCKED);
217 WeaponCharging Mech_CD01 =
new WeaponCharging(
this, NULL, WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_CLOSED_UNCOCKED);
226 WeaponDryFire Trigger_CC00 =
new WeaponDryFire(
this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_COCKED);
227 WeaponDryFire Trigger_CD00 =
new WeaponDryFire(
this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_COCKED);
228 WeaponDryFire Trigger_OD00 =
new WeaponDryFire(
this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_UNCOCKED);
229 WeaponDryFire Trigger_CD01 =
new WeaponDryFire(
this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_COCKED);
230 WeaponDryFire Trigger_OD01 =
new WeaponDryFire(
this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_UNCOCKED);
231 WeaponDryFire Trigger_CC01 =
new WeaponDryFire(
this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_COCKED);
232 WeaponDryFire Trigger_CJF0 =
new WeaponDryFire(
this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_UNCOCKED);
233 WeaponDryFire Trigger_CJF1 =
new WeaponDryFire(
this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_UNCOCKED);
235 WeaponFireAndChamberNext Trigger_CC11 =
new WeaponFireAndChamberNext(
this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_NORMAL);
236 WeaponStateBase Trigger_CC10 =
new WeaponFireLast(
this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_NORMAL);
237 WeaponStateBase Trigger_CC11L =
new WeaponFireLast(
this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_LAST);
239 WeaponStateBase Trigger_CC10J =
new WeaponFireToJam(
this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_JAM);
240 WeaponStateBase Trigger_CC11J =
new WeaponFireToJam(
this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_JAM);
245 WeaponChambering Chamber_CD00 =
new WeaponChambering(
this, NULL, WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_ONEBULLET_CLOSED_UNCOCKED);
246 WeaponChambering Chamber_CC00 =
new WeaponChambering(
this, NULL, WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_ONEBULLET_CLOSED);
247 WeaponChambering Chamber_OD00 =
new WeaponChambering(
this, NULL, WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_ONEBULLET_OPENED);
248 WeaponChambering Chamber_CD01 =
new WeaponChambering(
this, NULL, WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_ONEBULLET_CLOSED_UNCOCKED);
249 WeaponChambering Chamber_CC01 =
new WeaponChambering(
this, NULL, WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_ONEBULLET_CLOSED);
250 WeaponChambering Chamber_OD01 =
new WeaponChambering(
this, NULL, WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_ONEBULLET_OPENED);
252 WeaponAttachMagazine Attach_CC10 =
new WeaponAttachMagazine(
this, NULL, WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADPISTOL_NOMAGAZINE_BULLET_CLOSED);
253 WeaponAttachMagazine Attach_CJF0 =
new WeaponAttachMagazine(
this, NULL, WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADPISTOL_NOMAGAZINE_BULLET_CLOSED);
254 WeaponAttachMagazine Attach_CD00 =
new WeaponAttachMagazine(
this, NULL, WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADPISTOL_NOMAGAZINE_NOBULLET_CLOSED_UNCOCKED);
255 WeaponAttachMagazine Attach_CC00 =
new WeaponAttachMagazine(
this, NULL, WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADPISTOL_NOMAGAZINE_NOBULLET_CLOSED_COCKED);
256 WeaponAttachMagazine Attach_OD00 =
new WeaponAttachMagazine(
this, NULL, WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADPISTOL_NOMAGAZINE_NOBULLET_OPENED);
264 WeaponDetachingMag Detach_CC11 =
new WeaponDetachingMag(
this, NULL, WeaponActions.RELOAD, WeaponActionReloadTypes.RELOAD_MAGAZINE_DETACH);
265 WeaponDetachingMag Detach_CC01 =
new WeaponDetachingMag(
this, NULL, WeaponActions.RELOAD, WeaponActionReloadTypes.RELOAD_MAGAZINE_DETACH);
266 WeaponDetachingMag Detach_CD01 =
new WeaponDetachingMag(
this, NULL, WeaponActions.RELOAD, WeaponActionReloadTypes.RELOAD_MAGAZINE_DETACH);
267 WeaponDetachingMag Detach_OD01 =
new WeaponDetachingMag(
this, NULL, WeaponActions.RELOAD, WeaponActionReloadTypes.RELOAD_MAGAZINE_DETACH);
268 WeaponDetachingMag Detach_CJF1 =
new WeaponDetachingMag(
this, NULL, WeaponActions.RELOAD, WeaponActionReloadTypes.RELOAD_MAGAZINE_DETACH);
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);
647 dst.Insert( 0.0, -1.0,
"0.200 0.238 -0.050");
648 dst.Insert( 0.0, -0.5,
"0.185 0.142 -0.030");
649 dst.Insert( 0.0, 0.0,
"0.170 0.046 -0.028");
650 dst.Insert( 0.0, 0.5,
"0.176 0.023 -0.048");
651 dst.Insert( 0.0, 1.0,
"0.182 0.006 -0.059");
655 dst.Insert( 0.0, -1.0,
" 0.040 -0.080 -0.030");
656 dst.Insert( 0.0, -0.5,
" 0.040 -0.040 -0.040");
657 dst.Insert( 0.0, 0.0,
" 0.045 0.040 -0.008");
658 dst.Insert( 0.0, 0.5,
" 0.070 -0.115 -0.150");
659 dst.Insert( 0.0, 1.0,
" 0.100 -0.160 -0.320");
661 dst.Insert(-0.3, 0.0,
" 0.008 -0.048 -0.056");
662 dst.Insert(-0.5, 0.0,
" 0.020 -0.002 0.052");
663 dst.Insert(-0.8, 0.0,
" 0.100 0.001 0.075");
664 dst.Insert(-1.0, 0.0,
" 0.094 0.110 0.080");
666 dst.Insert( 0.3, 0.0,
" 0.020 0.030 0.018");
667 dst.Insert( 0.5, 0.0,
"-0.040 0.070 0.094");
668 dst.Insert( 0.8, 0.0,
"-0.118 0.188 0.050");
669 dst.Insert( 1.0, 0.0,
" 0.094 0.110 0.080");
673 dst.Insert( 0.0, -1.0,
"0.135 0.155 0.065");
674 dst.Insert( 0.0, -0.5,
"0.155 0.055 0.030");
675 dst.Insert( 0.0, 0.0,
"0.150 0.022 -0.017");
676 dst.Insert( 0.0, 0.5,
"0.140 0.003 -0.032");
677 dst.Insert( 0.0, 1.0,
"0.120 -0.026 -0.028");
692 const float LEAN_VERT_OFFSET = -0.1;
693 const float LEAN_HORIZ_OFFSET_L = 0.075;
694 const float LEAN_HORIZ_OFFSET_R = -0.025;
695 float aimStraightWeight = 1.0 -
Math.AbsFloat(ud11);
696 float leanOffset = lean * aimStraightWeight;
697 offset +=
Vector( leanOffset *
Math.Lerp(LEAN_HORIZ_OFFSET_L, LEAN_HORIZ_OFFSET_R, lean * 0.5 + 0.5), leanOffset * LEAN_VERT_OFFSET, 0);
699 float maxVelocity =
Math.Max(
Math.AbsFloat(localVelocity[0]),
Math.AbsFloat(localVelocity[2]) );
700 float peakVelocity = 0.5;
701 float moveAmount01 =
Math.Clamp(maxVelocity / peakVelocity, 0.0, 1.0);
702 if (moveAmount01 != 0.0)
706 moveOffset =
"-0.1 -0.2 -0.1";
708 moveOffset =
"0.0 -0.12 -0.1";
711 float ud01 = (ud11 * 0.5) + 0.5;
712 float aimWeight =
Math.Clamp(1.0 - (ud01 * 2), 0, 1);
715 float moveWeight = moveAmount01 *
Math.Pow(aimWeight, 2.0);
716 offset = offset + (moveWeight * moveOffset);
void AddAction(typename actionName)
class Blend2D< Class T > Blend2DVector
pair ( action, actionType )
base for semi auto weapons @NOTE name copies config base class
override void GetApproximateAimOffsets(Blend2DVector dst, int characterStance)
override vector GetApproximateMovementOffset(vector localVelocity, int characterStance, float lean, float ud11, float lr11)
charging of weapon without ammo to be chambered
signalize mechanism manipulation
weapon finite state machine
replace current magazine with new one
represents weapon's stable state (i.e. the basic states that the weapon will spend the most time in)
represent weapon state base
override bool IsRepairEnabled()
override bool HasBullet()
override void InitMuzzleArray()
override bool HasMagazine()
DayZPlayerConstants
defined in C++
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
class WeaponGuardIsDestroyed extends WeaponGuardBase m_weapon
void WeaponGuardHasAmmo(Weapon_Base w=NULL)
void WeaponGuardWeaponDischarged(Weapon_Base w=NULL)
void WeaponGuardWeaponOpen(Weapon_Base w=NULL)
override int GetCurrentStateID()
override bool IsBoltOpen()
@ CLOSED_CHARGED
closed and charged
@ DEFAULT
default weapon state, closed and discharged
@ OPENED_DISCHARGED
opened and discharged
class SSPFireout extends WeaponStableState OnEntry
enum FSMTransition WeaponTransition
class WeaponChambering_Chamber_OnEntry extends WeaponChambering_Base OnExit
ref array< MuzzleState > m_muzzleHasBullet
bool IsDischarged()
Whether the gun is discharged.