From 8c47b666c507b616f035ecbb0983e7d140bb6fa7 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Wed, 8 Jun 2016 10:45:19 +0800 Subject: [PATCH] Madness Added Madness --- .../bin/Res/sets/primitives/borderline.txt | 151 ---------------- projects/mtg/bin/Res/sets/primitives/mtg.txt | 162 ++++++++++++++++++ projects/mtg/src/AllAbilities.cpp | 10 ++ 3 files changed, 172 insertions(+), 151 deletions(-) diff --git a/projects/mtg/bin/Res/sets/primitives/borderline.txt b/projects/mtg/bin/Res/sets/primitives/borderline.txt index 9d8f5a066..8f95f9539 100644 --- a/projects/mtg/bin/Res/sets/primitives/borderline.txt +++ b/projects/mtg/bin/Res/sets/primitives/borderline.txt @@ -1,16 +1,5 @@ grade=borderline [card] -name=Arrogant Wurm -abilities=trample,madness -autoexile=restriction{discarded} pay({2}{G}) name(pay 2G to cast) activate name(pay 2G to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) -text=Trample -- Madness {2}{G} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={3}{G}{G} -type=Creature -subtype=Wurm -power=4 -toughness=4 -[/card] -[card] name=Autumn Willow abilities=opponentshroud,shroud auto={G}:-shroud @@ -35,40 +24,6 @@ power=2 toughness=2 [/card] [card] -name=Basking Rootwalla -abilities=madness -autoexile=restriction{discarded} pay({0}) name(pay 0 to cast) activate name(pay 0 to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) -auto={1}{G}:2/2 limit:1 -text={1}{G}: Basking Rootwalla gets +2/+2 until end of turn. Activate this ability only once each turn. -- Madness {0} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={G} -type=Creature -subtype=Lizard -power=1 -toughness=1 -[/card] -[card] -name=Big Game Hunter -abilities=madness -autoexile=restriction{discarded} pay({B}) name(pay B to cast) activate name(pay B to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) -auto=bury target(creature[power>=4]) -text=When Big Game Hunter enters the battlefield, destroy target creature with power 4 or greater. It can't be regenerated. -- Madness {B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={1}{B}{B} -type=Creature -subtype=Human Rebel Assassin -power=1 -toughness=1 -[/card] -[card] -name=Call to the Netherworld -abilities=madness -autoexile=restriction{discarded} pay({0}) name(pay 0 to cast) activate name(pay 0 to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) -target=creature[black]|myGraveyard -auto=moveTo(myHand) -text=Return target black creature card from your graveyard to your hand. -- Madness {0} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={B} -type=Sorcery -[/card] -[card] name=Cemetery Puca text=Whenever a creature is put into a graveyard from the battlefield, you may pay {1}. If you do, Cemetery Puca becomes a copy of that creature and gains this ability. auto=@movedto(creature|graveyard) from(battlefield):all(trigger[from]) pay[[{1}]] copy @@ -109,16 +64,6 @@ power=2 toughness=2 [/card] [card] -name=Dark Withering -abilities=madness -autoexile=restriction{discarded} pay({B}) name(pay B to cast) activate name(pay B to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) -target=creature[-black] -auto=destroy -text=Destroy target nonblack creature. -- Madness {B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={4}{B}{B} -type=Instant -[/card] -[card] name=Dimir Doppelganger auto={1}{U}{B}:target(creature|graveyard) moveto(exile) and!(copy)! text={1}{U}{B}: Exile target creature card from a graveyard. Dimir Doppelganger becomes a copy of that card and gains this ability. @@ -164,26 +109,6 @@ auto={3}:counter(1/1) #Not all player can use ability [/card] [card] -name=Fiery Temper -abilities=madness -autoexile=restriction{discarded} pay({R}) name(pay R to cast) activate name(pay R to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) -target=creature,player -auto=damage:3 -text=Fiery Temper deals 3 damage to target creature or player. -- Madness {R} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={1}{R}{R} -type=Instant -[/card] -[card] -name=Frantic Purification -abilities=madness -autoexile=restriction{discarded} pay({W}) name(pay W to cast) activate name(pay W to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) -target=enchantment -auto=destroy -text=Destroy target enchantment. -- Madness {W} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={2}{W} -type=Instant -[/card] -[card] name=Ghastly Remains auto=foreach(zombie|myhand) counter(1/1,1) autograveyard={B}{B}{B}:moveTo(myhand) myUpkeepOnly @@ -205,18 +130,6 @@ power=4 toughness=4 [/card] [card] -name=Gorgon Recluse -abilities=madness -autoexile=restriction{discarded} pay({B}{B}) name(pay BB to cast) activate name(pay BB to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) -auto=@combat(blocked,blocking) source(this) from(creature):all(trigger[from]) phaseaction[combatends once] destroy -text=Whenever Gorgon Recluse blocks or becomes blocked by a nonblack creature, destroy that creature at end of combat. -- Madness {B}{B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={3}{B}{B} -type=Creature -subtype=Gorgon -power=2 -toughness=4 -[/card] -[card] name=Govern the Guildless target=creature[-multicolor] auto=moveto(mybattlefield) @@ -226,17 +139,6 @@ mana={5}{U} type=Sorcery [/card] [card] -name=Ichor Slick -abilities=madness -autoexile=restriction{discarded} pay({3}{B}) name(pay 3B to cast) activate name(pay 3B to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) -target=creature -auto=-3/-3 -autohand=__CYCLING__({2}) -text=Target creature gets -3/-3 until end of turn. -- Cycling {2} ({2}, Discard this card: Draw a card.) -- Madness {3}{B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={2}{B} -type=Sorcery -[/card] -[card] name=Ivy Seer auto={2}{G}{T}:foreach(*[green]|myhand) 1/1 target(creature) text={2}{G}, {T}: Reveal any number of green cards in your hand. Target creature gets +X/+X until end of turn, where X is the number of cards revealed this way. @@ -308,15 +210,6 @@ type=Sorcery text=Put a 1/1 white Kor Soldier creature token onto the battlefield for each creature you control. Rebound (If you cast this spell from your hand, exile it as it resolves. At the beginning of your next upkeep, you may cast this card from exile without paying its mana cost.) [/card] [card] -name=Obsessive Search -abilities=madness -autoexile=restriction{discarded} pay({U}) name(pay U to cast) activate name(pay U to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) -auto=draw:1 controller -text=Draw a card. -- Madness {U} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={U} -type=Instant -[/card] -[card] name=Ogre Marauder text=Whenever Ogre Marauder attacks, it gains "Ogre Marauder can't be blocked" until end of turn unless defending player sacrifices a creature. auto=@combat(attacking) source(this):ability$!name(choose one) if type(creature|mybattlefield)~morethan~0 then choice sacrifice notatarget(creature|mybattlefield) _ choice all(mystored) unblockable ueot!$ opponent @@ -336,15 +229,6 @@ type=Instant text=Target creature gets +2/+2 until end of turn. Rebound (If you cast this spell from your hand, exile it as it resolves. At the beginning of your next upkeep, you may cast this card from exile without paying its mana cost.) [/card] [card] -name=Psychotic Haze -abilities=madness -autoexile=restriction{discarded} pay({1}{B}) name(pay 1B to cast) activate name(pay 1B to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) -auto=damage:1 all(creature,player) -text=Psychotic Haze deals 1 damage to each creature and each player. -- Madness {1}{B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={2}{B}{B} -type=Instant -[/card] -[card] name=Rakdos Augermage abilities=first strike auto={T}:name(target opponent) target(opponent) donothing && all(this) transforms((,newability[ability$!name(discard) reject notatarget(*|opponenthand)!$ targetedplayer && ability$!name(discard) reject notatarget(*|opponenthand)!$ controller])) assorcery @@ -364,17 +248,6 @@ mana={X}{X}{U} type=Sorcery [/card] [card] -name=Reckless Wurm -abilities=trample,madness -autoexile=restriction{discarded} pay({2}{R}) name(pay 2R to cast) activate name(pay 2R to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) -text=Trample -- Madness {2}{R} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={3}{R}{R} -type=Creature -subtype=Wurm -power=4 -toughness=4 -[/card] -[card] name=Recurring Insight target=opponent auto=draw:type:*:targetedpersonshand controller @@ -451,30 +324,6 @@ type=Instant text=Staggershock deals 2 damage to target creature or player. Rebound (If you cast this spell from your hand, exile it as it resolves. At the beginning of your next upkeep, you may cast this card from exile without paying its mana cost.) [/card] [card] -name=Strength of Isolation -abilities=madness -autoexile=restriction{discarded} pay({W}) name(pay W to cast) activate name(pay W to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) -target=creature -auto=1/2 -auto=protection from black -text=Enchant creature -- Enchanted creature gets +1/+2 and has protection from black. -- Madness {W} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={1}{W} -type=Enchantment -subtype=Aura -[/card] -[card] -name=Strength of Lunacy -abilities=madness -autoexile=restriction{discarded} pay({B}) name(pay B to cast) activate name(pay B to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) -target=creature -auto=2/1 -auto=protection from white -text=Enchant creature -- Enchanted creature gets +2/+1 and has protection from white. -- Madness {B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={1}{B} -type=Enchantment -subtype=Aura -[/card] -[card] name=Surreal Memoir auto=moverandom(instant) from(mygraveyard) to(myhand) auto=if rebound then transforms((,newability[moveto(exile)],newability[phaseaction[my upkeep once checkex] activate may activate castcard(restricted)])) diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index 41bf2db05..9344097fc 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -5122,6 +5122,17 @@ power=4 toughness=3 [/card] [card] +name=Arrogant Wurm +abilities=trample,madness +autoexile=restriction{discarded} pay({2}{G}) name(pay 2G to cast) activate name(pay 2G to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) +text=Trample -- Madness {2}{G} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={3}{G}{G} +type=Creature +subtype=Wurm +power=4 +toughness=4 +[/card] +[card] name=Arrows of Justice target=creature[attacking;blocking] auto=damage:4 @@ -7900,6 +7911,18 @@ type=Artifact subtype=Equipment [/card] [card] +name=Basking Rootwalla +abilities=madness +autoexile=restriction{discarded} pay({0}) name(pay 0 to cast) activate name(pay 0 to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) +auto={1}{G}:2/2 limit:1 +text={1}{G}: Basking Rootwalla gets +2/+2 until end of turn. Activate this ability only once each turn. -- Madness {0} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={G} +type=Creature +subtype=Lizard +power=1 +toughness=1 +[/card] +[card] name=Bassara Tower Archer abilities=opponentshroud,reach text=Hexproof, reach @@ -9002,6 +9025,18 @@ mana={3}{G} type=Sorcery [/card] [card] +name=Big Game Hunter +abilities=madness +autoexile=restriction{discarded} pay({B}) name(pay B to cast) activate name(pay B to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) +auto=bury target(creature[power>=4]) +text=When Big Game Hunter enters the battlefield, destroy target creature with power 4 or greater. It can't be regenerated. -- Madness {B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={1}{B}{B} +type=Creature +subtype=Human Rebel Assassin +power=1 +toughness=1 +[/card] +[card] name=Bile Blight target=creature auto=transforms((,newability[all(*[share!name!]) -3/-3])) ueot @@ -14037,6 +14072,16 @@ subtype=Human power=* toughness=* [/card] +[card] +name=Call to the Netherworld +abilities=madness +autoexile=restriction{discarded} pay({0}) name(pay 0 to cast) activate name(pay 0 to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) +target=creature[black]|myGraveyard +auto=moveTo(myHand) +text=Return target black creature card from your graveyard to your hand. -- Madness {0} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={B} +type=Sorcery +[/card] ###The 2 cards below should stay together (Flip Card)### [card] name=Callow Jushi @@ -21908,6 +21953,16 @@ mana={2}{R} type=Instant [/card] [card] +name=Dark Withering +abilities=madness +autoexile=restriction{discarded} pay({B}) name(pay B to cast) activate name(pay B to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) +target=creature[-black] +auto=destroy +text=Destroy target nonblack creature. -- Madness {B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={4}{B}{B} +type=Instant +[/card] +[card] name=Darkest Hour auto=lord(creature) transforms((,black)) text=All creatures are black. @@ -34020,6 +34075,16 @@ type=Enchantment subtype=Aura [/card] [card] +name=Fiery Temper +abilities=madness +autoexile=restriction{discarded} pay({R}) name(pay R to cast) activate name(pay R to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) +target=creature,player +auto=damage:3 +text=Fiery Temper deals 3 damage to target creature or player. -- Madness {R} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={1}{R}{R} +type=Instant +[/card] +[card] name=Fight to the Death auto=destroy all(creature[blocking;blocked]) text=Destroy all blocking creatures and all blocked creatures. @@ -36577,6 +36642,16 @@ mana={2}{GW}{GW}{GW} type=Instant [/card] [card] +name=Frantic Purification +abilities=madness +autoexile=restriction{discarded} pay({W}) name(pay W to cast) activate name(pay W to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) +target=enchantment +auto=destroy +text=Destroy target enchantment. -- Madness {W} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={2}{W} +type=Instant +[/card] +[card] name=Frantic Salvage target=artifact|mygraveyard auto=moveTo(mylibrary) @@ -41496,6 +41571,18 @@ type=Artifact subtype=Equipment [/card] [card] +name=Gorgon Recluse +abilities=madness +autoexile=restriction{discarded} pay({B}{B}) name(pay BB to cast) activate name(pay BB to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) +auto=@combat(blocked,blocking) source(this) from(creature):all(trigger[from]) phaseaction[combatends once] destroy +text=Whenever Gorgon Recluse blocks or becomes blocked by a nonblack creature, destroy that creature at end of combat. -- Madness {B}{B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={3}{B}{B} +type=Creature +subtype=Gorgon +power=2 +toughness=4 +[/card] +[card] name=Gorilla Chieftain auto={1}{G}:regenerate text={1}{G}: Regenerate Gorilla Chieftain. @@ -48054,6 +48141,17 @@ power=2 toughness=1 [/card] [card] +name=Ichor Slick +abilities=madness +autoexile=restriction{discarded} pay({3}{B}) name(pay 3B to cast) activate name(pay 3B to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) +target=creature +auto=-3/-3 +autohand=__CYCLING__({2}) +text=Target creature gets -3/-3 until end of turn. -- Cycling {2} ({2}, Discard this card: Draw a card.) -- Madness {3}{B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={2}{B} +type=Sorcery +[/card] +[card] name=Ichor Wellspring auto=draw:1 auto=@movedTo(this|graveyard) from(battlefield):draw:1 controller @@ -65596,6 +65694,17 @@ power=2 toughness=2 [/card] [card] +name=Mycosynth Golem +abilities=affinityartifacts +auto=lord(creature[artifact]|myhand,mylibrary,mygraveyard,myexile) affinityartifacts forcedalive +text=Affinity for artifacts (This spell costs {1} less to cast for each artifact you control.) -- Artifact creature spells you cast have affinity for artifacts. (They cost {1} less to cast for each artifact you control.) +mana={11} +type=Artifact Creature +subtype=Golem +power=4 +toughness=5 +[/card] +[card] name=Mycosynth Wellspring auto=may moveTo(myhand) notatarget(land[basic]|mylibrary) auto=@movedTo(this|graveyard) from(battlefield):may moveTo(myhand) notatarget(land[basic]|mylibrary) @@ -68955,6 +69064,15 @@ text={T}: Add {U} to your mana pool. -- {1}: Return Oboro, Palace in the Clouds type=Legendary Land [/card] [card] +name=Obsessive Search +abilities=madness +autoexile=restriction{discarded} pay({U}) name(pay U to cast) activate name(pay U to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) +auto=draw:1 controller +text=Draw a card. -- Madness {U} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={U} +type=Instant +[/card] +[card] name=Obsianus Golem mana={6} type=Artifact Creature @@ -75746,6 +75864,15 @@ mana={1}{R} type=Instant [/card] [card] +name=Psychotic Haze +abilities=madness +autoexile=restriction{discarded} pay({1}{B}) name(pay 1B to cast) activate name(pay 1B to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) +auto=damage:1 all(creature,player) +text=Psychotic Haze deals 1 damage to each creature and each player. -- Madness {1}{B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={2}{B}{B} +type=Instant +[/card] +[card] name=Psychotrope Thallid text=At the beginning of your upkeep, put a spore counter on Psychotrope Thallid. -- Remove three spore counters from Psychotrope Thallid: Put a 1/1 green Saproling creature token onto the battlefield. -- {1}, Sacrifice a Saproling: Draw a card. mana={2}{G} @@ -78865,6 +78992,17 @@ toughness=2 [/card] ###The 2 cards above should stay together (Flip Card)### [card] +name=Reckless Wurm +abilities=trample,madness +autoexile=restriction{discarded} pay({2}{R}) name(pay 2R to cast) activate name(pay 2R to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) +text=Trample -- Madness {2}{R} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={3}{R}{R} +type=Creature +subtype=Wurm +power=4 +toughness=4 +[/card] +[card] name=Reclaim target=*|mygraveyard auto=moveTo(myLibrary) @@ -97406,6 +97544,30 @@ type=Instant subtype=Arcane [/card] [card] +name=Strength of Isolation +abilities=madness +autoexile=restriction{discarded} pay({W}) name(pay W to cast) activate name(pay W to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) +target=creature +auto=1/2 +auto=protection from black +text=Enchant creature -- Enchanted creature gets +1/+2 and has protection from black. -- Madness {W} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={1}{W} +type=Enchantment +subtype=Aura +[/card] +[card] +name=Strength of Lunacy +abilities=madness +autoexile=restriction{discarded} pay({B}) name(pay B to cast) activate name(pay B to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) +target=creature +auto=2/1 +auto=protection from white +text=Enchant creature -- Enchanted creature gets +2/+1 and has protection from white. -- Madness {B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={1}{B} +type=Enchantment +subtype=Aura +[/card] +[card] name=Strength of Night kicker={B} auto=all(creature|myBattlefield) 1/1 ueot diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index 510ebf25b..2c0fe9107 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -1312,6 +1312,16 @@ int GenericPaidAbility::resolve() optionalCost->extraCosts->costs[i]->setSource(((MTGCardInstance *)target)); } } + if (source && source->previous && source->basicAbilities[(int)Constants::MADNESS]) + { + must = true; + optionalCost = source->computeNewCost(source->previous,optionalCost,optionalCost); + if(optionalCost->extraCosts) + { + for(unsigned int i = 0; i < optionalCost->extraCosts->costs.size();i++) + optionalCost->extraCosts->costs[i]->setSource(source); + } + } if(asAlternate && nomenu && optionalCost->getConvertedCost() < 1) nomenuAbility->resolve(); else