From ec1a55531277309ac034dd45a319dd7beedc5f23 Mon Sep 17 00:00:00 2001 From: Daniel Bomar Date: Sat, 5 Feb 2022 17:21:04 -0600 Subject: [PATCH] [NEO] Implemented Greasefang, Okiba Boss --- .../src/mage/cards/g/GreasefangOkibaBoss.java | 97 +++++++++++++++++++ .../src/mage/sets/KamigawaNeonDynasty.java | 1 + 2 files changed, 98 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/g/GreasefangOkibaBoss.java diff --git a/Mage.Sets/src/mage/cards/g/GreasefangOkibaBoss.java b/Mage.Sets/src/mage/cards/g/GreasefangOkibaBoss.java new file mode 100644 index 0000000000..4a21a1d2ca --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GreasefangOkibaBoss.java @@ -0,0 +1,97 @@ +package mage.cards.g; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfCombatTriggeredAbility; +import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.Card; +import mage.constants.*; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author weirddan455 + */ +public final class GreasefangOkibaBoss extends CardImpl { + + private static final FilterCard filter = new FilterCard("Vehicle card from your graveyard"); + + static { + filter.add(SubType.VEHICLE.getPredicate()); + } + + public GreasefangOkibaBoss(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}{B}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.RAT); + this.subtype.add(SubType.PILOT); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // At the beginning of combat on your turn, return target Vehicle card from your graveyard to the battlefield. It gains haste. Return it your hand at beginning of the next end step. + Ability ability = new BeginningOfCombatTriggeredAbility(new GreasefangOkibaBossEffect(), TargetController.YOU, false); + ability.addTarget(new TargetCardInYourGraveyard(filter)); + this.addAbility(ability); + } + + private GreasefangOkibaBoss(final GreasefangOkibaBoss card) { + super(card); + } + + @Override + public GreasefangOkibaBoss copy() { + return new GreasefangOkibaBoss(this); + } +} + +class GreasefangOkibaBossEffect extends OneShotEffect { + + public GreasefangOkibaBossEffect() { + super(Outcome.PutCardInPlay); + this.staticText = "return target Vehicle card from your graveyard to the battlefield. It gains haste. Return it your hand at beginning of the next end step"; + } + + private GreasefangOkibaBossEffect(final GreasefangOkibaBossEffect effect) { + super(effect); + } + + @Override + public GreasefangOkibaBossEffect copy() { + return new GreasefangOkibaBossEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Card card = game.getCard(source.getFirstTarget()); + if (controller == null || card == null || game.getState().getZone(card.getId()) != Zone.GRAVEYARD) { + return false; + } + controller.moveCards(card, Zone.BATTLEFIELD, source, game); + Permanent permanent = game.getPermanent(card.getId()); + if (permanent != null) { + ContinuousEffect hasteEffect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom); + hasteEffect.setTargetPointer(new FixedTarget(permanent, game)); + game.addEffect(hasteEffect, source); + Effect bounceEffect = new ReturnToHandTargetEffect().setText("return it to your hand"); + bounceEffect.setTargetPointer(new FixedTarget(permanent, game)); + game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(bounceEffect), source); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java index ed50c3312b..80c48ed1b6 100644 --- a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java +++ b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java @@ -108,6 +108,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet { cards.add(new SetCardInfo("Goro-Goro, Disciple of Ryusei", 145, Rarity.RARE, mage.cards.g.GoroGoroDiscipleOfRyusei.class)); cards.add(new SetCardInfo("Grafted Growth", 188, Rarity.COMMON, mage.cards.g.GraftedGrowth.class)); cards.add(new SetCardInfo("Gravelighter", 98, Rarity.UNCOMMON, mage.cards.g.Gravelighter.class)); + cards.add(new SetCardInfo("Greasefang, Okiba Boss", 220, Rarity.RARE, mage.cards.g.GreasefangOkibaBoss.class)); cards.add(new SetCardInfo("Greater Tanuki", 189, Rarity.COMMON, mage.cards.g.GreaterTanuki.class)); cards.add(new SetCardInfo("Guardians of Oboro", 56, Rarity.COMMON, mage.cards.g.GuardiansOfOboro.class)); cards.add(new SetCardInfo("Hand of Enlightenment", 11, Rarity.COMMON, mage.cards.h.HandOfEnlightenment.class));