From 348ada3f0d7e2d44c46bca70e7df9997780b92c6 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Sun, 29 Jan 2017 16:09:49 +0800 Subject: [PATCH] revised aacopier I think we still need to change legend to a trigger once it detects multiple legends in play then trigger it at once with targetchooser to select which cards to sacrifice as state based... vector of unique names or id or mtgcardinstance? --- projects/mtg/bin/Res/sets/primitives/mtg.txt | 19 ++++++++++++------- projects/mtg/src/AllAbilities.cpp | 18 +----------------- projects/mtg/src/MTGAbility.cpp | 7 +++++++ 3 files changed, 20 insertions(+), 24 deletions(-) diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index 5568eb5a0..d0df067b8 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -36781,7 +36781,8 @@ subtype=Aura [/card] [card] name=Evil Twin -auto=may copy NotATarget(creature) and!( transforms((,newability[{U}{B}{T}:destroy target(creature[share!name!])])) forever )! +auto=may copy NotATarget(creature) +auto=while(restriction{copiedacard}) transforms((,newability[{U}{B}{T}:destroy target(creature[share!name!])])) forever text=You may have Evil Twin enter the battlefield as a copy of any creature on the battlefield except it gains "{U}{B}, {T}: Destroy target creature with the same name as this creature." mana={2}{U}{B} type=Creature @@ -45551,7 +45552,8 @@ toughness=1 [/card] [card] name=Gigantoplasm -auto=may copy NotATarget(creature) and!( {X}:name(Base X) transforms((,setpower=X,settoughness=X)) ueot )! +auto=may copy NotATarget(creature) +auto=while(restriction{copiedacard}) {X}:name(Base X) transforms((,setpower=X,settoughness=X)) ueot text=You may have Gigantoplasm enter the battlefield as a copy of any creature on the battlefield except it gains "{X}: This creature has base power and toughness X/X." mana={3}{U} type=Creature @@ -71283,7 +71285,8 @@ toughness=2 [/card] [card] name=Mercurial Pretender -auto=may copy NotATarget(creature) and!( transforms((,newability[{2}{U}{U}:moveto(ownerhand)])) forever )! +auto=may copy NotATarget(creature) +auto=while(restriction{copiedacard}) transforms((,newability[{2}{U}{U}:moveto(ownerhand)])) forever text=You may have Mercurial Pretender enter the battlefield as a copy of any creature you control except it gains "{2}{U}{U}: Return this creature to its owner's hand." mana={4}{U} type=Creature @@ -83959,8 +83962,8 @@ toughness=1 [/card] [card] name=Phantasmal Image -auto=may copy NotATarget(creature) and!( transforms((Illusion)) forever )! -auto=@targeted(this):sacrifice +auto=may copy NotATarget(creature) +auto=while(restriction{copiedacard}) transforms((Illusion,newability[@targeted(this):sacrifice])) forever text=You may have Phantasmal Image enter the battlefield as a copy of any creature on the battlefield, except it's an Illusion in addition to its other types and it gains "When this creature becomes the target of a spell or ability, sacrifice it." mana={1}{U} type=Creature @@ -87229,7 +87232,8 @@ type=Sorcery [/card] [card] name=Progenitor Mimic -auto=may copy NotATarget(creature) and!( transforms((,newability[@each my upkeep:all(this) ifnot cantargetcard(*[token]) then clone])) forever )! +auto=may copy NotATarget(creature) +auto=while(restriction{copiedacard}) transforms((,newability[@each my upkeep:all(this) ifnot cantargetcard(*[token]) then clone])) forever text=You may have Progenitor Mimic enter the battlefield as a copy of any creature on the battlefield except it gains "At the beginning of your upkeep, if this creature isn't a token, put a token onto the battlefield that's a copy of this creature." mana={4}{G}{U} type=Creature @@ -125696,7 +125700,8 @@ toughness=4 [/card] [card] name=Vesuva -auto=may copy notatarget(land) and!( tap(noevent) )! +auto=may copy notatarget(land) +auto=while(restriction{copiedacard}) tap(noevent) text=You may have Vesuva enter the battlefield tapped as a copy of any land on the battlefield. type=Land [/card] diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index b1848ab5e..424f3776c 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -1592,9 +1592,8 @@ int AACopier::resolve() source->basicAbilities.reset(); source->getManaCost()->resetCosts(); } - //todo andAbility and tokenandAbility if(_target->TokenAndAbility) - {//the source copied a token with andAbility + {//the source copied a token with tokenandAbility MTGAbility * TokenandAbilityClone = _target->TokenAndAbility->clone(); TokenandAbilityClone->target = source; if(_target->TokenAndAbility->oneShot) @@ -1606,22 +1605,7 @@ int AACopier::resolve() { TokenandAbilityClone->addToGame(); } - }/* - if(andAbility) - { - MTGAbility * andAbilityClone = andAbility->clone(); - andAbilityClone->target = source; - if(andAbility->oneShot) - { - andAbilityClone->resolve(); - SAFE_DELETE(andAbilityClone); - } - else - { - andAbilityClone->addToGame(); - } } - */ return 1; } return 0; diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 7182617f1..2e8095bd6 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -537,6 +537,13 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe return 0; } + check = restriction[i].find("copiedacard"); + if(check != string::npos) + { + if(!card->isACopier) + return 0; + } + check = restriction[i].find("geared"); if (check != string::npos) {