Skip to content

Commit

Permalink
Correct types for all cards to match new syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
radar committed Nov 9, 2024
1 parent 2844ca6 commit ee98eb0
Show file tree
Hide file tree
Showing 34 changed files with 62 additions and 47 deletions.
6 changes: 3 additions & 3 deletions lib/magic/cards/basri_ket.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module Magic
module Cards
class BasriKet < Planeswalker
NAME = "Basri Ket"
TYPE_LINE = "#{T::Legendary} #{T::Planeswalker} -- Basri"
BASE_LOYALTY = 3
card_name "Basri Ket"
type T::Legendary, T::Planeswalker, "Basri"
loyalty 3

class Emblem < Magic::Emblem
def receive_event(event)
Expand Down
2 changes: 1 addition & 1 deletion lib/magic/cards/chrome_replicator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ChromeReplicator < Creature
toughness 4

Construct = Token.create "Construct" do
type "Artifact Creature —- Construct"
type T::Artifact, T::Creature, T::Creatures['Construct']
power 4
toughness 4
end
Expand Down
2 changes: 1 addition & 1 deletion lib/magic/cards/containment_priest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Cards
class ContainmentPriest < Creature
card_name "Containment Priest"
cost generic: 1, white: 1
creature_type("Human Cleric")
creature_type "Human Cleric"
keywords :flash
power 2
toughness 2
Expand Down
2 changes: 1 addition & 1 deletion lib/magic/cards/dire_fleet_warmonger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Magic
module Cards
class DireFleetWarmonger < Creature
card_name "Dire Fleet Warmonger"
type "Creature -- Orc Pirate"
creature_type "Orc Pirate"
cost generic: 1, black: 1, red: 1
power 3
toughness 3
Expand Down
2 changes: 1 addition & 1 deletion lib/magic/cards/doomwake_giant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Cards
class DoomwakeGiant < Creature
card_name "Doomwake Giant"
cost generic: 4, black: 1
type "Enchantment Creature -- Giant"
type T::Enchantment, T::Creature, T::Creatures["Giant"]
power 4
toughness 6

Expand Down
2 changes: 1 addition & 1 deletion lib/magic/cards/dryad_of_the_ilysian_grove.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Magic
module Cards
DryadOfTheIlysianGrove = Creature("Dryad of the Ilysian Grove") do
type "#{T::Enchantment} #{T::Creature} -- #{creature_types("Nymph Dryad")}"
type T::Enchantment, T::Creature, *creature_types("Nymph Dryad")

power 2
toughness 4
Expand Down
2 changes: 1 addition & 1 deletion lib/magic/cards/falconer_adept.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Cards

class FalconerAdept < Creature
BirdToken = Token.create("Bird") do
type "Creature — Bird"
creature_type "Bird"
power 1
toughness 1
colors :white
Expand Down
2 changes: 1 addition & 1 deletion lib/magic/cards/foundry_inspector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Magic
module Cards
FoundryInspector = Creature("Foundry Inspector") do
cost generic: 3
type "Artifact Creature -- Constructor"
type T::Artifact, T::Creature, T::Creatures["Construct"]
power 3
toughness 2

Expand Down
4 changes: 2 additions & 2 deletions lib/magic/cards/geist_honored_monk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ module Magic
module Cards
GeistHonoredMonk = Creature("Geist Honored Monk") do
cost generic: 3, white: 2
creature_type("Human Monk")
creature_type "Human Monk"
keywords :vigilance
end

class GeistHonoredMonk < Creature
SpiritToken = Token.create "Spirit" do
type "Creature —- Spirit"
creature_type "Spirit"
power 1
toughness 1
colors :white
Expand Down
2 changes: 1 addition & 1 deletion lib/magic/cards/goblin_wizardry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Cards

class GoblinWizardry < Instant
GoblinWizardToken = Token.create "Goblin Wizard" do
type "Creature —- Goblin Wizard"
creature_type "Goblin Wizard"
power 1
toughness 1
colors :red
Expand Down
2 changes: 1 addition & 1 deletion lib/magic/cards/golgari_guildgate.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Magic
module Cards
GolgariGuildgate = Card("Golgari Guildgate") do
type "Land -- Gate"
type T::Land, T::Lands::Gate
end

class GolgariGuildgate < Card
Expand Down
4 changes: 2 additions & 2 deletions lib/magic/cards/great_furnace.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module Magic
module Cards
class GreatFurnace < Land
NAME = "Great Furnace"
TYPE_LINE = "Artifact Land"
card_name "Great Furnace"
type T::Artifact, T::Land

class ManaAbility < Magic::ManaAbility
costs "{T}"
Expand Down
2 changes: 1 addition & 1 deletion lib/magic/cards/griffin_aerie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Cards

class GriffinAerie < Enchantment
GriffinToken = Token.create("Griffin") do
type "Creature -- Griffin"
creature_type "Griffin"
power 2
toughness 2
colors :white
Expand Down
4 changes: 2 additions & 2 deletions lib/magic/cards/lathril_blade_of_the_elves.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Magic
module Cards
LathrilBladeOfTheElves = Creature("Lathril, Blade of the Elves") do
creature_type "Elf Noble"
type T::Super::Legendary, T::Creature, *creature_types("Elf Noble")
cost generic: 2, black: 1, green: 1
power 2
toughness 3
Expand All @@ -10,7 +10,7 @@ module Cards

class LathrilBladeOfTheElves < Creature
ElfWarriorToken = Token.create "Elf Warrior" do
type "Creature —- Elf Warror"
creature_type "Elf Warrior"
power 1
toughness 1
colors :green
Expand Down
2 changes: 1 addition & 1 deletion lib/magic/cards/mangara_the_diplomat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Magic
module Cards
MangaraTheDiplomat = Creature("Mangara, the Diplomat") do
cost generic: 3, white: 1
type "Legendary Creature - Human Cleric"
type T::Legendary, T::Creature, *creature_types("Human Cleric")
power 2
toughness 4
keywords :lifelink
Expand Down
2 changes: 1 addition & 1 deletion lib/magic/cards/massacre_girl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Magic
module Cards
class MassacreGirl < Creature
card_name "Massacre Girl"
type "Legendary Creature -- Human Assassin"
legendary_creature_type "Human Assassin"
cost generic: 3, black: 2
power 4
toughness 4
Expand Down
2 changes: 1 addition & 1 deletion lib/magic/cards/odric_lunarch_marshal.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Magic
module Cards
OdricLunarchMarshal = Creature("Odric, Lunarch Marshal") do
type "Legendary Creature -- Human Soldier"
type T::Legendary, T::Creature, *creature_types("Human Soldier")
cost generic: 3, white: 1
power 3
toughness 3
Expand Down
2 changes: 1 addition & 1 deletion lib/magic/cards/pridemalkin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Cards
class Pridemalkin < Creature
card_name "Pridemalkin"
cost "{2}{G}"
type "Creature -- Cat"
creature_type "Cat"
power 2
toughness 1

Expand Down
6 changes: 3 additions & 3 deletions lib/magic/cards/rin_and_seri_inseperable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ module Magic
module Cards
RinAndSeriInseperable = Creature("Rin and Seri, Inseparable") do
cost "{1}{R}{G}{W}"
type "Legendary Creature — Dog Cat"
legendary_creature_type "Dog Cat"
power 4
toughness 4
end

class RinAndSeriInseperable < Creature
CatToken = Token.create "Cat" do
type "Creature —- Cat"
creature_type "Cat"
power 1
toughness 1
colors :green
end

DogToken = Token.create "Dog" do
type "Creature —- Dog"
creature_type "Dog"
power 1
toughness 1
colors :white
Expand Down
2 changes: 1 addition & 1 deletion lib/magic/cards/roaming_ghostlight.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Magic
module Cards
RoamingGhostlight = Creature("Roaming Ghostlight") do
cost generic: 3, blue: 2
type "Creature -- Spirit"
creature_type "Spirit"
power 3
toughness 2
keywords :flying
Expand Down
2 changes: 1 addition & 1 deletion lib/magic/cards/sanctum_of_calm_waters.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Magic
module Cards
SanctumOfCalmWaters = Enchantment("Sanctum of Calm Waters") do
type "Legendary Enchantment -- Shrine"
type T::Legendary, T::Enchantment, "Shrine"
cost generic: 3, blue: 1

def event_handlers
Expand Down
2 changes: 1 addition & 1 deletion lib/magic/cards/sanctum_of_tranquil_light.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Magic
module Cards
SanctumOfTranquilLight = Enchantment("Sanctum of Tranquil Light") do
type "Legendary Enchantment -- Shrine"
type T::Legendary, T::Enchantment, "Shrine"
cost white: 1
end

Expand Down
2 changes: 1 addition & 1 deletion lib/magic/cards/scute_swarm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Cards

class ScuteSwarm < Creature
InsectToken = Token.create("Insect") do
type "Creature -- Insect"
creature_type "Insect"
power 1
toughness 1
end
Expand Down
12 changes: 10 additions & 2 deletions lib/magic/cards/shared/types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,25 @@ def types
end

def creature_types(types)
types.split(/(?<!Time) (?!Lord)/).map { T::Creatures[_1] }.join(" ")
types.split(/(?<!Time) (?!Lord)/).map { T::Creatures[_1] }
end

def creature_type(types)
set_types(T::Creature, *creature_types(types))
type(T::Creature, *creature_types(types))
end

def artifact_creature_type(types)
set_types(T::Artifact, T::Creature, *creature_types(types))
end

def legendary_creature_type(types)
set_types(T::Legendary, T::Creature, *creature_types(types))
end

def planeswalker(name)
set_types(T::Legendary, T::Planeswalker, name)
end

def type(*types)
set_types(*types)
end
Expand Down
4 changes: 2 additions & 2 deletions lib/magic/cards/speaker_of_the_heavens.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ module Cards
power 1
toughness 1
cost white: 1
creature_type("Human Cleric")
creature_type "Human Cleric"
keywords :vigilance, :lifelink

AngelToken = Token.create("Angel") do
type "Creature -- Angel"
creature_type "Angel"
power 4
toughness 4
keywords :flying
Expand Down
4 changes: 2 additions & 2 deletions lib/magic/cards/ugin_the_spirit_dragon.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module Magic
module Cards
class UginTheSpiritDragon < Planeswalker
NAME = "Ugin, the Spirit Dragon"
TYPE_LINE = "Legendary Planeswalker -- Ugin"
card_name "Ugin, the Spirit Dragon"
planeswalker "Ugin"
BASE_LOYALTY = 7

class LoyaltyAbility1 < Magic::LoyaltyAbility
Expand Down
2 changes: 1 addition & 1 deletion lib/magic/cards/wood_elves.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Cards
WoodElves = Creature("Wood Elves") do
power 1
toughness 1
creature_type("Elf Scout")
creature_type "Elf Scout"
cost generic: 2, green: 1
end
end
Expand Down
1 change: 1 addition & 0 deletions lib/magic/types/lands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
module Magic
module Types
module Lands
Gate = "Gate".freeze
class BasicLand
def self.==(other)
self.name.split("::").last == other
Expand Down
10 changes: 5 additions & 5 deletions spec/cards/colossal_dreadmaw_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

subject! { ResolvePermanent("Colossal Dreadmaw", owner: p1) }

context 'base card atrributes' do
context 'base card atrributes' do
it "is a dinosaur" do
expect(subject.card.type_line).to eq("Creature -- Dinosaur")
expect(subject.card.types).to include("Dinosaur")
end

it "Has trample" do
expect(subject.trample?).to eq(true)
end
Expand All @@ -18,6 +18,6 @@
expect(subject.power).to eq(6)
expect(subject.toughness).to eq(6)
end
end
end

end
4 changes: 3 additions & 1 deletion spec/cards/containment_priest_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@

context "card attributes" do
it "is a human cleric" do
expect(subject.card.type_line).to eq("Creature -- Human Cleric")
expect(subject.card.types).to include("Creature")
expect(subject.card.types).to include("Human")
expect(subject.card.types).to include("Cleric")
end

it "has flash" do
Expand Down
1 change: 0 additions & 1 deletion spec/cards/golgari_guildgate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
end

it "enters the battlefield tapped" do
game.stack.resolve!
expect(permanent).to be_tapped
end

Expand Down
3 changes: 2 additions & 1 deletion spec/cards/mistral_singer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

context 'base card atrributes' do
it "is a siren" do
expect(subject.card.type_line).to eq("Creature -- Siren")
expect(subject.card.types).to include("Siren")
expect(subject.card.types).to include("Creature")
end

it "Has flying" do
Expand Down
4 changes: 3 additions & 1 deletion spec/cards/onakke_ogre_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
let!(:onakke_ogre) { ResolvePermanent("Onakke Ogre", owner: p1) }

it "is an ogre warrior" do
expect(onakke_ogre.card.type_line).to eq("Creature -- Ogre Warrior")
expect(onakke_ogre.card.types).to include("Ogre")
expect(onakke_ogre.card.types).to include("Warrior")
expect(onakke_ogre.card.types).to include("Creature")
end

end
4 changes: 3 additions & 1 deletion spec/cards/story_seeker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
let!(:story_seeker) { ResolvePermanent("Story Seeker", owner: p2) }

it "is a dwarf cleric" do
expect(story_seeker.card.type_line).to eq("Creature -- Dwarf Cleric")
expect(story_seeker.card.types).to include("Dwarf")
expect(story_seeker.card.types).to include("Cleric")
expect(story_seeker.card.types).to include("Creature")
end

it "has lifelink" do
Expand Down

0 comments on commit ee98eb0

Please sign in to comment.