コード例 #1
0
        private static bool ShouldGainCopper(GameState gameState, ICardPicker gainOrder)
        {
            PlayerState self = gameState.Self;

            int minValue = self.ExpectedCoinValueAtEndOfTurn;
            int maxValue = minValue + Strategy.CountInHand(Dominion.Cards.IllGottenGains, gameState);

            if (maxValue == minValue)
            {
                return(false);
            }

            CardPredicate shouldGainCard = delegate(Card card)
            {
                int currentCardCost = card.CurrentCoinCost(self);

                return(currentCardCost >= minValue &&
                       currentCardCost <= maxValue);
            };

            Card cardType = gainOrder.GetPreferredCard(gameState, shouldGainCard);

            if (cardType == null)
            {
                return(false);
            }

            int coppersToGain = DefaultPlayerAction.CostOfCard(cardType, gameState) - minValue;

            return(coppersToGain > 0);
        }
コード例 #2
0
        private static bool DoesHandHaveCombinationToTrash(DefaultPlayerAction playerAction, GameState gameState)
        {
            int countToTrash = Strategy.CountInHandFrom(playerAction.trashOrder, gameState);
            int countInHand  = gameState.Self.Hand.Count;

            return(countInHand - countToTrash <= 2);
        }
コード例 #3
0
        public static MapOfCards <IPlayerAction> GetCardResponses(DefaultPlayerAction playerAction)
        {
            var result = new MapOfCards <IPlayerAction>();

            result[Dominion.Cards.Ambassador]     = new AmbassadorAlwaysReturnBestTrash(playerAction);
            result[Dominion.Cards.Amulet]         = new Amulet(playerAction);
            result[Dominion.Cards.Alchemist]      = new Alchemist(playerAction);
            result[Dominion.Cards.BandOfMisfits]  = new BandOfMisfits(playerAction);
            result[Dominion.Cards.Cartographer]   = new Cartographer(playerAction);
            result[Dominion.Cards.Catacombs]      = new Catacombs(playerAction);
            result[Dominion.Cards.Chancellor]     = new Chancellor(playerAction);
            result[Dominion.Cards.Count]          = new Count(playerAction);
            result[Dominion.Cards.Doctor]         = new Doctor(playerAction);
            result[Dominion.Cards.Explorer]       = new Explorer(playerAction);
            result[Dominion.Cards.Golem]          = new Golem(playerAction);
            result[Dominion.Cards.Governor]       = new Governor(playerAction);
            result[Dominion.Cards.Herbalist]      = new Herbalist(playerAction);
            result[Dominion.Cards.Herald]         = new Herald(playerAction);
            result[Dominion.Cards.HorseTraders]   = new HorseTraders(playerAction);
            result[Dominion.Cards.IllGottenGains] = new IllGottenGainsAlwaysGainCopper(playerAction);
            result[Dominion.Cards.Island]         = new Island(playerAction);
            result[Dominion.Cards.Library]        = new Library(playerAction);
            result[Dominion.Cards.Masquerade]     = new Masquerade(playerAction);
            result[Dominion.Cards.MarketSquare]   = new MarketSquare(playerAction);
            result[Dominion.Cards.Masterpiece]    = new Masterpiece(playerAction);
            result[Dominion.Cards.Messenger]      = new Messenger(playerAction);
            result[Dominion.Cards.Mint]           = new Mint(playerAction);
            result[Dominion.Cards.Miser]          = new Miser(playerAction);
            result[Dominion.Cards.Moat]           = new Moat(playerAction);
            result[Dominion.Cards.Mystic]         = new MysticAndWishingWell(playerAction);
            result[Dominion.Cards.NomadCamp]      = new NomadCamp(playerAction);
            result[Dominion.Cards.Nobles]         = new Nobles(playerAction);
            result[Dominion.Cards.PearlDiver]     = new PearlDiver(playerAction);
            result[Dominion.Cards.Rebuild]        = new Rebuild(playerAction);
            result[Dominion.Cards.SpiceMerchant]  = new SpiceMerchant(playerAction);
            result[Dominion.Cards.Scavenger]      = new Scavenger(playerAction);
            result[Dominion.Cards.ScryingPool]    = new ScryingPool(playerAction);
            result[Dominion.Cards.Scheme]         = new Scheme(playerAction);
            result[Dominion.Cards.Steward]        = new Steward(playerAction);
            result[Dominion.Cards.StoneMason]     = new StoneMason(playerAction);
            result[Dominion.Cards.RoyalSeal]      = new RoyalSeal(playerAction);
            result[Dominion.Cards.SecretChamber]  = new SecretChamber(playerAction);
            result[Dominion.Cards.Treasury]       = new Treasury(playerAction);
            result[Dominion.Cards.Trader]         = new Trader(playerAction);
            result[Dominion.Cards.Urchin]         = new Urchin(playerAction);
            result[Dominion.Cards.Vault]          = new Vault(playerAction);
            result[Dominion.Cards.Watchtower]     = new Watchtower(playerAction);
            result[Dominion.Cards.WalledVillage]  = new WalledVillage(playerAction);
            result[Dominion.Cards.WishingWell]    = result[Dominion.Cards.Mystic];
            result[Dominion.Cards.YoungWitch]     = new YoungWitch(playerAction);

            return(result);
        }
コード例 #4
0
        private static bool PreferMoneyOverDuchy(DefaultPlayerAction playerAction, GameState gameState)
        {
            if (!gameState.GetPile(Dominion.Cards.Duchy).Any)
            {
                return(true);
            }

            int minCoin = gameState.Self.ExpectedCoinValueAtEndOfTurn;
            int maxCoin = minCoin + 3;

            Card mostExpensiveCard = playerAction.purchaseOrder.GetPreferredCard(gameState, card => card.CurrentCoinCost(gameState.Self) > minCoin && card.CurrentCoinCost(gameState.Self) <= maxCoin);
            Card thatOrDuchy       = playerAction.purchaseOrder.GetPreferredCard(gameState, card => card == Dominion.Cards.Duchy || card == mostExpensiveCard);

            if (mostExpensiveCard != null && thatOrDuchy != Dominion.Cards.Duchy)
            {
                return(true);
            }

            return(false);
        }
コード例 #5
0
ファイル: Lookout.cs プロジェクト: origershony/Dominulator
        public static bool ShouldPlay(GameState gameState, DefaultPlayerAction playerAction)
        {
            int cardCountToTrash = Strategy.CountInDeck(Dominion.Cards.Copper, gameState);

            if (!playerAction.purchaseOrder.DoesCardPickerMatch(gameState, Dominion.Cards.Estate))
            {
                cardCountToTrash += Strategy.CountInDeck(Dominion.Cards.Estate, gameState);
            }

            cardCountToTrash += Strategy.CountInDeck(Dominion.Cards.Curse, gameState);
            cardCountToTrash += Strategy.CountInDeck(Dominion.Cards.Hovel, gameState);
            cardCountToTrash += Strategy.CountInDeck(Dominion.Cards.Necropolis, gameState);
            cardCountToTrash += Strategy.CountInDeck(Dominion.Cards.OvergrownEstate, gameState);

            if (!playerAction.purchaseOrder.DoesCardPickerMatch(gameState, Dominion.Cards.Lookout))
            {
                cardCountToTrash += Strategy.CountInDeck(Dominion.Cards.Lookout, gameState);
            }

            int totalCardsOwned = gameState.Self.CardsInDeck.Count;

            return(((double)cardCountToTrash) / totalCardsOwned > 0.4);
        }
コード例 #6
0
 public MysticAndWishingWell(DefaultPlayerAction playerAction)
     : base(playerAction)
 {
 }
コード例 #7
0
ファイル: WatchTower.cs プロジェクト: origershony/Dominulator
 public Watchtower(DefaultPlayerAction playerAction)
     : base(playerAction)
 {
 }
コード例 #8
0
 public IllGottenGainsAlwaysGainCopper(DefaultPlayerAction playerAction)
     : base(playerAction)
 {
 }
コード例 #9
0
 public Steward(DefaultPlayerAction playerAction)
     : base(playerAction)
 {
 }
コード例 #10
0
 public AmbassadorMaxReturn(DefaultPlayerAction playerAction)
     : base(playerAction)
 {
 }
コード例 #11
0
 public AmbassadorAlwaysReturnBestTrash(DefaultPlayerAction playerAction)
     : base(playerAction)
 {
 }
コード例 #12
0
ファイル: Masquerade.cs プロジェクト: origershony/Dominulator
 public Masquerade(DefaultPlayerAction playerAction)
     : base(playerAction)
 {
 }
コード例 #13
0
 public ScryingPool(DefaultPlayerAction playerAction)
     : base(playerAction)
 {
 }
コード例 #14
0
ファイル: Moat.cs プロジェクト: NathanTeeuwen/Dominulator
 public Moat(DefaultPlayerAction playerAction)
     : base(playerAction)
 {
 }
コード例 #15
0
 public Library(DefaultPlayerAction playerAction)
     : base(playerAction)
 {
 }
コード例 #16
0
 public Messenger(DefaultPlayerAction playerAction)
     : base(playerAction)
 {
 }
コード例 #17
0
 public SpiceMerchant(DefaultPlayerAction playerAction)
     : base(playerAction)
 {
 }
コード例 #18
0
 public Catacombs(DefaultPlayerAction playerAction)
     : base(playerAction)
 {
 }
コード例 #19
0
ファイル: Amulet.cs プロジェクト: origershony/Dominulator
 public Amulet(DefaultPlayerAction playerAction)
     : base(playerAction)
 {
 }
コード例 #20
0
ファイル: NomadCamp.cs プロジェクト: origershony/Dominulator
 public NomadCamp(DefaultPlayerAction playerAction)
     : base(playerAction)
 {
 }
コード例 #21
0
 public Masterpiece(DefaultPlayerAction playerAction)
     : base(playerAction)
 {
 }
コード例 #22
0
ファイル: Doctor.cs プロジェクト: origershony/Dominulator
 public Doctor(DefaultPlayerAction playerAction)
     : base(playerAction)
 {
 }
コード例 #23
0
 public Island(DefaultPlayerAction playerAction)
     : base(playerAction)
 {
 }
コード例 #24
0
ファイル: Chancellor.cs プロジェクト: albireoNox/Dominulator
 public Chancellor(DefaultPlayerAction playerAction)
     : base(playerAction)
 {
 }
コード例 #25
0
 public AmbassadorReturnIfNotDisruptPurchase(DefaultPlayerAction playerAction)
     : base(playerAction)
 {
 }
コード例 #26
0
        public static MapOfCards <GameStatePlayerActionPredicate> GetCardShouldPlayDefaults(DefaultPlayerAction playerAction)
        {
            var result = new MapOfCards <GameStatePlayerActionPredicate>();

            result[Dominion.Cards.Apprentice]    = Strategy.HasCardToTrashInHand;
            result[Dominion.Cards.Altar]         = Strategy.HasCardToTrashInHand;
            result[Dominion.Cards.Bishop]        = Strategy.HasCardToTrashInHand;
            result[Dominion.Cards.Forager]       = Strategy.HasCardToTrashInHand;
            result[Dominion.Cards.Island]        = Strategy.HasCardToDiscardInHand;
            result[Dominion.Cards.JunkDealer]    = Strategy.HasCardToTrashInHand;
            result[Dominion.Cards.Lookout]       = Lookout.ShouldPlay;
            result[Dominion.Cards.Masquerade]    = Strategy.HasCardToTrashInHand;
            result[Dominion.Cards.Mercenary]     = Strategy.HasAtLeast2ToTrashInHand;
            result[Dominion.Cards.Remodel]       = Strategy.HasCardToTrashInHand;
            result[Dominion.Cards.Salvager]      = Strategy.HasCardToTrashInHand;
            result[Dominion.Cards.SpiceMerchant] = Strategy.HasCardToTrashInHand;
            result[Dominion.Cards.Trader]        = Strategy.HasCardToTrashInHand;
            result[Dominion.Cards.TradingPost]   = Strategy.HasAtLeast2ToTrashInHand;
            result[Dominion.Cards.Transmute]     = Strategy.HasCardToTrashInHand;
            result[Dominion.Cards.Rats]          = Strategy.HasCardToTrashInHand;
            return(result);
        }
コード例 #27
0
 public BandOfMisfits(DefaultPlayerAction playerAction)
     : base(playerAction)
 {
 }
コード例 #28
0
ファイル: Herbalist.cs プロジェクト: origershony/Dominulator
 public Herbalist(DefaultPlayerAction playerAction)
     : base(playerAction)
 {
 }
コード例 #29
0
 public Alchemist(DefaultPlayerAction playerAction)
     : base(playerAction)
 {
 }
コード例 #30
0
 public IllGottenGains(DefaultPlayerAction playerAction)
     : base(playerAction)
 {
 }