mirror of
https://github.com/correl/mage.git
synced 2025-01-11 19:13:02 +00:00
* Voice of Resurgence - Fixed a bug that the dies trigger did not work correctly if Voice of Resurgence was copied e.g. by a Phantasmal Image.
This commit is contained in:
parent
c347dc18b4
commit
672ac28931
6 changed files with 46 additions and 13 deletions
|
@ -80,6 +80,7 @@ class VoiceOfResurgenceTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
public VoiceOfResurgenceTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new CreateTokenEffect(new VoiceOfResurgenceToken()), false);
|
||||
setLeavesTheBattlefieldTrigger(true);
|
||||
}
|
||||
|
||||
public VoiceOfResurgenceTriggeredAbility(final VoiceOfResurgenceTriggeredAbility ability) {
|
||||
|
|
|
@ -576,4 +576,35 @@ public class PhantasmalImageTest extends CardTestPlayerBase {
|
|||
assertPermanentCount(playerB, "Wurm", 2);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* A Phantasmal Image that was copying a Voice of Resurgence died and left
|
||||
* no token behind.
|
||||
*/
|
||||
@Test
|
||||
public void testVoiceOfResurgence() {
|
||||
// Whenever an opponent casts a spell during your turn or when Voice of Resurgence dies, put a green and white Elemental creature token onto the battlefield with "This creature's power and toughness are each equal to the number of creatures you control."
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Voice of Resurgence");
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 2);
|
||||
addCard(Zone.HAND, playerA, "Phantasmal Image");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Phantasmal Image"); // not targeted
|
||||
setChoice(playerB, "Voice of Resurgence");
|
||||
|
||||
attack(2, playerB, "Voice of Resurgence");
|
||||
block(2, playerA, "Voice of Resurgence", "Voice of Resurgence");
|
||||
setStopAt(2, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertLife(playerB, 20);
|
||||
assertLife(playerA, 20);
|
||||
|
||||
assertGraveyardCount(playerA, "Phantasmal Image", 1);
|
||||
assertGraveyardCount(playerB, "Voice of Resurgence", 1);
|
||||
|
||||
assertPermanentCount(playerB, "Elemental", 1);
|
||||
assertPermanentCount(playerA, "Elemental", 1);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ package org.mage.test.cards.triggers.dies;
|
|||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.Filter;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
|
@ -72,8 +73,8 @@ public class VoiceOfResurgenceTest extends CardTestPlayerBase {
|
|||
assertGraveyardCount(playerA, "Treachery", 1);
|
||||
assertGraveyardCount(playerB, "Voice of Resurgence", 1);
|
||||
|
||||
assertPermanentCount(playerA, "Elemental", 1);
|
||||
assertPowerToughness(playerA, "Elemental", 2, 2);
|
||||
assertPermanentCount(playerA, "Elemental", 2); // one from the Lightning Bolt and one from the Voice of Resurgence dying
|
||||
assertPowerToughness(playerA, "Elemental", 3, 3, Filter.ComparisonScope.All);
|
||||
assertTappedCount("Island", true, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -25,13 +25,12 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.choices;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import mage.constants.Outcome;
|
||||
import mage.abilities.Ability;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
|
@ -43,7 +42,8 @@ public class Choices extends ArrayList<Choice> {
|
|||
|
||||
protected Outcome outcome;
|
||||
|
||||
public Choices() {}
|
||||
public Choices() {
|
||||
}
|
||||
|
||||
public Choices(final Choices choices) {
|
||||
this.outcome = choices.outcome;
|
||||
|
@ -57,7 +57,7 @@ public class Choices extends ArrayList<Choice> {
|
|||
}
|
||||
|
||||
public List<Choice> getUnchosen() {
|
||||
List<Choice> unchosen = new ArrayList<Choice>();
|
||||
List<Choice> unchosen = new ArrayList<>();
|
||||
for (Choice choice : this) {
|
||||
if (!choice.isChosen()) {
|
||||
unchosen.add(choice);
|
||||
|
|
|
@ -753,7 +753,7 @@ public interface Player extends MageItem, Copyable<Player> {
|
|||
|
||||
/**
|
||||
* Uses card.moveToZone and posts a inform message about moving the card to
|
||||
* graveyard into the game log
|
||||
* library into the game log
|
||||
*
|
||||
* @param card
|
||||
* @param sourceId
|
||||
|
|
Loading…
Reference in a new issue