Lightweight library for parsing Hearthstone cards using Pyleri.
This library aims to provide a tool that can "read" Hearthstone cards and generate playable versions of them from their text.
In it's current state, the grammar parser still has a limited vocabulary. It can parse minions's abilities and basic spell actions and targeting a into a form usable in fireplace, a Python implementation of Hearthstone.
Clone this repository:
git clone https://github.com/kajchang/Dalaran.git
Cloning into 'Dalaran'...
cd Dalaran
Install fireplace:
pip3 install -e git+https://github.com/kajchang/fireplace.git#egg=fireplace
Install Dalaran and other requirements:
pip3 install .
There's a reasonable amount of test coverage, but more is coming in the future.
Run the tests:
python3 -m unittest discover
And that's how you can make and play with your custom hearthstone cards!
Building A Simple Interpreter In Python for basic knowledge of lexing and code examples.
Fireplace Documentation, Utilities, and Card Making API for examples of how to make integrate custom cards into their simulation and play and test games in their simulation.
Demystify, up-to-date-ish project for the same thing in Magic: the Gathering, which uses a blend of Python and ANTLR, but with a similar approach. However, I don't think there's a real simulation / play aspect, and that it's more of just lexing / parsing.
Feel free to help out and contribute!