Exemplo n.º 1
0
        public CardGainAvailablility[] GetCardAvailability(int numberOfPlayers, CardAvailabilityType cardAvailabilityType)
        {
            int victoryCount = (numberOfPlayers == 2) ? 8 : 12;

            var builder = new CardGainAvailabilityBuilder(victoryCount, numberOfPlayers, cardAvailabilityType);

            builder.AddCardTypeIfNotPresent(Cards.Copper);
            builder.AddCardTypeIfNotPresent(Cards.Silver);
            builder.AddCardTypeIfNotPresent(Cards.Gold);
            if (this.useColonyAndPlatinum)
            {
                builder.AddCardTypeIfNotPresent(Cards.Platinum);
                builder.AddCardTypeIfNotPresent(Cards.Colony);
            }

            if (this.useShelters)
            {
                switch (cardAvailabilityType)
                {
                case CardAvailabilityType.AllPossibleCardsInGame:
                {
                    builder.AddStartingCard(Cards.Necropolis);
                    builder.AddStartingCard(Cards.Hovel);
                    builder.AddStartingCard(Cards.OvergrownEstate);
                    break;
                }
                }
            }

            builder.AddSupply(victoryCount + (this.useShelters ? 0 : numberOfPlayers * 3), Cards.Estate);
            builder.AddCardTypeIfNotPresent(Cards.Duchy);
            builder.AddCardTypeIfNotPresent(Cards.Province);
            builder.AddSupply((numberOfPlayers - 1) * 10, Cards.Curse);

            foreach (Card card in this.kingdomPiles)
            {
                builder.AddCardTypeIfNotPresent(card);
                if (card == Cards.YoungWitch && baneCard != null)
                {
                    builder.AddCardTypeIfNotPresent(baneCard);
                }
            }

            return(builder.Result);
        }
Exemplo n.º 2
0
        public CardGainAvailablility[] GetCardAvailability(int numberOfPlayers, CardAvailabilityType cardAvailabilityType)
        {
            var builder = new CardGainAvailabilityBuilder();

            int curseCount   = (numberOfPlayers - 1) * 10;
            int ruinsCount   = (numberOfPlayers - 1) * 10;
            int victoryCount = (numberOfPlayers == 2) ? 8 : 12;

            builder.AddSupply(60, Cards.Copper);
            builder.AddSupply(40, Cards.Silver);
            builder.AddSupply(30, Cards.Gold);
            if (this.useColonyAndPlatinum)
            {
                builder.AddSupply(20, Cards.Platinum);
            }
            if (this.kingdomPiles.Where(card => card.potionCost != 0).Any())
            {
                builder.AddSupply(16, Cards.Potion);
            }
            if (this.kingdomPiles.Where(card => card.requiresSpoils).Any())
            {
                builder.AddNonSupply(16, Cards.Spoils);
            }

            if (this.useShelters)
            {
                switch (cardAvailabilityType)
                {
                case CardAvailabilityType.AdditionalCardsAfterKingdom:
                case CardAvailabilityType.AllPossibleCardsInGame:
                {
                    builder.AddStartingCard(Cards.Necropolis);
                    builder.AddStartingCard(Cards.Hovel);
                    builder.AddStartingCard(Cards.OvergrownEstate);
                    break;
                }
                }
            }


            builder.AddSupply(victoryCount + (!this.useShelters ? numberOfPlayers * 3 : 0), Cards.Estate);
            builder.AddSupply(victoryCount, Cards.Duchy);
            builder.AddSupply(victoryCount, Cards.Province);
            if (this.useColonyAndPlatinum)
            {
                builder.AddSupply(victoryCount, Cards.Colony);
            }
            builder.AddSupply(curseCount, Cards.Curse);

            if (cardAvailabilityType != CardAvailabilityType.AdditionalCardsAfterKingdom)
            {
                foreach (Card card in this.kingdomPiles)
                {
                    if (card.isVictory)
                    {
                        builder.AddSupply(victoryCount, card);
                    }
                    else
                    {
                        builder.AddSupply(card.defaultSupplyCount, card);
                    }

                    if (card == Cards.YoungWitch && baneCard != null)
                    {
                        if (baneCard.isVictory)
                        {
                            builder.AddSupply(victoryCount, baneCard);
                        }
                        else
                        {
                            builder.AddSupply(card.defaultSupplyCount, baneCard);
                        }
                    }
                }
            }

            if (this.kingdomPiles.Where(card => card.requiresRuins).Any())
            {
                switch (cardAvailabilityType)
                {
                case CardAvailabilityType.AllPossibleCardsInGame:
                case CardAvailabilityType.AdditionalCardsAfterKingdom:
                {
                    foreach (var card in ruins)
                    {
                        builder.AddSupply(1, card);
                    }
                    break;
                }
                }

                switch (cardAvailabilityType)
                {
                case CardAvailabilityType.AllPossibleCardsInGame:
                case CardAvailabilityType.TypesForBuyingOrGaining:
                {
                    builder.AddSupply(ruinsCount, Cards.Ruins);
                    break;
                }
                }
            }

            if (this.kingdomPiles.Where(card => card == Cards.Hermit).Any())
            {
                builder.AddNonSupply(10, Cards.Madman);
            }

            if (this.kingdomPiles.Where(card => card == Cards.Urchin).Any())
            {
                builder.AddNonSupply(10, Cards.Mercenary);
            }

            if (this.kingdomPiles.Where(card => card == Cards.Tournament).Any())
            {
                foreach (Card prize in prizes)
                {
                    builder.AddNonSupply(1, prize);
                }
            }

            return(builder.Result);
        }