mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
added boneclad necromancer unit tests + fix for issue #5875
This commit is contained in:
parent
0d6be669de
commit
1d0da973ac
2 changed files with 79 additions and 2 deletions
|
|
@ -9,7 +9,7 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.common.FilterCreatureCard;
|
||||||
import mage.game.permanent.token.ZombieToken;
|
import mage.game.permanent.token.ZombieToken;
|
||||||
import mage.target.common.TargetCardInGraveyard;
|
import mage.target.common.TargetCardInGraveyard;
|
||||||
|
|
||||||
|
|
@ -20,7 +20,7 @@ import java.util.UUID;
|
||||||
*/
|
*/
|
||||||
public final class BonecladNecromancer extends CardImpl {
|
public final class BonecladNecromancer extends CardImpl {
|
||||||
|
|
||||||
private static final FilterCard filter = new FilterCard("creature card from a graveyard");
|
private static final FilterCreatureCard filter = new FilterCreatureCard("creature card from a graveyard");
|
||||||
|
|
||||||
public BonecladNecromancer(UUID ownerId, CardSetInfo setInfo) {
|
public BonecladNecromancer(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,77 @@
|
||||||
|
package org.mage.test.cards.triggers;
|
||||||
|
|
||||||
|
import mage.constants.PhaseStep;
|
||||||
|
import mage.constants.Zone;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Added this test class to test issue #5875
|
||||||
|
* https://github.com/magefree/mage/issues/5875
|
||||||
|
*
|
||||||
|
* Boneclad Necromancer could exile non-creature cards from the graveyard to get his 2/2 Zombie.
|
||||||
|
*
|
||||||
|
* Boneclad Necromancer {3}{B}{B}
|
||||||
|
*
|
||||||
|
* Card Type: Creature — Human Wizard
|
||||||
|
* P / T: 3 / 3
|
||||||
|
* Description: When Boneclad Necromancer enters the battlefield, you may exile target creature card from a graveyard.
|
||||||
|
* If you do, create a 2/2 black Zombie creature token.
|
||||||
|
*
|
||||||
|
* @author jgray1206
|
||||||
|
*/
|
||||||
|
public class BonecladNecromancerTest extends CardTestPlayerBase {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testBonecladNecromancerCanExileCreaturesFromOwnGraveyard() {
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5);
|
||||||
|
addCard(Zone.HAND, playerA, "Boneclad Necromancer", 1);
|
||||||
|
addCard(Zone.GRAVEYARD, playerA, "Raptor Hatchling", 1);
|
||||||
|
|
||||||
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Boneclad Necromancer");
|
||||||
|
playerA.addChoice("Raptor Hatchling");
|
||||||
|
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||||
|
execute();
|
||||||
|
|
||||||
|
assertPermanentCount(playerA, "Boneclad Necromancer", 1);
|
||||||
|
assertPermanentCount(playerA, "Zombie", 1);
|
||||||
|
assertExileCount(playerA, "Raptor Hatchling", 1);
|
||||||
|
assertGraveyardCount(playerA, "Raptor Hatchling", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testBonecladNecromancerCanExileCreaturesFromOtherGraveyard() {
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5);
|
||||||
|
addCard(Zone.HAND, playerA, "Boneclad Necromancer", 1);
|
||||||
|
addCard(Zone.GRAVEYARD, playerB, "Raptor Hatchling", 1);
|
||||||
|
|
||||||
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Boneclad Necromancer");
|
||||||
|
playerA.addChoice("Raptor Hatchling");
|
||||||
|
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||||
|
execute();
|
||||||
|
|
||||||
|
assertPermanentCount(playerA, "Boneclad Necromancer", 1);
|
||||||
|
assertPermanentCount(playerA, "Zombie", 1);
|
||||||
|
assertExileCount(playerB, "Raptor Hatchling", 1);
|
||||||
|
assertGraveyardCount(playerB, "Raptor Hatchling", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testBonecladNecromancerCantExileNonCreatures() {
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5);
|
||||||
|
addCard(Zone.HAND, playerA, "Boneclad Necromancer", 1);
|
||||||
|
addCard(Zone.GRAVEYARD, playerA, "Feral Invocation", 1);
|
||||||
|
|
||||||
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Boneclad Necromancer");
|
||||||
|
playerA.addChoice("Feral Invocation");
|
||||||
|
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||||
|
execute();
|
||||||
|
|
||||||
|
assertPermanentCount(playerA, "Boneclad Necromancer", 1);
|
||||||
|
assertPermanentCount(playerA, "Zombie", 0);
|
||||||
|
assertExileCount(playerA, "Feral Invocation", 0);
|
||||||
|
assertGraveyardCount(playerA, "Feral Invocation", 1);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue