Skip to content

Commit

Permalink
Add Teferi's Protoge
Browse files Browse the repository at this point in the history
  • Loading branch information
radar committed Mar 10, 2024
1 parent 9e5ce54 commit 70914e5
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
22 changes: 22 additions & 0 deletions lib/magic/cards/teferis_protoge.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module Magic
module Cards
class TeferisProtoge < Creature
card_name "Teferi's Protoge"
creature_type "Human Wizard"
cost "{2}{U}"
power 2
toughness 3

class ActivatedAbility < Magic::ActivatedAbility
costs "{1}{U}, {T}"

def resolve!
trigger_effect(:draw_cards, player: controller)
add_choice(:discard)
end
end

def activated_abilities = [ActivatedAbility]
end
end
end
21 changes: 21 additions & 0 deletions spec/cards/teferis_protege_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
require "spec_helper"

RSpec.describe Magic::Cards::TeferisProtoge do
include_context "two player game"
subject { ResolvePermanent("Teferi's Protoge") }

context "activated ability" do
it "activates the ability" do
expect(p1).to receive(:draw!)
p1.add_mana(blue: 2)
p1.activate_ability(ability: subject.activated_abilities.first) do
_1.pay_mana(generic: { blue: 1 }, blue: 1)
end

game.tick!

choice = game.choices.last
expect(choice).to be_a(Magic::Choice::Discard)
end
end
end

0 comments on commit 70914e5

Please sign in to comment.