module Cards.M11 where
import Action
import CardSelector
import Cards.Common
import Control.Lens
import Control.Monad
import Control.Monad.State
import Mana
import State.Operations hiding (card)
import State.Types

cards :: [Card]
cards = [
  makeCard $ do
     cardName .= "Relentless Rats"
     cardType .= [Creature, Rat]
     castCost $= "1BB"
     stats .= (2,2)
     abilities .= [RecursiveStatic
                   selectSelf
                   (\sourceID tID -> do
                       s <- get
                       pID <- playerControllingCard sourceID
                       let n = (length .
                                filter (\cID -> cID /= sourceID &&
                                              (s^.card cID.cardName) == "Relentless Rats"))
                               (s^.playerWithID pID.field)
                       return $ StatMod (n,n)
                       )
                  ]
  , makeCard $ do
     cardName .= "Prodigal Pyromancer"
     cardType .= [Creature, Human, Wizard]
     castCost $= "2R"
     stats .= (1,1)
     abilities .= [Activated
                   "{Tap}: Prodigal Pyromancer deals 1 damage to target creature or player"
                   TapCost
                   $ \pID cID ->
                     withTarget cID pID
                     (selectPlayer <||> (selectCreature <&&> selectOnField))
                     (\target -> case target of
                         (PlayerTarget pID) -> damagePlayer pID 1
                         (CardTarget cID) -> damageCard cID 1)
                  ]
                                 
  ]