From 36d4db49ca175ec59858ef7194a9f43632f19e72 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Sat, 11 Feb 2017 00:04:17 +0800 Subject: [PATCH 01/26] bug fix --- projects/mtg/bin/Res/sets/primitives/mtg.txt | 48 ++++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index ade9d98f5..bd0f7dd1d 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -1549,7 +1549,7 @@ toughness=7 [card] name=Aetherworks Marvel auto=@movedto(graveyard) from(*|myBattlefield):alterenergy:1 controller -autohand={t}{e:6}:reveal:6 optionone name(Cast Card) target(<1>*[-land]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) )! optiononeend optiontwo name(bottom of library) target(<1>*|reveal) transforms((,newability[all(*|reveal) bottomoflibrary])) oneshot optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!( activate castcard(normal) )! afterrevealedend revealend +autohand={t}{e:6}:reveal:6 optionone name(Cast Card) target(<1>*[-land]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(bottom of library) target(<1>*|reveal) transforms((,newability[all(*|reveal) bottomoflibrary])) oneshot optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!( activate castcard(normal) )! afterrevealedend revealend text=Whenever a permanent you control is put into a graveyard, you get {E} (an energy counter). -- {T}, Pay {E}{E}{E}{E}{E}{E}: Look at the top six cards of your library. You may cast a card from among them without paying its mana cost. Put the rest on the bottom of your library in a random order. mana={4} type=Legendary Artifact @@ -18669,7 +18669,7 @@ subtype=Chandra [card] name=Chandra, Torch of Defiance auto=counter(0/0,4,loyalty) -auto={C(0/0,1,Loyalty)}:name(+1: Exile Top Card) reveal:1 optionone target(*|reveal) moveto(exile) and!( becomes(tobecast) )! optiononeend afterrevealed if type(tobecast[-land]|myexile)~morethan~0 then transforms((,newability[choice all(tobecast|myexile) castcard(restricted),newability[choice damage:2 opponent && all(tobecast|myexile) moveto(ownerexile)])) oneshot else choice damage:2 opponent && all(tobecast|myexile) moveto(ownerexile) afterrevealedend revealend +auto={C(0/0,1,Loyalty)}:name(+1: Exile Top Card) reveal:1 optionone target(*|reveal) moveto(exile) and!( becomes(tobecast) ueot )! optiononeend afterrevealed if type(tobecast[-land]|myexile)~morethan~0 then transforms((,newability[choice all(tobecast|myexile) castcard(restricted),newability[choice name(deal 2 damage) damage:2 opponent && all(tobecast|myexile) moveto(ownerexile)])) oneshot else choice name(deal 2 damage) damage:2 opponent && all(tobecast|myexile) moveto(ownerexile) afterrevealedend revealend auto={C(0/0,1,Loyalty)}:name(+1: Add 2 Red Mana) Add{R}{R} auto={C(0/0,-3,Loyalty)}:name(-3: 4 damage to creature) damage:4 target(creature) auto={C(0/0,-7,Loyalty)}:name(-7: Emblem) emblem transforms((,newability[@movedTo(*|mystack):damage:5 target(*[creature;player])])) forever dontremove @@ -91251,27 +91251,27 @@ toughness=3 [/card] [card] name=Rashmi, Eternities Crafter -auto=@movedto(*[-land;manacost=1]|mystack) restriction{thisturn(*|mystack)~lessthan~2}:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<1]|reveal) moveto(myexile) and!( becomes(tobecast) )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend -auto=@movedto(*[-land;manacost=2]|mystack) restriction{thisturn(*|mystack)~lessthan~2}:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<2]|reveal) moveto(myexile) and!( becomes(tobecast) )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend -auto=@movedto(*[-land;manacost=3]|mystack) restriction{thisturn(*|mystack)~lessthan~2}:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<3]|reveal) moveto(myexile) and!( becomes(tobecast) )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend -auto=@movedto(*[-land;manacost=4]|mystack) restriction{thisturn(*|mystack)~lessthan~2}:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<4]|reveal) moveto(myexile) and!( becomes(tobecast) )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend -auto=@movedto(*[-land;manacost=5]|mystack) restriction{thisturn(*|mystack)~lessthan~2}:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<5]|reveal) moveto(myexile) and!( becomes(tobecast) )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend -auto=@movedto(*[-land;manacost=6]|mystack) restriction{thisturn(*|mystack)~lessthan~2}:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<6]|reveal) moveto(myexile) and!( becomes(tobecast) )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend -auto=@movedto(*[-land;manacost=7]|mystack) restriction{thisturn(*|mystack)~lessthan~2}:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<7]|reveal) moveto(myexile) and!( becomes(tobecast) )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend -auto=@movedto(*[-land;manacost=8]|mystack) restriction{thisturn(*|mystack)~lessthan~2}:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<8]|reveal) moveto(myexile) and!( becomes(tobecast) )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend -auto=@movedto(*[-land;manacost=9]|mystack) restriction{thisturn(*|mystack)~lessthan~2}:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<9]|reveal) moveto(myexile) and!( becomes(tobecast) )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend -auto=@movedto(*[-land;manacost=10]|mystack) restriction{thisturn(*|mystack)~lessthan~2}:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<10]|reveal) moveto(myexile) and!( becomes(tobecast) )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend -auto=@movedto(*[-land;manacost=11]|mystack) restriction{thisturn(*|mystack)~lessthan~2}:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<11]|reveal) moveto(myexile) and!( becomes(tobecast) )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend -auto=@movedto(*[-land;manacost=12]|mystack) restriction{thisturn(*|mystack)~lessthan~2}:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<12]|reveal) moveto(myexile) and!( becomes(tobecast) )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend -auto=@movedto(*[-land;manacost=13]|mystack) restriction{thisturn(*|mystack)~lessthan~2}:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<13]|reveal) moveto(myexile) and!( becomes(tobecast) )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend -auto=@movedto(*[-land;manacost=14]|mystack) restriction{thisturn(*|mystack)~lessthan~2}:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<14]|reveal) moveto(myexile) and!( becomes(tobecast) )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend -auto=@movedto(*[-land;manacost=15]|mystack) restriction{thisturn(*|mystack)~lessthan~2}:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<15]|reveal) moveto(myexile) and!( becomes(tobecast) )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend -auto=@movedto(*[-land;manacost=16]|mystack) restriction{thisturn(*|mystack)~lessthan~2}:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<16]|reveal) moveto(myexile) and!( becomes(tobecast) )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend -auto=@movedto(*[-land;manacost=17]|mystack) restriction{thisturn(*|mystack)~lessthan~2}:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<17]|reveal) moveto(myexile) and!( becomes(tobecast) )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend -auto=@movedto(*[-land;manacost=18]|mystack) restriction{thisturn(*|mystack)~lessthan~2}:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<18]|reveal) moveto(myexile) and!( becomes(tobecast) )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend -auto=@movedto(*[-land;manacost=19]|mystack) restriction{thisturn(*|mystack)~lessthan~2}:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<19]|reveal) moveto(myexile) and!( becomes(tobecast) )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend -auto=@movedto(*[-land;manacost=20]|mystack) restriction{thisturn(*|mystack)~lessthan~2}:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<20]|reveal) moveto(myexile) and!( becomes(tobecast) )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend -auto=@movedto(*[-land;manacost=21]|mystack) restriction{thisturn(*|mystack)~lessthan~2}:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<21]|reveal) moveto(myexile) and!( becomes(tobecast) )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend +auto=@movedto(*[-land;manacost=1]|mystack) restriction{thisturn(*|mystack)~lessthan~1} turnlimited:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<1]|reveal) moveto(myexile) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend +auto=@movedto(*[-land;manacost=2]|mystack) restriction{thisturn(*|mystack)~lessthan~1} turnlimited:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<2]|reveal) moveto(myexile) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend +auto=@movedto(*[-land;manacost=3]|mystack) restriction{thisturn(*|mystack)~lessthan~1} turnlimited:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<3]|reveal) moveto(myexile) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend +auto=@movedto(*[-land;manacost=4]|mystack) restriction{thisturn(*|mystack)~lessthan~1} turnlimited:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<4]|reveal) moveto(myexile) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend +auto=@movedto(*[-land;manacost=5]|mystack) restriction{thisturn(*|mystack)~lessthan~1} turnlimited:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<5]|reveal) moveto(myexile) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend +auto=@movedto(*[-land;manacost=6]|mystack) restriction{thisturn(*|mystack)~lessthan~1} turnlimited:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<6]|reveal) moveto(myexile) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend +auto=@movedto(*[-land;manacost=7]|mystack) restriction{thisturn(*|mystack)~lessthan~1} turnlimited:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<7]|reveal) moveto(myexile) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend +auto=@movedto(*[-land;manacost=8]|mystack) restriction{thisturn(*|mystack)~lessthan~1} turnlimited:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<8]|reveal) moveto(myexile) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend +auto=@movedto(*[-land;manacost=9]|mystack) restriction{thisturn(*|mystack)~lessthan~1} turnlimited:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<9]|reveal) moveto(myexile) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend +auto=@movedto(*[-land;manacost=10]|mystack) restriction{thisturn(*|mystack)~lessthan~1} turnlimited:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<10]|reveal) moveto(myexile) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend +auto=@movedto(*[-land;manacost=11]|mystack) restriction{thisturn(*|mystack)~lessthan~1} turnlimited:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<11]|reveal) moveto(myexile) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend +auto=@movedto(*[-land;manacost=12]|mystack) restriction{thisturn(*|mystack)~lessthan~1} turnlimited:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<12]|reveal) moveto(myexile) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend +auto=@movedto(*[-land;manacost=13]|mystack) restriction{thisturn(*|mystack)~lessthan~1} turnlimited:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<13]|reveal) moveto(myexile) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend +auto=@movedto(*[-land;manacost=14]|mystack) restriction{thisturn(*|mystack)~lessthan~1} turnlimited:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<14]|reveal) moveto(myexile) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend +auto=@movedto(*[-land;manacost=15]|mystack) restriction{thisturn(*|mystack)~lessthan~1} turnlimited:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<15]|reveal) moveto(myexile) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend +auto=@movedto(*[-land;manacost=16]|mystack) restriction{thisturn(*|mystack)~lessthan~1} turnlimited:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<16]|reveal) moveto(myexile) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend +auto=@movedto(*[-land;manacost=17]|mystack) restriction{thisturn(*|mystack)~lessthan~1} turnlimited:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<17]|reveal) moveto(myexile) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend +auto=@movedto(*[-land;manacost=18]|mystack) restriction{thisturn(*|mystack)~lessthan~1} turnlimited:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<18]|reveal) moveto(myexile) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend +auto=@movedto(*[-land;manacost=19]|mystack) restriction{thisturn(*|mystack)~lessthan~1} turnlimited:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<19]|reveal) moveto(myexile) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend +auto=@movedto(*[-land;manacost=20]|mystack) restriction{thisturn(*|mystack)~lessthan~1} turnlimited:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<20]|reveal) moveto(myexile) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend +auto=@movedto(*[-land;manacost=21]|mystack) restriction{thisturn(*|mystack)~lessthan~1} turnlimited:reveal:1 revealzone(mylibrary) optionone name(choose card) target(*[-land;manacost<21]|reveal) moveto(myexile) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put in hand) target(*|reveal) moveto(ownerhand) optiontwoend afterrevealed all(tobecast|myexile) moveto(myexile) and!( activate castcard(normal) )! afterrevealedend revealend text=Whenever you cast your first spell each turn, reveal the top card of your library. If it's a nonland card with converted mana cost less than that spell's, you may cast it without paying its mana cost. If you don't cast the revealed card, put it into your hand. mana={2}{G}{U} type=Legendary Creature @@ -115235,7 +115235,7 @@ type=Instant [/card] [card] name=Surging Sentinels -autostack=if casted(this) then reveal:4 optionone name(Cast Card) target(Surging Sentinels|reveal) moveto(mylibrary) and!( becomes(tobecast) )! optiononeend optiontwo name(put on bottom) target(<4>*|reveal) bottomoflibrary optiontwoend afterrevealed all(tobecast|mylibrary) moveto(mylibrary) and!( activate castcard(normal) )! afterrevealedend revealend +autostack=if casted(this) then reveal:4 optionone name(Cast Card) target(Surging Sentinels|reveal) moveto(mylibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put on bottom) target(<4>*|reveal) bottomoflibrary optiontwoend afterrevealed all(tobecast|mylibrary) moveto(mylibrary) and!( activate castcard(normal) )! afterrevealedend revealend text=First strike -- Ripple 4 (When you cast this spell, you may reveal the top four cards of your library. You may cast any revealed cards with the same name as this spell without paying their mana costs. Put the rest on the bottom of your library.) mana={2}{W} type=Creature From e9c33e3bea2e2b4bed7cc7cf0f0de1d6e5eb768c Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Sat, 11 Feb 2017 01:28:14 +0800 Subject: [PATCH 02/26] revised shocklands --- projects/mtg/bin/Res/sets/primitives/mtg.txt | 42 ++++++++++---------- projects/mtg/src/ExtraCost.cpp | 12 ++++-- 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index bd0f7dd1d..665508a12 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -12041,8 +12041,8 @@ type=Artifact [/card] [card] name=Blood Crypt -auto=tap(noevent) -auto=pay({L:2}) untap +auto=noactivatedability ueot +auto=pay({L:2}) name(pay 2 life) donothing name(pay 2 life) && -noactivatedability all(this)?tap(noevent) && -noactivatedability all(this) text=({T}: Add {B} or {R} to your mana pool.) -- As Blood Crypt enters the battlefield, you may pay 2 life. If you don't, Blood Crypt enters the battlefield tapped. type=Land subtype=Swamp Mountain @@ -14751,8 +14751,8 @@ type=Enchantment [/card] [card] name=Breeding Pool -auto=tap(noevent) -auto=pay({L:2}) untap +auto=noactivatedability ueot +auto=pay({L:2}) name(pay 2 life) donothing name(pay 2 life) && -noactivatedability all(this)?tap(noevent) && -noactivatedability all(this) text=({T}: Add {G} or {U} to your mana pool.) -- As Breeding Pool enters the battlefield, you may pay 2 life. If you don't, Breeding Pool enters the battlefield tapped. type=Land subtype=Forest Island @@ -48249,8 +48249,8 @@ toughness=5 [/card] [card] name=Godless Shrine -auto=tap(noevent) -auto=pay({L:2}) untap +auto=noactivatedability ueot +auto=pay({L:2}) name(pay 2 life) donothing name(pay 2 life) && -noactivatedability all(this)?tap(noevent) && -noactivatedability all(this) text=({T}: Add {W} or {B} to your mana pool.) -- As Godless Shrine enters the battlefield, you may pay 2 life. If you don't, Godless Shrine enters the battlefield tapped. type=Land subtype=Plains Swamp @@ -51535,8 +51535,8 @@ type=Sorcery [/card] [card] name=Hallowed Fountain -auto=tap(noevent) -auto=pay({L:2}) untap +auto=noactivatedability ueot +auto=pay({L:2}) name(pay 2 life) donothing name(pay 2 life) && -noactivatedability all(this)?tap(noevent) && -noactivatedability all(this) text=({T}: Add {W} or {U} to your mana pool.) -- As Hallowed Fountain enters the battlefield, you may pay 2 life. If you don't, Hallowed Fountain enters the battlefield tapped. type=Land subtype=Plains Island @@ -82985,8 +82985,8 @@ type=Enchantment [/card] [card] name=Overgrown Tomb -auto=tap(noevent) -auto=pay({L:2}) untap +auto=noactivatedability ueot +auto=pay({L:2}) name(pay 2 life) donothing name(pay 2 life) && -noactivatedability all(this)?tap(noevent) && -noactivatedability all(this) text=({T}: Add {B} or {G} to your mana pool.) -- As Overgrown Tomb enters the battlefield, you may pay 2 life. If you don't, Overgrown Tomb enters the battlefield tapped. type=Land subtype=Swamp Forest @@ -97241,8 +97241,8 @@ type=Artifact [/card] [card] name=Sacred Foundry -auto=tap(noevent) -auto=may untap && life:-2 controller +auto=noactivatedability ueot +auto=pay({L:2}) name(pay 2 life) donothing name(pay 2 life) && -noactivatedability all(this)?tap(noevent) && -noactivatedability all(this) text=({T}: Add {R} or {W} to your mana pool.) -- As Sacred Foundry enters the battlefield, you may pay 2 life. If you don't, Sacred Foundry enters the battlefield tapped. type=Land subtype=Mountain Plains @@ -112274,8 +112274,8 @@ toughness=5 [/card] [card] name=Steam Vents -auto=tap(noevent) -auto=pay({L:2}) untap +auto=noactivatedability ueot +auto=pay({L:2}) name(pay 2 life) donothing name(pay 2 life) && -noactivatedability all(this)?tap(noevent) && -noactivatedability all(this) text=({T}: Add {U} or {R} to your mana pool.) -- As Steam Vents enters the battlefield, you may pay 2 life. If you don't, Steam Vents enters the battlefield tapped. type=Land subtype=Island Mountain @@ -112828,8 +112828,8 @@ toughness=3 [/card] [card] name=Stomping Ground -auto=tap(noevent) -auto=pay({L:2}) untap +auto=noactivatedability ueot +auto=pay({L:2}) name(pay 2 life) donothing name(pay 2 life) && -noactivatedability all(this)?tap(noevent) && -noactivatedability all(this) text=({T}: Add {R} or {G} to your mana pool.) -- As Stomping Ground enters the battlefield, you may pay 2 life. If you don't, Stomping Ground enters the battlefield tapped. type=Land subtype=Mountain Forest @@ -117754,8 +117754,8 @@ toughness=2 [/card] [card] name=Temple Garden -auto=tap(noevent) -auto=pay({L:2}) untap +auto=noactivatedability ueot +auto=pay({L:2}) name(pay 2 life) donothing name(pay 2 life) && -noactivatedability all(this)?tap(noevent) && -noactivatedability all(this) text=({T}: Add {G} or {W} to your mana pool.) -- As Temple Garden enters the battlefield, you may pay 2 life. If you don't, Temple Garden enters the battlefield tapped. type=Land subtype=Forest Plains @@ -130573,7 +130573,7 @@ type=Sorcery [/card] [card] name=Wand of Denial -auto={t}:target(player) reveal:1 optionone name(Get Creature) target(*|reveal) transforms((,newability[pay({L:2}) name(Pay Life) moveto(ownergraveyard) ])) forever optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) optiontwoend revealend +auto={t}:target(player) reveal:1 optionone name(Get Creature) target(*|reveal) transforms((,newability[pay[[{L:2}]] name(Pay Life) moveto(ownergraveyard) ])) forever optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) optiontwoend revealend text={T}: Look at the top card of target player's library. If it's a nonland card, you may pay 2 life. If you do, put it into that player's graveyard. mana={2} type=Artifact @@ -131484,8 +131484,8 @@ type=Instant [/card] [card] name=Watery Grave -auto=tap(noevent) -auto=pay({L:2}) untap +auto=noactivatedability ueot +auto=pay({L:2}) name(pay 2 life) donothing name(pay 2 life) && -noactivatedability all(this)?tap(noevent) && -noactivatedability all(this) text=({T}: Add {U} or {B} to your mana pool.) -- As Watery Grave enters the battlefield, you may pay 2 life. If you don't, Watery Grave enters the battlefield tapped. type=Land subtype=Island Swamp diff --git a/projects/mtg/src/ExtraCost.cpp b/projects/mtg/src/ExtraCost.cpp index e79c93098..fc21e686a 100644 --- a/projects/mtg/src/ExtraCost.cpp +++ b/projects/mtg/src/ExtraCost.cpp @@ -95,7 +95,7 @@ ExtraManaCost * ExtraManaCost::clone() const } ExtraManaCost::ExtraManaCost(ManaCost * costToPay) - : ExtraCost("Pay The Cost",NULL, costToPay) + : ExtraCost("",NULL, costToPay) { } @@ -321,13 +321,19 @@ SpecificLifeCost::SpecificLifeCost(TargetChooser *_tc, int slc) int SpecificLifeCost::canPay() { - MTGCardInstance * _target = (MTGCardInstance *) target; + if(source->controller()->life >= slc && !source->controller()->inPlay()->hasAbility(Constants::CANTCHANGELIFE) && + !source->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFE) && + !source->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFE)) + { + return 1; + } + /*MTGCardInstance * _target = (MTGCardInstance *) target; if(_target->controller()->life >= slc && !_target->controller()->inPlay()->hasAbility(Constants::CANTCHANGELIFE) && !_target->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFE) && !_target->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFE)) { return 1; - } + }*/ return 0; } From e74921cbdf2427ddddf71a12ab89c18f1eaaa520 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Sat, 11 Feb 2017 16:17:31 +0800 Subject: [PATCH 03/26] fix crash for multiple andAbility --- projects/mtg/src/AllAbilities.cpp | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index 6f843c809..ed5a4f6fd 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -4377,6 +4377,25 @@ AAMover::AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTG if (_target) target = _target; andAbility = NULL; + if(destination.size() && !named.size() && source->controller()->isAI()) + { + if(destination.find("library") != string::npos) + named = "Put in Library"; + else if(destination.find("hand") != string::npos) + named = "Put in Hand"; + else if(destination.find("exile") != string::npos) + named = "Put in Exile"; + else if(destination.find("removedfromgame") != string::npos) + named = "Put in Exile"; + else if(destination.find("graveyard") != string::npos) + named = "Put in Graveyard"; + else if(destination.find("previous") != string::npos) + named = "Put in Battlefield"; + else if(destination.find("inplay") != string::npos) + named = "Put in Play"; + else if(destination.find("battlefield") != string::npos) + named = "Put in Play"; + } } MTGGameZone * AAMover::destinationZone(Targetable * target) @@ -4479,13 +4498,13 @@ int AAMover::resolve() else return 0; } - p->game->putInZone(_target, fromZone, destZone); - while(_target->next) - _target = _target->next; + MTGCardInstance *newTarget = p->game->putInZone(_target, fromZone, destZone); + /*while(_target->next) + _target = _target->next;*/ if(andAbility) { MTGAbility * andAbilityClone = andAbility->clone(); - andAbilityClone->target = _target; + andAbilityClone->target = newTarget; if(andAbility->oneShot) { andAbilityClone->resolve(); From 3afcc7fdf9afdda1fb35a911845b098e2325d10e Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Sat, 11 Feb 2017 18:25:45 +0800 Subject: [PATCH 04/26] fix hang aicode ability controller aicode should be dedicated for AI only... --- projects/mtg/src/AllAbilities.cpp | 12 ++++++++++++ projects/mtg/src/MTGAbility.cpp | 12 +----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index ed5a4f6fd..9d5d3030d 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -54,6 +54,18 @@ GenericRevealAbility::GenericRevealAbility(GameObserver* observer, int id, MTGCa int GenericRevealAbility::resolve() { + if(source->lastController->isAI() && source->getAICustomCode().size()) + { + string abi = source->getAICustomCode(); + std::transform(abi.begin(), abi.end(), abi.begin(), ::tolower);//fix crash + AbilityFactory af(game); + MTGAbility * a3 = af.parseMagicLine(abi, this->GetId(), NULL, source); + a3->oneShot = 1; + a3->canBeInterrupted = false; + a3->resolve(); + SAFE_DELETE(a3); + return 1; + } MTGAbility * ability = NEW MTGRevealingCards(game, this->GetId(), source, howMany); ability->addToGame(); return 1; diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index fc6832afa..d9cfc823b 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -3684,17 +3684,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG a->oneShot = 1; a->canBeInterrupted = false; a->named = newName; - if(card->getAICustomCode().size() && card->controller()->isAI()) - { - string abi = card->getAICustomCode(); - std::transform(abi.begin(), abi.end(), abi.begin(), ::tolower);//fix crash - MTGAbility * a3 = parseMagicLine(abi, id, spell, card); - a3->oneShot = 1; - a3->canBeInterrupted = false; - return a3; - } - else - return a; + return a; } //scry:x (activate aility) From 3776bff594dd9213e1193e62ca2e21f97ef523f8 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Sat, 11 Feb 2017 22:04:20 +0800 Subject: [PATCH 05/26] add effeciency to use the reveal ability aicode overrides this on resolve and it seems most cards that have this has possitive effect --- projects/mtg/src/AIPlayerBaka.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/projects/mtg/src/AIPlayerBaka.cpp b/projects/mtg/src/AIPlayerBaka.cpp index f88eff2b1..014eff7b6 100644 --- a/projects/mtg/src/AIPlayerBaka.cpp +++ b/projects/mtg/src/AIPlayerBaka.cpp @@ -657,6 +657,10 @@ int OrderedAIAction::getEfficiency() { efficiency += 55; } + else if (dynamic_cast(a)) + { + efficiency += 55; + } SAFE_DELETE(transAbility); return efficiency; } From 6b1e51b4f64ac29295f3361bf2039481400007ed Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Sun, 12 Feb 2017 07:08:31 +0800 Subject: [PATCH 06/26] revised masks --- projects/mtg/src/CardGui.cpp | 48 ++++++++++++++---------------------- 1 file changed, 19 insertions(+), 29 deletions(-) diff --git a/projects/mtg/src/CardGui.cpp b/projects/mtg/src/CardGui.cpp index 42ec3c85c..13f75e4b6 100644 --- a/projects/mtg/src/CardGui.cpp +++ b/projects/mtg/src/CardGui.cpp @@ -254,8 +254,8 @@ void CardGui::Render() highlightborder = game? game->getResourceManager()->GetQuad("white"):WResourceManager::Instance()->GetQuad("white"); if(fakeborder) { - if(card->has(Constants::CANPLAYFROMGRAVEYARD)||card->has(Constants::CANPLAYFROMEXILE)||card->has(Constants::PAYZERO) - ||((card->has(Constants::TEMPFLASHBACK) || card->getManaCost()->getFlashback()) && game->isInGrave(card))) + if(card->has(Constants::CANPLAYFROMEXILE)||card->has(Constants::PAYZERO) + ||(card->has(Constants::CANPLAYFROMGRAVEYARD) || card->has(Constants::TEMPFLASHBACK) || card->getManaCost()->getFlashback() && game->isInGrave(card))) fakeborder->SetColor(ARGB((int)(actA),7,235,7));//green border else fakeborder->SetColor(ARGB((int)(actA),15,15,15)); @@ -401,6 +401,23 @@ void CardGui::Render() } } + // Render a mask over the card, if set + if (mask && quad) + JRenderer::GetInstance()->FillRect(actX - (scale * quad->mWidth / 2),actY - (scale * quad->mHeight / 2), scale * quad->mWidth, scale* quad->mHeight, mask); + + if ((tc && tc->alreadyHasTarget(card)) || (game && card == game->mLayers->actionLayer()->currentActionCard))//paint targets red. + { + JQuadPtr rMask = card->getObserver()->getResourceManager()->GetQuad("white"); + rMask->SetColor(ARGB(128,255,0,0));//red + renderer->RenderQuad(rMask.get(), actX, actY, actT, (27 * actZ + 1) / 16, 40 * actZ / 16); + } + if(tc && tc->source && tc->source->view && tc->source->view->actZ >= 1.3 && card == tc->source)//paint the source green while infocus. + { + JQuadPtr gMask = card->getObserver()->getResourceManager()->GetQuad("white"); + gMask->SetColor(ARGB(128,0,255,0));//green + renderer->RenderQuad(gMask.get(), actX, actY, actT, (27 * actZ + 1) / 16, 40 * actZ / 16); + } + //draws the numbers power/toughness if (card->isCreature()) { @@ -496,33 +513,6 @@ void CardGui::Render() } } - // Render a mask over the card, if set - if (mask && quad) - JRenderer::GetInstance()->FillRect(actX - (scale * quad->mWidth / 2),actY - (scale * quad->mHeight / 2), scale * quad->mWidth, scale* quad->mHeight, mask); - - if ((tc && tc->alreadyHasTarget(card)) || (game && card == game->mLayers->actionLayer()->currentActionCard))//paint targets red. - { - if (card->isTapped()) - { - renderer->FillRect(actX - (scale * quad->mWidth / 2)-7,actY - (scale * quad->mHeight / 2)+7,scale* quad->mHeight,scale * quad->mWidth, ARGB(128,255,0,0)); - } - else - { - renderer->FillRect(actX - (scale * quad->mWidth / 2),actY - (scale * quad->mHeight / 2), scale * quad->mWidth, scale* quad->mHeight, ARGB(128,255,0,0)); - } - } - if(tc && tc->source && tc->source->view && tc->source->view->actZ >= 1.3 && card == tc->source)//paint the source green while infocus. - { - if (tc->source->isTapped()) - { - renderer->FillRect(actX - (scale * quad->mWidth / 2)-7,actY - (scale * quad->mHeight / 2)+7,scale* quad->mHeight,scale * quad->mWidth, ARGB(128,0,255,0)); - } - else - { - renderer->FillRect(tc->source->view->actX - (scale * quad->mWidth / 2),tc->source->view->actY - (scale * quad->mHeight / 2), scale*quad->mWidth, scale*quad->mHeight, ARGB(128,0,255,0)); - } - } - PlayGuiObject::Render(); } From b5129f702e28c404465cb32b48f00c2426319238 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Sun, 12 Feb 2017 10:29:13 +0800 Subject: [PATCH 07/26] add multi target quads stack displays target quads up to 10 targets. also displays actual number of targets... --- projects/mtg/include/ActionStack.h | 2 +- projects/mtg/src/ActionStack.cpp | 99 +++++++++++++++++++++++++----- 2 files changed, 84 insertions(+), 17 deletions(-) diff --git a/projects/mtg/include/ActionStack.h b/projects/mtg/include/ActionStack.h index 0e74224db..65d6f37a0 100644 --- a/projects/mtg/include/ActionStack.h +++ b/projects/mtg/include/ActionStack.h @@ -77,7 +77,7 @@ public: } virtual const string getDisplayName() const; - void Render(MTGCardInstance * source, JQuad * targetQuad, string alt1, string alt2, string action, bool bigQuad = false, int aType = 0); + void Render(MTGCardInstance * source, JQuad * targetQuad, string alt1, string alt2, string action, bool bigQuad = false, int aType = 0, vector targetIcons = vector()); virtual int receiveEvent(WEvent *) { diff --git a/projects/mtg/src/ActionStack.cpp b/projects/mtg/src/ActionStack.cpp index 731682c91..3b6433519 100644 --- a/projects/mtg/src/ActionStack.cpp +++ b/projects/mtg/src/ActionStack.cpp @@ -88,7 +88,7 @@ float Interruptible::GetVerticalTextOffset() const } void Interruptible::Render(MTGCardInstance * source, JQuad * targetQuad, string alt1, string alt2, string action, - bool bigQuad, int aType) + bool bigQuad, int aType, vector mytargetsQuad) { WFont * mFont = observer->getResourceManager()->GetWFont(Fonts::MAIN_FONT); mFont->SetColor(ARGB(255,255,255,255)); @@ -105,13 +105,41 @@ void Interruptible::Render(MTGCardInstance * source, JQuad * targetQuad, string } else { - renderer->FillRect(x-2,y-16 + GetVerticalTextOffset(), 73, 43, ARGB(235,10,10,10)); /*if(source->controller()->isHuman() && source->controller()->opponent()->isAI()) renderer->DrawRect(x-2,y-16 + GetVerticalTextOffset(), 73, 43, ARGB(245,0,255,0)); else renderer->DrawRect(x-2,y-16 + GetVerticalTextOffset(), 73, 43, ARGB(245,255,0,0));*/ - mFont->DrawString(">", x + 32, y + GetVerticalTextOffset(), JGETEXT_LEFT); - mFont->DrawString(_(action).c_str(), x + 75, y + GetVerticalTextOffset(), JGETEXT_LEFT); + float xnadj = 0; + int count = 1; + if(mytargetsQuad.size()) + { + count = mytargetsQuad.size(); + for(unsigned int k = 0; k < mytargetsQuad.size(); k++) + { + if(k > 10) + break; + xnadj+=3; + } + } + + ostringstream aa; + aa << action << " " << "(" << count << ")"; + + if(count > 1) + xnadj -= 3; + + renderer->FillRect(x-1.8f,y-16 + GetVerticalTextOffset(), 73 + xnadj, 43, ARGB(235,10,10,10));//box + + mFont->SetColor(ARGB(255,128,255,0));//recolor + mFont->DrawString(">", x + 32, y + GetVerticalTextOffset(), JGETEXT_LEFT); + mFont->SetColor(ARGB(255,255,255,255));//reset color + + if(count > 1) + { + mFont->DrawString(_(aa.str()).c_str(), x + 75 + xnadj, y + GetVerticalTextOffset(), JGETEXT_LEFT); + } + else + mFont->DrawString(_(action).c_str(), x + 75 + xnadj, y + GetVerticalTextOffset(), JGETEXT_LEFT); } JQuadPtr quad = observer->getResourceManager()->RetrieveCard(source, CACHE_THUMB); @@ -147,19 +175,44 @@ void Interruptible::Render(MTGCardInstance * source, JQuad * targetQuad, string } - if (targetQuad) + if(mytargetsQuad.size()) { - float backupX = targetQuad->mHotSpotX; - float backupY = targetQuad->mHotSpotY; - targetQuad->SetColor(ARGB(255,255,255,255)); - targetQuad->SetHotSpot(targetQuad->mWidth / 2, targetQuad->mHeight / 2); - float scale = mHeight / targetQuad->mHeight; - renderer->RenderQuad(targetQuad, x + 55, y + ((mHeight - targetQuad->mHeight) / 2) + targetQuad->mHotSpotY, 0, scale, scale); - targetQuad->SetHotSpot(backupX, backupY); + float xadj = 0; + for(unsigned int k = 0; k < mytargetsQuad.size(); k++) + { + if(k > 10) + break; + + JQuadPtr multiQ = mytargetsQuad[k]; + if(multiQ.get()) + { + float backupX = multiQ->mHotSpotX; + float backupY = multiQ->mHotSpotY; + multiQ->SetColor(ARGB(255,255,255,255)); + multiQ->SetHotSpot(multiQ->mWidth / 2, multiQ->mHeight / 2); + float scale = mHeight / multiQ->mHeight; + renderer->RenderQuad(multiQ.get(), x + 55 + xadj, y + ((mHeight - multiQ->mHeight) / 2) + multiQ->mHotSpotY, 0, scale, scale); + multiQ->SetHotSpot(backupX, backupY); + xadj+=3; + } + } } - else if (alt2.size()) + else { - mFont->DrawString(_(alt2).c_str(), x + 35, y+15 + GetVerticalTextOffset()); + if (targetQuad) + { + float backupX = targetQuad->mHotSpotX; + float backupY = targetQuad->mHotSpotY; + targetQuad->SetColor(ARGB(255,255,255,255)); + targetQuad->SetHotSpot(targetQuad->mWidth / 2, targetQuad->mHeight / 2); + float scale = mHeight / targetQuad->mHeight; + renderer->RenderQuad(targetQuad, x + 55, y + ((mHeight - targetQuad->mHeight) / 2) + targetQuad->mHotSpotY, 0, scale, scale); + targetQuad->SetHotSpot(backupX, backupY); + } + else if (alt2.size()) + { + mFont->DrawString(_(alt2).c_str(), x + 35, y+15 + GetVerticalTextOffset()); + } } } @@ -173,6 +226,7 @@ void StackAbility::Render() string action = ability->getMenuText(); MTGCardInstance * source = ability->source; string alt1 = source->getName(); + vector mytargetQuads; Targetable * _target = ability->target; if (ability->getActionTc()) @@ -180,6 +234,19 @@ void StackAbility::Render() Targetable * t = ability->getActionTc()->getNextTarget(); if (t) _target = t; + + + //test vector quads + if(ability->getActionTc()->getTargetsFrom().size()) + { + for(size_t i = 0; i < ability->getActionTc()->getTargetsFrom().size(); i++) + { + Targetable * tt = ability->getActionTc()->getTargetsFrom()[i]; + if(tt) + mytargetQuads.push_back( ((Damageable *)(tt))->getIcon() ); + } + } + //end } Damageable * target = NULL; if (_target != ability->source && (dynamic_cast(_target) || dynamic_cast(_target))) @@ -199,9 +266,9 @@ void StackAbility::Render() } if(observer->gameType() == GAME_TYPE_MOMIR) - Interruptible::Render(source, quad.get(), alt1, alt2, action, true, ability->aType); + Interruptible::Render(source, quad.get(), alt1, alt2, action, true, ability->aType, mytargetQuads); else - Interruptible::Render(source, quad.get(), alt1, alt2, action); + Interruptible::Render(source, quad.get(), alt1, alt2, action, false, 0, mytargetQuads); } StackAbility::StackAbility(GameObserver* observer, int id, MTGAbility * _ability) : Interruptible(observer, id), ability(_ability) From 7a35c253cb0e5db1065715fd22ba347fb180b3d6 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Sun, 12 Feb 2017 19:43:10 +0800 Subject: [PATCH 08/26] refine display --- projects/mtg/src/ActionStack.cpp | 24 ++++++++++++++++++------ projects/mtg/src/AllAbilities.cpp | 2 +- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/projects/mtg/src/ActionStack.cpp b/projects/mtg/src/ActionStack.cpp index 3b6433519..58d60bf8c 100644 --- a/projects/mtg/src/ActionStack.cpp +++ b/projects/mtg/src/ActionStack.cpp @@ -118,7 +118,7 @@ void Interruptible::Render(MTGCardInstance * source, JQuad * targetQuad, string { if(k > 10) break; - xnadj+=3; + xnadj+=4; } } @@ -126,13 +126,13 @@ void Interruptible::Render(MTGCardInstance * source, JQuad * targetQuad, string aa << action << " " << "(" << count << ")"; if(count > 1) - xnadj -= 3; + xnadj -= 4; - renderer->FillRect(x-1.8f,y-16 + GetVerticalTextOffset(), 73 + xnadj, 43, ARGB(235,10,10,10));//box + //renderer->FillRect(x-1.8f,y-16 + GetVerticalTextOffset(), 73 + xnadj, 43, ARGB(235,10,10,10));//box - mFont->SetColor(ARGB(255,128,255,0));//recolor + //mFont->SetColor(ARGB(255,128,255,128));//recolor mFont->DrawString(">", x + 32, y + GetVerticalTextOffset(), JGETEXT_LEFT); - mFont->SetColor(ARGB(255,255,255,255));//reset color + //mFont->SetColor(ARGB(255,255,255,255));//reset color if(count > 1) { @@ -143,12 +143,19 @@ void Interruptible::Render(MTGCardInstance * source, JQuad * targetQuad, string } JQuadPtr quad = observer->getResourceManager()->RetrieveCard(source, CACHE_THUMB); + JQuadPtr fakeborder = observer->getResourceManager()->GetQuad("white"); if (!quad.get()) quad = CardGui::AlternateThumbQuad(source); if (quad.get()) { quad->SetColor(ARGB(255,255,255,255)); float scale = mHeight / quad->mHeight; + if (fakeborder.get()) + { + fakeborder->SetColor(ARGB(255,15,15,15)); + renderer->RenderQuad(fakeborder.get(), x + (quad->mWidth * scale / 2), y + (quad->mHeight * scale / 2), 0, (29 * actZ + 1) / 16, 42 * actZ / 16); + } + renderer->RenderQuad(quad.get(), x + (quad->mWidth * scale / 2), y + (quad->mHeight * scale / 2), 0, scale, scale); } else if (alt1.size()) @@ -191,9 +198,14 @@ void Interruptible::Render(MTGCardInstance * source, JQuad * targetQuad, string multiQ->SetColor(ARGB(255,255,255,255)); multiQ->SetHotSpot(multiQ->mWidth / 2, multiQ->mHeight / 2); float scale = mHeight / multiQ->mHeight; + if (fakeborder.get()) + { + fakeborder->SetColor(ARGB(255,15,15,15)); + renderer->RenderQuad(fakeborder.get(), x + 55 + xadj, y + ((mHeight - multiQ->mHeight) / 2) + multiQ->mHotSpotY, 0, (29 * actZ + 1) / 16, 42 * actZ / 16); + } renderer->RenderQuad(multiQ.get(), x + 55 + xadj, y + ((mHeight - multiQ->mHeight) / 2) + multiQ->mHotSpotY, 0, scale, scale); multiQ->SetHotSpot(backupX, backupY); - xadj+=3; + xadj+=4; } } } diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index 9d5d3030d..6277fd3a6 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -4402,7 +4402,7 @@ AAMover::AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTG else if(destination.find("graveyard") != string::npos) named = "Put in Graveyard"; else if(destination.find("previous") != string::npos) - named = "Put in Battlefield"; + named = "Previous Zone"; else if(destination.find("inplay") != string::npos) named = "Put in Play"; else if(destination.find("battlefield") != string::npos) From d604ae2d77b6fb4f2ccad2a790c3c5d1dd7515bb Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Mon, 13 Feb 2017 07:49:37 +0800 Subject: [PATCH 09/26] add gravecast restriction if gravecast then do something -> translates when this card was cast from a graveyard --- projects/mtg/src/AllAbilities.cpp | 2 +- projects/mtg/src/MTGAbility.cpp | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index 6277fd3a6..852777726 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -4389,7 +4389,7 @@ AAMover::AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTG if (_target) target = _target; andAbility = NULL; - if(destination.size() && !named.size() && source->controller()->isAI()) + if(destination.size() && !named.size()) { if(destination.find("library") != string::npos) named = "Put in Library"; diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index d9cfc823b..adbeeb958 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -314,6 +314,21 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe return 0; } } + check = restriction[i].find("gravecast"); + if(check != string::npos) + { + int count = 0; + for(unsigned int k = 0; k < player->game->stack->cardsSeenThisTurn.size(); k++) + { + MTGCardInstance * stackCard = player->game->stack->cardsSeenThisTurn[k]; + if(stackCard->next && stackCard->next == card && (card->previousZone == card->controller()->game->graveyard||card->previousZone == card->controller()->opponent()->game->graveyard)) + count++; + if(stackCard == card && (card->previousZone == card->controller()->game->graveyard||card->previousZone == card->controller()->opponent()->game->graveyard)) + count++; + } + if(!count) + return 0; + } check = restriction[i].find("rebound"); if(check != string::npos) { @@ -321,9 +336,9 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe for(unsigned int k = 0; k < player->game->stack->cardsSeenThisTurn.size(); k++) { MTGCardInstance * stackCard = player->game->stack->cardsSeenThisTurn[k]; - if(stackCard->next && stackCard->next == card && card->previousZone == card->controller()->game->hand) + if(stackCard->next && stackCard->next == card && (card->previousZone == card->controller()->game->hand||card->previousZone == card->controller()->opponent()->game->hand)) count++; - if(stackCard == card && card->previousZone == card->controller()->game->hand) + if(stackCard == card && (card->previousZone == card->controller()->game->hand||card->previousZone == card->controller()->opponent()->game->hand)) count++; } if(!count) From 13f590c6a22890ba4bfa1b8018dd5d4f7678f0c4 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Mon, 13 Feb 2017 08:26:06 +0800 Subject: [PATCH 10/26] hiddenface if the source has hiddenface ability then all of its targets will not show on the stack ability, useful for cards like demonic tutor etc... --- projects/mtg/src/ActionStack.cpp | 26 ++++++++++++++------------ projects/mtg/src/MTGDefinitions.cpp | 2 +- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/projects/mtg/src/ActionStack.cpp b/projects/mtg/src/ActionStack.cpp index 58d60bf8c..f0f57af6b 100644 --- a/projects/mtg/src/ActionStack.cpp +++ b/projects/mtg/src/ActionStack.cpp @@ -94,7 +94,8 @@ void Interruptible::Render(MTGCardInstance * source, JQuad * targetQuad, string mFont->SetColor(ARGB(255,255,255,255)); mFont->SetScale(DEFAULT_MAIN_FONT_SCALE); JRenderer * renderer = JRenderer::GetInstance(); - + bool hiddenview = source->has(Constants::HIDDENFACE)?true:false; + if (!targetQuad) { /*if(source->controller()->isHuman() && source->controller()->opponent()->isAI() && !alt2.size() && _(action).c_str() == source->name) @@ -122,24 +123,25 @@ void Interruptible::Render(MTGCardInstance * source, JQuad * targetQuad, string } } - ostringstream aa; - aa << action << " " << "(" << count << ")"; + ostringstream aa; + aa << action << " " << "(" << count << ")"; - if(count > 1) - xnadj -= 4; + if(count > 1) + xnadj -= 4; - //renderer->FillRect(x-1.8f,y-16 + GetVerticalTextOffset(), 73 + xnadj, 43, ARGB(235,10,10,10));//box - - //mFont->SetColor(ARGB(255,128,255,128));//recolor + if(!hiddenview) + { mFont->DrawString(">", x + 32, y + GetVerticalTextOffset(), JGETEXT_LEFT); - //mFont->SetColor(ARGB(255,255,255,255));//reset color - if(count > 1) { mFont->DrawString(_(aa.str()).c_str(), x + 75 + xnadj, y + GetVerticalTextOffset(), JGETEXT_LEFT); } else mFont->DrawString(_(action).c_str(), x + 75 + xnadj, y + GetVerticalTextOffset(), JGETEXT_LEFT); + } + else + mFont->DrawString(_(action).c_str(), x + 35, y + GetVerticalTextOffset(), JGETEXT_LEFT); + } JQuadPtr quad = observer->getResourceManager()->RetrieveCard(source, CACHE_THUMB); @@ -182,7 +184,7 @@ void Interruptible::Render(MTGCardInstance * source, JQuad * targetQuad, string } - if(mytargetsQuad.size()) + if(mytargetsQuad.size() && !hiddenview) { float xadj = 0; for(unsigned int k = 0; k < mytargetsQuad.size(); k++) @@ -209,7 +211,7 @@ void Interruptible::Render(MTGCardInstance * source, JQuad * targetQuad, string } } } - else + else if(!hiddenview) { if (targetQuad) { diff --git a/projects/mtg/src/MTGDefinitions.cpp b/projects/mtg/src/MTGDefinitions.cpp index f9811f8e7..c9d02d911 100644 --- a/projects/mtg/src/MTGDefinitions.cpp +++ b/projects/mtg/src/MTGDefinitions.cpp @@ -175,7 +175,7 @@ const char* Constants::MTGBasicAbilities[] = { "canblocktapped", "oppnomaxhand", "cantcrew", - "hiddenface",//test for facedown + "hiddenface",//test for hiding card "anytypeofmana" }; From 21710ddfb3123ecd9dca6ae4cbb2c625adcb2f31 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Mon, 13 Feb 2017 09:35:05 +0800 Subject: [PATCH 11/26] refactor AAMover getmenu text --- projects/mtg/include/AllAbilities.h | 1 + projects/mtg/src/AllAbilities.cpp | 50 +++++++++++++++++------------ 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 8cd8895c4..6c6140495 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -2119,6 +2119,7 @@ public: AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest,string _name, ManaCost * _cost = NULL, bool undying = false, bool persist = false); MTGGameZone * destinationZone(Targetable * target = NULL); int resolve(); + string overrideNamed(string destination = ""); const string getMenuText(); const char * getMenuText(TargetChooser * fromTc); AAMover * clone() const; diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index 852777726..e2c562873 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -4389,25 +4389,8 @@ AAMover::AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTG if (_target) target = _target; andAbility = NULL; - if(destination.size() && !named.size()) - { - if(destination.find("library") != string::npos) - named = "Put in Library"; - else if(destination.find("hand") != string::npos) - named = "Put in Hand"; - else if(destination.find("exile") != string::npos) - named = "Put in Exile"; - else if(destination.find("removedfromgame") != string::npos) - named = "Put in Exile"; - else if(destination.find("graveyard") != string::npos) - named = "Put in Graveyard"; - else if(destination.find("previous") != string::npos) - named = "Previous Zone"; - else if(destination.find("inplay") != string::npos) - named = "Put in Play"; - else if(destination.find("battlefield") != string::npos) - named = "Put in Play"; - } + if(!named.size() && source->controller()->isAI()) + named = overrideNamed(destination); } MTGGameZone * AAMover::destinationZone(Targetable * target) @@ -4534,11 +4517,36 @@ int AAMover::resolve() return 0; } +string AAMover::overrideNamed(string destination) +{ + string name = "Move"; + if(destination.size()) + { + if(destination.find("library") != string::npos) + name = "Put in Library"; + else if(destination.find("hand") != string::npos) + name = "Put in Hand"; + else if(destination.find("exile") != string::npos) + name = "Put in Exile"; + else if(destination.find("removedfromgame") != string::npos) + name = "Put in Exile"; + else if(destination.find("graveyard") != string::npos) + name = "Put in Graveyard"; + else if(destination.find("previous") != string::npos) + name = "Previous Zone"; + else if(destination.find("inplay") != string::npos) + name = "Put in Play"; + else if(destination.find("battlefield") != string::npos) + name = "Put in Play"; + } + return name; +} + const string AAMover::getMenuText() { if(named.size()) return named.c_str(); - return "Put in Zone"; + return "Move"; } const char* AAMover::getMenuText(TargetChooser * tc) @@ -4600,7 +4608,7 @@ const char* AAMover::getMenuText(TargetChooser * tc) } } - return "Put in Zone"; + return "Move"; } AAMover * AAMover::clone() const From 722056e78a2889c72db0fc93f2bfa694c24b4a1c Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Mon, 13 Feb 2017 10:43:22 +0800 Subject: [PATCH 12/26] moved this --- projects/mtg/src/AIPlayerBaka.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/projects/mtg/src/AIPlayerBaka.cpp b/projects/mtg/src/AIPlayerBaka.cpp index 014eff7b6..1fdd47723 100644 --- a/projects/mtg/src/AIPlayerBaka.cpp +++ b/projects/mtg/src/AIPlayerBaka.cpp @@ -617,6 +617,13 @@ int OrderedAIAction::getEfficiency() efficiency = 0; } + else if (GenericRevealAbility * grA = dynamic_cast(a)) + { + if(grA->source->getAICustomCode().size()) + efficiency = 50 + (owner->getRandomGenerator()->random() % 50); + else + efficiency = 0; + } //At this point the "basic" efficiency is computed, we further tweak it depending on general decisions, independent of theAbility type MayAbility * may = dynamic_cast(ability); @@ -657,10 +664,6 @@ int OrderedAIAction::getEfficiency() { efficiency += 55; } - else if (dynamic_cast(a)) - { - efficiency += 55; - } SAFE_DELETE(transAbility); return efficiency; } From 6f4377de76cec914ebd9cc5af36e1e3370e5be9c Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Mon, 13 Feb 2017 17:54:55 +0800 Subject: [PATCH 13/26] Inverted this we transform with no value.. get the value first then transform it to lower... --- projects/mtg/src/CardPrimitive.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/mtg/src/CardPrimitive.cpp b/projects/mtg/src/CardPrimitive.cpp index 23e9f9f78..d48d48373 100644 --- a/projects/mtg/src/CardPrimitive.cpp +++ b/projects/mtg/src/CardPrimitive.cpp @@ -334,8 +334,8 @@ void CardPrimitive::addMagicText(string value, string key) void CardPrimitive::setdoubleFaced(const string& value) { - std::transform(doubleFaced.begin(), doubleFaced.end(), doubleFaced.begin(), ::tolower); doubleFaced = value; + std::transform(doubleFaced.begin(), doubleFaced.end(), doubleFaced.begin(), ::tolower); } const string& CardPrimitive::getdoubleFaced() const @@ -345,8 +345,8 @@ const string& CardPrimitive::getdoubleFaced() const void CardPrimitive::setAICustomCode(const string& value) { - std::transform(AICustomCode.begin(), AICustomCode.end(), AICustomCode.begin(), ::tolower); AICustomCode = value; + std::transform(AICustomCode.begin(), AICustomCode.end(), AICustomCode.begin(), ::tolower); } const string& CardPrimitive::getAICustomCode() const @@ -356,8 +356,8 @@ const string& CardPrimitive::getAICustomCode() const void CardPrimitive::setCrewAbility(const string& value) { - std::transform(CrewAbility.begin(), CrewAbility.end(), CrewAbility.begin(), ::tolower); CrewAbility = value; + std::transform(CrewAbility.begin(), CrewAbility.end(), CrewAbility.begin(), ::tolower); } const string& CardPrimitive::getCrewAbility() const From 143b3d98b11505f513a838179c46e3f3f9c4e552 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Mon, 13 Feb 2017 20:11:07 +0800 Subject: [PATCH 14/26] modified guiopponenthand --- projects/mtg/src/GuiStatic.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/projects/mtg/src/GuiStatic.cpp b/projects/mtg/src/GuiStatic.cpp index 97ab1cf4a..877cc858c 100644 --- a/projects/mtg/src/GuiStatic.cpp +++ b/projects/mtg/src/GuiStatic.cpp @@ -397,9 +397,14 @@ int GuiOpponentHand::receiveEventPlus(WEvent* e) t = NEW CardView(CardView::nullZone, event->card, *(event->card->view)); else t = NEW CardView(CardView::nullZone, event->card, x, y); - t->x = x + Width / 2; - t->y = y + Height / 2; - t->zoom = 0.6f; + //t->x = x + Width / 2; + //t->y = y + Height / 2; + //t->zoom = 0.6f; + //I set to negative so we don't see the face when the cards move... + t->x = -400.f; + t->y = -400.f; + t->mask = ARGB(0,0,0,0); + t->zoom = -0.6f; t->alpha = 0; cards.push_back(t); return 1; From 2d383e237fdd7c16c2347c85f2fdfa5c4ec75338 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Tue, 14 Feb 2017 05:09:28 +0800 Subject: [PATCH 15/26] hiddenview if the target is in library and the source has the hiddenface ability then hide it --- projects/mtg/include/GameObserver.h | 1 + projects/mtg/include/MTGAbility.h | 1 + projects/mtg/src/ActionStack.cpp | 23 ++++++++++++++++++++--- projects/mtg/src/GameObserver.cpp | 11 +++++++++++ 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/projects/mtg/include/GameObserver.h b/projects/mtg/include/GameObserver.h index 2f520043c..a658f4396 100644 --- a/projects/mtg/include/GameObserver.h +++ b/projects/mtg/include/GameObserver.h @@ -134,6 +134,7 @@ class GameObserver{ int isInGrave(MTGCardInstance * card); int isInExile(MTGCardInstance * card); int isInHand(MTGCardInstance * card); + int isInLibrary(MTGCardInstance * card); virtual void Update(float dt); void Render(); void ButtonPressed(PlayGuiObject*); diff --git a/projects/mtg/include/MTGAbility.h b/projects/mtg/include/MTGAbility.h index 7c90ae847..a95643059 100644 --- a/projects/mtg/include/MTGAbility.h +++ b/projects/mtg/include/MTGAbility.h @@ -221,6 +221,7 @@ public: BLOCK_COST = 37, GRANTEDFLASHBACK_COST = 38, FORCED_TOKEN_CREATOR = 39, + HIDDENVIEW = 40, }; }; diff --git a/projects/mtg/src/ActionStack.cpp b/projects/mtg/src/ActionStack.cpp index f0f57af6b..827769701 100644 --- a/projects/mtg/src/ActionStack.cpp +++ b/projects/mtg/src/ActionStack.cpp @@ -94,7 +94,7 @@ void Interruptible::Render(MTGCardInstance * source, JQuad * targetQuad, string mFont->SetColor(ARGB(255,255,255,255)); mFont->SetScale(DEFAULT_MAIN_FONT_SCALE); JRenderer * renderer = JRenderer::GetInstance(); - bool hiddenview = source->has(Constants::HIDDENFACE)?true:false; + bool hiddenview = aType == MTGAbility::HIDDENVIEW?true:false; if (!targetQuad) { @@ -241,6 +241,8 @@ void StackAbility::Render() MTGCardInstance * source = ability->source; string alt1 = source->getName(); vector mytargetQuads; + int fmLibrary = 0; + int force = 0; Targetable * _target = ability->target; if (ability->getActionTc()) @@ -257,7 +259,19 @@ void StackAbility::Render() { Targetable * tt = ability->getActionTc()->getTargetsFrom()[i]; if(tt) - mytargetQuads.push_back( ((Damageable *)(tt))->getIcon() ); + { + if( ((Damageable *)(tt))->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE ) + { + if( source->has(Constants::HIDDENFACE) && !observer->isInLibrary(((MTGCardInstance *)(tt))) ) + mytargetQuads.push_back( ((Damageable *)(tt))->getIcon() ); + else if ( !source->has(Constants::HIDDENFACE) ) + mytargetQuads.push_back( ((Damageable *)(tt))->getIcon() ); + else + fmLibrary++; + } + else + mytargetQuads.push_back( ((Damageable *)(tt))->getIcon() ); + } } } //end @@ -279,10 +293,13 @@ void StackAbility::Render() } } + if(source->has(Constants::HIDDENFACE) && fmLibrary) + force = MTGAbility::HIDDENVIEW; + if(observer->gameType() == GAME_TYPE_MOMIR) Interruptible::Render(source, quad.get(), alt1, alt2, action, true, ability->aType, mytargetQuads); else - Interruptible::Render(source, quad.get(), alt1, alt2, action, false, 0, mytargetQuads); + Interruptible::Render(source, quad.get(), alt1, alt2, action, false, force, mytargetQuads); } StackAbility::StackAbility(GameObserver* observer, int id, MTGAbility * _ability) : Interruptible(observer, id), ability(_ability) diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index 05f8f7344..413319edd 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -1630,6 +1630,17 @@ int GameObserver::isInHand(MTGCardInstance * card) } return 0; } +int GameObserver::isInLibrary(MTGCardInstance * card) +{ + + for (int i = 0; i < 2; i++) + { + MTGGameZone * library = players[i]->game->library; + if (players[i]->game->isInZone(card, library)) + return 1; + } + return 0; +} void GameObserver::cleanupPhase() { currentPlayer->cleanupPhase(); From 01fdcfdfecf32aa8f23b9907c305758dc8dd9fd2 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Tue, 14 Feb 2017 22:30:50 +0800 Subject: [PATCH 16/26] zpos and zone display added zone position (adjust dynamically), also inverts the display of the zone so we always get the top/recent one... the library zpos is inverted so if we choose to target the top 5 zpos like target(*[zpos>=5|mylibrary), it will do from top to bottom... this is only for AI so we can add alternate code for them since they cant use reveal atm, we can make them target within allowed range... Also this commit disabled the new legend and planeswalker rule since it conflicts with reveal ability, unless I/We figure it out, I recommend to use the old one... --- projects/mtg/include/CardDescriptor.h | 6 ++- projects/mtg/include/MTGCardInstance.h | 1 + projects/mtg/src/CardDescriptor.cpp | 14 ++++-- projects/mtg/src/CardDisplay.cpp | 11 +++-- projects/mtg/src/CardGui.cpp | 11 ++++- projects/mtg/src/GameObserver.cpp | 10 +++++ projects/mtg/src/MTGCardInstance.cpp | 1 + projects/mtg/src/MTGRules.cpp | 59 +++++++++++++++++++++++--- projects/mtg/src/TargetChooser.cpp | 10 ++++- 9 files changed, 104 insertions(+), 19 deletions(-) diff --git a/projects/mtg/include/CardDescriptor.h b/projects/mtg/include/CardDescriptor.h index 23adcfe5c..daa9aa365 100644 --- a/projects/mtg/include/CardDescriptor.h +++ b/projects/mtg/include/CardDescriptor.h @@ -39,6 +39,8 @@ class CardDescriptor: public MTGCardInstance int manacostComparisonMode; int counterComparisonMode; int convertedManacost; // might fit better into MTGCardInstance? + int zposComparisonMode; + int zposition; int anyCounter; int init(); CardDescriptor(); @@ -68,12 +70,12 @@ class CardDescriptor: public MTGCardInstance int CDdamager; int CDgeared; int CDblocked; - int CDcanProduceC; + /*int CDcanProduceC; int CDcanProduceG; int CDcanProduceU; int CDcanProduceR; int CDcanProduceB; - int CDcanProduceW; + int CDcanProduceW;*/ int CDnocolor; }; diff --git a/projects/mtg/include/MTGCardInstance.h b/projects/mtg/include/MTGCardInstance.h index 2d8e9f328..3e6f60620 100644 --- a/projects/mtg/include/MTGCardInstance.h +++ b/projects/mtg/include/MTGCardInstance.h @@ -114,6 +114,7 @@ public: int CountedObjects; int kicked; int dredge; + int zpos; bool isDualWielding; bool stillNeeded; Player * lastController; diff --git a/projects/mtg/src/CardDescriptor.cpp b/projects/mtg/src/CardDescriptor.cpp index ce412411a..5be1448a7 100644 --- a/projects/mtg/src/CardDescriptor.cpp +++ b/projects/mtg/src/CardDescriptor.cpp @@ -18,6 +18,8 @@ CardDescriptor::CardDescriptor() manacostComparisonMode = COMPARISON_NONE; counterComparisonMode = COMPARISON_NONE; convertedManacost = -1; + zposComparisonMode = COMPARISON_NONE; + zposition = -1; compareName =""; nameComparisonMode = COMPARISON_NONE; colorComparisonMode = COMPARISON_NONE; @@ -26,12 +28,12 @@ CardDescriptor::CardDescriptor() CDdamager = 0; CDgeared = 0; CDblocked = 0; - CDcanProduceC = 0; + /*CDcanProduceC = 0; CDcanProduceG = 0; CDcanProduceU = 0; CDcanProduceR = 0; CDcanProduceB = 0; - CDcanProduceW = 0; + CDcanProduceW = 0;*/ CDnocolor = 0; } @@ -145,6 +147,8 @@ MTGCardInstance * CardDescriptor::match_or(MTGCardInstance * card) return NULL; if (manacostComparisonMode && !valueInRange(manacostComparisonMode, card->myconvertedcost, convertedManacost)) return NULL; + if (zposComparisonMode && !valueInRange(zposComparisonMode, card->zpos, zposition)) + return NULL; if (nameComparisonMode && compareName != card->name) return NULL; return card; @@ -186,6 +190,8 @@ MTGCardInstance * CardDescriptor::match_and(MTGCardInstance * card) match = NULL; if (manacostComparisonMode && !valueInRange(manacostComparisonMode, card->myconvertedcost, convertedManacost)) match = NULL; + if (zposComparisonMode && !valueInRange(zposComparisonMode, card->zpos, zposition)) + match = NULL; if(nameComparisonMode && compareName != card->name) match = NULL; @@ -256,7 +262,7 @@ MTGCardInstance * CardDescriptor::match(MTGCardInstance * card) match = NULL; } } - + /* if ((CDcanProduceC == -1 && card->canproduceC == 1) || (CDcanProduceC == 1 && card->canproduceC == 0)) { match = NULL; @@ -286,7 +292,7 @@ MTGCardInstance * CardDescriptor::match(MTGCardInstance * card) { match = NULL; } - + */ if ((CDnocolor == -1 && card->getColor() == 0)) { match = NULL; diff --git a/projects/mtg/src/CardDisplay.cpp b/projects/mtg/src/CardDisplay.cpp index 5ad0a38bd..7675763d0 100644 --- a/projects/mtg/src/CardDisplay.cpp +++ b/projects/mtg/src/CardDisplay.cpp @@ -44,9 +44,11 @@ void CardDisplay::init(MTGGameZone * zone) resetObjects(); if (!zone) return; start_item = 0; - for (int i = 0; i < zone->nb_cards; i++) + vector newCD (zone->cards.rbegin(), zone->cards.rend()); + for (int i = 0; i < zone->nb_cards; i++)//invert display so the top will always be the first one to show { - AddCard(zone->cards[i]); + //AddCard(zone->cards[i]); + AddCard(newCD[i]); } if (mObjects.size()) mObjects[0]->Entering(); } @@ -78,7 +80,8 @@ void CardDisplay::Update(float dt) bool update = false; if (zone) - { + {//invert display so the top will always be the first one to show + vector newCD (zone->cards.rbegin(), zone->cards.rend()); int size = zone->cards.size(); for (int i = start_item; i < start_item + nb_displayed_items && i < (int)(mObjects.size()); i++) { @@ -88,7 +91,7 @@ void CardDisplay::Update(float dt) break; } CardGui * cardg = (CardGui *) mObjects[i]; - if (cardg->card != zone->cards[i]) update = true; + if (cardg->card != newCD[i]) update = true; } } PlayGuiObjectController::Update(dt); diff --git a/projects/mtg/src/CardGui.cpp b/projects/mtg/src/CardGui.cpp index 13f75e4b6..bfd80dea4 100644 --- a/projects/mtg/src/CardGui.cpp +++ b/projects/mtg/src/CardGui.cpp @@ -545,7 +545,7 @@ void CardGui::AlternateRender(MTGCard * card, const Pos& pos) JRenderer * renderer = JRenderer::GetInstance(); JQuadPtr q; MTGCardInstance * thiscard = dynamic_cast (card); - + int zpos = 0; float x = pos.actX; vectoritems = gModRules.cardgui.background; @@ -569,6 +569,7 @@ void CardGui::AlternateRender(MTGCard * card, const Pos& pos) //draw black border ingame only if(thiscard && thiscard->getObserver()) { + zpos = thiscard->zpos; renderer->FillRoundRect((pos.actX - (pos.actZ * 84.f))-11.5f,(pos.actY - (pos.actZ * 119.7f))-14.f,pos.actZ * 168.f + 6.5f,pos.actZ * 239.4f + 12.f,8.f,ARGB(255,5,5,5)); renderer->DrawRoundRect((pos.actX - (pos.actZ * 84.f))-11.5f,(pos.actY - (pos.actZ * 119.7f))-14.f,pos.actZ * 168.f + 6.5f,pos.actZ * 239.4f + 12.f,8.f,ARGB(50,240,240,240)); } @@ -732,7 +733,7 @@ void CardGui::AlternateRender(MTGCard * card, const Pos& pos) if (found != string::npos) { stringstream st; - st << card->getMTGId(); + st << "id:" << card->getMTGId() << " zpos:" << zpos; formattedfield = FormattedData(formattedfield, "mtgid", st.str()); } @@ -1509,6 +1510,12 @@ bool CardGui::FilterCard(MTGCard * _card,string filter) { cd.setToughness(comparisonCriterion); cd.toughnessComparisonMode = comparisonMode; + //zpos restrictions + } + else if (attribute.find("zpos") != string::npos) + {//using > or < don't have effect unless like this: >= or <= or = + cd.zposition = comparisonCriterion; + cd.zposComparisonMode = comparisonMode; //Manacost restrictions } else if (attribute.find("manacost") != string::npos) diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index 413319edd..94d6397af 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -672,6 +672,16 @@ void GameObserver::gameStateBasedEffects() for (int i = 0; i < ManaCost::MANA_PAID_WITH_BESTOW +1; i++) card->alternateCostPaid[i] = 0; } + //test zone position + if(card && (isInGrave(card)||isInHand(card)||isInExile(card))) + { + card->zpos = w+1; + } + else if(card && (isInLibrary(card))) + {//invert so we get the top one... + int onum = w+1; + card->zpos = abs(onum - zone->nb_cards)+1; + } } diff --git a/projects/mtg/src/MTGCardInstance.cpp b/projects/mtg/src/MTGCardInstance.cpp index be1c0b1fe..d05eaf718 100644 --- a/projects/mtg/src/MTGCardInstance.cpp +++ b/projects/mtg/src/MTGCardInstance.cpp @@ -237,6 +237,7 @@ void MTGCardInstance::initMTGCI() stillNeeded = true; kicked = 0; dredge = 0; + zpos = 0; chooseacolor = -1; chooseasubtype = ""; coinSide = -1; diff --git a/projects/mtg/src/MTGRules.cpp b/projects/mtg/src/MTGRules.cpp index d981838b5..a8bcbcbf3 100644 --- a/projects/mtg/src/MTGRules.cpp +++ b/projects/mtg/src/MTGRules.cpp @@ -3257,14 +3257,17 @@ int MTGLegendRule::added(MTGCardInstance * card) { map::iterator it; int destroy = 0; - + vectoroldCards; for (it = cards.begin(); it != cards.end(); it++) { MTGCardInstance * comparison = (*it).first; if (comparison != card && comparison->controller() == card->controller() && !(comparison->getName().compare(card->getName()))) - if (!(game->getCurrentTargetChooser() || game->mLayers->actionLayer()->isWaitingForAnswer())) + if (!(game->getCurrentTargetChooser() || game->mLayers->actionLayer()->isWaitingForAnswer())) + { + oldCards.push_back(comparison); destroy = 1; - } + } + }/* if(destroy) { vectorselection; @@ -3287,6 +3290,27 @@ int MTGLegendRule::added(MTGCardInstance * card) SAFE_DELETE(LegendruleGeneric); MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), NULL, myClone,true,selection,card->controller(),"Legendary Rule"); menuChoice->addToGame(); + }*/ + //reverted to old since this new code conflicts with reveal targetchooser + if(destroy) + { + vectorselection; + MultiAbility * multi = NEW MultiAbility(game, game->mLayers->actionLayer()->getMaxId(), card, card, NULL); + for(unsigned int i = 0;i < oldCards.size();i++) + { + AAMover *a = NEW AAMover(game, game->mLayers->actionLayer()->getMaxId(), card, oldCards[i],"ownergraveyard","Keep New"); + a->oneShot = true; + multi->Add(a); + } + multi->oneShot = 1; + MTGAbility * a1 = multi; + selection.push_back(a1); + AAMover *b = NEW AAMover(game, game->mLayers->actionLayer()->getMaxId(), card, card,"ownergraveyard","Keep Old"); + b->oneShot = true; + MTGAbility * b1 = b; + selection.push_back(b1); + MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), card, card,true,selection,card->controller(),"Legendary Rule"); + menuChoice->addToGame(); } return 1; } @@ -3341,9 +3365,12 @@ int MTGPlaneWalkerRule::added(MTGCardInstance * card) { MTGCardInstance * comparison = (*it).first; if (comparison != card && comparison->types == card->types && comparison->controller() == card->controller()) - if (!(game->getCurrentTargetChooser() || game->mLayers->actionLayer()->isWaitingForAnswer())) + if (!(game->getCurrentTargetChooser() || game->mLayers->actionLayer()->isWaitingForAnswer())) + { + oldCards.push_back(comparison); destroy = 1; - } + } + }/* if (destroy) { vectorselection; @@ -3366,6 +3393,28 @@ int MTGPlaneWalkerRule::added(MTGCardInstance * card) SAFE_DELETE(PWruleGeneric); MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), NULL, myClone,true,selection,card->controller(),"Planeswalker Uniqueness Rule"); menuChoice->addToGame(); + }*/ + //reverted to old since this new code conflicts with reveal targetchooser + if (destroy) + { + vectorselection; + + MultiAbility * multi = NEW MultiAbility(game,game->mLayers->actionLayer()->getMaxId(), card, card, NULL); + for(unsigned int i = 0;i < oldCards.size();i++) + { + AAMover *a = NEW AAMover(game, game->mLayers->actionLayer()->getMaxId(), card, oldCards[i],"ownergraveyard","Keep New"); + a->oneShot = true; + multi->Add(a); + } + multi->oneShot = 1; + MTGAbility * a1 = multi; + selection.push_back(a1); + AAMover *b = NEW AAMover(game, game->mLayers->actionLayer()->getMaxId(), card, card,"ownergraveyard","Keep Old"); + b->oneShot = true; + MTGAbility * b1 = b; + selection.push_back(b1); + MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), card, card,true,selection,card->controller(),"Planeswalker Rule"); + menuChoice->addToGame(); } return 1; } diff --git a/projects/mtg/src/TargetChooser.cpp b/projects/mtg/src/TargetChooser.cpp index be0466166..a80822c21 100644 --- a/projects/mtg/src/TargetChooser.cpp +++ b/projects/mtg/src/TargetChooser.cpp @@ -579,7 +579,7 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta { cd->CDdamager = 1; } - } + }/* //can produce mana else if (attribute.find("cmana") != string::npos) { @@ -646,7 +646,7 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta { cd->CDcanProduceW = 1; } - } + }*/ else if (attribute.find("multicolor") != string::npos) { //card is multicolored? @@ -674,6 +674,12 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta { cd->setToughness(comparisonCriterion); cd->toughnessComparisonMode = comparisonMode; + //zpos restrictions + } + else if (attribute.find("zpos") != string::npos) + { + cd->zposition = comparisonCriterion; + cd->zposComparisonMode = comparisonMode; //Manacost restrictions } else if (attribute.find("manacost") != string::npos) From a9b42127d1bc0ad4aae542a6fc2b5b7c26f13459 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Wed, 15 Feb 2017 07:30:13 +0800 Subject: [PATCH 17/26] added mypos mypos returns cards zpos (zone position) --- projects/mtg/include/AllAbilities.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 6c6140495..b5bc6110a 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -997,6 +997,10 @@ private: intValue += card->controller()->game->inPlay->cards[j]->power; } } + else if (s == "mypos") + {//hand,exile,grave & library only (library zpos is inverted so the recent one is always the top) + intValue = card->zpos; + } else if (s == "revealedp") { if (card->revealedLast) From 60d7675a368e67b712dde6524f4bc0b47ffc713f Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Wed, 15 Feb 2017 10:27:56 +0800 Subject: [PATCH 18/26] necroed hide cards using necroed also fix castcard target if its a land. --- projects/mtg/include/AllAbilities.h | 1 + projects/mtg/include/MTGDefinitions.h | 3 ++- projects/mtg/src/AllAbilities.cpp | 36 ++++++++++++++++++-------- projects/mtg/src/CardGui.cpp | 37 ++++++++++++++++++++++++--- projects/mtg/src/MTGAbility.cpp | 1 + projects/mtg/src/MTGDefinitions.cpp | 3 ++- 6 files changed, 65 insertions(+), 16 deletions(-) diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index b5bc6110a..4968f9630 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -2115,6 +2115,7 @@ public: class AAMover: public ActivatedAbility { public: + bool necro; string destination; MTGAbility * andAbility; string named; diff --git a/projects/mtg/include/MTGDefinitions.h b/projects/mtg/include/MTGDefinitions.h index 678a847a0..86486e21a 100644 --- a/projects/mtg/include/MTGDefinitions.h +++ b/projects/mtg/include/MTGDefinitions.h @@ -265,7 +265,8 @@ class Constants CANTCREW = 143, HIDDENFACE = 144, ANYTYPEOFMANA = 145, - NB_BASIC_ABILITIES = 146, + NECROED = 146, + NB_BASIC_ABILITIES = 147, RARITY_S = 'S', //Special Rarity RARITY_M = 'M', //Mythics diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index e2c562873..41aa9f93c 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -4391,6 +4391,7 @@ AAMover::AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTG andAbility = NULL; if(!named.size() && source->controller()->isAI()) named = overrideNamed(destination); + necro = false; } MTGGameZone * AAMover::destinationZone(Targetable * target) @@ -4411,6 +4412,8 @@ int AAMover::resolve() MTGCardInstance * _target = (MTGCardInstance *) target; if (target) { + if(necro) + _target->basicAbilities[Constants::NECROED] = 1; Player* p = _target->controller(); if (p) { @@ -4496,18 +4499,23 @@ int AAMover::resolve() MTGCardInstance *newTarget = p->game->putInZone(_target, fromZone, destZone); /*while(_target->next) _target = _target->next;*/ - if(andAbility) + if(newTarget) { - MTGAbility * andAbilityClone = andAbility->clone(); - andAbilityClone->target = newTarget; - if(andAbility->oneShot) + if(necro) + newTarget->basicAbilities[Constants::NECROED] = 1; + if(andAbility) { - andAbilityClone->resolve(); - SAFE_DELETE(andAbilityClone); - } - else - { - andAbilityClone->addToGame(); + MTGAbility * andAbilityClone = andAbility->clone(); + andAbilityClone->target = newTarget; + if(andAbility->oneShot) + { + andAbilityClone->resolve(); + SAFE_DELETE(andAbilityClone); + } + else + { + andAbilityClone->addToGame(); + } } } } @@ -8104,7 +8112,13 @@ int AACastCard::resolveSpell() if (_target) { if (_target->isLand()) - putinplay = true; + { + MTGCardInstance * copy = _target->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->battlefield,noEvent); + copy->changeController(source->controller(),true); + this->forceDestroy = true; + processed = true; + return 1; + } Spell * spell = NULL; MTGCardInstance * copy = NULL; diff --git a/projects/mtg/src/CardGui.cpp b/projects/mtg/src/CardGui.cpp index bfd80dea4..88a0dcae3 100644 --- a/projects/mtg/src/CardGui.cpp +++ b/projects/mtg/src/CardGui.cpp @@ -502,16 +502,32 @@ void CardGui::Render() } } + //shadow that covers the whole card for targetchooser... if (tc && !tc->canTarget(card)) { if (!shadow) shadow = card->getObserver()->getResourceManager()->GetQuad("shadow"); if (shadow) { - shadow->SetColor(ARGB(200,255,255,255)); + shadow->SetColor(ARGB(190,255,255,255)); renderer->RenderQuad(shadow.get(), actX, actY, actT, (28 * actZ + 1) / 16, 40 * actZ / 16); } } + + //for necro + if (!shadow) + shadow = card->getObserver()->getResourceManager()->GetQuad("shadow"); + if (shadow) + { + int myA = 0; + if(game && card->has(Constants::NECROED))//no peeking... + myA = 255; + else + myA = 0; + + shadow->SetColor(ARGB(myA,255,255,255)); + renderer->RenderQuad(shadow.get(), actX, actY, actT, (28 * actZ + 1) / 16, 40 * actZ / 16); + } PlayGuiObject::Render(); } @@ -1151,6 +1167,20 @@ void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb, bool noborder JQuadPtr quad = thumb ? WResourceManager::Instance()->RetrieveCard(card, RETRIEVE_THUMB) : WResourceManager::Instance()->RetrieveCard(card); MTGCardInstance * kcard = dynamic_cast(card); + GameObserver * game = NULL; + //TargetChooser * tc = NULL; + bool myA = true; + if(kcard) + { + game = kcard->getObserver(); + if(game) + { + if(kcard->has(Constants::NECROED)) + myA = false; + else + myA = true; + } + } if(kcard && !kcard->isToken && kcard->name != kcard->model->data->name) { MTGCard * fcard = MTGCollection()->getCardByName(kcard->name); @@ -1162,7 +1192,7 @@ void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb, bool noborder quad = thumb ? WResourceManager::Instance()->RetrieveCardToken(tcard, RETRIEVE_THUMB, 1, abs(kcard->copiedID)) : WResourceManager::Instance()->RetrieveCardToken(tcard, RETRIEVE_NORMAL, 1, abs(kcard->copiedID)); } - if (quad.get()) + if (quad.get() && myA) { if (quad->mHeight < quad->mWidth) { @@ -1216,7 +1246,8 @@ void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb, bool noborder //DebugTrace("Unable to fetch image: " << card->getImageName()); // If we come here, we do not have the picture. - AlternateRender(card, pos); + if(myA) + AlternateRender(card, pos); } string CardGui::FormattedData(string data, string replace, string value) diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index adbeeb958..11bc1df3e 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -2797,6 +2797,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG MTGAbility * a = NEW AAMover(observer, id, card, target, splitMove[1],newName); a->oneShot = true; + ((AAMover*)a)->necro = s.find("hiddenmoveto") != string::npos?true:false; if(storedAndAbility.size()) { string stored = storedAndAbility; diff --git a/projects/mtg/src/MTGDefinitions.cpp b/projects/mtg/src/MTGDefinitions.cpp index c9d02d911..2f1ac37d8 100644 --- a/projects/mtg/src/MTGDefinitions.cpp +++ b/projects/mtg/src/MTGDefinitions.cpp @@ -176,7 +176,8 @@ const char* Constants::MTGBasicAbilities[] = { "oppnomaxhand", "cantcrew", "hiddenface",//test for hiding card - "anytypeofmana" + "anytypeofmana", + "necroed"//hide necored }; map Constants::MTGBasicAbilitiesMap; From 90ed6e1fdd7ba4a15ef353fa1302d9027d69456e Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Thu, 16 Feb 2017 00:28:07 +0800 Subject: [PATCH 19/26] chooseacolor indicator replaced text with color filled rectangle --- projects/mtg/src/AllAbilities.cpp | 2 ++ projects/mtg/src/CardGui.cpp | 31 +++++++++++++++++++++++-------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index 41aa9f93c..9bc10a671 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -4183,6 +4183,8 @@ int AACloner::resolve() Spell * spell = NEW Spell(game, myClone); spell->source->isToken = 1; spell->resolve(); + spell->source->owner = targetPlayer; + spell->source->lastController = targetPlayer; spell->source->fresh = 1; spell->source->entersBattlefield = 1; spell->source->model = spell->source; diff --git a/projects/mtg/src/CardGui.cpp b/projects/mtg/src/CardGui.cpp index 88a0dcae3..2734f14a4 100644 --- a/projects/mtg/src/CardGui.cpp +++ b/projects/mtg/src/CardGui.cpp @@ -460,15 +460,30 @@ void CardGui::Render() if(card->chooseacolor >= 1) { if(card->chooseacolor == 1) - buff += "\n-Green"; + { + renderer->FillRect(actX - 10 * actZ, actY - (1 * actZ), 6.f,6.f,ARGB(255,0,255,0)); + renderer->DrawRect(actX - 10 * actZ, actY - (1 * actZ), 6.f,6.f,ARGB(180,10,10,10)); + } else if(card->chooseacolor == 2) - buff += "\n-Blue"; + { + renderer->FillRect(actX - 10 * actZ, actY - (1 * actZ), 6.f,6.f,ARGB(255,0,206,209)); + renderer->DrawRect(actX - 10 * actZ, actY - (1 * actZ), 6.f,6.f,ARGB(180,10,10,10)); + } else if(card->chooseacolor == 3) - buff += "\n-Red"; + { + renderer->FillRect(actX - 10 * actZ, actY - (1 * actZ), 6.f,6.f,ARGB(255,255,0,0)); + renderer->DrawRect(actX - 10 * actZ, actY - (1 * actZ), 6.f,6.f,ARGB(180,10,10,10)); + } else if(card->chooseacolor == 4) - buff += "\n-Black"; + { + renderer->FillRect(actX - 10 * actZ, actY - (1 * actZ), 6.f,6.f,ARGB(255,20,20,20)); + renderer->DrawRect(actX - 10 * actZ, actY - (1 * actZ), 6.f,6.f,ARGB(180,210,210,210)); + } else if(card->chooseacolor == 5) - buff += "\n-White"; + { + renderer->FillRect(actX - 10 * actZ, actY - (1 * actZ), 6.f,6.f,ARGB(255,250,235,215)); + renderer->DrawRect(actX - 10 * actZ, actY - (1 * actZ), 6.f,6.f,ARGB(180,10,10,10)); + } } if(!alternate && buff != "" && game->gameType() == GAME_TYPE_CLASSIC)//it seems that other game modes makes cards as tokens!!! hmmm... { @@ -476,8 +491,8 @@ void CardGui::Render() char buffer[200]; sprintf(buffer, "%s", buff.c_str()); mFont->SetColor(ARGB(static_cast(actA),255,215,0));//Gold indicator - mFont->SetScale(0.8f); - mFont->DrawString(buffer, actX - 10 * actZ, actY - (16 * actZ)); + mFont->SetScale(actZ); + mFont->DrawString(buffer, actX - 10 * actZ, actY - (18.3f * actZ)); mFont->SetScale(1); } @@ -497,7 +512,7 @@ void CardGui::Render() sprintf(buffer, "%i", card->counters->counters[0]->nb); mFont->SetColor(ARGB(static_cast(actA),255,255,255)); mFont->SetScale(actZ); - mFont->DrawString(buffer, actX - 10 * actZ, actY - (12 * actZ)); + mFont->DrawString(buffer, actX - 10 * actZ, actY - (10.8f * actZ)); mFont->SetScale(1); } } From 6c28496dd8b9a2c92e3bda9faa4acf7f48ccecc8 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Thu, 16 Feb 2017 00:42:54 +0800 Subject: [PATCH 20/26] reduced efficiency --- projects/mtg/src/AIPlayerBaka.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/mtg/src/AIPlayerBaka.cpp b/projects/mtg/src/AIPlayerBaka.cpp index 1fdd47723..185d92ec0 100644 --- a/projects/mtg/src/AIPlayerBaka.cpp +++ b/projects/mtg/src/AIPlayerBaka.cpp @@ -620,7 +620,7 @@ int OrderedAIAction::getEfficiency() else if (GenericRevealAbility * grA = dynamic_cast(a)) { if(grA->source->getAICustomCode().size()) - efficiency = 50 + (owner->getRandomGenerator()->random() % 50); + efficiency = 45 + (owner->getRandomGenerator()->random() % 50); else efficiency = 0; } From c70762f871280d192b3bc78238e614b30a89e4c6 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Thu, 16 Feb 2017 02:39:03 +0800 Subject: [PATCH 21/26] readded modified rule --- projects/mtg/include/GameObserver.h | 1 + projects/mtg/src/AllAbilities.cpp | 2 +- projects/mtg/src/GameObserver.cpp | 3 +++ projects/mtg/src/MTGRules.cpp | 26 ++++++++++++++------------ 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/projects/mtg/include/GameObserver.h b/projects/mtg/include/GameObserver.h index a658f4396..6e2bc01e6 100644 --- a/projects/mtg/include/GameObserver.h +++ b/projects/mtg/include/GameObserver.h @@ -142,6 +142,7 @@ class GameObserver{ int receiveEvent(WEvent * event); bool connectRule; + bool LPWeffect; void logAction(Player* player, const string& s=""); void logAction(int playerId, const string& s="") { diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index 9bc10a671..1ca746761 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -192,7 +192,7 @@ void MTGRevealingCards::Update(float dt) //if any carddisplays are open, dont do anything until theyre closed, then wait your turn if multiple reveals trigger. return; } - if (game->mLayers->actionLayer()->menuObject) + if (game->mLayers->actionLayer()->menuObject || game->LPWeffect) return;//dont do any of this if a menuobject exist. if (!source->getObserver()->mLayers->actionLayer()->getCurrentTargetChooser() && !revealDisplay && !initCD) { diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index 94d6397af..c891c4c0d 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -50,6 +50,7 @@ void GameObserver::cleanup() replacementEffects = NEW ReplacementEffects(); combatStep = BLOCKERS; connectRule = false; + LPWeffect = false; actionsList.clear(); gameTurn.clear(); OpenedDisplay = NULL; @@ -106,6 +107,7 @@ GameObserver::GameObserver(WResourceManager *output, JGE* input) combatStep = BLOCKERS; mRules = NULL; connectRule = false; + LPWeffect = false; mLoading = false; mLayers = NULL; mTrash = new Trash(); @@ -1052,6 +1054,7 @@ void GameObserver::gameStateBasedEffects() userRequestNextGamePhase(); } + this->LPWeffect = false; //WEventGameStateBasedChecked event checked receiveEvent(NEW WEventGameStateBasedChecked()); } diff --git a/projects/mtg/src/MTGRules.cpp b/projects/mtg/src/MTGRules.cpp index a8bcbcbf3..d838ecb96 100644 --- a/projects/mtg/src/MTGRules.cpp +++ b/projects/mtg/src/MTGRules.cpp @@ -3257,17 +3257,18 @@ int MTGLegendRule::added(MTGCardInstance * card) { map::iterator it; int destroy = 0; - vectoroldCards; + //vectoroldCards; for (it = cards.begin(); it != cards.end(); it++) { MTGCardInstance * comparison = (*it).first; if (comparison != card && comparison->controller() == card->controller() && !(comparison->getName().compare(card->getName()))) if (!(game->getCurrentTargetChooser() || game->mLayers->actionLayer()->isWaitingForAnswer())) { - oldCards.push_back(comparison); + //oldCards.push_back(comparison); destroy = 1; + game->LPWeffect = true; } - }/* + } if(destroy) { vectorselection; @@ -3290,9 +3291,9 @@ int MTGLegendRule::added(MTGCardInstance * card) SAFE_DELETE(LegendruleGeneric); MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), NULL, myClone,true,selection,card->controller(),"Legendary Rule"); menuChoice->addToGame(); - }*/ + } //reverted to old since this new code conflicts with reveal targetchooser - if(destroy) + /*if(destroy) { vectorselection; MultiAbility * multi = NEW MultiAbility(game, game->mLayers->actionLayer()->getMaxId(), card, card, NULL); @@ -3311,7 +3312,7 @@ int MTGLegendRule::added(MTGCardInstance * card) selection.push_back(b1); MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), card, card,true,selection,card->controller(),"Legendary Rule"); menuChoice->addToGame(); - } + }*/ return 1; } @@ -3360,17 +3361,18 @@ int MTGPlaneWalkerRule::added(MTGCardInstance * card) { map::iterator it; int destroy = 0; - vectoroldCards; + //vectoroldCards; for (it = cards.begin(); it != cards.end(); it++) { MTGCardInstance * comparison = (*it).first; if (comparison != card && comparison->types == card->types && comparison->controller() == card->controller()) if (!(game->getCurrentTargetChooser() || game->mLayers->actionLayer()->isWaitingForAnswer())) { - oldCards.push_back(comparison); + //oldCards.push_back(comparison); destroy = 1; + game->LPWeffect = true; } - }/* + } if (destroy) { vectorselection; @@ -3393,9 +3395,9 @@ int MTGPlaneWalkerRule::added(MTGCardInstance * card) SAFE_DELETE(PWruleGeneric); MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), NULL, myClone,true,selection,card->controller(),"Planeswalker Uniqueness Rule"); menuChoice->addToGame(); - }*/ + } //reverted to old since this new code conflicts with reveal targetchooser - if (destroy) + /*if (destroy) { vectorselection; @@ -3415,7 +3417,7 @@ int MTGPlaneWalkerRule::added(MTGCardInstance * card) selection.push_back(b1); MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), card, card,true,selection,card->controller(),"Planeswalker Rule"); menuChoice->addToGame(); - } + }*/ return 1; } From 5a3a32462d67404d402400e8ac6faa1480608c20 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Thu, 16 Feb 2017 02:44:42 +0800 Subject: [PATCH 22/26] first set of changes updated some cards --- .../bin/Res/sets/primitives/borderline.txt | 10 - projects/mtg/bin/Res/sets/primitives/mtg.txt | 487 ++++++++++++------ .../bin/Res/sets/primitives/unsupported.txt | 33 -- projects/mtg/bin/Res/test/welkin_hawk.txt | 2 +- projects/mtg/bin/Res/test/windswept_heath.txt | 2 +- 5 files changed, 345 insertions(+), 189 deletions(-) diff --git a/projects/mtg/bin/Res/sets/primitives/borderline.txt b/projects/mtg/bin/Res/sets/primitives/borderline.txt index ee25dd475..243e1cafd 100644 --- a/projects/mtg/bin/Res/sets/primitives/borderline.txt +++ b/projects/mtg/bin/Res/sets/primitives/borderline.txt @@ -412,16 +412,6 @@ type=Sorcery text=Destroy all creatures target player controls. For each creature that died this way, put two 1/1 red Goblin creature tokens onto the battlefield under that player's control. [/card] [card] -name=Necropotence -#exile cards are faceup -auto=@movedTo(*|mygraveyard):all(trigger[to]) moveTo(exile) -auto=phasealter(remove,draw,controller) -auto={L:1}:name(exile) reveal:1 optionone all(*|reveal) transforms((,newability[moveto(exile)],newability[phaseaction[my endofturn once checkex] moveto(ownerhand)])) optiononeend revealend -text=Skip your draw step. -- Whenever you discard a card, exile that card from your graveyard. -- Pay 1 life: Exile the top card of your library face down. Put that card into your hand at the beginning of your next end step. -mana={B}{B}{B} -type=Enchantment -[/card] -[card] name=Nightshade Seer auto={2}{B}{T}:foreach(*[black]|myhand) -1/-1 target(creature) text={2}{B}, {T}: Reveal any number of black cards in your hand. Target creature gets -X/-X until end of turn, where X is the number of cards revealed this way. diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index 665508a12..76fdb9724 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -68,7 +68,7 @@ toughness=3 [card] name=Abbot of Keral Keep auto=@movedTo(*[-creature]|mystack):1/1 ueot -auto=reveal:1 optionone all(*|reveal) moveto(exile) and!( transforms((,newability[canplayfromexile])) ueot)! optiononeend revealend +auto=moveto(exile) and!( transforms((,canplayfromexile)) ueot )! all(*[zpos=1]|mylibrary) text=Prowess (Whenever you cast a noncreature spell, this creature gets +1/+1 until end of turn.) -- When Abbot of Keral Keep enters the battlefield, exile the top card of your library. Until end of turn, you may play that card. mana={1}{R} type=Creature @@ -236,7 +236,8 @@ name=Absorb Vis target=player auto=life:-4 auto=life:4 controller -autohand=__BASIC_LANDCYCLING__({1}{B}) +aicode=activate target(land[basic]|mylibrary) moveto(myhand) +autohand={1}{B}{cycle}:name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>land[basic]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Target player loses 4 life and you gain 4 life. -- Basic landcycling {1}{B} ({1}{B}, Discard this card: Search your library for a basic land card, reveal it, and put it into your hand. Then shuffle your library.) mana={6}{B} type=Sorcery @@ -762,7 +763,7 @@ type=Sorcery [/card] [card] name=Act on Impulse -auto=name(exile) reveal:3 optionone all(*|reveal) moveto(exile) and!( transforms((,newability[canplayfromexile])) ueot)! optiononeend revealend +auto=moveto(exile) and!( transforms((,canplayfromexile)) ueot )! all(*[zpos<=3]|mylibrary) text=Exile the top three cards of your library. Until end of turn, you may play cards exiled this way. (If you cast a spell this way, you still pay its costs. You can play a land this way only if you have an available land play remaining.) mana={2}{R} type=Sorcery @@ -1029,7 +1030,7 @@ toughness=4 [card] name=Aerial Caravan abilities=flying -auto={1}{U}{U}:name(exile) reveal:1 optionone all(*|reveal) moveto(exile) and!( transforms((,newability[canplayfromexile])) ueot )! optiononeend revealend +auto={1}{U}{U}:moveto(exile) and!( transforms((,canplayfromexile)) ueot )! all(*[zpos=1]|mylibrary) text=Flying -- {1}{U}{U}: Exile the top card of your library. Until end of turn, you may play that card. (Reveal the card as you exile it.) mana={4}{U}{U} type=Creature @@ -1969,6 +1970,7 @@ subtype=Ajani [card] name=Ajani Unyielding auto=counter(0/0,4,loyalty) +aicode=activate target(<3>*[zpos<=3]|mylibrary) name(revealed card) moveto(myhand) name(revealed card) and!(if cantargetcard(land|*) then bottomoflibrary)! auto={C(0/0,2,Loyalty)}:name(+2: Reveal Cards) reveal:3 optionone name(Get Nonland Cards) target(<3>*[-land]|reveal) moveto(myhand) optiononeend optiontwo name(put on bottom) target(<3>*|reveal) bottomoflibrary optiontwoend revealend auto={C(0/0,-2,Loyalty)}:name(-2: Exile Target) target(creature) dynamicability moveTo(exile) auto={C(0/0,-9,Loyalty)}:name(-9: Ultimate) counter(1/1,5) all(creature|mybattlefield) && counter(0/0,5,loyalty) all(other planeswalker|mybattlefield) @@ -6283,7 +6285,8 @@ type=Enchantment [card] name=Ash Barrens auto={t}:add{c} -autohand=__BASIC_LANDCYCLING__({1}) +aicode=activate target(land[basic]|mylibrary) moveto(myhand) +autohand={1}{cycle}:name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>land[basic]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text={T}: Add {C} to your mana pool. -- Basic landcycling {1} ({1}, Discard this card: Search your library for a basic land card, reveal it, and put it into your hand. Then shuffle your library.) type=Land [/card] @@ -6331,6 +6334,17 @@ power=6 toughness=6 [/card] [card] +name=Ashen Ghoul +abilities=haste +autograveyard={B}:moveto(ownerbattlefield) restriction{type(creature[zpos>=myposplus1plusend]|mygraveyard)~morethan~2,myupkeeponly} +text=Haste -- {B}: Return Ashen Ghoul from your graveyard to the battlefield. Activate this ability only during your upkeep and only if three or more creature cards are above Ashen Ghoul. +mana={3}{B} +type=Creature +subtype=Zombie +power=3 +toughness=1 +[/card] +[card] name=Ashen Monstrosity abilities=haste,mustattack text=Haste -- Ashen Monstrosity attacks each turn if able. @@ -6920,6 +6934,7 @@ toughness=1 [/card] [card] name=Augury Adept +aicode=activate target(*[zpos=1]|mylibrary) moveto(myhand) and!(dynamicability)! auto=@combatdamaged(player) from(this):reveal:1 optionone name(Reveal) target(*|reveal) transforms((,newability[life:manacost controller])) forever optiononeend optiontwo choice all(*|reveal) moveto(myhand) optiontwoend revealend text=Whenever Augury Adept deals combat damage to a player, reveal the top card of your library and put that card into your hand. You gain life equal to its converted mana cost. mana={1}{WU}{WU} @@ -10078,6 +10093,7 @@ type=Instant [/card] [card] name=Beast Hunt +aicode=activate target(<3>*[zpos<=3]|mylibrary) name(revealed card) moveto(myhand) name(revealed card) and!(if cantargetcard(*[-creature]|*) then moveto(mygraveyard))! auto=reveal:3 optionone name(Reveal) target(<3>creature|reveal) moveto(myhand) optiononeend optiontwo choice all(*|reveal) moveto(mygraveyard) optiontwoend revealend text=Reveal the top three cards of your library. Put all creature cards revealed this way into your hand and the rest into your graveyard. mana={3}{G} @@ -10259,7 +10275,9 @@ type=Enchantment [card] name=Behold the Beyond auto=reject all(*|myhand) -auto=moveto(myhand) target(<3>*|mylibrary) +abilities=hiddenface +aicode=activate moveto(myhand) target(<3>*|mylibrary) +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<3>*|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Discard your hand. Search your library for three cards and put those cards into your hand. Then shuffle your library. mana={5}{B}{B} type=Sorcery @@ -12567,6 +12585,7 @@ toughness=3 [/card] [card] name=Bloodline Shaman +aicode=activate transforms((,newability[if type(creature[chosentype;zpos=1]|mylibrary)~morethan~0 then target(creature[chosentype;zpos=1]|mylibrary) moveto(ownerbattlefield) else target(*[zpos=1]|mylibrary) moveto(mygraveyard)])) ueot auto=chooseatype {t}:transforms((,newability[reveal:1 optionone name(Reveal) target(creature[chosentype]|reveal) moveto(myhand) optiononeend optiontwo name(Discard) target(<1>*|reveal) moveto(mygraveyard) optiontwoend revealend])) forever chooseend text={T}: Choose a creature type. Reveal the top card of your library. If that card is a creature card of the chosen type, put it into your hand. Otherwise, put it into your graveyard. mana={1}{G} @@ -13722,6 +13741,7 @@ toughness=4 [card] name=Borborygmos Enraged auto={D(land|myhand)}:target(creature,player) damage:3 +aicode=activate target(<3>*[zpos<=3]|mylibrary) name(revealed card) moveto(myhand) name(revealed card) and!(if cantargetcard(*[-land]|*) then moveto(mygraveyard))! auto=@combatdamaged(player) from(this):reveal:3 optionone name(Reveal) target(<3>land|reveal) moveto(myhand) optiononeend optiontwo name(Send To Grave) choice all(*|reveal) moveto(mygraveyard) optiontwoend revealend text=Trample -- Whenever Borborygmos Enraged deals combat damage to a player, reveal the top three cards of your library. Put all land cards revealed this way into your hand and the rest into your graveyard. -- Discard a land card: Borborygmos Enraged deals 3 damage to target creature or player. mana={4}{R}{R}{G}{G} @@ -14467,6 +14487,7 @@ toughness=1 [/card] [card] name=Brass Herald +aicode=activate target(<4>*[zpos<=4]|mylibrary) name(revealed card) moveto(myhand) name(revealed card) and!(if cantargetcard(*[-chosentype]|*) then bottomoflibrary)! auto=chooseatype transforms((,newability[lord(creature[chosentype]|mybattlefield) 1/1],newability[reveal:4 optionone name(Reveal) target(<4>creature[chosentype]|reveal) moveto(myhand) optiononeend optiontwo target(<4>*|reveal) bottomoflibrary optiontwoend revealend])) forever chooseend text=As Brass Herald enters the battlefield, choose a creature type. -- When Brass Herald enters the battlefield, reveal the top four cards of your library. Put all creature cards of the chosen type revealed this way into your hand and the rest on the bottom of your library in any order. -- Creatures of the chosen type get +1/+1. mana={6} @@ -16351,6 +16372,7 @@ type=Sorcery [/card] [card] name=Call of the Wild +aicode=activate transforms((,newability[if type(creature[zpos=1]|mylibrary)~morethan~0 then target(creature[zpos=1]|mylibrary) moveto(ownerbattlefield) else target(*[zpos=1]|mylibrary) moveto(mygraveyard)])) ueot auto={2}{g}{g}:reveal:1 optionone target(creature|reveal) moveto(mybattlefield) optiononeend optiontwo name(Put in grave) target(<1>*|reveal) moveto(mygraveyard) optiontwoend revealend text={2}{G}{G}: Reveal the top card of your library. If it's a creature card, put it onto the battlefield. Otherwise, put it into your graveyard. mana={2}{G}{G} @@ -18501,7 +18523,7 @@ type=Instant [card] name=Chameleon Colossus abilities=protection from black,changeling -auto={2}{G}{G}:dynamicability && dynamicability +auto={2}{G}{G}:power/power ueot text=Changeling (This card is every creature type at all times.) -- Protection from black -- {2}{G}{G}: Chameleon Colossus gets +X/+X until end of turn, where X is its power. mana={2}{G}{G} type=Creature @@ -19634,6 +19656,7 @@ toughness=2 [card] name=Chromescale Drake abilities=affinityartifacts,flying +aicode=activate target(<3>*[zpos<=3]|mylibrary) name(revealed card) moveto(myhand) name(revealed card) and!(if cantargetcard(*[-artifact]|*) then moveto(mygraveyard))! auto=name(Reveal 3 cards) reveal:3 optionone name(Artifacts) target(<3>artifact|reveal) moveto(myhand) optiononeend optiontwo choice all(*|reveal) moveto(mygraveyard) optiontwoend revealend text=Affinity for artifacts (This spell costs {1} less to cast for each artifact you control.) -- Flying -- When Chromescale Drake enters the battlefield, reveal the top three cards of your library. Put all artifact cards revealed this way into your hand and the rest into your graveyard. mana={6}{U}{U}{U} @@ -21234,6 +21257,7 @@ toughness=1 [/card] [card] name=Coiling Oracle +aicode=activate target(<1>*[zpos=1]|mylibrary) name(revealed card) moveto(myhand) name(revealed card) and!(if cantargetcard(land|*) then moveto(mybattlefield))! auto=reveal:1 optionone target(land|reveal) moveto(mybattlefield) optiononeend optiontwo name(Put in hand) target(<1>*|reveal) moveto(myhand) optiontwoend revealend text=When Coiling Oracle enters the battlefield, reveal the top card of your library. If it's a land card, put it onto the battlefield. Otherwise, put that card into your hand. mana={G}{U} @@ -21503,7 +21527,7 @@ type=Instant [/card] [card] name=Commune with Lava -auto=name(exile) reveal:x revealzone(mylibrary) optionone all(*|reveal) moveto(exile) and!( transforms((,newability[canplayfromexile])) uynt )! optiononeend revealend +auto=moveto(exile) and!( transforms((,canplayfromexile)) uynt )! all(*[zpos<=castx]|mylibrary) text=Exile the top X cards of your library. Until the end of your next turn, you may play those cards. mana={X}{R}{R} type=Instant @@ -24066,8 +24090,9 @@ toughness=1 [/card] [card] name=Cruel Tutor -auto=name(search a card) moveTo(exile) and!(transforms((,newability[moveto(ownerlibrary)])) oneshot)! notatarget(*|mylibrary) -auto=life:-2 controller +abilities=hiddenface +aicode=activate moveto(mylibrary) and!(moveto(mylibrary) and!(life:-2 controller)!)! target(*|mylibrary) +auto=name(search card) reveal:plibrarycount optionone name(choose card) target(*|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(mylibrary) and!(moveto(mylibrary) and!(life:-2 controller)!)! afterrevealedend revealend text=Search your library for a card, then shuffle your library and put that card on top of it. You lose 2 life. mana={2}{B} type=Sorcery @@ -25580,6 +25605,7 @@ type=Instant [/card] [card] name=Dark Confidant +aicode=activate target(*[zpos=1]|mylibrary) moveto(myhand) and!(dynamicability)! auto=@each my upkeep:reveal:1 optionone name(Reveal) target(*|reveal) transforms((,newability[life:-manacost controller])) forever optiononeend optiontwo name(Claim your card) choice all(*|reveal) moveto(myhand) optiontwoend revealend text=At the beginning of your upkeep, reveal the top card of your library and put that card into your hand. You lose life equal to its converted mana cost. mana={1}{B} @@ -25668,7 +25694,9 @@ type=Sorcery [/card] [card] name=Dark Petition -auto=moveto(myhand) notatarget(*|mylibrary) +abilities=hiddenface +aicode=activate moveto(myhand) target(*|mylibrary) +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>*|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend auto=if type(*[instant;sorcery]|mygraveyard)~morethan~1 then add{B}{B}{B} text=Search your library for a card and put that card into your hand. Then shuffle your library. -- Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, add {B}{B}{B} to your mana pool. mana={3}{B}{B} @@ -25754,6 +25782,8 @@ type=Instant [/card] [card] name=Dark Tutelage +aicode=activate target(*[zpos=1]|mylibrary) moveto(myhand) and!(dynamicability)! +auto=@each my upkeep:reveal:1 optionone name(Reveal) target(*|reveal) transforms((,newability[life:-manacost controller])) forever optiononeend optiontwo name(Claim your card) choice all(*|reveal) moveto(myhand) optiontwoend revealend text=At the beginning of your upkeep, reveal the top card of your library and put that card into your hand. You lose life equal to its converted mana cost. mana={2}{B} type=Enchantment @@ -26902,6 +26932,15 @@ other={delve} name(Delve) type=Instant [/card] [card] +name=Death Spark +target=creature,player +auto=damage:1 +autograveyard={1}:moveto(ownerhand) restriction{type(creature[zpos=myposplus1plusend]|mygraveyard)~morethan~0,myupkeeponly} +text=Death Spark deals 1 damage to target creature or player. -- At the beginning of your upkeep, if Death Spark is in your graveyard with a creature card directly above it, you may pay {1}. If you do, return Death Spark to your hand. +mana={R} +type=Instant +[/card] +[card] name=Death Speakers abilities=protection from black text=Protection from black @@ -28143,8 +28182,9 @@ subtype=Aura [/card] [card] name=Demonic Collusion -target=*|mylibrary -auto=moveTo(myhand) +abilities=hiddenface +aicode=activate moveto(myhand) target(*|mylibrary) +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>*|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend buyback={3}{B}{B}{D(*|myhand)}{D(*|myhand)} text=Buyback - Discard two cards. (You may discard two cards in addition to any other costs as you cast this spell. If you do, put this card into your hand as it resolves.) -- Search your library for a card and put that card into your hand. Then shuffle your library. mana={3}{B}{B} @@ -28200,7 +28240,9 @@ subtype=Aura [/card] [card] name=Demonic Tutor -auto=moveTo(myhand) notatarget(*|myLibrary) +abilities=hiddenface +aicode=activate moveto(myhand) target(*|mylibrary) +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>*|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Search your library for a card and put that card into your hand. Then shuffle your library. mana={1}{B} type=Sorcery @@ -28363,6 +28405,7 @@ type=Sorcery name=Depala, Pilot Exemplar auto=lord(other dwarf|mybattlefield) 1/1 auto=lord(creature[vehicle]|mybattlefield) 1/1 +aicode=activate target(*[zpos<=x]|mylibrary) name(revealed card) moveto(myhand) name(revealed card) and!(if cantargetcard(*[-dwarf;-vehicle]|*) then bottomoflibrary))! auto=@tapped(this):may pay({x}) name(Pay X) Reveal:x revealzone(mylibrary) optionone all(*[dwarf;vehicle]|reveal) moveto(ownerhand) optiononeend optiontwo all(*|reveal) bottomoflibrary optiontwoend revealend text=Other Dwarves you control get +1/+1. -- Each Vehicle you control gets +1/+1 as long as it's a creature. -- Whenever Depala, Pilot Exemplar becomes tapped, you may pay {X}. If you do, reveal the top X cards of your library, put all Dwarf and Vehicle cards from among them into your hand, then put the rest on the bottom of your library in a random order. -- mana={1}{R}{W} @@ -29080,7 +29123,9 @@ type=Instant [/card] [card] name=Diabolic Intent -auto=moveTo(myhand) target(*|myLibrary) +abilities=hiddenface +aicode=activate moveto(myhand) target(*|mylibrary) +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>*|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=As an additional cost to cast Diabolic Intent, sacrifice a creature. -- Search your library for a card and put that card into your hand. Then shuffle your library. mana={1}{B}{S(creature|mybattlefield)} type=Sorcery @@ -29097,14 +29142,18 @@ toughness=4 [/card] [card] name=Diabolic Revelation -auto=this(variable{castx} >0) notatarget(*|mylibrary) moveTo(myhand) +abilities=hiddenface +aicode=activate moveto(myhand) target(*|mylibrary) +auto=this(variable{castx} >0) name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(*|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Search your library for up to X cards and put those cards into your hand. Then shuffle your library. mana={X}{3}{B}{B} type=Sorcery [/card] [card] name=Diabolic Tutor -auto=moveTo(myHand) notatarget(*|mylibrary) +abilities=hiddenface +aicode=activate moveto(myhand) target(*|mylibrary) +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>*|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Search your library for a card and put that card into your hand. Then shuffle your library. mana={2}{B}{B} type=Sorcery @@ -31605,7 +31654,7 @@ subtype=Aura [card] name=Dream Pillager abilities=flying -auto=@combatdamaged(player) from(this):name(exile) reveal:thatmuch revealzone(mylibrary) optionone all(*|reveal) moveto(exile) and!( if cantargetcard(*[-land]|*) then transforms((,newability[canplayfromexile])) ueot )! optiononeend revealend +auto=@combatdamaged(player) from(this):name(exile) reveal:thatmuch revealzone(mylibrary) optionone all(*|reveal) moveto(exile) and!( if cantargetcard(*[-land]|*) then transforms((,canplayfromexile)) ueot )! optiononeend revealend text=Flying -- Whenever Dream Pillager deals combat damage to a player, exile that many cards from the top of your library. Until end of turn, you may cast nonland cards exiled this way. mana={5}{R}{R} type=Creature @@ -34018,6 +34067,7 @@ toughness=3 [/card] [card] name=Elder Pine of Jukai +aicode=activate target(<3>*[zpos<=3]|mylibrary) name(revealed card) moveto(myhand) name(revealed card) and!(if cantargetcard(*[-land]|*) then bottomoflibrary))! auto=@movedTo(arcane,spirit|mystack):reveal:4 optionone name(Get Lands) target(<4>land|reveal) moveto(myhand) optiononeend optiontwo name(put on bottom) target(<4>*|reveal) bottomoflibrary optiontwoend revealend auto=@movedTo(this|mygraveyard) from(myBattlefield):may moveTo(myhand) target(spirit[manacost<=2]|mygraveyard) text=Whenever you cast a Spirit or Arcane spell, reveal the top three cards of your library. Put all land cards revealed this way into your hand and the rest on the bottom of your library in any order. -- Soulshift 2 (When this is put into a graveyard from the battlefield, you may return target Spirit card with converted mana cost 2 or less from your graveyard to your hand.) @@ -35979,6 +36029,7 @@ toughness=5 [/card] [card] name=Enlistment Officer +aicode=activate target(<4>*[zpos<=4]|mylibrary) name(revealed card) moveto(myhand) name(revealed card) and!(if cantargetcard(*[-soldier]|*) then bottomoflibrary))! auto=reveal:4 optionone name(Get Soldiers) target(<4>soldier|reveal) moveto(myhand) optiononeend optiontwo name(put on bottom) target(<4>*|reveal) bottomoflibrary optiontwoend revealend text=First strike -- When Enlistment Officer enters the battlefield, reveal the top four cards of your library. Put all Soldier cards revealed this way into your hand and the rest on the bottom of your library. mana={3}{W} @@ -36027,6 +36078,7 @@ type=Instant [/card] [card] name=Enshrined Memories +aicode=activate target(*[zpos<=castx]|mylibrary) name(revealed card) moveto(myhand) name(revealed card) and!(if cantargetcard(*[-creature]|*) then bottomoflibrary))! auto=reveal:x optionone name(Get creatures) target(<50>artifact|reveal) moveto(myhand) optiononeend optiontwo name(put on bottom) target(<50>*|reveal) bottomoflibrary optiontwoend revealend text=Reveal the top X cards of your library. Put all creature cards revealed this way into your hand and the rest on the bottom of your library in any order. mana={X}{G} @@ -38852,7 +38904,7 @@ name=Fatal Frenzy target=creature auto=trample auto=treason -auto=dynamicability +auto=power/0 ueot text=Until end of turn, target creature you control gains trample and gets +X/+0, where X is its power. Sacrifice it at the beginning of the next end step. mana={2}{R} type=Instant @@ -39502,7 +39554,7 @@ toughness=5 [/card] [card] name=Feral Animist -auto={3}:dynamicability +auto={3}:power/0 ueot text={3}: Feral Animist gets +X/+0 until end of turn, where X is its power. mana={1}{R}{G} type=Creature @@ -40008,7 +40060,8 @@ type=Instant name=Fiery Fall target=creature auto=damage:5 -autohand=__BASIC_LANDCYCLING__({1}{R}) +aicode=activate target(land[basic]|mylibrary) moveto(myhand) +autohand={1}{R}{cycle}:name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>land[basic]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Fiery Fall deals 5 damage to target creature. -- Basic landcycling {1}{R} ({1}{R}, Discard this card: Search your library for a basic land card, reveal it, and put it into your hand. Then shuffle your library.) mana={5}{R} type=Instant @@ -44211,7 +44264,9 @@ toughness=3 [/card] [card] name=Gamble -auto=name(search a card) notatarget(*|mylibrary) moveTo(myHand) and!( discard:1 controller )! oneshot +abilities=hiddenface +aicode=activate moveto(myhand) and!(discard:1 controller)! target(*|mylibrary) +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>*|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand) and!(discard:1 controller)!])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Search your library for a card, put that card into your hand, discard a card at random, then shuffle your library. mana={R} type=Sorcery @@ -44962,6 +45017,7 @@ type=Artifact [/card] [card] name=Genesis Hydra +aicode=activate target(*[-land;-instant;-sorcery;zpos<=castx]|mylibrary) moveto(mybattlefield) autostack=if casted(this) then reveal:x optionone target(*[-land;-instant;-sorcery;manacost<=x]|reveal) moveto(mybattlefield) and!( all(*|reveal) moveto(mylibrary) and!(shuffle)! )! optiononeend optiontwo all(*|reveal) moveto(mylibrary) and!(shuffle)! optiontwoend revealend auto=counter(1/1,x) text=When you cast Genesis Hydra, reveal the top X cards of your library. You may put a nonland permanent card with converted mana cost X or less from among them onto the battlefield. Then shuffle the rest into your library. -- Genesis Hydra enters the battlefield with X +1/+1 counters on it. @@ -46497,7 +46553,8 @@ type=Enchantment name=Gleam of Resistance auto=lord(creature|myBattlefield) 1/2 ueot auto=untap all(creature|myBattlefield) -autohand=__BASIC_LANDCYCLING__({1}{W}) +aicode=activate target(land[basic]|mylibrary) moveto(myhand) +autohand={1}{W}{cycle}:name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>land[basic]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Creatures you control get +1/+2 until end of turn. Untap those creatures. -- Basic landcycling {1}{W} ({1}{W}, Discard this card: Search your library for a basic land card, reveal it, and put it into your hand. Then shuffle your library.) mana={4}{W} type=Instant @@ -47851,6 +47908,7 @@ toughness=2 [card] name=Goblin Ringleader abilities=haste +aicode=activate target(<4>*[zpos<=4]|mylibrary) name(revealed card) moveto(myhand) name(revealed card) and!(if cantargetcard(*[-goblin]|*) then bottomoflibrary))! auto=reveal:4 optionone name(Get Goblin) target(<4>Goblin|reveal) moveto(myhand) optiononeend optiontwo name(put on bottom) target(<4>*|reveal) bottomoflibrary optiontwoend revealend text=Haste -- When Goblin Ringleader enters the battlefield, reveal the top four cards of your library. Put all Goblin cards revealed this way into your hand and the rest on the bottom of your library. mana={3}{R} @@ -49124,6 +49182,7 @@ toughness=4 [/card] [card] name=Grave Defiler +aicode=activate target(<4>*[zpos<=4]|mylibrary) name(revealed card) moveto(myhand) name(revealed card) and!(if cantargetcard(*[-zombie]|*) then bottomoflibrary))! auto=reveal:4 optionone name(Get Zombie) target(<4>zombie|reveal) moveto(myhand) optiononeend optiontwo name(put on bottom) target(<4>*|reveal) bottomoflibrary optiontwoend revealend text=When Grave Defiler enters the battlefield, reveal the top four cards of your library. Put all Zombie cards revealed this way into your hand and the rest on the bottom of your library. -- {1}{B}: Regenerate Grave Defiler. auto={1}{B}:regenerate @@ -49203,7 +49262,8 @@ toughness=6 name=Grave Upheaval target=creature|graveyard auto=moveto(mybattlefield) and!(haste)! -autohand=__BASIC_LANDCYCLING__({2}) +aicode=activate target(land[basic]|mylibrary) moveto(myhand) +autohand={2}{cycle}:name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>land[basic]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Put target creature card from a graveyard onto the battlefield under your control. It gains haste. -- Basic landcycling {2} ({2}, Discard this card: Search your library for a basic land card, reveal it, and put it into your hand. Then shuffle your library.) mana={4}{B}{R} type=Sorcery @@ -50078,8 +50138,9 @@ toughness=1 [/card] [card] name=Grim Tutor -auto=moveTo(myhand) notatarget(*|myLibrary) -auto=life:-3 controller +abilities=hiddenface +aicode=activate moveto(myhand) and!(life:-3 controller)! target(*|mylibrary) +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>*|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand) and!(life:-3 controller)!])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Search your library for a card and put that card into your hand, then shuffle your library. You lose 3 life. mana={1}{B}{B} type=Sorcery @@ -56976,8 +57037,9 @@ toughness=1 [/card] [card] name=Imperial Seal -auto=name(search a card) moveTo(exile) and!(transforms((,newability[moveto(ownerlibrary)])) oneshot)! notatarget(*|mylibrary) -auto=life:-2 controller +abilities=hiddenface +aicode=activate moveto(mylibrary) and!(moveto(mylibrary) and!(life:-2 controller)!)! target(*|mylibrary) +auto=name(search card) reveal:plibrarycount optionone name(choose card) target(*|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(mylibrary) and!(moveto(mylibrary) and!(life:-2 controller)!)! afterrevealedend revealend text=Search your library for a card, then shuffle your library and put that card on top of it. You lose 2 life. mana={B} type=Sorcery @@ -57289,9 +57351,10 @@ toughness=3 [/card] [card] name=Increasing Ambition -target=*|mylibrary -auto=moveTo(myhand) -auto=flashback target(*|myLibrary) moveTo(myhand) +abilities=hiddenface +aicode=activate transforms((,newability[ifnot gravecast then target(*|myLibrary) moveTo(myhand)],newability[if gravecast then target(<2>*|myLibrary) moveTo(myhand)])) ueot +auto=ifnot gravecast then name(search card) reveal:plibrarycount optionone name(choose card) target(*|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(mylibrary) and!(moveto(mylibrary) and!(life:-2 controller)!)! afterrevealedend revealend +auto=if gravecast then name(search card) reveal:plibrarycount optionone name(choose card) target(<2>*|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(mylibrary) and!(moveto(mylibrary) and!(life:-2 controller)!)! afterrevealedend revealend flashback={7}{B} text=Search your library for a card and put that card into your hand. If Increasing Ambition was cast from a graveyard, instead search your library for two cards and put those cards into your hand. Then shuffle your library. -- Flashback {7}{B} (You may cast this card from your graveyard for its flashback cost. Then exile it.) mana={4}{B} @@ -57300,8 +57363,8 @@ type=Sorcery [card] name=Increasing Confusion target=player -auto=deplete:X -auto=flashback deplete:X +auto=ifnot gravecast then deplete:X +auto=if gravecast then deplete:twiceX flashback={X}{U} text=Target player puts the top X cards of his or her library into his or her graveyard. If Increasing Confusion was cast from a graveyard, that player puts twice as many cards into his or her graveyard instead. -- Flashback {X}{U} (You may cast this card from your graveyard for its flashback cost. Then exile it.) mana={X}{U} @@ -57309,8 +57372,8 @@ type=Sorcery [/card] [card] name=Increasing Devotion -auto=token(Human,Creature Human,1/1,white)*5 -auto=flashback token(Human,Creature Human,1/1,white)*5 +auto=ifnot gravecast then token(Human,Creature Human,1/1,white)*5 +auto=if gravecast then token(Human,Creature Human,1/1,white)*10 flashback={7}{W}{W} text=Put five 1/1 white Human creature tokens onto the battlefield. If Increasing Devotion was cast from a graveyard, put ten of those tokens onto the battlefield instead. -- Flashback {7}{W}{W} mana={3}{W}{W} @@ -57319,8 +57382,8 @@ type=Sorcery [card] name=Increasing Savagery target=creature -auto=counter(1/1,5) -auto=flashback counter(1/1,5) +auto=ifnot gravecast then counter(1/1,5) +auto=if gravecast then counter(1/1,10) flashback={5}{G}{G} text=Put five +1/+1 counters on target creature. If Increasing Savagery was cast from a graveyard, put ten +1/+1 counters on that creature instead. -- Flashback {5}{G}{G} mana={2}{G}{G} @@ -58557,7 +58620,7 @@ name=Ire Shaman abilities=menace facedown={3} autofacedown={R}:morph -autofaceup=counter(1/1,1) && name(exile) reveal:1 revealzone(mylibrary) optionone all(*|reveal) moveto(exile) and!( transforms((,newability[canplayfromexile])) ueot )! optiononeend revealend +autofaceup=counter(1/1,1) && moveto(exile) and!( transforms((,canplayfromexile)) ueot )! all(*[zpos=1]|mylibrary) text=Menace (This creature can't be blocked except by two or more creatures.) -- Megamorph {R} (You may cast this card face down as a 2/2 creature for {3}. Turn it face up any time for its megamorph cost and put a +1/+1 counter on it.) -- When Ire Shaman is turned face up, exile the top card of your library. Until end of turn, you may play that card. mana={1}{R} type=Creature @@ -61512,6 +61575,7 @@ toughness=1 [/card] [card] name=Kavu Howler +aicode=activate target(<4>*[zpos<=4]|mylibrary) name(revealed card) moveto(myhand) name(revealed card) and!(if cantargetcard(*[-kavu]|*) then bottomoflibrary))! auto=reveal:4 optionone name(Get Kavu) target(<4>kavu|reveal) moveto(myhand) optiononeend optiontwo name(put on bottom) target(<4>*|reveal) bottomoflibrary optiontwoend revealend text=When Kavu Howler enters the battlefield, reveal the top four cards of your library. Put all Kavu cards revealed this way into your hand and the rest on the bottom of your library. mana={4}{G}{G} @@ -64303,6 +64367,17 @@ type=Enchantment subtype=Aura [/card] [card] +name=Krovikan Horror +autograveyard=@each endofturn restriction{type(creature[zpos=myposplus1plusend]|mygraveyard)~morethan~0}:may moveto(ownerhand) +auto={1}{S(creature|mybattlefield)}:damage:1 target(creature,player) +text=At the beginning of the end step, if Krovikan Horror is in your graveyard with a creature card directly above it, you may return Krovikan Horror to your hand. -- {1}, Sacrifice a creature: Krovikan Horror deals 1 damage to target creature or player. +mana={3}{B} +type=Creature +subtype=Horror Spirit +power=2 +toughness=2 +[/card] +[card] name=Krovikan Mist abilities=flying anyzone=type:illusion:battlefield/type:illusion:battlefield cdaactive @@ -64865,6 +64940,7 @@ toughness=4 [/card] [card] name=Lair Delve +aicode=activate target(<2>*[zpos<=2]|mylibrary) name(revealed card) moveto(myhand) name(revealed card) and!(if cantargetcard(*[-creature;-land]|*) then bottomoflibrary))! auto=reveal:2 optionone name(Get creature and land) target(<2>*[creature,land]|reveal) moveto(myhand) optiononeend optiontwo name(put on bottom) all(*|reveal) bottomoflibrary optiontwoend revealend text=Reveal the top two cards of your library. Put all creature and land cards revealed this way into your hand and the rest on the bottom of your library in any order. mana={2}{G} @@ -68682,6 +68758,7 @@ toughness=1 [/card] [card] name=Lurking Predators +aicode=activate transforms((,newability[if type(creature[zpos=1]|mylibrary)~morethan~0 then target(creature[zpos=1]|mylibrary) moveto(ownerbattlefield) else target(*[zpos=1]|mylibrary) bottomoflibrary])) ueot auto=@movedTo(*|opponentstack):reveal:1 optionone if type(creature|reveal)~morethan~0 then name(Creature) target(*|reveal) moveto(mybattlefield) else name(put on bottom?) target(*|reveal) bottomoflibrary optiononeend optiontwo name(Put Back) target(<1>*|reveal) moveto(mylibrary) optiontwoend revealend text=Whenever an opponent casts a spell, reveal the top card of your library. If it's a creature card, put it onto the battlefield. Otherwise, you may put that card on the bottom of your library. mana={4}{G}{G} @@ -71452,6 +71529,7 @@ toughness=1 [/card] [card] name=Matter Reshaper +aicode=activate target(<1>*[zpos=1]|mylibrary) name(revealed card) moveto(myhand) name(revealed card) and!(if cantargetcard(*[-instant;-sorcery;manacost<=3]|*) then moveto(mybattlefield))! auto=@movedTo(this|graveyard) from(battlefield):name(Reshape) reveal:1 optionone if type(*[manacost <=3]|reveal)~morethan~0 then target(*|reveal) moveto(mybattlefield) optiononeend optiontwo name(Put in hand) target(<1>*|reveal) moveto(myhand) optiontwoend revealend text=({C} represents colorless mana.) -- When Matter Reshaper dies, reveal the top card of your library. You may put that card onto the battlefield if it's a permanent card with converted mana cost 3 or less. Otherwise, put that card into your hand. mana={2}{C} @@ -72437,7 +72515,8 @@ toughness=2 [card] name=Merfolk Wayfinder abilities=flying -auto=reveal:3 optionone name(Get islands) target(<3>island|reveal) moveto(myhand) optiononeend optiontwo name(put on bottom) all(*|reveal) bottomoflibrary optiontwoend revealend +aicode=activate target(<3>*[zpos<=3]|mylibrary) name(revealed card) moveto(myhand) name(revealed card) and!(if cantargetcard(*[-island]|*) then bottomoflibrary))! +auto=reveal:3 optionone name(Get islands) target(<3>island|reveal) moveto(myhand) optiononeend optiontwo name(put on bottom) target(<3>*|reveal) bottomoflibrary optiontwoend revealend text=Flying -- When Merfolk Wayfinder enters the battlefield, reveal the top three cards of your library. Put all Island cards revealed this way into your hand and the rest on the bottom of your library in any order. mana={2}{U} type=Creature @@ -73064,7 +73143,8 @@ type=Instant [card] name=Migratory Route auto=create(Bird:Creature Bird:1/1:white:flying)*4 -autohand=__BASIC_LANDCYCLING__({2}) +aicode=activate target(land[basic]|mylibrary) moveto(myhand) +autohand={2}{cycle}:name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>land[basic]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Create four 1/1 white Bird creature tokens with flying. -- Basic landcycling {2} ({2}, Discard this card: Search your library for a basic land card, reveal it, and put it into your hand. Then shuffle your library.) mana={3}{W}{U} type=Sorcery @@ -73537,7 +73617,7 @@ type=Enchantment name=Mind's Desire abilities=storm auto=shuffle -auto=reveal:1 optionone all(*|reveal) moveto(exile) and!( transforms((,newability[zerocast],newability[canplayfromexile])) ueot)! optiononeend revealend +auto=moveto(exile) and!( transforms((,zerocast,canplayfromexile)) ueot )! all(*[zpos=1]|mylibrary) text=Shuffle your library. Then exile the top card of your library. Until end of turn, you may play that card without paying its mana cost. (If it has X in its mana cost, X is 0.) -- Storm (When you cast this spell, copy it for each spell cast before it this turn.) mana={4}{U}{U} type=Sorcery @@ -75250,6 +75330,7 @@ subtype=Aura [/card] [card] name=Momir Vig, Simic Visionary +aicode=activate target(<1>*[zpos=1]|mylibrary) name(revealed card) moveto(myhand) name(revealed card) and!(if cantargetcard(*[-creature]|*) then moveto(mylibrary))! auto=@movedTo(creature[green]|mystack):target(creature|mylibrary) moveto(mylibrary) auto=@movedTo(creature[blue]|mystack):reveal:1 optionone target(creature|reveal) moveto(myhand) optiononeend optiontwo name(Put Back) target(<1>*|reveal) moveto(mylibrary) optiontwoend revealend text=Whenever you cast a green creature spell, you may search your library for a creature card and reveal it. If you do, shuffle your library and put that card on top of it. -- Whenever you cast a blue creature spell, reveal the top card of your library. If it's a creature card, put that card into your hand. @@ -76431,6 +76512,7 @@ type=Sorcery [/card] [card] name=Mulch +aicode=activate target(<4>*[zpos<=4]|mylibrary) name(revealed card) moveto(myhand) name(revealed card) and!(if cantargetcard(*[-land]|*) then moveto(mygraveyard))! auto=reveal:4 optionone name(Get land) target(<4>land|reveal) moveto(myhand) optiononeend optiontwo name(put in grave) all(*|reveal) moveto(mygraveyard) optiontwoend revealend text=Reveal the top four cards of your library. Put all land cards revealed this way into your hand and the rest into your graveyard. mana={1}{G} @@ -77657,7 +77739,7 @@ type=Instant [card] name=Narset, Enlightened Master abilities=first strike,opponentshroud -auto=@combat(attacking) source(this):name(exile) reveal:4 revealzone(mylibrary) optionone all(*|reveal) moveto(exile) and!( if cantargetcard(*[-creature;-land]|*) then transforms((,newability[zerocast],newability[canplayfromexile])) ueot )! optiononeend revealend +auto=@combat(attacking) source(this):moveto(exile) and!( if cantargetcard(*[-creature;-land]|*) then transforms((,zerocast,canplayfromexile)) ueot )! all(*[zpos<=4]|mylibrary) text=First strike, hexproof -- Whenever Narset, Enlightened Master attacks, exile the top four cards of your library. Until end of turn, you may cast noncreature cards exiled with Narset this turn without paying their mana costs. mana={3}{U}{R}{W} type=Legendary Creature @@ -78227,6 +78309,15 @@ power=0 toughness=1 [/card] [card] +name=Necropotence +auto=@movedTo(*|mygraveyard):all(trigger[to]) moveTo(exile) +auto=phasealter(remove,draw,controller) +auto={L:1}:name(pay life & exile) transforms((,newability[hiddenmoveto(exile)],newability[phaseaction[my endofturn once checkex] moveto(ownerhand)])) forever all(*[zpos=1]|mylibrary) +text=Skip your draw step. -- Whenever you discard a card, exile that card from your graveyard. -- Pay 1 life: Exile the top card of your library face down. Put that card into your hand at the beginning of your next end step. +mana={B}{B}{B} +type=Enchantment +[/card] +[card] name=Necropouncer auto={2}:equip auto=teach(creature) 3/1 @@ -78575,6 +78666,17 @@ power=4 toughness=2 [/card] [card] +name=Nether Shadow +abilities=haste +autograveyard=@each my upkeep restriction{type(creature[zpos>=myposplus1plusend]|mygraveyard)~morethan~2}:may moveto(ownerbattlefield) +text=Haste -- At the beginning of your upkeep, if Nether Shadow is in your graveyard with three or more creature cards above it, you may put Nether Shadow onto the battlefield. +mana={B}{B} +type=Creature +subtype=Spirit +power=1 +toughness=1 +[/card] +[card] name=Nether Spirit autograveyard=@each my upkeep restriction{type(creature|mygraveyard)~equalto~1}:moveTo(mybattlefield) text=At the beginning of your upkeep, if Nether Spirit is the only creature card in your graveyard, you may return Nether Spirit to the battlefield. @@ -78689,6 +78791,7 @@ toughness=1 [card] name=Neurok Familiar abilities=flying +aicode=activate transforms((,newability[if type(artifact[zpos=1]|mylibrary)~morethan~0 then target(artifact[zpos=1]|mylibrary) moveto(myhand) else target(*[zpos=1]|mylibrary) moveto(mygraveyard)])) ueot auto=reveal:1 optionone target(artifact|reveal) moveto(myhand) optiononeend optiontwo name(Put in grave) target(<1>*|reveal) moveto(mygraveyard) optiontwoend revealend text=Flying -- When Neurok Familiar enters the battlefield, reveal the top card of your library. If it's an artifact card, put it into your hand. Otherwise, put it into your graveyard. mana={1}{U} @@ -79605,6 +79708,7 @@ subtype=Nissa [card] name=Nissa, Nature's Artisan auto=counter(0/0,5,loyalty) +aicode=activate target(<2>*[zpos<=2]|mylibrary) name(revealed card) moveto(myhand) name(revealed card) and!(if cantargetcard(land|*) then moveto(mybattlefield))! auto={C(0/0,3,Loyalty)}:name(+3: Gain 3 Life) life:3 controller auto={C(0/0,-4,Loyalty)}:name(-4: Reveal Cards) reveal:2 optionone name(Get Lands) target(<2>land|reveal) moveto(mybattlefield) optiononeend optiontwo name(put on hand) target(<2>*|reveal) moveto(myhand) optiontwoend revealend auto={C(0/0,-12,Loyalty)}:name(-12: 5/5 & Trample) lord(creature|mybattlefield) 5/5 ueot && lord(creature|mybattlefield) trample ueot @@ -79615,6 +79719,7 @@ subtype=Nissa [/card] [card] name=Nissa, Sage Animist +aicode=activate transforms((,newability[if type(land[zpos=1]|mylibrary)~morethan~0 then target(land[zpos=1]|mylibrary) moveto(ownerbattlefield) else target(*[zpos=1]|mylibrary) moveto(ownerhand)])) ueot auto={C(0/0,1,Loyalty)}:name(+1: reveal) reveal:1 optionone target(<1>land|reveal) moveto(ownerbattlefield) optiononeend optiontwo target(<1>*|reveal) moveto(ownerhand) optiontwoend revealend auto={C(0/0,-2,Loyalty)}:name(-2: ashaya token) create(Ashaya, the Awoken World:Legendary Elemental Creature:4/4:green) auto={C(0/0,-7,Loyalty)}:name(-7: animate land) target(land) transforms((Creature Elemental,newability[untap],setpower=6,settoughness=6)) forever @@ -83325,6 +83430,7 @@ type=Enchantment [/card] [card] name=Pain Seer +aicode=activate target(*[zpos=1]|mylibrary) moveto(myhand) and!(transforms((,newability[life:-manacost controller])) ueot)! auto=@untapped(this):reveal:1 optionone name(Reveal) target(*|reveal) transforms((,newability[life:-manacost controller])) forever optiononeend optiontwo name(Claim your card) choice all(*|reveal) moveto(myhand) optiontwoend revealend text=Inspired — Whenever Pain Seer becomes untapped, reveal the top card of your library and put that card into your hand. You lose life equal to that card's converted mana cost. mana={1}{B} @@ -88475,7 +88581,9 @@ type=Enchantment [card] name=Prophecy target=opponent +aicode=activate target(*[zpos=1]|targetedpersonslibrary) moveto(ownerlibrary) and!(if cantargetcard(land|*) then life:1 controller)! auto=reveal:1 revealzone(targetedpersonslibrary) optionone name(put back) target(land|reveal) moveto(ownerlibrary) and!( transforms((,newability[shuffle],newability[life:1 opponent])) oneshot )! optiononeend optiontwo name(put back) target(*[-land]|reveal) moveto(ownerlibrary) and!( transforms((,newability[shuffle])) oneshot )! optiontwoend revealend +auto=@next upkeep:draw:1 controller text=Reveal the top card of target opponent's library. If it's a land, you gain 1 life. Then that player shuffles his or her library. -- Draw a card at the beginning of the next turn's upkeep. mana={W} type=Sorcery @@ -88514,7 +88622,7 @@ type=Instant [card] name=Prophetic Flamespeaker abilities=double strike,trample -auto=@combatdamaged(player) from(this):reveal:1 optionone all(*|reveal) moveto(exile) and!( transforms((,newability[canplayfromexile])) ueot)! optiononeend revealend +auto=@combatdamaged(player) from(this):moveto(exile) and!( transforms((,canplayfromexile)) ueot )! all(*[zpos=1]|mylibrary) text=Double strike, trample -- Whenever Prophetic Flamespeaker deals combat damage to a player, exile the top card of your library. You may play it this turn. mana={1}{R}{R} type=Creature @@ -97555,6 +97663,7 @@ type=Sorcery [/card] [card] name=Sages of the Anima +aicode=activate target(<3>creature[zpos<=3]|mylibrary) moveto(myhand) auto=replacedraw reveal:3 optionone name(Get creatures) target(<3>creature|reveal) moveto(myhand) optiononeend optiontwo name(put on bottom) target(<3>*|reveal) bottomoflibrary optiontwoend revealend text=If you would draw a card, instead reveal the top three cards of your library. Put all creature cards revealed this way into your hand and the rest on the bottom of your library in any order. mana={3}{G}{U} @@ -98288,6 +98397,7 @@ type=Sorcery [card] name=Sapling of Colfenor abilities=indestructible +aicode=activate notatarget(*[zpos=1]|mylibrary) name(revealed card) moveto(mylibrary) name(revealed card) and!(if cantargetcard(creature|*) then moveto(myhand) and!(transforms((,newability[life:toughness],newability[life:-power])) ueot)!)! auto=@combat(attacking) source(this):reveal:1 optionone name(Reveal and gain/lose life) target(creature|reveal) transforms((,newability[life:toughness],newability[life:-power],newability[moveto(myhand)])) forever optiononeend optiontwo target(<1>*|reveal) moveto(mylibrary) optiontwoend revealend text=Sapling of Colfenor is indestructible. -- Whenever Sapling of Colfenor attacks, reveal the top card of your library. If it's a creature card, you gain life equal to that card's toughness, lose life equal to its power, then put it into your hand. mana={3}{BG}{BG} @@ -98446,6 +98556,7 @@ toughness=1 [card] name=Sarkhan the Mad auto=counter(0/0,7,loyalty) +aicode=activate moveto(myhand) and!( dynamicability )! notatarget(<1>*[zpos=1]|mylibrary) auto={0}:name(0: reveal damage) Reveal:1 revealzone(mylibrary) revealuntil(*|mylibrary) optionone name(put in hand) target(*|reveal) moveto(myhand) optiononeend afterrevealed all(this) damage:revealedmana afterrevealedend revealend auto={C(0/0,-2,Loyalty)}:name(-2: sacrifice) target(creature) sacrifice and!( token(Dragon,creature dragon,5/5,flying,red) targetcontroller )! auto={C(0/0,-4,Loyalty)}:name(-4: ultimate) all(creature[dragon]|mybattlefield) transforms((,newability[target(player) dynamicability])) oneshot @@ -99982,7 +100093,7 @@ toughness=1 [/card] [card] name=Scrib Nibblers -auto={T}:name(exile) target(player) reveal:1 revealzone(targetedpersonslibrary) optionone all(*|reveal) moveto(exile) and!( if cantargetcard(*[land]|*) then life:1 controller )! optiononeend revealend +auto={T}:target(player) moveto(exile) and!( if cantargetcard(*[land]|*) then life:1 controller )! all(*[zpos=1]|targetedpersonslibrary) auto=@movedTo(land|mybattlefield):untap all(this) text={T}: Exile the top card of target player's library. If it's a land card, you gain 1 life. -- Landfall — Whenever a land enters the battlefield under your control, you may untap Scrib Nibblers. mana={2}{B} @@ -100986,7 +101097,8 @@ type=Instant [/card] [card] name=Seek the Horizon -auto=moveTo(myHand) notatarget(land[basic]|myLibrary) +aicode=activate target(land[basic]|mylibrary) moveto(myhand) +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(land[basic]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Search your library for up to three basic land cards, reveal them, and put them into your hand. Then shuffle your library. mana={3}{G} type=Sorcery @@ -101249,7 +101361,8 @@ type=Instant [/card] [card] name=Selective Memory -auto=moveTo(exile) notatarget(*[-land]|mylibrary) +aicode=activate target(*[-land]|mylibrary) moveto(exile) +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(*[-land]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(exile)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Search your library for any number of nonland cards and exile them. Then shuffle your library. mana={3}{U} type=Sorcery @@ -101350,7 +101463,7 @@ type=Artifact [card] name=Self-Assembler aicode=activate notatarget(creature[Assembly-Worker]|mylibrary) moveTo(ownerhand) -auto=Reveal:type:*:mylibrary revealzone(mylibrary) revealtype(creature[Assembly-Worker]|mylibrary) optionone name(choose card) target(creature[Assembly-Worker]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend revealend +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) revealtype(creature[Assembly-Worker]|mylibrary) optionone name(choose card) target(creature[Assembly-Worker]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend revealend text=When Self-Assembler enters the battlefield, you may search your library for an Assembly-Worker creature card, reveal it, put it into your hand, then shuffle your library. mana={5} type=Artifact Creature @@ -102254,7 +102367,7 @@ type=Sorcery [/card] [card] name=Sever the Bloodline -target=creature +target=creature[-black] auto=moveTo(exile) auto=all(*[share!name!]|targetcontrollerbattlefield) moveto(exile) flashback={5}{B}{B} @@ -102458,7 +102571,8 @@ type=Land [/card] [card] name=Shadowborn Apostle -auto={B}{S(Shadowborn Apostle|myBattlefield)}{S(Shadowborn Apostle|myBattlefield)}{S(Shadowborn Apostle|myBattlefield)}{S(Shadowborn Apostle|myBattlefield)}{S(Shadowborn Apostle|myBattlefield)}{S(Shadowborn Apostle|myBattlefield)}:moveTo(mybattlefield) target(creature[Demon]|mylibrary) +aicode=activate moveTo(mybattlefield) target(creature[Demon]|mylibrary) +auto={B}{S(Shadowborn Apostle|myBattlefield)}{S(Shadowborn Apostle|myBattlefield)}{S(Shadowborn Apostle|myBattlefield)}{S(Shadowborn Apostle|myBattlefield)}{S(Shadowborn Apostle|myBattlefield)}{S(Shadowborn Apostle|myBattlefield)}:name(search card) reveal:plibrarycount optionone name(choose card) target(creature[demon]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield))! afterrevealedend revealend text= A deck can have any number of cards named Shadowborn Apostle. -- {B}, Sacrifice six creatures named Shadowborn Apostle: Search your library for a Demon creature card and put it onto the battlefield. Then shuffle your library. mana={B} type=Creature @@ -103264,6 +103378,7 @@ toughness=0 [card] name=Shimian Specter abilities=flying +aicode=name(put in exile) activate name(put in exile) notatarget(*[-land]|opponenthand) transforms((,newability[all(*[share!name!]|mylibrary) moveto(exile) and!(shuffle)!],newability[all(*[share!name!]|mygraveyard) moveto(exile)],newability[all(*[share!name!]|myhand) moveto(exile)])) ueot auto=@combatdamaged(player) from(this):reveal:type:*:opponenthand revealzone(opponenthand) optionone name(choose card) notatarget(*[-land]|reveal) moveto(exile) and!( transforms((,newability[all(*[share!name!]|mylibrary) moveto(exile) and!(shuffle)!],newability[all(*[share!name!]|mygraveyard) moveto(exile)],newability[all(*[share!name!]|myhand) moveto(exile)])) oneshot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerhand) and!( all(*|reveal) moveto(ownerhand) )! optiontwoend revealend text=Flying -- Whenever Shimian Specter deals combat damage to a player, that player reveals his or her hand. You choose a nonland card from it. Search that player's graveyard, hand, and library for all cards with the same name as that card and exile them. Then that player shuffles his or her library. mana={2}{B}{B} @@ -103692,7 +103807,8 @@ toughness=2 [card] name=Shoreline Ranger abilities=flying -autohand={2}{cycle}:name(islandcycling) moveTo(myhand) target(island|mylibrary) +aicode=activate target(island|mylibrary) moveto(myhand) +autohand={2}{cycle}:name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>island|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Flying -- Islandcycling {2} ({2}, Discard this card: Search your library for an Island card, reveal it, and put it into your hand. Then shuffle your library.) mana={5}{U} type=Creature @@ -103778,7 +103894,8 @@ type=Instant name=Shred Memory target=*|graveyard auto=moveTo(exile) -autohand={1}{B}{B}{D(this|myhand)}:moveTo(myhand) target(*[manacost=2]|mylibrary) asSorcery +aicode=activate target(*[manacost=2]|mylibrary) moveto(myhand) +autohand={1}{B}{B}{D(this|myhand)}:name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>*[manacost=2]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend asSorcery text=Exile up to four target cards from a single graveyard. -- Transmute {1}{B}{B} ({1}{B}{B}, Discard this card: Search your library for a card with the same converted mana cost as this card, reveal it, and put it into your hand. Then shuffle your library. Transmute only as a sorcery.) mana={1}{B} type=Instant @@ -104219,8 +104336,9 @@ toughness=1 [/card] [card] name=Sidisi, Undead Vizier -abilities=deathtouch -auto=may name(Exploit) sacrifice notatarget(creature|mybattlefield) && transforms((,newability[moveto(myhand) notatarget(*|mylibrary)])) forever +abilities=deathtouch,hiddenface +aicode=activate moveto(myhand) notatarget(*|mylibrary) +auto=may name(Exploit) sacrifice notatarget(creature|mybattlefield) and!( reveal:plibrarycount optionone name(choose card) target(*|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myhand))! afterrevealedend revealend )! text=Deathtouch -- Exploit (When this creature enters the battlefield, you may sacrifice a creature.) -- When Sidisi, Undead Vizier exploits a creature, you may search your library for a card, put it into your hand, then shuffle your library. mana={3}{B}{B} type=Legendary Creature @@ -104328,7 +104446,8 @@ toughness=2 name=Sift Through Sands auto=draw:2 controller auto=target(*|myhand) reject -auto=if thisturn(*[Peer Through Depths]|mystack),thisturn(Reach Through Mists|mystack) then may name(search for Unspeakable) target(The Unspeakable|mylibrary) moveTo(mybattlefield) +aicode=activate target(The Unspeakable|mylibrary) moveTo(mybattlefield) +auto=if thisturn(*[Peer Through Depths]|mystack),thisturn(Reach Through Mists|mystack) then name(search for Unspeakable) reveal:plibrarycount optionone name(choose card) target(The Unspeakable|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield))! afterrevealedend revealend text=Draw two cards, then discard a card. -- If you've cast a spell named Peer Through Depths and a spell named Reach Through Mists this turn, you may search your library for a card named The Unspeakable, put it onto the battlefield, then shuffle your library. mana={1}{U}{U} type=Instant @@ -104777,7 +104896,8 @@ toughness=2 [card] name=Silkwing Scout abilities=flying -auto={G}{S}:moveTo(myBattlefield) and!(tap(noevent))! target(basic|mylibrary) +aicode=activate moveTo(myBattlefield) and!(tap(noevent))! target(land[basic]|myLibrary) +auto={G}{S}:name(search card) reveal:plibrarycount optionone name(choose card) target(land[basic]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield) and!(tap(noevent))!)! afterrevealedend revealend text=Flying -- {G}, Sacrifice Silkwing Scout: Search your library for a basic land card and put that card onto the battlefield tapped. Then shuffle your library. mana={2}{U} type=Creature @@ -105000,7 +105120,8 @@ toughness=1 [/card] [card] name=Silverglade Elemental -auto=may moveTo(myBattlefield) target(forest|myLibrary) +aicode=activate moveTo(myBattlefield) target(forest|myLibrary) +auto=name(search card) reveal:plibrarycount optionone name(choose card) target(forest|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield))! afterrevealedend revealend text=When Silverglade Elemental enters the battlefield, you may search your library for a Forest card and put that card onto the battlefield. If you do, shuffle your library. mana={4}{G} type=Creature @@ -105010,7 +105131,8 @@ toughness=4 [/card] [card] name=Silverglade Pathfinder -auto={1}{G}{T}{D(*|myhand)}:moveTo(myBattlefield) and!(tap(noevent))! target(basic|myLibrary) +aicode=activate moveTo(myBattlefield) and!(tap(noevent))! target(land[basic]|myLibrary) +auto={1}{G}{T}{D(*|myhand)}:name(search card) reveal:plibrarycount optionone name(choose card) target(land[basic]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield) and!(tap(noevent))!)! afterrevealedend revealend text={1}{G}, {T}, Discard a card: Search your library for a basic land card and put that card onto the battlefield tapped. Then shuffle your library. mana={1}{G} type=Creature @@ -105784,6 +105906,7 @@ toughness=1 [/card] [card] name=Skirk Drill Sergeant +aicode=activate transforms((,newability[if type(goblin[-instant;-sorcery;zpos=1]|mylibrary)~morethan~0 then target(goblin[-instant;-sorcery;zpos=1]|mylibrary) moveto(ownerbattlefield) else target(*[zpos=1]|mylibrary) moveto(ownergraveyard)])) ueot auto=@movedto(Goblin|mygraveyard) from(battlefield):pay({2}{r}) reveal:1 optionone target(goblin|reveal) moveto(mybattlefield) optiononeend optiontwo name(Put in grave) target(<1>*|reveal) moveto(mygraveyard) optiontwoend revealend text=Whenever Skirk Drill Sergeant or another Goblin is put into a graveyard from the battlefield, you may pay {2}{R}. If you do, reveal the top card of your library. If it's a Goblin permanent card, put it onto the battlefield. Otherwise, put it into your graveyard. mana={1}{R} @@ -106517,7 +106640,8 @@ toughness=3 [/card] [card] name=Skyship Weatherlight -auto=moveto(myexile) and!(transforms((skyshipped)) forever)! notatarget(*[creature;artifact]|mylibrary) +aicode=activate moveto(myexile) and!(transforms((skyshipped)) forever)! target(*[creature;artifact]|mylibrary) +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(*[creature;artifact]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myexile) and!(becomes(skyshipped) forever)!])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend auto={4}{T}:moverandom(*[skyshipped]) from(myexile) to(ownerhand) text=When Skyship Weatherlight enters the battlefield, search your library for any number of artifact and/or creature cards and exile them. Then shuffle your library. -- {4}, {T}: Choose a card at random that was exiled with Skyship Weatherlight. Put that card into its owner's hand. mana={4} @@ -106565,7 +106689,8 @@ type=Instant [/card] [card] name=Skyshroud Claim -auto=moveTo(myBattlefield) notatarget(forest|myLibrary) +aicode=activate moveTo(myBattlefield) target(forest|myLibrary) +auto=name(search card) reveal:plibrarycount optionone name(choose card) target(forest|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield))! afterrevealedend revealend text=Search your library for up to two Forest cards and put them onto the battlefield. Then shuffle your library. mana={3}{G} type=Sorcery @@ -106636,7 +106761,8 @@ type=Land [/card] [card] name=Skyshroud Poacher -auto={3}{T}:moveTo(myBattlefield) target(elf[-sorcery;-instant]|mylibrary) +aicode=activate moveTo(myBattlefield) target(elf[-sorcery;-instant]|myLibrary) +auto={3}{T}:name(search card) reveal:plibrarycount optionone name(choose card) target(elf[-sorcery;-instant]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield))! afterrevealedend revealend text={3}, {T}: Search your library for an Elf permanent card and put that card onto the battlefield. Then shuffle your library. mana={2}{G}{G} type=Creature @@ -106666,7 +106792,8 @@ toughness=3 [/card] [card] name=Skyshroud Sentinel -auto=moveTo(myhand) target(skyshroud sentinel|mylibrary) +aicode=activate target(skyshroud sentinel|mylibrary) moveto(myhand) +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(skyshroud sentinel|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=When Skyshroud Sentinel enters the battlefield, you may search your library for up to three cards named Skyshroud Sentinel, reveal them, and put them into your hand. If you do, shuffle your library. mana={2}{G} type=Creature @@ -106764,6 +106891,7 @@ toughness=4 [card] name=Skyward Eye Prophets abilities=vigilance +aicode=activate transforms((,newability[if type(land[zpos=1]|mylibrary)~morethan~0 then target(land[zpos=1]|mylibrary) moveto(ownerbattlefield) else target(*[zpos=1]|mylibrary) moveto(ownerhand)])) ueot auto={t}:reveal:1 optionone target(land|reveal) moveto(mybattlefield) optiononeend optiontwo name(Put in hand) target(<1>*|reveal) moveto(myhand) optiontwoend revealend text=Vigilance -- {T}: Reveal the top card of your library. If it's a land card, put it onto the battlefield. Otherwise, put it into your hand. mana={3}{G}{W}{U} @@ -107348,7 +107476,8 @@ toughness=7 [/card] [card] name=Sliver Overlord -auto={3}:moveto(hand) target(sliver|myLibrary) +aicode=activate target(sliver|mylibrary) moveto(myhand) +auto={3}:name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>sliver|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend auto={3}:moveto(myBattlefield) target(sliver|battlefield) text={3}: Search your library for a Sliver card, reveal that card, and put it into your hand. Then shuffle your library. -- {3}: Gain control of target Sliver. (This effect lasts indefinitely.) mana={W}{U}{B}{R}{G} @@ -108199,7 +108328,8 @@ toughness=2 [/card] [card] name=Solemn Simulacrum -auto=may moveTo(myBattlefield) and!(tap(noevent))! target(land[basic]|mylibrary) +aicode=activate moveTo(myBattlefield) and!(tap(noevent))! target(land[basic]|myLibrary) +auto=name(search card) reveal:plibrarycount optionone name(choose card) target(land[basic]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield) and!(tap(noevent))!)! afterrevealedend revealend auto=@movedTo(this|graveyard) from(Battlefield):may draw:1 controller text=When Solemn Simulacrum enters the battlefield, you may search your library for a basic land card and put that card onto the battlefield tapped. If you do, shuffle your library. -- When Solemn Simulacrum dies, you may draw a card. mana={4} @@ -108683,6 +108813,7 @@ type=Sorcery [card] name=Sorin, Grim Nemesis auto=counter(0/0,6,loyalty) +aicode=activate moveto(myhand) and!(transforms((,newability[life:-manacost opponent])) ueot)! notatarget(<1>*[zpos=1]|mylibrary) auto={C(0/0,1,Loyalty)}:reveal:1 optionone name(Reveal) target(*|reveal) transforms((,newability[life:-manacost opponent])) forever optiononeend optiontwo name(Claim your card) choice all(*|reveal) moveto(myhand) optiontwoend revealend auto={C(0/0,-1,Loyalty)}:damage:1 target(creature,planeswalker) && life:1 controller auto={C(0/0,-2,Loyalty)}:damage:2 target(creature,planeswalker) && life:2 controller @@ -110022,7 +110153,8 @@ toughness=6 [card] name=Sphinx Summoner abilities=flying -auto=may moveTo(myHand) target(creature[artifact]|myLibrary) +aicode=activate target(creature[artifact]|mylibrary) moveto(myhand) +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>creature[artifact]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Flying -- When Sphinx Summoner enters the battlefield, you may search your library for an artifact creature card, reveal it, and put it into your hand. If you do, shuffle your library. mana={3}{U}{B} type=Artifact Creature @@ -110050,7 +110182,8 @@ toughness=2 [/card] [card] name=Sphinx's Herald -auto={2}{U}{T}{S(creature[white]|myBattlefield)}{S(creature[blue]|myBattlefield)}{S(creature[black]|myBattlefield)}:moveTo(mybattlefield) target(sphinx sovereign|mylibrary) +aicode=activate moveTo(myBattlefield) target(sphinx sovereign|myLibrary) +auto={2}{U}{T}{S(creature[white]|myBattlefield)}{S(creature[blue]|myBattlefield)}{S(creature[black]|myBattlefield)}:name(search card) reveal:plibrarycount optionone name(choose card) target(sphinx sovereign|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield))! afterrevealedend revealend text={2}{U}, {T}, Sacrifice a white creature, a blue creature, and a black creature: Search your library for a card named Sphinx Sovereign and put it onto the battlefield. Then shuffle your library. mana={U} type=Artifact Creature @@ -111096,7 +111229,8 @@ type=Instant [/card] [card] name=Spoils of Victory -auto=moveTo(myBattlefield) notatarget(plains,island,swamp,mountain,forest|mylibrary) +aicode=activate moveTo(myBattlefield) target(*[plains;island;swamp;mountain;forest]|myLibrary) +auto=name(search card) reveal:plibrarycount optionone name(choose card) target(*[plains;island;swamp;mountain;forest]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield))! afterrevealedend revealend text=Search your library for a Plains, Island, Swamp, Mountain, or Forest card and put that card onto the battlefield. Then shuffle your library. mana={2}{G} type=Sorcery @@ -111381,7 +111515,8 @@ toughness=3 [card] name=Sprouting Vines abilities=storm -auto=moveto(myHand) notatarget(land[basic]|myLibrary) +aicode=activate target(land[basic]|mylibrary) moveto(myhand) +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>land[basic]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Search your library for a basic land card, reveal that card, and put it into your hand. Then shuffle your library. -- Storm (When you cast this spell, copy it for each spell cast before it this turn.) mana={2}{G} type=Instant @@ -112400,7 +112535,8 @@ type=Instant [/card] [card] name=Steelshaper Apprentice -auto={H}{W}{T}:moveTo(myhand) target(equipment|mylibrary) +aicode=activate target(equipment|mylibrary) moveto(myhand) +auto={H}{W}{T}:name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>equipment|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text={W}, {T}, Return Steelshaper Apprentice to its owner's hand: Search your library for an Equipment card, reveal that card, and put it into your hand. Then shuffle your library. mana={2}{W}{W} type=Creature @@ -112410,7 +112546,8 @@ toughness=3 [/card] [card] name=Steelshaper's Gift -auto=moveTo(myhand) notatarget(equipment|mylibrary) +aicode=activate target(equipment|mylibrary) moveto(myhand) +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>equipment|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Search your library for an Equipment card, reveal that card, and put it into your hand. Then shuffle your library. mana={W} type=Sorcery @@ -112986,7 +113123,8 @@ subtype=Equipment [/card] [card] name=Stoneforge Mystic -auto=may moveTo(myhand) target(equipment|mylibrary) +aicode=activate target(equipment|mylibrary) moveto(myhand) +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>equipment|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend auto={1}{W}{T}:moveTo(myBattlefield) target(equipment|myhand) text=When Stoneforge Mystic enters the battlefield, you may search your library for an Equipment card, reveal it, put it into your hand, then shuffle your library. -- {1}{W}, {T}: You may put an Equipment card from your hand onto the battlefield. mana={1}{W} @@ -113016,7 +113154,8 @@ subtype=Aura [card] name=Stonehewer Giant abilities=vigilance -auto={1}{W}{T}:name(move and attach) target(equipment|mylibrary) moveto(mybattlefield) and!(transforms((,newability[rehook target(creature|mybattlefield)])))! +aicode=activate moveTo(myBattlefield) and!(transforms((,newability[rehook target(creature|mybattlefield)])) oneshot)! target(equipment|myLibrary) +auto={1}{W}{T}:name(search card) reveal:plibrarycount optionone name(choose card) target(equipment|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield) and!(transforms((,newability[rehook target(creature|mybattlefield)])) oneshot)! afterrevealedend revealend text=Vigilance -- {1}{W}, {T}: Search your library for an Equipment card and put it onto the battlefield. Attach it to a creature you control. Then shuffle your library. mana={3}{W}{W} type=Creature @@ -113916,7 +114055,7 @@ toughness=1 [card] name=Stromkirk Occultist abilities=trample,madness -auto=@combatdamaged(player) from(this):name(exile) reveal:1 optionone all(*|reveal) moveto(exile) and!( transforms((,newability[canplayfromexile])) ueot)! optiononeend revealend +auto=@combatdamaged(player) from(this):moveto(exile) and!( transforms((,canplayfromexile)) ueot )! all(*[zpos=1]|mylibrary) autoexile=restriction{discarded} pay({1}{r}) name(pay 1R to cast) activate name(pay 1R to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) text=Trample -- Whenever Stromkirk Occultist deals combat damage to a player, exile the top card of your library. Until end of turn, you may play that card. -- Madness {1}{R} (If you discard this card, discard it into exile. When you do, cast it for its madness cost or put it into your graveyard.) mana={2}{R} @@ -114581,8 +114720,8 @@ type=Instant [/card] [card] name=Summoner's Pact -target=creature[green]|mylibrary -auto=moveTo(myhand) +aicode=activate target(creature[green]|mylibrary) moveto(myhand) +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>creature[green]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend auto=if casted(this) then transforms((,newability[upcost[{2}{G}{G};next upkeep] wingame opponent])) forever color=green text=Summoner's Pact is green. -- Search your library for a green creature card, reveal it, and put it into your hand. Then shuffle your library. -- At the beginning of your next upkeep, pay {2}{G}{G}. If you don't, you lose the game. @@ -115111,7 +115250,8 @@ toughness=10 [/card] [card] name=Supreme Inquisitor -auto={T(wizard|myBattlefield)}{T(wizard|myBattlefield)}{T(wizard|myBattlefield)}{T(wizard|myBattlefield)}{T(wizard|myBattlefield)}:choice name(target player) target(player) moveto(exile) target(*|targetedpersonslibrary) +aicode=activate moveto(exile) target(*|targetedpersonslibrary) +auto={T(wizard|myBattlefield)}{T(wizard|myBattlefield)}{T(wizard|myBattlefield)}{T(wizard|myBattlefield)}{T(wizard|myBattlefield)}:name(target player) target(player) reveal:type:*:targetedpersonslibrary revealzone(targetedpersonslibrary) optionone name(choose card) target(*|reveal) moveto(exile) optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend revealend text=Tap five untapped Wizards you control: Search target player's library for up to five cards and exile them. Then that player shuffles his or her library. mana={3}{U}{U} type=Creature @@ -115332,7 +115472,8 @@ type=Sorcery [/card] [card] name=Survival of the Fittest -auto={G}{D(creature|myhand)}:moveTo(myhand) target(creature|myLibrary) +aicode=activate target(creature|mylibrary) moveto(myhand) +auto={G}{D(creature|myhand)}:name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>creature|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text={G}, Discard a creature card: Search your library for a creature card, reveal that card, and put it into your hand. Then shuffle your library. mana={1}{G} type=Enchantment @@ -115817,7 +115958,8 @@ subtype=Equipment name=Sword of the Animist auto={2}:equip auto=teach(creature) 1/1 -auto=@combat(attacking) source(mytgt):may notatarget(land[basic]|mylibrary) moveto(mybattlefield) and!(tap(noevent))! +aicode=activate moveTo(myBattlefield) and!(tap(noevent))! target(land[basic]|myLibrary) +auto=@combat(attacking) source(mytgt):name(search card) reveal:plibrarycount optionone name(choose card) target(land[basic]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield) and!(tap(noevent))!)! afterrevealedend revealend text=Equipped creature gets +1/+1. -- Whenever equipped creature attacks, you may search your library for a basic land card, put it onto the battlefield tapped, then shuffle your library. -- Equip {2} mana={2} type=Legendary Artifact @@ -115957,7 +116099,8 @@ toughness=4 name=Sylvan Bounty target=player auto=life:8 -autohand=__BASIC_LANDCYCLING__({1}{G}) +aicode=activate target(land[basic]|mylibrary) moveto(myhand) +autohand={1}{G}{cycle}:name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>land[basic]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Target player gains 8 life. -- Basic landcycling {1}{G} ({1}{G}, Discard this card: Search your library for a basic land card, reveal it, and put it into your hand. Then shuffle your library.) mana={5}{G} type=Instant @@ -116020,7 +116163,8 @@ type=Instant [card] name=Sylvan Primordial abilities=reach -auto=target(*[-creature]|opponentbattlefield) destroy and!(if cantargetcard(*[-creature]|nonbattlezone) then choice notatarget(forest|mylibrary) moveto(mybattlefield) and!(tap(noevent))! )! +aicode=activate notatarget(forest|mylibrary) moveto(mybattlefield) and!(tap(noevent))! +auto=target(*[-creature]|opponentbattlefield) destroy and!(if cantargetcard(*[-creature]|nonbattlezone) then name(search card) reveal:plibrarycount optionone name(choose card) target(forest|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield) and!(tap(noevent))!)! afterrevealedend revealend )! text=Reach -- When Sylvan Primordial enters the battlefield, for each opponent, destroy target noncreature permanent that player controls. For each permanent destroyed this way, search your library for a Forest card and put that card onto the battlefield tapped. Then shuffle your library. mana={5}{G}{G} type=Creature @@ -116030,7 +116174,8 @@ toughness=8 [/card] [card] name=Sylvan Ranger -auto=may moveTo(myhand) target(land[basic]|mylibrary) +aicode=activate target(land[basic]|mylibrary) moveto(myhand) +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>land[basic]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=When Sylvan Ranger enters the battlefield, you may search your library for a basic land card, reveal it, and put it into your hand. If you do, shuffle your library. mana={1}{G} type=Creature @@ -116042,7 +116187,8 @@ toughness=1 name=Sylvan Reclamation target=*[artifact;enchantment] auto=moveto(exile) -autohand=__BASIC_LANDCYCLING__({2}) +aicode=activate target(land[basic]|mylibrary) moveto(myhand) +autohand={2}{cycle}:name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>land[basic]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Exile up to two target artifacts and/or enchantments. -- Basic landcycling {2} ({2}, Discard this card: Search your library for a basic land card, reveal it, and put it into your hand. Then shuffle your library.) mana={3}{G}{W} type=Instant @@ -116059,7 +116205,8 @@ toughness=1 [/card] [card] name=Sylvan Scrying -auto=name(search a land) moveTo(myHand) target(land|mylibrary) +aicode=activate target(land|mylibrary) moveto(myhand) +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>land|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Search your library for a land card, reveal it, and put it into your hand. Then shuffle your library. mana={1}{G} type=Sorcery @@ -116067,7 +116214,7 @@ type=Sorcery [card] name=Sylvan Tutor aicode=activate target(creature|mylibrary) moveto(mylibrary) and!(moveto(mylibrary))! -auto=Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>creature|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(mylibrary)])) optiononeend optiontwo bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary )! optiontwoend revealend +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>creature|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(mylibrary)])) optiononeend optiontwo bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary )! optiontwoend revealend text=Search your library for a creature card and reveal that card. Shuffle your library, then put the card on top of it. mana={G} type=Sorcery @@ -116682,7 +116829,8 @@ type=Artifact [/card] [card] name=Tallowisp -auto=@movedto(spirit,arcane|mystack):may moveto(myhand) target(aura|myLibrary) +aicode=activate target(aura|mylibrary) moveto(myhand) +auto=@movedto(spirit,arcane|mystack):name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(aura|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Whenever you cast a Spirit or Arcane spell, you may search your library for an Aura card with enchant creature, reveal it, and put it into your hand. If you do, shuffle your library. mana={1}{W} type=Creature @@ -116830,8 +116978,10 @@ subtype=Tamiyo [/card] [card] name=Tamiyo's Journal -auto=@upkeep:token(Clue,Artifact Clue,0/0) and!( transforms((,newability[{S}{2}:draw:1])) forever )! -auto={T}{S(clue|mybattlefield)}{S(clue|mybattlefield)}{S(clue|mybattlefield)}: moveto(myhand) target(*|mylibrary) +abilities=hiddenface +auto=@each my upkeep:token(Clue,Artifact Clue,0/0) and!( transforms((,newability[{S}{2}:draw:1])) forever )! +aicode=activate target(*|mylibrary) moveto(myhand) +auto={T}{S(clue|mybattlefield)}{S(clue|mybattlefield)}{S(clue|mybattlefield)}:name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>*|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=At the beginning of your upkeep, investigate. (Put a colorless Clue artifact token onto the battlefield with "{2}, Sacrifice this artifact: Draw a card.") -- {T}, Sacrifice three Clues: Search your library for a card and put that card into your hand. Then shuffle your library. mana={5} type=Legendary Artifact @@ -118169,7 +118319,8 @@ toughness=9 [card] name=Terminal Moraine auto={T}:Add{1} -auto={2}{T}{S}:moveTo(myBattlefield) and!(tap(noevent))! target(basic|mylibrary) +aicode=activate moveTo(myBattlefield) and!(tap(noevent))! target(land[basic]|myLibrary) +auto={2}{T}{S}:name(search card) reveal:plibrarycount optionone name(choose card) target(land[basic]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield) and!(tap(noevent))!)! afterrevealedend revealend text={T}: Add {1} to your mana pool. -- {2}, {T}, Sacrifice Terminal Moraine: Search your library for a basic land card and put that card onto the battlefield tapped. Then shuffle your library. type=Land [/card] @@ -118268,7 +118419,8 @@ type=Land [/card] [card] name=Terramorphic Expanse -auto={T}{S}:moveTo(myBattlefield) and!(tap(noevent))! target(basic|mylibrary) +aicode=activate moveTo(myBattlefield) and!(tap(noevent))! target(land[basic]|myLibrary) +auto={T}{S}:name(search card) reveal:plibrarycount optionone name(choose card) target(land[basic]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield) and!(tap(noevent))!)! afterrevealedend revealend text={T}, Sacrifice Terramorphic Expanse: Search your library for a basic land card and put it onto the battlefield tapped. Then shuffle your library. type=Land [/card] @@ -118574,8 +118726,8 @@ subtype=Aura [card] name=Thada Adel, Acquisitor abilities=islandwalk -auto=@combatdamagefoeof(player) from(this):name(exile artifact) notatarget(artifact|opponentlibrary) moveto(myexile) and!( transforms((,newability[canplayfromexile],newability[phaseactionmulti[endofturn once] moveto(ownerexile) all(this|exile)])) ueot)! -auto=@combatdamageof(player) from(this):name(exile artifact) notatarget(artifact|mylibrary) moveto(myexile) and!( transforms((,newability[canplayfromexile],newability[phaseactionmulti[endofturn once] moveto(ownerexile) all(this|exile)])) ueot)! +aicode=activate notatarget(artifact|opponentlibrary) moveto(myexile) and!( transforms((,canplayfromexile,newability[phaseactionmulti[endofturn once] moveto(ownerexile) all(this|exile)])) ueot)! +auto=@combatdamaged(player) from(this):name(exile artifact) Reveal:olibrarycount revealzone(opponentlibrary) optionone name(choose card) target(<1>artifact|reveal) moveto(myexile) and!( transforms((,canplayfromexile,newability[phaseactionmulti[endofturn once] moveto(ownerexile) all(this|exile)],newability[all(other *|reveal) moveto(ownerlibrary) and!(shuffle)!])) ueot)! optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Islandwalk -- Whenever Thada Adel, Acquisitor deals combat damage to a player, search that player's library for an artifact card and exile it. Then that player shuffles his or her library. Until end of turn, you may play that card. mana={1}{U}{U} type=Legendary Creature @@ -118694,7 +118846,8 @@ toughness=2 [card] name=Thalia's Lancers abilities=first strike -auto=may moveTo(myHand) target(*[legendary]|myLibrary) +aicode=activate target(*[legendary]|mylibrary) moveto(myhand) +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>*[legendary]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=First strike -- When Thalia's Lancers enters the battlefield, you may search your library for a legendary card, reveal it, put it into your hand, then shuffle your library. mana={3}{W}{W} type=Creature @@ -118853,7 +119006,8 @@ toughness=2 [card] name=Thawing Glaciers auto=tap(noevent) -auto={1}{T}:moveTo(mybattlefield) and!(tap(noevent))! target(land[basic]|mylibrary) && phaseaction[cleanup,sourceinplay] moveto(myhand) all(this) +aicode=activate moveTo(mybattlefield) and!( tap(noevent) && phaseaction[cleanup,sourceinplay] moveto(myhand) all(this) )! target(land[basic]|mylibrary) +auto={1}{T}:name(search card) reveal:plibrarycount optionone name(choose card) target(land[basic]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot && phaseaction[cleanup,sourceinplay] moveto(myhand) all(this))! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield) and!(tap(noevent))!)! afterrevealedend revealend text=Thawing Glaciers enters the battlefield tapped. -- {1}, {T}: Search your library for a basic land card, put that card onto the battlefield tapped, then shuffle your library. Return Thawing Glaciers to its owner's hand at the beginning of the next cleanup step. type=Land [/card] @@ -119975,7 +120129,8 @@ subtype=Arcane [/card] [card] name=Three Visits -auto=moveTo(myBattlefield) notatarget(forest|mylibrary) +aicode=activate moveTo(myBattlefield) target(forest|myLibrary) +auto=name(search card) reveal:plibrarycount optionone name(choose card) target(forest|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield))! afterrevealedend revealend text=Search your library for a Forest card and put that card onto the battlefield. Then shuffle your library. mana={1}{G} type=Sorcery @@ -120896,7 +121051,8 @@ type=Enchantment [/card] [card] name=Time of Need -auto=moveTo(myHand) notatarget(creature[legendary]|mylibrary) +aicode=activate target(creature[legendary]|mylibrary) moveto(myhand) +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>creature[legendary]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Search your library for a legendary creature card, reveal it, and put it into your hand. Then shuffle your library. mana={1}{G} type=Sorcery @@ -121048,7 +121204,8 @@ toughness=1 [/card] [card] name=Tinker -auto=moveto(mybattlefield) target(artifact|mylibrary) +aicode=activate moveTo(myBattlefield) target(artifact|myLibrary) +auto=name(search card) reveal:plibrarycount optionone name(choose card) target(artifact|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield))! afterrevealedend revealend text=As an additional cost to cast Tinker, sacrifice an artifact. -- Search your library for an artifact card and put that card onto the battlefield. Then shuffle your library. mana={2}{U}{S(artifact|mybattlefield)} type=Sorcery @@ -121203,7 +121360,9 @@ toughness=1 [/card] [card] name=Tithe -auto=if type(land|mybattlefield)~lessthan~type(land|opponentbattlefield) then moveTo(myhand) notatarget(plains|mylibrary) else moveTo(myhand) notatarget(plains|mylibrary) +aicode=activate transforms((,newability[if type(land|mybattlefield)~lessthan~type(land|opponentbattlefield) then moveTo(myhand) notatarget(plains|mylibrary) else moveTo(myhand) notatarget(plains|mylibrary)])) ueot +auto=if type(land|mybattlefield)~lessthan~type(land|opponentbattlefield) then name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(plains|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend +auto=ifnot type(land|mybattlefield)~lessthan~type(land|opponentbattlefield) then name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(plains|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Search your library for a Plains card. If you control fewer lands than an opponent, you may search your library for an additional Plains card. Reveal those cards and put them into your hand. Then shuffle your library. mana={W} type=Instant @@ -121274,7 +121433,8 @@ type=Sorcery name=Tolaria West auto=tap(noevent) auto={T}:Add{U} -autohand={1}{U}{U}{discard}:moveTo(myhand) target(*[manacost=0]|mylibrary) asSorcery +aicode=activate target(*[manacost=0]|mylibrary) moveto(myhand) +autohand={1}{U}{U}{discard}:name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>*[manacost=0]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Tolaria West enters the battlefield tapped. -- {T}: Add {U} to your mana pool. -- Transmute {1}{U}{U} ({1}{U}{U}, Discard this card: Search your library for a card with converted mana cost 0, reveal it, and put it into your hand. Then shuffle your library. Transmute only as a sorcery.) type=Land [/card] @@ -121867,7 +122027,8 @@ toughness=3 [/card] [card] name=Totem-Guide Hartebeest -auto=may moveTo(myhand) target(aura|myLibrary) +aicode=activate target(aura|mylibrary) moveto(myhand) +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(aura|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=When Totem-Guide Hartebeest enters the battlefield, you may search you library for an aura card, reveal it, put it into your hand and shuffle your library. mana={4}{W} type=Creature @@ -122567,7 +122728,8 @@ toughness=3 [/card] [card] name=Trapmaker's Snare -auto=moveTo(myhand) notatarget(*[trap]|mylibrary) +aicode=activate target(*[trap]|mylibrary) moveto(myhand) +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>*[trap]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Search your library for a Trap card, reveal it, and put it into your hand. Then shuffle your library. mana={1}{U} type=Instant @@ -122594,7 +122756,8 @@ type=Sorcery name=Traumatic Visions target=*|stack auto=fizzle -autohand=__BASIC_LANDCYCLING__({1}{U}) +aicode=activate target(land[basic]|mylibrary) moveto(myhand) +autohand={1}{U}{cycle}:name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>land[basic]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Counter target spell. -- Basic landcycling {1}{U} ({1}{U}, Discard this card: Search your library for a basic land card, reveal it, and put it into your hand. Then shuffle your library.) mana={3}{U}{U} type=Instant @@ -122618,7 +122781,8 @@ type=Sorcery [/card] [card] name=Traveler's Amulet -auto={1}{S}:moveTo(myhand) target(land[basic]|mylibrary) +aicode=activate target(land[basic]|mylibrary) moveto(myhand) +auto={1}{S}:name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>land[basic]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text={1}, Sacrifice Traveler's Amulet: Search your library for a basic land card, reveal it, and put it into your hand. Then shuffle your library. mana={1} type=Artifact @@ -122653,8 +122817,9 @@ toughness=2 [/card] [card] name=Traverse the Ulvenwald -auto=ifnot delirium then moveto(myhand) target(land[basic]|mylibrary) -auto=if delirium then moveto(myhand) target(land,creature|mylibrary) +aicode=activate transforms((,newability[if delirium then moveto(myhand) target(*[land;creature]|mylibrary)],newability[ifnot delirium then moveto(myhand) target(land[basic]|mylibrary)])) ueot +auto=if delirium then name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>*[creature;land]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend +auto=ifnot delirium then name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>land|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Search your library for a basic land card, reveal it, put it into your hand, then shuffle your library. -- Delirium If there are four or more card types among cards in your graveyard, instead search your library for a creature or land card, reveal it, put it into your hand, then shuffle your library. mana={G} type=Sorcery @@ -122672,8 +122837,10 @@ toughness=3 [/card] [card] name=Treacherous Terrain -auto=damage:type:land:opponentbattlefield opponent -autohand=__BASIC_LANDCYCLING__({2}) +target=player +auto=damage:type:land:targetedpersonsbattlefield +aicode=activate target(land[basic]|mylibrary) moveto(myhand) +autohand={2}{cycle}:name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>land[basic]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Treacherous Terrain deals damage to each opponent equal to the number of lands that player controls. -- Basic landcycling {2} ({2}, Discard this card: Search your library for a basic land card, reveal it, and put it into your hand. Then shuffle your library.) mana={6}{R}{G} type=Sorcery @@ -122778,7 +122945,8 @@ toughness=3 [/card] [card] name=Treasure Mage -auto=may moveTo(myhand) target(artifact[manacost>=6]|mylibrary) +aicode=activate target(artifact[manacost>=6]|mylibrary) moveto(myhand) +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>artifact[manacost>=6]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=When Treasure Mage enters the battlefield, you may search your library for an artifact card with converted mana cost 6 or greater, reveal that card, and put it into your hand. If you do, shuffle your library. mana={2}{U} type=Creature @@ -122853,7 +123021,7 @@ type=Artifact Land [card] name=Treefolk Harbinger aicode=activate target(*[treefolk;forest]|mylibrary) moveto(mylibrary) and!(moveto(mylibrary))! -auto=Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(*[treefolk;forest]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(mylibrary)])) optiononeend optiontwo bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary )! optiontwoend revealend +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(*[treefolk;forest]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(mylibrary)])) optiononeend optiontwo bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary )! optiontwoend revealend text=When Treefolk Harbinger enters the battlefield, you may search your library for a Treefolk or Forest card, reveal it, then shuffle your library and put that card on top of it. mana={G} type=Creature @@ -122975,14 +123143,15 @@ type=Sorcery [/card] [card] name=Trench Gorger -auto=choice target(land|mylibrary) moveto(exile) && lord(this) 1/1 -auto=choice lord(this) 6/6 +abilities=trample +aicode=activate target(land|mylibrary) moveto(myexile) and!(all(this) becomes(,0/0) forever && lord(this) 1/1)! +auto=name(exile cards) Reveal:type:*:mylibrary revealtype(land|mylibrary) revealzone(mylibrary) optionone name(choose cards) target(land|reveal) moveto(exile) and!( becomes(trenchgorged) ueot )! optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend afterrevealed all(trenchgorged|myexile) moveto(myexile) and!(all(this) becomes(,0/0) forever && lord(this) 1/1)! afterrevealedend revealend text=Trample -- When Trench Gorger enters the battlefield, you may search your library for any number of land cards, exile them, then shuffle your library. If you do, Trench Gorger's power and toughness each become equal to the number of cards exiled this way. mana={6}{U}{U} type=Creature subtype=Leviathan -power=0 -toughness=0 +power=6 +toughness=6 [/card] [card] name=Trench Wurm @@ -123280,7 +123449,8 @@ type=Artifact [/card] [card] name=Trinket Mage -auto=may moveTo(myhand) target(artifact[manacost<=1]|mylibrary) +aicode=activate target(artifact[manacost<=1]|mylibrary) moveto(myhand) +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>artifact[manacost<=1]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=When Trinket Mage enters the battlefield, you may search your library for an artifact card with converted mana cost 1 or less, reveal that card, and put it into your hand. If you do, shuffle your library. mana={2}{U} type=Creature @@ -123499,7 +123669,7 @@ toughness=3 [card] name=Trophy Mage aicode=activate target(artifact[manacost=3]|mylibrary) moveto(myhand) -auto=Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>artifact[manacost=3]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend +auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>artifact[manacost=3]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=When Trophy Mage enters the battlefield, you may search your library for an artifact card with converted mana cost 3, reveal it, put it into your hand, then shuffle your library. mana={2}{U} type=Creature @@ -124080,7 +124250,8 @@ type=Sorcery [card] name=Twisted Abomination auto={B}:regenerate -autohand={2}{cycle}:name(swampcycling) moveTo(myhand) target(swamp|mylibrary) +aicode=activate moveTo(myhand) target(swamp|myLibrary) +autohand={2}{cycle}:name(search card) reveal:plibrarycount optionone name(choose card) target(<1>swamp|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveto(myhand))! afterrevealedend revealend text={B}: Regenerate Twisted Abomination. -- Swampcycling {2} ({2}, Discard this card: Search your library for a Swamp card, reveal it, and put it into your hand. Then shuffle your library.) mana={5}{B} type=Creature @@ -124474,7 +124645,8 @@ toughness=2 name=Ulvenwald Hydra abilities=reach anyzone=type:land:mybattlefield/type:land:mybattlefield cdaactive -auto=may target(land|mylibrary) moveto(mybattlefield) and!(tap(noevent))! +aicode=activate moveTo(myBattlefield) and!(tap(noevent))! target(land|myLibrary) +auto=name(search card) reveal:plibrarycount optionone name(choose card) target(land|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield) and!(tap(noevent))!)! afterrevealedend revealend text=Reach -- Ulvenwald Hydra's power and toughness are each equal to the number of lands you control. -- When Ulvenwald Hydra enters the battlefield, you may search your library for a land card, put it onto the battlefield tapped, then shuffle your library. mana={4}{G}{G} type=Creature @@ -125421,7 +125593,8 @@ type=Instant [/card] [card] name=Untamed Wilds -auto=moveTo(myBattlefield) notatarget(land[basic]|mylibrary) +aicode=activate moveTo(myBattlefield) target(land[basic]|myLibrary) +auto=name(search card) reveal:plibrarycount optionone name(choose card) target(land[basic]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield))! afterrevealedend revealend text=Search your library for a basic land card and put that card onto the battlefield. Then shuffle your library. mana={2}{G} type=Sorcery @@ -126079,7 +126252,8 @@ toughness=2 [/card] [card] name=Valley Rannet -autohand={2}{cycle}:name(mountaincycling or forestcycling) moveTo(myhand) target(mountain,forest|mylibrary) +aicode=activate moveTo(myhand) target(*[forest;mountain]|myLibrary) +autohand={2}{cycle}:name(search card) reveal:plibrarycount optionone name(choose card) target(<1>*[forest;mountain]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveto(myhand))! afterrevealedend revealend text=Mountaincycling {2}, forestcycling {2} ({2}, Discard this card: Search your library for a Mountain or Forest card, reveal it, and put it into your hand. Then shuffle your library.) mana={4}{R}{G} type=Creature @@ -126351,8 +126525,9 @@ type=Sorcery [/card] [card] name=Vampiric Tutor -auto=name(search a card) moveTo(exile) and!(transforms((,newability[moveto(ownerlibrary)])) oneshot)! notatarget(*|mylibrary) -auto=life:-2 controller +abilities=hiddenface +aicode=activate moveto(mylibrary) and!(moveto(mylibrary) and!(life:-2 controller)!)! target(*|mylibrary) +auto=name(search card) reveal:plibrarycount optionone name(choose card) target(*|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(mylibrary) and!(moveto(mylibrary) and!(life:-2 controller)!)! afterrevealedend revealend text=Search your library for a card, then shuffle your library and put that card on top of it. You lose 2 life. mana={B} type=Instant @@ -126646,7 +126821,8 @@ toughness=1 name=Vedalken AEthermage abilities=flash auto=moveto(ownerhand) target(sliver) -autohand={3}{cycle}:name(wizardcycling) moveTo(myhand) target(wizard|mylibrary) +aicode=activate moveTo(myHand) target(wizard|myLibrary) +autohand={3}{cycle}:name(search card) reveal:plibrarycount optionone name(choose card) target(<1>wizard|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myhand))! afterrevealedend revealend text=Flash (You may cast this spell any time you could cast an instant.) -- When Vedalken AEthermage enters the battlefield, return target Sliver to its owner's hand. -- Wizardcycling {3} ({3}, Discard this card: Search your library for a Wizard card, reveal it, and put it into your hand. Then shuffle your library.) mana={1}{U} type=Creature @@ -127147,7 +127323,8 @@ toughness=2 [/card] [card] name=Verdant Catacombs -auto={L}{T}{S}:moveTo(myBattlefield) target(swamp,forest|mylibrary) +aicode=activate moveTo(myBattlefield) target(*[forest;swamp]|myLibrary) +auto={L}{T}{S}:name(search card) reveal:plibrarycount optionone name(choose card) target(*[forest;swamp]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveto(ownerbattlefield))! afterrevealedend revealend text={T}, Pay 1 life, Sacrifice Verdant Catacombs: Search your library for a Swamp or Forest card and put it onto the battlefield. Then shuffle your library. type=Land [/card] @@ -128393,7 +128570,8 @@ toughness=2 [/card] [card] name=Viridian Emissary -auto=@movedTo(this|graveyard) from(battlefield):may moveTo(mybattlefield) and!(tap(noevent))! target(land[basic]|mylibrary) +aicode=activate moveTo(myBattlefield) and!(tap(noevent))! target(land[basic]|myLibrary) +auto=@movedTo(this|graveyard) from(battlefield):name(search card) reveal:plibrarycount optionone name(choose card) target(land[basic]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield) and!(tap(noevent))!)! afterrevealedend revealend text=When Viridian Emissary dies, you may search your library for a basic land card and put that card onto the battlefield tapped. If you do, shuffle your library. mana={1}{G} type=Creature @@ -130598,7 +130776,8 @@ toughness=3 [/card] [card] name=Wanderer's Twig -auto={1}{S}:moveTo(myhand) target(land[basic]|mylibrary) +aicode=activate moveTo(myHand) target(land[basic]|myLibrary) +auto={1}{S}:name(search card) reveal:plibrarycount optionone name(choose card) target(<1>land[basic]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myhand))! afterrevealedend revealend text={1}, Sacrifice Wanderer's Twig: Search your library for a basic land card, reveal it, and put it into your hand. Then shuffle your library. mana={1} type=Artifact @@ -130976,7 +131155,8 @@ toughness=4 [/card] [card] name=Wargate -auto=moveto(mybattlefield) target(*[-instant;-sorcery;manacost <=X]|mylibrary) +aicode=activate moveTo(myBattlefield) target(*[-instant;-sorcery;manacost <=X]|myLibrary) +auto=name(search card) reveal:plibrarycount optionone name(choose card) target(*[-instant;-sorcery;manacost <=X]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveto(ownerbattlefield))! afterrevealedend revealend text=Search your library for a permanent card with converted mana cost X or less, put it onto the battlefield, then shuffle your library. mana={X}{G}{W}{U} type=Sorcery @@ -131085,7 +131265,8 @@ type=Enchantment [card] name=Warped Landscape auto={T}:Add{C} -auto={2}{T}{S}:moveto(mybattlefield) target(basic|mylibrary) and!(tap(noevent))! +aicode=activate moveTo(myBattlefield) and!(tap(noevent))! target(land[basic]|myLibrary) +auto={2}{T}{S}:name(search card) reveal:plibrarycount optionone name(choose card) target(land[basic]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield) and!(tap(noevent))!)! afterrevealedend revealend text={T}: Add {C} to your mana pool. -- {2}, {T}, Sacrifice Warped Landscape: Search your library for a basic land card and put it onto the battlefield tapped. Then shuffle your library. type=Land [/card] @@ -131585,7 +131766,8 @@ subtype=Aura [/card] [card] name=Wayfarer's Bauble -auto={2}{T}{S}:moveTo(myBattlefield) and!(tap(noevent))! target(land[basic]|mylibrary) +aicode=activate moveTo(myBattlefield) and!(tap(noevent))! target(land[basic]|myLibrary) +auto={2}{T}{S}:name(search card) reveal:plibrarycount optionone name(choose card) target(land[basic]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield) and!(tap(noevent))!)! afterrevealedend revealend text={2}, {T}, Sacrifice Wayfarer's Bauble: Search your library for a basic land card and put that card onto the battlefield tapped. Then shuffle your library. mana={1} type=Artifact @@ -131717,7 +131899,8 @@ toughness=2 [/card] [card] name=Weathered Wayfarer -auto={W}{T}:moveTo(myhand) target(land|mylibrary) restriction{type(land|opponentbattlefield)~morethan~type(land|mybattlefield)} +aicode=activate moveTo(myhand) target(land|mylibrary) +auto={W}{T}:name(search card) reveal:plibrarycount optionone name(choose card) target(<1>land|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myhand))! afterrevealedend revealend restriction{control less lands} text={W}, {T}: Search your library for a land card, reveal it, and put it into your hand. Then shuffle your library. Activate this ability only if an opponent controls more lands than you. mana={W} type=Creature @@ -132019,7 +132202,8 @@ toughness=2 [card] name=Welkin Hawk abilities=flying -auto=@movedTo(this|graveyard) from(battlefield):may moveTo(myHand) target(welkin hawk|mylibrary) +aicode=activate moveTo(myHand) target(Welkin Hawk|myLibrary) +auto=@movedto(this|graveyard) from(battlefield):name(search card) reveal:plibrarycount optionone name(choose card) target(Welkin Hawk|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myhand))! afterrevealedend revealend text=Flying -- When Welkin Hawk dies, you may search your library for a card named Welkin Hawk, reveal that card, put it into your hand, then shuffle your library. mana={1}{W} type=Creature @@ -132925,7 +133109,8 @@ type=Enchantment [/card] [card] name=Wild Wanderer -auto=may moveto(ownerbattlefield) and!(tap(noevent))! notatarget(land[basic]|mylibrary) +aicode=activate moveTo(myBattlefield) and!(tap(noevent))! target(land[basic]|myLibrary) +auto=name(search card) reveal:plibrarycount optionone name(choose card) target(land[basic]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield) and!(tap(noevent))!)! afterrevealedend revealend text=When Wild Wanderer enters the battlefield, you may search your library for a basic land card, put it onto the battlefield tapped, then shuffle your library. mana={3}{G} type=Creature @@ -132997,7 +133182,8 @@ type=Artifact [card] name=Wild-Field Scarecrow abilities=defender -auto={2}{s}:moveto(myhand) target(basic|mylibrary) +aicode=activate moveTo(myHand) target(land[basic]|myLibrary) +auto={2}{S}:name(search card) reveal:plibrarycount optionone name(choose card) target(land[basic]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myhand))! afterrevealedend revealend text=Defender -- {2}, Sacrifice Wild-Field Scarecrow: Search your library for up to two basic land cards, reveal them, and put them into your hand. Then shuffle your library. mana={3} type=Artifact Creature @@ -133427,7 +133613,8 @@ type=Instant [/card] [card] name=Windswept Heath -auto={L}{T}{S}:moveTo(myBattlefield) target(forest,plains|mylibrary) +aicode=activate moveTo(myBattlefield) target(*[forest;plains]|myLibrary) +auto={L}{T}{S}:name(search card) reveal:plibrarycount optionone name(choose card) target(*[forest;plains]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveto(ownerbattlefield))! afterrevealedend revealend text={T}, Pay 1 life, Sacrifice Windswept Heath: Search your library for a Forest or Plains card and put it onto the battlefield. Then shuffle your library. type=Land [/card] @@ -133714,7 +133901,8 @@ toughness=2 [/card] [card] name=Wirewood Guardian -autohand={2}{cycle}:name(forestcycling) moveTo(myhand) target(forest|mylibrary) +aicode=activate moveTo(myHand) target(forest|myLibrary) +autohand={2}{cycle}:name(search card) reveal:plibrarycount optionone name(choose card) target(forest|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myhand))! afterrevealedend revealend text=Forestcycling {2} ({2}, Discard this card: Search your library for a Forest card, reveal it, and put it into your hand. Then shuffle your library.) mana={5}{G}{G} type=Creature @@ -133724,7 +133912,8 @@ toughness=6 [/card] [card] name=Wirewood Herald -auto=@movedto(this|graveyard) from(battlefield):may moveto(myhand) target(elf|mylibrary) +aicode=activate moveTo(myHand) target(elf|myLibrary) +auto=@movedto(this|graveyard) from(battlefield):name(search card) reveal:plibrarycount optionone name(choose card) target(elf|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myhand))! afterrevealedend revealend text=When Wirewood Herald dies, you may search your library for an Elf card, reveal that card, put it into your hand, then shuffle your library. mana={1}{G} type=Creature @@ -134245,7 +134434,8 @@ toughness=0 [/card] [card] name=Wood Elves -auto=may moveTo(mybattlefield) target(forest|myLibrary) +aicode=activate moveTo(myBattlefield) target(forest|myLibrary) +auto=name(search card) reveal:plibrarycount optionone name(choose card) target(forest|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveto(ownerbattlefield))! afterrevealedend revealend text=When Wood Elves enters the battlefield, search your library for a Forest card and put that card onto the battlefield. Then shuffle your library. mana={2}{G} type=Creature @@ -134296,7 +134486,8 @@ type=Land [/card] [card] name=Wooded Foothills -auto={L}{T}{S}:moveTo(myBattlefield) target(mountain,forest|mylibrary) +aicode=activate moveTo(myBattlefield) target(*[mountain;forest]|myLibrary) +auto={L}{T}{S}:name(search card) reveal:plibrarycount optionone name(choose card) target(*[mountain;forest]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveto(ownerbattlefield))! afterrevealedend revealend text={T}, Pay 1 life, Sacrifice Wooded Foothills: Search your library for a Mountain or Forest card and put it onto the battlefield. Then shuffle your library. type=Land [/card] @@ -134330,7 +134521,8 @@ toughness=6 [/card] [card] name=Woodland Bellower -auto=may moveto(mybattlefield) notatarget(creature[green;manacost<=3;-legendary]|mylibrary) +aicode=activate moveTo(myBattlefield) target(creature[green;manacost<=3;-legendary]|myLibrary) +auto=name(search card) reveal:plibrarycount optionone name(choose card) target(creature[green;manacost<=3;-legendary]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield))! afterrevealedend revealend text=When Woodland Bellower enters the battlefield, you may search your library for a nonlegendary green creature card with converted mana cost 3 or less, put it onto the battlefield, then shuffle your library. mana={4}{G}{G} type=Creature @@ -135205,6 +135397,7 @@ toughness=5 [/card] [card] name=Xenagos, the Reveler +aicode=activate transforms((,newability[all(*[zpos<=7]|mylibrary) moveto(exile) and!( if cantargetcard(*[creature;land]|*) then moveto(ownerbattlefield)])) ueot auto=counter(0/0,3,loyalty) auto={C(0/0,1,Loyalty)}:name(+1: Red/Green Mana) foreach(creature|mybattlefield) ability$! choice add{R} _ choice add{G} !$ controller auto={C(0/0,0,Loyalty)}:name(0: Satyr token) token(Satyr,Creature Satyr,2/2,haste,green,red) @@ -135332,8 +135525,8 @@ type=Land [card] name=Yavimaya Dryad abilities=forestwalk -auto=may name(my battlefield) moveTo(myBattlefield) and!(tap(noevent))! target(forest|mylibrary) -auto=may name(opponent's battlefield) moveTo(opponentBattlefield) and!(tap(noevent))! target(forest|mylibrary) +aicode=activate moveto(targetedpersonsbattlefield) and!(tap(noevent))! target(forest|mylibrary) +auto=name(target player) target(player) reveal:plibrarycount revealzone(mylibrary) optionone name(choose card) target(forest|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveto(targetedpersonsbattlefield) and!(tap(noevent))!)! afterrevealedend revealend text=Forestwalk -- When Yavimaya Dryad enters the battlefield, you may search your library for a Forest card and put it onto the battlefield tapped under target player's control. If you do, shuffle your library. mana={1}{G}{G} type=Creature @@ -135344,7 +135537,8 @@ toughness=1 [card] name=Yavimaya Elder auto={2}{S}:draw:1 -auto=@movedto(this|graveyard) from(battlefield):may moveTo(myHand) target(land[basic]|myLibrary) +aicode=activate moveTo(myHand) target(land[basic]|myLibrary) +auto=@movedto(this|graveyard) from(battlefield):name(search card) reveal:plibrarycount optionone name(choose card) target(land[basic]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myhand))! afterrevealedend revealend text=When Yavimaya Elder dies, you may search your library for up to two basic land cards, reveal them, and put them into your hand. If you do, shuffle your library. -- {2}, Sacrifice Yavimaya Elder: Draw a card. mana={1}{G}{G} type=Creature @@ -135375,7 +135569,8 @@ toughness=1 [/card] [card] name=Yavimaya Granger -auto=may moveTo(myBattlefield) and!(tap(noevent))! target(land[basic]|myLibrary) +aicode=activate moveTo(myBattlefield) and!(tap(noevent))! target(land[basic]|myLibrary) +auto=name(search card) reveal:plibrarycount optionone name(choose card) target(land[basic]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield) and!(tap(noevent))!)! afterrevealedend revealend auto=upcost[{2}{G};next upkeep] sacrifice text=Echo {2}{G} (At the beginning of your upkeep, if this came under your control since the beginning of your last upkeep, sacrifice it unless you pay its echo cost.) -- When Yavimaya Granger enters the battlefield, you may search your library for a basic land card, put that card onto the battlefield tapped, then shuffle your library. mana={2}{G} @@ -135537,7 +135732,7 @@ toughness=2 [/card] [card] name=Yew Spirit -auto={2}{G}{G}:name(power pump both) dynamicability && dynamicability +auto={2}{G}{G}:power/power ueot text={2}{G}{G}: Yew Spirit gets +X/+X until end of turn, where X is its power. mana={4}{G} type=Creature @@ -135558,7 +135753,8 @@ toughness=4 [/card] [card] name=Yisan, the Wanderer Bard -auto={2}{G}{T}{C(0/0,1,Verse)}:name(search creature) Reveal:type:*:mylibrary revealzone(mylibrary) revealtype(*[creature]|mylibrary) optionone target(creature[manacost=counter{0%0.1.Verse}]|reveal) moveto(mybattlefield) and!( all(*|reveal) moveto(mylibrary) )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(mylibrary) and!( all(*|reveal) moveto(mylibrary) )! optiontwoend afterrevealed shuffle afterrevealedend revealend +aicode=activate transforms((,newability[moveTo(myBattlefield) target(creature[manacost=counter{0%0.1.Verse}]|myLibrary)])) ueot +auto={2}{G}{T}{C(0/0,4,Verse)}:name(search card) reveal:plibrarycount optionone name(choose card) target(<1>creature[manacost=counter{0%0.1.Verse}]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield))! afterrevealedend revealend text={2}{G}, {T}, Put a verse counter on Yisan, the Wanderer Bard: Search your library for a creature card with converted mana cost equal to the number of verse counters on Yisan, put it onto the battlefield, then shuffle your library. mana={2}{G} type=Legendary Creature @@ -136096,7 +136292,8 @@ toughness=4 [/card] [card] name=Zirilan of the Claw -auto={1}{r}{r}{t}:target(dragon|mylibrary) moveto(mybattlefield) && transforms((,unearth,haste)) forever +aicode=activate moveTo(myBattlefield) and!(transforms((,haste,unearth)) forever)! target(dragon|myLibrary) +auto={1}{r}{r}{t}:name(search card) reveal:plibrarycount optionone name(choose card) target(dragon|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield) and!(transforms((,haste,unearth)) forever)!)! afterrevealedend revealend text={1}{R}{R}, {T}: Search your library for a Dragon permanent card and put that card onto the battlefield. Then shuffle your library. That Dragon gains haste until end of turn. Exile it at the beginning of the next end step. mana={3}{R}{R} type=Legendary Creature @@ -136390,6 +136587,7 @@ type=Sorcery [/card] [card] name=Zoologist +aicode=activate transforms((,newability[if type(creature[zpos=1]|mylibrary)~morethan~0 then target(creature[zpos=1]|mylibrary) moveto(ownerbattlefield) else target(*[zpos=1]|mylibrary) moveto(ownergraveyard)])) ueot auto={3}{g}{t}:reveal:1 optionone target(creature|reveal) moveto(mybattlefield) optiononeend optiontwo name(Put in grave) target(<1>*|reveal) moveto(mygraveyard) optiontwoend revealend text={3}{G}, {T}: Reveal the top card of your library. If it's a creature card, put it onto the battlefield. Otherwise, put it into your graveyard. mana={3}{G} @@ -136468,7 +136666,8 @@ toughness=2 [card] name=Zur the Enchanter abilities=flying -auto=@combat(attacking) source(this):may moveTo(myBattlefield) target(enchantment[manacost<=3]|myLibrary) +aicode=activate moveTo(myBattlefield) target(enchantment[manacost<=3]|myLibrary) +auto=@combat(attacking) source(this):name(search card) reveal:plibrarycount optionone name(choose card) target(enchantment[manacost<=3]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveto(ownerbattlefield))! afterrevealedend revealend text=Flying -- Whenever Zur the Enchanter attacks, you may search your library for an enchantment card with converted mana cost 3 or less and put it onto the battlefield. If you do, shuffle your library. mana={1}{W}{U}{B} type=Legendary Creature diff --git a/projects/mtg/bin/Res/sets/primitives/unsupported.txt b/projects/mtg/bin/Res/sets/primitives/unsupported.txt index 883dc9f5a..0e5d71923 100644 --- a/projects/mtg/bin/Res/sets/primitives/unsupported.txt +++ b/projects/mtg/bin/Res/sets/primitives/unsupported.txt @@ -593,15 +593,6 @@ power=4 toughness=1 [/card] [card] -name=Ashen Ghoul -text=Haste -- {B}: Return Ashen Ghoul from your graveyard to the battlefield. Activate this ability only during your upkeep and only if three or more creature cards are above Ashen Ghoul. -mana={3}{B} -type=Creature -subtype=Zombie -power=3 -toughness=1 -[/card] -[card] name=Ashiok, Nightmare Weaver text=+2: Exile the top three cards of target opponent's library. -- -X: Put a creature card with converted mana cost X exiled with Ashiok, Nightmare Weaver onto the battlefield under your control. That creature is a Nightmare in addition to its other types. -- -10: Exile all cards from all opponents' hands and graveyards. mana={1}{U}{B} @@ -3485,12 +3476,6 @@ mana={4}{W} type=Sorcery [/card] [card] -name=Death Spark -text=Death Spark deals 1 damage to target creature or player. -- At the beginning of your upkeep, if Death Spark is in your graveyard with a creature card directly above it, you may pay {1}. If you do, return Death Spark to your hand. -mana={R} -type=Instant -[/card] -[card] name=Death Wish text=You may choose a card you own from outside the game and put it into your hand. You lose half your life, rounded up. Exile Death Wish. mana={1}{B}{B} @@ -8482,15 +8467,6 @@ power=3 toughness=2 [/card] [card] -name=Krovikan Horror -text=At the beginning of the end step, if Krovikan Horror is in your graveyard with a creature card directly above it, you may return Krovikan Horror to your hand. -- {1}, Sacrifice a creature: Krovikan Horror deals 1 damage to target creature or player. -mana={3}{B} -type=Creature -subtype=Horror Spirit -power=2 -toughness=2 -[/card] -[card] name=Krovikan Vampire text=At the beginning of each end step, if a creature dealt damage by Krovikan Vampire this turn died, put that card onto the battlefield under your control. Sacrifice it when you lose control of Krovikan Vampire. mana={3}{B}{B} @@ -10495,15 +10471,6 @@ power=6 toughness=6 [/card] [card] -name=Nether Shadow -text=Haste -- At the beginning of your upkeep, if Nether Shadow is in your graveyard with three or more creature cards above it, you may put Nether Shadow onto the battlefield. -mana={B}{B} -type=Creature -subtype=Spirit -power=1 -toughness=1 -[/card] -[card] name=Nettlevine Blight text=Enchant creature or land -- Enchanted permanent has "At the beginning of your end step, sacrifice this permanent and attach Nettlevine Blight to a creature or land you control." mana={4}{B}{B} diff --git a/projects/mtg/bin/Res/test/welkin_hawk.txt b/projects/mtg/bin/Res/test/welkin_hawk.txt index b4421a0f4..dc41e68db 100644 --- a/projects/mtg/bin/Res/test/welkin_hawk.txt +++ b/projects/mtg/bin/Res/test/welkin_hawk.txt @@ -9,7 +9,7 @@ hand:shock [DO] shock welkin hawk -choice 1 +choice 0 [ASSERT] FIRSTMAIN [PLAYER1] diff --git a/projects/mtg/bin/Res/test/windswept_heath.txt b/projects/mtg/bin/Res/test/windswept_heath.txt index fa7684f98..16e5c984a 100644 --- a/projects/mtg/bin/Res/test/windswept_heath.txt +++ b/projects/mtg/bin/Res/test/windswept_heath.txt @@ -11,7 +11,7 @@ library:Forest,Plains,Mountain,Swamp,Island [PLAYER2] [DO] Windswept Heath -choice 1 +choice 0 Plains [ASSERT] firstmain From 0a68a056d81e9dbb568b1c69d1f8534e91178dcb Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Thu, 16 Feb 2017 16:55:13 +0800 Subject: [PATCH 23/26] refactor canproducemana --- projects/mtg/include/CardDescriptor.h | 4 +-- projects/mtg/include/MTGCardInstance.h | 7 +---- projects/mtg/src/CardDescriptor.cpp | 36 ++++++++++++--------- projects/mtg/src/MTGCardInstance.cpp | 43 +++++++++++++++++++++----- projects/mtg/src/TargetChooser.cpp | 10 ++++-- 5 files changed, 69 insertions(+), 31 deletions(-) diff --git a/projects/mtg/include/CardDescriptor.h b/projects/mtg/include/CardDescriptor.h index daa9aa365..383a35439 100644 --- a/projects/mtg/include/CardDescriptor.h +++ b/projects/mtg/include/CardDescriptor.h @@ -70,12 +70,12 @@ class CardDescriptor: public MTGCardInstance int CDdamager; int CDgeared; int CDblocked; - /*int CDcanProduceC; + int CDcanProduceC; int CDcanProduceG; int CDcanProduceU; int CDcanProduceR; int CDcanProduceB; - int CDcanProduceW;*/ + int CDcanProduceW; int CDnocolor; }; diff --git a/projects/mtg/include/MTGCardInstance.h b/projects/mtg/include/MTGCardInstance.h index 3e6f60620..098c77dc0 100644 --- a/projects/mtg/include/MTGCardInstance.h +++ b/projects/mtg/include/MTGCardInstance.h @@ -285,12 +285,7 @@ public: int imprintR; int imprintB; int imprintW; - int canproduceG; - int canproduceU; - int canproduceR; - int canproduceB; - int canproduceW; - int canproduceC; + int canproduceMana(int color = -1); int entersBattlefield; string currentimprintName; vectorimprintedNames; diff --git a/projects/mtg/src/CardDescriptor.cpp b/projects/mtg/src/CardDescriptor.cpp index 5be1448a7..02f6baec6 100644 --- a/projects/mtg/src/CardDescriptor.cpp +++ b/projects/mtg/src/CardDescriptor.cpp @@ -28,12 +28,12 @@ CardDescriptor::CardDescriptor() CDdamager = 0; CDgeared = 0; CDblocked = 0; - /*CDcanProduceC = 0; + CDcanProduceC = 0; CDcanProduceG = 0; CDcanProduceU = 0; CDcanProduceR = 0; CDcanProduceB = 0; - CDcanProduceW = 0;*/ + CDcanProduceW = 0; CDnocolor = 0; } @@ -262,37 +262,45 @@ MTGCardInstance * CardDescriptor::match(MTGCardInstance * card) match = NULL; } } - /* - if ((CDcanProduceC == -1 && card->canproduceC == 1) || (CDcanProduceC == 1 && card->canproduceC == 0)) + + if (CDcanProduceC == -1) + { + int count = card->canproduceMana(Constants::MTG_COLOR_ARTIFACT) + card->canproduceMana(Constants::MTG_COLOR_WASTE); + if (count) + match = NULL; + } + if (CDcanProduceC == 1) + { + int count = card->canproduceMana(Constants::MTG_COLOR_ARTIFACT) + card->canproduceMana(Constants::MTG_COLOR_WASTE); + if (!count) + match = NULL; + } + + if ((CDcanProduceG == -1 && card->canproduceMana(Constants::MTG_COLOR_GREEN) == 1) || (CDcanProduceG == 1 && card->canproduceMana(Constants::MTG_COLOR_GREEN) == 0)) { match = NULL; } - if ((CDcanProduceG == -1 && card->canproduceG == 1) || (CDcanProduceG == 1 && card->canproduceG == 0)) + if ((CDcanProduceU == -1 && card->canproduceMana(Constants::MTG_COLOR_BLUE) == 1) || (CDcanProduceU == 1 && card->canproduceMana(Constants::MTG_COLOR_BLUE) == 0)) { match = NULL; } - if ((CDcanProduceU == -1 && card->canproduceU == 1) || (CDcanProduceU == 1 && card->canproduceU == 0)) + if ((CDcanProduceR == -1 && card->canproduceMana(Constants::MTG_COLOR_RED) == 1) || (CDcanProduceR == 1 && card->canproduceMana(Constants::MTG_COLOR_RED) == 0)) { match = NULL; } - if ((CDcanProduceR == -1 && card->canproduceR == 1) || (CDcanProduceR == 1 && card->canproduceR == 0)) + if ((CDcanProduceB == -1 && card->canproduceMana(Constants::MTG_COLOR_BLACK) == 1) || (CDcanProduceB == 1 && card->canproduceMana(Constants::MTG_COLOR_BLACK) == 0)) { match = NULL; } - if ((CDcanProduceB == -1 && card->canproduceB == 1) || (CDcanProduceB == 1 && card->canproduceB == 0)) + if ((CDcanProduceW == -1 && card->canproduceMana(Constants::MTG_COLOR_WHITE) == 1) || (CDcanProduceW == 1 && card->canproduceMana(Constants::MTG_COLOR_WHITE) == 0)) { match = NULL; } - - if ((CDcanProduceW == -1 && card->canproduceW == 1) || (CDcanProduceW == 1 && card->canproduceW == 0)) - { - match = NULL; - } - */ + if ((CDnocolor == -1 && card->getColor() == 0)) { match = NULL; diff --git a/projects/mtg/src/MTGCardInstance.cpp b/projects/mtg/src/MTGCardInstance.cpp index d05eaf718..b9f40f860 100644 --- a/projects/mtg/src/MTGCardInstance.cpp +++ b/projects/mtg/src/MTGCardInstance.cpp @@ -98,7 +98,11 @@ MTGCardInstance::MTGCardInstance(MTGCard * card, MTGPlayerCards * arg_belongs_to void MTGCardInstance::copy(MTGCardInstance * card) { MTGCard * source = NULL; - if(card->isToken || card->hasCopiedToken) + if(card->isACopier && card->copiedID) + { + source = MTGCollection()->getCardById(card->copiedID); + } + else if(card->isToken || card->hasCopiedToken) { if(card->getMTGId() > 0)//not generated token source = MTGCollection()->getCardById(card->getMTGId()); @@ -263,12 +267,6 @@ void MTGCardInstance::initMTGCI() imprintR = 0; imprintB = 0; imprintW = 0; - canproduceG = 0; - canproduceU = 0; - canproduceR = 0; - canproduceB = 0; - canproduceW = 0; - canproduceC = 0; entersBattlefield = 0; currentimprintName = ""; imprintedNames.clear(); @@ -851,6 +849,37 @@ int MTGCardInstance::countDuplicateCardNames() return count; } +//check can produce mana +int MTGCardInstance::canproduceMana(int color) +{ + int count = 0; + + //start + if(hasSubtype("forest") && color == 1) + count++; + if(hasSubtype("island") && color == 2) + count++; + if(hasSubtype("mountain") && color == 3) + count++; + if(hasSubtype("swamp") && color == 4) + count++; + if(hasSubtype("plains") && color == 5) + count++; + if(cardsAbilities.size()) + { + for(unsigned int j = 0; j < cardsAbilities.size(); j++) + { + if(dynamic_cast (cardsAbilities[j]) && dynamic_cast (cardsAbilities[j])->output->hasColor(color)) + count++; + } + } + + if(count) + return 1; + + return 0; +} + //check stack bool MTGCardInstance::StackIsEmptyandSorcerySpeed() { diff --git a/projects/mtg/src/TargetChooser.cpp b/projects/mtg/src/TargetChooser.cpp index a80822c21..8a82bbf35 100644 --- a/projects/mtg/src/TargetChooser.cpp +++ b/projects/mtg/src/TargetChooser.cpp @@ -579,7 +579,7 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta { cd->CDdamager = 1; } - }/* + } //can produce mana else if (attribute.find("cmana") != string::npos) { @@ -591,6 +591,7 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta { cd->CDcanProduceC = 1; } + cd->mode = CardDescriptor::CD_OR; } else if (attribute.find("manag") != string::npos) { @@ -602,6 +603,7 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta { cd->CDcanProduceG = 1; } + cd->mode = CardDescriptor::CD_OR; } else if (attribute.find("manau") != string::npos) { @@ -613,6 +615,7 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta { cd->CDcanProduceU = 1; } + cd->mode = CardDescriptor::CD_OR; } else if (attribute.find("manar") != string::npos) { @@ -624,6 +627,7 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta { cd->CDcanProduceR = 1; } + cd->mode = CardDescriptor::CD_OR; } else if (attribute.find("manab") != string::npos) { @@ -635,6 +639,7 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta { cd->CDcanProduceB = 1; } + cd->mode = CardDescriptor::CD_OR; } else if (attribute.find("manaw") != string::npos) { @@ -646,7 +651,8 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta { cd->CDcanProduceW = 1; } - }*/ + cd->mode = CardDescriptor::CD_OR; + } else if (attribute.find("multicolor") != string::npos) { //card is multicolored? From da874738d6bff2ee21ea4ab1b2213767e91f8b8c Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Thu, 16 Feb 2017 17:10:06 +0800 Subject: [PATCH 24/26] castcard generated card --- projects/mtg/src/AllAbilities.cpp | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index 1ca746761..d0416dde3 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -8115,11 +8115,29 @@ int AACastCard::resolveSpell() { if (_target->isLand()) { - MTGCardInstance * copy = _target->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->battlefield,noEvent); - copy->changeController(source->controller(),true); - this->forceDestroy = true; - processed = true; - return 1; + if(theNamedCard) + { + MTGCardInstance * copy = _target->controller()->game->putInZone(_target, _target->currentZone, _target->controller()->game->temp); + copy->changeController(source->controller(),true); + Spell * spell = NEW Spell(game, 0,copy,NULL,NULL, 1); + spell->resolve(); + delete spell; + + this->forceDestroy = true; + processed = true; + return 1; + } + else + { + MTGAbility * a = NEW AAMover(game, -1, source, _target, "mybattlefield", ""); + a->oneShot = true; + a->resolve(); + SAFE_DELETE(a); + + this->forceDestroy = true; + processed = true; + return 1; + } } Spell * spell = NULL; From 5e46016c4dadba65782c8779f8d53eb3d7374386 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Thu, 16 Feb 2017 21:26:03 +0800 Subject: [PATCH 25/26] added new legend & pw rule, trigger & event added new pw & legend rule (i just leave the old rules behind and disabled it), added phasesin, faceup, copiedacard event, added facedup & phasedin trigger. --- .../bin/Res/sets/primitives/borderline.txt | 2 +- projects/mtg/include/AllAbilities.h | 44 +++ projects/mtg/include/MTGCardInstance.h | 1 + projects/mtg/include/MTGRules.h | 39 ++- projects/mtg/include/WEvent.h | 18 ++ projects/mtg/src/AllAbilities.cpp | 3 + projects/mtg/src/GameObserver.cpp | 3 + projects/mtg/src/GuiPlay.cpp | 4 + projects/mtg/src/MTGAbility.cpp | 14 +- projects/mtg/src/MTGCardInstance.cpp | 21 ++ projects/mtg/src/MTGRules.cpp | 299 ++++++++++++++---- projects/mtg/src/WEvent.cpp | 33 ++ 12 files changed, 408 insertions(+), 73 deletions(-) diff --git a/projects/mtg/bin/Res/sets/primitives/borderline.txt b/projects/mtg/bin/Res/sets/primitives/borderline.txt index 243e1cafd..e3e23e25e 100644 --- a/projects/mtg/bin/Res/sets/primitives/borderline.txt +++ b/projects/mtg/bin/Res/sets/primitives/borderline.txt @@ -790,7 +790,7 @@ type=Instant name=Villainous Wealth #can't order stack target=opponent -auto=reveal:castx revealzone(targetedpersonslibrary) optionone all(*|reveal) moveto(exile) and!( if cantargetcard(*[-land;manacost<=castx]|*) then transforms((,newability[may activate castcard(normal)]])) oneshot )! optiononeend revealend +auto=moveto(exile) and!( if cantargetcard(*[-land;manacost<=castx]|*) then transforms((,newability[may activate castcard(normal)]])) ueot )! all(*[zpos<=castx]|mylibrary) text=Target opponent exiles the top X cards of his or her library. You may cast any number of nonland cards with converted mana cost X or less from among them without paying their mana costs. mana={X}{B}{G}{U} type=Sorcery diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 4968f9630..9c400ceae 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -1332,6 +1332,50 @@ public: } }; +class TrCardPhasesIn: public Trigger +{ +public: + TrCardPhasesIn(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc, bool once = false) : + Trigger(observer, id, source, once, tc) + { + } + + int triggerOnEventImpl(WEvent * event) + { + WEventCardPhasesIn * e = dynamic_cast (event); + if (!e) return 0; + if (!tc->canTarget(e->card)) return 0; + return 1; + } + + TrCardPhasesIn * clone() const + { + return NEW TrCardPhasesIn(*this); + } +}; + +class TrCardFaceUp: public Trigger +{ +public: + TrCardFaceUp(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc, bool once = false) : + Trigger(observer, id, source, once, tc) + { + } + + int triggerOnEventImpl(WEvent * event) + { + WEventCardFaceUp * e = dynamic_cast (event); + if (!e) return 0; + if (!tc->canTarget(e->card)) return 0; + return 1; + } + + TrCardFaceUp * clone() const + { + return NEW TrCardFaceUp(*this); + } +}; + class TrCardTransformed: public Trigger { public: diff --git a/projects/mtg/include/MTGCardInstance.h b/projects/mtg/include/MTGCardInstance.h index 098c77dc0..fa7803ee0 100644 --- a/projects/mtg/include/MTGCardInstance.h +++ b/projects/mtg/include/MTGCardInstance.h @@ -253,6 +253,7 @@ public: int LKIpower; int LKItoughness; int countDuplicateCardNames(); + int countDuplicateCardTypes(); void cdaPT(int p = 0, int t = 0); bool isCDA; void switchPT(bool apply = false); diff --git a/projects/mtg/include/MTGRules.h b/projects/mtg/include/MTGRules.h index ba82ff9f0..45cd82c56 100644 --- a/projects/mtg/include/MTGRules.h +++ b/projects/mtg/include/MTGRules.h @@ -421,7 +421,36 @@ public: int receiveEvent(WEvent * event); virtual MTGTokensCleanup * clone() const; }; - +//New Legend Rule +class MTGNewLegend: public PermanentAbility +{ +public: + TargetChooser * tcL; + MTGAbility * Legendrule; + MTGAbility * LegendruleAbility; + MTGAbility * LegendruleGeneric; + //vector list; + MTGNewLegend(GameObserver* observer, int _id); + int CheckLegend(MTGCardInstance * card); + void MoveLegend(MTGCardInstance * card); + int receiveEvent(WEvent * event); + virtual MTGNewLegend * clone() const; +}; +//New Planeswalker Rule +class MTGNewPlaneswalker: public PermanentAbility +{ +public: + TargetChooser * tcP; + MTGAbility * PWrule; + MTGAbility * PWruleAbility; + MTGAbility * PWruleGeneric; + //vector list; + MTGNewPlaneswalker(GameObserver* observer, int _id); + int CheckPW(MTGCardInstance * card); + void MovePW(MTGCardInstance * card); + int receiveEvent(WEvent * event); + virtual MTGNewPlaneswalker * clone() const; +}; /* * 704.5k If a player controls two or more legendary permanents with the same name, * that player chooses one of them, and the rest are put into their owners’ graveyards. @@ -430,10 +459,6 @@ public: class MTGLegendRule: public ListMaintainerAbility { public: - TargetChooser * tcL; - MTGAbility * Legendrule; - MTGAbility * LegendruleAbility; - MTGAbility * LegendruleGeneric; MTGLegendRule(GameObserver* observer, int _id); int canBeInList(MTGCardInstance * card); int added(MTGCardInstance * card); @@ -445,10 +470,6 @@ public: class MTGPlaneWalkerRule: public ListMaintainerAbility { public: - TargetChooser * tcP; - MTGAbility * PWrule; - MTGAbility * PWruleAbility; - MTGAbility * PWruleGeneric; MTGPlaneWalkerRule(GameObserver* observer, int _id); int canBeInList(MTGCardInstance * card); int added(MTGCardInstance * card); diff --git a/projects/mtg/include/WEvent.h b/projects/mtg/include/WEvent.h index 29dee342a..8971cfb79 100644 --- a/projects/mtg/include/WEvent.h +++ b/projects/mtg/include/WEvent.h @@ -305,12 +305,30 @@ struct WEventCardControllerChange : public WEventCardUpdate { virtual Targetable * getTarget(int target); }; +//event when card with phases in +struct WEventCardPhasesIn : public WEventCardUpdate { + WEventCardPhasesIn(MTGCardInstance * card); + virtual Targetable * getTarget(int target); +}; + +//event when card with morph faces up +struct WEventCardFaceUp : public WEventCardUpdate { + WEventCardFaceUp(MTGCardInstance * card); + virtual Targetable * getTarget(int target); +}; + //event when card transforms struct WEventCardTransforms : public WEventCardUpdate { WEventCardTransforms(MTGCardInstance * card); virtual Targetable * getTarget(int target); }; +//event when card copies a card +struct WEventCardCopiedACard : public WEventCardUpdate { + WEventCardCopiedACard(MTGCardInstance * card); + virtual Targetable * getTarget(int target); +}; + //alterenergy event struct WEventplayerEnergized : public WEvent { WEventplayerEnergized(Player * player,int nb_count); diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index d0416dde3..ac80a2d2a 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -1674,6 +1674,7 @@ int AACopier::resolve() } } } + currentAbilities.clear(); return 1; } return 0; @@ -3284,6 +3285,8 @@ int AAMorph::resolve() } } } + WEvent * e = NEW WEventCardFaceUp(_target); + game->receiveEvent(e); currentAbilities.clear(); testDestroy(); } diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index c891c4c0d..8b8728474 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -859,6 +859,9 @@ void GameObserver::gameStateBasedEffects() card->phasedTurn = turn; if(card->view) card->view->alpha = 255; + //add event phases in here + WEvent * evphasein = NEW WEventCardPhasesIn(card); + receiveEvent(evphasein); } if (card->target && isInPlay(card->target) && (card->hasSubtype(Subtypes::TYPE_EQUIPMENT) || card->hasSubtype(Subtypes::TYPE_AURA))) { diff --git a/projects/mtg/src/GuiPlay.cpp b/projects/mtg/src/GuiPlay.cpp index 5ba888869..acc5cbb56 100644 --- a/projects/mtg/src/GuiPlay.cpp +++ b/projects/mtg/src/GuiPlay.cpp @@ -426,6 +426,10 @@ int GuiPlay::receiveEventPlus(WEvent * e) Replace(); else if (dynamic_cast (e)) Replace(); + else if (dynamic_cast (e)) + Replace(); + else if (dynamic_cast (e)) + Replace(); Replace(); return 0; } diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 11bc1df3e..55bccd9ae 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -1036,6 +1036,14 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string, int id, Spell if (TargetChooser *tc = parseSimpleTC(s,"transformed", card)) return NEW TrCardTransformed(observer, id, card, tc,once); + //Card Faces Up + if (TargetChooser *tc = parseSimpleTC(s,"facedup", card)) + return NEW TrCardFaceUp(observer, id, card, tc,once); + + //Card Phases In + if (TargetChooser *tc = parseSimpleTC(s,"phasedin", card)) + return NEW TrCardPhasesIn(observer, id, card, tc,once); + //CombatTrigger //Card card attacked and is blocked found = s.find("combat("); @@ -1478,14 +1486,16 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG found = s.find("legendrule"); if(found != string::npos) { - observer->addObserver(NEW MTGLegendRule(observer, -1)); + //observer->addObserver(NEW MTGLegendRule(observer, -1)); + observer->addObserver(NEW MTGNewLegend(observer, -1)); return NULL; } //this handles the planeswalker named legend rule which is dramatically different from above. found = s.find("planeswalkerrule"); if(found != string::npos) { - observer->addObserver(NEW MTGPlaneWalkerRule(observer, -1)); + //observer->addObserver(NEW MTGPlaneWalkerRule(observer, -1)); + observer->addObserver(NEW MTGNewPlaneswalker(observer, -1)); return NULL; } found = s.find("planeswalkerdamage"); diff --git a/projects/mtg/src/MTGCardInstance.cpp b/projects/mtg/src/MTGCardInstance.cpp index b9f40f860..aa9d7e557 100644 --- a/projects/mtg/src/MTGCardInstance.cpp +++ b/projects/mtg/src/MTGCardInstance.cpp @@ -169,6 +169,11 @@ void MTGCardInstance::copy(MTGCardInstance * card) backupTargets = this->backupTargets; storedCard = oldStored; miracle = false; + + + //add event here copied a card... + WEvent * e = NEW WEventCardCopiedACard(this); + getObserver()->receiveEvent(e); } MTGCardInstance::~MTGCardInstance() @@ -849,6 +854,22 @@ int MTGCardInstance::countDuplicateCardNames() return count; } +int MTGCardInstance::countDuplicateCardTypes() +{ + int count = 0; + + if(observer) + { + int nb_cards = controller()->game->battlefield->nb_cards; + for(int x = 0; x < nb_cards; x++) + { + if(controller()->game->battlefield->cards[x] != this && controller()->game->battlefield->cards[x]->types == this->types) + count+=1; + } + } + return count; +} + //check can produce mana int MTGCardInstance::canproduceMana(int color) { diff --git a/projects/mtg/src/MTGRules.cpp b/projects/mtg/src/MTGRules.cpp index d838ecb96..9c4e75428 100644 --- a/projects/mtg/src/MTGRules.cpp +++ b/projects/mtg/src/MTGRules.cpp @@ -3228,15 +3228,244 @@ MTGTokensCleanup * MTGTokensCleanup::clone() const return NEW MTGTokensCleanup(*this); } -/* Legend Rule */ -MTGLegendRule::MTGLegendRule(GameObserver* observer, int _id) : -ListMaintainerAbility(observer, _id) +//new legend rule +MTGNewLegend::MTGNewLegend(GameObserver* observer, int _id) : +PermanentAbility(observer, _id) { tcL = NULL; Legendrule = NULL; LegendruleAbility = NULL; LegendruleGeneric = NULL; } + +int MTGNewLegend::receiveEvent(WEvent * e) +{ + if(game->getCurrentTargetChooser() || game->mLayers->actionLayer()->isWaitingForAnswer()) + return 0; + if (WEventZoneChange* ev1 = dynamic_cast(e)) + { + if (ev1->to == game->players[0]->game->inPlay || ev1->to == game->players[1]->game->inPlay) + { + MTGCardInstance * card = ev1->card; + if(card && card->countDuplicateCardNames() > 1 && card->hasType(Subtypes::TYPE_LEGENDARY)) + { + CheckLegend(card); + return 1; + } + } + } + else if(WEventCardControllerChange* ev2 = dynamic_cast(e)) + { + MTGCardInstance * card = ev2->card; + if(card && card->countDuplicateCardNames() > 1 && card->hasType(Subtypes::TYPE_LEGENDARY)) + { + CheckLegend(card); + return 1; + } + } + else if(WEventCardTransforms* ev3 = dynamic_cast(e)) + { + MTGCardInstance * card = ev3->card; + if(card && card->countDuplicateCardNames() > 1 && card->hasType(Subtypes::TYPE_LEGENDARY)) + { + CheckLegend(card); + return 1; + } + } + else if(WEventCardCopiedACard* ev4 = dynamic_cast(e)) + { + MTGCardInstance * card = ev4->card; + if(card && card->countDuplicateCardNames() > 1 && card->hasType(Subtypes::TYPE_LEGENDARY)) + { + CheckLegend(card); + return 1; + } + } + else if(WEventCardFaceUp* ev5 = dynamic_cast(e)) + { + MTGCardInstance * card = ev5->card; + if(card && card->countDuplicateCardNames() > 1 && card->hasType(Subtypes::TYPE_LEGENDARY)) + { + CheckLegend(card); + return 1; + } + } + else if(WEventCardPhasesIn* ev6 = dynamic_cast(e)) + { + MTGCardInstance * card = ev6->card; + if(card && card->countDuplicateCardNames() > 1 && card->hasType(Subtypes::TYPE_LEGENDARY)) + { + CheckLegend(card); + return 1; + } + } + return 0; +} +int MTGNewLegend::CheckLegend(MTGCardInstance * card) +{ + if(!card) + return 0; + if(card->isPhased) + return 0; + if (card->hasType(Subtypes::TYPE_LEGENDARY) && card->controller()->game->inPlay->hasCard(card)) + if(card->has(Constants::NOLEGEND)||card->controller()->opponent()->inPlay()->hasAbility(Constants::NOLEGENDRULE)||card->controller()->inPlay()->hasAbility(Constants::NOLEGENDRULE)) + return 0; + if(card->countDuplicateCardNames() <= 1) + return 0; + + MoveLegend(card); + return 1; +} +void MTGNewLegend::MoveLegend(MTGCardInstance * card) +{ + game->LPWeffect = true; + vectorselection; + MTGCardInstance * myClone = NEW MTGCardInstance(card, card->controller()->game); + TargetChooserFactory tfL(game); + tcL = tfL.createTargetChooser("*[share!name!]|mybattlefield",myClone); + tcL->targetter = NULL; + tcL->maxtargets = 1; + Legendrule = NEW AAMover(game, game->mLayers->actionLayer()->getMaxId(), myClone, NULL,"ownergraveyard","Put in Graveyard"); + Legendrule->oneShot = true; + Legendrule->canBeInterrupted = false; + LegendruleAbility = NEW GenericTargetAbility(game, "","",game->mLayers->actionLayer()->getMaxId(), myClone,tcL, Legendrule->clone()); + SAFE_DELETE(Legendrule); + LegendruleAbility->oneShot = true; + LegendruleAbility->canBeInterrupted = false; + LegendruleGeneric = NEW GenericAddToGame(game, game->mLayers->actionLayer()->getMaxId(), myClone,NULL,LegendruleAbility->clone()); + SAFE_DELETE(LegendruleAbility); + LegendruleGeneric->oneShot = true; + selection.push_back(LegendruleGeneric->clone()); + SAFE_DELETE(LegendruleGeneric); + MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), NULL, myClone,true,selection,card->controller(),"Legendary Rule"); + menuChoice->addToGame(); + return; +} +MTGNewLegend * MTGNewLegend::clone() const +{ + return NEW MTGNewLegend(*this); +} +//new pw rule +MTGNewPlaneswalker::MTGNewPlaneswalker(GameObserver* observer, int _id) : +PermanentAbility(observer, _id) +{ + tcP = NULL; + PWrule = NULL; + PWruleAbility = NULL; + PWruleGeneric = NULL; +} + +int MTGNewPlaneswalker::receiveEvent(WEvent * e) +{ + if(game->getCurrentTargetChooser() || game->mLayers->actionLayer()->isWaitingForAnswer()) + return 0; + if (WEventZoneChange* ev1 = dynamic_cast(e)) + { + if (ev1->to == game->players[0]->game->inPlay || ev1->to == game->players[1]->game->inPlay) + { + MTGCardInstance * card = ev1->card; + if(card && card->hasType(Subtypes::TYPE_PLANESWALKER)) + { + CheckPW(card); + return 1; + } + } + } + else if(WEventCardControllerChange* ev2 = dynamic_cast(e)) + { + MTGCardInstance * card = ev2->card; + if(card && card->hasType(Subtypes::TYPE_PLANESWALKER)) + { + CheckPW(card); + return 1; + } + } + else if(WEventCardTransforms* ev3 = dynamic_cast(e)) + { + MTGCardInstance * card = ev3->card; + if(card && card->hasType(Subtypes::TYPE_PLANESWALKER)) + { + CheckPW(card); + return 1; + } + } + else if(WEventCardCopiedACard* ev4 = dynamic_cast(e)) + { + MTGCardInstance * card = ev4->card; + if(card && card->hasType(Subtypes::TYPE_PLANESWALKER)) + { + CheckPW(card); + return 1; + } + } + else if(WEventCardFaceUp* ev5 = dynamic_cast(e)) + { + MTGCardInstance * card = ev5->card; + if(card && card->hasType(Subtypes::TYPE_PLANESWALKER)) + { + CheckPW(card); + return 1; + } + } + else if(WEventCardPhasesIn* ev6 = dynamic_cast(e)) + { + MTGCardInstance * card = ev6->card; + if(card && card->hasType(Subtypes::TYPE_PLANESWALKER)) + { + CheckPW(card); + return 1; + } + } + return 0; +} +int MTGNewPlaneswalker::CheckPW(MTGCardInstance * card) +{ + if(!card) + return 0; + if(card->isPhased) + return 0; + if(card->countDuplicateCardTypes() < 1) + return 0; + + MovePW(card); + return 1; +} +void MTGNewPlaneswalker::MovePW(MTGCardInstance * card) +{ + game->LPWeffect = true; + vectorselection; + MTGCardInstance * myClone = NEW MTGCardInstance(card, card->controller()->game); + TargetChooserFactory tfL(game); + tcP = tfL.createTargetChooser("planeswalker[share!types!]|mybattlefield",myClone); + tcP->targetter = NULL; + tcP->maxtargets = 1; + PWrule = NEW AAMover(game, game->mLayers->actionLayer()->getMaxId(), myClone, NULL,"ownergraveyard","Put in Graveyard"); + PWrule->oneShot = true; + PWrule->canBeInterrupted = false; + PWruleAbility = NEW GenericTargetAbility(game, "","",game->mLayers->actionLayer()->getMaxId(), myClone,tcP, PWrule->clone()); + SAFE_DELETE(PWrule); + PWruleAbility->oneShot = true; + PWruleAbility->canBeInterrupted = false; + PWruleGeneric = NEW GenericAddToGame(game, game->mLayers->actionLayer()->getMaxId(), myClone,NULL,PWruleAbility->clone()); + SAFE_DELETE(PWruleAbility); + PWruleGeneric->oneShot = true; + selection.push_back(PWruleGeneric->clone()); + SAFE_DELETE(PWruleGeneric); + MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), NULL, myClone,true,selection,card->controller(),"Planeswalker Uniqueness Rule"); + menuChoice->addToGame(); + return; +} +MTGNewPlaneswalker * MTGNewPlaneswalker::clone() const +{ + return NEW MTGNewPlaneswalker(*this); +} +////end new//// +///old below/// +/* Legend Rule */ +MTGLegendRule::MTGLegendRule(GameObserver* observer, int _id) : +ListMaintainerAbility(observer, _id) +{ +} ; int MTGLegendRule::canBeInList(MTGCardInstance * card) @@ -3257,43 +3486,19 @@ int MTGLegendRule::added(MTGCardInstance * card) { map::iterator it; int destroy = 0; - //vectoroldCards; + vectoroldCards; for (it = cards.begin(); it != cards.end(); it++) { MTGCardInstance * comparison = (*it).first; if (comparison != card && comparison->controller() == card->controller() && !(comparison->getName().compare(card->getName()))) if (!(game->getCurrentTargetChooser() || game->mLayers->actionLayer()->isWaitingForAnswer())) { - //oldCards.push_back(comparison); + oldCards.push_back(comparison); destroy = 1; game->LPWeffect = true; } } if(destroy) - { - vectorselection; - MTGCardInstance * myClone = NEW MTGCardInstance(card, card->controller()->game); - TargetChooserFactory tfL(game); - tcL = tfL.createTargetChooser("*[share!name!]|mybattlefield",myClone); - tcL->targetter = NULL; - tcL->maxtargets = 1; - Legendrule = NEW AAMover(game, game->mLayers->actionLayer()->getMaxId(), myClone, NULL,"ownergraveyard","Put in Graveyard"); - Legendrule->oneShot = true; - Legendrule->canBeInterrupted = false; - LegendruleAbility = NEW GenericTargetAbility(game, "","",game->mLayers->actionLayer()->getMaxId(), myClone,tcL, Legendrule->clone()); - SAFE_DELETE(Legendrule); - LegendruleAbility->oneShot = true; - LegendruleAbility->canBeInterrupted = false; - LegendruleGeneric = NEW GenericAddToGame(game, game->mLayers->actionLayer()->getMaxId(), myClone,NULL,LegendruleAbility->clone()); - SAFE_DELETE(LegendruleAbility); - LegendruleGeneric->oneShot = true; - selection.push_back(LegendruleGeneric->clone()); - SAFE_DELETE(LegendruleGeneric); - MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), NULL, myClone,true,selection,card->controller(),"Legendary Rule"); - menuChoice->addToGame(); - } - //reverted to old since this new code conflicts with reveal targetchooser - /*if(destroy) { vectorselection; MultiAbility * multi = NEW MultiAbility(game, game->mLayers->actionLayer()->getMaxId(), card, card, NULL); @@ -3312,7 +3517,7 @@ int MTGLegendRule::added(MTGCardInstance * card) selection.push_back(b1); MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), card, card,true,selection,card->controller(),"Legendary Rule"); menuChoice->addToGame(); - }*/ + } return 1; } @@ -3339,10 +3544,6 @@ MTGLegendRule * MTGLegendRule::clone() const MTGPlaneWalkerRule::MTGPlaneWalkerRule(GameObserver* observer, int _id) : ListMaintainerAbility(observer, _id) { - tcP = NULL; - PWrule = NULL; - PWruleAbility = NULL; - PWruleGeneric = NULL; } ; @@ -3361,43 +3562,19 @@ int MTGPlaneWalkerRule::added(MTGCardInstance * card) { map::iterator it; int destroy = 0; - //vectoroldCards; + vectoroldCards; for (it = cards.begin(); it != cards.end(); it++) { MTGCardInstance * comparison = (*it).first; if (comparison != card && comparison->types == card->types && comparison->controller() == card->controller()) if (!(game->getCurrentTargetChooser() || game->mLayers->actionLayer()->isWaitingForAnswer())) { - //oldCards.push_back(comparison); + oldCards.push_back(comparison); destroy = 1; game->LPWeffect = true; } } if (destroy) - { - vectorselection; - MTGCardInstance * myClone = NEW MTGCardInstance(card, card->controller()->game); - TargetChooserFactory tfL(game); - tcP = tfL.createTargetChooser("planeswalker[share!types!]|mybattlefield",myClone); - tcP->targetter = NULL; - tcP->maxtargets = 1; - PWrule = NEW AAMover(game, game->mLayers->actionLayer()->getMaxId(), myClone, NULL,"ownergraveyard","Put in Graveyard"); - PWrule->oneShot = true; - PWrule->canBeInterrupted = false; - PWruleAbility = NEW GenericTargetAbility(game, "","",game->mLayers->actionLayer()->getMaxId(), myClone,tcP, PWrule->clone()); - SAFE_DELETE(PWrule); - PWruleAbility->oneShot = true; - PWruleAbility->canBeInterrupted = false; - PWruleGeneric = NEW GenericAddToGame(game, game->mLayers->actionLayer()->getMaxId(), myClone,NULL,PWruleAbility->clone()); - SAFE_DELETE(PWruleAbility); - PWruleGeneric->oneShot = true; - selection.push_back(PWruleGeneric->clone()); - SAFE_DELETE(PWruleGeneric); - MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), NULL, myClone,true,selection,card->controller(),"Planeswalker Uniqueness Rule"); - menuChoice->addToGame(); - } - //reverted to old since this new code conflicts with reveal targetchooser - /*if (destroy) { vectorselection; @@ -3417,7 +3594,7 @@ int MTGPlaneWalkerRule::added(MTGCardInstance * card) selection.push_back(b1); MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), card, card,true,selection,card->controller(),"Planeswalker Rule"); menuChoice->addToGame(); - }*/ + } return 1; } diff --git a/projects/mtg/src/WEvent.cpp b/projects/mtg/src/WEvent.cpp index d58377c7e..a8a7903e6 100644 --- a/projects/mtg/src/WEvent.cpp +++ b/projects/mtg/src/WEvent.cpp @@ -236,11 +236,26 @@ WEventCardControllerChange::WEventCardControllerChange(MTGCardInstance * card) : { } +WEventCardPhasesIn::WEventCardPhasesIn(MTGCardInstance * card) : + WEventCardUpdate(card) +{ +} + +WEventCardFaceUp::WEventCardFaceUp(MTGCardInstance * card) : + WEventCardUpdate(card) +{ +} + WEventCardTransforms::WEventCardTransforms(MTGCardInstance * card) : WEventCardUpdate(card) { } +WEventCardCopiedACard::WEventCardCopiedACard(MTGCardInstance * card) : + WEventCardUpdate(card) +{ +} + WEventCombatStepChange::WEventCombatStepChange(CombatStep step) : WEvent(), step(step) { @@ -412,12 +427,30 @@ Targetable * WEventCardControllerChange::getTarget(int target) return NULL; } +Targetable * WEventCardPhasesIn::getTarget(int target) +{ + if (target) return card; + return NULL; +} + +Targetable * WEventCardFaceUp::getTarget(int target) +{ + if (target) return card; + return NULL; +} + Targetable * WEventCardTransforms::getTarget(int target) { if (target) return card; return NULL; } +Targetable * WEventCardCopiedACard::getTarget(int target) +{ + if (target) return card; + return NULL; +} + Targetable * WEventplayerEnergized::getTarget(Player * player) { if (player) return player; From c6c4c17b30393050806b6b6c1b92dd543c1883c4 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Thu, 16 Feb 2017 21:57:17 +0800 Subject: [PATCH 26/26] try to fix parenthesis :( --- projects/mtg/src/CardGui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/mtg/src/CardGui.cpp b/projects/mtg/src/CardGui.cpp index 2734f14a4..c5e815d99 100644 --- a/projects/mtg/src/CardGui.cpp +++ b/projects/mtg/src/CardGui.cpp @@ -254,8 +254,8 @@ void CardGui::Render() highlightborder = game? game->getResourceManager()->GetQuad("white"):WResourceManager::Instance()->GetQuad("white"); if(fakeborder) { - if(card->has(Constants::CANPLAYFROMEXILE)||card->has(Constants::PAYZERO) - ||(card->has(Constants::CANPLAYFROMGRAVEYARD) || card->has(Constants::TEMPFLASHBACK) || card->getManaCost()->getFlashback() && game->isInGrave(card))) + if((card->has(Constants::CANPLAYFROMEXILE)||card->has(Constants::PAYZERO))|| + ((card->has(Constants::CANPLAYFROMGRAVEYARD) || card->has(Constants::TEMPFLASHBACK) || card->getManaCost()->getFlashback()) && game->isInGrave(card))) fakeborder->SetColor(ARGB((int)(actA),7,235,7));//green border else fakeborder->SetColor(ARGB((int)(actA),15,15,15));