2013-04-12 19:32:25 -07:00
|
|
|
package magic.test;
|
|
|
|
|
|
|
|
import magic.model.MagicDuel;
|
|
|
|
import magic.model.MagicGame;
|
|
|
|
import magic.model.MagicPlayer;
|
|
|
|
import magic.model.phase.MagicMainPhase;
|
|
|
|
|
|
|
|
// shows the AI can cast Twincast on a Twincast, creating an endless loop.
|
|
|
|
// repro:
|
|
|
|
// 1. cast Lightning Bolt, targeting the AI's Diregraf Ghoul
|
|
|
|
// 2. cast Twincast, targeting the Lightning Bolt effect on the stack
|
|
|
|
// 3. pass priority
|
2013-06-23 18:33:35 -07:00
|
|
|
class TestTwincastEndlessLoop extends TestGameBuilder {
|
|
|
|
|
2017-06-16 20:19:03 -07:00
|
|
|
@Override
|
2013-04-12 19:32:25 -07:00
|
|
|
public MagicGame getGame() {
|
2015-04-05 01:22:52 -07:00
|
|
|
final MagicDuel duel=createDuel();
|
2014-11-29 04:58:07 -08:00
|
|
|
final MagicGame game=duel.nextGame();
|
2013-04-12 19:32:25 -07:00
|
|
|
game.setPhase(MagicMainPhase.getFirstInstance());
|
|
|
|
final MagicPlayer player=game.getPlayer(0);
|
|
|
|
final MagicPlayer opponent=game.getPlayer(1);
|
|
|
|
|
|
|
|
MagicPlayer P = player;
|
|
|
|
|
|
|
|
P.setLife(6);
|
|
|
|
addToLibrary(P, "Plains", 15);
|
2015-05-21 20:05:34 -07:00
|
|
|
createPermanent(P,"Rupture Spire",false,6);
|
|
|
|
createPermanent(P,"Wall of Diffusion",false,1);
|
|
|
|
createPermanent(P,"Eager Cadet",false,1);
|
2013-04-12 19:32:25 -07:00
|
|
|
addToHand(P,"Twincast",1);
|
|
|
|
addToHand(P,"Benalish Lancer",1);
|
|
|
|
addToHand(P,"Accorder Paladin",1);
|
|
|
|
addToHand(P,"Eager Cadet",1);
|
|
|
|
addToHand(P,"Lightning Bolt",2);
|
|
|
|
addToHand(P,"Swords to Plowshares",1);
|
2013-06-23 18:33:35 -07:00
|
|
|
|
2013-04-12 19:32:25 -07:00
|
|
|
|
|
|
|
P = opponent;
|
2013-06-23 18:33:35 -07:00
|
|
|
|
2013-04-12 19:32:25 -07:00
|
|
|
P.setLife(12);
|
|
|
|
addToLibrary(P, "Swamp", 15);
|
2015-05-21 20:05:34 -07:00
|
|
|
createPermanent(P,"Rupture Spire",false,4);
|
|
|
|
createPermanent(P,"Eager Cadet",false,1);
|
|
|
|
createPermanent(P,"Diregraf Ghoul",false,1);
|
2013-04-12 19:32:25 -07:00
|
|
|
addToHand(P,"Twincast",1);
|
2013-06-23 18:33:35 -07:00
|
|
|
|
2013-04-12 19:32:25 -07:00
|
|
|
return game;
|
|
|
|
}
|
|
|
|
}
|