From a1064cc5a1f814d66594d318d747cf0ffb18b7dc Mon Sep 17 00:00:00 2001 From: Rob Speer Date: Sun, 19 Feb 2012 15:49:53 -0500 Subject: [PATCH] Deploying to Web from commit 7ab4c62d636600ebe28a5ae2d13a3b1cec54b216 --- playWeb.js | 2 +- strategies.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/playWeb.js b/playWeb.js index f4007db..f49ebec 100644 --- a/playWeb.js +++ b/playWeb.js @@ -253,7 +253,7 @@ } } } - return [my.menagerieDraws() === 3 ? "Menagerie" : void 0, my.shantyTownDraws(true) === 2 ? "Shanty Town" : void 0, my.countInHand("Province") > 0 ? "Tournament" : void 0, wantsToPlayMultiplier ? "Throne Room" : void 0, wantsToPlayMultiplier ? "King's Court" : void 0, state.gainsToEndGame() >= 5 || (_ref = state.cardInfo.Curse, __indexOf.call(my.draw, _ref) >= 0) ? "Lookout" : void 0, "Cartographer", "Bag of Gold", "Apothecary", "Scout", "Scrying Pool", "Spy", "Trusty Steed", "Festival", "University", "Farming Village", "Bazaar", "Worker's Village", "City", "Walled Village", "Fishing Village", "Village", "Border Village", "Mining Village", "Grand Market", "Hunting Party", "Alchemist", "Laboratory", "Caravan", "Market", "Peddler", "Treasury", my.inPlay.length >= 2 || multiplier > 1 ? "Conspirator" : void 0, "Familiar", "Highway", "Scheme", "Wishing Well", (_ref2 = state.cardInfo.Crossroads, __indexOf.call(my.hand, _ref2) < 0) ? "Great Hall" : void 0, (_ref3 = state.cardInfo.Copper, __indexOf.call(my.hand, _ref3) >= 0) ? "Spice Merchant" : void 0, this.choose('stablesDiscard', state, my.hand.concat([null])) ? "Stables" : void 0, "Apprentice", "Pearl Diver", "Hamlet", "Lighthouse", "Haven", "Minion", my.actions > 1 && my.hand.length <= 4 ? "Library" : void 0, my.actions > 1 ? "Torturer" : void 0, my.actions > 1 ? "Margrave" : void 0, my.actions > 1 ? "Rabble" : void 0, my.actions > 1 ? "Witch" : void 0, my.actions > 1 ? "Ghost Ship" : void 0, my.actions > 1 ? "Smithy" : void 0, my.actions > 1 ? "Embassy" : void 0, my.actions > 1 && my.hand.length <= 4 ? "Watchtower" : void 0, my.actions > 1 && my.hand.length <= 5 ? "Library" : void 0, my.actions > 1 && (my.discard.length + my.draw.length) <= 3 ? "Courtyard" : void 0, my.actions > 1 ? "Oracle" : void 0, !(my.countInPlay(state.cardInfo.Crossroads) > 0) ? "Crossroads" : void 0, "Great Hall", wantsToTrash >= multiplier ? "Upgrade" : void 0, "Oasis", "Pawn", "Warehouse", "Cellar", my.actions > 1 && my.hand.length <= 6 ? "Library" : void 0, this.choose('spiceMerchantTrash', state, my.hand.concat([null])) ? "Spice Merchant" : void 0, "King's Court", okayToPlayMultiplier ? "Throne Room" : void 0, "Tournament", "Menagerie", my.actions < 2 ? "Shanty Town" : void 0, "Crossroads", "Nobles", my.countInHand("Treasure Map") >= 2 ? "Treasure Map" : void 0, "Followers", "Mountebank", "Witch", "Torturer", "Margrave", "Sea Hag", "Young Witch", "Tribute", "Goons", "Wharf", "Tactician", "Masquerade", "Vault", "Ghost Ship", "Princess", my.countInHand("Province") >= 1 ? "Explorer" : void 0, my.hand.length <= 3 ? "Library" : void 0, "Jester", "Militia", "Cutpurse", "Bridge", "Bishop", "Horse Traders", "Jack of All Trades", "Steward", countInHandCopper >= 1 ? "Moneylender" : void 0, "Expand", "Remodel", "Salvager", "Mine", countInHandCopper >= 3 ? "Coppersmith" : void 0, my.hand.length <= 4 ? "Library" : void 0, "Rabble", "Envoy", "Smithy", "Embassy", my.hand.length <= 3 ? "Watchtower" : void 0, "Council Room", my.hand.length <= 5 ? "Library" : void 0, my.hand.length <= 4 ? "Watchtower" : void 0, (my.discard.length + my.draw.length) > 0 ? "Courtyard" : void 0, "Merchant Ship", my.countInHand("Estate") >= 1 ? "Baron" : void 0, "Monument", "Oracle", wantsToTrash >= multiplier * 2 ? "Remake" : void 0, "Adventurer", "Harvest", "Haggler", "Mandarin", "Explorer", "Woodcutter", "Nomad Camp", "Chancellor", "Counting House", countInHandCopper >= 2 ? "Coppersmith" : void 0, state.extraturn === false ? "Outpost" : void 0, wantsToTrash ? "Ambassador" : void 0, wantsToTrash + my.countInHand("Silver") >= 2 * multiplier ? "Trading Post" : void 0, wantsToTrash ? "Chapel" : void 0, wantsToTrash >= multiplier ? "Trader" : void 0, wantsToTrash >= multiplier ? "Trade Route" : void 0, my.ai.choose('mint', state, my.hand) ? "Mint" : void 0, "Secret Chamber", "Pirate Ship", "Noble Brigand", "Thief", "Island", "Fortune Teller", "Bureaucrat", "Navigator", my.actions < 2 ? "Conspirator" : void 0, "Herbalist", "Moat", my.hand.length <= 6 ? "Library" : void 0, my.hand.length <= 5 ? "Watchtower" : void 0, "Ironworks", "Workshop", state.smugglerChoices().length > 1 ? "Smugglers" : void 0, "Feast", wantsToTrash >= multiplier ? "Transmute" : void 0, "Coppersmith", "Saboteur", "Duchess", my.hand.length <= 7 ? "Library" : void 0, my.countInDeck("Gold") >= 4 && state.current.countInDeck("Treasure Map") === 1 ? "Treasure Map" : void 0, "Spice Merchant", "Shanty Town", "Stables", "Chapel", "Library", "Conspirator", null, "Watchtower", "Trade Route", "Treasure Map", "Ambassador", "Throne Room"]; + return [my.menagerieDraws() === 3 ? "Menagerie" : void 0, my.shantyTownDraws(true) === 2 ? "Shanty Town" : void 0, my.countInHand("Province") > 0 ? "Tournament" : void 0, wantsToPlayMultiplier ? "Throne Room" : void 0, wantsToPlayMultiplier ? "King's Court" : void 0, state.gainsToEndGame() >= 5 || (_ref = state.cardInfo.Curse, __indexOf.call(my.draw, _ref) >= 0) ? "Lookout" : void 0, "Cartographer", "Bag of Gold", "Apothecary", "Scout", "Scrying Pool", "Spy", "Trusty Steed", "Festival", "University", "Farming Village", "Bazaar", "Worker's Village", "City", "Walled Village", "Fishing Village", "Village", "Border Village", "Mining Village", "Grand Market", "Hunting Party", "Alchemist", "Laboratory", "Caravan", "Market", "Peddler", "Treasury", my.inPlay.length >= 2 || multiplier > 1 ? "Conspirator" : void 0, "Familiar", "Highway", "Scheme", "Wishing Well", "Golem", (_ref2 = state.cardInfo.Crossroads, __indexOf.call(my.hand, _ref2) < 0) ? "Great Hall" : void 0, (_ref3 = state.cardInfo.Copper, __indexOf.call(my.hand, _ref3) >= 0) ? "Spice Merchant" : void 0, this.choose('stablesDiscard', state, my.hand.concat([null])) ? "Stables" : void 0, "Apprentice", "Pearl Diver", "Hamlet", "Lighthouse", "Haven", "Minion", my.actions > 1 && my.hand.length <= 4 ? "Library" : void 0, my.actions > 1 ? "Torturer" : void 0, my.actions > 1 ? "Margrave" : void 0, my.actions > 1 ? "Rabble" : void 0, my.actions > 1 ? "Witch" : void 0, my.actions > 1 ? "Ghost Ship" : void 0, my.actions > 1 ? "Smithy" : void 0, my.actions > 1 ? "Embassy" : void 0, my.actions > 1 && my.hand.length <= 4 ? "Watchtower" : void 0, my.actions > 1 && my.hand.length <= 5 ? "Library" : void 0, my.actions > 1 && (my.discard.length + my.draw.length) <= 3 ? "Courtyard" : void 0, my.actions > 1 ? "Oracle" : void 0, !(my.countInPlay(state.cardInfo.Crossroads) > 0) ? "Crossroads" : void 0, "Great Hall", wantsToTrash >= multiplier ? "Upgrade" : void 0, "Oasis", "Pawn", "Warehouse", "Cellar", my.actions > 1 && my.hand.length <= 6 ? "Library" : void 0, this.choose('spiceMerchantTrash', state, my.hand.concat([null])) ? "Spice Merchant" : void 0, "King's Court", okayToPlayMultiplier ? "Throne Room" : void 0, "Tournament", "Menagerie", my.actions < 2 ? "Shanty Town" : void 0, "Crossroads", "Nobles", my.countInHand("Treasure Map") >= 2 ? "Treasure Map" : void 0, "Followers", "Mountebank", "Witch", "Torturer", "Margrave", "Sea Hag", "Young Witch", "Tribute", "Goons", "Wharf", "Tactician", "Masquerade", "Vault", "Ghost Ship", "Princess", my.countInHand("Province") >= 1 ? "Explorer" : void 0, my.hand.length <= 3 ? "Library" : void 0, "Jester", "Militia", "Cutpurse", "Bridge", "Bishop", "Horse Traders", "Jack of All Trades", "Steward", countInHandCopper >= 1 ? "Moneylender" : void 0, "Expand", "Remodel", "Salvager", "Mine", countInHandCopper >= 3 ? "Coppersmith" : void 0, my.hand.length <= 4 ? "Library" : void 0, "Rabble", "Envoy", "Smithy", "Embassy", my.hand.length <= 3 ? "Watchtower" : void 0, "Council Room", my.hand.length <= 5 ? "Library" : void 0, my.hand.length <= 4 ? "Watchtower" : void 0, (my.discard.length + my.draw.length) > 0 ? "Courtyard" : void 0, "Merchant Ship", my.countInHand("Estate") >= 1 ? "Baron" : void 0, "Monument", "Oracle", wantsToTrash >= multiplier * 2 ? "Remake" : void 0, "Adventurer", "Harvest", "Haggler", "Mandarin", "Explorer", "Woodcutter", "Nomad Camp", "Chancellor", "Counting House", countInHandCopper >= 2 ? "Coppersmith" : void 0, state.extraturn === false ? "Outpost" : void 0, wantsToTrash ? "Ambassador" : void 0, wantsToTrash + my.countInHand("Silver") >= 2 * multiplier ? "Trading Post" : void 0, wantsToTrash ? "Chapel" : void 0, wantsToTrash >= multiplier ? "Trader" : void 0, wantsToTrash >= multiplier ? "Trade Route" : void 0, my.ai.choose('mint', state, my.hand) ? "Mint" : void 0, "Secret Chamber", "Pirate Ship", "Noble Brigand", "Thief", "Island", "Fortune Teller", "Bureaucrat", "Navigator", my.actions < 2 ? "Conspirator" : void 0, "Herbalist", "Moat", my.hand.length <= 6 ? "Library" : void 0, my.hand.length <= 5 ? "Watchtower" : void 0, "Ironworks", "Workshop", state.smugglerChoices().length > 1 ? "Smugglers" : void 0, "Feast", wantsToTrash >= multiplier ? "Transmute" : void 0, "Coppersmith", "Saboteur", "Duchess", my.hand.length <= 7 ? "Library" : void 0, my.countInDeck("Gold") >= 4 && state.current.countInDeck("Treasure Map") === 1 ? "Treasure Map" : void 0, "Spice Merchant", "Shanty Town", "Stables", "Chapel", "Library", "Conspirator", null, "Watchtower", "Trade Route", "Treasure Map", "Ambassador", "Throne Room"]; }; BasicAI.prototype.multipliedActionPriority = function(state, my) { var skipMultipliers; diff --git a/strategies.js b/strategies.js index 66a0ff0..1999e7a 100644 --- a/strategies.js +++ b/strategies.js @@ -1 +1 @@ -strategies = {"BankWharf":"# Play Big Money including Banks, except buy Wharf with every $5 buy.\n{\n name: 'BankWharf'\n author: 'Geronimoo' #tweaked by Jorbles\n requires: ['Bank', 'Wharf']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6\n \"Duchy\" if state.gainsToEndGame() <= 4\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Bank\"\n \"Gold\"\n \"Wharf\"\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 3\n ]\n}\n","BigEnvoy":"{\n name: 'BigEnvoy'\n requires: ['Envoy']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6 \\\n or state.countInSupply(\"Province\") <= 6\n \n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \"Envoy\" if my.countInDeck(\"Envoy\") < 1\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 3\n ]\n}\n\n","BigMoney":"# This is an implementation of the pure Big Money strategy, updated\n# based on WanderingWinder's forum posts:\n# http://forum.dominionstrategy.com/index.php?topic=625\n{\n name: 'Big Money'\n author: 'WanderingWinder'\n requires: []\n gainPriority: (state, my) -> \n if state.supply.Colony?\n [\n \"Colony\" if my.getTotalMoney() > 32\n \"Province\" if state.gainsToEndGame() <= 6\n \"Duchy\" if state.gainsToEndGame() <= 5\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Province\" if state.countInSupply(\"Colony\") <= 7\n \"Gold\"\n \"Duchy\" if state.gainsToEndGame() <= 6\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 2\n ]\n else\n [\n \"Province\" if my.getTotalMoney() > 18\n \"Duchy\" if state.gainsToEndGame() <= 4\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Gold\"\n \"Duchy\" if state.gainsToEndGame() <= 6\n \"Silver\"\n ]\n}\n\n","BigSmithy":"{\n name: 'BigSmithy'\n requires: ['Smithy']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6 \\\n or state.countInSupply(\"Province\") <= 6\n \n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \"Smithy\" if my.countInDeck(\"Smithy\") < 2 \\\n and my.numCardsInDeck() >= 16\n \"Smithy\" if my.countInDeck(\"Smithy\") < 1\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 3\n ]\n}\n\n","BM_Library":"{\n name: 'BM Library'\n requires: ['Library']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \"Library\"\n \"Silver\"\n ]\n}\n","BM_Masquerade":"# ehunt described this strategy in words on the Dominion Strategy Forum,\n# describing it as a \"fun, if sobering, experiment\" to play Masquerade\n# completely algorithmically in a real game.\n#\n# \"Do not try to tweak big money masquerade. Instead, let big money\n# masquerade tweak you.\"\n{\n name: 'BM Masquerade'\n requires: ['Masquerade']\n author: 'ehunt'\n gainPriority: (state, my) -> \n [\n \"Province\"\n \"Gold\"\n \"Duchy\" if state.gainsToEndGame() <= 5\n \"Masquerade\" if my.countInDeck(\"Masquerade\") == 0\n \"Silver\"\n ]\n}\n\n","ChapelMountebank":"# Gain one Chapel and one Mountebank, and otherwise play Big Money.\n{\n name: 'ChapelMountebank'\n requires: ['Chapel', 'Mountebank']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6\n \"Mountebank\" if my.countInDeck(\"Mountebank\") == 0\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \n # If this bot somehow gets rid of its chapel later in the game,\n # it won't try to acquire another one.\n \"Chapel\" if my.coins <= 3 and my.countInDeck(\"Chapel\") == 0 and my.turnsTaken <= 2\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 3\n ]\n}\n","ChapelWitch":"# Gain one Chapel and one Witch, and otherwise play Big Money. One of the most\n# powerful two-card strategies there is.\n{\n name: 'ChapelWitch'\n requires: ['Chapel', 'Witch']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6\n \"Witch\" if my.countInDeck(\"Witch\") == 0\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \n # If this bot somehow gets rid of its chapel later in the game,\n # it won't try to acquire another one.\n \"Chapel\" if my.coins <= 3 and my.countInDeck(\"Chapel\") == 0 and my.turnsTaken <= 2\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 3\n ]\n\n trashPriority: (state, my) -> [\n \"Curse\"\n \"Estate\" if state.gainsToEndGame() > 4\n \"Copper\" if my.getTotalMoney() > 4\\\n and not (my.countInDeck(\"Witch\") == 0 and my.getTreasureInHand() == 5)\n \"Estate\" if state.gainsToEndGame() > 2\n ]\n\n}\n","ChapelYoungWitch":"{\n name: 'ChapelYoungWitch'\n requires: ['Chapel', 'Young Witch']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6\n \"Young Witch\" if my.countInDeck(\"Young Witch\") == 0\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \n # If this bot somehow gets rid of its chapel later in the game,\n # it won't try to acquire another one.\n \"Chapel\" if my.coins <= 3 and my.countInDeck(\"Chapel\") == 0 and my.turnsTaken <= 2\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 3\n ]\n\n trashPriority: (state, my) -> [\n \"Curse\"\n \"Estate\" if state.gainsToEndGame() > 4\n \"Copper\" if my.getTotalMoney() > 4\\\n and not (my.countInDeck(\"Witch\") == 0 and my.getTreasureInHand() == 5)\n \"Estate\" if state.gainsToEndGame() > 2\n ]\n\n}\n","DoubleAmbassador":"{\n name: 'Double Ambassador'\n author: 'rspeer'\n requires: ['Ambassador']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \"Ambassador\" if my.countInDeck(\"Ambassador\") < 2\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 3\n ]\n\n discardPriority: (state, my) -> [\n \"Colony\"\n \"Duchy\"\n \"Province\"\n \"Ambassador\" if my.countInHand(\"Ambassador\") > 1\n \"Estate\" if my.countInHand(\"Ambassador\") == 0 \\\n or state.gainsToEndGame <= 5\n \"Curse\" if my.countInHand(\"Ambassador\") == 0 \\\n or state.gainsToEndGame <= 5\n \"Copper\"\n \"Estate\"\n \"Curse\"\n null\n \"Silver\"\n ]\n}\n","DoubleGhostShip":"{\n name: 'DoubleGhostShip'\n requires: ['Ghost Ship']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6 and my.countInDeck(\"Gold\") > 0\n \"Ghost Ship\" if my.countInDeck(\"Ghost Ship\") < 2\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \"Silver\"\n ]\n}\n","DoubleGoons":"{\n name: 'DoubleGoons'\n requires: ['Goons']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Goons\" if my.countInDeck(\"Goons\") < 2\n \"Gold\"\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 4 \\\n and my.countInPlay(\"Goons\") > 0\n ]\n}\n","DoubleJack":"# Buys two Jacks of All Trades and otherwise plays a version of Big Money.\n#\n# This has no Colony rules, because it would be a terrible strategy in\n# Colony games.\n{\n name: 'DoubleJack'\n author: 'rspeer'\n requires: [\"Jack of All Trades\"]\n gainPriority: (state, my) -> [\n \"Province\" if my.getTotalMoney() > 15\n \"Duchy\" if state.gainsToEndGame() <= 5\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Gold\"\n \"Jack of All Trades\" if my.countInDeck(\"Jack of All Trades\") < 2\n \"Silver\"\n ]\n}\n","DoubleMilitia":"{\n name: 'DoubleMilitia'\n requires: ['Militia']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Militia\" if my.countInDeck(\"Militia\") < 2\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 3\n ]\n}\n","DoubleMountebank":"{\n name: 'DoubleMountebank'\n requires: ['Mountebank']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6 and my.countInDeck(\"Gold\") > 0\n \"Duchy\" if state.gainsToEndGame() <= 5\n \"Mountebank\" if my.countInDeck(\"Mountebank\") < 2\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \"Silver\"\n ]\n}\n","DoubleWitch":"{\n name: 'DoubleWitch'\n requires: ['Witch']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6 and my.countInDeck(\"Gold\") > 0\n \"Witch\" if my.countInDeck(\"Witch\") < 2\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \"Silver\"\n ]\n}\n","KCWharf":"# Buy Wharf with every $5 and King's Court with every $7. Probably not\n# optimized.\n{\n name: 'KCWharf'\n author: 'rspeer'\n requires: [\"King's Court\", \"Wharf\"]\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"King's Court\"\n \"Gold\"\n \"Wharf\"\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 3\n ]\n}\n","MoneylenderWitch":"# Not necessarily a good strategy.\n{\n name: 'MoneylenderWitch'\n requires: ['Moneylender', 'Witch']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6 and my.countInDeck(\"Gold\") > 0\n \"Witch\" if my.countInDeck(\"Witch\") < 2\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \"Moneylender\" if my.countInDeck(\"Moneylender\") == 0\n \"Silver\"\n ]\n}\n","OBM_Adventurer":"# Optimized version of Big Money + Adventurer\n{\n name: 'OBM Adventurer'\n author: 'WanderingWinder'\n requires: ['Adventurer']\n gainPriority: (state, my) -> [\n \"Province\" if my.countInDeck(\"Gold\") > 0\n \"Duchy\" if state.countInSupply(\"Province\") <= 4\n \"Estate\" if state.countInSupply(\"Province\") <= 2\n \"Adventurer\" if state.countInSupply(\"Gold\") > 0 \\\n and my.countInDeck(\"Adventurer\") == 0\n \"Gold\"\n \"Duchy\" if state.countInSupply(\"Province\") <= 5\n \"Silver\"\n ]\n}\n","OBM_Bazaar":"# Optimized version of Big Money + Bazaar\n{\n name: 'OBM Bazaar'\n author: 'WanderingWinder'\n requires: ['Bazaar']\n gainPriority: (state, my) -> [\n \"Province\" if my.countInDeck(\"Gold\") > 0\n \"Duchy\" if state.gainsToEndGame() <= 4\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Gold\"\n \"Duchy\" if state.gainsToEndGame() <= 5\n \"Bazaar\"\n \"Silver\"\n ]\n}\n\n","OBM_Bridge":"# Optimized version of Big Money + Bridge\n{\n name: 'OBM Bridge'\n author: 'WanderingWinder'\n requires: ['Bridge']\n gainPriority: (state, my) -> [\n \"Province\" if my.countInDeck(\"Gold\") > 0\n \"Duchy\" if state.gainsToEndGame() <= 4\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Gold\"\n \"Duchy\" if state.gainsToEndGame() <= 6\n \"Bridge\" if my.countInDeck(\"Bridge\") <= my.countCardTypeInDeck(\"Treasure\") / 10\n \"Bridge\" if my.countInDeck(\"Bridge\") == 0\n \"Silver\"\n ]\n}\n\n","OBM_Chancellor":"{\n name: 'OBM Chancellor'\n author: 'rspeer'\n requires: ['Chancellor']\n gainPriority: (state, my) -> [\n \"Province\" if my.getTotalMoney() > 18\n \"Duchy\" if state.gainsToEndGame() <= 4\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Gold\"\n \"Duchy\" if state.gainsToEndGame() <= 6\n \"Chancellor\" if my.countInDeck(\"Chancellor\") < 1\n \"Silver\"\n ]\n}\n\n","OBM_Coppersmith":"# Plays Coppersmith on 5/2 starts; plays Big Money otherwise.\n{\n name: 'OBM Coppersmith'\n author: 'HiveMindEmulator'\n requires: ['Coppersmith']\n gainPriority: (state, my) -> [\n \"Province\" if my.getTotalMoney() > 18\n \"Duchy\" if state.gainsToEndGame() <= 4\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Gold\"\n \"Duchy\" if state.gainsToEndGame() <= 6\n \"Coppersmith\" if my.numCardsInDeck() == 10 and my.getAvailableMoney() == 5\n \"Silver\"\n ]\n}\n\n","OBM_Courtyard":"{\n name: 'OBM Courtyard'\n author: 'HiveMindEmulator'\n requires: ['Courtyard']\n gainPriority: (state, my) -> [\n \"Province\" if my.countInDeck(\"Gold\") > 0\n \"Duchy\" if state.gainsToEndGame() <= 4\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Gold\"\n \"Duchy\" if state.gainsToEndGame() <= 5\n \"Silver\" if my.countInDeck(\"Silver\") == 0\n \"Courtyard\" if my.countInDeck(\"Courtyard\") == 0\n \"Courtyard\" if my.countInDeck(\"Courtyard\") < my.countCardTypeInDeck(\"treasure\") / 8\n \"Silver\"\n \"Courtyard\" if my.countInDeck(\"Courtyard\") <= 1\n ]\n}\n","OBM_Hunting_Party":"{\n name: 'OBM Hunting Party'\n author: 'DG'\n requires: ['Hunting Party']\n gainPriority: (state, my) -> [\n \"Province\" if my.countInDeck(\"Gold\") > 0\n \"Duchy\" if state.gainsToEndGame() <= 2\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Gold\" if my.countInDeck(\"Gold\") == 0\n \"Hunting Party\"\n \"Gold\"\n \"Estate\" if state.gainsToEndGame() <= 4\n \"Silver\"\n ]\n}\n","OBM_Monument":"# Optimized version of Big Money + Monument\n{\n name: 'OBM Monument'\n author: 'tko'\n requires: ['Monument']\n gainPriority: (state, my) -> [\n \"Province\" if my.getTotalMoney() > 18\n \"Duchy\" if state.gainsToEndGame() <= 4\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Gold\"\n \"Duchy\" if state.gainsToEndGame() <= 5\n \"Monument\" if my.countInDeck(\"Monument\") < 3\n \"Silver\"\n ]\n}\n\n","OBM_Nobles":"{\n name: 'OBM Nobles'\n author: 'rspeer'\n requires: ['Nobles']\n gainPriority: (state, my) -> [\n \"Province\" \n \"Duchy\" if state.gainsToEndGame() <= 4\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Nobles\" if my.countInDeck(\"Nobles\") < 1\n \"Nobles\" if state.gainsToEndGame() <= 6\n \"Gold\"\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 2\n ]\n}\n","Remaker":"{\n name: 'Remaker'\n requires: ['Remake']\n gainPriority: (state, my) -> [\n \"Province\" if my.countInDeck(\"Gold\") > 0\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Gold\"\n \"Remake\" if my.countInDeck(\"Remake\") == 0\n \"Silver\"\n\n # Some inoffensive $4, $5, and $7 cards, in case it needs them:\n \"Expand\"\n \"Laboratory\"\n \"Caravan\"\n ]\n}\n","RoyalBigMoney":"{\n name: 'Royal Big Money'\n requires: ['Big Money']\n gainPriority: (state, my) -> \n if state.supply.Colony?\n [\n \"Colony\" if my.getTotalMoney() > 32\n \"Province\" if state.gainsToEndGame() <= 6\n \"Duchy\" if state.gainsToEndGame() <= 5\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Province\" if state.countInSupply(\"Colony\") <= 7\n \"Gold\"\n \"Duchy\" if state.gainsToEndGame() <= 6\n \"Royal Seal\"\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 2\n ]\n else\n [\n \"Province\" if my.getTotalMoney() > 18\n \"Duchy\" if state.gainsToEndGame() <= 4\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Gold\"\n \"Duchy\" if state.gainsToEndGame() <= 6\n \"Royal Seal\"\n \"Silver\"\n ]\n}\n\n","SchemeWitch":"{\n name: 'SchemeWitch'\n requires: ['Witch', 'Scheme']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6 and my.countInDeck(\"Gold\") > 0\n \"Witch\" if my.countInDeck(\"Witch\") == 0\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \"Scheme\" if my.countInDeck('Scheme') < 2 and my.countInDeck('Silver') > 0\n \"Silver\"\n ]\n}\n","SillyAI":"# SillyAI's strategy is to buy an arbitrary card with the highest available\n# cost. It does a reasonable job of playing like a newbie, it occasionally\n# gets lucky and pulls off nice combos, and it tests a lot of possible\n# states of the game.\n{\n name: 'SillyAI'\n author: 'rspeer'\n requires: []\n gainPriority: (state, my) -> []\n gainValue: (state, card, my) ->\n if my.turnsTaken > 100\n # oh god, just make it stop\n return 1\n if card.name is \"Copper\" or card.name is \"Curse\"\n return -1\n else\n [coins, potions] = card.getCost(state)\n return coins + potions*2 + Math.random()\n}\n","SingleBaron":"{\n name: 'SingleBaron'\n requires: ['Baron']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6\n \"Duchy\" if state.gainsToEndGame() <= 5\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \"Baron\" if my.countInDeck(\"Baron\") == 0\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 2\n ]\n \n discardPriority: (state, my) -> [\n \"Colony\"\n \"Province\"\n \"Duchy\"\n \"Curse\"\n \"Estate\" if my.countInHand(\"Baron\") == 0 \\\n or my.countInHand(\"Estate\") > 1\n \"Copper\"\n \"Baron\" if my.countInHand(\"Estate\") == 0\n null\n \"Silver\"\n \"Estate\"\n \"Baron\"\n ]\n\n}\n","SingleWitch":"{\n name: 'SingleWitch'\n requires: ['Witch']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6 and my.countInDeck(\"Gold\") > 0\n \"Witch\" if my.countInDeck(\"Witch\") == 0\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \"Silver\"\n ]\n}\n","TournamentPlayer":"{\n name: \"TournamentPlayer\"\n author: 'rspeer'\n requires: ['Tournament']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\"\n \"Duchy\" if 0 < state.gainsToEndGame() <= 2\n \"Followers\"\n \"Trusty Steed\"\n \"Bag of Gold\"\n \"Princess\"\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Diadem\"\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \"Tournament\"\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 3\n ]\n \n discardPriority: (state, my) -> [\n \"Colony\"\n \"Duchy\"\n \"Curse\"\n \"Estate\"\n \"Province\" if my.countInHand(\"Tournament\") == 0 \\\n or my.countInHand(\"Province\") > 1\n \"Copper\"\n null\n \"Silver\"\n \"Gold\"\n ]\n\n}\n"} +strategies = {"BankWharf":"# Play Big Money including Banks, except buy Wharf with every $5 buy.\n{\n name: 'BankWharf'\n author: 'Geronimoo' #tweaked by Jorbles\n requires: ['Bank', 'Wharf']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6\n \"Duchy\" if state.gainsToEndGame() <= 4\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Bank\"\n \"Gold\"\n \"Wharf\"\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 3\n ]\n}\n","BM_Library":"{\n name: 'BM Library'\n requires: ['Library']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \"Library\"\n \"Silver\"\n ]\n}\n","OBM_Hunting_Party":"{\n name: 'OBM Hunting Party'\n author: 'DG'\n requires: ['Hunting Party']\n gainPriority: (state, my) -> [\n \"Province\" if my.countInDeck(\"Gold\") > 0\n \"Duchy\" if state.gainsToEndGame() <= 2\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Gold\" if my.countInDeck(\"Gold\") == 0\n \"Hunting Party\"\n \"Gold\"\n \"Estate\" if state.gainsToEndGame() <= 4\n \"Silver\"\n ]\n}\n","DSFinal1Gardens":"{\n name: 'DSFinal1Gardens'\n requires: ['Bishop', 'Gardens', 'Hamlet', 'Ironworks']\n gainPriority: (state, my) -> \n [\n \"Province\" if my.getTotalMoney() > 18\n \"Duchy\" if state.gainsToEndGame() <= 4\n \"Estate\" if state.gainsToEndGame() <= 4\n \"Gold\"\n \"Duchy\" if state.gainsToEndGame() <= 6\n \"Ironworks\" if my.countInDeck(\"Ironworks\") < 5\n \"Gardens\"\n \"Silver\"\n \"Hamlet\"\n \"Estate\"\n \"Copper\"\n ]\n}\n","OBM_Chancellor":"{\n name: 'OBM Chancellor'\n author: 'rspeer'\n requires: ['Chancellor']\n gainPriority: (state, my) -> [\n \"Province\" if my.getTotalMoney() > 18\n \"Duchy\" if state.gainsToEndGame() <= 4\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Gold\"\n \"Duchy\" if state.gainsToEndGame() <= 6\n \"Chancellor\" if my.countInDeck(\"Chancellor\") < 1\n \"Silver\"\n ]\n}\n\n","DoubleWitch":"{\n name: 'DoubleWitch'\n requires: ['Witch']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6 and my.countInDeck(\"Gold\") > 0\n \"Witch\" if my.countInDeck(\"Witch\") < 2\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \"Silver\"\n ]\n}\n","OBM_Monument":"# Optimized version of Big Money + Monument\n{\n name: 'OBM Monument'\n author: 'tko'\n requires: ['Monument']\n gainPriority: (state, my) -> [\n \"Province\" if my.getTotalMoney() > 18\n \"Duchy\" if state.gainsToEndGame() <= 4\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Gold\"\n \"Duchy\" if state.gainsToEndGame() <= 5\n \"Monument\" if my.countInDeck(\"Monument\") < 3\n \"Silver\"\n ]\n}\n\n","BM_Masquerade":"# ehunt described this strategy in words on the Dominion Strategy Forum,\n# describing it as a \"fun, if sobering, experiment\" to play Masquerade\n# completely algorithmically in a real game.\n#\n# \"Do not try to tweak big money masquerade. Instead, let big money\n# masquerade tweak you.\"\n{\n name: 'BM Masquerade'\n requires: ['Masquerade']\n author: 'ehunt'\n gainPriority: (state, my) -> \n [\n \"Province\"\n \"Gold\"\n \"Duchy\" if state.gainsToEndGame() <= 5\n \"Masquerade\" if my.countInDeck(\"Masquerade\") == 0\n \"Silver\"\n ]\n}\n\n","ChapelWitch":"# Gain one Chapel and one Witch, and otherwise play Big Money. One of the most\n# powerful two-card strategies there is.\n{\n name: 'ChapelWitch'\n requires: ['Chapel', 'Witch']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6\n \"Witch\" if my.countInDeck(\"Witch\") == 0\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \n # If this bot somehow gets rid of its chapel later in the game,\n # it won't try to acquire another one.\n \"Chapel\" if my.coins <= 3 and my.countInDeck(\"Chapel\") == 0 and my.turnsTaken <= 2\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 3\n ]\n\n trashPriority: (state, my) -> [\n \"Curse\"\n \"Estate\" if state.gainsToEndGame() > 4\n \"Copper\" if my.getTotalMoney() > 4\\\n and not (my.countInDeck(\"Witch\") == 0 and my.getTreasureInHand() == 5)\n \"Estate\" if state.gainsToEndGame() > 2\n ]\n\n}\n","MoneylenderWitch":"# Not necessarily a good strategy.\n{\n name: 'MoneylenderWitch'\n requires: ['Moneylender', 'Witch']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6 and my.countInDeck(\"Gold\") > 0\n \"Witch\" if my.countInDeck(\"Witch\") < 2\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \"Moneylender\" if my.countInDeck(\"Moneylender\") == 0\n \"Silver\"\n ]\n}\n","BigSmithy":"{\n name: 'BigSmithy'\n requires: ['Smithy']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6 \\\n or state.countInSupply(\"Province\") <= 6\n \n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \"Smithy\" if my.countInDeck(\"Smithy\") < 2 \\\n and my.numCardsInDeck() >= 16\n \"Smithy\" if my.countInDeck(\"Smithy\") < 1\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 3\n ]\n}\n\n","DoubleGoons":"{\n name: 'DoubleGoons'\n requires: ['Goons']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Goons\" if my.countInDeck(\"Goons\") < 2\n \"Gold\"\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 4 \\\n and my.countInPlay(\"Goons\") > 0\n ]\n}\n","OBM_Bazaar":"# Optimized version of Big Money + Bazaar\n{\n name: 'OBM Bazaar'\n author: 'WanderingWinder'\n requires: ['Bazaar']\n gainPriority: (state, my) -> [\n \"Province\" if my.countInDeck(\"Gold\") > 0\n \"Duchy\" if state.gainsToEndGame() <= 4\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Gold\"\n \"Duchy\" if state.gainsToEndGame() <= 5\n \"Bazaar\"\n \"Silver\"\n ]\n}\n\n","KCWharf":"# Buy Wharf with every $5 and King's Court with every $7. Probably not\n# optimized.\n{\n name: 'KCWharf'\n author: 'rspeer'\n requires: [\"King's Court\", \"Wharf\"]\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"King's Court\"\n \"Gold\"\n \"Wharf\"\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 3\n ]\n}\n","SchemeWitch":"{\n name: 'SchemeWitch'\n requires: ['Witch', 'Scheme']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6 and my.countInDeck(\"Gold\") > 0\n \"Witch\" if my.countInDeck(\"Witch\") == 0\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \"Scheme\" if my.countInDeck('Scheme') < 2 and my.countInDeck('Silver') > 0\n \"Silver\"\n ]\n}\n","OBM_Bridge":"# Optimized version of Big Money + Bridge\n{\n name: 'OBM Bridge'\n author: 'WanderingWinder'\n requires: ['Bridge']\n gainPriority: (state, my) -> [\n \"Province\" if my.countInDeck(\"Gold\") > 0\n \"Duchy\" if state.gainsToEndGame() <= 4\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Gold\"\n \"Duchy\" if state.gainsToEndGame() <= 6\n \"Bridge\" if my.countInDeck(\"Bridge\") <= my.countCardTypeInDeck(\"Treasure\") / 10\n \"Bridge\" if my.countInDeck(\"Bridge\") == 0\n \"Silver\"\n ]\n}\n\n","OBM_Adventurer":"# Optimized version of Big Money + Adventurer\n{\n name: 'OBM Adventurer'\n author: 'WanderingWinder'\n requires: ['Adventurer']\n gainPriority: (state, my) -> [\n \"Province\" if my.countInDeck(\"Gold\") > 0\n \"Duchy\" if state.countInSupply(\"Province\") <= 4\n \"Estate\" if state.countInSupply(\"Province\") <= 2\n \"Adventurer\" if state.countInSupply(\"Gold\") > 0 \\\n and my.countInDeck(\"Adventurer\") == 0\n \"Gold\"\n \"Duchy\" if state.countInSupply(\"Province\") <= 5\n \"Silver\"\n ]\n}\n","SingleWitch":"{\n name: 'SingleWitch'\n requires: ['Witch']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6 and my.countInDeck(\"Gold\") > 0\n \"Witch\" if my.countInDeck(\"Witch\") == 0\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \"Silver\"\n ]\n}\n","SingleBaron":"{\n name: 'SingleBaron'\n requires: ['Baron']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6\n \"Duchy\" if state.gainsToEndGame() <= 5\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \"Baron\" if my.countInDeck(\"Baron\") == 0\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 2\n ]\n \n discardPriority: (state, my) -> [\n \"Colony\"\n \"Province\"\n \"Duchy\"\n \"Curse\"\n \"Estate\" if my.countInHand(\"Baron\") == 0 \\\n or my.countInHand(\"Estate\") > 1\n \"Copper\"\n \"Baron\" if my.countInHand(\"Estate\") == 0\n null\n \"Silver\"\n \"Estate\"\n \"Baron\"\n ]\n\n}\n","DoubleAmbassador":"{\n name: 'Double Ambassador'\n author: 'rspeer'\n requires: ['Ambassador']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \"Ambassador\" if my.countInDeck(\"Ambassador\") < 2\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 3\n ]\n\n discardPriority: (state, my) -> [\n \"Colony\"\n \"Duchy\"\n \"Province\"\n \"Ambassador\" if my.countInHand(\"Ambassador\") > 1\n \"Estate\" if my.countInHand(\"Ambassador\") == 0 \\\n or state.gainsToEndGame <= 5\n \"Curse\" if my.countInHand(\"Ambassador\") == 0 \\\n or state.gainsToEndGame <= 5\n \"Copper\"\n \"Estate\"\n \"Curse\"\n null\n \"Silver\"\n ]\n}\n","SillyAI":"# SillyAI's strategy is to buy an arbitrary card with the highest available\n# cost. It does a reasonable job of playing like a newbie, it occasionally\n# gets lucky and pulls off nice combos, and it tests a lot of possible\n# states of the game.\n{\n name: 'SillyAI'\n author: 'rspeer'\n requires: []\n gainPriority: (state, my) -> []\n gainValue: (state, card, my) ->\n if my.turnsTaken > 100\n # oh god, just make it stop\n return 1\n if card.name is \"Copper\" or card.name is \"Curse\"\n return -1\n else\n [coins, potions] = card.getCost(state)\n return coins + potions*2 + Math.random()\n}\n","OBM_Nobles":"{\n name: 'OBM Nobles'\n author: 'rspeer'\n requires: ['Nobles']\n gainPriority: (state, my) -> [\n \"Province\" \n \"Duchy\" if state.gainsToEndGame() <= 4\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Nobles\" if my.countInDeck(\"Nobles\") < 1\n \"Nobles\" if state.gainsToEndGame() <= 6\n \"Gold\"\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 2\n ]\n}\n","DSFinal1Bishop":"{\n name: 'DSFinal1Bishop'\n requires: ['Bishop', 'Gardens', 'Hamlet', 'Ironworks']\n gainPriority: (state, my) -> \n [\n \"Province\" if my.getTotalMoney() > 18\n \"Duchy\" if state.gainsToEndGame() <= 4\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Gold\"\n \"Duchy\" if state.gainsToEndGame() <= 6\n \"Ironworks\" if my.countInDeck(\"Ironworks\") < 2\n \"Bishop\" if my.countInDeck(\"Bishop\") < 2\n \"Gardens\" if my.countInDeck(\"Gardens\") < 2\n \"Silver\"\n \"Hamlet\"\n ]\n}\n","OBM_Coppersmith":"# Plays Coppersmith on 5/2 starts; plays Big Money otherwise.\n{\n name: 'OBM Coppersmith'\n author: 'HiveMindEmulator'\n requires: ['Coppersmith']\n gainPriority: (state, my) -> [\n \"Province\" if my.getTotalMoney() > 18\n \"Duchy\" if state.gainsToEndGame() <= 4\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Gold\"\n \"Duchy\" if state.gainsToEndGame() <= 6\n \"Coppersmith\" if my.numCardsInDeck() == 10 and my.getAvailableMoney() == 5\n \"Silver\"\n ]\n}\n\n","TournamentPlayer":"{\n name: \"TournamentPlayer\"\n author: 'rspeer'\n requires: ['Tournament']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\"\n \"Duchy\" if 0 < state.gainsToEndGame() <= 2\n \"Followers\"\n \"Trusty Steed\"\n \"Bag of Gold\"\n \"Princess\"\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Diadem\"\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \"Tournament\"\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 3\n ]\n \n discardPriority: (state, my) -> [\n \"Colony\"\n \"Duchy\"\n \"Curse\"\n \"Estate\"\n \"Province\" if my.countInHand(\"Tournament\") == 0 \\\n or my.countInHand(\"Province\") > 1\n \"Copper\"\n null\n \"Silver\"\n \"Gold\"\n ]\n\n}\n","DoubleGhostShip":"{\n name: 'DoubleGhostShip'\n requires: ['Ghost Ship']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6 and my.countInDeck(\"Gold\") > 0\n \"Ghost Ship\" if my.countInDeck(\"Ghost Ship\") < 2\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \"Silver\"\n ]\n}\n","OBM_Courtyard":"{\n name: 'OBM Courtyard'\n author: 'HiveMindEmulator'\n requires: ['Courtyard']\n gainPriority: (state, my) -> [\n \"Province\" if my.countInDeck(\"Gold\") > 0\n \"Duchy\" if state.gainsToEndGame() <= 4\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Gold\"\n \"Duchy\" if state.gainsToEndGame() <= 5\n \"Silver\" if my.countInDeck(\"Silver\") == 0\n \"Courtyard\" if my.countInDeck(\"Courtyard\") == 0\n \"Courtyard\" if my.countInDeck(\"Courtyard\") < my.countCardTypeInDeck(\"treasure\") / 8\n \"Silver\"\n \"Courtyard\" if my.countInDeck(\"Courtyard\") <= 1\n ]\n}\n","Remaker":"{\n name: 'Remaker'\n requires: ['Remake']\n gainPriority: (state, my) -> [\n \"Province\" if my.countInDeck(\"Gold\") > 0\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Gold\"\n \"Remake\" if my.countInDeck(\"Remake\") == 0\n \"Silver\"\n\n # Some inoffensive $4, $5, and $7 cards, in case it needs them:\n \"Expand\"\n \"Laboratory\"\n \"Caravan\"\n ]\n}\n","BigMoney":"# This is an implementation of the pure Big Money strategy, updated\n# based on WanderingWinder's forum posts:\n# http://forum.dominionstrategy.com/index.php?topic=625\n{\n name: 'Big Money'\n author: 'WanderingWinder'\n requires: []\n gainPriority: (state, my) -> \n if state.supply.Colony?\n [\n \"Colony\" if my.getTotalMoney() > 32\n \"Province\" if state.gainsToEndGame() <= 6\n \"Duchy\" if state.gainsToEndGame() <= 5\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Province\" if state.countInSupply(\"Colony\") <= 7\n \"Gold\"\n \"Duchy\" if state.gainsToEndGame() <= 6\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 2\n ]\n else\n [\n \"Province\" if my.getTotalMoney() > 18\n \"Duchy\" if state.gainsToEndGame() <= 4\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Gold\"\n \"Duchy\" if state.gainsToEndGame() <= 6\n \"Silver\"\n ]\n}\n\n","ChapelYoungWitch":"{\n name: 'ChapelYoungWitch'\n requires: ['Chapel', 'Young Witch']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6\n \"Young Witch\" if my.countInDeck(\"Young Witch\") == 0\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \n # If this bot somehow gets rid of its chapel later in the game,\n # it won't try to acquire another one.\n \"Chapel\" if my.coins <= 3 and my.countInDeck(\"Chapel\") == 0 and my.turnsTaken <= 2\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 3\n ]\n\n trashPriority: (state, my) -> [\n \"Curse\"\n \"Estate\" if state.gainsToEndGame() > 4\n \"Copper\" if my.getTotalMoney() > 4\\\n and not (my.countInDeck(\"Witch\") == 0 and my.getTreasureInHand() == 5)\n \"Estate\" if state.gainsToEndGame() > 2\n ]\n\n}\n","RoyalBigMoney":"{\n name: 'Royal Big Money'\n requires: ['Big Money']\n gainPriority: (state, my) -> \n if state.supply.Colony?\n [\n \"Colony\" if my.getTotalMoney() > 32\n \"Province\" if state.gainsToEndGame() <= 6\n \"Duchy\" if state.gainsToEndGame() <= 5\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Province\" if state.countInSupply(\"Colony\") <= 7\n \"Gold\"\n \"Duchy\" if state.gainsToEndGame() <= 6\n \"Royal Seal\"\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 2\n ]\n else\n [\n \"Province\" if my.getTotalMoney() > 18\n \"Duchy\" if state.gainsToEndGame() <= 4\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Gold\"\n \"Duchy\" if state.gainsToEndGame() <= 6\n \"Royal Seal\"\n \"Silver\"\n ]\n}\n\n","BigEnvoy":"{\n name: 'BigEnvoy'\n requires: ['Envoy']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6 \\\n or state.countInSupply(\"Province\") <= 6\n \n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \"Envoy\" if my.countInDeck(\"Envoy\") < 1\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 3\n ]\n}\n\n","DoubleMilitia":"{\n name: 'DoubleMilitia'\n requires: ['Militia']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Militia\" if my.countInDeck(\"Militia\") < 2\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 3\n ]\n}\n","DoubleMountebank":"{\n name: 'DoubleMountebank'\n requires: ['Mountebank']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6 and my.countInDeck(\"Gold\") > 0\n \"Duchy\" if state.gainsToEndGame() <= 5\n \"Mountebank\" if my.countInDeck(\"Mountebank\") < 2\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \"Silver\"\n ]\n}\n","DoubleJack":"# Buys two Jacks of All Trades and otherwise plays a version of Big Money.\n#\n# This has no Colony rules, because it would be a terrible strategy in\n# Colony games.\n{\n name: 'DoubleJack'\n author: 'rspeer'\n requires: [\"Jack of All Trades\"]\n gainPriority: (state, my) -> [\n \"Province\" if my.getTotalMoney() > 15\n \"Duchy\" if state.gainsToEndGame() <= 5\n \"Estate\" if state.gainsToEndGame() <= 2\n \"Gold\"\n \"Jack of All Trades\" if my.countInDeck(\"Jack of All Trades\") < 2\n \"Silver\"\n ]\n}\n","ChapelMountebank":"# Gain one Chapel and one Mountebank, and otherwise play Big Money.\n{\n name: 'ChapelMountebank'\n requires: ['Chapel', 'Mountebank']\n gainPriority: (state, my) -> [\n \"Colony\" if my.countInDeck(\"Platinum\") > 0\n \"Province\" if state.countInSupply(\"Colony\") <= 6\n \"Mountebank\" if my.countInDeck(\"Mountebank\") == 0\n \"Duchy\" if 0 < state.gainsToEndGame() <= 5\n \"Estate\" if 0 < state.gainsToEndGame() <= 2\n \"Platinum\"\n \"Gold\"\n \n # If this bot somehow gets rid of its chapel later in the game,\n # it won't try to acquire another one.\n \"Chapel\" if my.coins <= 3 and my.countInDeck(\"Chapel\") == 0 and my.turnsTaken <= 2\n \"Silver\"\n \"Copper\" if state.gainsToEndGame() <= 3\n ]\n}\n"}