Implemented Risen Reef

This commit is contained in:
Evan Kranzler 2019-06-21 09:29:28 -04:00
parent 545e28cbbc
commit d93142507d
2 changed files with 89 additions and 0 deletions

View file

@ -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;
}
}

View file

@ -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));