diff --git a/projects/mtg/bin/Res/sets/TSP/_cards.dat b/projects/mtg/bin/Res/sets/TSP/_cards.dat index 632dc47ed..2330dbe97 100644 --- a/projects/mtg/bin/Res/sets/TSP/_cards.dat +++ b/projects/mtg/bin/Res/sets/TSP/_cards.dat @@ -359,6 +359,18 @@ text=B rarity=C [/card] [card] +id=111085 +name=Telekinetic Sliver +mana={2}{U}{U} +type=Creature +subtype=Sliver +power=2 +toughness=2 +text=All Slivers have "{T}: Tap target permanent." +auto=lord(sliver) {T}:tap target(*) +rarity=U +[/card] +[card] id=118887 name=Temporal Eddy mana={2}{U}{U} diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index f3d985765..0edfeea99 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -134,6 +134,7 @@ stasis.txt steelclad_serpent1.txt steelclad_serpent2.txt sword_to_plowshares.txt +telekinetic_sliver.txt terror.txt titanic_ultimatum.txt tranquil_domain.txt @@ -148,4 +149,4 @@ zombify.txt #Momir Basic Tests ######################## momir/keldon_warlord.txt -momir/overcost.txt \ No newline at end of file +momir/overcost.txt diff --git a/projects/mtg/bin/Res/test/telekinetic_sliver.txt b/projects/mtg/bin/Res/test/telekinetic_sliver.txt new file mode 100644 index 000000000..5b8f7bf66 --- /dev/null +++ b/projects/mtg/bin/Res/test/telekinetic_sliver.txt @@ -0,0 +1,28 @@ +#Testing Telekinetic sliver +# text=All Slivers have "{T}: Tap target permanent." +[INIT] +FIRSTMAIN +[PLAYER1] +inplay:Telekinetic Sliver,Metallic sliver,grizzly bears +[PLAYER2] +[DO] +Metallic sliver +grizzly bears +next +#combat begins +next +#attackers +grizzly bears +next +#blockers +next +#damage +next +#combat ends +[ASSERT] +COMBATEND +[PLAYER1] +inplay:Telekinetic Sliver,Metallic sliver,grizzly bears +[PLAYER2] +life:20 +[END] \ No newline at end of file diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index f1caf02e4..53e5b2bbe 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -113,9 +113,9 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG int doTap = 0; //Tap in the cost ? if (s.find("{t}") != string::npos) doTap = 1; - unsigned int delimiter = s.find("}:"); - - if (delimiter!= string::npos && s[0]=='{'){ + size_t delimiter = s.find("}:"); + size_t firstNonSpace = s.find_first_not_of(" "); + if (delimiter!= string::npos && firstNonSpace !=string::npos && s[firstNonSpace] == '{'){ ManaCost * cost = ManaCost::parseManaCost(s.substr(0,delimiter+1),NULL,card); if (doTap || (cost && !cost->isNull())){ string s1 = s.substr(delimiter+2); @@ -1973,7 +1973,9 @@ MTGAbility::MTGAbility(int id, MTGCardInstance * _source,Targetable * _target ): } MTGAbility::~MTGAbility(){ - SAFE_DELETE(cost); + if (!isClone){ + SAFE_DELETE(cost); + } } int MTGAbility::addToGame(){