Added a test. Some mionor changes.

This commit is contained in:
LevelX2 2020-09-17 10:02:08 +02:00
parent 4050631807
commit 1125d9cca1
3 changed files with 93 additions and 5 deletions

View file

@ -50,13 +50,13 @@ public final class HaldanAvidArcanist extends CardImpl {
return new HaldanAvidArcanist(this);
}
static boolean checkCard(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
if (!PakoArcaneRetriever.checkWatcher(affectedControllerId, game.getCard(sourceId), game)
static boolean checkCard(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
if (!PakoArcaneRetriever.checkWatcher(affectedControllerId, game.getCard(objectId), game)
|| !source.isControlledBy(affectedControllerId)
|| game.getState().getZone(sourceId) != Zone.EXILED) {
|| game.getState().getZone(objectId) != Zone.EXILED) {
return false;
}
Card card = game.getCard(sourceId);
Card card = game.getCard(objectId);
return card != null
&& !card.isCreature()
&& card.getCounters(game).containsKey(CounterType.FETCH);

View file

@ -0,0 +1,88 @@
package org.mage.test.cards.single.hou;
import java.io.FileNotFoundException;
import mage.constants.MultiplayerAttackOption;
import mage.constants.PhaseStep;
import mage.constants.RangeOfInfluence;
import mage.constants.Zone;
import mage.game.FreeForAll;
import mage.game.Game;
import mage.game.GameException;
import mage.game.mulligan.MulliganType;
import org.junit.Assert;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestMultiPlayerBase;
/**
*
* @author LevelX2
*/
public class TormentOfHailfireTest extends CardTestMultiPlayerBase {
@Override
protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException {
// Start Life = 2
Game game = new FreeForAll(MultiplayerAttackOption.MULTIPLE, RangeOfInfluence.ONE, MulliganType.GAME_DEFAULT.getMulligan(0), 20);
// Player order: A -> D -> C -> B
playerA = createPlayer(game, playerA, "PlayerA");
playerB = createPlayer(game, playerB, "PlayerB");
playerC = createPlayer(game, playerC, "PlayerC");
playerD = createPlayer(game, playerD, "PlayerD");
return game;
}
@Test
public void test_Normal() {
setStrictChooseMode(true);
// Repeat the following process X times. Each opponent loses 3 life unless they sacrifice a nonland permanent or discards a card.
addCard(Zone.HAND, playerA, "Torment of Hailfire", 1); // Sorcery {X}{B}{B}
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 12);
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 2);
addCard(Zone.HAND, playerB, "Plains", 1);
addCard(Zone.BATTLEFIELD, playerC, "Silvercoat Lion", 3);
addCard(Zone.BATTLEFIELD, playerD, "Silvercoat Lion", 3);
addCard(Zone.HAND, playerD, "Plains", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Torment of Hailfire");
setChoice(playerA, "X=10");
setChoice(playerD, "Yes");// Sacrifices a nonland permanent?
setChoice(playerD, "Silvercoat Lion");
setChoice(playerB, "Yes");// Sacrifices a nonland permanent?
setChoice(playerB, "Silvercoat Lion");
setChoice(playerD, "Yes");// Sacrifices a nonland permanent?
setChoice(playerD, "Silvercoat Lion");
setChoice(playerB, "Yes");// Sacrifices a nonland permanent?
setChoice(playerB, "Silvercoat Lion");
setChoice(playerD, "No");// Sacrifices a nonland permanent?
setChoice(playerD, "Yes");// Discard a card?
setChoice(playerB, "Yes");// Discard a card?
setChoice(playerD, "Yes");// Sacrifices a nonland permanent?
setChoice(playerD, "Silvercoat Lion");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertAllCommandsUsed();
assertGraveyardCount(playerA, "Torment of Hailfire", 1);
assertLife(playerA, 20);
assertLife(playerC, 20);
assertLife(playerD, 2);
assertLife(playerB, -1);
Assert.assertFalse("Player B is dead", playerB.isInGame());
}
}

View file

@ -21,7 +21,7 @@ public class ExileAttachedEffect extends OneShotEffect {
public ExileAttachedEffect() {
super(Outcome.Exile);
staticText = "Exile enchanted creature";
staticText = "exile enchanted creature";
}
public ExileAttachedEffect(final ExileAttachedEffect effect) {