-
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
18 changed files
with
116 additions
and
25 deletions.
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
7 changes: 4 additions & 3 deletions
7
...gic/abilities/static/type_modification.rb → lib/magic/abilities/static/type_removal.rb
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
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
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,48 @@ | ||
module Magic | ||
module Cards | ||
HeliodGodOfTheSun = Creature("Heliod, God of the Sun") do | ||
type T::Super::Legendary, T::Enchantment, T::Creature, "God" | ||
cost "{3}{W}" | ||
keywords :indestructible | ||
power 5 | ||
toughness 6 | ||
|
||
class TypeModification < Abilities::Static::TypeRemoval | ||
def initialize(source:) | ||
@source = source | ||
end | ||
|
||
def type_removal | ||
[ | ||
T::Creature | ||
] | ||
end | ||
|
||
def applicable_targets | ||
if controller.devotion(:white) >= 5 | ||
[] | ||
else | ||
[source] | ||
end | ||
end | ||
end | ||
|
||
class VigilanceGrant < Abilities::Static::KeywordGrant | ||
def keyword_grants | ||
[Keywords::VIGILANCE] | ||
end | ||
|
||
def applicable_targets | ||
controller.creatures - [source] | ||
end | ||
end | ||
|
||
def static_abilities | ||
[ | ||
TypeModification, | ||
VigilanceGrant, | ||
] | ||
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
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
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
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
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 |
---|---|---|
|
@@ -56,7 +56,7 @@ def permanent? | |
end | ||
|
||
def legendary? | ||
type?(T::Legendary) | ||
type?(T::Super::Legendary) | ||
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,40 @@ | ||
require "spec_helper" | ||
|
||
RSpec.describe Magic::Cards::HeliodGodOfTheSun do | ||
include_context "two player game" | ||
|
||
let!(:heliod) { ResolvePermanent("Heliod, God of The Sun") } | ||
|
||
it "is indestructible" do | ||
expect(heliod).to be_indestructible | ||
end | ||
|
||
context "devotion" do | ||
it "is not a creature" do | ||
expect(heliod).not_to be_creature | ||
end | ||
|
||
context "with 2x nine lives (4 pips) and itself" do | ||
before do | ||
2.times do | ||
ResolvePermanent("Nine Lives") | ||
end | ||
|
||
game.tick! | ||
end | ||
|
||
it "is a creature" do | ||
expect(heliod).to be_creature | ||
end | ||
end | ||
end | ||
|
||
context "vigilance static ability" do | ||
let(:wood_elves) { ResolvePermanent("Wood Elves") } | ||
|
||
it "grants vigilance to all creatures" do | ||
expect(wood_elves).to be_vigilant | ||
expect(heliod).not_to be_vigilant | ||
end | ||
end | ||
end |