-
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 #375
- Loading branch information
Showing
3 changed files
with
44 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,16 @@ | ||
module Magic | ||
module Cards | ||
HeroicIntervention = Instant("Heroic Intervention") do | ||
cost generic: 1, green: 1 | ||
end | ||
|
||
class HeroicIntervention < Instant | ||
def resolve! | ||
owner.permanents.each do | ||
_1.grant_keyword(Keywords::HEXPROOF, until_eot: true) | ||
_1.grant_keyword(Keywords::INDESTRUCTIBLE, until_eot: true) | ||
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::HeroicIntervention do | ||
include_context "two player game" | ||
|
||
before do | ||
ResolvePermanent("Island", owner: p1) | ||
ResolvePermanent("Wood Elves", owner: p1) | ||
ResolvePermanent("Sol Ring", owner: p1) | ||
ResolvePermanent("Selfless Savior", owner: p2) | ||
end | ||
|
||
subject { Card("Heroic Intervention", owner: p1) } | ||
|
||
it "all permanents you control gain hexproof and indestructible" do | ||
cast_and_resolve(card: subject) | ||
|
||
island = p1.permanents.by_name("Island").first | ||
wood_elves = p1.permanents.by_name("Wood Elves").first | ||
sol_ring = p1.permanents.by_name("Sol Ring").first | ||
|
||
[island, wood_elves, sol_ring].each do |permanent| | ||
expect(permanent.hexproof?).to eq(true) | ||
expect(permanent.indestructible?).to eq(true) | ||
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