Skip to content

Commit

Permalink
Added test for Pako Arcane Retriever.
Browse files Browse the repository at this point in the history
  • Loading branch information
LevelX2 committed Sep 8, 2020
1 parent 8e465ac commit d0ccafd
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Mage.Sets/src/mage/cards/t/TormentOfHailfire.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public boolean apply(Game game, Ability source) {
if (controller != null) {
int repeat = source.getManaCostsToPay().getX();
for (int i = 1; i <= repeat; i++) {

for (UUID opponentId : game.getOpponents(source.getControllerId())) {
Player opponent = game.getPlayer(opponentId);
if (opponent != null) {
Expand All @@ -85,7 +86,6 @@ public boolean apply(Game game, Ability source) {
opponent.loseLife(3, game, false);
}
}

}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@

package org.mage.test.cards.single.c20;

import mage.cards.Card;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.counters.CounterType;
import org.junit.Assert;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;

/**
*
* @author LevelX2
*/

public class PakoArcaneRetrieverTest extends CardTestPlayerBase {

@Test
public void test_CheckExiled() {
setStrictChooseMode(true);

addCard(Zone.BATTLEFIELD, playerA, "Mountain", 6);

addCard(Zone.LIBRARY, playerA, "Silvercoat Lion", 1);
addCard(Zone.LIBRARY, playerB, "Pillarfield Ox", 1);

skipInitShuffling();
// Partner with Pako, Arcane Retriever
// You may play noncreature cards from exile with fetch counters on them if you
// exiled them, and you may spend mana as though it were mana of any color to cast those spells.
addCard(Zone.BATTLEFIELD, playerA, "Haldan, Avid Arcanist", 1);
// Partner with Haldan, Avid Arcanist
// Haste
// Whenever Pako, Arcane Retriever attacks, exile the top card of each player's library and put a fetch counter on each of them. Put a +1/+1 counter on Pako for each noncreature card exiled this way.
addCard(Zone.BATTLEFIELD, playerA, "Pako, Arcane Retriever", 1); // Creature {3}{R}{G} (3/3)

attack(1, playerA, "Pako, Arcane Retriever");

setStopAt(1, PhaseStep.END_TURN);
execute();

assertAllCommandsUsed();

assertLife(playerA, 20);
assertLife(playerB, 17);

assertExileCount(playerA, "Silvercoat Lion", 1);
assertExileCount(playerB, "Pillarfield Ox", 1);

for(Card card :currentGame.getExile().getAllCards(currentGame)) {
Assert.assertTrue(card.getName() + " has a fetch counter",card.getCounters(currentGame).getCount(CounterType.FETCH) == 1);
}

}

@Test
public void test_CastExiled() {
// setStrictChooseMode(true);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 3);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 6);

addCard(Zone.LIBRARY, playerA, "Lightning Bolt", 1); // Instant 3 damge
// Create a 3/3 green Centaur creature token.
addCard(Zone.LIBRARY, playerB, "Call of the Conclave", 1); // Sorcery {W}{G}

skipInitShuffling();
// Partner with Pako, Arcane Retriever
// You may play noncreature cards from exile with fetch counters on them if you
// exiled them, and you may spend mana as though it were mana of any color to cast those spells.
addCard(Zone.BATTLEFIELD, playerA, "Haldan, Avid Arcanist", 1);
// Partner with Haldan, Avid Arcanist
// Haste
// Whenever Pako, Arcane Retriever attacks, exile the top card of each player's library and put a fetch counter on each of them. Put a +1/+1 counter on Pako for each noncreature card exiled this way.
addCard(Zone.BATTLEFIELD, playerA, "Pako, Arcane Retriever", 1); // Creature {3}{R}{G} (3/3)

attack(1, playerA, "Pako, Arcane Retriever");

castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Call of the Conclave");

setStopAt(1, PhaseStep.END_TURN);
execute();

assertAllCommandsUsed();

assertLife(playerA, 20);
assertLife(playerB, 12); // 3+2 (attack) + 3 Lighning Bolt

assertGraveyardCount(playerA, "Lightning Bolt", 1);
assertGraveyardCount(playerB, "Call of the Conclave", 1);


}
}

0 comments on commit d0ccafd

Please sign in to comment.