[MH2] Implemented Chrome Courier

This commit is contained in:
Evan Kranzler 2021-05-31 16:08:37 -04:00
parent d1f31fb1d0
commit 7607d69015
2 changed files with 98 additions and 0 deletions

View file

@ -0,0 +1,97 @@
package mage.cards.c;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.*;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetCard;
import mage.target.common.TargetCardInLibrary;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ChromeCourier extends CardImpl {
public ChromeCourier(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{1}{W}{U}");
this.subtype.add(SubType.THOPTER);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// Flying
this.addAbility(FlyingAbility.getInstance());
// When Chrome Courier enters the battlefield, reveal the top two cards of your library. Put one of them into your hand and the other into your graveyard. If you put an artifact card into your hand this way, you gain 3 life.
this.addAbility(new EntersBattlefieldTriggeredAbility(new ChromeCourierEffect()));
}
private ChromeCourier(final ChromeCourier card) {
super(card);
}
@Override
public ChromeCourier copy() {
return new ChromeCourier(this);
}
}
class ChromeCourierEffect extends OneShotEffect {
ChromeCourierEffect() {
super(Outcome.Benefit);
staticText = "reveal the top two cards of your library. " +
"Put one of them into your hand and the other into your graveyard. " +
"If you put an artifact card into your hand this way, you gain 3 life";
}
private ChromeCourierEffect(final ChromeCourierEffect effect) {
super(effect);
}
@Override
public ChromeCourierEffect copy() {
return new ChromeCourierEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, 2));
player.revealCards(source, cards, game);
Card card;
switch (cards.size()) {
case 0:
card = null;
break;
case 1:
card = cards.getRandom(game);
break;
default:
TargetCard target = new TargetCardInLibrary();
target.withChooseHint("to hand");
player.choose(outcome, cards, target, game);
card = cards.get(target.getFirstTarget(), game);
}
player.moveCards(card, Zone.HAND, source, game);
cards.remove(card);
player.moveCards(cards, Zone.GRAVEYARD, source, game);
if (card != null && card.isArtifact()) {
player.gainLife(3, game, source);
}
return true;
}
}

View file

@ -51,6 +51,7 @@ public final class ModernHorizons2 extends ExpansionSet {
cards.add(new SetCardInfo("Chainer, Nightmare Adept", 289, Rarity.RARE, mage.cards.c.ChainerNightmareAdept.class)); cards.add(new SetCardInfo("Chainer, Nightmare Adept", 289, Rarity.RARE, mage.cards.c.ChainerNightmareAdept.class));
cards.add(new SetCardInfo("Chance Encounter", 277, Rarity.RARE, mage.cards.c.ChanceEncounter.class)); cards.add(new SetCardInfo("Chance Encounter", 277, Rarity.RARE, mage.cards.c.ChanceEncounter.class));
cards.add(new SetCardInfo("Chatterstorm", 152, Rarity.COMMON, mage.cards.c.Chatterstorm.class)); cards.add(new SetCardInfo("Chatterstorm", 152, Rarity.COMMON, mage.cards.c.Chatterstorm.class));
cards.add(new SetCardInfo("Chrome Courier", 190, Rarity.COMMON, mage.cards.c.ChromeCourier.class));
cards.add(new SetCardInfo("Combine Chrysalis", 191, Rarity.UNCOMMON, mage.cards.c.CombineChrysalis.class)); cards.add(new SetCardInfo("Combine Chrysalis", 191, Rarity.UNCOMMON, mage.cards.c.CombineChrysalis.class));
cards.add(new SetCardInfo("Constable of the Realm", 10, Rarity.UNCOMMON, mage.cards.c.ConstableOfTheRealm.class)); cards.add(new SetCardInfo("Constable of the Realm", 10, Rarity.UNCOMMON, mage.cards.c.ConstableOfTheRealm.class));
cards.add(new SetCardInfo("Counterspell", 267, Rarity.UNCOMMON, mage.cards.c.Counterspell.class)); cards.add(new SetCardInfo("Counterspell", 267, Rarity.UNCOMMON, mage.cards.c.Counterspell.class));