Skip to content

3: Card introspection

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

The declarative action system in the Fireplace DSL allows for easy introspection of a card's actions. It is therefore possible to programmatically know what effects a card will have and when, without ever playing it.

Examples

Here we take a look at the Deathrattle script of the Leper Gnome card (EX1_029).

>>> from fireplace.card import Card
>>> leper_gnome = Card("EX1_029")
>>> deathrattle = leper_gnome.data.scripts.deathrattle
>>> deathrattle
<TargetedAction: Hit(AMOUNT=2)>
>>> deathrattle._args[deathrattle.__class__.Args.TARGETS]
<Selector: PLAY HOSTILE and HERO and>
>>> deathrattle._args[deathrattle.__class__.Args.AMOUNT]
2

Next article: Creating and playing a Game