hlynurd / open-mtg

A python implementation of Magic: The Gathering with an AI that plays it using Monte Carlo move evaluation.
MIT License
140 stars 32 forks source link

Abstract spell effects #1

Open hlynurd opened 6 years ago

hlynurd commented 6 years ago

Currently, the few implemented spells are enumerated in "make_move" and "get_legal_moves". Returning legal moves associated with the spell and handling the spell effect should be handled by the card objects rather than long rows of 'player.casting_spell == "Vengeance": [...]'. Consider passing lambda functions as card creation parameters, cf. [lambda self: self.owner.add_mana({"Green": 1})] in current Land card instantiation.