diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index 261522a02..cf3f881e9 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -9371,8 +9371,7 @@ toughness=1 [/card] [card] name=Blightsteel Colossus -abilities=trample,indestructible,infect -autograveyard=moveTo(ownerlibrary) && shuffle +abilities=trample,indestructible,infect,shufflelibrarydeath text=Trample,infect -- Blightsteel Colossus is indestructible. -- If Blightsteel Colossus would be put into a graveyard from anywhere, reveal Blightsteel Colossus and shuffle it into its owner's library instead. mana={12} type=Artifact Creature @@ -21047,8 +21046,7 @@ type=Artifact Land [/card] [card] name=Darksteel Colossus -abilities=trample,indestructible -autograveyard=moveTo(ownerlibrary) && shuffle +abilities=trample,indestructible,shufflelibrarydeath text=Trample -- Darksteel Colossus is indestructible. -- If Darksteel Colossus would be put into a graveyard from anywhere, reveal Darksteel Colossus and shuffle it into its owner's library instead. mana={11} type=Artifact Creature @@ -34460,6 +34458,14 @@ mana={1}{U}{U} type=Instant [/card] [card] +name=Forbidden Crypt +abilities=mygraveexiler +auto=replacedraw if type(*|mygraveyard)~morethan~0 then moveto(ownerhand) notatarget(*|mygraveyard) else wingame opponent +text=If you would draw a card, return a card from your graveyard to your hand instead. If you can't, you lose the game. -- If a card would be put into your graveyard from anywhere, exile that card instead. +mana={3}{B}{B} +type=Enchantment +[/card] +[card] name=Forbidden Lore target=land auto=teach(land) {T}:2/1 target(creature) @@ -40038,6 +40044,16 @@ power=6 toughness=6 [/card] [card] +name=Gravebane Zombie +abilities=librarydeath +text=If Gravebane Zombie would be put into a graveyard from the battlefield, put Gravebane Zombie on top of its owner's library instead. +mana={3}{B} +type=Creature +subtype=Zombie +power=3 +toughness=2 +[/card] +[card] name=Gravebind target=creature auto=cantregen @@ -53686,8 +53702,8 @@ toughness=2 [/card] [card] name=Legacy Weapon +abilities=shufflelibrarydeath auto={w}{R}{G}{B}{U}:moveto(exile) target(*|battlefield) -autograveyard=moveTo(ownerlibrary) && shuffle text={w}{R}{G}{B}{U}:Exile target permanent. -- If Legacy Weapon would be put into a graveyard from anywhere, reveal Legacy Weapon and shuffle it into its owner's library instead. type=Legendary Artifact mana={7} @@ -53995,12 +54011,10 @@ abilities=leyline [/card] [card] name=Leyline of the Void -#need to have opponentOwn attribute like auto=lord(*[opponentOwn]) transforms((,newability[exiledeath])) -auto=@movedTo(*|opponentGraveyard):all(trigger[to]) moveTo(exile) +abilities=leyline,oppgraveexiler text=If Leyline of the Void is in your opening hand, you may begin the game with it on the battlefield. -- If a card would be put into an opponent's graveyard from anywhere, exile it instead. mana={2}{B}{B} type=Enchantment -abilities=leyline [/card] [card] name=Leyline Phantom @@ -72202,8 +72216,8 @@ type=Sorcery [/card] [card] name=Progenitus +abilities=shufflelibrarydeath auto=protection from(*) -autograveyard=moveTo(ownerlibrary) && shuffle text=Protection from everything -- If Progenitus would be put into a graveyard from anywhere, reveal Progenitus and shuffle it into its owner's library instead. mana={W}{W}{U}{U}{B}{B}{R}{R}{G}{G} type=Legendary Creature @@ -72584,7 +72598,7 @@ subtype=Arcane [card] name=Pulmonic Sliver auto=lord(sliver) flying -auto=lord(sliver) transforms((,newability[@movedTo(this|graveyard) from(battlefield):all(trigger[to]) moveTo(ownerlibrary)])) +auto=lord(sliver) transforms((,newability[librarydeath])) text=All Sliver creatures have flying. -- All Slivers have "If this permanent would be put into a graveyard, you may put it on top of its owner's library instead." mana={3}{W}{W} type=Creature @@ -76497,6 +76511,14 @@ mana={1}{W} type=Instant [/card] [card] +name=Rest in Peace +abilities=mygraveexiler,oppgraveexiler +auto=moveto(exile) all(*|graveyard) +text=When Rest in Peace enters the battlefield, exile all cards from all graveyards. -- If a card or token would be put into a graveyard from anywhere, exile it instead. +mana={1}{W} +type=Enchantment +[/card] +[card] name=Restless Apparition abilities=persist auto={WB}{WB}{WB}:3/3 @@ -111046,6 +111068,15 @@ power=6 toughness=6 [/card] [card] +name=Yawgmoth's Agenda +abilities=mygraveexiler +auto=lord(*|mygraveyard) canPlayFromGraveyard +auto=maxCast(*)1 +text=You can't cast more than one spell each turn. -- You may play cards from your graveyard. -- If a card would be put into your graveyard from anywhere, exile it instead. +mana={3}{B}{B} +type=Enchantment +[/card] +[card] name=Yawgmoth's Bargain auto=phasealter(remove,draw,controller) auto={L}:draw:1 controller diff --git a/projects/mtg/bin/Res/sets/primitives/unsupported.txt b/projects/mtg/bin/Res/sets/primitives/unsupported.txt index 2700d7866..9b1b81fb3 100644 --- a/projects/mtg/bin/Res/sets/primitives/unsupported.txt +++ b/projects/mtg/bin/Res/sets/primitives/unsupported.txt @@ -5428,12 +5428,6 @@ mana={2}{G} type=Enchantment [/card] [card] -name=Forbidden Crypt -text=If you would draw a card, return a card from your graveyard to your hand instead. If you can't, you lose the game. -- If a card would be put into your graveyard from anywhere, exile that card instead. -mana={3}{B}{B} -type=Enchantment -[/card] -[card] name=Forbidden Ritual text=Sacrifice a nontoken permanent. If you do, target opponent loses 2 life unless he or she sacrifices a permanent or discards a card. You may repeat this process any number of times. mana={2}{B}{B} @@ -6598,15 +6592,6 @@ type=Enchantment subtype=Aura [/card] [card] -name=Gravebane Zombie -text=If Gravebane Zombie would be put into a graveyard from the battlefield, put Gravebane Zombie on top of its owner's library instead. -mana={3}{B} -type=Creature -subtype=Zombie -power=3 -toughness=2 -[/card] -[card] name=Graven Dominator text=Flying -- Haunt (When this card is put into a graveyard from the battlefield, exile it haunting target creature.) -- When Graven Dominator enters the battlefield or the creature it haunts is put into a graveyard, each other creature becomes 1/1 until end of turn. mana={4}{W}{W} @@ -13271,15 +13256,6 @@ mana={1}{U} type=Sorcery [/card] [card] -name=Rest in Peace -#Note this is replacement effect, I think wagic has no override rule. -auto=moveto(exile) all(*|graveyard) -auto=@movedTo(*|graveyard):all(trigger[to]) moveTo(exile) -text=When Rest in Peace enters the battlefield, exile all cards from all graveyards. -- If a card or token would be put into a graveyard from anywhere, exile it instead. -mana={1}{W} -type=Enchantment -[/card] -[card] name=Restless Dreams text=As an additional cost to cast Restless Dreams, discard X cards. -- Return X target creature cards from your graveyard to your hand. mana={B} @@ -18954,12 +18930,6 @@ mana={2}{W} type=Instant [/card] [card] -name=Yawgmoth's Agenda -text=You can't cast more than one spell each turn. -- You may play cards from your graveyard. -- If a card would be put into your graveyard from anywhere, exile it instead. -mana={3}{B}{B} -type=Enchantment -[/card] -[card] name=Ydwen Efreet text=Whenever Ydwen Efreet blocks, flip a coin. If you lose the flip, remove Ydwen Efreet from combat and it can't block this turn. Creatures it was blocking that had become blocked by only Ydwen Efreet this combat become unblocked. mana={R}{R}{R} diff --git a/projects/mtg/include/MTGDefinitions.h b/projects/mtg/include/MTGDefinitions.h index a87e49ef5..79311fc1b 100644 --- a/projects/mtg/include/MTGDefinitions.h +++ b/projects/mtg/include/MTGDefinitions.h @@ -222,7 +222,9 @@ class Constants TOKENIZER = 104, MYGRAVEEXILER = 105, OPPGRAVEEXILER = 106, - NB_BASIC_ABILITIES = 107, + LIBRARYDEATH = 107, + SHUFFLELIBRARYDEATH = 108, + NB_BASIC_ABILITIES = 109, RARITY_S = 'S', //Special Rarity diff --git a/projects/mtg/src/MTGDefinitions.cpp b/projects/mtg/src/MTGDefinitions.cpp index 82ea0ca46..bf2ca0f09 100644 --- a/projects/mtg/src/MTGDefinitions.cpp +++ b/projects/mtg/src/MTGDefinitions.cpp @@ -135,7 +135,9 @@ const char* Constants::MTGBasicAbilities[] = { "canplayfromgraveyard", "tokenizer",//parallel lives, "mygraveexiler", - "oppgraveexiler" + "oppgraveexiler", + "librarydeath", + "shufflelibrarydeath" }; map Constants::MTGBasicAbilitiesMap; diff --git a/projects/mtg/src/MTGGameZones.cpp b/projects/mtg/src/MTGGameZones.cpp index 052d4ec51..d4fd3139a 100644 --- a/projects/mtg/src/MTGGameZones.cpp +++ b/projects/mtg/src/MTGGameZones.cpp @@ -321,6 +321,17 @@ MTGCardInstance * MTGPlayerCards::putInZone(MTGCardInstance * card, MTGGameZone return card; //Error check int doCopy = 1; + bool shufflelibrary = card->basicAbilities[(int)Constants::SHUFFLELIBRARYDEATH]; + //Darksteel Colossus, Legacy Weapon ... top priority since we replace destination directly automatically... + for(int i = 0; i < 2; ++i) + { + if ((to == g->players[i]->game->graveyard) && ( + card->basicAbilities[(int)Constants::LIBRARYDEATH]|| + card->basicAbilities[(int)Constants::SHUFFLELIBRARYDEATH])) + { + to = g->players[i]->game->library; + } + } //Leyline of the Void, Yawgmoth's Agenda... effect... for(int i = 0; i < 2; ++i) { @@ -392,6 +403,9 @@ MTGCardInstance * MTGPlayerCards::putInZone(MTGCardInstance * card, MTGGameZone } if(!asCopy) { + if(shufflelibrary) + copy->owner->game->library->shuffle(); + WEvent * e = NEW WEventZoneChange(copy, from, to); g->receiveEvent(e); }