示例#1
0
            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);
            }
示例#2
0
        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;
                }
            }
        }
示例#3
0
        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);
        }
示例#4
0
        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);
        }
示例#5
0
        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;
                }
            }
        }
示例#7
0
        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);
        }
示例#8
0
        private bool IsCannonAttack()
        {
            bool result = false;

            GenericSecondaryWeapon secondaryWeapon = Combat.ChosenWeapon as GenericSecondaryWeapon;

            if (secondaryWeapon != null)
            {
                if (secondaryWeapon.HasType(UpgradeType.Cannon))
                {
                    result = true;
                }
            }

            return(result);
        }
示例#9
0
        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);
        }