Esempio n. 1
0
        private bool IsTargetValidForAdditionalAttack(GenericShip targetShip)
        {
            bool result = true;

            SelectTargetForSecondAttackSubPhase secondAttackSubphase = Phases.CurrentSubPhase as SelectTargetForSecondAttackSubPhase;

            if (secondAttackSubphase != null)
            {
                if (!secondAttackSubphase.FilterTargets(targetShip))
                {
                    result = false;
                }
            }

            return(result);
        }
Esempio n. 2
0
    // Extra Attacks

    public static void StartAdditionalAttack(GenericShip ship, Action callback, Func <GenericShip, IShipWeapon, bool> extraAttackFilter = null, string abilityName = null, string description = null, string imageUrl = null)
    {
        Selection.ChangeActiveShip("ShipId:" + ship.ShipId);
        Phases.CurrentSubPhase.RequiredPlayer = ship.Owner.PlayerNo;

        ExtraAttackFilter = extraAttackFilter;

        SelectTargetForSecondAttackSubPhase newAttackSubphase = (SelectTargetForSecondAttackSubPhase)Phases.StartTemporarySubPhaseNew(
            "Second attack",
            typeof(SelectTargetForSecondAttackSubPhase),
            //delegate { ExtraAttackTargetSelected(callback, extraAttackFilter); }
            callback
            );

        newAttackSubphase.AbilityName = abilityName;
        newAttackSubphase.Description = description;
        newAttackSubphase.ImageUrl    = imageUrl;

        newAttackSubphase.Start();
    }