23 bool result = m_arg0.GuardCondition(e) && m_arg1.GuardCondition(e);
24 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] guard - " + m_arg0.Type() +
" && " + m_arg1.Type() +
" = " + result); }
37 bool result = !m_arg0.GuardCondition(e);
52 bool result = m_arg0.GuardCondition(e) || m_arg1.GuardCondition(e);
53 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] guard - " + m_arg0.Type() +
" || " + m_arg1.Type() +
" = " + result); }
103 int mi =
m_weapon.GetCurrentMuzzle();
104 Magazine mag =
m_weapon.GetMagazine(mi);
105 if (mag != NULL && mag.GetAmmoCount() > 0)
122 int mi =
m_weapon.GetCurrentMuzzle();
123 if (
m_weapon.GetInternalMagazineCartridgeCount(mi) >= 1)
140 Magazine mag = e.m_magazine;
141 if (mag != NULL && mag.GetAmmoCount() > 0)
159 int mi =
m_weapon.GetCurrentMuzzle();
160 Magazine mag =
m_weapon.GetMagazine(mi);
174 protected int m_muzzle;
175 void WeaponGuardChamberEmpty (
Weapon_Base w = NULL,
int muzzle_index = 0 ) {
m_weapon = w; m_muzzle = muzzle_index; }
179 if (
m_weapon.IsChamberEmpty(m_muzzle))
196 int mi =
m_weapon.GetCurrentMuzzle();
210 protected int m_muzzle;
211 void WeaponGuardAnyChamberEmpty (
Weapon_Base w = NULL,
int muzzle_index = 0 ) {
m_weapon = w; m_muzzle = muzzle_index; }
215 for (
int i = 0; i <
m_weapon.GetMuzzleCount(); i++)
231 protected int m_muzzle;
232 void WeaponGuardChamberFull (
Weapon_Base w = NULL,
int muzzle_index = 0 ) {
m_weapon = w; m_muzzle = muzzle_index; }
236 if (
m_weapon.IsChamberFull(m_muzzle))
253 int mi =
m_weapon.GetCurrentMuzzle();
272 int mi =
m_weapon.GetCurrentMuzzle();
273 if (
m_weapon.IsInternalMagazineFull(mi))
290 int mi =
m_weapon.GetCurrentMuzzle();
305 protected int m_muzzle;
306 void WeaponGuardChamberFiredOut (
Weapon_Base w = NULL,
int muzzle_index = 0 ) {
m_weapon = w; m_muzzle = muzzle_index; }
310 if (
m_weapon.IsChamberFiredOut(m_muzzle))
327 int mi =
m_weapon.GetCurrentMuzzle();
345 for (
int i = 0; i <
m_weapon.GetMuzzleCount(); i++)
366 int mi =
m_weapon.GetCurrentMuzzle();
367 if (
m_weapon && e.m_magazine &&
m_weapon.CanAttachMagazine(mi, e.m_magazine))
384 int mi =
m_weapon.GetCurrentMuzzle();
385 Magazine attached_mag =
m_weapon.GetMagazine(mi);
386 if (
m_weapon && e.m_magazine && e.m_magazine != attached_mag )
403 int mi =
m_weapon.GetCurrentMuzzle();
421 int mi =
m_weapon.GetCurrentMuzzle();
422 if (
m_weapon.GetInternalMagazineMaxCartridgeCount(mi) -
m_weapon.GetInternalMagazineCartridgeCount(mi) > 1)
432 class WeaponGuardInternalMagazineHasRoomForBullet
extends WeaponGuardBase
439 int mi =
m_weapon.GetCurrentMuzzle();
440 if (
m_weapon.GetInternalMagazineMaxCartridgeCount(mi) -
m_weapon.GetInternalMagazineCartridgeCount(mi) >= 1)
457 int mi =
m_weapon.GetCurrentMuzzle();
458 if (
m_weapon.GetTotalMaxCartridgeCount(mi) -
m_weapon.GetTotalCartridgeCount(mi) == 1)
475 int i =
m_weapon.GetMuzzleCount() - 1;
478 if (
m_weapon.GetTotalMaxCartridgeCount(i) -
m_weapon.GetTotalCartridgeCount(i) >= 1)
489 class WeaponGuardChamberMultiHasRoomBulltetIgnoreLast
extends WeaponGuardBase
492 void WeaponGuardChamberMultiHasRoomBulltetIgnoreLast (
Weapon_Base w = NULL) {
m_weapon = w; }
496 int i =
m_weapon.GetMuzzleCount() - 1;
497 bool emty_one =
false;
500 if (
m_weapon.GetTotalMaxCartridgeCount(i) -
m_weapon.GetTotalCartridgeCount(i) >= 1)
526 Magazine mag = m_state.m_srcMagazine;
527 if (mag != NULL && mag.GetAmmoCount() > 0)
544 int mi =
m_weapon.GetCurrentMuzzle();
545 Magazine mag =
m_weapon.GetMagazine(mi);
546 Magazine mag2 = e.m_magazine;
547 if (mag != NULL && mag2 != NULL)
559 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" guard - mag == NULL or mag2 == NULL, cannot perform comparison");
606 return player.GetWeaponManager().WantContinue();