Tests reproducing bug in Mage.Core with creature CopyEffect for triggered abilities

This commit is contained in:
magenoxx 2012-05-02 16:48:11 +04:00
parent d1af0e82fe
commit 40ff3dd498
2 changed files with 22 additions and 0 deletions

View file

@ -28,4 +28,25 @@ public class PhantasmalImageTest extends CardTestPlayerBase {
assertPermanentCount(playerB, "Craw Wurm", 1);
}
/**
* Tests that copy effect will copy EntersBattlefieldTriggeredAbility and it will be applied.
*/
@Test
public void testCopiedEntersBattlefieldTriggeredAbility() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Island", 2);
addCard(Constants.Zone.HAND, playerA, "Phantasmal Image");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Howling Banshee");
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Phantasmal Image");
setStopAt(2, Constants.PhaseStep.END_TURN);
execute();
assertPermanentCount(playerA, "Howling Banshee", 1);
assertPermanentCount(playerB, "Howling Banshee", 1);
assertLife(playerA, 17);
assertLife(playerB, 17);
}
}

View file

@ -373,6 +373,7 @@ public abstract class CardImpl<T extends CardImpl<T>> extends MageObjectImpl<T>
game.setZone(objectId, Zone.BATTLEFIELD);
game.applyEffects();
permanent.entersBattlefield(sourceId, game);
game.applyEffects();
game.fireEvent(new ZoneChangeEvent(permanent, controllerId, fromZone, Zone.BATTLEFIELD));
return true;
}