Beispiel #1
0
        public override void SkipButton()
        {
            if ((Selection.ThisShip == null) || (Selection.ThisShip.IsAttackPerformed))
            {
                // If no ship is selected or selected ship already performed attack
                // skip combat for all player's ships with current PS

                List <GenericShip> shipsToSkipCombat = new List <GenericShip>();

                foreach (var shipHolder in Roster.GetPlayer(Phases.CurrentPhasePlayer).Ships)
                {
                    if (shipHolder.Value.State.Initiative == Phases.CurrentSubPhase.RequiredInitiative)
                    {
                        shipsToSkipCombat.Add(shipHolder.Value);
                    }
                }

                SkipCombatByShips(shipsToSkipCombat, Next);
            }
            else
            {
                // If selected ship can attack - skip attack only for this ship

                GenericShip skippedShip = Selection.ThisShip;
                AfterSkippedCombatActivation(skippedShip);
                skippedShip.CallCombatDeactivation(CheckNext);
            }
        }
Beispiel #2
0
        private void SkipCombatByShips(List <GenericShip> shipsToSkipCombat, Action callback)
        {
            if (shipsToSkipCombat != null && shipsToSkipCombat.Count > 0)
            {
                GenericShip shipToSkipCombat = shipsToSkipCombat.First();

                shipsToSkipCombat.Remove(shipToSkipCombat);

                if (!shipToSkipCombat.IsAttackPerformed)
                {
                    shipToSkipCombat.CallCombatActivation(
                        delegate {
                        AfterSkippedCombatActivation(shipToSkipCombat);
                        shipToSkipCombat.CallCombatDeactivation(
                            delegate { SkipCombatByShips(shipsToSkipCombat, callback); }
                            );
                    });
                }
                else
                {
                    SkipCombatByShips(shipsToSkipCombat, callback);
                }
            }
            else
            {
                callback();
            }
        }
Beispiel #3
0
 public override void SkipButton()
 {
     if ((Selection.ThisShip == null) || (Selection.ThisShip.IsAttackPerformed))
     {
         if (TargetsAreAvailable())
         {
             AskToConfirmSkip();
         }
         else
         {
             SkipCombatByShipsWithCurrentInitiative();
         }
     }
     else
     {
         GenericShip skippedShip = Selection.ThisShip;
         AfterSkippedCombatActivation(skippedShip);
         skippedShip.CallCombatDeactivation(CheckNext);
     }
 }
Beispiel #4
0
 private static void FinishCombatActivation()
 {
     Attacker.CallCombatDeactivation(CleanupAndCheckExtraAttacks);
 }