From 324b3b83d687e812ef9affeb925c0739e4be191e Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 5 Nov 2021 08:57:45 -0400 Subject: [PATCH] [VOW] Implemented Diver Skaab --- Mage.Sets/src/mage/cards/d/DiverSkaab.java | 79 +++++++++++++++++++ .../src/mage/sets/InnistradCrimsonVow.java | 1 + 2 files changed, 80 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/d/DiverSkaab.java diff --git a/Mage.Sets/src/mage/cards/d/DiverSkaab.java b/Mage.Sets/src/mage/cards/d/DiverSkaab.java new file mode 100644 index 0000000000..5a4897b176 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DiverSkaab.java @@ -0,0 +1,79 @@ +package mage.cards.d; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ExploitCreatureTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.PutOnLibraryTargetEffect; +import mage.abilities.keyword.ExploitAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class DiverSkaab extends CardImpl { + + public DiverSkaab(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); + + this.subtype.add(SubType.ZOMBIE); + this.power = new MageInt(3); + this.toughness = new MageInt(5); + + // Exploit + this.addAbility(new ExploitAbility()); + + // When Diver Skaab exploits a creature, target creature's owner puts it on the top or bottom of their library. + Ability ability = new ExploitCreatureTriggeredAbility(new DiverSkaabEffect()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + private DiverSkaab(final DiverSkaab card) { + super(card); + } + + @Override + public DiverSkaab copy() { + return new DiverSkaab(this); + } +} + +class DiverSkaabEffect extends OneShotEffect { + + DiverSkaabEffect() { + super(Outcome.Removal); + staticText = "target creature's owner puts it on the top or bottom of their library"; + } + + private DiverSkaabEffect(final DiverSkaabEffect effect) { + super(effect); + } + + @Override + public DiverSkaabEffect copy() { + return new DiverSkaabEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(game.getOwnerId(source.getFirstTarget())); + if (player == null) { + return false; + } + if (player.chooseUse(Outcome.Detriment, "Put the targeted object on the top or bottom of your library?", + "", "Top", "Bottom", source, game)) { + return new PutOnLibraryTargetEffect(true).apply(game, source); + } + return new PutOnLibraryTargetEffect(false).apply(game, source); + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java index c7b7ce3a5f..ae6f2bed68 100644 --- a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java +++ b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java @@ -73,6 +73,7 @@ public final class InnistradCrimsonVow extends ExpansionSet { cards.add(new SetCardInfo("Dig Up", 197, Rarity.RARE, mage.cards.d.DigUp.class)); cards.add(new SetCardInfo("Dire-Strain Anarchist", 181, Rarity.MYTHIC, mage.cards.d.DireStrainAnarchist.class)); cards.add(new SetCardInfo("Distracting Geist", 9, Rarity.UNCOMMON, mage.cards.d.DistractingGeist.class)); + cards.add(new SetCardInfo("Diver Skaab", 56, Rarity.UNCOMMON, mage.cards.d.DiverSkaab.class)); cards.add(new SetCardInfo("Dominating Vampire", 154, Rarity.RARE, mage.cards.d.DominatingVampire.class)); cards.add(new SetCardInfo("Dormant Grove", 198, Rarity.UNCOMMON, mage.cards.d.DormantGrove.class)); cards.add(new SetCardInfo("Dreadfeast Demon", 108, Rarity.RARE, mage.cards.d.DreadfeastDemon.class));