예제 #1
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;
                }
            }
        }
예제 #2
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);
        }
예제 #3
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 = Host.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;
                }
            }
        }
예제 #5
0
파일: TIED.cs 프로젝트: stwangner/FlyCasual
        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);
        }
예제 #6
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);
        }