diff --git a/Mage.Sets/src/mage/cards/r/RaidersKarve.java b/Mage.Sets/src/mage/cards/r/RaidersKarve.java new file mode 100644 index 0000000000..aab9c532f8 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RaidersKarve.java @@ -0,0 +1,89 @@ +package mage.cards.r; + +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.CrewAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.CardsImpl; +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 java.util.UUID; + +/** + * @author TheElk801 + */ +public final class RaidersKarve extends CardImpl { + + public RaidersKarve(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); + + this.subtype.add(SubType.VEHICLE); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Whenever Raiders' Karve attacks, look at the top card of your library. If it's a land card, you may put it onto the battlefield tapped. + this.addAbility(new AttacksTriggeredAbility(new RaidersKarveEffect(), false)); + + // Crew 3 + this.addAbility(new CrewAbility(3)); + } + + private RaidersKarve(final RaidersKarve card) { + super(card); + } + + @Override + public RaidersKarve copy() { + return new RaidersKarve(this); + } +} + +class RaidersKarveEffect extends OneShotEffect { + + RaidersKarveEffect() { + super(Outcome.Benefit); + staticText = "look at the top card of your library. " + + "If it's a land card, you may put it onto the battlefield tapped"; + } + + private RaidersKarveEffect(final RaidersKarveEffect effect) { + super(effect); + } + + @Override + public RaidersKarveEffect copy() { + return new RaidersKarveEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (controller == null || sourceObject == null) { + return false; + } + Card card = controller.getLibrary().getFromTop(game); + if (card == null) { + return true; + } + controller.lookAtCards(sourceObject.getIdName(), new CardsImpl(card), game); + if (!card.isLand()) { + return true; + } + String message = "Put " + card.getLogName() + " onto the battlefield tapped?"; + if (controller.chooseUse(Outcome.PutLandInPlay, message, source, game)) { + controller.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/Kaldheim.java b/Mage.Sets/src/mage/sets/Kaldheim.java index 1403bf7445..5440ccdb7d 100644 --- a/Mage.Sets/src/mage/sets/Kaldheim.java +++ b/Mage.Sets/src/mage/sets/Kaldheim.java @@ -173,6 +173,7 @@ public final class Kaldheim extends ExpansionSet { cards.add(new SetCardInfo("Pilfering Hawk", 71, Rarity.COMMON, mage.cards.p.PilferingHawk.class)); cards.add(new SetCardInfo("Plains", 394, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Pyre of Heroes", 241, Rarity.RARE, mage.cards.p.PyreOfHeroes.class)); + cards.add(new SetCardInfo("Raiders' Karve", 242, Rarity.COMMON, mage.cards.r.RaidersKarve.class)); cards.add(new SetCardInfo("Raise the Draugr", 105, Rarity.COMMON, mage.cards.r.RaiseTheDraugr.class)); cards.add(new SetCardInfo("Rally the Ranks", 20, Rarity.RARE, mage.cards.r.RallyTheRanks.class)); cards.add(new SetCardInfo("Rampage of the Valkyries", 393, Rarity.UNCOMMON, mage.cards.r.RampageOfTheValkyries.class));