From 701940ced71f7cc13e65ccf23b9f524e81dbcf3a Mon Sep 17 00:00:00 2001 From: theelk801 Date: Sun, 9 Apr 2023 18:24:18 -0400 Subject: [PATCH] [MOM] Implement Orthion, Hero of Lavabrink --- .../mage/cards/o/OrthionHeroOfLavabrink.java | 101 ++++++++++++++++++ .../src/mage/sets/MarchOfTheMachine.java | 1 + 2 files changed, 102 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/o/OrthionHeroOfLavabrink.java diff --git a/Mage.Sets/src/mage/cards/o/OrthionHeroOfLavabrink.java b/Mage.Sets/src/mage/cards/o/OrthionHeroOfLavabrink.java new file mode 100644 index 0000000000..090e58a89a --- /dev/null +++ b/Mage.Sets/src/mage/cards/o/OrthionHeroOfLavabrink.java @@ -0,0 +1,101 @@ +package mage.cards.o; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateAsSorceryActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenCopyTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.target.TargetPermanent; +import mage.target.targetpointer.FixedTargets; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class OrthionHeroOfLavabrink extends CardImpl { + + public OrthionHeroOfLavabrink(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.SOLDIER); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {1}{R}, {T}: Create a token that's a copy of another target creature you control. It gains haste. Sacrifice it at the beginning of the next end step. Activate only as a sorcery. + Ability ability = new ActivateAsSorceryActivatedAbility( + new OrthionHeroOfLavabrinkEffect(false), new ManaCostsImpl<>("{1}{R}") + ); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE)); + this.addAbility(ability); + + // {6}{R}{R}{R}, {T}: Create five tokens that are copies of another target creature you control. They gain haste. Sacrifice them at the beginning of the next end step. Activate only as a sorcery. + ability = new ActivateAsSorceryActivatedAbility( + new OrthionHeroOfLavabrinkEffect(true), new ManaCostsImpl<>("{6}{R}{R}{R}") + ); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE)); + this.addAbility(ability); + } + + private OrthionHeroOfLavabrink(final OrthionHeroOfLavabrink card) { + super(card); + } + + @Override + public OrthionHeroOfLavabrink copy() { + return new OrthionHeroOfLavabrink(this); + } +} + +class OrthionHeroOfLavabrinkEffect extends OneShotEffect { + + private final int amount; + + OrthionHeroOfLavabrinkEffect(boolean five) { + super(Outcome.Benefit); + if (five) { + staticText = "create five tokens that are copies of another target creature you control. " + + "They gain haste. Sacrifice them at the beginning of the next end step"; + } else { + staticText = "create a token that's a copy of another target creature you control. " + + "It gains haste. Sacrifice it at the beginning of the next end step"; + } + this.amount = five ? 5 : 1; + } + + private OrthionHeroOfLavabrinkEffect(final OrthionHeroOfLavabrinkEffect effect) { + super(effect); + this.amount = effect.amount; + } + + @Override + public OrthionHeroOfLavabrinkEffect copy() { + return new OrthionHeroOfLavabrinkEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect( + null, null, false, amount + ); + effect.apply(game, source); + game.addEffect(new GainAbilityTargetEffect( + HasteAbility.getInstance(), Duration.Custom + ).setTargetPointer(new FixedTargets(effect.getAddedPermanents(), game)), source); + effect.sacrificeTokensCreatedAtNextEndStep(game, source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/MarchOfTheMachine.java b/Mage.Sets/src/mage/sets/MarchOfTheMachine.java index 71e5a8aa85..13c9f3f067 100644 --- a/Mage.Sets/src/mage/sets/MarchOfTheMachine.java +++ b/Mage.Sets/src/mage/sets/MarchOfTheMachine.java @@ -162,6 +162,7 @@ public final class MarchOfTheMachine extends ExpansionSet { cards.add(new SetCardInfo("Oracle of Tragedy", 71, Rarity.UNCOMMON, mage.cards.o.OracleOfTragedy.class)); cards.add(new SetCardInfo("Order of the Alabaster Host", 72, Rarity.COMMON, mage.cards.o.OrderOfTheAlabasterHost.class)); cards.add(new SetCardInfo("Order of the Mirror", 72, Rarity.COMMON, mage.cards.o.OrderOfTheMirror.class)); + cards.add(new SetCardInfo("Orthion, Hero of Lavabrink", 334, Rarity.RARE, mage.cards.o.OrthionHeroOfLavabrink.class)); cards.add(new SetCardInfo("Overgrown Pest", 197, Rarity.COMMON, mage.cards.o.OvergrownPest.class)); cards.add(new SetCardInfo("Ozolith, the Shattered Spire", 198, Rarity.RARE, mage.cards.o.OzolithTheShatteredSpire.class)); cards.add(new SetCardInfo("Phyrexian Archivist", 262, Rarity.COMMON, mage.cards.p.PhyrexianArchivist.class));