From 7d901c46ebc132e49b15e6e0b8b5d8a005bf8bbe Mon Sep 17 00:00:00 2001 From: theelk801 Date: Sat, 8 Apr 2023 18:12:53 -0400 Subject: [PATCH] [MOM] Implement Halo-Charged Skaab --- .../src/mage/cards/h/HaloChargedSkaab.java | 91 +++++++++++++++++++ .../src/mage/sets/MarchOfTheMachine.java | 1 + 2 files changed, 92 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/h/HaloChargedSkaab.java diff --git a/Mage.Sets/src/mage/cards/h/HaloChargedSkaab.java b/Mage.Sets/src/mage/cards/h/HaloChargedSkaab.java new file mode 100644 index 0000000000..a61e0cd504 --- /dev/null +++ b/Mage.Sets/src/mage/cards/h/HaloChargedSkaab.java @@ -0,0 +1,91 @@ +package mage.cards.h; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.MillCardsEachPlayerEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.constants.TargetController; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.common.TargetCardInYourGraveyard; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class HaloChargedSkaab extends CardImpl { + + public HaloChargedSkaab(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{U}"); + + this.subtype.add(SubType.ZOMBIE); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // When Halo-Charged Skaab enters the battlefield, each player mills two cards. Then you may put an instant, sorcery, or battle card from your graveyard on top of your library. + Ability ability = new EntersBattlefieldTriggeredAbility( + new MillCardsEachPlayerEffect(2, TargetController.EACH_PLAYER) + ); + ability.addEffect(new HaloChargedSkaabEffect()); + this.addAbility(ability); + } + + private HaloChargedSkaab(final HaloChargedSkaab card) { + super(card); + } + + @Override + public HaloChargedSkaab copy() { + return new HaloChargedSkaab(this); + } +} + +class HaloChargedSkaabEffect extends OneShotEffect { + + private static final FilterCard filter = new FilterCard("instant, sorcery, or battle card from your graveyard"); + + static { + filter.add(Predicates.or( + CardType.INSTANT.getPredicate(), + CardType.SORCERY.getPredicate(), + CardType.BATTLE.getPredicate() + )); + } + + HaloChargedSkaabEffect() { + super(Outcome.Benefit); + staticText = "then you may put an instant, sorcery, or battle card from your graveyard on top of your library"; + } + + private HaloChargedSkaabEffect(final HaloChargedSkaabEffect effect) { + super(effect); + } + + @Override + public HaloChargedSkaabEffect copy() { + return new HaloChargedSkaabEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + TargetCard target = new TargetCardInYourGraveyard(0, 1, filter, true); + player.choose(outcome, target, source, game); + Card card = game.getCard(target.getFirstTarget()); + return card != null && player.putCardsOnTopOfLibrary(card, game, source, false); + } +} diff --git a/Mage.Sets/src/mage/sets/MarchOfTheMachine.java b/Mage.Sets/src/mage/sets/MarchOfTheMachine.java index 9d1552394c..0df517fcb4 100644 --- a/Mage.Sets/src/mage/sets/MarchOfTheMachine.java +++ b/Mage.Sets/src/mage/sets/MarchOfTheMachine.java @@ -106,6 +106,7 @@ public final class MarchOfTheMachine extends ExpansionSet { cards.add(new SetCardInfo("Golden-Scale Aeronaut", 15, Rarity.COMMON, mage.cards.g.GoldenScaleAeronaut.class)); cards.add(new SetCardInfo("Grafted Butcher", 109, Rarity.RARE, mage.cards.g.GraftedButcher.class)); cards.add(new SetCardInfo("Halo Hopper", 260, Rarity.COMMON, mage.cards.h.HaloHopper.class)); + cards.add(new SetCardInfo("Halo-Charged Skaab", 60, Rarity.COMMON, mage.cards.h.HaloChargedSkaab.class)); cards.add(new SetCardInfo("Hangar Scrounger", 142, Rarity.COMMON, mage.cards.h.HangarScrounger.class)); cards.add(new SetCardInfo("Harried Artisan", 143, Rarity.UNCOMMON, mage.cards.h.HarriedArtisan.class)); cards.add(new SetCardInfo("Heliod, the Radiant Dawn", 17, Rarity.RARE, mage.cards.h.HeliodTheRadiantDawn.class));