Exemple #1
0
 public static CardPickByPriority DefaultTreasurePlayOrder()
 {
     return(new CardPickByPriority(
                CardAcceptance.For(Cards.Contraband), // play early to provide opponent as little information when banning
                // base set first
                CardAcceptance.For(Cards.Platinum),
                CardAcceptance.For(Cards.Gold),
                CardAcceptance.For(Cards.Silver),
                CardAcceptance.For(Cards.Copper),
                CardAcceptance.For(Cards.Spoils),
                CardAcceptance.For(Cards.Potion),
                // alphabetical, all other treasures that dont really depend on order
                CardAcceptance.For(Cards.Cache),
                CardAcceptance.For(Cards.TreasureTrove),
                CardAcceptance.For(Cards.FoolsGold),
                CardAcceptance.For(Cards.Loan),
                CardAcceptance.For(Cards.Harem),
                CardAcceptance.For(Cards.Hoard),
                CardAcceptance.For(Cards.Masterpiece),
                CardAcceptance.For(Cards.PhilosophersStone),
                CardAcceptance.For(Cards.Quarry),
                CardAcceptance.For(Cards.RoyalSeal),
                CardAcceptance.For(Cards.Stash),
                CardAcceptance.For(Cards.Talisman),
                // cards whose benefit is sensitive to ordering
                CardAcceptance.For(Cards.Venture),        // playing this card might increase the number of treasures played
                CardAcceptance.For(Cards.CounterFeit),    // after venture so that you have more variety to counterfeit
                CardAcceptance.For(Cards.IllGottenGains), // by playing after venture, you have more information about whether to gain the copper
                CardAcceptance.For(Cards.HornOfPlenty),   // play relatively last so it has the most variety of cards to trigger with
                CardAcceptance.For(Cards.Bank)));         // try to make bank as valuable as possibile.
 }
Exemple #2
0
 public static CardPickByPriority DefaultDiscardOrder()
 {
     return(new CardPickByPriority(
                CardAcceptance.For(Cards.Province),
                CardAcceptance.For(Cards.Duchy),
                CardAcceptance.For(Cards.Estate),
                CardAcceptance.For(Cards.OvergrownEstate),
                CardAcceptance.For(Cards.Hovel),
                CardAcceptance.For(Cards.Ruins),
                CardAcceptance.For(Cards.Curse),
                CardAcceptance.For(Cards.Copper)));
 }
Exemple #3
0
 public static ICardPicker DefaultTrashOrder(ICardPicker purchaseOrder)
 {
     return(new CardPickByPriority(
                CardAcceptance.For(Cards.Curse),
                CardAcceptance.For(Cards.RuinedVillage),
                CardAcceptance.For(Cards.RuinedMarket),
                CardAcceptance.For(Cards.Survivors),
                CardAcceptance.For(Cards.RuinedLibrary),
                CardAcceptance.For(Cards.AbandonedMine),
                CardAcceptance.For(Cards.Estate, gameState => !purchaseOrder.DoesCardPickerMatch(gameState, Cards.Estate)),
                CardAcceptance.For(Cards.OvergrownEstate),
                CardAcceptance.For(Cards.Hovel),
                CardAcceptance.For(Cards.Copper, gameState => !purchaseOrder.DoesCardPickerMatch(gameState, Cards.Copper))));
 }
        public Card GetPreferredCardReverse(GameState gameState, CardPredicate cardPredicate)
        {
            for (int i = this.cardAcceptances.Length - 1; i >= 0; i--)
            {
                CardAcceptance acceptance = this.cardAcceptances[i];
                if (cardPredicate(acceptance.card) &&
                    acceptance.match(gameState))
                {
                    return(acceptance.card);
                }
            }

            return(null);
        }
        public Card GetPreferredCard(GameState gameState, CardPredicate cardPredicate)
        {
            var existingCards = gameState.Self.AllOwnedCards.Clone();

            int numberOfTries = 2;

            for (int index = 0; index < this.buildOrder.Length; ++index)
            {
                CardAcceptance acceptance = this.buildOrder[index];

                if (acceptance == null)
                {
                    continue;
                }

                if (!acceptance.match(gameState))
                {
                    continue;
                }

                Card currentCard = acceptance.card;

                if (existingCards.HasCard(currentCard))
                {
                    existingCards.RemoveCard(currentCard);
                    continue;
                }
                numberOfTries--;

                if (cardPredicate(currentCard))
                {
                    return(currentCard);
                }

                if (numberOfTries == 0)
                {
                    break;
                }
            }

            return(null);
        }
        public int AmountWillingtoOverPayFor(Card card, GameState gameState)
        {
            bool wantsToGainCard = this.GetPreferredCard(gameState, c => c == card) != null;

            return(wantsToGainCard ? CardAcceptance.DefaultOverpayAmount(gameState) : 0);
        }
        public static CardAcceptance For(Card card, CountSource countSource, Comparison comparison, int threshhold, GameStatePredicate match)
        {
            MatchDescription descr = new MatchDescription(card, countSource, comparison, threshhold);

            return(CardAcceptance.For(card, gameState => descr.GameStatePredicate(gameState) && match(gameState)));
        }