Esempio n. 1
0
        //http://diehrstraits.com/2009/05/basic-dominion-strategy/
        public static Instruction ChapelBuy(IGame game, AIPlayer player)
        {
            int coins = player.CoinCountThisRound;

            if (player.ActiveCount == 1)
            {
                if (coins <= 4)
                {
                    return(GeneralAIHelper.GenerateBuyInstruction("Chapel"));
                }
            }

            if (coins >= 8 && GeneralAIHelper.CanBuyCard(game, "Province"))
            {
                return(GeneralAIHelper.GenerateBuyInstruction("Province"));
            }

            if (coins >= 6 && GeneralAIHelper.CanBuyCard(game, "Gold"))
            {
                return(GeneralAIHelper.GenerateBuyInstruction("Gold"));
            }

            if (coins >= 3 && GeneralAIHelper.CanBuyCard(game, "Silver"))
            {
                return(GeneralAIHelper.GenerateBuyInstruction("Silver"));
            }

            return(null);
        }
Esempio n. 2
0
        // http://diehrstraits.com/2009/05/basic-dominion-strategy/
        public static Instruction GrandSmithyBuy(IGame game, AIPlayer player)
        {
            int coins = player.CoinCountThisRound;

            if (coins >= 8 && GeneralAIHelper.CanBuyCard(game, "Province"))
            {
                return(GeneralAIHelper.GenerateBuyInstruction("Province"));
            }

            if (coins >= 6 && GeneralAIHelper.CanBuyCard(game, "Gold"))
            {
                return(GeneralAIHelper.GenerateBuyInstruction("Gold"));
            }

            if (coins >= 4)
            {
                var smithyCards = player.GetAllPlayerCards().Where(card => card.Info.CardName == "Smithy");

                if (smithyCards.Count() < 3 && GeneralAIHelper.CanBuyCard(game, "Smithy"))
                {
                    return(GeneralAIHelper.GenerateBuyInstruction("Smithy"));
                }
            }

            if (coins >= 3 && GeneralAIHelper.CanBuyCard(game, "Silver"))
            {
                return(GeneralAIHelper.GenerateBuyInstruction("Silver"));
            }

            return(null);
        }