Skip to content

4: Creating and playing a Game

Jerome Leclanche edited this page Sep 5, 2015 · 2 revisions

https://github.com/jleclanche/fireplace/blob/master/tests/full_game.py

Mulligans

Mulligans set a choice variable on the player. If that variable is set, ending the turn or performing any action will result in an error.

The choice variable is an action (a MulliganChoice, specifically). It has a cards attribute which contains the list of cards that can be picked. To perform the mulligan, you can call choose() with, as arguments, the cards that should be rejected:

player.choice.choose(card1, card2, ...)

This will first draw an amount of cards equal to the amount of chosen cards, and then shuffle the chosen cards into the deck (therefore, the chosen cards will never be re-drawn).

Calling choose() with no arguments will perform an empty mulligan (keep all cards).