diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index a197aa5d0..076b0b143 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -27,6 +27,7 @@ counsel_of_the_soratami.txt counterspell.txt counterspell2.txt creature_bond.txt +doomed_necromancer.txt drain_life.txt flare.txt force_of_nature.txt diff --git a/projects/mtg/bin/Res/test/doomed_necromancer.txt b/projects/mtg/bin/Res/test/doomed_necromancer.txt new file mode 100644 index 000000000..4778e98ae --- /dev/null +++ b/projects/mtg/bin/Res/test/doomed_necromancer.txt @@ -0,0 +1,19 @@ +#Testing Doomed Necromancer's ability on a brass man in graveyard +[INIT] +FIRSTMAIN +[PLAYER1] +inplay:129880 +graveyard:1099 +manapool:{B} +[PLAYER2] +[DO] +129880 +1099 +[ASSERT] +FIRSTMAIN +[PLAYER1] +inplay:1099 +graveyard:129880 +manapool:{0} +[PLAYER2] +[END] \ No newline at end of file diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index c64239197..60cf050aa 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -164,7 +164,7 @@ class AZoneMover:public TargetAbility{ public: string destinationZone; - AZoneMover(int _id, MTGCardInstance * _source, TargetChooser * _tc,string destZone, ManaCost * _cost = NULL):TargetAbility(_id,_source, _tc,_cost){ + AZoneMover(int _id, MTGCardInstance * _source, TargetChooser * _tc,string destZone, ManaCost * _cost = NULL, int _tap=0):TargetAbility(_id,_source, _tc,_cost,0,_tap){ destinationZone = destZone; } diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 1b259a14d..8ff97841c 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -150,7 +150,7 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){ if (delimiter!= string::npos){ cost = ManaCost::parseManaCost(line.substr(0,delimiter+1)); } - OutputDebugString("Pqrsing cost\n"); + OutputDebugString("Parsing cost\n"); if (cost && cost->isNull()){ OutputDebugString("Cost is null\n"); SAFE_DELETE(cost); @@ -192,7 +192,7 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){ //Target Abilities found = s.find("target("); if (found != string::npos){ - int end = s.find(")"); + int end = s.find(")", found); string starget = s.substr(found + 7,end - found - 7); TargetChooserFactory tcf; tc = tcf.createTargetChooser(starget, card); @@ -298,7 +298,7 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){ string szone = s.substr(found + 7,end - found - 7); if (tc){ if (cost){ - game->addObserver(NEW AZoneMover(id,card,tc,szone,cost)); + game->addObserver(NEW AZoneMover(id,card,tc,szone,cost,doTap)); } }else{ MTGGameZone * fromZone = target->getCurrentZone();//this is technically incorrect. The initial zone should be as described in the targetchooser