Skip to content

Commit

Permalink
Merge pull request #6 from DStu-dominion/working
Browse files Browse the repository at this point in the history
added Hunting Grounds
  • Loading branch information
aiannacc committed Mar 2, 2014
2 parents 8f53b0c + d3ac090 commit ad05719
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
11 changes: 10 additions & 1 deletion basicAI.coffee
Expand Up @@ -812,6 +812,13 @@ class BasicAI
herbalistValue: (state, card, my) =>
this.mintValue(state, card, my)


huntingGroundsGainPriority: (state, my) -> [
"Duchy"
"Estates"
]


# islandPriority chooses which card to set aside with Island. At present this
# list is incomplete, but covers just about everything that we would want to set aside
# with an Island.
Expand Down Expand Up @@ -1185,7 +1192,9 @@ class BasicAI
else
return true


# method was missing, just quickfix default to false
wantsToJM: (state, my) ->
false


wantsToDiscardBeggar: (state) ->
Expand Down
24 changes: 24 additions & 0 deletions cards.coffee
Expand Up @@ -1621,6 +1621,7 @@ makeCard 'Saboteur', attack, {
cardToTrash = drawn[0]
state.log("...#{state.current.ai} trashes #{opp.ai}'s #{cardToTrash}.")
state.trash.push(drawn[0])
drawn[0].trashEffect(state, state.current)
choices = upgradeChoices(state, drawn, c.Saboteur.upgradeFilter)
choices.push([cardToTrash,null])
choice = opp.ai.choose('upgrade', state, choices)
Expand Down Expand Up @@ -2502,6 +2503,29 @@ makeCard 'Hunting Party', action, {
ai_playValue: (state, my) -> 790
}


makeCard 'Hunting Grounds', action, {
cost: 6
cards: 4

trashEffect: (state, player) ->
choice = player.ai.choose('huntingGroundsGain', state, ["Estates", "Duchy"])
if choice == "Estates"
state.gainCard(player, c.Estate)
state.gainCard(player, c.Estate)
state.gainCard(player, c.Estate)
else if choice == "Duchy"
state.gainCard(player, c.Duchy)
else
state.log("Invalid choice for HuntingGroundsGain: #{choice}!")
state.gainCard(player, c.Duchy)

ai_playValue: (state, my) ->
if my.actions > 1 then 666 else 201
ai_multipliedValue: (state, my) ->
if my.actions > 0 then 1542 else -1
}

makeCard 'Ironworks', action, {
cost: 4
playEffect: (state) ->
Expand Down

0 comments on commit ad05719

Please sign in to comment.