Thanks, DStu. Is there a way I can patch it for myself if I'm running from a browser? Just dumping the fixed makeCard code into the "Player 1" window in my browser doesn't work.
I don't thin you can patch, but you can workaround:
{
name: 'LookBug'
requires: ['Lookout']
gainPriority: (state, my) -> [
"Colony" if my.countInDeck("Platinum") > 0
"Province" if state.countInSupply("Colony") <= 6 \
or state.countInSupply("Province") <= 6
"Duchy" if 0 < state.gainsToEndGame() <= 5
"Estate" if 0 < state.gainsToEndGame() <= 2
"Platinum"
"Gold" if my.countInDeck("Gold") < 2
"Lookout"
"Silver"
]
actionPriority: (state, my) ->
if state.gainsToEndGame() > 5 or ...
"Lookout"
}
so just add an actionPriority function to your bot, which returns a list containing the priorities you want your cards played. Note that you have to add all the cards of you bot there, as this overwrites the call of ai_value from cards (IIRC). You might want to look into old_actionPriority in basicAI.cofffee if you have some more cards in your bot to see how they used to be prioritized.
Maybe
actionPriority: (state, my) ->
old_actionPriority(state,my)
does also work, at least Lookout is implemented correctly there, but there might be some newer cards (like from Guilds and Dark Ages) that are not listed there anymore.
:e corrected name of old_actionPriority. Maybe you also have to reference it over the ai, in this case it is
my.ai.old_actionPriority(state,my)
I'm not sure what exactly the scope is from which the code is called here.
edit: OK, actionPriority seems to be not called anymore, it's now playPriority if I understand this correctly. Problem is that this one is merged with the Treasures, so you must inculde all the treasures in your list, too, otherwise the bot does not play Treasures.