mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 03:22:00 -08:00
* Deep-Sea Kraken - Fixed that the triggered ability to remove time counters did not work.
This commit is contained in:
parent
8d31a38d1d
commit
c896ae2442
4 changed files with 56 additions and 8 deletions
|
|
@ -29,6 +29,7 @@ package org.mage.test.cards.abilities.keywords;
|
|||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
|
|
@ -114,4 +115,28 @@ public class SuspendTest extends CardTestPlayerBase {
|
|||
assertPermanentCount(playerA, "Silvercoat Lion", 1);
|
||||
|
||||
}
|
||||
@Test
|
||||
public void testDeepSeaKraken() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
|
||||
// Suspend 9-{2}{U}
|
||||
// Whenever an opponent casts a spell, if Deep-Sea Kraken is suspended, remove a time counter from it.
|
||||
addCard(Zone.HAND, playerA, "Deep-Sea Kraken",1);
|
||||
|
||||
// Instant {1}{U}
|
||||
// Counter target spell. If the spell is countered this way, exile it with three time counters on it instead of putting it into its owner's graveyard. If it doesn't have suspend, it gains suspend. (At the beginning of its owner's upkeep, remove a counter from that card. When the last is removed, the player plays it without paying its mana cost. If it's a creature, it has haste.)
|
||||
addCard(Zone.HAND, playerB, "Lightning Bolt",1);
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1);
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Suspend");
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", playerA);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerB, "Lightning Bolt", 1);
|
||||
assertExileCount("Deep-Sea Kraken", 1);
|
||||
|
||||
assertCounterOnExiledCardCount("Deep-Sea Kraken", CounterType.TIME, 8); // -1 from spell of player B
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -490,12 +490,32 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Assert.assertNotNull("There is no such permanent on the battlefield, cardName=" + cardName, found);
|
||||
|
||||
Assert.assertEquals("(Battlefield) Counter counts are not equal (" + cardName + ":" + type + ")", count, found.getCounters().getCount(type));
|
||||
}
|
||||
/**
|
||||
* Assert counter count on a card in exile
|
||||
*
|
||||
* @param cardName Name of the cards that should be counted.
|
||||
* @param type Type of the counter that should be counted.
|
||||
* @param count Expected count.
|
||||
*/
|
||||
public void assertCounterOnExiledCardCount(String cardName, CounterType type, int count) throws AssertionError {
|
||||
Card found = null;
|
||||
|
||||
if (found == null) {
|
||||
for (Card card : currentGame.getExile().getAllCards(currentGame)) {
|
||||
if (card.getName().equals(cardName)) {
|
||||
found = card;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Assert.assertNotNull("There is no such card in the exile, cardName=" + cardName, found);
|
||||
Assert.assertEquals("(Exile) Counter counts are not equal (" + cardName + ":" + type + ")", count, found.getCounters(currentGame).getCount(type));
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert counter count on a player
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue