private bool SnapShotAttackFilter(GenericShip defender, IShipWeapon weapon, bool isSilent) { bool result = true; if (defender != snapShotTarget) { if (!isSilent) { Messages.ShowErrorToHuman( string.Format("Snap Shot's target must be {0}", snapShotTarget.PilotInfo.PilotName)); } result = false; } else if (!(weapon.GetType() == HostUpgrade.GetType())) { if (!isSilent) { Messages.ShowErrorToHuman( string.Format("This attack must be Snap Shot attack")); } result = false; } return(result); }
private void SetRangeToOne(GenericShip thisShip, GenericShip anotherShip, IShipWeapon chosenWeapon, ref int range) { if (thisShip.ShipId == HostShip.ShipId) { if ((range <= 3) && (chosenWeapon.GetType() == typeof(PrimaryWeaponClass))) { range = 1; } } }
private bool IsSecondaryShot(GenericShip defender, IShipWeapon weapon, bool isSilent) { bool result = false; if (weapon.GetType() != typeof(PrimaryWeaponClass)) { result = true; } else { if (!isSilent) Messages.ShowError("Attack must be performed from secondary weapon"); } return result; }
private bool SnapShotAttackFilter(GenericShip defender, IShipWeapon weapon) { bool result = true; if (defender != snapShotTarget || !(weapon.GetType() == HostUpgrade.GetType())) { Messages.ShowErrorToHuman( string.Format("Snap Shot target must be {0}, using Snap Shot weapon", snapShotTarget.PilotName)); result = false; } return(result); }
private bool IsPrimaryShot(GenericShip defender, IShipWeapon weapon) { bool result = false; if (weapon.GetType() == typeof(PrimaryWeaponClass)) { result = true; } else { Messages.ShowError("Attack must be performed from primary weapon"); } return(result); }
private bool ForesightAttackFilter(GenericShip defender, IShipWeapon weapon, bool isSilent) { bool result = true; if (defender != blasterTarget) { if (!isSilent) { Messages.ShowErrorToHuman( string.Format("Underslung Blaster Cannon's target must be {0}", blasterTarget.PilotInfo.PilotName)); } result = false; } else if (!(weapon.GetType() == HostUpgrade.GetType())) { if (!isSilent) { Messages.ShowErrorToHuman("This attack must be Underslung Blaster Cannon attack"); } result = false; } return(result); }