protected override bool CanReRollWithWeaponClass() { if (Combat.ChosenWeapon is GenericSecondaryWeapon) { GenericSecondaryWeapon upgradeWeapon = Combat.ChosenWeapon as GenericSecondaryWeapon; return(upgradeWeapon.HasType(UpgradeType.Missile) || upgradeWeapon.HasType(UpgradeType.Torpedo)); } return(false); }
private void AllowLaunchesByTargetLock(ref bool result) { GenericSecondaryWeapon secondaryWeapon = Combat.ChosenWeapon as GenericSecondaryWeapon; if (secondaryWeapon != null) { if ((secondaryWeapon.HasType(UpgradeType.Torpedo) || secondaryWeapon.HasType(UpgradeType.Missile)) && Actions.HasTargetLockOn(Selection.ThisShip, Selection.AnotherShip)) { result = false; } } }
private bool IsMissilesOrTorpedoesAttack() { bool result = false; GenericSecondaryWeapon secondaryWeapon = Combat.ChosenWeapon as GenericSecondaryWeapon; if (secondaryWeapon != null) { if (secondaryWeapon.HasType(UpgradeType.Torpedo) || secondaryWeapon.HasType(UpgradeType.Missile)) { result = true; } } return(result); }
public override bool IsActionEffectAvailable() { bool result = false; if (Combat.AttackStep == CombatStep.Attack && !(Source.UpgradeAbilities[0] as GuidanceChipsAbility).IsGuidanceChipsAbilityUsed()) { GenericSecondaryWeapon secondaryWeapon = (Combat.ChosenWeapon as GenericSecondaryWeapon); if (secondaryWeapon != null) { if (secondaryWeapon.HasType(UpgradeType.Torpedo) || secondaryWeapon.HasType(UpgradeType.Missile)) { result = true; } } } return(result); }
private void RegisterSaturationSalvoAbility() { GenericSecondaryWeapon weapon = Combat.ChosenWeapon as GenericSecondaryWeapon; if (weapon != null) { if (weapon.HasType(UpgradeType.Torpedo) || weapon.HasType(UpgradeType.Missile)) { Triggers.RegisterTrigger( new Trigger() { Name = "Saturation Salvo", TriggerType = TriggerTypes.OnAttackMissed, TriggerOwner = HostShip.Owner.PlayerNo, EventHandler = SaturationSalvoDamage }); } } }
private void AllowLowCostCannons(ref bool result) { GenericSecondaryWeapon secondaryWeapon = Combat.ChosenWeapon as GenericSecondaryWeapon; if (secondaryWeapon != null) { if (secondaryWeapon.HasType(UpgradeType.Cannon) && secondaryWeapon.Cost <= 2) { result = false; } } }
private bool IsAttackWithCannonUpgradeCost3OrFewer() { bool result = false; GenericSecondaryWeapon secondaryWeapon = Combat.ChosenWeapon as GenericSecondaryWeapon; if (secondaryWeapon != null && secondaryWeapon.HasType(UpgradeType.Cannon) && secondaryWeapon.Cost <= 3) { result = true; } return(result); }
private bool IsCannonAttack() { bool result = false; GenericSecondaryWeapon secondaryWeapon = Combat.ChosenWeapon as GenericSecondaryWeapon; if (secondaryWeapon != null) { if (secondaryWeapon.HasType(UpgradeType.Cannon)) { result = true; } } return(result); }
private bool IsCannonShot(GenericShip defender, IShipWeapon weapon) { bool result = false; GenericSecondaryWeapon upgradeWeapon = weapon as GenericSecondaryWeapon; if (upgradeWeapon != null && upgradeWeapon.HasType(UpgradeType.Cannon)) { result = true; } else { Messages.ShowError("Attack must be performed from Cannon"); } return(result); }