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; }
private void PerformCannonAction(Card target) { int opponentsIndex = GetOpponentPlayerIndex(); Card cardToDestroy = ScoreZones[opponentsIndex].RemoveCard(target); if (cardToDestroy != null) { DiscardPile.AddCard(cardToDestroy); DoesCannonNeedTarget = false; } }
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(); }
public List <Card> GetMapCards() { if (Field[Field.Count - 1].Suit != Suites.Maps) { return(null); } if (MapCache == null) { MapCache = DiscardPile.PeakRandomThree(); } return(MapCache); }
private void PerformMapAction(Card target) { if (!MapCache.Contains(target)) { return; } Card cardTaken = DiscardPile.DrawSelectedCard(target); if (cardTaken != null) { Field.Add(cardTaken); MapCache = null; } }
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; }