diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index 9344097fc..cb727c025 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -16791,6 +16791,18 @@ mana={1} type=Artifact [/card] [card] +name=Chrome Mox +auto=may imprint notatarget(*[-land;-artifact]|myhand) +auto=this(variable{evictg}>0) {t}:add{g} +auto=this(variable{evictu}>0) {t}:add{u} +auto=this(variable{evictr}>0) {t}:add{r} +auto=this(variable{evictb}>0) {t}:add{b} +auto=this(variable{evictw}>0) {t}:add{w} +text=Imprint - When Chrome Mox enters the battlefield, you may exile a nonartifact, nonland card from your hand. -- {T}: Add one mana of any of the exiled card's colors to your mana pool. +mana={0} +type=Artifact +[/card] +[card] name=Chrome Steed auto=aslongas(artifact|mybattlefield) 2/2 >2 text=Metalcraft - Chrome Steed gets +2/+2 as long as you control three or more artifacts. @@ -17070,6 +17082,16 @@ mana={3}{W} type=Enchantment [/card] [card] +name=Circular Logic +abilities=madness +target=*|stack +auto=if cantargetcard(*|opponentstack) then transforms((,newability[pay[[{value:type:*:opponentgraveyard}]] name(pay {value} mana) donothing?fizzle])) forever else transforms((,newability[pay[[{value:type:*:mygraveyard}]] name(pay {value} mana) donothing?fizzle])) forever +autoexile=restriction{discarded} pay({U}) name(pay U to cast) activate name(pay U to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) +text=Counter target spell unless its controller pays {1} for each card in your graveyard. -- Madness {U} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={2}{U} +type=Instant +[/card] +[card] name=Citadel Castellan abilities=vigilance auto=this(cantargetcard(*[-renown]) transforms((,newability[@combatdamaged(player) from(this):counter(1/1.2) && becomes(renown) forever])) diff --git a/projects/mtg/bin/Res/sets/primitives/unsupported.txt b/projects/mtg/bin/Res/sets/primitives/unsupported.txt index 420132809..efa41df65 100644 --- a/projects/mtg/bin/Res/sets/primitives/unsupported.txt +++ b/projects/mtg/bin/Res/sets/primitives/unsupported.txt @@ -3862,12 +3862,6 @@ power=2 toughness=3 [/card] [card] -name=Circular Logic -text=Counter target spell unless its controller pays {1} for each card in your graveyard. -- Madness {U} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={2}{U} -type=Instant -[/card] -[card] name=City in a Bottle text=Whenever a nontoken permanent from the Arabian Nights expansion other than City in a Bottle is on the battlefield, its controller sacrifices it. -- Players can't play cards from the Arabian Nights expansion. mana={2} diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 8961159be..99aa6f858 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -565,6 +565,26 @@ private: intValue +=1; } } + else if (s == "evictg") + { + intValue = card->imprintG; + } + else if (s == "evictu") + { + intValue = card->imprintU; + } + else if (s == "evictr") + { + intValue = card->imprintR; + } + else if (s == "evictb") + { + intValue = card->imprintB; + } + else if (s == "evictw") + { + intValue = card->imprintW; + } else if (s == "targetedcurses") { if(card->playerTarget) @@ -1963,7 +1983,8 @@ public: string named; bool undying; bool persist; - AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest,string _name, ManaCost * _cost = NULL, bool undying = false, bool persist = false); + bool imprint; + AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest,string _name, ManaCost * _cost = NULL, bool undying = false, bool persist = false, bool imprint = false); MTGGameZone * destinationZone(Targetable * target = NULL); int resolve(); const string getMenuText(); diff --git a/projects/mtg/include/MTGCardInstance.h b/projects/mtg/include/MTGCardInstance.h index bad9b8322..09e36e535 100644 --- a/projects/mtg/include/MTGCardInstance.h +++ b/projects/mtg/include/MTGCardInstance.h @@ -257,6 +257,14 @@ public: int myconvertedcost; ManaCost * computeNewCost(MTGCardInstance * card,ManaCost * oldCost, ManaCost * refCost,bool noTrinisphere = false); int countTrini; + vectorimprintedCards; + int imprintG; + int imprintU; + int imprintR; + int imprintB; + int imprintW; + string currentimprintName; + vectorimprintedNames; void eventattacked(); void eventattackedAlone(); diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index 2c0fe9107..974fc00ec 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -2927,8 +2927,8 @@ AInstantCastRestrictionUEOT::~AInstantCastRestrictionUEOT() //AAMover -AAMover::AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest,string newName, ManaCost * _cost, bool undying, bool persist) : - ActivatedAbility(observer, _id, _source, _cost, 0), destination(dest),named(newName),undying(undying),persist(persist) +AAMover::AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest,string newName, ManaCost * _cost, bool undying, bool persist, bool imprint) : + ActivatedAbility(observer, _id, _source, _cost, 0), destination(dest),named(newName),undying(undying),persist(persist),imprint(imprint) { if (_target) target = _target; @@ -2986,6 +2986,8 @@ int AAMover::resolve() p->game->putInZone(_target, fromZone, destZone); while(_target->next) _target = _target->next; + if (imprint) + source->imprintedCards.push_back(_target); if(andAbility) { MTGAbility * andAbilityClone = andAbility->clone(); @@ -3062,6 +3064,8 @@ const char* AAMover::getMenuText(TargetChooser * tc) // move card into exile else if (dest == game->players[i]->game->exile) { + if(imprint) + return "Imprint"; return "Exile"; } diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index 92d0fbf7b..1ceca665d 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -687,6 +687,46 @@ void GameObserver::gameStateBasedEffects() card->myPair->myPair = NULL; card->myPair = NULL; } + ///clear imprints + if(isInPlay(card) && card->imprintedCards.size()) + { + for(size_t ic = 0; ic < card->imprintedCards.size(); ic++) + { + if(!isInExile(card->imprintedCards[ic])) + card->imprintedCards.erase(card->imprintedCards.begin() + ic); + } + } + //reset imprints + if(isInPlay(card)) + { + card->imprintG = 0; + card->imprintU = 0; + card->imprintR = 0; + card->imprintB = 0; + card->imprintW = 0; + card->currentimprintName = ""; + if (card->imprintedCards.size()) + { + for(size_t i = 0; i < card->imprintedCards.size(); i++) + { + if (card->imprintedCards[i]->hasColor(Constants::MTG_COLOR_GREEN)) + card->imprintG += 1; + if (card->imprintedCards[i]->hasColor(Constants::MTG_COLOR_BLUE)) + card->imprintU += 1; + if (card->imprintedCards[i]->hasColor(Constants::MTG_COLOR_RED)) + card->imprintR += 1; + if (card->imprintedCards[i]->hasColor(Constants::MTG_COLOR_BLACK)) + card->imprintB += 1; + if (card->imprintedCards[i]->hasColor(Constants::MTG_COLOR_WHITE)) + card->imprintW += 1; + if (card->imprintedCards[i]->getName().size()) + { + card->currentimprintName = card->imprintedCards[i]->getName(); + card->imprintedNames.push_back(card->imprintedCards[i]->getName()); + } + } + } + } card->bypassTC = false; //turn off bypass //////////////////////////////////////////////////// //Unattach Equipments that dont have valid targets// diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 8b618683d..d4bfefcc1 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -2361,6 +2361,15 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG } //imprint + found = s.find("imprint"); + if (found != string::npos) + { + MTGAbility * a = NEW AAMover(observer, id, card, target, "exile",newName,NULL,false,false,true); + a->oneShot = 1; + return a; + } + + //phaseout found = s.find("phaseout"); if (found != string::npos) { diff --git a/projects/mtg/src/MTGCardInstance.cpp b/projects/mtg/src/MTGCardInstance.cpp index af2913ebb..a4c4a2554 100644 --- a/projects/mtg/src/MTGCardInstance.cpp +++ b/projects/mtg/src/MTGCardInstance.cpp @@ -206,6 +206,14 @@ void MTGCardInstance::initMTGCI() myPair = NULL; miracle = false; countTrini = 0; + imprintedCards.clear(); + imprintG = 0; + imprintU = 0; + imprintR = 0; + imprintB = 0; + imprintW = 0; + currentimprintName = ""; + imprintedNames.clear(); for (int i = 0; i < ManaCost::MANA_PAID_WITH_SUSPEND +1; i++) alternateCostPaid[i] = 0;