diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index 1fff3dc66..5a421a7d7 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -161,6 +161,7 @@ royal_assassin.txt safehold_duo.txt sedge_sliver.txt seismic_assault.txt +selesnya_guildmage.txt siege_gang_commander.txt shepherd_of_rot.txt shivan_hellkite.txt diff --git a/projects/mtg/bin/Res/test/selesnya_guildmage.txt b/projects/mtg/bin/Res/test/selesnya_guildmage.txt new file mode 100644 index 000000000..83d61f76a --- /dev/null +++ b/projects/mtg/bin/Res/test/selesnya_guildmage.txt @@ -0,0 +1,38 @@ +#Bug: Selesnya guildmage's ability doesn't wear off at the end of turn +# {3}{W}: creatures you control gain +1/+1 until end of turn +[INIT] +FIRSTMAIN +[PLAYER1] +inplay:selesnya guildmage,grizzly bears +manapool:{3}{W} +[PLAYER2] +inplay:mountain +hand:shock +[DO] +selesnya guildmage +next +#combat begins +next +#attackers +grizzly bears +eot +#untap +next +#upkeep +next +#draw +next +#main +mountain +shock +grizzly bears +[ASSERT] +FIRSTMAIN +[PLAYER1] +inplay:selesnya guildmage +graveyard:grizzly bears +[PLAYER2] +inplay:mountain +graveyard:shock +life:17 +[END] \ No newline at end of file diff --git a/projects/mtg/include/MTGAbility.h b/projects/mtg/include/MTGAbility.h index 0ecbdc4bc..5efd20acc 100644 --- a/projects/mtg/include/MTGAbility.h +++ b/projects/mtg/include/MTGAbility.h @@ -202,7 +202,7 @@ class AbilityFactory{ int countCards(TargetChooser * tc, Player * player = NULL, int option = 0); int parsePowerToughness(string s, int *power, int *toughness); TriggeredAbility * parseTrigger(string s, int id, Spell * spell, MTGCardInstance *card, Targetable * target); - MTGAbility * parseMagicLine(string s, int id, Spell * spell, MTGCardInstance *card, int activated = 0); + MTGAbility * parseMagicLine(string s, int id, Spell * spell, MTGCardInstance *card, int activated = 0, int forceUEOT = 0); public: int abilityEfficiency(MTGAbility * a, Player * p, int mode = MODE_ABILITY); int magicText(int id, Spell * spell, MTGCardInstance * card = NULL); diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 5acdc0950..4260bf62f 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -131,7 +131,7 @@ TriggeredAbility * AbilityFactory::parseTrigger(string magicText, int id, Spell //Parses a string and returns the corresponding MTGAbility object // Returns NULL if parsing failed -MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTGCardInstance *card, int activated){ +MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTGCardInstance *card, int activated, int forceUEOT){ size_t found; string whitespaces (" \t\f\v\n\r"); @@ -259,13 +259,14 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG TargetChooser * lordTargets = tcf.createTargetChooser(lordTargetsString, card); - MTGAbility * a = parseMagicLine(s1,id,spell, card); + MTGAbility * a = parseMagicLine(s1,id,spell, card,0,activated); //activated lords usually force an end of turn ability if (!a){ SAFE_DELETE(lordTargets); return NULL; } MTGAbility * result = NULL; int oneShot = 0; + if (activated) oneShot = 1; if (card->hasType("sorcery") || card->hasType("instant")) oneShot = 1; if (i == 3) oneShot = 1; if (a->oneShot) oneShot = 1; @@ -545,7 +546,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG return NULL; } - int forceUEOT = 0; + found = s.find("ueot"); if (found!= string::npos) forceUEOT = 1;