mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 12:49:39 -08:00
Tests reproducing bug in Mage.Core with creature CopyEffect for triggered abilities
This commit is contained in:
parent
d1af0e82fe
commit
40ff3dd498
2 changed files with 22 additions and 0 deletions
|
|
@ -28,4 +28,25 @@ public class PhantasmalImageTest extends CardTestPlayerBase {
|
||||||
assertPermanentCount(playerB, "Craw Wurm", 1);
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -373,6 +373,7 @@ public abstract class CardImpl<T extends CardImpl<T>> extends MageObjectImpl<T>
|
||||||
game.setZone(objectId, Zone.BATTLEFIELD);
|
game.setZone(objectId, Zone.BATTLEFIELD);
|
||||||
game.applyEffects();
|
game.applyEffects();
|
||||||
permanent.entersBattlefield(sourceId, game);
|
permanent.entersBattlefield(sourceId, game);
|
||||||
|
game.applyEffects();
|
||||||
game.fireEvent(new ZoneChangeEvent(permanent, controllerId, fromZone, Zone.BATTLEFIELD));
|
game.fireEvent(new ZoneChangeEvent(permanent, controllerId, fromZone, Zone.BATTLEFIELD));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue