-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
module Magic | ||
module Cards | ||
EternalWitness = Creature("Eternal Witness") do | ||
cost green: 1, generic: 2 | ||
power 2 | ||
toughness 1 | ||
creature_type "Human Shaman" | ||
|
||
enters_the_battlefield do | ||
game.add_choice(EternalWitness::Choice.new(actor: actor)) | ||
end | ||
end | ||
|
||
class EternalWitness < Creature | ||
class Choice < Magic::Choice::May | ||
def choices | ||
controller.graveyard | ||
end | ||
|
||
def resolve!(target:) | ||
target.move_to_hand! | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
require "spec_helper" | ||
|
||
RSpec.describe Magic::Cards::EternalWitness do | ||
include_context "two player game" | ||
|
||
context "when it enters" do | ||
subject { Card("Eternal Witness") } | ||
|
||
before do | ||
p1.graveyard.add(Card("Wood Elves")) | ||
end | ||
|
||
it "can choose to return wood elves" do | ||
p1.add_mana(green: 3) | ||
p1.cast(card: subject) do | ||
_1.auto_pay_mana | ||
end | ||
|
||
game.stack.resolve! | ||
|
||
game.resolve_choice!(target: p1.graveyard.first) | ||
|
||
expect(p1.hand.by_name("Wood Elves")).to be_one | ||
expect(p1.graveyard.by_name("Wood Elves")).to be_none | ||
end | ||
end | ||
end |