dovin-3.0: A proof assistant for Magic: The Gathering puzzles.
Safe HaskellNone
LanguageHaskell2010

Dovin.Builder

Description

Functions for adding new cards to the board.

withLocation Hand $ do
  withAttributes ["angel", token] $ addCreature (4, 4) "Angel"
Synopsis

Builders

Each of these terminates a build chain, and will add a card with the specified type to the board.

Fluid interface

These methods can be chained together to specify different properties of the card to be created.

as :: Player -> GameMonad () -> GameMonad () Source #

Perform action as the specified player.

withAttribute :: String -> GameMonad () -> GameMonad () Source #

Add an attribute to the created card, as identified by a string. Attributes with that special meaning to Dovin built-ins (such as flying) are defined in Dovin.Attributes.

withAttributes :: [String] -> GameMonad () -> GameMonad () Source #

Helper version of withAttribute for adding multiple attributes at a time.

withCMC :: Int -> GameMonad () -> GameMonad () Source #

Set the converted mana cost of the created card.

withEffect Source #

Arguments

:: EffectMonad CardMatcher

The set of cards to apply the effect to

-> [LayeredEffectPart]

The effect to apply

-> EffectName

Human-readable description, cosmetic only.

-> GameMonad () 
-> GameMonad () 

Add an effect to the created card. The effect will only apply when the card is in play.

withEffectWhen Source #

Arguments

:: EffectMonad Bool

Effect only applies when this returns true

-> EffectMonad CardMatcher

The set of cards to apply the effect to

-> [LayeredEffectPart]

The effect to apply

-> EffectName

Human-readable description, cosmetic only.

-> GameMonad () 
-> GameMonad () 

A more flexible version of withEffect that allows customization of then the effect should apply.

withLocation :: Location -> GameMonad () -> GameMonad () Source #

Place the created card into a specific location.

withOwner :: Player -> GameMonad () -> GameMonad () Source #

Set the owner for the created card. If not specified, defaults to the owner of the card location.

withPlusOneCounters :: Int -> GameMonad () -> GameMonad () Source #

Set the number of +1/+1 counters of the created card.

withMinusOneCounters :: Int -> GameMonad () -> GameMonad () Source #

Set the number of -1/-1 counters of the created card.