* Oathbreaker format - Fixed that signate spell didn't return to command zone. Added unit test for oathbreaker format (fixes #6695).

This commit is contained in:
LevelX2 2020-06-23 09:18:40 +02:00
parent 5ae041f39a
commit 29e5230469
6 changed files with 220 additions and 19 deletions

View file

@ -91,4 +91,41 @@ public class BolsterTest extends CardTestPlayerBase {
assertLife(playerB, 16);
}
@Test
public void EliteScaleguardTriggerTwiceTest() {
// When Elite Scaleguard enters the battlefield, bolster 2.
// Whenever a creature you control with a +1/+1 counter on it attacks, tap target creature defending player controls.
addCard(Zone.HAND, playerA, "Elite Scaleguard"); // Creature 2/3 {4}{W}
addCard(Zone.BATTLEFIELD, playerA, "Plains", 5);
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1);
addCard(Zone.BATTLEFIELD, playerB, "Pillarfield Ox", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Elite Scaleguard");
attack(3, playerA, "Silvercoat Lion");
addTarget(playerA, "Pillarfield Ox"); // Tap from triggered ability of Elite Scaleguard
attack(5, playerA, "Silvercoat Lion");
addTarget(playerA, "Pillarfield Ox"); // Tap from triggered ability of Elite Scaleguard
setStopAt(5, PhaseStep.POSTCOMBAT_MAIN);
setStrictChooseMode(true);
execute();
assertAllCommandsUsed();
assertPowerToughness(playerA, "Elite Scaleguard", 2, 3);
assertCounterCount("Silvercoat Lion", CounterType.P1P1, 2);
assertPowerToughness(playerA, "Silvercoat Lion", 4, 4);
assertTapped("Silvercoat Lion", true);
assertPermanentCount(playerB, "Pillarfield Ox", 1);
assertTapped("Pillarfield Ox", true);
assertLife(playerB, 12);
}
}

View file

@ -0,0 +1,69 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.mage.test.oathbreaker.FFA3;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestOathbreaker3PlayersFFA;
/**
*
* @author LevelX2
*/
public class BasicSaheekiSublimeArtificerTest extends CardTestOathbreaker3PlayersFFA {
/**
* Check that if a player left the game, it's commander is also removed
*/
@Test
public void commanderRemovedTest() {
concede(1, PhaseStep.PRECOMBAT_MAIN, playerA);
setStopAt(1, PhaseStep.DECLARE_ATTACKERS);
execute();
assertCommandZoneCount(playerB, "Saheeli, Sublime Artificer", 1);
assertCommandZoneCount(playerB, "Thoughtcast", 1);
assertCommandZoneCount(playerC, "Saheeli, Sublime Artificer", 1);
assertCommandZoneCount(playerC, "Thoughtcast", 1);
assertCommandZoneCount(playerA, "Saheeli, Sublime Artificer", 0);
assertCommandZoneCount(playerA, "Thoughtcast", 0);
}
@Test
public void castCommanderTest() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 4);
addCard(Zone.BATTLEFIELD, playerA, "Ornithopter", 4);
// Planeswalker 5 Loyality Counter
// Whenever you cast a noncreature spell, create a 1/1 colorless Servo artifact creature token.
// -2: Target artifact you control becomes a copy of another target artifact or creature you control until end of turn,
// except it's an artifact in addition to its other types.
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Saheeli, Sublime Artificer"); // Planeswalker 5 {1}{U/R}{U/R}
// Affinity for artifacts
// Draw two cards.
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Thoughtcast"); // Sorcery {4}{U}
setStopAt(1, PhaseStep.DECLARE_ATTACKERS);
execute();
assertCommandZoneCount(playerB, "Saheeli, Sublime Artificer", 1);
assertCommandZoneCount(playerB, "Thoughtcast", 1);
assertCommandZoneCount(playerC, "Saheeli, Sublime Artificer", 1);
assertCommandZoneCount(playerC, "Thoughtcast", 1);
assertHandCount(playerA, 3);
assertPermanentCount(playerA, "Saheeli, Sublime Artificer", 1);
assertCommandZoneCount(playerA, "Thoughtcast", 1);
}
}

View file

@ -0,0 +1,38 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.mage.test.serverside.base;
import java.io.FileNotFoundException;
import mage.constants.MultiplayerAttackOption;
import mage.constants.RangeOfInfluence;
import mage.game.Game;
import mage.game.GameException;
import mage.game.OathbreakerFreeForAll;
import mage.game.mulligan.MulliganType;
import org.mage.test.serverside.base.impl.CardTestPlayerAPIImpl;
/**
* @author LevelX2
*/
public abstract class CardTestOathbreaker3PlayersFFA extends CardTestPlayerAPIImpl {
public CardTestOathbreaker3PlayersFFA() {
super();
this.deckNameA = "Oathbreaker_UR.dck"; // PW: Saheeli, Sublime Artificer SS: Thoughtcast
this.deckNameB = "Oathbreaker_UR.dck";
this.deckNameC = "Oathbreaker_UR.dck";
}
@Override
protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException {
Game game = new OathbreakerFreeForAll(MultiplayerAttackOption.MULTIPLE, RangeOfInfluence.ONE, MulliganType.GAME_DEFAULT.getMulligan(0), 20);
playerA = createPlayer(game, playerA, "PlayerA", deckNameA);
playerB = createPlayer(game, playerB, "PlayerB", deckNameB);
playerC = createPlayer(game, playerC, "PlayerC", deckNameC);
return game;
}
}