From e762a5f983d27447de28f2e592abb52cc95787c3 Mon Sep 17 00:00:00 2001 From: "wagic.the.homebrew@gmail.com" Date: Mon, 26 Oct 2009 13:31:30 +0000 Subject: [PATCH] Erwan - revert r1187 - fix a bug with "@damaged" (see slith bloodletter test) --- projects/mtg/bin/Res/test/_tests.txt | 1 + .../mtg/bin/Res/test/slith_bloodletter.txt | 40 +++++++++++++++++++ projects/mtg/src/MTGAbility.cpp | 16 ++++---- 3 files changed, 48 insertions(+), 9 deletions(-) create mode 100644 projects/mtg/bin/Res/test/slith_bloodletter.txt diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index cd47bf1eb..389d98773 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -217,6 +217,7 @@ shock.txt shock2.txt slate_of_ancestry.txt sleeper_agent.txt +slith_bloodletter.txt soulblast.txt sphinx_summoner.txt spitting_earth.txt diff --git a/projects/mtg/bin/Res/test/slith_bloodletter.txt b/projects/mtg/bin/Res/test/slith_bloodletter.txt new file mode 100644 index 000000000..692529d5b --- /dev/null +++ b/projects/mtg/bin/Res/test/slith_bloodletter.txt @@ -0,0 +1,40 @@ +#Bug: Slith bloodletter gets counters even when it doesn't attack +[INIT] +COMBATATTACKERS +[PLAYER1] +inplay:grizzly bears,slith bloodletter +[PLAYER2] +[DO] +grizzly bears +next +#blockers +next +#damage +next +#end combat +eot +eot +next +#upkeep +next +#draw +next +#main +next +#begin +next +#attackers +slith bloodletter +next +#blockers +next +#damage +next +#end combat +[ASSERT] +COMBATEND +[PLAYER1] +inplay:grizzly bears,slith bloodletter +[PLAYER2] +life:17 +[END] \ No newline at end of file diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 5f9105850..2613105b3 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -118,16 +118,14 @@ TriggeredAbility * AbilityFactory::parseTrigger(string magicText, int id, Spell tc->targetter = NULL; found = s.find("from("); - TargetChooser *fromTc = NULL; - if (found != string::npos){ - end = s.find (")", found); - starget = s.substr(found+5,end - found - 5); - TargetChooser * fromTc = tcf.createTargetChooser(starget,card); - fromTc->targetter = NULL; - return NEW TrDamaged(id,card,tc,fromTc); - }else{ + TargetChooser *fromTc = NULL; + if (found != string::npos){ + end = s.find (")", found); + starget = s.substr(found+5,end - found - 5); + fromTc = tcf.createTargetChooser(starget,card); + fromTc->targetter = NULL; + } return NEW TrDamaged(id,card,tc,fromTc); - } } int who = 0;