 
 makeCard 'Adventurer', action, {
   cost: 6
-
-  playEffect: (state) ->
-    treasuresDrawn = 0
-    while treasuresDrawn < 2
-      # Take cards one at a time, and either put them in hand or set them
-      # aside depending on their type.
-      drawn = state.current.getCardsFromDeck(1)
-      if drawn.length == 0
-        break
-      card = drawn[0]
-      if card.isTreasure
-        treasuresDrawn += 1
-        state.current.hand.push(card)
-        state.log("...drawing a #{card}.")
-      else
-        state.current.setAside.push(card)
-    state.current.discard = state.current.discard.concat(state.current.setAside)
-    state.current.setAside = []
+  playEffect: (state) ->
+    drawn = state.current.dig(state,
+      (state, card) -> card.isTreasure,
+      2
+    )
+    if drawn.length > 0
+      treasures = drawn
+      state.current.hand = state.current.hand.concat(treasures)
+      state.log("...#{state.current.ai} draws #{treasures}.")
 }
 
 makeCard 'Alchemist', action, {

    2 * Math.floor(unique.length / 5)    
}

makeCard 'Gardens', c.Estate, {
  cost: 4
  getVP: (state) -> Math.floor(state.current.getDeck().length / 10)

      transferCard(c['Horse Traders'], player.hand, player.duration)
}

# So far Hunting Party is the only card that digs for something 
# dependent on the game state.
makeCard 'Hunting Party', action, {
  cost: 5
  cards: +1
  actions: +1
  playEffect: (state) ->
    state.revealHand(state.current)    
    drawn = state.current.dig(state,
      (state, card) -> card not in state.current.hand
    )
    if drawn.length > 0
      card = drawn[0]
      state.log("...#{state.current.ai} draws #{card}.")
      state.current.hand.push(card)
}

makeCard 'Ironworks', action, {
