Merge pull request #623 from kevlahnota/master

CDA and X manacost on stack
This commit is contained in:
Anthony Calosa
2015-09-18 06:10:24 +08:00
12 changed files with 576 additions and 247 deletions

View File

@@ -2,7 +2,7 @@
#Please keep these card alphabetized, and try to have the "name=" line at the top of each card
[card]
name=Aeon Chronicler
auto=phandcount/phandcount nonstatic
auto=phandcount/phandcount cdaactive
autoexile=@counterremoved(0/0,1,Time) from(sourcecard) suspended:draw:1
suspend(0)={X}{3}{U}
text=Aeon Chronicler's power and toughness are each equal to the number of cards in your hand. -- Suspend X - {X}{3}{U}. X can't be 0. (Rather than cast this card from your hand, you may pay {X}{3}{U} and exile it with X time counters on it. At the beginning of your upkeep, remove a time counter. When the last is removed, cast it without paying its mana cost. It has haste.) -- Whenever a time counter is removed from Aeon Chronicler while it's exiled, draw a card.
@@ -867,7 +867,7 @@ type=Instant
[/card]
[card]
name=Adamaro, First to Desire
auto=foreach(*|opponenthand) 1/1
auto=type:*:opponenthand/type:*:opponenthand cdaactive
text=Adamaro, First to Desire's power and toughness are each equal to the number of cards in the hand of the opponent with the most cards in hand.
mana={1}{R}{R}
type=Legendary Creature
@@ -1464,7 +1464,7 @@ subtype=Ajani
[/card]
[card]
name=Avatar Token
auto=thisforeach(controllerlife) 1/1
auto=controllerlife/controllerlife cdaactive
type=Creature
subtype=Avatar
power=*
@@ -2287,7 +2287,7 @@ toughness=2
[card]
name=Altar Golem
abilities=trample,doesnotuntap
auto=foreach(creature|battlefield) 1/1
auto=type:creature:battlefield/type:creature:battlefield cdaactive
auto={T(creature|myBattlefield)}{T(creature|myBattlefield)}{T(creature|myBattlefield)}{T(creature|myBattlefield)}{T(creature|myBattlefield)}:untap
text=Trample -- Altar Golem's power and toughness are each equal to the number of creatures on the battlefield. -- Altar Golem doesn't untap during your untap step. -- Tap five untapped creatures you control: Untap Altar Golem.
mana={7}
@@ -2853,22 +2853,7 @@ toughness=3
[/card]
[card]
name=Ancient Ooze
auto=foreach(other creature[manacost=1]|mybattlefield) 1/1
auto=foreach(other creature[manacost=2]|mybattlefield) 2/2
auto=foreach(other creature[manacost=3]|mybattlefield) 3/3
auto=foreach(other creature[manacost=4]|mybattlefield) 4/4
auto=foreach(other creature[manacost=5]|mybattlefield) 5/5
auto=foreach(other creature[manacost=6]|mybattlefield) 6/6
auto=foreach(other creature[manacost=7]|mybattlefield) 7/7
auto=foreach(other creature[manacost=8]|mybattlefield) 8/8
auto=foreach(other creature[manacost=9]|mybattlefield) 9/9
auto=foreach(other creature[manacost=10]|mybattlefield) 10/10
auto=foreach(other creature[manacost=11]|mybattlefield) 11/11
auto=foreach(other creature[manacost=12]|mybattlefield) 12/12
auto=foreach(other creature[manacost=13]|mybattlefield) 13/13
auto=foreach(other creature[manacost=14]|mybattlefield) 14/14
auto=foreach(other creature[manacost=15]|mybattlefield) 15/15
auto=foreach(other creature[manacost=16]|mybattlefield) 16/16
auto=pancientooze/pancientooze cdaactive
text=Ancient Ooze's power and toughness are each equal to the total converted mana cost of other creatures you control.
mana={5}{G}{G}
type=Creature
@@ -7909,7 +7894,7 @@ toughness=2
[card]
name=Battle Squadron
abilities=flying
auto=foreach(creature|myBattlefield) 1/1
auto=type:creature:myBattlefield/type:creature:myBattlefield cdaactive
text=Flying -- Battle Squadron's power and toughness are each equal to the number of creatures you control.
mana={3}{R}{R}
type=Creature
@@ -8222,7 +8207,7 @@ type=Enchantment
[/card]
[card]
name=Beast of Burden
auto=foreach(creature|Battlefield) 1/1
auto=type:creature:Battlefield/type:creature:Battlefield cdaactive
text=Beast of Burden's power and toughness are each equal to the number of creatures on the battlefield.
mana={6}
type=Artifact Creature
@@ -8512,7 +8497,7 @@ toughness=2
[/card]
[card]
name=Benalish Commander
auto=type:soldier:mybattlefield/type:soldier:mybattlefield nonstatic
auto=type:soldier:mybattlefield/type:soldier:mybattlefield cdaactive
autoexile=@counterremoved(0/0,1,Time) from(sourcecard) suspended:token(Soldier,Creature Soldier,1/1,white)
suspend(0)={X}{W}{W}
text=Benalish Commander's power and toughness are each equal to the number of Soldiers you control. -- Suspend X - {X}{W}{W}. X can't be 0. (Rather than cast this card from your hand, you may pay {X}{W}{W} and exile it with X time counters on it. At the beginning of your upkeep, remove a time counter. When the last is removed, cast it without paying its mana cost. It has haste.) -- Whenever a time counter is removed from Benalish Commander while it's exiled, put a 1/1 white Soldier creature token onto the battlefield.
@@ -11356,7 +11341,7 @@ toughness=2
[/card]
[card]
name=Boneyard Wurm
auto=foreach(creature|mygraveyard) 1/1
auto=type:creature:mygraveyard/type:creature:mygraveyard cdaactive
text=Boneyard Wurm's power and toughness are each equal to the number of creature cards in your graveyard.
mana={1}{G}
type=Creature
@@ -12639,7 +12624,7 @@ toughness=4
[card]
name=Broodstar
abilities=affinityartifacts,flying
auto=foreach(artifact|mybattlefield) 1/1
auto=type:artifact:mybattlefield/type:artifact:mybattlefield cdaactive
text=Affinity for artifacts (This spell costs {1} less to cast for each artifact you control.) -- Flying -- Broodstar's power and toughness are each equal to the number of artifacts you control.
mana={8}{U}{U}
type=Creature
@@ -13633,6 +13618,7 @@ subtype=Elf
power=2
toughness=2
[/card]
#chosentype and chosencolor not compatible with cdaactive...
[card]
name=Caller of the Hunt
auto=chooseatype foreach(creature[chosentype]|battlefield) 1/1 chooseend
@@ -13788,7 +13774,7 @@ type=Sorcery
[card]
name=Cantivore
abilities=vigilance
auto=foreach(enchantment|graveyard) 1/1
auto=type:enchantment:graveyard/type:enchantment:graveyard cdaactive
text=Vigilance -- Cantivore's power and toughness are each equal to the number of enchantment cards in all graveyards.
mana={1}{W}{W}
type=Creature
@@ -15399,7 +15385,11 @@ toughness=4
[/card]
[card]
name=Chameleon Spirit
auto=chooseacolor foreach(*[chosencolor]|opponentBattlefield) 1/1 chooseend
auto=choice name(green) activate type:*[green]:opponentBattlefield/type:*[green]:opponentBattlefield cdaactive
auto=choice name(red) activate type:*[red]:opponentBattlefield/type:*[red]:opponentBattlefield cdaactive
auto=choice name(blue) activate type:*[blue]:opponentBattlefield/type:*[blue]:opponentBattlefield cdaactive
auto=choice name(white) activate type:*[white]:opponentBattlefield/type:*[white]:opponentBattlefield cdaactive
auto=choice name(black) activate type:*[black]:opponentBattlefield/type:*[black]:opponentBattlefield cdaactive
text=As Chameleon Spirit enters the battlefield, choose a color. -- Chameleon Spirit's power and toughness are each equal to the number of permanents of the chosen color your opponents control.
mana={3}{U}
type=Creature
@@ -17666,7 +17656,7 @@ type=Instant
[card]
name=Cognivore
abilities=flying
auto=foreach(instant|graveyard) 1/1
auto=type:instant:graveyard/type:instant:graveyard cdaactive
text=Flying -- Cognivore's power and toughness are each equal to the number of instant cards in all graveyards.
mana={6}{U}{U}
type=Creature
@@ -17686,7 +17676,7 @@ toughness=1
[/card]
[card]
name=Coiling Woodworm
auto=foreach(forest|battlefield) 1/0
auto=type:forest:battlefield/1 cdaactive
text=Coiling Woodworm's power is equal to the number of Forests on the battlefield.
mana={2}{G}
type=Creature
@@ -19763,7 +19753,7 @@ toughness=4
[card]
name=Crowd of Cinders
abilities=fear
auto=foreach(*[black]|myBattlefield) 1/1
auto=type:*[black]:myBattlefield/type:*[black]:myBattlefield cdaactive
text=Fear (This creature can't be blocked except by artifact creatures and/or black creatures.) -- Crowd of Cinders's power and toughness are each equal to the number of black permanents you control.
mana={3}{B}
type=Creature
@@ -19968,7 +19958,7 @@ type=Enchantment
[/card]
[card]
name=Crusader of Odric
auto=foreach(creature|mybattlefield) 1/1
auto=type:creature:mybattlefield/type:creature:mybattlefield cdaactive
text=Crusader of Odric's power and toughness are each equal to the number of creatures you control.
mana={2}{W}
type=Creature
@@ -20858,7 +20848,7 @@ subtype=Aura
[/card]
[card]
name=Dakkon Blackblade
auto=foreach(land|myBattlefield) 1/1
auto=type:land:myBattlefield/type:land:myBattlefield cdaactive
text=Dakkon Blackblade's power and toughness are each equal to the number of lands you control.
mana={2}{W}{U}{U}{B}
type=Legendary Creature
@@ -20921,7 +20911,7 @@ toughness=1
[/card]
[card]
name=Dakmor Sorceress
auto=foreach(swamp|myBattlefield) 1/0
auto=type:swamp:myBattlefield/4 cdaactive
text=Dakmor Sorceress's power is equal to the number of Swamps you control.
mana={5}{B}
type=Creature
@@ -21419,7 +21409,7 @@ type=Artifact
[card]
name=Darksteel Juggernaut
abilities=mustattack,indestructible
auto=foreach(artifact|mybattlefield) 1/1
auto=type:artifact:mybattlefield/type:artifact:mybattlefield cdaactive
text=Darksteel Juggernaut's power and toughness are equal to the number of artifacts you control. -- Darksteel Juggernaut is indestructible and attacks each turn if able.
mana={5}
type=Artifact Creature
@@ -21615,8 +21605,7 @@ toughness=3
[/card]
[card]
name=Dauntless Dourbark
auto=foreach(forest|myBattlefield) 1/1
auto=foreach(treefolk|myBattlefield) 1/1
auto=pdauntless/pdauntless cdaactive
auto=aslongas(other treefolk|myBattlefield) trample
text=Dauntless Dourbark's power and toughness are each equal to the number of Forests you control plus the number of Treefolk you control. -- Dauntless Dourbark has trample as long as you control another Treefolk.
mana={3}{G}
@@ -21749,7 +21738,7 @@ toughness=1
[card]
name=Dauthi Warlord
abilities=shadow
auto=foreach(creature[shadow]|battlefield) 1/0
auto=type:creature[shadow]:battlefield/1 cdaactive
text=Shadow (This creature can block or be blocked by only creatures with shadow.) -- Dauthi Warlord's power is equal to the number of creatures with shadow on the battlefield.
mana={1}{B}
type=Creature
@@ -23831,7 +23820,7 @@ text=Destroy target artifact with converted mana cost X. It can't be regenerated
[/card]
[card]
name=Detritivore
auto=type:land[-basic]:opponentgraveyard/type:land[-basic]:opponentgraveyard nonstatic
auto=type:land[-basic]:opponentgraveyard/type:land[-basic]:opponentgraveyard cdaactive
autoexile=@counterremoved(0/0,1,Time) from(sourcecard) suspended:destroy target(land[-basic])
suspend(0)={X}{3}{R}
text=Detritivore's power and toughness are each equal to the number of nonbasic land cards in your opponents' graveyards. -- Suspend X - {X}{3}{R}. X can't be 0. (Rather than cast this card from your hand, you may pay {X}{3}{R} and exile it with X time counters on it. At the beginning of your upkeep, remove a time counter. When the last is removed, cast it without paying its mana cost. It has haste.) -- Whenever a time counter is removed from Detritivore while it's exiled, destroy target nonbasic land.
@@ -25292,7 +25281,7 @@ type=Artifact
[card]
name=Doubtless One
auto=spiritlink
auto=foreach(cleric) 1/1
auto=type:cleric:battlefield/type:cleric:battlefield cdaactive
text=Doubtless One's power and toughness are each equal to the number of Clerics on the battlefield. -- Whenever Doubtless One deals damage, you gain that much life.
mana={3}{W}
type=Creature
@@ -26421,7 +26410,7 @@ toughness=5
[card]
name=Drift of the Dead
abilities=defender
auto=foreach(land[snow]|myBattlefield) 1/1
auto=type:land[snow]:myBattlefield/type:land[snow]:myBattlefield cdaactive
text=Defender (This creature can't attack.) -- Drift of the Dead's power and toughness are each equal to the number of snow lands you control.
mana={3}{B}
type=Creature
@@ -26781,7 +26770,7 @@ toughness=1
[card]
name=Drove of Elves
abilities=opponentshroud
auto=foreach(*[green]|myBattlefield) 1/1
auto=type:*[green]:myBattlefield/type:*[green]:myBattlefield cdaactive
text=Drove of Elves's power and toughness are each equal to the number of green permanents you control. -- Drove of Elves can't be the target of spells or abilities your opponents control.
mana={3}{G}
type=Creature
@@ -27132,7 +27121,7 @@ toughness=1
[card]
name=Dungrove Elder
abilities=opponentshroud
auto=foreach(forest|mybattlefield) 1/1
auto=type:forest:mybattlefield/type:forest:mybattlefield cdaactive
text=Hexproof (This creature can't be the target of spells or abilities your opponents control.) -- Dungrove Elder's power and toughness are each equal to the number of Forests you control.
mana={2}{G}
type=Creature
@@ -28466,7 +28455,7 @@ type=Sorcery
name=Elephant T1
type=Creature
subtype=Elephant
auto=foreach(creature|mygraveyard) 1/1
auto=type:creature:mygraveyard/type:creature:mygraveyard cdaactive
text=This creature's power and toughness are each equal to the number of creature cards in its controller's graveyard.
power=*
toughness=*
@@ -30000,7 +29989,7 @@ toughness=2
[/card]
[card]
name=Entropic Specter
auto=foreach(*|opponenthand) 1/1
auto=type:*:opponenthand/type:*:opponenthand cdaactive
auto=@damaged(controller) from(this):ability$!name(discard) target(*|myhand) reject!$ controller
auto=@damaged(opponent) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent
text=Flying -- As Entropic Specter enters the battlefield, choose an opponent. -- Entropic Specter's power and toughness are each equal to the number of cards in the chosen player's hand. -- Whenever Entropic Specter deals damage to a player, that player discards a card.
@@ -31590,7 +31579,7 @@ toughness=1
[card]
name=Faerie Swarm
abilities=flying
auto=foreach(*[blue]|myBattlefield) 1/1
auto=type:*[blue]:myBattlefield/type:*[blue]:myBattlefield cdaactive
text=Flying -- Faerie Swarm's power and toughness are each equal to the number of blue permanents you control.
mana={3}{U}
type=Creature
@@ -37037,7 +37026,7 @@ type=Instant
name=Geist-Honored Monk
abilities=vigilance
auto=token(Spirit,Creature Spirit,1/1,white,flying)*2
auto=foreach(creature|mybattlefield) 1/1
auto=type:creature:mybattlefield/type:creature:mybattlefield cdaactive
text=Vigilance -- Geist-Honored Monk's power and toughness are each equal to the number of creatures you control. -- When Geist-Honored Monk enters the battlefield, put two 1/1 white Spirit creature tokens with flying onto the battlefield.
mana={3}{W}{W}
type=Creature
@@ -44009,7 +43998,7 @@ subtype=Arcane
[card]
name=Heedless One
abilities=trample
auto=foreach(elf) 1/1
auto=type:elf:battlefield/type:elf:battlefield cdaactive
text=Trample -- Heedless One's power and toughness are each equal to the number of Elves on the battlefield.
mana={3}{G}
type=Creature
@@ -48996,7 +48985,7 @@ toughness=4
[/card]
[card]
name=Jagged-Scar Archers
auto=foreach(elf|myBattlefield) 1/1
auto=type:elf:myBattlefield/type:elf:myBattlefield cdaactive
auto={T}:target(creature[flying]) dynamicability<!powerstrike!>
text=Jagged-Scar Archers's power and toughness are each equal to the number of Elves you control. -- {T}: Jagged-Scar Archers deals damage equal to its power to target creature with flying.
mana={1}{G}{G}
@@ -50252,8 +50241,8 @@ abilities=defender
[/card]
[card]
name=Kagemaro, First to Suffer
auto=foreach(*|myhand) 1/1
auto={B}{S}:foreach(*|myhand) -1/-1 all(creature)
auto=type:*:myhand/type:*:myhand cdaactive
auto={B}{S}:-type:*:myhand/-type:*:myhand all(creature)
text=Kagemaro, First to Suffer's power and toughness are each equal to the number of cards in your hand. -- {B}, Sacrifice Kagemaro: All creatures get -X/-X until end of turn, where X is the number of cards in your hand.
mana={3}{B}{B}
type=Legendary Creature
@@ -51342,7 +51331,7 @@ toughness=1
[/card]
[card]
name=Keldon Warlord
auto=foreach(creature[-wall]|myBattlefield) 1/1
auto=type:creature[-wall]:myBattlefield/type:creature[-wall]:myBattlefield cdaactive
text=Keldon Warlord's power and toughness are each equal to the number of non-Wall creatures you control.
mana={2}{R}{R}
type=Creature
@@ -51991,7 +51980,7 @@ toughness=2
[card]
name=Kithkin Rabble
abilities=vigilance
auto=foreach(*[white]|myBattlefield) 1/1
auto=type:*[white]:myBattlefield/type:*[white]:myBattlefield cdaactive
text=Vigilance -- Kithkin Rabble's power and toughness are each equal to the number of white permanents you control.
mana={3}{W}
type=Creature
@@ -52115,7 +52104,7 @@ toughness=1
[/card]
[card]
name=Kiyomaro, First to Stand
auto=foreach(*|myhand) 1/1
auto=type:*:myhand/type:*:myhand cdaactive
auto=aslongas(*|myhand) vigilance >3
auto=@damaged(player) from(this) restriction{type(*|myhand)~morethan~6}:life:7 controller >6
auto=@damaged(creature) from(this) restriction{type(*|myhand)~morethan~6}:life:7 controller >6
@@ -52609,7 +52598,7 @@ toughness=1
[card]
name=Kolaghan Forerunners
abilities=trample
auto=foreach(creature|mybattlefield) 1/0
auto=type:creature:mybattlefield/3 cdaactive
other={R}{2} name(Dash)
auto=if paid(alternative) then transforms((,newability[haste],newability[phaseaction[endofturn sourceinplay] moveto(ownerhand) all(this)])) forever
text=Trample -- Kolaghan Forerunners's power is equal to the number of creatures you control. -- Dash {2}{R} (You may cast this spell for its dash cost. If you do, it gains haste, and it's returned from the battlefield to its owner's hand at the beginning of the next end step.)
@@ -52665,6 +52654,15 @@ power=3
toughness=3
[/card]
[card]
name=Konda's Banner
auto={2}:equip target(creature[legendary]|mybattlefield)
auto=teach(creature) transforms((,newability[lord(creature[share!color!]) 1/1],newability[lord(creature[share!types!]) 1/1]))
text=Konda's Banner can be attached only to a legendary creature. -- Creatures that share a color with equipped creature get +1/+1. -- Creatures that share a creature type with equipped creature get +1/+1. -- Equip {2}
mana={2}
type=Legendary Artifact
subtype=Equipment
[/card]
[card]
name=Konda's Hatamoto
auto=bushido(1/1)
auto=aslongas(samurai[legendary]|mybattlefield) 1/2
@@ -52834,7 +52832,7 @@ toughness=1
[card]
name=Korlash Heir to Blackblade
auto={discard(korlash heir to blackblade|myhand)}:moveto(mybattlefield) and!(tap)! target(<upto:2>swamp|mylibrary)
auto=foreach(swamp|mybattlefield) 1/1
auto=type:swamp:mybattlefield/type:swamp:mybattlefield cdaactive
auto={1}{B}:regenerate
text=Korlash, Heir to Blackblade's power and toughness are each equal to the number of Swamps you control. -- {1}{B}: Regenerate Korlash. -- Grandeur - Discard another card named Korlash, Heir to Blackblade: Search your library for up to two Swamp cards, put them onto the battlefield tapped, then shuffle your library.
mana={2}{B}{B}
@@ -53267,7 +53265,7 @@ subtype=Aura
[card]
name=Krovikan Mist
abilities=flying
auto=foreach(illusion|battlefield) 1/1
auto=type:illusion:battlefield/type:illusion:battlefield cdaactive
text=Flying -- Krovikan Mist's power and toughness are each equal to the number of Illusions on the battlefield.
mana={1}{U}
type=Creature
@@ -54859,7 +54857,7 @@ toughness=5
[/card]
[card]
name=Lhurgoyf
auto=foreach(creature|graveyard) 1/1
auto=type:creature:graveyard/plusonetype:creature:graveyard cdaactive
text=Lhurgoyf's power is equal to the number of creature cards in all graveyards and its toughness is equal to that number plus 1.
mana={2}{G}{G}
type=Creature
@@ -56188,7 +56186,7 @@ toughness=2
[/card]
[card]
name=Lord of Extinction
auto=foreach(*|graveyard) 1/1
auto=type:*:graveyard/type:*:graveyard cdaactive
text=Lord of Extinction's power and toughness are each equal to the number of cards in all graveyards.
mana={3}{B}{G}
type=Creature
@@ -57500,7 +57498,7 @@ toughness=6
[card]
name=Magnivore
abilities=haste
auto=foreach(sorcery|graveyard) 1/1
auto=type:sorcery:graveyard/type:sorcery:graveyard cdaactive
text=Haste (This creature can attack the turn it comes under your control.) -- Magnivore's power and toughness are each equal to the number of sorcery cards in all graveyards.
mana={2}{R}{R}
type=Creature
@@ -58291,9 +58289,7 @@ toughness=3
[/card]
[card]
name=Maraxus of Keld
auto=foreach(artifact[-tapped]|myBattlefield) 1/1
auto=foreach(creature[-tapped]|myBattlefield) 1/1
auto=foreach(land[-tapped]|myBattlefield) 1/1
auto=type:*[-tapped&-enchantment;-tapped&-planeswalker]/type:*[-tapped&-enchantment;-tapped&-planeswalker] cdaactive
text=Maraxus of Keld's power and toughness are each equal to the number of untapped artifacts, creatures, and lands you control.
mana={4}{R}{R}
type=Legendary Creature
@@ -58668,7 +58664,7 @@ toughness=4
[/card]
[card]
name=Maro
auto=foreach(*|myhand) 1/1
auto=type:*:myhand/type:*:myhand cdaactive
text=Maro's power and toughness are each equal to the number of cards in your hand.
mana={2}{G}{G}
type=Creature
@@ -59201,7 +59197,7 @@ toughness=2
[card]
name=Master of Etherium
auto=lord(other creature[artifact]|mybattlefield) 1/1
auto=foreach(artifact|mybattlefield) 1/1
auto=type:artifact:mybattlefield/type:artifact:mybattlefield cdaactive
text=Master of Etherium's power and toughness are each equal to the number of artifacts you control. -- Other artifact creatures you control get +1/+1.
mana={2}{U}
type=Artifact Creature
@@ -59306,7 +59302,7 @@ toughness=4
[/card]
[card]
name=Masumaro, First to Live
auto=foreach(*|myhand) 2/2
auto=twicetype:*:myhand/twicetype:*:myhand cdaactive
text=Masumaro, First to Live's power and toughness are each equal to twice the number of cards in your hand.
mana={3}{G}{G}{G}
type=Legendary Creature
@@ -59316,11 +59312,7 @@ toughness=*
[/card]
[card]
name=Matca Rioters
auto=aslongas(forest|myBattlefield) 1/1
auto=aslongas(island|myBattlefield) 1/1
auto=aslongas(plains|myBattlefield) 1/1
auto=aslongas(mountain|myBattlefield) 1/1
auto=aslongas(swamp|myBattlefield) 1/1
auto=pbasiclandtypes/pbasiclandtypes cdaactive
text=Domain - Matca Rioters's power and toughness are each equal to the number of basic land types among lands you control.
mana={2}{G}
type=Creature
@@ -62293,7 +62285,7 @@ toughness=8
[card]
name=Molimo, Maro-Sorcerer
abilities=trample
auto=foreach(land|myBattlefield) 1/1
auto=type:land:myBattlefield/type:land:myBattlefield cdaactive
text=Trample (If this creature would deal enough damage to its blockers to destroy them, you may have it deal the rest of its damage to defending player or planeswalker.) -- Molimo, Maro-Sorcerer's power and toughness are each equal to the number of lands you control.
mana={4}{G}{G}{G}
type=Legendary Creature
@@ -63171,7 +63163,7 @@ toughness=2
[card]
name=Mortivore
auto={B}:regenerate
auto=foreach(creature|graveyard) 1/1
auto=type:creature:graveyard/type:creature:graveyard cdaactive
text=Mortivore's power and toughness are each equal to the number of creature cards in all graveyards. -- {B}: Regenerate Mortivore. (The next time this creature would be destroyed this turn, it isn't. Instead tap it, remove all damage from it, and remove it from combat.)
mana={2}{B}{B}
type=Creature
@@ -63566,8 +63558,7 @@ toughness=2
[card]
name=Multani, Maro-Sorcerer
abilities=shroud
auto=foreach(*|myhand) 1/1
auto=foreach(*|opponenthand) 1/1
auto=type:*:hand/type:*:hand cdaactive
text=Shroud (This permanent can't be the target of spells or abilities.) -- Multani's power and toughness are each equal to the total number of cards in all players' hands.
mana={4}{G}{G}
type=Legendary Creature
@@ -64380,7 +64371,7 @@ subtype=Shapeshifter
name=Nameless One
facedown={3}
autofacedown={2}{U}:morph
auto=foreach(wizard) 1/1
auto=type:wizard:battlefield/type:wizard:battlefield cdaactive
text=Nameless One's power and toughness are each equal to the number of Wizards on the battlefield. -- Morph {2}{U} (You may cast this face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.)
mana={3}{U}
type=Creature
@@ -65784,7 +65775,7 @@ type=Sorcery
[card]
name=Nightmare
abilities=flying
auto=foreach(swamp|myBattlefield) 1/1
auto=type:swamp:mybattlefield/type:swamp:mybattlefield cdaactive
text=Flying -- Nightmare's power and toughness are each equal to the number of Swamps you control.
mana={5}{B}
type=Creature
@@ -65902,7 +65893,7 @@ toughness=4
[/card]
[card]
name=Nightstalker Engine
auto=foreach(creature|myGraveyard) 1/0
auto=type:creature:myGraveyard/3 cdaactive
text=Nightstalker Engine's power is equal to the number of creature cards in your graveyard.
mana={4}{B}
type=Creature
@@ -68681,7 +68672,7 @@ toughness=2
[/card]
[card]
name=Overbeing of Myth
auto=foreach(*|myhand) 1/1
auto=type:*:myhand/type:*:myhand cdaactive
auto=@each my draw:draw:1
text=Overbeing of Myth's power and toughness are each equal to the number of cards in your hand. -- At the beginning of your draw step, draw an additional card.
mana={GU}{GU}{GU}{GU}{GU}
@@ -68934,7 +68925,7 @@ type=Sorcery
[/card]
[card]
name=Pack Rat
auto=foreach(creature[rat]|mybattlefield) 1/1
auto=type:rat:mybattlefield/type:rat:mybattlefield cdaactive
auto={2}{B}{discard(*|myhand)}:token(253624)
text=Pack Rat's power and toughness are each equal to the number of Rats you control. -- {2}{B}, Discard a card: Put a token onto the battlefield that's a copy of Pack Rat.
mana={1}{B}
@@ -69178,7 +69169,7 @@ toughness=4
[/card]
[card]
name=Pallimud
auto=foreach(land[tapped]|opponentBattlefield) 1/0
auto=type:land[tapped]:opponentbattlefield/3 cdaactive
text=As Pallimud enters the battlefield, choose an opponent. -- Pallimud's power is equal to the number of tapped lands the chosen player controls.
mana={2}{R}
type=Creature
@@ -70308,7 +70299,7 @@ toughness=6
[/card]
[card]
name=Pestilence Rats
auto=foreach(other rat) 1/0
auto=othertype:rat:battlefield/3 cdaactive
text=Pestilence Rats's power is equal to the number of other Rats on the battlefield. (For example, as long as there are two other Rats on the battlefield, Pestilence Rats's power and toughness are 2/3.)
mana={2}{B}
type=Creature
@@ -71772,7 +71763,7 @@ toughness=1
[/card]
[card]
name=Plague Rats
auto=foreach(plague rats) 1/1
auto=myname/myname cdaactive
text=Plague Rats's power and toughness are each equal to the number of creatures named Plague Rats on the battlefield.
mana={2}{B}
type=Creature
@@ -72973,7 +72964,7 @@ subtype=Aura
[card]
name=Primalcrux
abilities=trample
auto=thisforeach(variable{type:manag:mybattlefield}>0) 1/1
auto=type:manag:mybattlefield/type:manag:mybattlefield cdaactive
text=Trample -- Chroma - Primalcrux's power and toughness are each equal to the number of green mana symbols in the mana costs of permanents you control.
mana={G}{G}{G}{G}{G}{G}
type=Creature
@@ -73646,7 +73637,7 @@ type=Enchantment
[/card]
[card]
name=Psychosis Crawler
auto=foreach(*|myhand) 1/1
auto=type:*:myhand/type:*:myhand cdaactive
auto=@drawn(controller):life:-1 opponent
text=Psychosis Crawler's power and toughness are each equal to the number of cards in your hand. - Whenever you draw a card, each opponent loses 1 life.
mana={5}
@@ -76640,7 +76631,7 @@ toughness=2
[card]
name=Reckless One
abilities=haste
auto=foreach(goblin) 1/1
auto=type:goblin:battlefield/type:goblin:battlefield cdaactive
text=Haste -- Reckless One's power and toughness are each equal to the number of Goblins on the battlefield.
mana={3}{R}
type=Creature
@@ -77979,7 +77970,7 @@ type=Artifact
[card]
name=Revenant
abilities=flying
auto=foreach(creature|mygraveyard) 1/1
auto=type:creature:mygraveyard/type:creature:mygraveyard cdaactive
text=Flying -- Revenant's power and toughness are each equal to the number of creature cards in your graveyard.
mana={4}{B}
type=Creature
@@ -79992,7 +79983,7 @@ toughness=3
[/card]
[card]
name=Rubblehulk
auto=type:land:mybattlefield/type:land:mybattlefield nonstatic
auto=type:land:mybattlefield/type:land:mybattlefield cdaactive
autohand={1}{R}{G}{discard}:name(bloodrush) target(creature[attacking]) type:land:mybattlefield/type:land:mybattlefield ueot
text=Rubblehulk's power and toughness are each equal to the number of lands you control. -- Bloodrush — {1}{R}{G}, Discard Rubblehulk: Target attacking creature gets +X/+X until end of turn, where X is the number of lands you control.
mana={4}{R}{G}
@@ -80516,7 +80507,7 @@ type=Artifact
[card]
name=Rusting Golem
auto=fading:5
auto=thisforeach(counter{0/0.1.Fade}) 1/1
auto=counter{0%0.1.Fade}/counter{0%0.1.Fade} cdaactive
text=Fading 5 (This creature enters the battlefield with five fade counters on it. At the beginning of your upkeep, remove a fade counter from it. If you can't, sacrifice it.) -- Rusting Golem's power and toughness are each equal to the number of fade counters on it.
mana={4}
type=Artifact Creature
@@ -82556,7 +82547,7 @@ toughness=1
[/card]
[card]
name=Scion of the Wild
auto=foreach(creature|myBattlefield) 1/1
auto=type:creature:myBattlefield/type:creature:myBattlefield cdaactive
text=Scion of the Wild's power and toughness are each equal to the number of creatures you control.
mana={1}{G}{G}
type=Creature
@@ -84608,7 +84599,7 @@ toughness=3
name=Serpent of the Endless Sea
abilities=cantattack
auto=aslongas(island|opponentBattlefield) -cantattack
auto=foreach(island|myBattlefield) 1/1
auto=type:island:myBattlefield/type:island:myBattlefield cdaactive
text=Serpent of the Endless Sea's power and toughness are each equal to the number of Islands you control. -- Serpent of the Endless Sea can't attack unless defending player controls an Island.
mana={4}{U}
type=Creature
@@ -84681,7 +84672,7 @@ toughness=1
[/card]
[card]
name=Serra Avatar
auto=thisforeach(controllerlife) 1/1
auto=controllerlife/controllerlife cdaactive
autograveyard=moveTo(ownerlibrary) && shuffle
text=Serra Avatar's power and toughness are each equal to your life total. -- When Serra Avatar is put into a graveyard from anywhere, shuffle it into its owner's library.
mana={4}{W}{W}{W}
@@ -84997,8 +84988,8 @@ toughness=2
[/card]
[card]
name=Sewer Nemesis
auto=choice name(opponent) transforms((,newability[foreach(*|opponentgraveyard) 1/1],newability[@movedTo(*|opponentstack):deplete:1 opponent])) forever
auto=choice name(you) transforms((,newability[foreach(*|mygraveyard) 1/1],newability[@movedTo(*|mystack):deplete:1 controller])) forever
auto=choice name(opponent) transforms((,newability[type:*:opponentgraveyard/type:*:opponentgraveyard cdaactive],newability[@movedTo(*|opponentstack):deplete:1 opponent])) forever
auto=choice name(you) transforms((,newability[type:*:mygraveyard/type:*:mygraveyard cdaactive],newability[@movedTo(*|mystack):deplete:1 controller])) forever
text=As Sewer Nemesis enters the battlefield, choose a player. -- Sewer Nemesis's power and toughness are each equal to the number of cards in the chosen player's graveyard. -- Whenever the chosen player casts a spell, that player puts the top card of his or her library into his or her graveyard.
mana={3}{B}
type=Creature
@@ -87377,7 +87368,7 @@ toughness=5
[/card]
[card]
name=Sima Yi, Wei Field Marshal
auto=foreach(swamp|myBattlefield) 1/0
auto=type:swamp:myBattlefield/4 cdaactive
text=Sima Yi, Wei Field Marshal's power is equal to the number of Swamps you control.
mana={5}{B}
type=Legendary Creature
@@ -88830,7 +88821,7 @@ toughness=3
[card]
name=Skyshroud War Beast
abilities=trample
auto=foreach(land[-basic]|opponentBattlefield) 1/1
auto=type:land[-basic]:opponentBattlefield/type:land[-basic]:opponentBattlefield cdaactive
text=Trample -- As Skyshroud War Beast enters the battlefield, choose an opponent. -- Skyshroud War Beast's power and toughness are each equal to the number of nonbasic lands the chosen player controls.
mana={1}{G}
type=Creature
@@ -88904,7 +88895,7 @@ toughness=3
[/card]
[card]
name=Slag Fiend
auto=foreach(artifact|graveyard) 1/1
auto=type:artifact:graveyard/type:artifact:graveyard cdaactive
text=Slag Fiend's power and toughness are each equal to the number of artifact cards in all graveyards.
mana={R}
type=Creature
@@ -90401,7 +90392,7 @@ toughness=1
[card]
name=Soramaro, First to Dream
abilities=flying
auto=foreach(*|myhand) 1/1
auto=type:*:myhand/type:*:myhand cdaactive
auto={4}{H(land|myBattlefield)}:draw:1
text=Flying -- Soramaro, First to Dream's power and toughness are each equal to the number of cards in your hand. -- {4}, Return a land you control to its owner's hand: Draw a card.
mana={4}{U}{U}
@@ -90917,8 +90908,7 @@ toughness=2
[/card]
[card]
name=Soulless One
auto=foreach(zombie|graveyard) 1/1
auto=foreach(zombie) 1/1
auto=pgbzombie/pgbzombie cdaactive
text=Soulless One's power and toughness are each equal to the number of Zombies on the battlefield plus the number of Zombie cards in all graveyards.
mana={3}{B}
type=Creature
@@ -90975,7 +90965,7 @@ type=Instant
[card]
name=Soulsurge Elemental
abilities=first strike
auto=foreach(creature|myBattlefield) 1/0
auto=type:creature:myBattlefield/1 cdaactive
text=First strike -- Soulsurge Elemental's power is equal to the number of creatures you control.
mana={3}{R}
type=Creature
@@ -91505,8 +91495,7 @@ toughness=1
[card]
name=Spellheart Chimera
abilities=flying,trample
auto=type:*[instant]:mygraveyard/0 nonstatic
auto=type:*[sorcery]:mygraveyard/0 nonstatic
auto=pginstantsorcery/3 cdaactive
text=Flying. -- Trample. -- Spellheart Chimera's power is equal to the number of instant and sorcery cards in your graveyard.
mana={1}{U}{R}
type=Creature
@@ -92493,7 +92482,7 @@ color=green
[card]
name=Splinterfright
abilities=trample
auto=foreach(creature|mygraveyard) 1/1
auto=type:creature:mygraveyard/type:creature:mygraveyard cdaactive
auto=@each my upkeep:deplete:2 controller
text=Trample -- Splinterfright's power and toughness are each equal to the number of creature cards in your graveyard -- At the beginning of your upkeep, put the top two cards of your library into your graveyard.
mana={2}{G}
@@ -92896,7 +92885,7 @@ type=Enchantment
[/card]
[card]
name=Squelching Leeches
auto=foreach(swamp|myBattlefield) 1/1
auto=type:swamp:myBattlefield/type:swamp:myBattlefield cdaactive
text=Squelching Leeches's power and toughness are each equal to the number of Swamps you control.
mana={2}{B}{B}
type=Creature
@@ -95055,7 +95044,7 @@ toughness=6
[card]
name=Sturmgeist
abilities=flying
auto=foreach(*|myhand) 1/1
auto=type:*:myhand/type:*:myhand cdaactive
auto=@combatdamaged(player) from(this):draw:1 controller
text=Flying -- Sturmgeist's power and toughness are each equal to the number of cards in your hand. -- Whenever Sturmgeist deals combat damage to a player, draw a card.
mana={3}{U}{U}
@@ -96171,7 +96160,7 @@ toughness=0
[/card]
[card]
name=Swarm of Rats
auto=foreach(rat|myBattlefield) 1/0
auto=type:rat:mybattlefield/1 cdaactive
text=Swarm of Rats's power is equal to the number of Rats you control.
mana={1}{B}
type=Creature
@@ -96638,7 +96627,7 @@ type=Sorcery
[/card]
[card]
name=Sylvan Yeti
auto=foreach(*|myhand) 1/0
auto=type:*:myhand/4 cdaactive
text=Sylvan Yeti's power is equal to the number of cards in your hand.
mana={2}{G}{G}
type=Creature
@@ -97487,14 +97476,7 @@ toughness=7
[/card]
[card]
name=Tarmogoyf
auto=aslongas(artifact|graveyard) 1/1
auto=aslongas(creature|graveyard) 1/1
auto=aslongas(enchantment|graveyard) 1/1
auto=aslongas(instant|graveyard) 1/1
auto=aslongas(land|graveyard) 1/1
auto=aslongas(sorcery|graveyard) 1/1
auto=aslongas(tribal|graveyard) 1/1
auto=aslongas(planeswalker|graveyard) 1/1
auto=gravecardtypes/plusonegravecardtypes cdaactive
text=Tarmogoyf's power is equal to the number of card types among cards in all graveyards and its toughness is equal to that number plus 1. (The card types are artifact, creature, enchantment, instant, land, planeswalker, sorcery, and tribal.)
mana={1}{G}
type=Creature
@@ -98526,7 +98508,7 @@ type=Artifact
[card]
name=Terravore
abilities=trample
auto=foreach(land|graveyard) 1/1
auto=type:land:graveyard/type:land:graveyard cdaactive
text=Trample -- Terravore's power and toughness are each equal to the number of land cards in all graveyards.
mana={1}{G}{G}
type=Creature
@@ -100376,8 +100358,8 @@ toughness=5
[/card]
[card]
name=Tidewalker
auto=foreach(island|myBattlefield) counter(0/0,1,Time)
auto=thisforeach(counter{0/0.1.Time}) 1/1
auto=foreach(island|myBattlefield) counter(0/0,1,Time) oneshot
auto=counter{0%0.1.Time}/counter{0%0.1.Time} cdaactive
auto=vanishing:0
text=Tidewalker enters the battlefield with a time counter on it for each Island you control. -- Vanishing (At the beginning of your upkeep, remove a time counter from this permanent. When the last is removed, sacrifice it.) -- Tidewalker's power and toughness are each equal to the number of time counters on it.
mana={2}{U}
@@ -103523,7 +103505,7 @@ toughness=2
[/card]
[card]
name=Uktabi Wildcats
auto=foreach(forest|myBattlefield) 1/1
auto=type:forest:mybattlefield/type:forest:mybattlefield cdaactive
auto={G}{S(forest|myBattlefield)}:regenerate
text=Uktabi Wildcats's power and toughness are each equal to the number of Forests you control. -- {G}, Sacrifice a Forest: Regenerate Uktabi Wildcats.
mana={4}{G}
@@ -103568,16 +103550,16 @@ toughness=8
[/card]
[card]
name=Ulasht, the Hate Seed
auto=foreach(other creature[red]|myBattlefield) counter(1/1,1)
auto=foreach(other creature[green]|myBattlefield) counter(1/1,1)
auto=foreach(other creature[red]|myBattlefield) counter(1/1,1) oneshot
auto=foreach(other creature[green]|myBattlefield) counter(1/1,1) oneshot
auto={1}{C(1/1,-1)}:damage:1 target(creature)
auto={1}{C(1/1,-1)}:token(Saproling,Creature Saproling,1/1,green)
text=Ulasht, the Hate Seed enters the battlefield with a +1/+1 counter on it for each other red creature you control and a +1/+1 counter on it for each other green creature you control. -- {1}, Remove a +1/+1 counter from Ulasht: Choose one - Ulasht deals 1 damage to target creature; or put a 1/1 green Saproling creature token onto the battlefield.
mana={2}{R}{G}
type=Legendary Creature
subtype=Hellion Hydra
power=*
toughness=*
power=0
toughness=0
[/card]
[card]
name=Ultimate Price
@@ -103652,7 +103634,7 @@ type=Artifact
[/card]
[card]
name=Umbra Stalker
auto=thisforeach(variable{type:manab:mygraveyard}>0) 1/1
auto=type:manab:mygraveyard/type:manab:mygraveyard cdaactive
text=Chroma - Umbra Stalker's power and toughness are each equal to the number of black mana symbols in the mana costs of cards in your graveyard.
mana={4}{B}{B}{B}
type=Creature
@@ -107469,7 +107451,7 @@ toughness=2
name=Elemental
type=Creature
subtype=Elemental
auto=foreach(creature|mybattlefield) 1/1
auto=type:creature:mybattlefield/type:creature:mybattlefield cdaactive
text=This creature's power and toughness are each equal to the number of creature cards in its controller's battlefield.
power=*
toughness=*
@@ -109673,7 +109655,7 @@ toughness=3
[/card]
[card]
name=Wayfaring Temple
auto=foreach(creature|mybattlefield) 1/1
auto=type:creature:mybattlefield/type:creature:mybattlefield cdaactive
auto=@combatdamaged(player) from(this) restriction{type(creature[token]|mybattlefield)~morethan~0}:name(populate) clone notatarget(creature[token]|mybattlefield)
text=Wayfaring Temple's power and toughness are each equal to the number of creatures you control. -- Whenever Wayfaring Temple deals combat damage to a player, populate. (Put a token onto the battlefield that's a copy of a creature token you control.)
mana={1}{G}{W}
@@ -110723,7 +110705,7 @@ toughness=4
[card]
name=Wilderness Elemental
abilities=trample
auto=foreach(land[-basic]|opponentBattlefield) 1/0
auto=type:land[-basic]:opponentbattlefield/3 cdaactive
text=Trample -- Wilderness Elemental's power is equal to the number of nonbasic lands your opponents control.
mana={1}{R}{G}
type=Creature
@@ -112782,8 +112764,7 @@ type=Legendary Land
[/card]
[card]
name=Yavimaya Kavu
auto=foreach(creature[red]|battlefield) 1/0
auto=foreach(creature[green]|battlefield) 0/1
auto=type:creature[red]:battlefield/type:creature[green]:battlefield cdaactive
text=Yavimaya Kavu's power is equal to the number of red creatures on the battlefield. -- Yavimaya Kavu's toughness is equal to the number of green creatures on the battlefield.
mana={2}{R}{G}
type=Creature

View File

@@ -0,0 +1,46 @@
#Testing CDA Tarmogoyf vs Godhead of Awe
#Godhead of Awe makes other creatures 1/1 on layer 7b
#Tarmogoyf's CDA ability is on layer 7a so it will be overriden
#by Godhead of Awe. Giant Growth's ability is on layer 7c so
#the +3/+3 bonus is intact. :)
[INIT]
FIRSTMAIN
[PLAYER1]
inplay:Concordant Crossroads, Godhead of Awe, Forest
hand:Tarmogoyf, Giant Growth
graveyard:mountain, lightning bolt, grizzly bear
manapool:{1}{G}
[PLAYER2]
[DO]
Tarmogoyf
next
next
Tarmogoyf
next
eot
eot
#untap
next
#upkeep
next
#draw
next
#main1
Forest
Giant Growth
Tarmogoyf
next
#combat begin
next
#attackers
Tarmogoyf
eot
[ASSERT]
UNTAP
[PLAYER1]
inplay:Concordant Crossroads, Godhead of Awe, Tarmogoyf, Forest
graveyard:mountain, lightning bolt, grizzly bear, Giant Growth
manapool:{0}
[PLAYER2]
life:15
[END]

View File

@@ -0,0 +1,38 @@
#Testing CDA Turn to Frog vs Krosan Cloudscraper
#Krosan Cloudscraper that is turned into frog with 1 damage
#from Lightning Dart must die because when you change
#the power and toughness into 1/1, the 1 point of damage
#is taken into account...
[INIT]
FIRSTMAIN
[PLAYER1]
inplay:Krosan Cloudscraper
[PLAYER2]
inplay:Mountain, Plains, Swamp, Island
hand:Lightning Dart, Turn to Frog
[DO]
next
next
Krosan Cloudscraper
next
no
yes
Mountain
Plains
Lightning Dart
Krosan Cloudscraper
Swamp
Island
Turn to Frog
Krosan Cloudscraper
endinterruption
eot
[ASSERT]
UNTAP
[PLAYER1]
graveyard:Krosan Cloudscraper
[PLAYER2]
inplay:Mountain, Plains, Swamp, Island
graveyard:Lightning Dart, Turn to Frog
life:20
[END]

View File

@@ -210,6 +210,8 @@ Call_to_Heel_1.txt
Call_to_Heel_2.txt
castle.txt
cathodion.txt
CDA#1.txt
CDA#2.txt
celestial_mantle.txt
celestial_purge.txt
celestial_sword.txt

View File

@@ -68,6 +68,7 @@ private:
bool plusone = false;
bool plustwo = false;
bool plusthree = false;
bool other = false;//othertype:[subtype]
if (!target) target = card;
int multiplier = 1;
if (s[0] == '-')
@@ -134,6 +135,12 @@ private:
size_t pThree = s.find("plusthree");
s.erase(pThree,pThree + 9);
}
if(s.find("othertype") != string::npos)
{
other = true;
size_t oth = s.find("othertype");
s.erase(oth,oth + 5);
}
if(s == "prex")
{
ManaCost * cX = card->controller()->getManaPool()->Diff(card->getManaCost());
@@ -170,7 +177,10 @@ private:
}
else if (s == "manacost")
{
intValue = target->getManaCost()->getConvertedCost();
if (target->currentZone == target->controller()->game->stack)//X is 0 except if it's on the stack
intValue = target->getManaCost()->getConvertedCost() + target->castX;
else
intValue = target->getManaCost()->getConvertedCost();
}
else if (s == "azorius")//devotion blue white
{
@@ -392,6 +402,7 @@ private:
}
TargetChooserFactory tf(card->getObserver());
TargetChooser * tc = tf.createTargetChooser(theType.c_str(),NULL);
tc->other = other;
for (int i = 0; i < 2; i++)
{
Player * p = card->getObserver()->players[i];
@@ -639,6 +650,136 @@ private:
{
intValue = target->controller()->opponent()->game->hand->nb_cards;
}
else if (s == "pancientooze")//Ancient Ooze
{
intValue = 0;
for (int j = card->controller()->game->inPlay->nb_cards - 1; j >= 0; --j)
{
if (card->controller()->game->inPlay->cards[j]->hasType(Subtypes::TYPE_CREATURE) && card->controller()->game->inPlay->cards[j] != card)
{
intValue += card->controller()->game->inPlay->cards[j]->getManaCost()->getConvertedCost();
}
}
}
else if (s == "pdauntless")//Dauntless Dourbark
{
intValue = 0;
for (int j = card->controller()->game->battlefield->nb_cards - 1; j >= 0; --j)
{
if (card->controller()->game->battlefield->cards[j]->hasType("forest"))
{
intValue += 1;
}
if (card->controller()->game->battlefield->cards[j]->hasType("treefolk"))
{
intValue += 1;
}
}
}
else if (s == "pbasiclandtypes")//Basic Land types
{
intValue = 0;
int forest, plains, swamp, island, mountain = 0;
for (int j = card->controller()->game->battlefield->nb_cards - 1; j >= 0; --j)
{
if (card->controller()->game->battlefield->cards[j]->hasType("forest"))
{
forest = 1;
}
if (card->controller()->game->battlefield->cards[j]->hasType("plains"))
{
plains = 1;
}
if (card->controller()->game->battlefield->cards[j]->hasType("swamp"))
{
swamp = 1;
}
if (card->controller()->game->battlefield->cards[j]->hasType("island"))
{
island = 1;
}
if (card->controller()->game->battlefield->cards[j]->hasType("mountain"))
{
mountain = 1;
}
}
intValue = mountain + island + forest + swamp + plains;
}
else if (s == "myname")//Plague Rats and others
{
intValue = 0;
for (int i = 0; i < 2; i++)
{
Player * p = card->getObserver()->players[i];
for (int j = p->game->battlefield->nb_cards - 1; j >= 0; --j)
{
if (p->game->battlefield->cards[j]->name == card->name)
{
intValue += 1;
}
}
}
}
else if (s == "pgbzombie")//Soulless One
{
intValue = 0;
for (int i = 0; i < 2; i++)
{
Player * p = card->getObserver()->players[i];
for (int j = p->game->graveyard->nb_cards - 1; j >= 0; --j)
{
if (p->game->graveyard->cards[j]->hasType("zombie"))
{
intValue += 1;
}
}
for (int j = p->game->inPlay->nb_cards - 1; j >= 0; --j)
{
if (p->game->inPlay->cards[j]->hasType("zombie"))
{
intValue += 1;
}
}
}
}
else if (s == "pginstantsorcery")//Spellheart Chimera
{
intValue = 0;
for (int j = card->controller()->game->graveyard->nb_cards - 1; j >= 0; --j)
{
if (card->controller()->game->graveyard->cards[j]->hasType(Subtypes::TYPE_INSTANT)
||card->controller()->game->graveyard->cards[j]->hasType(Subtypes::TYPE_SORCERY))
{
intValue += 1;
}
}
}
else if (s == "gravecardtypes")//Tarmogoyf
{
intValue = 0;
int art, cre, enc, ins, lnd, sor, trb, pwk = 0;
for (int i = 0; i < 2; i++)
{
Player * p = card->getObserver()->players[i];
if(p->game->graveyard->hasType("planeswalker"))
pwk = 1;
if(p->game->graveyard->hasType("tribal"))
trb = 1;
if(p->game->graveyard->hasType("sorcery"))
sor = 1;
if(p->game->graveyard->hasType("land"))
lnd = 1;
if(p->game->graveyard->hasType("instant"))
ins = 1;
if(p->game->graveyard->hasType("enchantment"))
enc = 1;
if(p->game->graveyard->hasType("creature"))
cre = 1;
if(p->game->graveyard->hasType("artifact"))
art = 1;
}
intValue = art + cre + enc + ins + lnd + sor + trb + pwk;
}
else if (s == "morethanfourcards")
{
if(card->playerTarget)
@@ -2250,53 +2391,92 @@ public:
WParsedPT * wppt;
string PT;
bool nonstatic;
bool cda;
APowerToughnessModifier(GameObserver* observer, int id, MTGCardInstance * _source, MTGCardInstance * _target, WParsedPT * wppt,string PT,bool nonstatic) :
MTGAbility(observer, id, _source, _target), wppt(wppt),PT(PT),nonstatic(nonstatic)
{
aType = MTGAbility::STANDARD_PUMP;
cda = PT.find("cdaactive") != string::npos;
}
void Update(float)
string ReplaceString(string subject, const string& search, const string& replace)
{
size_t pos = 0;
while ((pos = subject.find(search, pos)) != string::npos)
{
if(!nonstatic)
return;
((MTGCardInstance *) target)->pbonus -= wppt->power.getValue();
((MTGCardInstance *) target)->tbonus -= wppt->toughness.getValue();
((MTGCardInstance *) target)->applyPTL();
if(PT.size())
{
SAFE_DELETE(wppt);
wppt = NEW WParsedPT(PT,NULL,(MTGCardInstance *) source);
}
MTGCardInstance * _target = (MTGCardInstance *) target;
_target->pbonus += wppt->power.getValue();
_target->tbonus += wppt->toughness.getValue();
_target->applyPTL();
subject.replace(pos, search.length(), replace);
pos += replace.length();
}
return subject;
}
void Update(float)
{
if(!nonstatic)
return;
if(!cda || (cda && (((MTGCardInstance *) target)->isSettingBase < 1)))
{
((MTGCardInstance *) target)->power -= wppt->power.getValue();
((MTGCardInstance *) target)->addToToughness(-wppt->toughness.getValue());
if(PT.size())
{
SAFE_DELETE(wppt);
if(cda)
wppt = NEW WParsedPT(ReplaceString(PT, " cdaactive", ""),NULL,(MTGCardInstance *) source);
else
wppt = NEW WParsedPT(ReplaceString(PT, " nonstatic", ""),NULL,(MTGCardInstance *) source);
}
MTGCardInstance * _target = (MTGCardInstance *) target;
_target->power += wppt->power.getValue();
_target->addToToughness(wppt->toughness.getValue());
}
if(cda)
{//update but not apply
if(PT.size())
{
SAFE_DELETE(wppt);
if(cda)
wppt = NEW WParsedPT(ReplaceString(PT, " cdaactive", ""),NULL,(MTGCardInstance *) source);
else
wppt = NEW WParsedPT(ReplaceString(PT, " nonstatic", ""),NULL,(MTGCardInstance *) source);
}
((MTGCardInstance *) target)->origpower = wppt->power.getValue();
((MTGCardInstance *) target)->origtoughness = (wppt->toughness.getValue() + ((MTGCardInstance *) target)->life)-((MTGCardInstance *) target)->life;//what?
}
}
int addToGame()
{
MTGCardInstance * _target = (MTGCardInstance *) target;
if(PT.size())
{
SAFE_DELETE(wppt);
wppt = NEW WParsedPT(PT,NULL,(MTGCardInstance *) source);
if(cda)
wppt = NEW WParsedPT(ReplaceString(PT, " cdaactive", ""),NULL,(MTGCardInstance *) source);
else
wppt = NEW WParsedPT(ReplaceString(PT, " nonstatic", ""),NULL,(MTGCardInstance *) source);
}
if(cda)
{//Characteristic-defining abilities
_target->cdaPT(wppt->power.getValue(),wppt->toughness.getValue());
}
else
{
_target->addptbonus(wppt->power.getValue(),wppt->toughness.getValue());
}
_target->pbonus += wppt->power.getValue();
_target->tbonus += wppt->toughness.getValue();
_target->applyPTL();
if(_target->has(Constants::INDESTRUCTIBLE) && wppt->toughness.getValue() < 0 && _target->toughness <= 0)
{
_target->controller()->game->putInGraveyard(_target);
}
return MTGAbility::addToGame();
}
int destroy()
{
((MTGCardInstance *) target)->pbonus -= wppt->power.getValue();
((MTGCardInstance *) target)->tbonus -= wppt->toughness.getValue();
((MTGCardInstance *) target)->applyPTL();
if(cda)
{
/*??Do Nothing??*/;
}
else
{
((MTGCardInstance *) target)->removeptbonus(wppt->power.getValue(),wppt->toughness.getValue());
}
return 1;
}
const string getMenuText()
@@ -2304,7 +2484,10 @@ public:
if(PT.size())
{
SAFE_DELETE(wppt);
wppt = NEW WParsedPT(PT,NULL,(MTGCardInstance *) source);
if(cda)
wppt = NEW WParsedPT(ReplaceString(PT, " cdaactive", ""),NULL,(MTGCardInstance *) source);
else
wppt = NEW WParsedPT(ReplaceString(PT, " nonstatic", ""),NULL,(MTGCardInstance *) source);
}
sprintf(menuText, "%i/%i", wppt->power.getValue(), wppt->toughness.getValue());
return menuText;
@@ -2315,12 +2498,10 @@ public:
a->wppt = NEW WParsedPT(*(a->wppt));
return a;
}
~APowerToughnessModifier()
{
delete (wppt);
}
};
class GenericInstantAbility: public InstantAbility, public NestedAbility
@@ -4031,6 +4212,8 @@ string menu;
class ASwapPT: public InstantAbility
{
public:
int oldP;
int oldT;
ASwapPT(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target) :
InstantAbility(observer, _id, _source, _target)
{
@@ -4045,12 +4228,11 @@ public:
while (_target->next)
_target = _target->next; //This is for cards such as rampant growth
if(_target->isPTswitch)
_target->isPTswitch = false;
else
_target->isPTswitch = true;
_target->applyPTL();
oldP = _target->power;
oldT = _target->toughness;
_target->addToToughness(oldP);
_target->addToToughness(-oldT);
_target->setPower(oldT);
}
return 1;
}
@@ -4063,9 +4245,11 @@ public:
while (_target->next)
_target = _target->next; //This is for cards such as rampant growth
_target->isPTswitch = false;
_target->applyPTL();
oldP = _target->power;
oldT = _target->toughness;
_target->addToToughness(oldP);
_target->addToToughness(-oldT);
_target->setPower(oldT);
}
return 1;
@@ -5647,17 +5831,13 @@ public:
{
nbOpponents = source->blockers.size();
if (nbOpponents <= MaxOpponent) return 0;
source->pbonus += PowerModifier * (nbOpponents - MaxOpponent);
source->tbonus += ToughnessModifier * (nbOpponents - MaxOpponent);
source->applyPTL();
source->addptbonus(PowerModifier * (nbOpponents - MaxOpponent),ToughnessModifier * (nbOpponents - MaxOpponent));
}
else if (WEventPhaseChange* pe = dynamic_cast<WEventPhaseChange*>(event))
{
if (MTG_PHASE_AFTER_EOT == pe->to->id && nbOpponents > MaxOpponent)
{
source->pbonus -= PowerModifier * (nbOpponents - MaxOpponent);
source->tbonus -= ToughnessModifier * (nbOpponents - MaxOpponent);
source->applyPTL();
source->removeptbonus(PowerModifier * (nbOpponents - MaxOpponent),ToughnessModifier * (nbOpponents - MaxOpponent));
nbOpponents = 0;
}
}

View File

@@ -186,11 +186,7 @@ public:
int addToToughness(int value);
int setToughness(int value);
bool isSettingBase;
bool isPTswitch;
int oldP;
int oldT;
void applyPTL();
int isSettingBase;
vector<TargetChooser *>protections;
int addProtection(TargetChooser * tc);
@@ -224,6 +220,21 @@ public:
void tap();
void attemptUntap();
//cda and other func
void stripPTbonus();
void minusPTbonus(int p = 0, int t = 0);
void plusPTbonus(int p = 0, int t = 0);
void applyPTbonus();
void addcounter(int p = 0, int t = 0);
void removecounter(int p = 0, int t = 0);
void addptbonus(int p = 0, int t = 0);
void removeptbonus(int p = 0, int t = 0);
void addbaseP(int p = 0);
void addbaseT(int t = 0);
void revertbaseP();
void revertbaseT();
void cdaPT(int p = 0, int t = 0);
void eventattacked();
void eventattackedAlone();
void eventattackednotblocked();

View File

@@ -12,8 +12,8 @@ Author: Michael Nguyen
/* Wagic versions */
#define WAGIC_VERSION_MAJOR 0
#define WAGIC_VERSION_MEDIUM 19
#define WAGIC_VERSION_MINOR 2
#define WAGIC_VERSION_MEDIUM 20
#define WAGIC_VERSION_MINOR 1
#define VERSION_DOT(a, b, c) a ##.## b ##.## c
#define VERSION_WITHOUT_DOT(a, b, c) a ## b ## c

View File

@@ -2536,12 +2536,13 @@ int AACloner::resolve()
spell->source->fresh = 1;
spell->source->model = spell->source;
spell->source->model->data = spell->source;
if(_target->isToken)
//commenting this out fixes some problems when duplicating tokens 9/16/2015
/*if(_target->isToken)
{
spell->source->power = _target->origpower;
spell->source->toughness = _target->origtoughness;
spell->source->life = _target->origtoughness;
}
}*/
list<int>::iterator it;
for (it = awith.begin(); it != awith.end(); it++)
{
@@ -4180,20 +4181,20 @@ for (it = types.begin(); it != types.end(); it++)
}
}
}
if(newpowerfound || newtoughnessfound)
_target->isSettingBase += 1;
if(newpowerfound )
{//setting p/t only overrides base p/t as of M15 changes
{
WParsedInt * val = NEW WParsedInt(newpower,NULL, source);
_target->basepower = val->getValue();
_target->isSettingBase = true;
_target->applyPTL();
_target->addbaseP(val->getValue());
delete val;
}
if(newtoughnessfound )
{//setting p/t only overrides base p/t as of M15 changes
{//we should consider the damage if there is, if you have a 5/5 creature with 1 damage,
//and you turn it into 1/1, the 1 damage is still there and the creature must die...
//the toughness is intact but what we see in the game is the life...
WParsedInt * val = NEW WParsedInt(newtoughness,NULL, source);
_target->basetoughness = val->getValue();
_target->isSettingBase = true;
_target->applyPTL();
_target->addbaseT(val->getValue());
delete val;
}
@@ -4277,18 +4278,17 @@ int ATransformer::destroy()
{
_target->setColor(*it);
}
if(newpowerfound || newtoughnessfound)
_target->isSettingBase -= 1;
if(newpowerfound )
{//override since we changed tha base, the bonus must have changed
_target->isSettingBase = false;
_target->basepower = _target->origpower;
_target->applyPTL();
{
_target->revertbaseP();
}
if(newtoughnessfound )
{
_target->isSettingBase = false;
_target->basetoughness = _target->origtoughness;
_target->applyPTL();
_target->revertbaseT();
}
if(newAbilityFound)
{

View File

@@ -56,9 +56,7 @@ int Counter::added()
{
if (power != 0 || toughness != 0)
{
target->pbonus += power;
target->tbonus += toughness;
target->applyPTL();
target->addcounter(power, toughness);
}
return 1;
}
@@ -67,9 +65,7 @@ int Counter::removed()
{
if (power != 0 || toughness != 0)
{
target->pbonus -= power;
target->tbonus -= toughness;
target->applyPTL();
target->removecounter(power, toughness);
}
return 1;
}

View File

@@ -2629,7 +2629,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
int MaxOpponent = atoi(rampageParameters[1].c_str());
return NEW ARampageAbility(observer, id, card, power, toughness, MaxOpponent);
}
//evole
if (s.find("evolve") != string::npos)
{
@@ -2924,7 +2924,12 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
{
return NEW PTInstant(observer, id, card, target, wppt,s,nonstatic);
}
return NEW APowerToughnessModifier(observer, id, card, target, wppt,s,nonstatic);
else if(s.find("cdaactive") != string::npos)
{
return NEW APowerToughnessModifier(observer, id, card, target, wppt,s,true);
}
else
return NEW APowerToughnessModifier(observer, id, card, target, wppt,s,nonstatic);
}
return NEW PTInstant(observer, id, card, target, wppt,s,nonstatic);
}
@@ -3597,9 +3602,9 @@ int AbilityFactory::getAbilities(vector<MTGAbility *> * v, Spell * spell, MTGCar
if(card->previous && card->previous->morphed && !card->turningOver)
{
magicText = card->magicTexts["facedown"];
card->basepower = 2;
card->power = 2;
card->life = 2;
card->basetoughness = 2;
card->toughness = 2;
card->setColor(0,1);
card->name = "Morph";
card->types.clear();
@@ -3607,17 +3612,12 @@ int AbilityFactory::getAbilities(vector<MTGAbility *> * v, Spell * spell, MTGCar
card->setType(cre.c_str());
card->basicAbilities.reset();
card->getManaCost()->resetCosts();
card->isSettingBase = true;
card->applyPTL();
}
else if(card && !card->morphed && card->turningOver)
{
card->isSettingBase = false;
card->power = card->origpower;
card->basepower = card->origpower;
card->life = card->origtoughness;
card->toughness = card->origtoughness;
card->basetoughness = card->origtoughness;
card->power += card->origpower-2;
card->life += card->origtoughness-2;
card->toughness += card->origtoughness-2;
card->setColor(0,1);
card->name = card->model->data->name;
card->types = card->model->data->types;
@@ -3631,7 +3631,6 @@ int AbilityFactory::getAbilities(vector<MTGAbility *> * v, Spell * spell, MTGCar
string faceupC= card->magicTexts["faceup"];
magicText.append("\n");
magicText.append(faceupC);
card->applyPTL();
}
else if(card && card->hasType(Subtypes::TYPE_EQUIPMENT) && card->target)

View File

@@ -53,8 +53,7 @@ MTGCardInstance::MTGCardInstance(MTGCard * card, MTGPlayerCards * arg_belongs_to
thatmuch = 0;
flanked = 0;
castMethod = Constants::NOT_CAST;
isSettingBase = false;
isPTswitch = false;
isSettingBase = 0;
}
MTGCardInstance * MTGCardInstance::createSnapShot()
@@ -66,34 +65,6 @@ MTGCardInstance::MTGCardInstance(MTGCard * card, MTGPlayerCards * arg_belongs_to
return snapShot;
}
void MTGCardInstance::applyPTL()
{
//7a ??how to add cda(Characteristic Defining Ability)??
power = origpower;
toughness = origtoughness;
//7b
if (isSettingBase)
{
power = basepower;
toughness = basetoughness;
}
//7c - 7d shared?
power += pbonus;
toughness += tbonus;
life = toughness;
//7e switch is last
if (isPTswitch)
{
oldP = power;
oldT = toughness;
this->addToToughness(oldP);
this->addToToughness(-oldT);
this->power = oldT;
}
/* end */
doDamageTest = 1;
}
void MTGCardInstance::copy(MTGCardInstance * card)
{
MTGCard * source = card->model;
@@ -628,6 +599,101 @@ int MTGCardInstance::setToughness(int value)
return 1;
}
void MTGCardInstance::stripPTbonus()
{
power -= pbonus;
addToToughness(-tbonus);
}
void MTGCardInstance::plusPTbonus(int p, int t)
{
pbonus += p;
tbonus += t;
}
void MTGCardInstance::minusPTbonus(int p, int t)
{
pbonus -= p;
tbonus -= t;
}
void MTGCardInstance::applyPTbonus()
{
power += pbonus;
addToToughness(tbonus);
}
void MTGCardInstance::addcounter(int p, int t)
{
stripPTbonus();
plusPTbonus(p,t);
applyPTbonus();
}
void MTGCardInstance::addptbonus(int p, int t)
{
stripPTbonus();
plusPTbonus(p,t);
applyPTbonus();
}
void MTGCardInstance::removecounter(int p, int t)
{
stripPTbonus();
minusPTbonus(p,t);
applyPTbonus();
}
void MTGCardInstance::removeptbonus(int p, int t)
{
stripPTbonus();
minusPTbonus(p,t);
applyPTbonus();
}
void MTGCardInstance::addbaseP(int p)
{
basepower = p;
power -= pbonus;
power = p;
power += pbonus;
}
void MTGCardInstance::addbaseT(int t)
{
basetoughness = t;
addToToughness(-tbonus);
addToToughness(t - toughness);
addToToughness(tbonus);
}
void MTGCardInstance::revertbaseP()
{
power -= pbonus;
power += origpower;
power -= basepower;
power += pbonus;
basepower = origpower;
}
void MTGCardInstance::revertbaseT()
{
addToToughness(-tbonus);
addToToughness(origtoughness);
addToToughness(-basetoughness);
addToToughness(tbonus);
basetoughness = origtoughness;
}
void MTGCardInstance::cdaPT(int p, int t)
{
origpower = p;
origtoughness = t;
setPower(p);
setToughness(t);
applyPTbonus();
}
int MTGCardInstance::canBlock()
{
if (tapped)

View File

@@ -13,6 +13,8 @@ Token::Token(string _name, MTGCardInstance * source, int _power, int _toughness)
lifeOrig = life;
origpower = _power;
origtoughness = _toughness;
basepower = power;
basetoughness = toughness;
rarity = Constants::RARITY_T;
name = _name;
if (name.size() && name[0] >= 97 && name[0] <= 122) name[0] -= 32; //Poor man's camelcase. We assume strings we get are either Camelcased or lowercase
@@ -25,6 +27,9 @@ Token::Token(string _name, MTGCardInstance * source, int _power, int _toughness)
attacker = 0;
defenser = NULL;
banding = NULL;
pbonus = 0;
tbonus = 0;
isSettingBase = 0;
}
Token::Token(int id) :
@@ -45,7 +50,11 @@ Token::Token(const Token& source) :
life = source.life;
lifeOrig = source.life;
origpower = source.origpower;
origtoughness = source.origpower;
origtoughness = source.origtoughness;
basepower = source.origpower;
basetoughness = source.origtoughness;
pbonus = source.pbonus;
tbonus = source.tbonus;
rarity = source.rarity;
name = source.name;
setId = source.setId;
@@ -56,6 +65,7 @@ Token::Token(const Token& source) :
attacker = source.attacker;
defenser = source.defenser;
banding = source.banding;
isSettingBase = source.isSettingBase;
}