diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index ac7d5340b..1a7f46453 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -131,6 +131,8 @@ death_ward.txt deja_vu.txt dingus_egg.txt doomed_necromancer.txt +double_strike_i145.txt +double_strike2_i145.txt dragon_fodder.txt dragon_fodder2.txt dragon_whelp_i154.txt diff --git a/projects/mtg/bin/Res/test/bugs/double_strike_i145.txt b/projects/mtg/bin/Res/test/bugs/double_strike_i145.txt deleted file mode 100644 index cee8b085c..000000000 --- a/projects/mtg/bin/Res/test/bugs/double_strike_i145.txt +++ /dev/null @@ -1,40 +0,0 @@ -#NAME: Double Strike i145 -#DESC: When a creature with double strike kills -#DESC: its blocker with its first strike, then -#DESC: it should not be able to deal damage to -#DESC: the opponent player with its regular -#DESC: strike, unless it has Trample. -#DESC: The following test checks Double Strike -#DESC: with and without Trample. Player1 should -#DESC: lose 7 life from the Fangren Hunter, but -#DESC: none from the Shanodin Dryads. -[INIT] -combatattackers -[PLAYER1] -inplay:shanodin dryads,fangren hunter,rage reflection -graveyard: -[PLAYER2] -inplay:drudge skeletons,walking dead -graveyard: -life:20 -[DO] -shanodin dryads -fangren hunter -next -drudge skeletons -walking dead -walking dead -next -next -next -next -[ASSERT] -combatend -[PLAYER1] -inplay:shanodin dryads,fangren hunter,rage reflection -graveyard: -[PLAYER2] -inplay: -graveyard:drudge skeletons,walking dead -life:13 -[END] diff --git a/projects/mtg/bin/Res/test/double_strike2_i145.txt b/projects/mtg/bin/Res/test/double_strike2_i145.txt new file mode 100644 index 000000000..8db22f597 --- /dev/null +++ b/projects/mtg/bin/Res/test/double_strike2_i145.txt @@ -0,0 +1,22 @@ +#NAME: Double Strike i145 +[INIT] +combatattackers +[PLAYER1] +inplay:Hearthfire Hobgoblin +[PLAYER2] +inplay:grizzly bears +[DO] +Hearthfire Hobgoblin +next +grizzly bears +next +#damage 1 +next +#end +[ASSERT] +combatend +[PLAYER1] +inplay:Hearthfire Hobgoblin +[PLAYER2] +graveyard:grizzly bears +[END] diff --git a/projects/mtg/bin/Res/test/double_strike_i145.txt b/projects/mtg/bin/Res/test/double_strike_i145.txt new file mode 100644 index 000000000..cb1c11ec5 --- /dev/null +++ b/projects/mtg/bin/Res/test/double_strike_i145.txt @@ -0,0 +1,29 @@ +#NAME: Double Strike i145 +#Testing double strike + trample +# see http://code.google.com/p/wagic/issues/detail?id=145 +[INIT] +combatattackers +[PLAYER1] +inplay:fangren hunter,rage reflection +graveyard: +[PLAYER2] +inplay:grizzly bears +[DO] +fangren hunter +next +grizzly bears +next +#choose trample +next +#damage 1 +next +#damage 2 +next +[ASSERT] +combatend +[PLAYER1] +inplay:fangren hunter,rage reflection +[PLAYER2] +graveyard:grizzly bears +life:14 +[END] diff --git a/projects/mtg/src/GuiCombat.cpp b/projects/mtg/src/GuiCombat.cpp index 6a466d73b..2358fbf15 100644 --- a/projects/mtg/src/GuiCombat.cpp +++ b/projects/mtg/src/GuiCombat.cpp @@ -307,14 +307,16 @@ int GuiCombat::resolve() // Returns the number of damage objects dealt this turn DamageStack* stack = NEW DamageStack(); for (inner_iterator it = attackers.begin(); it != attackers.end(); ++it) { - signed dmg = (*it)->card->stepPower(step); + MTGCardInstance * attacker = (*it)->card; + signed dmg = attacker->stepPower(step); for (vector::iterator q = (*it)->blockers.begin(); q != (*it)->blockers.end(); ++q) { for (vector::iterator d = (*q)->damages.begin(); d != (*q)->damages.end(); ++d) stack->Add(NEW Damage(*d)); dmg -= (*q)->sumDamages(); } - if (dmg > 0) stack->Add(NEW Damage((*it)->card, go->opponent(), dmg, DAMAGE_COMBAT)); + + if (dmg > 0 && ( (!attacker->blocked) || attacker->has(Constants::TRAMPLE)) ) stack->Add(NEW Damage((*it)->card, go->opponent(), dmg, DAMAGE_COMBAT)); for (vector::iterator d = (*it)->damages.begin(); d != (*it)->damages.end(); ++d) stack->Add(NEW Damage(*d)); }