mirror of
https://github.com/correl/mage.git
synced 2025-04-09 01:01:06 -09:00
CuroseOfEchoes bug fix and test
This commit is contained in:
parent
a0f7ac7704
commit
56c5c1328a
2 changed files with 32 additions and 1 deletions
Mage.Sets/src/mage/sets/darkascension
Mage.Tests/src/test/java/org/mage/test/cards/copy
|
@ -151,7 +151,7 @@ class CurseOfEchoesEffect extends OneShotEffect {
|
||||||
if (!playerId.equals(spell.getControllerId())) {
|
if (!playerId.equals(spell.getControllerId())) {
|
||||||
Player player = game.getPlayer(playerId);
|
Player player = game.getPlayer(playerId);
|
||||||
if (player.chooseUse(Outcome.Copy, chooseMessage, source, game)) {
|
if (player.chooseUse(Outcome.Copy, chooseMessage, source, game)) {
|
||||||
Spell copy = spell.copySpell(source.getControllerId());;
|
Spell copy = spell.copySpell(source.getControllerId());
|
||||||
game.getStack().push(copy);
|
game.getStack().push(copy);
|
||||||
copy.chooseNewTargets(game, playerId);
|
copy.chooseNewTargets(game, playerId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,4 +173,35 @@ public class CopySpellTest extends CardTestPlayerBase {
|
||||||
assertHandCount(playerA, 3); // Evermind + 1 card from Evermind spliced on cast Into the fray and 1 from the copied spell with splice
|
assertHandCount(playerA, 3); // Evermind + 1 card from Evermind spliced on cast Into the fray and 1 from the copied spell with splice
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {4}{U} Enchantment (Enchant Player)
|
||||||
|
* Whenever enchanted player casts an instant or sorcery spell, each other player may copy that spell
|
||||||
|
* and may choose new targets for the copy he or she controls.
|
||||||
|
*
|
||||||
|
* Reported bug: "A player with Curse of Echoes attached to them played Bribery and the player who controlled the curse had control
|
||||||
|
* of all 3 copies. This seems to be the case for all spells."
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testCurseOfEchoes() {
|
||||||
|
|
||||||
|
addCard(Zone.HAND, playerA, "Curse of Echoes");
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Island", 5);
|
||||||
|
addCard(Zone.HAND, playerB, "Lightning Bolt");
|
||||||
|
addCard(Zone.BATTLEFIELD, playerB, "Mountain");
|
||||||
|
|
||||||
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Echoes");
|
||||||
|
addTarget(playerA, playerB);
|
||||||
|
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt");
|
||||||
|
addTarget(playerB, playerA); // original target
|
||||||
|
setChoice(playerA, "Yes");
|
||||||
|
addTarget(playerA, playerB);
|
||||||
|
|
||||||
|
setStopAt(2, PhaseStep.BEGIN_COMBAT);
|
||||||
|
execute();
|
||||||
|
|
||||||
|
assertGraveyardCount(playerB, "Lightning Bolt", 1);
|
||||||
|
assertLife(playerA, 17); // still takes original spell's damage
|
||||||
|
assertLife(playerB, 17); // copy redirected
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue