From a6be97a001faca884a50077a44ccfcb301ccb6d2 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Tue, 13 Jan 2026 12:40:30 -0500 Subject: [PATCH] [ECL] Implement Oko, Lorwyn Liege / Oko, Shadowmoore Scion --- .../src/mage/cards/o/OkoLorwynLiege.java | 122 ++++++++++++++++++ Mage.Sets/src/mage/sets/LorwynEclipsed.java | 2 + .../GainAllCreatureTypesTargetEffect.java | 4 +- .../emblems/OkoShadowmoorScionEmblem.java | 60 +++++++++ 4 files changed, 187 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/cards/o/OkoLorwynLiege.java create mode 100644 Mage/src/main/java/mage/game/command/emblems/OkoShadowmoorScionEmblem.java diff --git a/Mage.Sets/src/mage/cards/o/OkoLorwynLiege.java b/Mage.Sets/src/mage/cards/o/OkoLorwynLiege.java new file mode 100644 index 00000000000..e27457fac39 --- /dev/null +++ b/Mage.Sets/src/mage/cards/o/OkoLorwynLiege.java @@ -0,0 +1,122 @@ +package mage.cards.o; + +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.MillThenPutInHandEffect; +import mage.abilities.effects.common.TransformSourceEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAllCreatureTypesTargetEffect; +import mage.abilities.triggers.BeginningOfFirstMainTriggeredAbility; +import mage.cards.CardSetInfo; +import mage.cards.TransformingDoubleFacedCard; +import mage.choices.Choice; +import mage.choices.ChoiceCreatureType; +import mage.constants.*; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.command.emblems.OkoShadowmoorScionEmblem; +import mage.game.permanent.token.ElkToken; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class OkoLorwynLiege extends TransformingDoubleFacedCard { + + public OkoLorwynLiege(UUID ownerId, CardSetInfo setInfo) { + super( + ownerId, setInfo, + new SuperType[]{SuperType.LEGENDARY}, new CardType[]{CardType.PLANESWALKER}, new SubType[]{SubType.OKO}, "{2}{U}", + "Oko, Shadowmoor Scion", + new SuperType[]{SuperType.LEGENDARY}, new CardType[]{CardType.PLANESWALKER}, new SubType[]{SubType.OKO}, "G" + ); + this.getLeftHalfCard().setStartingLoyalty(3); + this.getRightHalfCard().setStartingLoyalty(3); + + // At the beginning of your first main phase, you may pay {G}. If you do, transform Oko. + this.getLeftHalfCard().addAbility(new BeginningOfFirstMainTriggeredAbility( + new DoIfCostPaid(new TransformSourceEffect(), new ManaCostsImpl<>("{G}")) + )); + + // +2: Up to one target creature gains all creature types. + Ability ability = new LoyaltyAbility(new GainAllCreatureTypesTargetEffect(Duration.Custom), 2); + ability.addTarget(new TargetCreaturePermanent(0, 1)); + this.getLeftHalfCard().addAbility(ability); + + // +1: Target creature gets -2/-0 until your next turn. + ability = new LoyaltyAbility(new BoostTargetEffect(-2, -0, Duration.UntilYourNextTurn), 1); + ability.addTarget(new TargetCreaturePermanent()); + this.getLeftHalfCard().addAbility(ability); + + // Oko, Shadowmoor Scion + // At the beginning of your first main phase, you may pay {U}. If you do, transform Oko. + this.getRightHalfCard().addAbility(new BeginningOfFirstMainTriggeredAbility( + new DoIfCostPaid(new TransformSourceEffect(), new ManaCostsImpl<>("{U}")) + )); + + // -1: Mill three cards. You may put a permanent card from among them into your hand. + this.getRightHalfCard().addAbility(new LoyaltyAbility( + new MillThenPutInHandEffect(3, StaticFilters.FILTER_CARD_PERMANENT), -1 + )); + + // -3: Create two 3/3 green Elk creature tokens. + this.getRightHalfCard().addAbility(new LoyaltyAbility( + new CreateTokenEffect(new ElkToken(), 2), -3 + )); + + // -6: Choose a creature type. You get an emblem with "Creatures you control of the chosen type get +3/+3 and have vigilance and hexproof." + this.getRightHalfCard().addAbility(new LoyaltyAbility(new OkoShadowmoorScionEffect(), -6)); + } + + private OkoLorwynLiege(final OkoLorwynLiege card) { + super(card); + } + + @Override + public OkoLorwynLiege copy() { + return new OkoLorwynLiege(this); + } +} + +class OkoShadowmoorScionEffect extends OneShotEffect { + + OkoShadowmoorScionEffect() { + super(Outcome.Benefit); + staticText = "choose a creature type. You get an emblem with " + + "\"Creatures you control of the chosen type get +3/+3 and have vigilance and hexproof.\""; + } + + private OkoShadowmoorScionEffect(final OkoShadowmoorScionEffect effect) { + super(effect); + } + + @Override + public OkoShadowmoorScionEffect copy() { + return new OkoShadowmoorScionEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (player == null || sourceObject == null) { + return false; + } + Choice choice = new ChoiceCreatureType(game, source); + player.choose(outcome, choice, game); + SubType subType = SubType.fromString(choice.getChoice()); + if (subType == null) { + return false; + } + game.addEmblem(new OkoShadowmoorScionEmblem(subType), sourceObject, source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/LorwynEclipsed.java b/Mage.Sets/src/mage/sets/LorwynEclipsed.java index 02f2a983955..8dc2fb13966 100644 --- a/Mage.Sets/src/mage/sets/LorwynEclipsed.java +++ b/Mage.Sets/src/mage/sets/LorwynEclipsed.java @@ -247,6 +247,8 @@ public final class LorwynEclipsed extends ExpansionSet { cards.add(new SetCardInfo("Nightmare Sower", 114, Rarity.UNCOMMON, mage.cards.n.NightmareSower.class)); cards.add(new SetCardInfo("Noggle Robber", 237, Rarity.UNCOMMON, mage.cards.n.NoggleRobber.class)); cards.add(new SetCardInfo("Noggle the Mind", 60, Rarity.UNCOMMON, mage.cards.n.NoggleTheMind.class)); + cards.add(new SetCardInfo("Oko, Lorwyn Liege", 287, Rarity.MYTHIC, mage.cards.o.OkoLorwynLiege.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Oko, Lorwyn Liege", 61, Rarity.MYTHIC, mage.cards.o.OkoLorwynLiege.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Omni-Changeling", 62, Rarity.UNCOMMON, mage.cards.o.OmniChangeling.class)); cards.add(new SetCardInfo("Overgrown Tomb", "350b", Rarity.RARE, mage.cards.o.OvergrownTomb.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Overgrown Tomb", 266, Rarity.RARE, mage.cards.o.OvergrownTomb.class, NON_FULL_USE_VARIOUS)); diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAllCreatureTypesTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAllCreatureTypesTargetEffect.java index 4ac463b8ec8..734262d45a2 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAllCreatureTypesTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAllCreatureTypesTargetEffect.java @@ -48,6 +48,8 @@ public class GainAllCreatureTypesTargetEffect extends ContinuousEffectImpl { if (staticText != null && !staticText.isEmpty()) { return staticText; } - return getTargetPointer().describeTargets(mode.getTargets(), "it") + " gains all creature types " + duration.toString(); + return getTargetPointer().describeTargets(mode.getTargets(), "it") + + " gains all creature types" + + (duration.toString().isEmpty() ? "" : duration.toString()); } } diff --git a/Mage/src/main/java/mage/game/command/emblems/OkoShadowmoorScionEmblem.java b/Mage/src/main/java/mage/game/command/emblems/OkoShadowmoorScionEmblem.java new file mode 100644 index 00000000000..2b83a81a58a --- /dev/null +++ b/Mage/src/main/java/mage/game/command/emblems/OkoShadowmoorScionEmblem.java @@ -0,0 +1,60 @@ +package mage.game.command.emblems; + +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.InfoEffect; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.abilities.effects.common.continuous.GainAbilityAllEffect; +import mage.abilities.keyword.HexproofAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.game.command.Emblem; + +/** + * @author TheElk801 + */ +public final class OkoShadowmoorScionEmblem extends Emblem { + + // -6: Choose a creature type. You get an emblem with "Creatures you control of the chosen type get +3/+3 and have vigilance and hexproof." + public OkoShadowmoorScionEmblem() { + this((SubType) null); + } + + public OkoShadowmoorScionEmblem(SubType subType) { + super("Emblem Oko"); + FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); + if (subType != null) { + filter.add(subType.getPredicate()); + } + Ability ability = new SimpleStaticAbility( + Zone.COMMAND, + new BoostAllEffect( + 3, 3, Duration.WhileOnBattlefield, filter, false + ).setText("creatures you control of the chosen type get +3/+3") + ); + ability.addEffect(new GainAbilityAllEffect( + VigilanceAbility.getInstance(), Duration.WhileOnBattlefield, + filter, "and have vigilance" + )); + ability.addEffect(new GainAbilityAllEffect( + HexproofAbility.getInstance(), Duration.WhileOnBattlefield, + filter, "and hexproof" + )); + if (subType != null) { + ability.addEffect(new InfoEffect("(Chosen subtype: " + subType + ")")); + } + this.getAbilities().add(ability); + } + + private OkoShadowmoorScionEmblem(final OkoShadowmoorScionEmblem card) { + super(card); + } + + @Override + public OkoShadowmoorScionEmblem copy() { + return new OkoShadowmoorScionEmblem(this); + } +}