From 5068339db35a454c8c89371df173ad2d811f1d9c Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 16 Sep 2021 21:10:54 -0400 Subject: [PATCH] [MID] Implemented Jerren, Corrupted Bishop / Ormendahl, the Corrupter --- .../mage/cards/j/JerrenCorruptedBishop.java | 139 ++++++++++++++++++ .../mage/cards/o/OrmendahlTheCorrupter.java | 62 ++++++++ .../src/mage/sets/InnistradMidnightHunt.java | 2 + 3 files changed, 203 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/j/JerrenCorruptedBishop.java create mode 100644 Mage.Sets/src/mage/cards/o/OrmendahlTheCorrupter.java diff --git a/Mage.Sets/src/mage/cards/j/JerrenCorruptedBishop.java b/Mage.Sets/src/mage/cards/j/JerrenCorruptedBishop.java new file mode 100644 index 0000000000..aafbae1716 --- /dev/null +++ b/Mage.Sets/src/mage/cards/j/JerrenCorruptedBishop.java @@ -0,0 +1,139 @@ +package mage.cards.j; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.condition.Condition; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.LoseLifeSourceControllerEffect; +import mage.abilities.effects.common.TransformSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.LifelinkAbility; +import mage.abilities.keyword.TransformAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.ZoneChangeEvent; +import mage.game.permanent.PermanentToken; +import mage.game.permanent.token.HumanToken; +import mage.players.Player; +import mage.target.TargetPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class JerrenCorruptedBishop extends CardImpl { + + private static final FilterPermanent filter = new FilterControlledPermanent(SubType.HUMAN); + + public JerrenCorruptedBishop(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.CLERIC); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + this.transformable = true; + this.secondSideCardClazz = mage.cards.o.OrmendahlTheCorrupter.class; + + // Whenever Jerren, Corrupted Bishop enters the battlefield or another nontoken Human you control dies, you lose 1 life and create a 1/1 white Human creature token. + this.addAbility(new JerrenCorruptedBishopTriggeredAbility()); + + // {2}: Target Human you control gains lifelink until end of turn. + Ability ability = new SimpleActivatedAbility(new GainAbilityTargetEffect( + LifelinkAbility.getInstance(), Duration.EndOfTurn + ), new GenericManaCost(2)); + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + + // At the beginning of your end step, if you have exactly 13 life, you may pay {4}{B}{B}. If you do, transform Jerren. + this.addAbility(new TransformAbility()); + this.addAbility(new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD, new DoIfCostPaid( + new TransformSourceEffect(true), new ManaCostsImpl<>("{4}{B}{B}") + ), TargetController.YOU, JerrenCorruptedBishopCondition.instance, false)); + } + + private JerrenCorruptedBishop(final JerrenCorruptedBishop card) { + super(card); + } + + @Override + public JerrenCorruptedBishop copy() { + return new JerrenCorruptedBishop(this); + } +} + +enum JerrenCorruptedBishopCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + return player != null && player.getLife() == 13; + } + + @Override + public String toString() { + return "if you have exactly 13 life"; + } +} + +class JerrenCorruptedBishopTriggeredAbility extends TriggeredAbilityImpl { + + JerrenCorruptedBishopTriggeredAbility() { + super(Zone.BATTLEFIELD, new LoseLifeSourceControllerEffect(1)); + this.addEffect(new CreateTokenEffect(new HumanToken())); + } + + private JerrenCorruptedBishopTriggeredAbility(final JerrenCorruptedBishopTriggeredAbility ability) { + super(ability); + } + + @Override + public JerrenCorruptedBishopTriggeredAbility copy() { + return new JerrenCorruptedBishopTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD + || event.getType() == GameEvent.EventType.ZONE_CHANGE; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + switch (event.getType()) { + case ENTERS_THE_BATTLEFIELD: + return event.getSourceId().equals(getSourceId()); + case ZONE_CHANGE: + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + return zEvent.isDiesEvent() + && zEvent.getTarget() != null + && !zEvent.getTarget().getId().equals(getSourceId()) + && zEvent.getTarget().isControlledBy(getControllerId()) + && !(zEvent.getTarget() instanceof PermanentToken) + && zEvent.getTarget().hasSubtype(SubType.HUMAN, game); + + default: + return false; + } + } + + @Override + public String getRule() { + return "Whenever {this} enters the battlefield or another nontoken Human you control dies, " + + "you lose 1 life and create a 1/1 white Human creature token."; + } +} diff --git a/Mage.Sets/src/mage/cards/o/OrmendahlTheCorrupter.java b/Mage.Sets/src/mage/cards/o/OrmendahlTheCorrupter.java new file mode 100644 index 0000000000..59c786aa5d --- /dev/null +++ b/Mage.Sets/src/mage/cards/o/OrmendahlTheCorrupter.java @@ -0,0 +1,62 @@ +package mage.cards.o; + +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.LifelinkAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.filter.StaticFilters; +import mage.target.common.TargetControlledPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class OrmendahlTheCorrupter extends CardImpl { + + public OrmendahlTheCorrupter(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, ""); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.DEMON); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + this.color.setBlack(true); + this.transformable = true; + this.nightCard = true; + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Lifelink + this.addAbility(LifelinkAbility.getInstance()); + + // Sacrifice another creature: Draw a card. + this.addAbility(new SimpleActivatedAbility( + new DrawCardSourceControllerEffect(1), + new SacrificeTargetCost(new TargetControlledPermanent( + StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE + )) + )); + } + + private OrmendahlTheCorrupter(final OrmendahlTheCorrupter card) { + super(card); + } + + @Override + public OrmendahlTheCorrupter copy() { + return new OrmendahlTheCorrupter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java b/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java index b2efb34902..1c2a799e55 100644 --- a/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java +++ b/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java @@ -181,6 +181,7 @@ public final class InnistradMidnightHunt extends ExpansionSet { cards.add(new SetCardInfo("Island", 270, Rarity.LAND, mage.cards.basiclands.Island.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Jack-o'-Lantern", 254, Rarity.COMMON, mage.cards.j.JackOLantern.class)); cards.add(new SetCardInfo("Jadar, Ghoulcaller of Nephalia", 108, Rarity.RARE, mage.cards.j.JadarGhoulcallerOfNephalia.class)); + cards.add(new SetCardInfo("Jerren, Corrupted Bishop", 109, Rarity.MYTHIC, mage.cards.j.JerrenCorruptedBishop.class)); cards.add(new SetCardInfo("Join the Dance", 229, Rarity.UNCOMMON, mage.cards.j.JoinTheDance.class)); cards.add(new SetCardInfo("Katilda, Dawnhart Prime", 230, Rarity.RARE, mage.cards.k.KatildaDawnhartPrime.class)); cards.add(new SetCardInfo("Kessig Naturalist", 231, Rarity.UNCOMMON, mage.cards.k.KessigNaturalist.class)); @@ -224,6 +225,7 @@ public final class InnistradMidnightHunt extends ExpansionSet { cards.add(new SetCardInfo("Olivia's Midnight Ambush", 118, Rarity.COMMON, mage.cards.o.OliviasMidnightAmbush.class)); cards.add(new SetCardInfo("Ominous Roost", 65, Rarity.UNCOMMON, mage.cards.o.OminousRoost.class)); cards.add(new SetCardInfo("Organ Hoarder", 66, Rarity.COMMON, mage.cards.o.OrganHoarder.class)); + cards.add(new SetCardInfo("Ormendahl, the Corrupter", 109, Rarity.MYTHIC, mage.cards.o.OrmendahlTheCorrupter.class)); cards.add(new SetCardInfo("Otherworldly Gaze", 67, Rarity.COMMON, mage.cards.o.OtherworldlyGaze.class)); cards.add(new SetCardInfo("Outland Liberator", 190, Rarity.UNCOMMON, mage.cards.o.OutlandLiberator.class)); cards.add(new SetCardInfo("Overgrown Farmland", 265, Rarity.RARE, mage.cards.o.OvergrownFarmland.class));