diff --git a/Mage.Sets/src/mage/cards/b/Boing.java b/Mage.Sets/src/mage/cards/b/Boing.java new file mode 100644 index 0000000000..a46eecff6d --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/Boing.java @@ -0,0 +1,69 @@ +package mage.cards.b; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class Boing extends CardImpl { + + public Boing(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}"); + + // Return target creature to its owner's hand, then roll a six-sided die. If the result is 3 or less, scry a number of cards equal to the result. + this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); + this.getSpellAbility().addEffect(new BoingEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + private Boing(final Boing card) { + super(card); + } + + @Override + public Boing copy() { + return new Boing(this); + } +} + +class BoingEffect extends OneShotEffect { + + BoingEffect() { + super(Outcome.Benefit); + staticText = ", then roll a six-sided die. If the result is 3 or less, " + + "scry a number of cards equal to the result"; + } + + private BoingEffect(final BoingEffect effect) { + super(effect); + } + + @Override + public BoingEffect copy() { + return new BoingEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + int result = player.rollDice(outcome, source, game, 6); + if (result <= 3) { + player.scry(result, source, game); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/Unfinity.java b/Mage.Sets/src/mage/sets/Unfinity.java index cfc4f6b4ba..40ca04ccb1 100644 --- a/Mage.Sets/src/mage/sets/Unfinity.java +++ b/Mage.Sets/src/mage/sets/Unfinity.java @@ -22,6 +22,7 @@ public final class Unfinity extends ExpansionSet { cards.add(new SetCardInfo("Attempted Murder", 66, Rarity.UNCOMMON, mage.cards.a.AttemptedMurder.class)); cards.add(new SetCardInfo("Blood Crypt", 279, Rarity.RARE, mage.cards.b.BloodCrypt.class)); + cards.add(new SetCardInfo("Boing!", 40, Rarity.COMMON, mage.cards.b.Boing.class)); cards.add(new SetCardInfo("Breeding Pool", 286, Rarity.RARE, mage.cards.b.BreedingPool.class)); cards.add(new SetCardInfo("Clown Car", 186, Rarity.RARE, mage.cards.c.ClownCar.class)); cards.add(new SetCardInfo("Forest", 239, Rarity.LAND, mage.cards.basiclands.Forest.class, FULL_ART_BFZ_VARIOUS));