private bool FilterTargets(GenericUpgrade upgrade)
        {
            ConditionArgs args = new ConditionArgs()
            {
                UpgradeToCheck = upgrade
            };

            return(Conditions.Passed(args));
        }
Exemplo n.º 2
0
        public override bool Passed(ConditionArgs args)
        {
            if (args.ShipToCheck == null)
            {
                Messages.ShowError("Ability Condition Error: ship is not set");
                return(false);
            }

            return(args.ShipToCheck.GetType().IsSubclassOf(ShipType));
        }
Exemplo n.º 3
0
        public override bool Passed(ConditionArgs args)
        {
            if (args.UpgradeToCheck == null)
            {
                Messages.ShowError("Ability Condition Error: upgrade is not set");
                return(false);
            }

            return(args.UpgradeToCheck.HasType(UpgradeType));
        }
        private bool FilterTargets(GenericShip ship)
        {
            ConditionArgs args = new ConditionArgs()
            {
                ShipToCheck     = ship,
                ShipAbilityHost = Ability.HostShip
            };

            return(Conditions.Passed(args));
        }
        public override bool Passed(ConditionArgs args)
        {
            if (args.ShipToCheck == null)
            {
                Messages.ShowError("Ability Condition Error: ship is not set");
                return(false);
            }

            return(args.ShipToCheck.SectorsInfo.IsShipInSector(Combat.Defender, ArcType));
        }
        public override bool Passed(ConditionArgs args)
        {
            if (args.ShipToCheck == null)
            {
                Messages.ShowError("Ability Condition Error: ship is not set");
                return(false);
            }

            return(args.ShipToCheck.UpgradeBar.HasUpgradeTypeInstalled(UpgradeType));
        }
Exemplo n.º 7
0
        public override bool Passed(ConditionArgs args)
        {
            foreach (Type tokenType in TokensToHave)
            {
                if (args.ShipToCheck.Tokens.HasToken(tokenType, '*'))
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 8
0
        public override bool Passed(ConditionArgs args)
        {
            if (args.ShipToCheck == null || args.ShipAbilityHost == null)
            {
                Messages.ShowError("Ability Condition Error: ship is not set");
                return(false);
            }

            DistanceInfo distInfo = new DistanceInfo(args.ShipAbilityHost, args.ShipToCheck);

            return(distInfo.Range >= MinRange && distInfo.Range <= MaxRange);
        }
Exemplo n.º 9
0
        public bool Passed(ConditionArgs args)
        {
            foreach (Condition condition in AllConditions)
            {
                if (!condition.Passed(args))
                {
                    return(false);
                }
            }

            return(true);
        }
Exemplo n.º 10
0
        public override bool Passed(ConditionArgs args)
        {
            if (args.ShipToCheck == null)
            {
                Messages.ShowError("Ability Condition Error: ship is not set");
                return(false);
            }

            if (args.ShipToCheck.RevealedManeuver != null)
            {
                return(args.ShipToCheck.RevealedManeuver.Speed >= MinSpeed && args.ShipToCheck.RevealedManeuver.Speed <= MaxSpeed);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 11
0
        public override bool Passed(ConditionArgs args)
        {
            if (args.ShipToCheck == null || args.ShipAbilityHost == null)
            {
                Messages.ShowError("Ability Condition Error: ship is not set");
                return(false);
            }

            switch (TeamType)
            {
            case Team.Type.Friendly:
                return(args.ShipToCheck.Owner.PlayerNo == args.ShipAbilityHost.Owner.PlayerNo);

            case Team.Type.Enemy:
                return(args.ShipToCheck.Owner.PlayerNo != args.ShipAbilityHost.Owner.PlayerNo);

            default:
                return(false);
            }
        }
Exemplo n.º 12
0
 public abstract bool Passed(ConditionArgs args);