add Jhoira Weatherlight Captain + tests

This commit is contained in:
igoudt 2018-03-18 11:55:50 +01:00
parent 7344a15a9b
commit bd4b5f6300
3 changed files with 64 additions and 0 deletions

View file

@ -0,0 +1,37 @@
package mage.cards.j;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.filter.common.FilterHistoricSpell;
import java.util.UUID;
public class JhoiraWeatherlightCaptain extends CardImpl {
public JhoiraWeatherlightCaptain(UUID ownerId, CardSetInfo cardSetInfo){
super(ownerId, cardSetInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{R}");
addSuperType(SuperType.LEGENDARY);
subtype.add(SubType.HUMAN, SubType.ARTIFICER);
power = new MageInt(3);
toughness = new MageInt(3);
Ability ability = new SpellCastControllerTriggeredAbility(new DrawCardSourceControllerEffect(1), new FilterHistoricSpell(), false);
addAbility(ability);
}
public JhoiraWeatherlightCaptain(final JhoiraWeatherlightCaptain jhoiraWeatherlightCaptain){
super(jhoiraWeatherlightCaptain);
}
public JhoiraWeatherlightCaptain copy(){
return new JhoiraWeatherlightCaptain(this);
}
}

View file

@ -55,5 +55,6 @@ public class Dominaria extends ExpansionSet {
cards.add(new SetCardInfo("Benalish Marshal", 10, Rarity.UNCOMMON, mage.cards.b.BenalishMarshal.class));
cards.add(new SetCardInfo("Charge", 11, Rarity.COMMON, mage.cards.c.Charge.class));
cards.add(new SetCardInfo("Knight of Grace", 12, Rarity.UNCOMMON, mage.cards.k.KnightOfGrace.class));
cards.add(new SetCardInfo("Jhoira, Weatherlight Captain", 200, Rarity.MYTHIC, mage.cards.j.JhoiraWeatherlightCaptain.class));
}
}

View file

@ -5,6 +5,8 @@ import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
import javax.ws.rs.POST;
public class SimpleDominariaCards extends CardTestPlayerBase {
@Test
@ -84,4 +86,28 @@ public class SimpleDominariaCards extends CardTestPlayerBase {
assertPowerToughness(playerA, "Knight of Grace", 3, 2);
}
@Test
public void jhoiraCastHistoric(){
addCard(Zone.BATTLEFIELD, playerA, "Jhoira, Weatherlight Captain");
addCard(Zone.HAND, playerA, "Ornithopter");
addCard(Zone.LIBRARY, playerA, "Forest", 10);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ornithopter");
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertHandCount(playerA, 1);
}
@Test
public void jhoiraCastNonHistoric(){
addCard(Zone.BATTLEFIELD, playerA, "Jhoira, Weatherlight Captain");
addCard(Zone.HAND, playerA, "Giant Growth");
addCard(Zone.BATTLEFIELD, playerA, "Forest", 2);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Giant Growth", "Jhoira, Weatherlight Captain");
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertHandCount(playerA, 0);
}
}