From d93142507d4e55ca3bcad319b1300d5f8e9c2a81 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 21 Jun 2019 09:29:28 -0400 Subject: [PATCH] Implemented Risen Reef --- Mage.Sets/src/mage/cards/r/RisenReef.java | 88 +++++++++++++++++++++++ Mage.Sets/src/mage/sets/CoreSet2020.java | 1 + 2 files changed, 89 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/r/RisenReef.java diff --git a/Mage.Sets/src/mage/cards/r/RisenReef.java b/Mage.Sets/src/mage/cards/r/RisenReef.java new file mode 100644 index 0000000000..71c38de59a --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RisenReef.java @@ -0,0 +1,88 @@ +package mage.cards.r; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +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.Zone; +import mage.filter.FilterPermanent; +import mage.game.Game; +import mage.players.Player; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class RisenReef extends CardImpl { + + private static final FilterPermanent filter + = new FilterPermanent(SubType.ELEMENTAL, "{this} or another Elemental"); + + public RisenReef(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}{U}"); + + this.subtype.add(SubType.ELEMENTAL); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever Risen Reef or another Elemental enters the battlefield under your control, look at the top card of your library. If it's a land card, you may put it onto the battlefield tapped. If you don't put the card onto the battlefield, put it into your hand. + this.addAbility(new EntersBattlefieldControlledTriggeredAbility(new RisenReefEffect(), filter)); + } + + private RisenReef(final RisenReef card) { + super(card); + } + + @Override + public RisenReef copy() { + return new RisenReef(this); + } +} + +class RisenReefEffect extends OneShotEffect { + + RisenReefEffect() { + 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. " + + "If you don't put the card onto the battlefield, put it into your hand"; + } + + private RisenReefEffect(final RisenReefEffect effect) { + super(effect); + } + + @Override + public RisenReefEffect copy() { + return new RisenReefEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + Card card = player.getLibrary().getFromTop(game); + if (card == null) { + return false; + } + player.lookAtCards("", card, game); + if (card.isLand() && player.chooseUse( + outcome, "Put " + card.getName() + " onto the battlefield tapped?", + "(otherwise put it into your hand", "To battlefield", + "To hand", source, game)) { + player.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, true, null); + } else { + player.moveCards(card, Zone.HAND, source, game); + } + return true; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/CoreSet2020.java b/Mage.Sets/src/mage/sets/CoreSet2020.java index 768760a162..84ca80b196 100644 --- a/Mage.Sets/src/mage/sets/CoreSet2020.java +++ b/Mage.Sets/src/mage/sets/CoreSet2020.java @@ -99,6 +99,7 @@ public final class CoreSet2020 extends ExpansionSet { cards.add(new SetCardInfo("Reckless Air Strike", 154, Rarity.COMMON, mage.cards.r.RecklessAirStrike.class)); cards.add(new SetCardInfo("Renowned Weaponsmith", 72, Rarity.UNCOMMON, mage.cards.r.RenownedWeaponsmith.class)); cards.add(new SetCardInfo("Retributive Wand", 236, Rarity.UNCOMMON, mage.cards.r.RetributiveWand.class)); + cards.add(new SetCardInfo("Risen Reef", 217, Rarity.UNCOMMON, mage.cards.r.RisenReef.class)); cards.add(new SetCardInfo("Rotting Regisaur", 111, Rarity.RARE, mage.cards.r.RottingRegisaur.class)); cards.add(new SetCardInfo("Rule of Law", 35, Rarity.UNCOMMON, mage.cards.r.RuleOfLaw.class)); cards.add(new SetCardInfo("Scholar of the Ages", 74, Rarity.UNCOMMON, mage.cards.s.ScholarOfTheAges.class));