From 009239d645c81cad0677b6406e57d5af808f7d60 Mon Sep 17 00:00:00 2001 From: "wagic.laurent" Date: Mon, 5 Oct 2009 17:16:56 +0000 Subject: [PATCH] Laurent - Added Shuffle still require testing. Wanted to add a bunch of cards that use "shuffle" as a keyword.. after the remedy from Herr Doktor in R1050 and the removal of oblation from ONS it gave me the idea that this could be implemented... I wanted to add some cards like darksteel collosus (M10) with something like auto=@movedto(this|graveyard) from(battlefield):moveto(mylibrary) && shuffle well the above does not work ... Anyway... i'm not sure the shuffle keyword is working... I don't really have a way to test it. Also if some willing soul could have a quick look would be great.. some cards could be added like Boggart Forager (LRW), Oblation (ONS)... --- projects/mtg/bin/Res/sets/RAV/_cards.dat | 10 ++++++++ projects/mtg/bin/Res/sets/RAV/todo.dat | 9 ------- projects/mtg/include/AllAbilities.h | 30 ++++++++++++++++++++++++ projects/mtg/src/MTGAbility.cpp | 9 +++++++ 4 files changed, 49 insertions(+), 9 deletions(-) diff --git a/projects/mtg/bin/Res/sets/RAV/_cards.dat b/projects/mtg/bin/Res/sets/RAV/_cards.dat index b4a7451d2..e3ddb04fe 100644 --- a/projects/mtg/bin/Res/sets/RAV/_cards.dat +++ b/projects/mtg/bin/Res/sets/RAV/_cards.dat @@ -543,6 +543,16 @@ mana={W}{R} type=Instant [/card] [card] +text=Each player shuffles his or her graveyard into his or her library. +id=88963 +name=Mnemonic Nexus +auto=moveto(opponentlibrary) all(*|opponentgraveyard) && shuffle opponent +auto=moveto(mylibrary) all(*|mygraveyard) && shuffle controller +rarity=U +type=Instant +mana={3}{U} +[/card] +[card] text=Flying. At the beginning of your upkeep, you lose 1 life. auto=@each my upkeep:life:-1 id=83631 diff --git a/projects/mtg/bin/Res/sets/RAV/todo.dat b/projects/mtg/bin/Res/sets/RAV/todo.dat index 92f1d492b..45cd7d98b 100644 --- a/projects/mtg/bin/Res/sets/RAV/todo.dat +++ b/projects/mtg/bin/Res/sets/RAV/todo.dat @@ -1138,15 +1138,6 @@ type=Enchantment mana={4}{R} [/card] [card] -text=Each player shuffles his or her graveyard into his or her library. -id=88963 -name=Mnemonic Nexus -auto=moveto(library) all(*|graveyard) -rarity=U -type=Instant -mana={3}{U} -[/card] -[card] text=Enchant creature Enchanted creature gets +3/+3. Dredge 2 (If you would draw a card, instead you may put exactly two cards from the top of your library into your graveyard. If you do, return this card from your graveyard to your hand. Otherwise, draw a card.) id=89009 name=Moldervine Cloak diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index a7007e654..2bae79a26 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -3787,6 +3787,36 @@ class AADepleter:public ActivatedAbilityTP{ } }; +//Shuffle +class AAShuffle:public ActivatedAbilityTP{ + public: + AAShuffle(int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost=NULL, int _tap = 0, int who = TargetChooser::UNSET):ActivatedAbilityTP(_id,card, _target,_cost,_tap,who){ + } + int resolve(){ + Targetable * _target = getTarget(); + Player * player; + if (_target){ + if (_target->typeAsTarget() == TARGET_CARD){ + player = ((MTGCardInstance *)_target)->controller(); + }else{ + player = (Player *) _target; + } + MTGLibrary * library = player->game->library; + library->shuffle(); + } + return 1; + } + + const char * getMenuText(){ + return "Shuffle"; + } + + AAShuffle * clone() const{ + AAShuffle * a = NEW AAShuffle(*this); + a->isClone = 1; + return a; + } +}; //Random Discard class AARandomDiscarder:public ActivatedAbilityTP{ diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index a58be5bea..3d07276f1 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -501,6 +501,15 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG return a; } + //Shuffle + found = s.find("shuffle"); + if (found != string::npos){ + Targetable * t = NULL; + if (spell) t = spell->getNextPlayerTarget(); + MTGAbility * a = NEW AAShuffle(id,card,t,NULL,0,who); + a->oneShot = 1; + return a; + } /* //CannotBeBlockedBy