Esempio n. 1
0
        private bool FilterJamTargets(GenericShip ship)
        {
            if (ship.Owner.PlayerNo == Selection.ThisShip.Owner.PlayerNo)
            {
                return(false);
            }
            if (ship.Tokens.HasToken(typeof(JamToken)))
            {
                return(false);
            }

            BoardTools.DistanceInfo distanceInfo = new BoardTools.DistanceInfo(Selection.ThisShip, ship);
            if (distanceInfo.Range <= 1)
            {
                return(true);
            }

            BoardTools.ShotInfo shotInfo = new BoardTools.ShotInfo(Selection.ThisShip, ship, Selection.ThisShip.PrimaryWeapons);
            if (shotInfo.Range <= 2 && shotInfo.InPrimaryArc)
            {
                return(true);
            }

            return(false);
        }
Esempio n. 2
0
        private bool FilterJamTargets(GenericShip ship)
        {
            if (ship.Owner.PlayerNo == Selection.ThisShip.Owner.PlayerNo)
            {
                return(false);
            }

            bool result = false;

            if (Rules.Jam.JamIsAllowed(Selection.ThisShip, ship))
            {
                result = true;
            }

            if (Edition.Current is Editions.FirstEdition)
            {
                if (ship.Tokens.HasToken(typeof(JamToken)))
                {
                    return(false);
                }

                BoardTools.ShotInfo shotInfo = new BoardTools.ShotInfo(Selection.ThisShip, ship, Selection.ThisShip.PrimaryWeapons);
                if (shotInfo.Range <= 2 && shotInfo.InPrimaryArc)
                {
                    return(true);
                }
            }

            return(result);
        }
Esempio n. 3
0
        protected virtual bool AbilityCanBeUsed()
        {
            if (!Combat.ShotInfo.InArc)
            {
                return(false);
            }

            BoardTools.ShotInfo reverseShotInfo = new BoardTools.ShotInfo(Combat.Defender, Combat.Attacker, Combat.Defender.PrimaryWeapons);
            if (reverseShotInfo.InArc)
            {
                return(false);
            }

            return(true);
        }
Esempio n. 4
0
        protected override bool AbilityCanBeUsed()
        {
            if (!Combat.ShotInfo.InArcByType(Arcs.ArcType.Front))
            {
                return(false);
            }

            BoardTools.ShotInfo reverseShotInfo = new BoardTools.ShotInfo(Combat.Defender, Combat.Attacker, Combat.Defender.PrimaryWeapons);
            if (reverseShotInfo.InArc)
            {
                return(false);
            }

            return(true);
        }
Esempio n. 5
0
        private int AiPriority(GenericShip ship)
        {
            int priority = 0;

            if (!ship.Tokens.HasToken(typeof(BlueTargetLockToken)))
            {
                priority += 50;
            }

            BoardTools.ShotInfo shotInfo = new BoardTools.ShotInfo(ship, LockedShip, ship.PrimaryWeapons);
            if (shotInfo.IsShotAvailable)
            {
                priority += 40;
            }

            priority += ship.State.Firepower * 5;

            return(priority);
        }