From 945bdd2fd095abb4b6139dee09031e0f414e58d2 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 30 Oct 2020 08:02:18 -0400 Subject: [PATCH] [CMR] Implemented Brinelin, the Moon Kraken --- .../mage/cards/b/BrinelinTheMoonKraken.java | 94 +++++++++++++++++++ Mage.Sets/src/mage/sets/CommanderLegends.java | 1 + 2 files changed, 95 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/b/BrinelinTheMoonKraken.java diff --git a/Mage.Sets/src/mage/cards/b/BrinelinTheMoonKraken.java b/Mage.Sets/src/mage/cards/b/BrinelinTheMoonKraken.java new file mode 100644 index 00000000000..bb99efe6294 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BrinelinTheMoonKraken.java @@ -0,0 +1,94 @@ +package mage.cards.b; + +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.keyword.PartnerAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.stack.Spell; +import mage.target.common.TargetNonlandPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class BrinelinTheMoonKraken extends CardImpl { + + public BrinelinTheMoonKraken(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{6}{U}{U}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.KRAKEN); + this.power = new MageInt(6); + this.toughness = new MageInt(8); + + // When Brinelin, the Moon Kraken enters the battlefield or whenever you cast a spell with converted mana cost 6 or greater, you may return target nonland permanent to its owner's hand. + this.addAbility(new BrinelinTheMoonKrakenTriggeredAbility()); + + // Partner + this.addAbility(PartnerAbility.getInstance()); + } + + private BrinelinTheMoonKraken(final BrinelinTheMoonKraken card) { + super(card); + } + + @Override + public BrinelinTheMoonKraken copy() { + return new BrinelinTheMoonKraken(this); + } +} + +class BrinelinTheMoonKrakenTriggeredAbility extends TriggeredAbilityImpl { + + BrinelinTheMoonKrakenTriggeredAbility() { + super(Zone.ALL, new ReturnToHandTargetEffect(), true); + this.addTarget(new TargetNonlandPermanent()); + } + + private BrinelinTheMoonKrakenTriggeredAbility(final BrinelinTheMoonKrakenTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.SPELL_CAST + || event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + switch (event.getType()) { + case SPELL_CAST: + if (!event.getPlayerId().equals(this.getControllerId()) + || game.getPermanent(getSourceId()) == null) { + return false; + } + Spell spell = game.getSpellOrLKIStack(event.getTargetId()); + return spell != null && spell.getConvertedManaCost() >= 6; + case ENTERS_THE_BATTLEFIELD: + return event.getTargetId().equals(getSourceId()); + default: + return false; + } + } + + @Override + public String getRule() { + return "When {this} enters the battlefield or whenever you cast a spell with converted mana cost " + + "6 or greater, you may return target nonland permanent to its owner's hand."; + } + + @Override + public BrinelinTheMoonKrakenTriggeredAbility copy() { + return new BrinelinTheMoonKrakenTriggeredAbility(this); + } +} diff --git a/Mage.Sets/src/mage/sets/CommanderLegends.java b/Mage.Sets/src/mage/sets/CommanderLegends.java index dc66240eb72..54f776cf27e 100644 --- a/Mage.Sets/src/mage/sets/CommanderLegends.java +++ b/Mage.Sets/src/mage/sets/CommanderLegends.java @@ -36,6 +36,7 @@ public final class CommanderLegends extends ExpansionSet { cards.add(new SetCardInfo("Bladegriff Prototype", 300, Rarity.RARE, mage.cards.b.BladegriffPrototype.class)); cards.add(new SetCardInfo("Brazen Freebooter", 164, Rarity.COMMON, mage.cards.b.BrazenFreebooter.class)); cards.add(new SetCardInfo("Briarblade Adept", 111, Rarity.COMMON, mage.cards.b.BriarbladeAdept.class)); + cards.add(new SetCardInfo("Brinelin, the Moon Kraken", 60, Rarity.UNCOMMON, mage.cards.b.BrinelinTheMoonKraken.class)); cards.add(new SetCardInfo("Cast Down", 112, Rarity.UNCOMMON, mage.cards.c.CastDown.class)); cards.add(new SetCardInfo("Charcoal Diamond", 303, Rarity.COMMON, mage.cards.c.CharcoalDiamond.class)); cards.add(new SetCardInfo("Coastline Marauders", 168, Rarity.UNCOMMON, mage.cards.c.CoastlineMarauders.class));