Skip to content

Commit

Permalink
Add Satyr Enchanter
Browse files Browse the repository at this point in the history
  • Loading branch information
radar committed Oct 20, 2024
1 parent 4e82e82 commit 9b83ec1
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
26 changes: 26 additions & 0 deletions lib/magic/cards/satyr_enchanter.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module Magic
module Cards
SatyrEnchanter = Creature("Satyr Enchanter") do
cost generic: 1, green: 1, white: 1
power 2
toughness 2
creature_type "Satyr Druid"

class SpellCastTrigger < TriggeredAbility
def should_perform?
you? && event.type?("Enchantment")
end

def call
actor.trigger_effect(:draw_cards, source: actor)
end
end

def event_handlers
{
Events::SpellCast => SpellCastTrigger
}
end
end
end
end
21 changes: 21 additions & 0 deletions spec/cards/satyr_enchanter_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
require 'spec_helper'

RSpec.describe Magic::Cards::SatyrEnchanter do
include_context "two player game"

subject! { ResolvePermanent("Satyr Enchanter", owner: p1) }

context "when enchantment is cast" do
let(:doubling_season) { Card("Doubling Season") }

it "draws a card" do
p1.add_mana(green: 5)
expect(p1).to receive(:draw!)
p1.cast(card: doubling_season) do
_1.pay_mana(green: 1, generic: { green: 4 })
end

game.tick!
end
end
end

0 comments on commit 9b83ec1

Please sign in to comment.