-
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.
Fixes #252
- Loading branch information
Showing
3 changed files
with
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module Magic | ||
module Cards | ||
TormodsCrypt = Artifact("Tormod's Crypt") do | ||
cost generic: 0 | ||
end | ||
|
||
class TormodsCrypt < Artifact | ||
class ActivatedAbility < Magic::ActivatedAbility | ||
def costs | ||
[ | ||
Costs::Tap.new(source), | ||
Costs::Sacrifice.new(source: source), | ||
] | ||
end | ||
|
||
def target_choices | ||
game.players | ||
end | ||
|
||
def resolve!(target:) | ||
target.graveyard.each do |card| | ||
trigger_effect(:exile, target: card) | ||
end | ||
end | ||
end | ||
|
||
def activated_abilities = [ActivatedAbility] | ||
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
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,24 @@ | ||
require 'spec_helper' | ||
|
||
RSpec.describe Magic::Cards::TormodsCrypt do | ||
include_context "two player game" | ||
subject(:permanent) { ResolvePermanent("Tormod's Crypt") } | ||
|
||
let(:wood_elves) { Card("Wood Elves", owner: p2) } | ||
|
||
before do | ||
wood_elves.move_to_graveyard! | ||
end | ||
|
||
it "taps and sacrifices to exile a player's graveyard" do | ||
p1.activate_ability(ability: permanent.activated_abilities.first) do | ||
_1.pay_sacrifice(permanent) | ||
_1.targeting(p2) | ||
end | ||
|
||
game.tick! | ||
|
||
expect(p2.graveyard).to be_empty | ||
expect(wood_elves.zone).to be_exile | ||
end | ||
end |