Created
May 16, 2017 20:14
-
-
Save pilaf/612ac693c5bb62d0f586b449f36868b3 to your computer and use it in GitHub Desktop.
DSL brainstorming for Magic implementation in Ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AbandonHope < Magic::Card | |
# short for: | |
# name "Abandon Hope" | |
# cost "{X}{1}{B}" | |
head "Abandon Hope", "{X}{1}{B}" | |
# short for `type :sorcery` | |
sorcery | |
text "As an additional cost to cast :name, discard X cards", | |
"Look at target opponent's hand and choose X cards from it. That player discards those cards." | |
additional_cost do |spell| | |
spell.owner.discard spell.cost.x | |
end | |
effect do |spell| | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LizardWarrior < Magic::Card | |
head "Lizard Warrior", "{3}{R}" | |
# short for `type :creature, "Lizard Warrior"` | |
creature "Lizard Warrior" | |
strength_and_toughness 4, 2 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment