From f45e975b14ebbc8133edebddbf1f2ce8df02f9a4 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Thu, 9 Feb 2017 22:38:00 +0800 Subject: [PATCH] add remake keyword alternative for becomes for use inside transforms... ex. emblem transforms((,newability[target(land) remake(creature:1/2:red)])) forever dontremove --- projects/mtg/bin/Res/sets/primitives/mtg.txt | 12 +++---- projects/mtg/src/MTGAbility.cpp | 36 ++++++++++++++++++++ 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index ce9961562..442b5e983 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -47411,7 +47411,7 @@ toughness=2 [card] name=Goblin Spymaster abilities=first strike -auto=@each opponent end:create(Goblin:Creature Goblin:1/1:red) and!( transforms((,newability[lord(creature|mybattlefield) mustattack])) forever )! opponent +auto=@each opponent end:token(Goblin,Creature Goblin,1/1,red) and!( transforms((,newability[lord(creature|mybattlefield) mustattack])) forever )! opponent text=First strike -- At the beginning of each opponent's end step, that player creates a 1/1 red Goblin creature token with "Creatures you control attack each combat if able." mana={2}{R} type=Creature @@ -49532,8 +49532,9 @@ type=Instant [/card] [card] name=Grip of the Roil +target=creature +auto=freeze auto=draw:1 controller -auto=target(creature) freeze text=Surge {1}{U} (You may cast this spell for its surge cost if you or a teammate has cast another spell this turn.) -- Tap target creature. It doesn't untap during its controller's next untap step. -- Draw a card. mana={2}{U} other={1}{U} name(surge) @@ -65378,7 +65379,7 @@ toughness=7 [card] name=Liege of the Tangle abilities=trample -auto=@combatdamaged(player) from(this):may name(put awakening counters) target(land|mybattlefield) transforms((,newability[counter(0/0.1.Awakening)],newability[this(counter{0/0.1.Awakening}>=1) becomes(Elemental Creature)],newability[this(counter{0/0.1.Awakening}>=1) becomes(,green)],setpower=8,settoughness=8)) forever +auto=@combatdamaged(player) from(this):may name(put awakening counters) target(land|mybattlefield) transforms((,newability[counter(0/0.1.Awakening)],newability[this(counter{0/0.1.Awakening}>=1) remake(Elemental Creature:8/8:green)])) forever text=Trample Whenever Liege of the Tangle deals combat damage to a player, you may choose any number of target lands you control and put an awakening counter on each of them. Each of those lands is an 8/8 green Elemental creature for as long as it has an awakening counter on it. They're still lands. mana={6}{G}{G} type=Creature @@ -114064,10 +114065,7 @@ toughness=6 [card] name=Swarmyard auto={T}:Add{1} -auto={T}:name(insect) regenerate target(insect) -auto={T}:name(rat) regenerate target(rat) -auto={T}:name(spider) regenerate target(spider) -auto={T}:name(squirrel) regenerate target(squirrel) +auto={T}:regenerate target(*[insect;rat;spider;squirrel]) text={T}: Add {1} to your mana pool. -- {T}: Regenerate target Insect, Rat, Spider, or Squirrel. type=Land [/card] diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 6999eb497..f33649b20 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -3546,6 +3546,42 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG return NEW ATransformer(observer, id, card, target, stypes, sabilities,newPower,ptFound,newToughness,ptFound,vector(),false,forceForever,untilYourNextTurn); } + //Remake... (animate artifact...: Remake(Creature: manacost/manacost) - alternative + vector splitRemake = parseBetween(s, "remake(", ")"); + if (splitRemake.size()) + { + vector RemakeParameters = split(splitRemake[1], ':'); + string stypes = RemakeParameters[0]; + string newPower = ""; + string newToughness = ""; + bool ptFound = false; + if(RemakeParameters.size() >1) + { + vector pt = split(RemakeParameters[1], '/'); + if(pt.size() > 1) + { + newPower = pt[0]; + newToughness = pt[1]; + ptFound = true; + } + } + string sabilities = ""; + unsigned int RemakeSize = ptFound?2:1; + if(RemakeParameters.size() > RemakeSize) + { + for(unsigned int i = RemakeSize;i < RemakeParameters.size();i++) + { + sabilities.append(RemakeParameters[i].c_str()); + if(i+1 < RemakeParameters.size()) + sabilities.append(","); + } + } + if (oneShot || forceUEOT || forceForever) + return NEW ATransformerInstant(observer, id, card, target, stypes, sabilities,newPower,ptFound,newToughness,ptFound,vector(),false,forceForever,untilYourNextTurn); + + return NEW ATransformer(observer, id, card, target, stypes, sabilities,newPower,ptFound,newToughness,ptFound,vector(),false,forceForever,untilYourNextTurn); + } + //bloodthirst vector splitBloodthirst = parseBetween(s, "bloodthirst:", " ", false); if (splitBloodthirst.size())