1) Added a support for MANACOST CHANGING cards. (by Zethfox)

Two example codes:

[card]
name=Alabaster Leech
auto=lord(*[white]|myhand) white:+1
autoexile=all(*|myhand) resetcost
autograveyard=all(*|myhand) resetcost
autohand=all(*|myhand) resetcost
autolibrary=all(*|myhand) resetcost
text=White spells you cast cost {W} more to cast.
mana={W}
type=Creature
subtype=Leech
power=1
toughness=3
[/card]

[card]
name=Helm of Awakening
auto=lord(*|myhand) colorless:-1
auto=lord(*|opponenthand) colorless:-1
autoexile=all(*|myhand) resetcost
autograveyard=all(*|myhand) resetcost
autohand=all(*|myhand) resetcost
autolibrary=all(*|myhand) resetcost
text=Spells cost {1} less to cast.
mana={2}
type=Artifact
[/card]

autoexile=all(*|myhand) resetcost
autograveyard=all(*|myhand) resetcost
autohand=all(*|myhand) resetcost
autolibrary=all(*|myhand) resetcost

----> This code section is necessary, because manacost altering cards will keep their effect even when they have left the battlefield. RESETCOST erases all alterations which have no existing source on the battlefield anymore.


2) Added the new keyword TRANSFORM, which is similar to BECOMES. The main difference is that you can change single parameters of a permanent (color,type,...).

Example codes:

[card]
name=Memnarch
auto={1}{U}{U}:target(*) transforms(artifact)
auto={3}{U}:moveTo(myBattlefield) target(arifact)
text={1}{U}{U}: Target permanent becomes an artifact in addition to its other types. (This effect lasts indefinitely.) -- {3}{U}: Gain control of target artifact. (This effect lasts indefinitely.)
mana={7}
type=Legendary Artifact Creature
subtype=Wizard
power=4
toughness=5
[/card]

[card]
name=Dralnu's Crusade
auto=lord(goblin) 1/1
auto=lord(goblin) transforms(zombie,black)
text=Goblin creatures get +1/+1. -- All Goblins are black and are Zombies in addition to their other creature types.
mana={1}{B}{R}
type=Enchantment
[/card]

Important notes concerning TRANSFORM:
- IF YOU TARGET A CREATURE THE EFFECT IS PERMINENT.
- IF YOU TARGET THE SOURCE THE EFFECT IS UNTIL END OF TURN. 
- IF YOU USE LORD THE EFFECT LAST TIL PERMINENT SOURCE LEAVES PLAY.

These restrictions will probably be changed in the near future!


3) Added 57 successfully tested cards.
Card list ---> first comment


4) Changed the name of several tokens: "()" used to cuase crashes when used in the name-line.


5) Added the new keyword NONBATTLEZONE for leaves play trigger optimizing. It can be used to replace the phrase "EXILE,GRAVEYARD,HAND,LIBRARY".

I will add tests for test suite in one of the next revisions!!



####### TEST SUITE PROVEN ########
This commit is contained in:
solo81@web.de
2010-08-17 00:23:48 +00:00
parent 667df139ed
commit 5d42bfa88f
15 changed files with 1025 additions and 469 deletions

View File

@@ -149,7 +149,7 @@ id=189648
rarity=M
[/card]
[card]
primitive=Dragon (Dragon Broodmother)
primitive=Dragon Token from Dragon Broodmother
id=22222220
rarity=T
[/card]

View File

@@ -769,7 +769,7 @@ id=121230
rarity=R
[/card]
[card]
primitive=Wolf (Sound the Call)
primitive=Wolf Token from Sound the Call
id=-121156
rarity=T
[/card]

View File

@@ -289,7 +289,7 @@ id=107542
rarity=C
[/card]
[card]
primitive=Goblin (Rakdos Guildmage)
primitive=Goblin Token from Rakdos Guildmage
id=-97108
rarity=T
[/card]
@@ -769,7 +769,7 @@ id=111220
rarity=R
[/card]
[card]
primitive=Sprouting Phytohydra (Sprouting Phytohydra)
primitive=Sprouting Phytohydra Token from Sprouting Phytohydra
id=-111220
rarity=C
[/card]

View File

@@ -274,7 +274,7 @@ id=136157
rarity=R
[/card]
[card]
primitive=Goldmeadow Harrier (Goldmeadow Lookout)
primitive=Goldmeadow Harrier Token from Goldmeadow Lookout
id=-130311
rarity=T
[/card]
@@ -404,7 +404,7 @@ id=132213
rarity=C
[/card]
[card]
primitive=Llanowar Elves (Llanowar Mentor)
primitive=Llanowar Elves Token from Llanowar Mentor
id=-126166
rarity=T
[/card]
@@ -749,7 +749,7 @@ id=126213
rarity=U
[/card]
[card]
primitive=Spark Elemental (Sparkspitter)
primitive=Spark Elemental Token from Sparkspitter
id=-130341
rarity=T
[/card]

View File

@@ -824,12 +824,12 @@ id=205075
rarity=R
[/card]
[card]
primitive=Ooze (Mitotic Ooze)
primitive=Ooze Token from Mitotic Ooze
id=
rarity=T
[/card]
[card]
primitive=Ooze (Ooze)
primitive=Ooze Token from Ooze Token
id=
rarity=T
[/card]

View File

@@ -174,7 +174,7 @@ id=74373
rarity=U
[/card]
[card]
primitive=Elemental (Feral Lightning)
primitive=Elemental Token from Feral Lightning
id=-84373
rarity=T
[/card]

View File

@@ -794,7 +794,7 @@ id=9847
rarity=R
[/card]
[card]
primitive=Knight (Waylay)
primitive=Knight Token from Waylay
id=-5833
rarity=T
[/card]

View File

@@ -219,7 +219,7 @@ id=191373
rarity=R
[/card]
[card]
primitive=Elemental (Zendikar Shrine)
primitive=Elemental Token from Zendikar Shrine
id=-183403
rarity=T
[/card]

View File

@@ -516,15 +516,6 @@ mana={5}
type=Artifact
[/card]
[card]
name=Alabaster Leech
text=White spells you cast cost {W} more to cast.
mana={W}
type=Creature
subtype=Leech
power=1
toughness=3
[/card]
[card]
name=Alabaster Potion
text=Choose one - Target player gains X life; or prevent the next X damage that would be dealt to target creature or player this turn.
mana={X}{W}{W}
@@ -567,12 +558,6 @@ power=1
toughness=1
[/card]
[card]
name=Alchor's Tomb
text={2}, {T}: Target permanent you control becomes the color of your choice. (This effect lasts indefinitely.)
mana={4}
type=Artifact
[/card]
[card]
name=Aleatory
text=Cast Aleatory only during combat after blockers are declared. -- Flip a coin. If you win the flip, target creature gets +1/+1 until end of turn. -- Draw a card at the beginning of the next turn's upkeep.
mana={1}{R}
@@ -824,15 +809,6 @@ text={T}: Add one mana of any color to your mana pool. Spend this mana only to c
type=Land
[/card]
[card]
name=Andradite Leech
text=Black spells you cast cost {B} more to cast. -- {B}: Andradite Leech gets +1/+1 until end of turn.
mana={2}{B}
type=Creature
subtype=Leech
power=2
toughness=2
[/card]
[card]
name=Angel of Salvation
text=Flash; convoke (Each creature you tap while casting this spell reduces its cost by {1} or by one mana of that creature's color.) -- Flying -- When Angel of Salvation enters the battlefield, prevent the next 5 damage that would be dealt this turn to any number of target creatures and/or players, divided as you choose.
mana={6}{W}{W}
@@ -1648,12 +1624,6 @@ mana={1}{U}
type=Instant
[/card]
[card]
name=Aura of Silence
text=Artifact and enchantment spells your opponents cast cost {2} more to cast. -- Sacrifice Aura of Silence: Destroy target artifact or enchantment.
mana={1}{W}{W}
type=Enchantment
[/card]
[card]
name=Auramancer's Guise
text=Enchant creature -- Enchanted creature gets +2/+2 for each Aura attached to it and has vigilance.
mana={2}{U}{U}
@@ -2147,15 +2117,6 @@ power=3
toughness=2
[/card]
[card]
name=Ballyrush Banneret
text=Kithkin spells and Soldier spells you cast cost {1} less to cast.
mana={1}{W}
type=Creature
subtype=Kithkin Soldier
power=2
toughness=1
[/card]
[card]
name=Balm of Restoration
text={1}, {T}, Sacrifice Balm of Restoration: Choose one - You gain 2 life; or prevent the next 2 damage that would be dealt to target creature or player this turn.
mana={2}
@@ -3468,15 +3429,6 @@ power=6
toughness=7
[/card]
[card]
name=Bosk Banneret
text=Treefolk spells and Shaman spells you cast cost {1} less to cast.
mana={1}{G}
type=Creature
subtype=Treefolk Shaman
power=1
toughness=3
[/card]
[card]
name=Bottle of Suleiman
text={1}, Sacrifice Bottle of Suleiman: Flip a coin. If you lose the flip, Bottle of Suleiman deals 5 damage to you. If you win the flip, put a 5/5 colorless Djinn artifact creature token with flying onto the battlefield.
mana={4}
@@ -3734,15 +3686,6 @@ mana={X}{R}{R}{W}{W}
type=Sorcery
[/card]
[card]
name=Brighthearth Banneret
text=Elemental spells and Warrior spells you cast cost {1} less to cast. -- Reinforce 1 - {1}{R} ({1}{R}, Discard this card: Put a +1/+1 counter on target creature.)
mana={1}{R}
type=Creature
subtype=Elemental Warrior
power=1
toughness=1
[/card]
[card]
name=Brilliant Ultimatum
text=Exile the top five cards of your library. An opponent separates those cards into two piles. You may play any number of cards from one of those piles without paying their mana costs.
mana={W}{W}{U}{U}{U}{B}{B}
@@ -5222,12 +5165,6 @@ power=1
toughness=1
[/card]
[card]
name=Chill
text=Red spells cost {2} more to cast.
mana={1}{U}
type=Enchantment
[/card]
[card]
name=Chill Haunting
text=As an additional cost to cast Chill Haunting, exile X creature cards from your graveyard. -- Target creature gets -X/-X until end of turn.
mana={1}{B}
@@ -5668,12 +5605,6 @@ mana={2}{W}{U}
type=Enchantment
[/card]
[card]
name=Cloud Key
text=As Cloud Key enters the battlefield, choose artifact, creature, enchantment, instant, or sorcery. -- Spells you cast of the chosen type cost {1} less to cast.
mana={3}
type=Artifact
[/card]
[card]
name=Cloud of Faeries
text=Flying -- When Cloud of Faeries enters the battlefield, untap up to two lands. -- Cycling {2} ({2}, Discard this card: Draw a card.)
mana={1}{U}
@@ -7344,15 +7275,6 @@ power=1
toughness=1
[/card]
[card]
name=Daru Warchief
text=Soldier spells you cast cost {1} less to cast. -- Soldier creatures you control get +1/+2.
mana={2}{W}{W}
type=Creature
subtype=Human Soldier
power=1
toughness=1
[/card]
[card]
name=Dash Hopes
text=When you cast Dash Hopes, any player may pay 5 life. If a player does, counter Dash Hopes. -- Counter target spell.
mana={B}{B}
@@ -8048,15 +7970,6 @@ mana={7}{U}{U}
type=Sorcery
[/card]
[card]
name=Derelor
text=Black spells you cast cost {B} more to cast.
mana={3}{B}
type=Creature
subtype=Thrull
power=4
toughness=4
[/card]
[card]
name=Dermoplasm
text=Flying -- Morph {2}{U}{U} (You may cast this face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.) -- When Dermoplasm is turned face up, you may put a creature card with morph from your hand onto the battlefield face up. If you do, return Dermoplasm to its owner's hand.
mana={2}{U}
@@ -8847,18 +8760,7 @@ power=1
toughness=1
[/card]
[card]
name=Dragonspeaker Shaman
text=Dragon spells you cast cost {2} less to cast.
mana={1}{R}{R}
type=Creature
subtype=Human Barbarian Shaman
power=2
toughness=2
[/card]
[card]
name=Dragonstorm
target=dragon|myLibrabry
auto=moveto(myBattlefield)
text=Search your library for a Dragon permanent card and put it onto the battlefield. Then shuffle your library. -- Storm (When you cast this spell, copy it for each spell cast before it this turn.)
mana={8}{R}
type=Sorcery
@@ -8879,12 +8781,6 @@ power=1
toughness=1
[/card]
[card]
name=Dralnu's Crusade
text=Goblin creatures get +1/+1. -- All Goblins are black and are Zombies in addition to their other creature types.
mana={1}{B}{R}
type=Enchantment
[/card]
[card]
name=Dralnu's Pet
text=Kicker - {2}{B}, Discard a creature card. (You may pay {2}{B} and discard a creature card in addition to any other costs as you cast this spell.) -- If Dralnu's Pet was kicked, it enters the battlefield with flying and with X +1/+1 counters on it, where X is the discarded card's converted mana cost.
mana={1}{U}{U}
@@ -9598,15 +9494,6 @@ type=Enchantment
subtype=Aura
[/card]
[card]
name=Edgewalker
text=Cleric spells you cast cost {W}{B} less to cast. This effect reduces only the amount of colored mana you pay. (For example, if you cast a Cleric spell with mana cost {1}{W}, it costs {1} to cast.)
mana={1}{W}{B}
type=Creature
subtype=Human Cleric
power=2
toughness=2
[/card]
[card]
name=Ego Erasure
text=Changeling (This card is every creature type at all times.) -- Creatures target player controls get -2/-0 and lose all creature types until end of turn.
mana={2}{U}
@@ -9916,12 +9803,6 @@ mana={2}{W}
type=Instant
[/card]
[card]
name=Emerald Medallion
text=Green spells you cast cost {1} less to cast.
mana={2}
type=Artifact
[/card]
[card]
name=Emeria, the Sky Ruin
text=Emeria, the Sky Ruin enters the battlefield tapped. -- At the beginning of your upkeep, if you control seven or more Plains, you may return target creature card from your graveyard to the battlefield. -- {T}: Add {W} to your mana pool.
type=Land
@@ -9957,12 +9838,6 @@ power=2
toughness=2
[/card]
[card]
name=Enchanted Evening
text=All permanents are enchantments in addition to their other types.
mana={3}{WU}{WU}
type=Enchantment
[/card]
[card]
name=Enchantment Alteration
text=Attach target Aura attached to a creature or land to another permanent of that type.
mana={U}
@@ -10517,15 +10392,6 @@ type=Instant
subtype=Arcane
[/card]
[card]
name=Etherium Sculptor
text=Artifact spells you cast cost {1} less to cast.
mana={1}{U}
type=Artifact Creature
subtype=Vedalken Artificer
power=1
toughness=2
[/card]
[card]
name=Ethersworn Canonist
text=Each player who has cast a nonartifact spell this turn can't cast additional nonartifact spells.
mana={1}{W}
@@ -11352,12 +11218,6 @@ type=Enchantment
subtype=Aura
[/card]
[card]
name=Feroz's Ban
text=Creature spells cost {2} more to cast.
mana={6}
type=Artifact
[/card]
[card]
name=Ferropede
text=Ferropede is unblockable. -- Whenever Ferropede deals combat damage to a player, you may remove a counter from target permanent.
mana={3}
@@ -12543,15 +12403,6 @@ power=2
toughness=2
[/card]
[card]
name=Frogtosser Banneret
text=Haste -- Goblin spells and Rogue spells you cast cost {1} less to cast.
mana={1}{B}
type=Creature
subtype=Goblin Rogue
power=1
toughness=1
[/card]
[card]
name=Frontline Strategist
text=Morph {W} (You may cast this face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.) -- When Frontline Strategist is turned face up, prevent all combat damage non-Soldier creatures would deal this turn.
mana={W}
@@ -13634,15 +13485,6 @@ power=4
toughness=4
[/card]
[card]
name=Glowrider
text=Noncreature spells cost {1} more to cast.
mana={2}{W}
type=Creature
subtype=Human Cleric
power=2
toughness=1
[/card]
[card]
name=Gluttonous Slime
text=Flash -- Devour 1 (As this enters the battlefield, you may sacrifice any number of creatures. This creature enters the battlefield with that many +1/+1 counters on it.)
mana={2}{G}
@@ -14037,15 +13879,6 @@ mana={2}{R}
type=Enchantment
[/card]
[card]
name=Goblin Warchief
text=Goblin spells you cast cost {1} less to cast. -- Goblin creatures you control have haste.
mana={1}{R}{R}
type=Creature
subtype=Goblin
power=2
toughness=2
[/card]
[card]
name=Goblin Warrens
text={2}{R}, Sacrifice two Goblins: Put three 1/1 red Goblin creature tokens onto the battlefield.
mana={2}{R}
@@ -14295,15 +14128,6 @@ type=Artifact
subtype=Equipment
[/card]
[card]
name=Grand Arbiter Augustin IV
text=White spells you cast cost {1} less to cast. -- Blue spells you cast cost {1} less to cast. -- Spells your opponents cast cost {1} more to cast.
mana={2}{W}{U}
type=Legendary Creature
subtype=Human Advisor
power=2
toughness=3
[/card]
[card]
name=Grand Melee
auto=lord(creature) mustattack
auto=lord(creature) mustblock
@@ -15581,14 +15405,7 @@ power=2
toughness=2
[/card]
[card]
name=Helm of Awakening
text=Spells cost {1} less to cast.
mana={2}
type=Artifact
[/card]
[card]
name=Helm of Chatzuk
auto={1}{T}:banding target(creature)
text={1}, {T}: Target creature gains banding until end of turn. (Any creatures with banding, and up to one without, can attack in a band. Bands are blocked as a group. If any creatures with banding a player controls are blocking or being blocked by a creature, that player divides that creature's combat damage, not its controller, among any of the creatures it's being blocked by or is blocking.)
mana={1}
type=Artifact
@@ -15769,12 +15586,6 @@ mana={W}
type=Enchantment
[/card]
[card]
name=High Seas
text=Red creature spells and green creature spells cost {1} more to cast.
mana={2}{U}
type=Enchantment
[/card]
[card]
name=High Tide
text=Until end of turn, whenever a player taps an Island for mana, that player adds {U} to his or her mana pool (in addition to the mana the land produces).
mana={U}
@@ -15886,12 +15697,6 @@ mana={5}{U}
type=Enchantment
[/card]
[card]
name=Hivestone
text=Creatures you control are Slivers in addition to their other creature types.
mana={2}
type=Artifact
[/card]
[card]
name=Hivis of the Scale
text=You may choose not to untap Hivis of the Scale during your untap step. -- {T}: Gain control of target Dragon for as long as you control Hivis and Hivis remains tapped.
mana={3}{R}{R}
@@ -17225,15 +17030,6 @@ power=2
toughness=2
[/card]
[card]
name=Irini Sengir
text=White enchantment spells and green enchantment spells cost {2} more to cast.
mana={2}{B}{B}
type=Legendary Creature
subtype=Vampire Dwarf
power=2
toughness=2
[/card]
[card]
name=Iron Maiden
text=At the beginning of each opponent's upkeep, Iron Maiden deals X damage to that player, where X is the number of cards in his or her hand minus 4.
mana={3}
@@ -17421,15 +17217,6 @@ power=2
toughness=1
[/card]
[card]
name=Jade Leech
text=Green spells you cast cost {G} more to cast.
mana={2}{G}{G}
type=Creature
subtype=Leech
power=5
toughness=5
[/card]
[card]
name=Jade Monolith
text={1}: The next time a source of your choice would deal damage to target creature this turn, that source deals that damage to you instead.
mana={4}
@@ -17506,12 +17293,6 @@ mana={3}
type=Artifact
[/card]
[card]
name=Jet Medallion
text=Black spells you cast cost {1} less to cast.
mana={2}
type=Artifact
[/card]
[card]
name=Jetting Glasskite
text=Flying -- Whenever Jetting Glasskite becomes the target of a spell or ability for the first time in a turn, counter that spell or ability.
mana={4}{U}{U}
@@ -18816,15 +18597,6 @@ power=3
toughness=2
[/card]
[card]
name=Krosan Warchief
text=Beast spells you cast cost {1} less to cast. -- {1}{G}: Regenerate target Beast.
mana={2}{G}
type=Creature
subtype=Beast
power=2
toughness=2
[/card]
[card]
name=Krovikan Elementalist
text={2}{R}: Target creature gets +1/+0 until end of turn. -- {U}{U}: Target creature you control gains flying until end of turn. Sacrifice it at the beginning of the next end step.
mana={B}{B}
@@ -19610,12 +19382,6 @@ mana={4}
type=Artifact
[/card]
[card]
name=Life and Limb
text=All Forests and all Saprolings are 1/1 green Saproling creatures and Forest lands in addition to their other types.
mana={3}{G}
type=Enchantment
[/card]
[card]
name=Life from the Loam
text=Return up to three target land cards from your graveyard to your hand. -- Dredge 3 (If you would draw a card, instead you may put exactly three cards from the top of your library into your graveyard. If you do, return this card from your graveyard to your hand. Otherwise, draw a card.)
mana={1}{G}
@@ -19991,15 +19757,6 @@ mana={0}
type=Artifact
[/card]
[card]
name=Lodestone Golem
text=Nonartifact spells cost {1} more to cast.
mana={4}
type=Artifact Creature
subtype=Golem
power=5
toughness=3
[/card]
[card]
name=Logic Knot
text=Delve (You may exile any number of cards from your graveyard as you cast this spell. It costs {1} less to cast for each card exiled this way.) -- Counter target spell unless its controller pays {X}.
mana={X}{U}{U}
@@ -20015,12 +19772,6 @@ power=2
toughness=2
[/card]
[card]
name=Long-Forgotten Gohei
text=Arcane spells you cast cost {1} less to cast. -- Spirit creatures you control get +1/+1.
mana={3}
type=Artifact
[/card]
[card]
name=Long-Term Plans
target=*|myLibrary
text=Search your library for a card, shuffle your library, then put that card third from the top.
@@ -20733,12 +20484,6 @@ power=1
toughness=1
[/card]
[card]
name=Mana Matrix
text=Instant and enchantment spells you cast cost up to {2} less to cast.
mana={6}
type=Artifact
[/card]
[card]
name=Mana Maze
text=Players can't cast spells that share a color with the spell most recently cast this turn.
mana={1}{U}
@@ -21302,15 +21047,6 @@ mana={3}{R}
type=Enchantment
[/card]
[card]
name=Memnarch
text={1}{U}{U}: Target permanent becomes an artifact in addition to its other types. (This effect lasts indefinitely.) -- {3}{U}: Gain control of target artifact. (This effect lasts indefinitely.)
mana={7}
type=Legendary Artifact Creature
subtype=Wizard
power=4
toughness=5
[/card]
[card]
name=Memory Crystal
text=Buyback costs cost {2} less.
mana={3}
@@ -23668,15 +23404,6 @@ power=2
toughness=2
[/card]
[card]
name=Nightscape Familiar
text=Blue spells and red spells you cast cost {1} less to cast. -- {1}{B}: Regenerate Nightscape Familiar.
mana={1}{B}
type=Creature
subtype=Zombie
power=1
toughness=1
[/card]
[card]
name=Nightshade Assassin
text=First strike -- When Nightshade Assassin enters the battlefield, you may reveal X black cards in your hand. If you do, target creature gets -X/-X until end of turn. -- Madness {1}{B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={2}{B}{B}
@@ -25462,12 +25189,6 @@ mana={1}{W}
type=Instant
[/card]
[card]
name=Pearl Medallion
text=White spells you cast cost {1} less to cast.
mana={2}
type=Artifact
[/card]
[card]
name=Pearl Shard
text={3}, {T} or {W}, {T}: Prevent the next 2 damage that would be dealt to target creature or player this turn.
mana={3}
@@ -26215,12 +25936,6 @@ mana={1}{W}
type=Enchantment
[/card]
[card]
name=Planar Gate
text=Creature spells you cast cost up to {2} less to cast.
mana={6}
type=Artifact
[/card]
[card]
name=Planar Guide
text={3}{W}, Exile Planar Guide: Exile all creatures. At the beginning of the next end step, return those cards to the battlefield under their owners' control.
mana={W}
@@ -26803,12 +26518,6 @@ mana={2}{W}
type=Enchantment
[/card]
[card]
name=Prismatic Lace
text=Target permanent becomes the color or colors of your choice. (This effect lasts indefinitely.)
mana={U}
type=Instant
[/card]
[card]
name=Prismatic Omen
text=Lands you control are every basic land type in addition to their other types.
mana={1}{G}
@@ -29691,21 +29400,6 @@ power=2
toughness=3
[/card]
[card]
name=Ruby Leech
text=First strike -- Red spells you cast cost {R} more to cast.
mana={1}{R}
type=Creature
subtype=Leech
power=2
toughness=2
[/card]
[card]
name=Ruby Medallion
text=Red spells you cast cost {1} less to cast.
mana={2}
type=Artifact
[/card]
[card]
name=Rude Awakening
text=Choose one - Untap all lands you control; or until end of turn, lands you control become 2/2 creatures that are still lands. -- Entwine {2}{G} (Choose both if you pay the entwine cost.)
mana={4}{G}
@@ -30415,21 +30109,6 @@ mana={U}
type=Instant
[/card]
[card]
name=Sapphire Leech
text=Flying -- Blue spells you cast cost {U} more to cast.
mana={1}{U}
type=Creature
subtype=Leech
power=2
toughness=2
[/card]
[card]
name=Sapphire Medallion
text=Blue spells you cast cost {1} less to cast.
mana={2}
type=Artifact
[/card]
[card]
name=Saprazzan Breaker
text={U}: Put the top card of your library into your graveyard. If that card is a land card, Saprazzan Breaker is unblockable this turn.
mana={4}{U}
@@ -33799,12 +33478,6 @@ mana={3}{W}
type=Enchantment
[/card]
[card]
name=Sphere of Resistance
text=Spells cost {1} more to cast.
mana={2}
type=Artifact
[/card]
[card]
name=Sphere of Truth
text=If a white source would deal damage to you, prevent 2 of that damage.
mana={3}{W}
@@ -34337,12 +34010,6 @@ mana={1}
type=Artifact
[/card]
[card]
name=Squeeze
text=Sorcery spells cost {3} more to cast.
mana={3}{U}
type=Enchantment
[/card]
[card]
name=Squelch
text=Counter target activated ability. (Mana abilities can't be targeted.) -- Draw a card.
mana={1}{U}
@@ -34593,15 +34260,6 @@ power=2
toughness=1
[/card]
[card]
name=Stinkdrinker Daredevil
text=Giant spells you cast cost {2} less to cast.
mana={2}{R}
type=Creature
subtype=Goblin Rogue
power=1
toughness=3
[/card]
[card]
name=Stinkweed Imp
text=Flying -- Whenever Stinkweed Imp deals combat damage to a creature, destroy that creature. -- Dredge 5 (If you would draw a card, instead you may put exactly five cards from the top of your library into your graveyard. If you do, return this card from your graveyard to your hand. Otherwise, draw a card.)
mana={2}{B}
@@ -34667,12 +34325,6 @@ mana={2}{R}
type=Sorcery
[/card]
[card]
name=Stone Calendar
text=Spells you cast cost up to {1} less to cast.
mana={5}
type=Artifact
[/card]
[card]
name=Stone Giant
text={T}: Target creature you control with toughness less than Stone Giant's power gains flying until end of turn. Destroy that creature at the beginning of the next end step.
mana={2}{R}{R}
@@ -34731,15 +34383,6 @@ mana={3}{G}
type=Instant
[/card]
[card]
name=Stonybrook Banneret
text=Islandwalk -- Merfolk spells and Wizard spells you cast cost {1} less to cast.
mana={1}{U}
type=Creature
subtype=Merfolk Wizard
power=1
toughness=1
[/card]
[card]
name=Storage Matrix
text=As long as Storage Matrix is untapped, each player chooses artifact, creature, or land during his or her untap step. That player can untap only permanents of the chosen type this step.
mana={3}
@@ -34820,15 +34463,6 @@ power=2
toughness=2
[/card]
[card]
name=Stormscape Familiar
text=Flying -- White spells and black spells you cast cost {1} less to cast.
mana={1}{U}
type=Creature
subtype=Bird
power=1
toughness=1
[/card]
[card]
name=Stormtide Leviathan
text=Islandwalk -- All lands are Islands in addition to their original type. -- Creatures without flying or islandwalk can't attack.
mana={5}{U}{U}{U}
@@ -35213,15 +34847,6 @@ power=2
toughness=2
[/card]
[card]
name=Sunscape Familiar
text=Defender (This creature can't attack.) -- Green spells and blue spells you cast cost {1} less to cast.
mana={1}{W}
type=Creature
subtype=Wall
power=0
toughness=3
[/card]
[card]
name=Sunscour
text=You may exile two white cards from your hand rather than pay Sunscour's mana cost. -- Destroy all creatures.
mana={5}{W}{W}
@@ -36505,12 +36130,6 @@ power=7
toughness=7
[/card]
[card]
name=Thorn of Amethyst
text=Noncreature spells cost {1} more to cast.
mana={2}
type=Artifact
[/card]
[card]
name=Thorn-Thrash Viashino
text=Devour 2 (As this enters the battlefield, you may sacrifice any number of creatures. This creature enters the battlefield with twice that many +1/+1 counters on it.) -- {G}: Thorn-Thrash Viashino gains trample until end of turn.
mana={3}{R}
@@ -36536,15 +36155,6 @@ power=2
toughness=2
[/card]
[card]
name=Thornscape Familiar
text=Red spells and white spells you cast cost {1} less to cast.
mana={1}{G}
type=Creature
subtype=Insect
power=2
toughness=1
[/card]
[card]
name=Thought Devourer
text=Flying -- Your maximum hand size is reduced by four.
mana={2}{U}{U}
@@ -36845,15 +36455,6 @@ power=2
toughness=2
[/card]
[card]
name=Thunderscape Familiar
text=First strike -- Black spells and green spells you cast cost {1} less to cast.
mana={1}{R}
type=Creature
subtype=Kavu
power=1
toughness=1
[/card]
[card]
name=Thunderstaff
text=If Thunderstaff is untapped and a creature would deal combat damage to you, prevent 1 of that damage. -- {2}, {T}: Attacking creatures get +1/+0 until end of turn.
mana={3}
@@ -37942,15 +37543,6 @@ power=1
toughness=3
[/card]
[card]
name=Undead Warchief
text=Zombie spells you cast cost {1} less to cast. -- Zombie creatures you control get +2/+1.
mana={2}{B}{B}
type=Creature
subtype=Zombie
power=1
toughness=1
[/card]
[card]
name=Undergrowth
text=As an additional cost to cast Undergrowth, you may pay {2}{R}. -- Prevent all combat damage that would be dealt this turn. If its additional cost was paid, Undergrowth doesn't affect combat damage that would be dealt by red creatures.
mana={G}
@@ -38136,11 +37728,6 @@ power=2
toughness=2
[/card]
[card]
name=Urborg, Tomb of Yawgmoth
text=Each land is a Swamp in addition to its other land types.
type=Legendary Land
[/card]
[card]
name=Urge to Feed
text=Target creature gets -3/-3 until end of turn. You may tap any number of untapped Vampire creatures you control. If you do, put a +1/+1 counter on each of those Vampires.
mana={B}{B}

File diff suppressed because it is too large Load Diff

View File

@@ -90,12 +90,11 @@ public:
size_t start = s.find_last_of(" ",found);
if (start == string::npos) start = 0;
else start++;
power = WParsedInt(s.substr(start,found - start), spell, card);
toughness = WParsedInt(s.substr(found+1,end-found-1), spell, card);
toughness = WParsedInt(s.substr(found+1,end-found-1), spell, card);
ok = true;
}
}
}
};
@@ -2442,14 +2441,56 @@ class AOldSchoolDeathtouch:public MTGAbility{
}
};
//Adds types/abilities/P/T to a card (aura)
class ABecomes:public MTGAbility{
//reset card cost-----------------------------------------
class AResetCost:public MTGAbility{
public:
AResetCost(int id, MTGCardInstance * source, MTGCardInstance * target):MTGAbility(id,source,target){
MTGCardInstance * _target = (MTGCardInstance *)target;
}
int addToGame(){
MTGCardInstance * _target = (MTGCardInstance *)target;
_target->controller()->game->putInZone(_target,_target->controller()->game->hand, _target->controller()->game->hand);
return MTGAbility::addToGame();
}
AResetCost * clone() const{
AResetCost * a = NEW AResetCost(*this);
a->isClone = 1;
return a;
}
~AResetCost(){
}
};
//reduce or increase manacost of target by color:amount------------------------------------------
class AManaRedux:public MTGAbility{
public:
int amount;
int type;
AManaRedux(int id, MTGCardInstance * source, MTGCardInstance * target,int amount,int type):MTGAbility(id,source,target),amount(amount),type(type){
MTGCardInstance * _target = (MTGCardInstance *)target;
}
int addToGame(){
MTGCardInstance * _target = (MTGCardInstance *)target;
amount;
type;
_target->getManaCost()->add(type,amount);
return MTGAbility::addToGame();
}
AManaRedux * clone() const{
AManaRedux * a = NEW AManaRedux(*this);
a->isClone = 1;
return a;
}
~AManaRedux(){}
};
//------------------------------------
class ATransformer:public MTGAbility{
public:
list<int>abilities;
list<int>types;
list<int>colors;
WParsedPT * wppt;
ABecomes(int id, MTGCardInstance * source, MTGCardInstance * target, string stypes, WParsedPT * wppt, string sabilities):MTGAbility(id,source,target),wppt(wppt){
ATransformer(int id, MTGCardInstance * source, MTGCardInstance * target, string stypes, string sabilities):MTGAbility(id,source,target){
//TODO this is a copy/past of other code that's all around the place, everything should be in a dedicated parser class;
for (int j = 0; j < Constants::NB_BASIC_ABILITIES; j++){
@@ -2457,14 +2498,13 @@ public:
if (found != string::npos){
abilities.push_back(j);
}
}
for (int j = 0; j < Constants::MTG_NB_COLORS; j++){
}
for (int j = 0; j < Constants::MTG_NB_COLORS; j++){
size_t found = sabilities.find(Constants::MTGColorStrings[j]);
if (found != string::npos){
colors.push_back(j);
}
}
}
string s = stypes;
while (s.size()){
@@ -2481,6 +2521,83 @@ public:
}
}
int addToGame(){
MTGCardInstance * _target = (MTGCardInstance *)target;
list<int>::iterator it;
for ( it=types.begin() ; it != types.end(); it++ ){
_target->addType(*it);
}
for ( it=colors.begin() ; it != colors.end(); it++ ){
_target->setColor(*it);
}
for ( it=abilities.begin() ; it != abilities.end(); it++ ){
_target->basicAbilities[*it]++;
}
return MTGAbility::addToGame();
}
int destroy(){
MTGCardInstance * _target = (MTGCardInstance *)target;
list<int>::iterator it;
for ( it=types.begin() ; it != types.end(); it++ ){
_target->removeType(*it);
}
for ( it=colors.begin() ; it != colors.end(); it++ ){
_target->removeColor(*it);
}
for ( it=abilities.begin() ; it != abilities.end(); it++ ){
_target->basicAbilities[*it]--;
}
return 1;
}
ATransformer * clone() const{
ATransformer * a = NEW ATransformer(*this);
a->isClone = 1;
return a;
}
~ATransformer(){
}
};
//Adds types/abilities/P/T to a card (aura)
class ABecomes:public MTGAbility{
public:
list<int>abilities;
list<int>types;
list<int>colors;
WParsedPT * wppt;
ABecomes(int id, MTGCardInstance * source, MTGCardInstance * target, string stypes, WParsedPT * wppt, string sabilities):MTGAbility(id,source,target),wppt(wppt){
//TODO this is a copy/past of other code that's all around the place, everything should be in a dedicated parser class;
for (int j = 0; j < Constants::NB_BASIC_ABILITIES; j++){
size_t found = sabilities.find(Constants::MTGBasicAbilities[j]);
if (found != string::npos){
abilities.push_back(j);
}
}
for (int j = 0; j < Constants::MTG_NB_COLORS; j++){
size_t found = sabilities.find(Constants::MTGColorStrings[j]);
if (found != string::npos){
colors.push_back(j);
}
}
string s = stypes;
while (s.size()){
size_t found = s.find(" ");
if (found != string::npos){
int id = Subtypes::subtypesList->find(s.substr(0,found));
types.push_back(id);
s = s.substr(found+1);
}else{
int id = Subtypes::subtypesList->find(s);
types.push_back(id);
s = "";
}
}
}
int addToGame(){
MTGCardInstance * _target = (MTGCardInstance *)target;
list<int>::iterator it;

View File

@@ -13,13 +13,13 @@ using namespace std;
class CardPrimitive {
protected:
vector<string> ftdText;
int init();
string lcname;
ManaCost manaCost;
public:
string text;
string name;
int init();
int colors[Constants::MTG_NB_COLORS];
map<int,int> basicAbilities;

View File

@@ -971,8 +971,118 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
ab = NEW ABecomesUEOT(id,card,target,stypes,pt,sabilities);
}else{
ab = NEW ABecomes(id,card,target,stypes,pt,sabilities);
}return ab;
}
//ManaRedux
found = s.find("colorless:");
if (found != string::npos){
size_t start = s.find(":",found);
size_t end = s.find(" ",start);
int amount;
if (end != string::npos){amount = atoi(s.substr(start+1,end-start-1).c_str());}
else{amount = atoi(s.substr(start+1).c_str());}
MTGAbility * a = NEW AManaRedux(id,card,target,amount,0);
return a;
}
//ManaRedux
found = s.find("green:");
if (found != string::npos){
size_t start = s.find(":",found);
size_t end = s.find(" ",start);
int amount;
if (end != string::npos){amount = atoi(s.substr(start+1,end-start-1).c_str());}
else{amount = atoi(s.substr(start+1).c_str());}
MTGAbility * a = NEW AManaRedux(id,card,target,amount,1);
return a;
}
//ManaRedux
found = s.find("blue:");
if (found != string::npos){
size_t start = s.find(":",found);
size_t end = s.find(" ",start);
int amount;
if (end != string::npos){amount = atoi(s.substr(start+1,end-start-1).c_str());}
else{amount = atoi(s.substr(start+1).c_str());}
MTGAbility * a = NEW AManaRedux(id,card,target,amount,2);
return a;
}
//ManaRedux
found = s.find("red:");
if (found != string::npos){
size_t start = s.find(":",found);
size_t end = s.find(" ",start);
int amount;
if (end != string::npos){amount = atoi(s.substr(start+1,end-start-1).c_str());}
else{amount = atoi(s.substr(start+1).c_str());}
MTGAbility * a = NEW AManaRedux(id,card,target,amount,3);
return a;
}
//ManaRedux
found = s.find("black:");
if (found != string::npos){
size_t start = s.find(":",found);
size_t end = s.find(" ",start);
int amount;
if (end != string::npos){amount = atoi(s.substr(start+1,end-start-1).c_str());}
else{amount = atoi(s.substr(start+1).c_str());}
MTGAbility * a = NEW AManaRedux(id,card,target,amount,4);
return a;
}
//ManaRedux
found = s.find("white:");
if (found != string::npos){
size_t start = s.find(":",found);
size_t end = s.find(" ",start);
int amount;
if (end != string::npos){amount = atoi(s.substr(start+1,end-start-1).c_str());}
else{amount = atoi(s.substr(start+1).c_str());}
MTGAbility * a = NEW AManaRedux(id,card,target,amount,5);
return a;
}
//resetcost
found = s.find("resetcost");
if (found != string::npos){
MTGAbility * a = NEW AResetCost(id,card,target);
return a;}
////one less mana
// found = s.find("oneless");
// if (found != string::npos){
//MTGAbility * a = NEW AOneless(id,card,target);
// return a;}
////more more mana
// found = s.find("onemore");
// if (found != string::npos){
//MTGAbility * a = NEW AOnemore(id,card,target);
// return a;}
//transform....(hivestone,living enchantment)
found = s.find("transforms(");
if (found != string::npos){
size_t real_end = s.find(")", found);
size_t end = s.find(",", found);
if (end == string::npos) end = real_end;
string stypes = s.substr(found + 11,end - found - 11);
string sabilities;
if (end != real_end){
int previous = end+1;
end = s.find(",",previous);
if (end == string::npos) end = real_end;
string temp = s.substr(previous, end - previous);
if (end == real_end){
sabilities = temp;
}
}
return ab;
if (end != real_end){
sabilities = s.substr(end+1, real_end - end);
}
MTGAbility * ab;
if (forceUEOT){
ab = NEW ATransformer(id,card,target,stypes,sabilities);
}else{
ab = NEW ATransformer(id,card,target,stypes,sabilities);
}return ab;
}
//Change Power/Toughness
@@ -1067,11 +1177,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
a->oneShot = 1;
return a;
}
return NULL;
return NULL;
}
//Tells the AI if the ability should target itself or an ennemy
@@ -1187,6 +1293,10 @@ int AbilityFactory::getAbilities(vector<MTGAbility *> * v, Spell * spell, MTGCar
if (dest == zones->exile){
magicText = card->magicTexts["exile"];
break;
}
if (dest == zones->library){
magicText = card->magicTexts["library"];
break;
}
//Other zones needed ?
return 0;

View File

@@ -175,7 +175,7 @@ int OtherAbilitiesEventReceiver::receiveEvent(WEvent *e){
AbilityFactory af;
af.magicText(g->mLayers->actionLayer()->getMaxId(), NULL, event->card, 1, 0,event->to);
return 1;
}
}
}
return 0;
}

View File

@@ -77,6 +77,22 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
zones[nbzones] = MTGGameZone::MY_BATTLEFIELD;
nbzones++;
zones[nbzones] = MTGGameZone::OPPONENT_BATTLEFIELD;
}else if(zoneName.compare("nonbattlezone") == 0){
zones[nbzones] = MTGGameZone::MY_GRAVEYARD;
nbzones++;
zones[nbzones] = MTGGameZone::OPPONENT_GRAVEYARD;
nbzones++;
zones[nbzones] = MTGGameZone::MY_LIBRARY;
nbzones++;
zones[nbzones] = MTGGameZone::OPPONENT_LIBRARY;
nbzones++;
zones[nbzones] = MTGGameZone::MY_HAND;
nbzones++;
zones[nbzones] = MTGGameZone::OPPONENT_HAND;
nbzones++;
zones[nbzones] = MTGGameZone::MY_EXILE;
nbzones++;
zones[nbzones] = MTGGameZone::OPPONENT_EXILE;
}else if(zoneName.compare("stack") == 0){
zones[nbzones] = MTGGameZone::MY_STACK;
nbzones++;