Example #1
0
        private void processBust()
        {
            if (ChestAndKeyBeforeAnchor())
            {
                ScoreZones[(int)CurrentPlayersTurn].AddMultipleCards(
                    DiscardPile.DrawRandomLump(
                        CardsBeforeAnchor()));
            }
            bool anchor = false;

            while (Field.Count > 0)
            {
                Card currentCard = Field[Field.Count - 1];
                if (anchor)
                {
                    ScoreZones[(int)CurrentPlayersTurn].AddCard(currentCard);
                }
                else
                {
                    DiscardPile.AddCard(currentCard);
                }
                Field.Remove(currentCard);
                if (currentCard.Suit == Suites.Anchors)
                {
                    anchor = true;
                }
            }
            SwitchPlayers();
            DoesCannonNeedTarget = false;
            KrakenCannonOverride = false;
        }
Example #2
0
        private void PerformCannonAction(Card target)
        {
            int  opponentsIndex = GetOpponentPlayerIndex();
            Card cardToDestroy  = ScoreZones[opponentsIndex].RemoveCard(target);

            if (cardToDestroy != null)
            {
                DiscardPile.AddCard(cardToDestroy);
                DoesCannonNeedTarget = false;
            }
        }
Example #3
0
 private void PerformTakeAllAction()
 {
     if (ChestAndKeyBothPresentOnField())
     {
         int cardsToTake = Math.Min(Field.Count, DiscardPile.Count);
         ScoreZones[(int)CurrentPlayersTurn].AddMultipleCards(DiscardPile.DrawRandomLump(cardsToTake));
     }
     ScoreZones[(int)CurrentPlayersTurn].AddMultipleCards(Field);
     Field.Clear();
     SwitchPlayers();
 }
Example #4
0
 public List <Card> GetMapCards()
 {
     if (Field[Field.Count - 1].Suit != Suites.Maps)
     {
         return(null);
     }
     if (MapCache == null)
     {
         MapCache = DiscardPile.PeakRandomThree();
     }
     return(MapCache);
 }
Example #5
0
        private void PerformMapAction(Card target)
        {
            if (!MapCache.Contains(target))
            {
                return;
            }
            Card cardTaken = DiscardPile.DrawSelectedCard(target);

            if (cardTaken != null)
            {
                Field.Add(cardTaken);
                MapCache = null;
            }
        }
Example #6
0
 private void Initalize()
 {
     Deck = Deck.UnshuffledDeckWithoutTwos();
     Deck.Shuffle();
     DiscardPile = DiscardPile.NewDiscardPile();
     ScoreZones  = new ScoreZone[2] {
         new ScoreZone(), new ScoreZone()
     };
     Field = new List <Card>();
     CurrentPlayersTurn      = Players.PlayerOne;
     CurrentAvailableActions = new List <Actions>()
     {
         Actions.Draw
     };
     IsGameOver = false;
 }