From f690327c554ee57b3dd674c42bb2bd4b63e91cb7 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sun, 31 Oct 2021 18:06:00 -0400 Subject: [PATCH] [VOW] Implemented Olivia, Crimson Bride --- .../src/mage/cards/o/OliviaCrimsonBride.java | 134 ++++++++++++++++++ .../src/mage/sets/InnistradCrimsonVow.java | 1 + 2 files changed, 135 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/o/OliviaCrimsonBride.java diff --git a/Mage.Sets/src/mage/cards/o/OliviaCrimsonBride.java b/Mage.Sets/src/mage/cards/o/OliviaCrimsonBride.java new file mode 100644 index 0000000000..d0ec11c316 --- /dev/null +++ b/Mage.Sets/src/mage/cards/o/OliviaCrimsonBride.java @@ -0,0 +1,134 @@ +package mage.cards.o; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.StateTriggeredAbility; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.FilterPermanent; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.targetpointer.FixedTarget; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class OliviaCrimsonBride extends CardImpl { + + public OliviaCrimsonBride(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}{R}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.VAMPIRE); + this.subtype.add(SubType.NOBLE); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Haste + this.addAbility(HasteAbility.getInstance()); + + // Whenever Olivia, Crimson Bride attacks, return target creature card from your graveyard to the battlefield tapped and attacking. It gains "When you don't control a legendary Vampire, exile this creature." + Ability ability = new AttacksTriggeredAbility(new OliviaCrimsonBrideEffect()); + ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD)); + this.addAbility(ability); + } + + private OliviaCrimsonBride(final OliviaCrimsonBride card) { + super(card); + } + + @Override + public OliviaCrimsonBride copy() { + return new OliviaCrimsonBride(this); + } +} + +class OliviaCrimsonBrideEffect extends OneShotEffect { + + OliviaCrimsonBrideEffect() { + super(Outcome.Benefit); + staticText = "return target creature card from your graveyard to the battlefield tapped and attacking. " + + "It gains \"When you don't control a legendary Vampire, exile this creature.\""; + } + + private OliviaCrimsonBrideEffect(final OliviaCrimsonBrideEffect effect) { + super(effect); + } + + @Override + public OliviaCrimsonBrideEffect copy() { + return new OliviaCrimsonBrideEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { + return false; + } + Card card = game.getCard(getTargetPointer().getFirst(game, source)); + if (card == null) { + return false; + } + controller.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null); + Permanent permanent = game.getPermanent(card.getId()); + if (permanent == null) { + return false; + } + game.getCombat().addAttackingCreature(permanent.getId(), game); + game.addEffect(new GainAbilityTargetEffect( + new OliviaCrimsonBrideAbility(), Duration.Custom + ).setTargetPointer(new FixedTarget(permanent, game)), source); + return true; + } +} + +class OliviaCrimsonBrideAbility extends StateTriggeredAbility { + + private static final FilterPermanent filter = new FilterPermanent(); + + static { + filter.add(SuperType.LEGENDARY.getPredicate()); + filter.add(SubType.VAMPIRE.getPredicate()); + } + + public OliviaCrimsonBrideAbility() { + super(Zone.BATTLEFIELD, new ExileSourceEffect()); + } + + public OliviaCrimsonBrideAbility(final OliviaCrimsonBrideAbility ability) { + super(ability); + } + + @Override + public OliviaCrimsonBrideAbility copy() { + return new OliviaCrimsonBrideAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return game.getBattlefield().count(filter, getSourceId(), getControllerId(), game) < 1; + } + + @Override + public String getRule() { + return "When you don't control a legendary Vampire, exile this creature."; + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java index 4a9c9aba5b..6bb2660a14 100644 --- a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java +++ b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java @@ -62,6 +62,7 @@ public final class InnistradCrimsonVow extends ExpansionSet { cards.add(new SetCardInfo("Massive Might", 208, Rarity.COMMON, mage.cards.m.MassiveMight.class)); cards.add(new SetCardInfo("Mindleech Ghoul", 122, Rarity.COMMON, mage.cards.m.MindleechGhoul.class)); cards.add(new SetCardInfo("Mountain", 274, Rarity.LAND, mage.cards.basiclands.Mountain.class, FULL_ART_BFZ_VARIOUS)); + cards.add(new SetCardInfo("Olivia, Crimson Bride", 245, Rarity.MYTHIC, mage.cards.o.OliviaCrimsonBride.class)); cards.add(new SetCardInfo("Overcharged Amalgam", 71, Rarity.RARE, mage.cards.o.OverchargedAmalgam.class)); cards.add(new SetCardInfo("Path of Peril", 124, Rarity.RARE, mage.cards.p.PathOfPeril.class)); cards.add(new SetCardInfo("Plains", 268, Rarity.LAND, mage.cards.basiclands.Plains.class, FULL_ART_BFZ_VARIOUS));