From 6b896c8bae48d76ceb002e5d4fc9f38de8806da3 Mon Sep 17 00:00:00 2001 From: Vittorio Alfieri Date: Thu, 27 Jul 2023 18:18:58 +0200 Subject: [PATCH] Fixed some primitives from issue #1085, fixed _BLINK_UEOT_ macro, improved several abilities to allow the usage og "and" option. --- .../mtg/bin/Res/sets/primitives/_macros.txt | 2 +- .../bin/Res/sets/primitives/borderline.txt | 78 ++- projects/mtg/bin/Res/sets/primitives/mtg.txt | 22 +- .../bin/Res/sets/primitives/planeswalkers.txt | 17 +- projects/mtg/include/AllAbilities.h | 39 +- projects/mtg/src/AllAbilities.cpp | 540 ++++++++++++------ projects/mtg/src/MTGAbility.cpp | 66 +++ 7 files changed, 511 insertions(+), 253 deletions(-) diff --git a/projects/mtg/bin/Res/sets/primitives/_macros.txt b/projects/mtg/bin/Res/sets/primitives/_macros.txt index fbb539d77..bdc2e38d7 100644 --- a/projects/mtg/bin/Res/sets/primitives/_macros.txt +++ b/projects/mtg/bin/Res/sets/primitives/_macros.txt @@ -203,7 +203,7 @@ #AUTO_DEFINE _RENOWN_($c) this(cantargetcard(*[-renown]) transforms((,newability[@combatdamaged(player) from(this):counter(1/1.$c) && becomes(renown) forever])) # Exile card. Return it to the battlefield under its owner's control at the beginning of the next end step. -#AUTO_DEFINE _BLINK_UEOT_ name(Blink ueot) all(this) transforms((,newability[moveto(exile)],newability[if cantargetcard(*[-token]|*) then phaseactionmulti[endofturn once] moveto(ownerbattlefield)])) +#AUTO_DEFINE _BLINK_UEOT_ moveto(exile) and!( transforms((,newability[phaseaction[endofturn once checkex] moveto(ownerbattlefield)])) forever )! # Connives. (Draw a card, then discard a card. If you discarded a nonland card, put a +1/+1 counter on this creature.) #AUTO_DEFINE _CONNIVES_ draw:1 && transforms((,newability[if type(*[-land]|myhand)~morethan~0 then choice name(Discard a nonland) name(Discard a nonland) target(*[-land]|myhand) reject && counter(1/1) all(this)],newability[if type(land|myhand)~morethan~0 then choice name(Discard a land) name(Discard a land) target(land|myhand) reject])) oneshot diff --git a/projects/mtg/bin/Res/sets/primitives/borderline.txt b/projects/mtg/bin/Res/sets/primitives/borderline.txt index d9845a886..2dbe1d14f 100644 --- a/projects/mtg/bin/Res/sets/primitives/borderline.txt +++ b/projects/mtg/bin/Res/sets/primitives/borderline.txt @@ -1,7 +1,7 @@ grade=borderline #Bordeline Primitives Pack for Wagic the Homebrew. #Please keep these card alphabetized, and try to have the "name=" line at the top of each card -#I sorted this programmatically - Thanks to Vitty85 26-07-2023 +#I sorted this programmatically - Thanks to Vitty85 27-07-2023 [card] name=+2 Mace auto={3}:equip @@ -47294,27 +47294,27 @@ toughness=3 [card] name=Imbraham, Dean of Theory abilities=flying -auto={1}{U}{U}{T}:name(X=1) all(*[zpos<=1]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[phaseaction[endofturn once checkex] counter(0/0.-1.study)])) oneshot )! -auto={2}{U}{U}{T}:name(X=2) all(*[zpos<=2]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[phaseaction[endofturn once checkex] counter(0/0.-1.study)])) oneshot )! -auto={3}{U}{U}{T}:name(X=3) all(*[zpos<=3]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[phaseaction[endofturn once checkex] counter(0/0.-1.study)])) oneshot )! -auto={4}{U}{U}{T}:name(X=4) all(*[zpos<=4]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[phaseaction[endofturn once checkex] counter(0/0.-1.study)])) oneshot )! -auto={5}{U}{U}{T}:name(X=5) all(*[zpos<=5]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[phaseaction[endofturn once checkex] counter(0/0.-1.study)])) oneshot )! -auto={6}{U}{U}{T}:name(X=6) all(*[zpos<=6]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[phaseaction[endofturn once checkex] counter(0/0.-1.study)])) oneshot )! -auto={7}{U}{U}{T}:name(X=7) all(*[zpos<=7]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[phaseaction[endofturn once checkex] counter(0/0.-1.study)])) oneshot )! -auto={8}{U}{U}{T}:name(X=8) all(*[zpos<=8]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[phaseaction[endofturn once checkex] counter(0/0.-1.study)])) oneshot )! -auto={9}{U}{U}{T}:name(X=9) all(*[zpos<=9]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[phaseaction[endofturn once checkex] counter(0/0.-1.study)])) oneshot )! -auto={10}{U}{U}{T}:name(X=10) all(*[zpos<=10]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[phaseaction[endofturn once checkex] counter(0/0.-1.study)])) oneshot )! -auto={11}{U}{U}{T}:name(X=1) all(*[zpos<=11]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[phaseaction[endofturn once checkex] counter(0/0.-1.study)])) oneshot )! -auto={12}{U}{U}{T}:name(X=2) all(*[zpos<=12]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[phaseaction[endofturn once checkex] counter(0/0.-1.study)])) oneshot )! -auto={13}{U}{U}{T}:name(X=3) all(*[zpos<=13]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[phaseaction[endofturn once checkex] counter(0/0.-1.study)])) oneshot )! -auto={14}{U}{U}{T}:name(X=4) all(*[zpos<=14]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[phaseaction[endofturn once checkex] counter(0/0.-1.study)])) oneshot )! -auto={15}{U}{U}{T}:name(X=5) all(*[zpos<=15]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[phaseaction[endofturn once checkex] counter(0/0.-1.study)])) oneshot )! -auto={16}{U}{U}{T}:name(X=6) all(*[zpos<=16]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[phaseaction[endofturn once checkex] counter(0/0.-1.study)])) oneshot )! -auto={17}{U}{U}{T}:name(X=7) all(*[zpos<=17]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[phaseaction[endofturn once checkex] counter(0/0.-1.study)])) oneshot )! -auto={18}{U}{U}{T}:name(X=8) all(*[zpos<=18]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[phaseaction[endofturn once checkex] counter(0/0.-1.study)])) oneshot )! -auto={19}{U}{U}{T}:name(X=9) all(*[zpos<=19]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[phaseaction[endofturn once checkex] counter(0/0.-1.study)])) oneshot )! -auto={20}{U}{U}{T}:name(X=10) all(*[zpos<=20]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[phaseaction[endofturn once checkex] counter(0/0.-1.study)])) oneshot )! -auto={0}:name(Put exiled card in hand) target(*[counter{0/0.1.study}]|myexile) moveto(myhand) limit:1 +auto={U}{U}{T}:name(X=0) ability$!may name(Put exiled card in hand) name(Put exiled card in hand) target(*[counter{0/0.1.study}]|myexile) moveto(myhand)!$ controller +auto={1}{U}{U}{T}:name(X=1) all(*[zpos=1]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[ability$!may name(Put exiled card in hand) name(Put exiled card in hand) target(*[counter{0/0.1.study}]|myexile) moveto(myhand)!$ controller])) oneshot )! +auto={2}{U}{U}{T}:name(X=2) all(*[zpos=2]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[all(*[zpos<=2]|mylibrary) moveto(myexile) and!( counter(0/0.1.study) )!],newability[ability$!may name(Put exiled card in hand) name(Put exiled card in hand) target(*[counter{0/0.1.study}]|myexile) moveto(myhand)!$ controller])) oneshot )! +auto={3}{U}{U}{T}:name(X=3) all(*[zpos=3]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[all(*[zpos<=3]|mylibrary) moveto(myexile) and!( counter(0/0.1.study) )!],newability[ability$!may name(Put exiled card in hand) name(Put exiled card in hand) target(*[counter{0/0.1.study}]|myexile) moveto(myhand)!$ controller])) oneshot )! +auto={4}{U}{U}{T}:name(X=4) all(*[zpos=4]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[all(*[zpos<=4]|mylibrary) moveto(myexile) and!( counter(0/0.1.study) )!],newability[ability$!may name(Put exiled card in hand) name(Put exiled card in hand) target(*[counter{0/0.1.study}]|myexile) moveto(myhand)!$ controller])) oneshot )! +auto={5}{U}{U}{T}:name(X=5) all(*[zpos=5]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[all(*[zpos<=5]|mylibrary) moveto(myexile) and!( counter(0/0.1.study) )!],newability[ability$!may name(Put exiled card in hand) name(Put exiled card in hand) target(*[counter{0/0.1.study}]|myexile) moveto(myhand)!$ controller])) oneshot )! +auto={6}{U}{U}{T}:name(X=6) all(*[zpos=6]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[all(*[zpos<=6]|mylibrary) moveto(myexile) and!( counter(0/0.1.study) )!],newability[ability$!may name(Put exiled card in hand) name(Put exiled card in hand) target(*[counter{0/0.1.study}]|myexile) moveto(myhand)!$ controller])) oneshot )! +auto={7}{U}{U}{T}:name(X=7) all(*[zpos=7]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[all(*[zpos<=7]|mylibrary) moveto(myexile) and!( counter(0/0.1.study) )!],newability[ability$!may name(Put exiled card in hand) name(Put exiled card in hand) target(*[counter{0/0.1.study}]|myexile) moveto(myhand)!$ controller])) oneshot )! +auto={8}{U}{U}{T}:name(X=8) all(*[zpos=8]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[all(*[zpos<=8]|mylibrary) moveto(myexile) and!( counter(0/0.1.study) )!],newability[ability$!may name(Put exiled card in hand) name(Put exiled card in hand) target(*[counter{0/0.1.study}]|myexile) moveto(myhand)!$ controller])) oneshot )! +auto={9}{U}{U}{T}:name(X=9) all(*[zpos=9]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[all(*[zpos<=9]|mylibrary) moveto(myexile) and!( counter(0/0.1.study) )!],newability[ability$!may name(Put exiled card in hand) name(Put exiled card in hand) target(*[counter{0/0.1.study}]|myexile) moveto(myhand)!$ controller])) oneshot )! +auto={10}{U}{U}{T}:name(X=10) all(*[zpos=10]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[all(*[zpos<=10]|mylibrary) moveto(myexile) and!( counter(0/0.1.study) )!],newability[ability$!may name(Put exiled card in hand) name(Put exiled card in hand) target(*[counter{0/0.1.study}]|myexile) moveto(myhand)!$ controller])) oneshot )! +auto={11}{U}{U}{T}:name(X=11) all(*[zpos=11]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[all(*[zpos<=11]|mylibrary) moveto(myexile) and!( counter(0/0.1.study) )!],newability[ability$!may name(Put exiled card in hand) name(Put exiled card in hand) target(*[counter{0/0.1.study}]|myexile) moveto(myhand)!$ controller])) oneshot )! +auto={12}{U}{U}{T}:name(X=12) all(*[zpos=12]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[all(*[zpos<=12]|mylibrary) moveto(myexile) and!( counter(0/0.1.study) )!],newability[ability$!may name(Put exiled card in hand) name(Put exiled card in hand) target(*[counter{0/0.1.study}]|myexile) moveto(myhand)!$ controller])) oneshot )! +auto={13}{U}{U}{T}:name(X=13) all(*[zpos=13]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[all(*[zpos<=13]|mylibrary) moveto(myexile) and!( counter(0/0.1.study) )!],newability[ability$!may name(Put exiled card in hand) name(Put exiled card in hand) target(*[counter{0/0.1.study}]|myexile) moveto(myhand)!$ controller])) oneshot )! +auto={14}{U}{U}{T}:name(X=14) all(*[zpos=14]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[all(*[zpos<=14]|mylibrary) moveto(myexile) and!( counter(0/0.1.study) )!],newability[ability$!may name(Put exiled card in hand) name(Put exiled card in hand) target(*[counter{0/0.1.study}]|myexile) moveto(myhand)!$ controller])) oneshot )! +auto={15}{U}{U}{T}:name(X=15) all(*[zpos=15]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[all(*[zpos<=15]|mylibrary) moveto(myexile) and!( counter(0/0.1.study) )!],newability[ability$!may name(Put exiled card in hand) name(Put exiled card in hand) target(*[counter{0/0.1.study}]|myexile) moveto(myhand)!$ controller])) oneshot )! +auto={16}{U}{U}{T}:name(X=16) all(*[zpos=16]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[all(*[zpos<=16]|mylibrary) moveto(myexile) and!( counter(0/0.1.study) )!],newability[ability$!may name(Put exiled card in hand) name(Put exiled card in hand) target(*[counter{0/0.1.study}]|myexile) moveto(myhand)!$ controller])) oneshot )! +auto={17}{U}{U}{T}:name(X=17) all(*[zpos=17]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[all(*[zpos<=17]|mylibrary) moveto(myexile) and!( counter(0/0.1.study) )!],newability[ability$!may name(Put exiled card in hand) name(Put exiled card in hand) target(*[counter{0/0.1.study}]|myexile) moveto(myhand)!$ controller])) oneshot )! +auto={18}{U}{U}{T}:name(X=18) all(*[zpos=18]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[all(*[zpos<=18]|mylibrary) moveto(myexile) and!( counter(0/0.1.study) )!],newability[ability$!may name(Put exiled card in hand) name(Put exiled card in hand) target(*[counter{0/0.1.study}]|myexile) moveto(myhand)!$ controller])) oneshot )! +auto={19}{U}{U}{T}:name(X=19) all(*[zpos=19]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[all(*[zpos<=19]|mylibrary) moveto(myexile) and!( counter(0/0.1.study) )!],newability[ability$!may name(Put exiled card in hand) name(Put exiled card in hand) target(*[counter{0/0.1.study}]|myexile) moveto(myhand)!$ controller])) oneshot )! +auto={20}{U}{U}{T}:name(X=20) all(*[zpos=20]|mylibrary) moveto(myexile) and!( transforms((,newability[counter(0/0.1.study)],newability[all(*[zpos<=20]|mylibrary) moveto(myexile) and!( counter(0/0.1.study) )!],newability[ability$!may name(Put exiled card in hand) name(Put exiled card in hand) target(*[counter{0/0.1.study}]|myexile) moveto(myhand)!$ controller])) oneshot )! text=Flying -- {X}{U}{U}, {T}: Exile the top X cards of your library and put a study counter on each of them. Then you may put a card you own in exile with a study counter on it into your hand. // {2}{G} Kianne, Dean of Substance mana={2}{U}{U} type=Legendary Creature @@ -52387,16 +52387,15 @@ subtype=Aura [card] name=Kaya's Guile other={4}{W}{B} name(Entwine) -auto=ifnot paid(alternative) then choice name(Choose 1 and 2):ability$!name(sacrifice) notatarget(*[creature]|myBattlefield) sacrifice!$ opponent && moveto(exile) all(creature|opponentbattlefield) -auto=ifnot paid(alternative) then choice name(Choose 1 and 3):ability$!name(sacrifice) notatarget(*[creature]|myBattlefield) sacrifice!$ opponent && _AFTERLIFETOKEN_ -auto=ifnot paid(alternative) then choice name(Choose 1 and 4):ability$!name(sacrifice) notatarget(*[creature]|myBattlefield) sacrifice!$ opponent && life:4 controller -auto=ifnot paid(alternative) then choice name(Choose 2 and 3):moveto(exile) all(creature|opponentbattlefield) && _AFTERLIFETOKEN_ -auto=ifnot paid(alternative) then choice name(Choose 2 and 4):moveto(exile) all(creature|opponentbattlefield) && life:4 controller -auto=ifnot paid(alternative) then choice name(Choose 3 and 4):_AFTERLIFETOKEN_ && life:4 controller -auto=if paid(alternative) then ability$!name(sacrifice) notatarget(*[creature]|myBattlefield) sacrifice!$ opponent -auto=if paid(alternative) then moveto(exile) all(creature|opponentbattlefield) -auto=if paid(alternative) then _AFTERLIFETOKEN_ -auto=if paid(alternative) then life:4 controller +auto=ifnot paid(alternative) then if type(creature|opponentbattlefield)~morethan~0 then choice name(Sacrifice creature and exile cards) name(Sacrifice creature and exile cards) name(Sacrifice creature and exile cards) ability$!name(Sacrifice a creature) notatarget(creature|myBattlefield) sacrifice and!( moveto(exile) all(*|mygraveyard) )!!$ opponent && +auto=ifnot paid(alternative) then if type(creature|opponentbattlefield)~equalto~0 then choice name(Sacrifice creature and exile cards) name(Sacrifice creature and exile cards) name(Sacrifice creature and exile cards) moveto(exile) all(*|opponentgraveyard) +auto=ifnot paid(alternative) then choice name(Sacrifice creature and create spirit) name(Sacrifice creature and create spirit) token(Spirit,Creature Spirit,1/1,white,black,flying) && ability$!name(Sacrifice a creature) notatarget(creature|myBattlefield) sacrifice!$ opponent +auto=ifnot paid(alternative) then choice name(Sacrifice creature and gain life) name(Sacrifice creature and gain life) life:4 controller && ability$!name(Sacrifice a creature) notatarget(creature|myBattlefield) sacrifice!$ opponent +auto=ifnot paid(alternative) then choice name(Create spirit and exile cards) name(Create spirit and exile cards) token(Spirit,Creature Spirit,1/1,white,black,flying) and!( moveto(exile) all(*|opponentgraveyard) )! +auto=ifnot paid(alternative) then choice name(Gain life and exile cards) name(Gain life and exile cards) life:4 controller && moveto(exile) all(creature|opponentgraveyard) +auto=ifnot paid(alternative) then choice name(Create spirit and gain life) name(Create spirit and gain life) token(Spirit,Creature Spirit,1/1,white,black,flying) and!( life:4 controller )! +auto=if paid(alternative) then name(Sacrifice creature and exile cards) name(Sacrifice creature and exile cards) ability$!name(Sacrifice a creature) notatarget(creature|myBattlefield) sacrifice and!( moveto(exile) all(*|mygraveyard) )!!$ opponent +auto=if paid(alternative) then name(Create spirit and gain life) name(Create spirit and gain life) token(Spirit,Creature Spirit,1/1,white,black,flying) and!( life:4 controller )! text=Choose two -- Each opponent sacrifices a creature. -- Exile all cards from each opponent's graveyard. -- Create a 1/1 white and black Spirit creature token with flying. -- You gain 4 life. -- Entwine 3 (Choose all if you pay the entwine cost.) mana={1}{W}{B} type=Instant @@ -52414,8 +52413,8 @@ type=Instant [/card] [card] name=Kaya's Wrath -auto=destroy all(creature) -auto=@movedto(graveyard) from(creature|myBattlefield):life:1 +auto=all(creature|opponentbattlefield) destroy +auto=all(creature|mybattlefield) destroy and!( life:1 controller )! text=Destroy all creatures. You gain life equal to the number of creatures you controlled that were destroyed this way. mana={W}{W}{B}{B} type=Sorcery @@ -52445,7 +52444,7 @@ type=Legendary Artifact [/card] [card] name=Kayla's Reconstruction -aicode=activate transforms((,newability[if type(creature[manacost<=3&zpos<=7]|mylibrary)~equalto~0 then if type(artifact[manacost<=3&zpos<=7]|mylibrary)~equalto~0 then all(*[zpos<=7]|mylibrary) moveto(myreveal) and!( bottomoflibrary )!],newability[if type(creature[manacost<=3&zpos<=7]|mylibrary)~morethan~0 then target(creature[manacost<=3&zpos<=7]|mylibrary) moveto(mybattlefield) and!( transforms((,newability[all(*[zpos<=7]|mylibrary) moveto(myreveal) and!( bottomoflibrary )!],newability[if type(artifact[manacost<=3&zpos<=7]|mylibrary)~morethan~0 then target(artifact[manacost<=3&zpos<=7]|mylibrary) moveto(mybattlefield) and!( transforms((,newability[all(*[zpos<=7]|mylibrary) moveto(myreveal) and!( bottomoflibrary )!])) oneshot )! ])) oneshot +aicode=activate transforms((,newability[if type(creature[manacost<=3&zpos<=7]|mylibrary)~equalto~0 then if type(artifact[manacost<=3&zpos<=7]|mylibrary)~equalto~0 then all(*[zpos<=7]|mylibrary) moveto(myreveal) and!( bottomoflibrary )!],newability[if type(creature[manacost<=3&zpos<=7]|mylibrary)~morethan~0 then target(creature[manacost<=3&zpos<=7]|mylibrary) moveto(mybattlefield) and!( all(*[zpos<=7]|mylibrary) moveto(myreveal) and!( bottomoflibrary )! )!]auto=,newability[if type(creature[manacost<=3&zpos<=7]|mylibrary)~equalto~0 then if type(artifact[manacost<=3&zpos<=7]|mylibrary)~morethan~0 then target(artifact[manacost<=3&zpos<=7]|mylibrary) moveto(mybattlefield) and!( all(*[zpos<=7]|mylibrary) moveto(myreveal) and!( bottomoflibrary )! )!])) oneshot auto=name(Look top 7 cards) reveal:7 optionone name(Choose artifacts or creatures) target(*[manacost<=3]|reveal) moveto(mylibrary) and!( if cantargetcard(*[artifact;creature]|*) then becomes(tobecast) ueot )! optiononeend optiontwo name(Put on bottom) target(*|reveal) bottomoflibrary and!( all(*|reveal) bottomoflibrary )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(mybattlefield) afterrevealedend revealend text=Look at the top seven cards of your library. Put up to X artifact and/or creature cards with mana value 3 or less from among them onto the battlefield. Put the rest on the bottom of your library in a random order. mana={X}{W}{W}{W} @@ -53147,8 +53146,8 @@ otherrestriction=can play creature,compare(isflipped)~equalto~1 restriction=compare(isflipped)~equalto~0 anyzone={0}:doubleside(Imbraham, Dean of Theory) autostack=if paid(alternative) then name(Imbraham, Dean of Theory) name(Imbraham, Dean of Theory) flip(Imbraham, Dean of Theory) forcetype(Legendary Creature) -auto=this(variable{isflipped}<1) {T}:all(*[zpos=1]|mylibrary) moveto(myexile) and!( transforms((,newability[this(cantargetcard(*[land]|*) moveto(myhand)],newability[this(cantargetcard(*[-land]|*) counter(0/0.1.study)])) oneshot )! -auto=this(variable{isflipped}<1) {4}{G}:token(Fractal,Creature Fractal,0/0,green,blue) and!( transforms((,newability[if type(*[-land;red;counter{0/0.1.study}]|myexile)~morethan~0 then counter(1/1)],newability[if type(*[-land;black;counter{0/0.1.study}]|myexile)~morethan~0 then counter(1/1)],newability[if type(*[-land;green;counter{0/0.1.study}]|myexile)~morethan~0 then counter(1/1)],newability[if type(*[-land;white;counter{0/0.1.study}]|myexile)~morethan~0 then counter(1/1)],newability[if type(*[-land;blue;counter{0/0.1.study}]|myexile)~morethan~0 then counter(1/1)])) oneshot )! +auto=this(variable{isflipped}<1) {T}:name(Exile top card) name(Exile top card) all(*[zpos=1]|mylibrary) moveto(myexile) and!( transforms((,newability[if cantargetcard(*[land]|*) then moveto(myhand)],newability[if cantargetcard(*[-land]|*) then counter(0/0.1.Study)])) oneshot )! +auto=this(variable{isflipped}<1) {4}{G}:name(Create fractal) name(Create fractal) token(Fractal,Creature Fractal,0/0,green,blue) and!( transforms((,newability[if type(*[-land&manacost=0&counter{0/0.1.study}]|myexile)~morethan~0 then counter(1/1)],newability[if type(*[-land&manacost=1&counter{0/0.1.study}]|myexile)~morethan~0 then counter(1/1)],newability[if type(*[-land&manacost=2&counter{0/0.1.study}]|myexile)~morethan~0 then counter(1/1)],newability[if type(*[-land&manacost=3&counter{0/0.1.study}]|myexile)~morethan~0 then counter(1/1)],newability[if type(*[-land&manacost=4&counter{0/0.1.study}]|myexile)~morethan~0 then counter(1/1)],newability[if type(*[-land&manacost=5&counter{0/0.1.study}]|myexile)~morethan~0 then counter(1/1)],newability[if type(*[-land&manacost=6&counter{0/0.1.study}]|myexile)~morethan~0 then counter(1/1)],newability[if type(*[-land&manacost=7&counter{0/0.1.study}]|myexile)~morethan~0 then counter(1/1)],newability[if type(*[-land&manacost=8&counter{0/0.1.study}]|myexile)~morethan~0 then counter(1/1)],newability[if type(*[-land&manacost=9&counter{0/0.1.study}]|myexile)~morethan~0 then counter(1/1)],newability[if type(*[-land&manacost=10&counter{0/0.1.study}]|myexile)~morethan~0 then counter(1/1)],newability[if type(*[-land&manacost=11&counter{0/0.1.study}]|myexile)~morethan~0 then counter(1/1)],newability[if type(*[-land&manacost=12&counter{0/0.1.study}]|myexile)~morethan~0 then counter(1/1)],newability[if type(*[-land&manacost=13&counter{0/0.1.study}]|myexile)~morethan~0 then counter(1/1)],newability[if type(*[-land&manacost=14&counter{0/0.1.study}]|myexile)~morethan~0 then counter(1/1)],newability[if type(*[-land&manacost=15&counter{0/0.1.study}]|myexile)~morethan~0 then counter(1/1)],newability[if type(*[-land&manacost=16&counter{0/0.1.study}]|myexile)~morethan~0 then counter(1/1)],newability[if type(*[-land&manacost=17&counter{0/0.1.study}]|myexile)~morethan~0 then counter(1/1)],newability[if type(*[-land&manacost=18&counter{0/0.1.study}]|myexile)~morethan~0 then counter(1/1)],newability[if type(*[-land&manacost=19&counter{0/0.1.study}]|myexile)~morethan~0 then counter(1/1)],newability[if type(*[-land&manacost>=20&counter{0/0.1.study}]|myexile)~morethan~0 then counter(1/1)])) oneshot )! text={T}: Exile the top card of your library. If it's a land card, put it into your hand. Otherwise, put a study counter on it. -- {4}{G}: Create a 0/0 green and blue Fractal creature token. Put a +1/+1 counter on it for each different mana value among nonland cards you own in exile with study counters on them. // {2}{U}{U} name(Imbraham, Dean of Theory) mana={2}{G} type=Legendary Creature @@ -53463,8 +53462,7 @@ toughness=5 [card] name=Kira, Great Glass-Spinner abilities=flying -auto=lord(other creature|mybattlefield) transforms((,newability[@targeted(this) turnlimited:name(Counter spell) all(trigger[from]) fizzle])) -auto=@targeted(this) turnlimited:name(Counter spell) target(*|stack) fizzle +auto=lord(creature|mybattlefield) transforms((,newability[@targeted(this) turnlimited:name(Counter first spell) name(Counter first spell) target(*|stack) fizzle])) text=Flying -- Creatures you control have "Whenever this creature becomes the target of a spell or ability for the first time in a turn, counter that spell or ability." mana={1}{U}{U} type=Legendary Creature @@ -65633,7 +65631,7 @@ toughness=3 name=Nezahal, Primal Tide abilities=nofizzle,nomaxhand auto=@movedTo(*[-creature]|opponentstack):draw:1 -auto={D(*|myhand)}{D(*|myhand)}{D(*|myhand)}:_BLINK_UEOT_ +auto={D(*|myhand)}{D(*|myhand)}{D(*|myhand)}:name(Blink ueot) _BLINK_UEOT_ text=Nezahal, Primal Tide can't be countered. -- You have no maximum hand size. -- Whenever an opponent casts a noncreature spell, draw a card. -- Discard three cards: Exile Nezahal. Return it to the battlefield tapped under its owner's control at the beginning of the next end step. mana={5}{U}{U} type=Legendary Creature diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index ccd1e1bb1..2f6beda3f 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -1,6 +1,6 @@ #Primitives Pack for Wagic the Homebrew. #Please keep these card alphabetized, and try to have the "name=" line at the top of each card -#I sorted this programmatically so the other comments are removed except for AUTO_DEFINE - Vitty85 26-07-2023 +#I sorted this programmatically so the other comments are removed except for AUTO_DEFINE - Vitty85 27-07-2023 [card] name=Abandon Reason target=creature @@ -1438,7 +1438,7 @@ type=Instant [/card] [card] name=Aetherling -auto={U}:_BLINK_UEOT_ +auto={U}:name(Blink ueot) _BLINK_UEOT_ auto={U}:unblockable auto={1}:1/-1 auto={1}:-1/1 @@ -4354,7 +4354,7 @@ toughness=2 [/card] [card] name=Anurid Brushhopper -auto={D(*|myhand)}{D(*|myhand)}:_BLINK_UEOT_ +auto={D(*|myhand)}{D(*|myhand)}:name(Blink ueot) _BLINK_UEOT_ text=Discard two cards: Exile Anurid Brushhopper. Return it to the battlefield under its owner's control at the beginning of the next end step. mana={1}{G}{W} type=Creature @@ -5585,7 +5585,7 @@ type=Instant [card] name=Argent Sphinx abilities=flying -auto=aslongas(artifact|mybattlefield) {U}:_BLINK_UEOT_ >2 +auto=aslongas(artifact|mybattlefield) {U}:name(Blink ueot) name(Blink ueot) _BLINK_UEOT_ >2 text=Flying -- Metalcraft {U}: Exile Argent Sphinx. Return it to the battlefield under your control at the beginning of the next end step. Activate this ability only if you control three or more artifacts. mana={2}{U}{U} type=Creature @@ -43487,7 +43487,7 @@ toughness=6 [/card] [card] name=Frenetic Sliver -auto=lord(sliver) {0}:flipacoin winability _BLINK_UEOT_ winabilityend loseability sacrifice loseabilityend flipend +auto=lord(sliver) {0}:flipacoin winability name(Blink ueot) _BLINK_UEOT_ winabilityend loseability sacrifice loseabilityend flipend text=All Slivers have "{0}: If this permanent is on the battlefield, flip a coin. If you win the flip, exile this permanent and return it to the battlefield under its owner's control at the beginning of the next end step. If you lose the flip, sacrifice it." mana={1}{U}{R} type=Creature @@ -45740,7 +45740,7 @@ toughness=3 [card] name=Ghost Council of Orzhova auto=choice target(opponent) life:-1 && life:1 controller -auto={1}{S(creature|mybattlefield)}:_BLINK_UEOT_ +auto={1}{S(creature|mybattlefield)}:name(Blink ueot) _BLINK_UEOT_ text=When Ghost Council of Orzhova enters the battlefield, target opponent loses 1 life and you gain 1 life. -- {1}, Sacrifice a creature: Exile Ghost Council of Orzhova. Return it to the battlefield under its owner's control at the beginning of the next end step. mana={W}{W}{B}{B} type=Legendary Creature @@ -54716,7 +54716,7 @@ type=Sorcery [card] name=Hikari, Twilight Guardian abilities=flying -auto=@movedTo(spirit,arcane|mystack):may _BLINK_UEOT_ +auto=@movedTo(spirit,arcane|mystack):may name(Blink ueot) _BLINK_UEOT_ text=Flying -- Whenever you cast a Spirit or Arcane spell, you may exile Hikari, Twilight Guardian. If you do, return it to the battlefield under its owner's control at the beginning of the next end step. mana={3}{W}{W} type=Legendary Creature @@ -64872,9 +64872,9 @@ toughness=* [/card] [card] name=Krovikan Plague -target=creature[-Wall]|myBattlefield -auto=@next upkeep:draw:1 controller -auto=teach(creature) {T}:damage:1 target(anytarget) && all(this) counter(0/-1,1) +target=creature[-wall]|myBattlefield +auto=@next upkeep:name(Draw a card) draw:1 controller +auto=teach(creature) transforms((,newability[{T}{C(0/-1.1)}:name(Deal damage) damage:1 target(anytarget)])) text=Enchant non-Wall creature you control -- When Krovikan Plague enters the battlefield, draw a card at the beginning of the next turn's upkeep. -- Enchanted creature has "{T}: Put a -0/-1 counter on this creature, and Krovikan Plague deals 1 damage to target creature or player." mana={2}{B} type=Enchantment @@ -64971,7 +64971,7 @@ type=Artifact [card] name=Kudzu target=land -auto=@tapped(mytgt):all(trigger) destroy && all(this) transforms((,newability[target(land) retarget])) forever +auto=@tapped(mytgt):all(trigger) destroy && all(this) transforms((,newability[name(Attach to land) target(land|battlefield) retarget])) forever text=Enchant land -- When enchanted land becomes tapped, destroy it. That land's controller attaches Kudzu to a land of his or her choice. mana={1}{G}{G} type=Enchantment diff --git a/projects/mtg/bin/Res/sets/primitives/planeswalkers.txt b/projects/mtg/bin/Res/sets/primitives/planeswalkers.txt index bc8bd0395..3d1bef88c 100644 --- a/projects/mtg/bin/Res/sets/primitives/planeswalkers.txt +++ b/projects/mtg/bin/Res/sets/primitives/planeswalkers.txt @@ -1,6 +1,6 @@ #Planeswalkers Primitives Pack for Wagic the Homebrew. #Please keep these card alphabetized, and try to have the "name=" line at the top of each card -#We sorted this in alphabetical order - Luruz & Vitty85 26-07-2023 +#We sorted this in alphabetical order - Luruz & Vitty85 27-07-2023 [card] name=Abian, Luvion Usurper auto=counter(0/0,5,loyalty) @@ -1666,10 +1666,9 @@ subtype=Karn name=Karn, the Great Creator auto=counter(0/0,5,loyalty) auto=lord(artifact|opponentBattlefield) noactivatedability -auto={C(0/0,1,Loyalty)}:name(+1: Becomes a creature) target(artifact[-creature]) transforms((creature,newability[manacost/manacost])) uynt -auto={C(0/0,1,Loyalty)}:name(+1: Loyalty counter) donothing -auto={C(0/0,-2,Loyalty)}:name(-2: move a card from exile) moveto(ownerhand) target(artifact|myexile) -auto={C(0/0,-2,Loyalty)}:name(-2: move a card from sideboard) reveal:type:*:mysideboard revealzone(mysideboard) optionone name(choose card) target(<1>*[artifact]|reveal) moveto(myhand) and!(all(other *|reveal) moveto(ownersideboard))! optiononeend optiontwo name(put back) target(<1>*|reveal) moveto(ownersideboard) and!(all(other *|reveal) moveto(ownersideboard))! optiontwoend revealend +auto={C(0/0,1,Loyalty)}:name(+1: Transform an artifact) target(artifact[-creature]) transforms((creature,newability[manacost/manacost])) uynt +auto={C(0/0,1,Loyalty)}:name(+1: Don't transform any artifact) donothing +auto={C(0/0,-2,Loyalty)}:name(-2: Move a card from outside game) target(artifact|myexile,mysideboard) moveto(myhand) text=Activated abilities of artifacts your opponents control can't be activated. -- +1: Until your next turn, up to one target noncreature artifact becomes an artifact creature with power and toughness each equal to its mana value. -- -2: You may choose an artifact card you own from outside the game or in exile, reveal that card, and put it into your hand. mana={4} type=Legendary Planeswalker @@ -1763,9 +1762,11 @@ subtype=Kaya [card] name=Kaya, Ghost Assassin auto=counter(0/0,5,loyalty) -auto={C(0/0,0,Loyalty)}:name(+0: Exile Kaya or creature) ability$!name(Choose creature or this) choice name(Kaya, Ghost Assassin) all(this) (blink)ueot && life:-2 controller _choice name(Creature) target(creature) (blink)ueot controller!$ controller && life:-2 -auto={C(0/0,-1,Loyalty)}:name(-1: Each opponent loses life and you gain) life:-2 opponent && life:2 controller -auto={C(0/0,-2,Loyalty)}:name(-2: Each opponent discard and draw) ability$!name(discard a card) notatarget(*|myHand) reject!$ opponent && draw:1 controller +auto={C(0/0,0,Loyalty)}:name(+0: Exile creature) target(creature|battlefield) moveto(exile) and!( life:-2 controller && transforms((,newability[phaseaction[endofturn once checkex] moveto(ownerbattlefield)])) forever )! +auto={C(0/0,0,Loyalty)}:name(+0: Exile kaya) moveto(exile) and!( life:-2 controller && counter(0/0,hascntloyalty,Loyalty) && transforms((,newability[@next endofturn:name(Return to battlefield) moveto(ownerbattlefield) and!( counter(0/0.hascntloyalty.Loyalty) notrg && counter(0/0.-5.Loyalty) notrg)! ])) forever )! +auto={C(0/0,0,Loyalty)}:name(+0: Don't exile anything) life:-2 controller +auto={C(0/0,-1,Loyalty)}:name(-1: Opponent loses life) lifeleech:-2 opponent +auto={C(0/0,-2,Loyalty)}:name(-2: Each opponent discard and draw) ability$!name(Discard a card) notatarget(*|myHand) reject!$ opponent && draw:1 controller text=0: Exile Kaya, Ghost Assassin or up to one target creature. Return that card to the battlefield under its owner's control at the beginning of your next upkeep. You lose 2 life. -- -1: Each opponent loses 2 life and you gain 2 life. -- -2: Each opponent discards a card and you draw a card. mana={2}{W}{B} type=Legendary Planeswalker diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index ea3391dfd..50378cf6b 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -2340,7 +2340,7 @@ class ACombatRemoval: public ActivatedAbility class AADrawer: public ActivatedAbilityTP { public: - + MTGAbility * andAbility; string nbcardsStr; bool noReplace; AADrawer(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost,string nbcardsStr, int who = @@ -2348,6 +2348,7 @@ class AADrawer: public ActivatedAbilityTP int resolve(); const string getMenuText(); AADrawer * clone() const; + ~AADrawer(); int getNumCards(); }; @@ -2369,7 +2370,6 @@ class ACastRestriction: public AbilityTP const string getMenuText(); ACastRestriction * clone() const; ~ACastRestriction(); - }; @@ -2390,6 +2390,7 @@ class AInstantCastRestrictionUEOT: public InstantAbilityTP class AALifer: public ActivatedAbilityTP { public: + MTGAbility * andAbility; string life_s; bool siphon; AALifer(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target,string life_s, bool siphon = false, ManaCost * _cost = NULL, @@ -2397,8 +2398,8 @@ class AALifer: public ActivatedAbilityTP int resolve(); const string getMenuText(); AALifer * clone() const; + ~AALifer(); int getLife(); - }; /*Player Wins Game*/ @@ -4623,7 +4624,6 @@ class AAuraIncreaseReduce: public AbilityTP const string getMenuText(); AAuraIncreaseReduce * clone() const; //~AAuraIncreaseReduce(); - }; //Modify Hand @@ -4669,11 +4669,10 @@ class AALifeSet: public ActivatedAbilityTP }; -//lifesetend - class AADamager: public ActivatedAbilityTP { public: + MTGAbility * andAbility; string d; bool redirected; @@ -4683,7 +4682,7 @@ class AADamager: public ActivatedAbilityTP const string getMenuText(); int getDamage(); AADamager * clone() const; - + ~AADamager(); }; //prevent next damage @@ -4712,6 +4711,7 @@ class AAAlterPoison: public ActivatedAbilityTP AAAlterPoison * clone() const; ~AAAlterPoison(); }; + //Energy Counter class AAAlterEnergy: public ActivatedAbilityTP { @@ -4725,6 +4725,7 @@ class AAAlterEnergy: public ActivatedAbilityTP AAAlterEnergy * clone() const; ~AAAlterEnergy(); }; + //Experience Counter class AAAlterExperience: public ActivatedAbilityTP { @@ -4738,6 +4739,7 @@ class AAAlterExperience: public ActivatedAbilityTP AAAlterExperience * clone() const; ~AAAlterExperience(); }; + //Boast Event class AABoastEvent: public ActivatedAbilityTP { @@ -4751,6 +4753,7 @@ class AABoastEvent: public ActivatedAbilityTP AABoastEvent * clone() const; ~AABoastEvent(); }; + //Surveil Event class AASurveilEvent: public ActivatedAbilityTP { @@ -4764,6 +4767,7 @@ class AASurveilEvent: public ActivatedAbilityTP AASurveilEvent * clone() const; ~AASurveilEvent(); }; + //Explores Event class AAExploresEvent: public ActivatedAbilityTP { @@ -4777,6 +4781,7 @@ class AAExploresEvent: public ActivatedAbilityTP AAExploresEvent * clone() const; ~AAExploresEvent(); }; + //Ring bearer has been chosen class AARingBearerChosen : public ActivatedAbility { @@ -4789,6 +4794,7 @@ class AARingBearerChosen : public ActivatedAbility AARingBearerChosen * clone() const; ~AARingBearerChosen(); }; + //Dungeon Completed class AAAlterDungeonCompleted: public ActivatedAbilityTP { @@ -4802,6 +4808,7 @@ class AAAlterDungeonCompleted: public ActivatedAbilityTP AAAlterDungeonCompleted * clone() const; ~AAAlterDungeonCompleted(); }; + //Yidaro Counter class AAAlterYidaroCount: public ActivatedAbilityTP { @@ -4815,6 +4822,7 @@ class AAAlterYidaroCount: public ActivatedAbilityTP AAAlterYidaroCount * clone() const; ~AAAlterYidaroCount(); }; + //Ring Temptations class AAAlterRingTemptations: public ActivatedAbilityTP { @@ -4828,6 +4836,7 @@ class AAAlterRingTemptations: public ActivatedAbilityTP AAAlterRingTemptations * clone() const; ~AAAlterRingTemptations(); }; + //Monarch class AAAlterMonarch: public ActivatedAbilityTP { @@ -4840,6 +4849,7 @@ class AAAlterMonarch: public ActivatedAbilityTP AAAlterMonarch * clone() const; ~AAAlterMonarch(); }; + //Initiative class AAAlterInitiative: public ActivatedAbilityTP { @@ -4852,6 +4862,7 @@ class AAAlterInitiative: public ActivatedAbilityTP AAAlterInitiative * clone() const; ~AAAlterInitiative(); }; + //Surveil Offset class AAAlterSurveilOffset: public ActivatedAbilityTP { @@ -4865,6 +4876,7 @@ class AAAlterSurveilOffset: public ActivatedAbilityTP AAAlterSurveilOffset * clone() const; ~AAAlterSurveilOffset(); }; + //Devotion Offset class AAAlterDevotionOffset: public ActivatedAbilityTP { @@ -4878,6 +4890,7 @@ class AAAlterDevotionOffset: public ActivatedAbilityTP AAAlterDevotionOffset * clone() const; ~AAAlterDevotionOffset(); }; + /* Standard Damager, can choose a NEW target each time the price is paid */ class TADamager: public TargetAbility { @@ -4895,6 +4908,7 @@ class TADamager: public TargetAbility return NEW TADamager(*this); } }; + //bestow class ABestow : public ActivatedAbility { @@ -4910,21 +4924,25 @@ class ABestow : public ActivatedAbility class AATapper: public ActivatedAbility { public: + MTGAbility * andAbility; bool _sendNoEvent; AATapper(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost = NULL, bool _sendNoEvent = true); int resolve(); const string getMenuText(); AATapper * clone() const; + ~AATapper(); }; /* Can untap a target for a cost */ class AAUntapper: public ActivatedAbility { public: + MTGAbility * andAbility; AAUntapper(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost = NULL); int resolve(); const string getMenuText(); AAUntapper * clone() const; + ~AAUntapper(); }; /*announce card X*/ @@ -4977,11 +4995,13 @@ class AACountObjectB : public ActivatedAbility class AAFrozen: public ActivatedAbility { public: + MTGAbility * andAbility; bool freeze; AAFrozen(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target, bool tap, ManaCost * _cost = NULL); int resolve(); const string getMenuText(); AAFrozen * clone() const; + ~AAFrozen(); }; /* ghetto new target*/ class AANewTarget: public ActivatedAbility @@ -6850,6 +6870,7 @@ class APhaseAlter: public TriggeredAbility class AADepleter: public ActivatedAbilityTP { public: + MTGAbility * andAbility; string nbcardsStr; bool toexile; bool colorrepeat; @@ -6859,6 +6880,7 @@ class AADepleter: public ActivatedAbilityTP int resolve(); const string getMenuText(); AADepleter * clone() const; + ~AADepleter(); }; @@ -6895,11 +6917,13 @@ class AAModTurn: public ActivatedAbilityTP class AAShuffle: public ActivatedAbilityTP { public: + MTGAbility * andAbility; AAShuffle(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost = NULL, int who = TargetChooser::UNSET); int resolve(); const string getMenuText(); AAShuffle * clone() const; + ~AAShuffle(); }; //Mulligan @@ -6925,7 +6949,6 @@ class AARemoveMana: public ActivatedAbilityTP const string getMenuText(); AARemoveMana * clone() const; ~AARemoveMana(); - }; //Random Discard diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index a83c29530..2c9768b8a 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -1677,219 +1677,256 @@ AADamager::AADamager(GameObserver* observer, int _id, MTGCardInstance * _source, { aType = MTGAbility::DAMAGER; redirected = false; - } + andAbility = NULL; +} - int AADamager::resolve() +int AADamager::resolve() +{ + Damageable * _target = (Damageable *) getTarget(); + if (_target) { - Damageable * _target = (Damageable *) getTarget(); - if (_target) - { - WParsedInt damage(d, NULL, (MTGCardInstance *)source); - if(_target == game->opponent() && game->opponent()->inPlay()->hasType("planeswalker") && !redirected) - { - vectorselection; - MTGCardInstance * check = NULL; - this->redirected = true; - MTGAbility * setPlayer = this->clone(); - this->redirected = false; - selection.push_back(setPlayer); - int checkWalkers = ((Player*)_target)->game->battlefield->cards.size(); - for(int i = 0; i < checkWalkers;++i) - { - check = ((Player*)_target)->game->battlefield->cards[i]; - if(check->hasType(Subtypes::TYPE_PLANESWALKER)) - { - this->redirected = true; - MTGAbility * setWalker = this->clone(); - this->redirected = false; - setWalker->oneShot = true; - setWalker->target = check; - selection.push_back(setWalker); - } - } - if(selection.size()) + WParsedInt damage(d, NULL, (MTGCardInstance *)source); + if(_target == game->opponent() && game->opponent()->inPlay()->hasType("planeswalker") && !redirected) + { + vectorselection; + MTGCardInstance * check = NULL; + this->redirected = true; + MTGAbility * setPlayer = this->clone(); + this->redirected = false; + selection.push_back(setPlayer); + int checkWalkers = ((Player*)_target)->game->battlefield->cards.size(); + for(int i = 0; i < checkWalkers;++i) + { + check = ((Player*)_target)->game->battlefield->cards[i]; + if(check->hasType(Subtypes::TYPE_PLANESWALKER)) { - MTGAbility * a1 = NEW MenuAbility(game, this->GetId(), source, source,true,selection); - game->mLayers->actionLayer()->currentActionCard = source; - a1->resolve(); + this->redirected = true; + MTGAbility * setWalker = this->clone(); + this->redirected = false; + setWalker->oneShot = true; + setWalker->target = check; + selection.push_back(setWalker); } - return 1; } - game->mLayers->stackLayer()->addDamage(source, _target, damage.getValue()); - game->mLayers->stackLayer()->resolve(); + if(selection.size()) + { + MTGAbility * a1 = NEW MenuAbility(game, this->GetId(), source, source,true,selection); + game->mLayers->actionLayer()->currentActionCard = source; + a1->resolve(); + } return 1; } - return 0; - } - - int AADamager::getDamage() - { - WParsedInt damage(d, NULL, (MTGCardInstance *)source); - return damage.getValue(); - } - - const string AADamager::getMenuText() - { - MTGCardInstance * _target = dynamic_cast(target); - if(_target && (_target->hasType(Subtypes::TYPE_PLANESWALKER) || _target->hasType(Subtypes::TYPE_BATTLE))) - return _target->name.c_str(); - if(redirected) + game->mLayers->stackLayer()->addDamage(source, _target, damage.getValue()); + game->mLayers->stackLayer()->resolve(); + if(andAbility) { - if(d.size()) + MTGAbility * andAbilityClone = andAbility->clone(); + andAbilityClone->target = source; + if(andAbility->oneShot) + { + andAbilityClone->resolve(); + SAFE_DELETE(andAbilityClone); + } + else { - WParsedInt parsedNum(d, NULL, source); - return _("Deal " + parsedNum.getStringValue() + " Damage to Player").c_str(); + andAbilityClone->addToGame(); } - return "Damage Player"; } - + return 1; + } + return 0; +} + +int AADamager::getDamage() +{ + WParsedInt damage(d, NULL, (MTGCardInstance *)source); + return damage.getValue(); +} + +const string AADamager::getMenuText() +{ + MTGCardInstance * _target = dynamic_cast(target); + if(_target && (_target->hasType(Subtypes::TYPE_PLANESWALKER) || _target->hasType(Subtypes::TYPE_BATTLE))) + return _target->name.c_str(); + if(redirected) + { if(d.size()) { WParsedInt parsedNum(d, NULL, source); - return _("Deal " + parsedNum.getStringValue() + " Damage").c_str(); + return _("Deal " + parsedNum.getStringValue() + " Damage to Player").c_str(); } - return "Damage"; + return "Damage Player"; + } + + if(d.size()) + { + WParsedInt parsedNum(d, NULL, source); + return _("Deal " + parsedNum.getStringValue() + " Damage").c_str(); } + return "Damage"; +} AADamager * AADamager::clone() const { - return NEW AADamager(*this); + AADamager * a = NEW AADamager(*this); + if(andAbility) + a->andAbility = andAbility->clone(); + return a; } +AADamager::~AADamager() +{ + SAFE_DELETE(andAbility); +} //AADepleter AADepleter::AADepleter(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target,string nbcardsStr, ManaCost * _cost, int who, bool toexile, bool colorrepeat, bool namerepeat) : ActivatedAbilityTP(observer, _id, card, _target, _cost, who),nbcardsStr(nbcardsStr),toexile(toexile), colorrepeat(colorrepeat), namerepeat(namerepeat) { + andAbility = NULL; } - int AADepleter::resolve() + +int AADepleter::resolve() +{ + Player * player = getPlayerFromTarget(getTarget()); + if (player) { - Player * player = getPlayerFromTarget(getTarget()); - if (player) + WParsedInt numCards(nbcardsStr, NULL, source); + MTGLibrary * library = player->game->library; + if (colorrepeat && library->nb_cards) { - WParsedInt numCards(nbcardsStr, NULL, source); - MTGLibrary * library = player->game->library; - if (colorrepeat && library->nb_cards) + bool repeating = false; + do { - bool repeating = false; - do + repeating = false; + vectorfound; + for (int i = 0; i < numCards.getValue(); i++) { - repeating = false; - vectorfound; - for (int i = 0; i < numCards.getValue(); i++) + if (library->nb_cards) { - if (library->nb_cards) - { - if(library->nb_cards > i) - found.push_back(library->cards[(library->nb_cards - 1) - i]); - } + if(library->nb_cards > i) + found.push_back(library->cards[(library->nb_cards - 1) - i]); } + } - for (vector::iterator it = found.begin(); it != found.end(); it++) + for (vector::iterator it = found.begin(); it != found.end(); it++) + { + MTGCardInstance * cardFirst = *it; + if (cardFirst->isLand()) + continue; + for (int i = Constants::MTG_COLOR_GREEN; i <= Constants::MTG_COLOR_WHITE; ++i) { - MTGCardInstance * cardFirst = *it; - if (cardFirst->isLand()) - continue; - for (int i = Constants::MTG_COLOR_GREEN; i <= Constants::MTG_COLOR_WHITE; ++i) + if (cardFirst->hasColor(i)) { - if (cardFirst->hasColor(i)) + for (vector::iterator secondit = found.begin(); secondit != found.end(); secondit++) { - for (vector::iterator secondit = found.begin(); secondit != found.end(); secondit++) + MTGCardInstance * cardSecond = *secondit; + if (cardSecond->isLand()) + continue; + if (cardSecond->hasColor(i) && cardFirst != cardSecond) { - MTGCardInstance * cardSecond = *secondit; - if (cardSecond->isLand()) - continue; - if (cardSecond->hasColor(i) && cardFirst != cardSecond) - { - repeating = true; - } + repeating = true; } } } } + } - do + do + { + if (found.size()) { - if (found.size()) + MTGCardInstance * toMove = found.back(); + if (toMove) { - MTGCardInstance * toMove = found.back(); - if (toMove) - { - if (toexile) - player->game->putInZone(toMove, library, player->game->exile); - else - player->game->putInZone(toMove, library, player->game->graveyard); - found.pop_back(); - } + if (toexile) + player->game->putInZone(toMove, library, player->game->exile); + else + player->game->putInZone(toMove, library, player->game->graveyard); + found.pop_back(); } - } while (found.size()); + } + } while (found.size()); - } while (repeating); - } - else if (namerepeat && library->nb_cards) + } while (repeating); + } + else if (namerepeat && library->nb_cards) + { + bool repeating = false; + do { - bool repeating = false; - do + repeating = false; + vectorfound; + for (int i = 0; i < numCards.getValue(); i++) { - repeating = false; - vectorfound; - for (int i = 0; i < numCards.getValue(); i++) + if (library->nb_cards) { - if (library->nb_cards) - { - if (library->nb_cards > i) - found.push_back(library->cards[(library->nb_cards - 1) - i]); - } + if (library->nb_cards > i) + found.push_back(library->cards[(library->nb_cards - 1) - i]); } + } - for (vector::iterator it = found.begin(); it != found.end(); it++) + for (vector::iterator it = found.begin(); it != found.end(); it++) + { + MTGCardInstance * cardFirst = *it; + for (vector::iterator secondit = found.begin(); secondit != found.end(); secondit++) { - MTGCardInstance * cardFirst = *it; - for (vector::iterator secondit = found.begin(); secondit != found.end(); secondit++) + MTGCardInstance * cardSecond = *secondit; + if (cardSecond->name == cardFirst->name && cardFirst != cardSecond) { - MTGCardInstance * cardSecond = *secondit; - if (cardSecond->name == cardFirst->name && cardFirst != cardSecond) - { - repeating = true; - } + repeating = true; } - } - do + } + + do + { + if (found.size()) { - if (found.size()) + MTGCardInstance * toMove = found.back(); + if (toMove) { - MTGCardInstance * toMove = found.back(); - if (toMove) - { - if (toexile) - player->game->putInZone(toMove, library, player->game->exile); - else - player->game->putInZone(toMove, library, player->game->graveyard); - found.pop_back(); - } + if (toexile) + player->game->putInZone(toMove, library, player->game->exile); + else + player->game->putInZone(toMove, library, player->game->graveyard); + found.pop_back(); } - } while (found.size()); - } while (repeating); - } - else + } + } while (found.size()); + } while (repeating); + } + else + { + for (int i = 0; i < numCards.getValue(); i++) { - for (int i = 0; i < numCards.getValue(); i++) + if (library->nb_cards) { - if (library->nb_cards) - { - if (toexile) - player->game->putInZone(library->cards[library->nb_cards - 1], library, player->game->exile); - else - player->game->putInZone(library->cards[library->nb_cards - 1], library, player->game->graveyard); - } + if (toexile) + player->game->putInZone(library->cards[library->nb_cards - 1], library, player->game->exile); + else + player->game->putInZone(library->cards[library->nb_cards - 1], library, player->game->graveyard); } } - } - return 1; + if(andAbility) + { + MTGAbility * andAbilityClone = andAbility->clone(); + andAbilityClone->target = source; + if(andAbility->oneShot) + { + andAbilityClone->resolve(); + SAFE_DELETE(andAbilityClone); + } + else + { + andAbilityClone->addToGame(); + } + } } + return 1; +} const string AADepleter::getMenuText() { @@ -1913,7 +1950,15 @@ const string AADepleter::getMenuText() AADepleter * AADepleter::clone() const { - return NEW AADepleter(*this); + AADepleter * a = NEW AADepleter(*this); + if(andAbility) + a->andAbility = andAbility->clone(); + return a; +} + +AADepleter::~AADepleter() +{ + SAFE_DELETE(andAbility); } //AACascade @@ -4455,8 +4500,8 @@ AASacrificeCard::~AASacrificeCard() { SAFE_DELETE(andAbility); } -// Discard +// Discard AADiscardCard::AADiscardCard(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target) : ActivatedAbility(observer, _id, _source) { @@ -4510,57 +4555,72 @@ AADiscardCard * AADiscardCard::clone() const a->andAbility = andAbility->clone(); return a; } + AADiscardCard::~AADiscardCard() { SAFE_DELETE(andAbility); } - -// +//Draw AADrawer::AADrawer(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost, string nbcardsStr, int who, bool noreplace) : ActivatedAbilityTP(observer, _id, card, _target, _cost, who), nbcardsStr(nbcardsStr),noReplace(noreplace) { aType = MTGAbility::STANDARD_DRAW; + andAbility = NULL; } - int AADrawer::resolve() - { - Player * player = getPlayerFromTarget(getTarget()); +int AADrawer::resolve() +{ + Player * player = getPlayerFromTarget(getTarget()); - if (player) + if (player) + { + WParsedInt numCards(nbcardsStr, NULL, source); + WEvent * e = NEW WEventDraw(player, numCards.getValue(),this); + if(!noReplace) + e = game->replacementEffects->replace(e); + if(e) { - WParsedInt numCards(nbcardsStr, NULL, source); - WEvent * e = NEW WEventDraw(player, numCards.getValue(),this); - if(!noReplace) - e = game->replacementEffects->replace(e); - if(e) + game->mLayers->stackLayer()->addDraw(player, numCards.getValue()); + game->mLayers->stackLayer()->resolve(); + for(int i = numCards.getValue(); i > 0;i--) { - game->mLayers->stackLayer()->addDraw(player, numCards.getValue()); - game->mLayers->stackLayer()->resolve(); - for(int i = numCards.getValue(); i > 0;i--) + player->drawCounter += 1; + if ((game->turn < 1) && game->getCurrentGamePhase() == MTG_PHASE_FIRSTMAIN + && game->currentPlayer->game->inPlay->nb_cards == 0 && game->currentPlayer->game->graveyard->nb_cards == 0 + && game->currentPlayer->game->exile->nb_cards == 0 && game->currentlyActing() == (Player*)game->currentPlayer) //1st Play Check { - player->drawCounter += 1; - if ((game->turn < 1) && game->getCurrentGamePhase() == MTG_PHASE_FIRSTMAIN - && game->currentPlayer->game->inPlay->nb_cards == 0 && game->currentPlayer->game->graveyard->nb_cards == 0 - && game->currentPlayer->game->exile->nb_cards == 0 && game->currentlyActing() == (Player*)game->currentPlayer) //1st Play Check - { - game->currentPlayer->drawCounter = 0;//Reset drawCounter for pre-game draw - } - WEvent * e = NEW WEventcardDraw(player, 1); - game->receiveEvent(e); + game->currentPlayer->drawCounter = 0;//Reset drawCounter for pre-game draw } + WEvent * e = NEW WEventcardDraw(player, 1); + game->receiveEvent(e); + } + } + SAFE_DELETE(e); + if(andAbility) + { + MTGAbility * andAbilityClone = andAbility->clone(); + andAbilityClone->target = source; + if(andAbility->oneShot) + { + andAbilityClone->resolve(); + SAFE_DELETE(andAbilityClone); + } + else + { + andAbilityClone->addToGame(); } - SAFE_DELETE(e); } - return 1; } + return 1; +} - int AADrawer::getNumCards() - { - WParsedInt numCards(nbcardsStr, NULL, source); - return numCards.getValue(); - } +int AADrawer::getNumCards() +{ + WParsedInt numCards(nbcardsStr, NULL, source); + return numCards.getValue(); +} const string AADrawer::getMenuText() { @@ -4574,7 +4634,15 @@ const string AADrawer::getMenuText() AADrawer * AADrawer::clone() const { - return NEW AADrawer(*this); + AADrawer * a = NEW AADrawer(*this); + if(andAbility) + a->andAbility = andAbility->clone(); + return a; +} + +AADrawer::~AADrawer() +{ + SAFE_DELETE(andAbility); } // AAFrozen: Prevent a card from untapping during next untap phase @@ -4583,6 +4651,7 @@ ActivatedAbility(observer, id, card, _cost, 0) { target = _target; freeze = tap; + andAbility = NULL; } int AAFrozen::resolve() @@ -4598,6 +4667,20 @@ int AAFrozen::resolve() _target->tap();//easier to manage for cards that allow you to tap and also freeze. } _target->frozen += 1; + if(andAbility) + { + MTGAbility * andAbilityClone = andAbility->clone(); + andAbilityClone->target = _target; + if(andAbility->oneShot) + { + andAbilityClone->resolve(); + SAFE_DELETE(andAbilityClone); + } + else + { + andAbilityClone->addToGame(); + } + } } return 1; } @@ -4609,7 +4692,15 @@ const string AAFrozen::getMenuText() AAFrozen * AAFrozen::clone() const { - return NEW AAFrozen(*this); + AAFrozen * a = NEW AAFrozen(*this); + if(andAbility) + a->andAbility = andAbility->clone(); + return a; +} + +AAFrozen::~AAFrozen() +{ + SAFE_DELETE(andAbility); } // chose a new target for an aura or enchantment and equip it note: VERY basic right now. @@ -5734,6 +5825,7 @@ AALifer::AALifer(GameObserver* observer, int _id, MTGCardInstance * card, Target ActivatedAbilityTP(observer, _id, card, _target, _cost, who),life_s(life_s),siphon(siphon) { aType = MTGAbility::LIFER; + andAbility = NULL; } int AALifer::resolve() @@ -5752,6 +5844,21 @@ int AALifer::resolve() if(siphon && (slife > 0) && (life.getValue() < 0)) source->controller()->gainOrLoseLife(slife, source); + if(andAbility) + { + MTGAbility * andAbilityClone = andAbility->clone(); + andAbilityClone->target = source; + if(andAbility->oneShot) + { + andAbilityClone->resolve(); + SAFE_DELETE(andAbilityClone); + } + else + { + andAbilityClone->addToGame(); + } + } + return 1; } @@ -5770,7 +5877,15 @@ const string AALifer::getMenuText() AALifer * AALifer::clone() const { - return NEW AALifer(*this); + AALifer * a = NEW AALifer(*this); + if(andAbility) + a->andAbility = andAbility->clone(); + return a; +} + +AALifer::~AALifer() +{ + SAFE_DELETE(andAbility); } //Extra for Bestow ... partial fix since there's no update when react to click for bestow cards... @@ -6648,6 +6763,7 @@ AARandomDiscarder * AARandomDiscarder::clone() const AAShuffle::AAShuffle(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost, int who) : ActivatedAbilityTP(observer, _id, card, _target, _cost, who) { + andAbility = NULL; } int AAShuffle::resolve() @@ -6668,7 +6784,15 @@ const string AAShuffle::getMenuText() AAShuffle * AAShuffle::clone() const { - return NEW AAShuffle(*this); + AAShuffle * a = NEW AAShuffle(*this); + if(andAbility) + a->andAbility = andAbility->clone(); + return a; +} + +AAShuffle::~AAShuffle() +{ + SAFE_DELETE(andAbility); } // Mulligan @@ -6861,6 +6985,7 @@ AATapper::AATapper(GameObserver* observer, int id, MTGCardInstance * card, MTGCa { target = _target; aType = MTGAbility::TAPPER; + andAbility = NULL; } int AATapper::resolve() @@ -6872,6 +6997,20 @@ int AATapper::resolve() while (_target->next) _target = _target->next; //This is for cards such as rampant growth _target->tap(_sendNoEvent); + if(andAbility) + { + MTGAbility * andAbilityClone = andAbility->clone(); + andAbilityClone->target = _target; + if(andAbility->oneShot) + { + andAbilityClone->resolve(); + SAFE_DELETE(andAbilityClone); + } + else + { + andAbilityClone->addToGame(); + } + } } return 1; } @@ -6883,7 +7022,15 @@ const string AATapper::getMenuText() AATapper * AATapper::clone() const { - return NEW AATapper(*this); + AATapper * a = NEW AATapper(*this); + if(andAbility) + a->andAbility = andAbility->clone(); + return a; +} + +AATapper::~AATapper() +{ + SAFE_DELETE(andAbility); } //AA Untapper @@ -6892,6 +7039,7 @@ AAUntapper::AAUntapper(GameObserver* observer, int id, MTGCardInstance * card, M { target = _target; aType = MTGAbility::UNTAPPER; + andAbility = NULL; } int AAUntapper::resolve() @@ -6903,6 +7051,20 @@ int AAUntapper::resolve() while (_target->next) _target = _target->next; //This is for cards such as rampant growth _target->untap(); + if(andAbility) + { + MTGAbility * andAbilityClone = andAbility->clone(); + andAbilityClone->target = _target; + if(andAbility->oneShot) + { + andAbilityClone->resolve(); + SAFE_DELETE(andAbilityClone); + } + else + { + andAbilityClone->addToGame(); + } + } } return 1; } @@ -6914,7 +7076,15 @@ const string AAUntapper::getMenuText() AAUntapper * AAUntapper::clone() const { - return NEW AAUntapper(*this); + AAUntapper * a = NEW AAUntapper(*this); + if(andAbility) + a->andAbility = andAbility->clone(); + return a; +} + +AAUntapper::~AAUntapper() +{ + SAFE_DELETE(andAbility); } AAWhatsMax::AAWhatsMax(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance *, ManaCost * _cost, int value) : diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index e73958f4e..95c6ce011 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -4300,6 +4300,12 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG Targetable * t = spell ? spell->getNextTarget() : NULL; MTGAbility * a = NEW AADamager(observer, id, card, t, splitDamage[1], NULL, who); a->oneShot = 1; + if(storedAndAbility.size()) + { + string stored = storedAndAbility; + storedAndAbility.clear(); + ((AADamager*)a)->andAbility = parseMagicLine(stored, id, spell, card); + } return a; } @@ -4619,6 +4625,12 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG Targetable * t = spell ? spell->getNextTarget() : NULL; MTGAbility * a = NEW AALifer(observer, id, card, t, splitLife[1], false, NULL, who); a->oneShot = 1; + if(storedAndAbility.size()) + { + string stored = storedAndAbility; + storedAndAbility.clear(); + ((AALifer*)a)->andAbility = parseMagicLine(stored, id, spell, card); + } return a; } @@ -4629,6 +4641,12 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG Targetable * t = spell ? spell->getNextTarget() : NULL; MTGAbility * a = NEW AALifer(observer, id, card, t, splitSiphonLife[1], true, NULL, who); a->oneShot = 1; + if(storedAndAbility.size()) + { + string stored = storedAndAbility; + storedAndAbility.clear(); + ((AALifer*)a)->andAbility = parseMagicLine(stored, id, spell, card); + } return a; } @@ -4649,6 +4667,12 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG Targetable * t = spell ? spell->getNextTarget() : NULL; MTGAbility * a = NEW AADrawer(observer, id, card, t, NULL,splitDraw[1], who,s.find("noreplace") != string::npos); a->oneShot = 1; + if(storedAndAbility.size()) + { + string stored = storedAndAbility; + storedAndAbility.clear(); + ((AADrawer*)a)->andAbility = parseMagicLine(stored, id, spell, card); + } return a; } @@ -4665,6 +4689,12 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG Targetable * t = spell ? spell->getNextTarget() : NULL; MTGAbility * a = NEW AADepleter(observer, id, card, t , splitDeplete[1], NULL, who, false, colorrepeat, namerepeat); a->oneShot = 1; + if(storedAndAbility.size()) + { + string stored = storedAndAbility; + storedAndAbility.clear(); + ((AADepleter*)a)->andAbility = parseMagicLine(stored, id, spell, card); + } return a; } @@ -4681,6 +4711,12 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG Targetable * t = spell ? spell->getNextTarget() : NULL; MTGAbility * a = NEW AADepleter(observer, id, card, t , splitIngest[1], NULL, who, true, colorrepeat, namerepeat); a->oneShot = 1; + if(storedAndAbility.size()) + { + string stored = storedAndAbility; + storedAndAbility.clear(); + ((AADepleter*)a)->andAbility = parseMagicLine(stored, id, spell, card); + } return a; } @@ -4710,6 +4746,12 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG Targetable * t = spell? spell->getNextTarget() : NULL; MTGAbility * a = NEW AAShuffle(observer, id, card, t, NULL, who); a->oneShot = 1; + if(storedAndAbility.size()) + { + string stored = storedAndAbility; + storedAndAbility.clear(); + ((AAShuffle*)a)->andAbility = parseMagicLine(stored, id, spell, card); + } return a; } @@ -5548,6 +5590,12 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG { MTGAbility * a = NEW AAFrozen(observer, id, card, target,false); a->oneShot = 1; + if(storedAndAbility.size()) + { + string stored = storedAndAbility; + storedAndAbility.clear(); + ((AAFrozen*)a)->andAbility = parseMagicLine(stored, id, spell, card); + } return a; } @@ -5557,6 +5605,12 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG { MTGAbility * a = NEW AAFrozen(observer, id, card, target,true); a->oneShot = 1; + if(storedAndAbility.size()) + { + string stored = storedAndAbility; + storedAndAbility.clear(); + ((AAFrozen*)a)->andAbility = parseMagicLine(stored, id, spell, card); + } return a; } @@ -5699,6 +5753,12 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG { MTGAbility * a = NEW AAUntapper(observer, id, card, target); a->oneShot = 1; + if(storedAndAbility.size()) + { + string stored = storedAndAbility; + storedAndAbility.clear(); + ((AAUntapper*)a)->andAbility = parseMagicLine(stored, id, spell, card); + } return a; } @@ -5708,6 +5768,12 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG { MTGAbility * a = NEW AATapper(observer, id, card, target, NULL, bool(s.find("tap(noevent)") != string::npos)); a->oneShot = 1; + if(storedAndAbility.size()) + { + string stored = storedAndAbility; + storedAndAbility.clear(); + ((AATapper*)a)->andAbility = parseMagicLine(stored, id, spell, card); + } return a; }