From fe6ec307d9f76221948eecdfe3cc70c11c26b395 Mon Sep 17 00:00:00 2001 From: "wagic.the.homebrew@gmail.com" Date: Sun, 17 Jan 2010 10:34:36 +0000 Subject: [PATCH] Erwan -fix issue 300 (silver seraph) --- projects/mtg/bin/Res/sets/JUD/_cards.dat | 2 +- projects/mtg/bin/Res/test/_tests.txt | 1 + .../mtg/bin/Res/test/silver_seraph_i300.txt | 31 +++++++++++++++++++ projects/mtg/src/MTGAbility.cpp | 5 ++- 4 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 projects/mtg/bin/Res/test/silver_seraph_i300.txt diff --git a/projects/mtg/bin/Res/sets/JUD/_cards.dat b/projects/mtg/bin/Res/sets/JUD/_cards.dat index 7f421f75e..16b117673 100644 --- a/projects/mtg/bin/Res/sets/JUD/_cards.dat +++ b/projects/mtg/bin/Res/sets/JUD/_cards.dat @@ -394,7 +394,7 @@ rarity=R mana={5}{W}{W}{W} type=Creature subtype=Angel -auto=aslongas(*|mygraveyard) lord(creature other|myBattlefield) 2/2 >6 +auto=aslongas(*|mygraveyard) lord(other creature|myBattlefield) 2/2 >6 power=6 toughness=6 abilities=flying diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index 21ae0335e..ff13b5bc6 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -348,6 +348,7 @@ seedcradle_witch.txt seismic_assault.txt seismic_spike_i191.txt selesnya_guildmage.txt +silver_seraph_i300.txt skullcage0_i239.txt skullcage1_i239.txt skullcage2_i239.txt diff --git a/projects/mtg/bin/Res/test/silver_seraph_i300.txt b/projects/mtg/bin/Res/test/silver_seraph_i300.txt new file mode 100644 index 000000000..e3b2de424 --- /dev/null +++ b/projects/mtg/bin/Res/test/silver_seraph_i300.txt @@ -0,0 +1,31 @@ +#Bug: Silver Seraph's theshold ability doesn't work +#see http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=36036 +[INIT] +FIRSTMAIN +[PLAYER1] +graveyard:plains,forest,mountain,swamp,island,grizzly bears,raging goblin,black knight +inplay:white knight +hand:Silver Seraph +manapool:{5}{W}{W}{W} +[PLAYER2] +[DO] +silver seraph +next +#begin +next +#attackers +white knight +next +#blockers +next +#damage +next +#end combat +[ASSERT] +COMBATEND +[PLAYER1] +graveyard:plains,forest,mountain,swamp,island,grizzly bears,raging goblin,black knight +inplay:white knight,Silver Seraph +[PLAYER2] +life:16 +[END] \ No newline at end of file diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index fa5807908..c7fcf8a50 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -174,7 +174,6 @@ MTGAbility * AbilityFactory::getCoreAbility(MTGAbility * a){ return a; } - //Parses a string and returns the corresponding MTGAbility object // Returns NULL if parsing failed //Beware, Spell CAN be null when the function is called by the AI trying to analyze the effects of a given card @@ -346,10 +345,10 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG } if (end != string::npos){ int lordIncludeSelf = 1; - size_t other = s1.find("other"); + size_t other = s1.find(" other"); if ( other != string::npos){ lordIncludeSelf = 0; - s1.replace(other, 5,""); + s1.replace(other, 6,""); } string lordTargetsString = s.substr(found+header,end-found-header); TargetChooserFactory tcf;