From 203765ec00efdb0955dfe19e81e7b481d3999bfd Mon Sep 17 00:00:00 2001 From: theelk801 Date: Fri, 7 Apr 2023 08:46:16 -0400 Subject: [PATCH] [MOM] Implement Volcanic Spite --- Mage.Sets/src/mage/cards/v/VolcanicSpite.java | 93 +++++++++++++++++++ .../src/mage/sets/MarchOfTheMachine.java | 1 + 2 files changed, 94 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/v/VolcanicSpite.java diff --git a/Mage.Sets/src/mage/cards/v/VolcanicSpite.java b/Mage.Sets/src/mage/cards/v/VolcanicSpite.java new file mode 100644 index 00000000000..40d526028b5 --- /dev/null +++ b/Mage.Sets/src/mage/cards/v/VolcanicSpite.java @@ -0,0 +1,93 @@ +package mage.cards.v; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.TargetPermanent; +import mage.target.common.TargetCardInHand; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class VolcanicSpite extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("creature, planeswalker, or battle"); + + static { + filter.add(Predicates.or( + CardType.CREATURE.getPredicate(), + CardType.PLANESWALKER.getPredicate(), + CardType.BATTLE.getPredicate() + )); + } + + public VolcanicSpite(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}"); + + // Volcanic Spite deals 3 damage to target creature, planeswalker, or battle. You may put a card from your hand on the bottom of your library. If you do, draw a card. + this.getSpellAbility().addEffect(new DamageTargetEffect(3)); + this.getSpellAbility().addEffect(new VolcanicSpiteEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + } + + private VolcanicSpite(final VolcanicSpite card) { + super(card); + } + + @Override + public VolcanicSpite copy() { + return new VolcanicSpite(this); + } +} + +class VolcanicSpiteEffect extends OneShotEffect { + + VolcanicSpiteEffect() { + super(Outcome.Benefit); + staticText = "you may put a card from your hand on the bottom of your library. If you do, draw a card"; + } + + private VolcanicSpiteEffect(final VolcanicSpiteEffect effect) { + super(effect); + } + + @Override + public VolcanicSpiteEffect copy() { + return new VolcanicSpiteEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null + || player.getHand().isEmpty() + || !player.chooseUse( + outcome, "Put a card from your hand " + + "on the bottom of your library?", source, game + )) { + return false; + } + TargetCard target = new TargetCardInHand(); + player.choose(outcome, player.getHand(), target, game); + Card card = game.getCard(target.getFirstTarget()); + if (card == null) { + return false; + } + if (player.putCardsOnBottomOfLibrary(card, game, source, false)) { + player.drawCards(1, source, game); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/MarchOfTheMachine.java b/Mage.Sets/src/mage/sets/MarchOfTheMachine.java index 6554ed3d8b8..d9af9767968 100644 --- a/Mage.Sets/src/mage/sets/MarchOfTheMachine.java +++ b/Mage.Sets/src/mage/sets/MarchOfTheMachine.java @@ -204,6 +204,7 @@ public final class MarchOfTheMachine extends ExpansionSet { cards.add(new SetCardInfo("Transcendent Message", 83, Rarity.RARE, mage.cards.t.TranscendentMessage.class)); cards.add(new SetCardInfo("Urn of Godfire", 266, Rarity.COMMON, mage.cards.u.UrnOfGodfire.class)); cards.add(new SetCardInfo("Vanquish the Weak", 129, Rarity.COMMON, mage.cards.v.VanquishTheWeak.class)); + cards.add(new SetCardInfo("Volcanic Spite", 170, Rarity.COMMON, mage.cards.v.VolcanicSpite.class)); cards.add(new SetCardInfo("Voldaren Thrillseeker", 171, Rarity.RARE, mage.cards.v.VoldarenThrillseeker.class)); cards.add(new SetCardInfo("War Historian", 214, Rarity.COMMON, mage.cards.w.WarHistorian.class)); cards.add(new SetCardInfo("War-Trained Slasher", 172, Rarity.COMMON, mage.cards.w.WarTrainedSlasher.class));