From 8303ac65af905146da56f71d9215d674fcb0cc5d Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 31 May 2022 19:26:01 -0400 Subject: [PATCH] [CLB] Implemented Uchuulon --- Mage.Sets/src/mage/cards/u/Uchuulon.java | 104 ++++++++++++++++++ .../CommanderLegendsBattleForBaldursGate.java | 1 + 2 files changed, 105 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/u/Uchuulon.java diff --git a/Mage.Sets/src/mage/cards/u/Uchuulon.java b/Mage.Sets/src/mage/cards/u/Uchuulon.java new file mode 100644 index 00000000000..3e592e7992b --- /dev/null +++ b/Mage.Sets/src/mage/cards/u/Uchuulon.java @@ -0,0 +1,104 @@ +package mage.cards.u; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.CreateTokenCopySourceEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +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.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInOpponentsGraveyard; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class Uchuulon extends CardImpl { + + private static final FilterPermanent filter + = new FilterControlledPermanent("Crabs, Oozes, and/or Horrors you control"); + + static { + filter.add(Predicates.or( + SubType.CRAB.getPredicate(), + SubType.OOZE.getPredicate(), + SubType.HORROR.getPredicate() + )); + } + + private static final DynamicValue xValue = new PermanentsOnBattlefieldCount(filter, null); + + public Uchuulon(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}"); + + this.subtype.add(SubType.CRAB); + this.subtype.add(SubType.OOZE); + this.subtype.add(SubType.HORROR); + this.power = new MageInt(0); + this.toughness = new MageInt(4); + + // Uchuulon's power is equal to the number of Crabs, Oozes, and/or Horrors you control. + this.addAbility(new SimpleStaticAbility(new SetPowerSourceEffect(xValue, Duration.EndOfGame))); + + // Horrific Symbiosis — At the beginning of your end step, exile up to one target creature card from an opponent's graveyard. If you, create a token that's a copy of Uchuulon. + Ability ability = new BeginningOfEndStepTriggeredAbility( + new UchuulonEffect(), TargetController.YOU, false + ); + ability.addTarget(new TargetCardInOpponentsGraveyard( + 0, 1, StaticFilters.FILTER_CARD_CREATURE + )); + this.addAbility(ability.withFlavorWord("Horrific Symbiosis")); + } + + private Uchuulon(final Uchuulon card) { + super(card); + } + + @Override + public Uchuulon copy() { + return new Uchuulon(this); + } +} + +class UchuulonEffect extends OneShotEffect { + + UchuulonEffect() { + super(Outcome.Benefit); + staticText = "exile up to one target creature card from an opponent's graveyard. " + + "If you, create a token that's a copy of {this}"; + } + + private UchuulonEffect(final UchuulonEffect effect) { + super(effect); + } + + @Override + public UchuulonEffect copy() { + return new UchuulonEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Card card = game.getCard(getTargetPointer().getFirst(game, source)); + if (player == null || card == null) { + return false; + } + player.moveCards(card, Zone.EXILED, source, game); + new CreateTokenCopySourceEffect().apply(game, source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java index 575c57cc1a3..c99b41a0914 100644 --- a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java +++ b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java @@ -292,6 +292,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet { cards.add(new SetCardInfo("Treasure Keeper", 341, Rarity.UNCOMMON, mage.cards.t.TreasureKeeper.class)); cards.add(new SetCardInfo("Two-Handed Axe", 203, Rarity.UNCOMMON, mage.cards.t.TwoHandedAxe.class)); cards.add(new SetCardInfo("Tymora's Invoker", 101, Rarity.COMMON, mage.cards.t.TymorasInvoker.class)); + cards.add(new SetCardInfo("Uchuulon", 673, Rarity.RARE, mage.cards.u.Uchuulon.class)); cards.add(new SetCardInfo("Undercellar Myconid", 259, Rarity.COMMON, mage.cards.u.UndercellarMyconid.class)); cards.add(new SetCardInfo("Underdark Explorer", 154, Rarity.COMMON, mage.cards.u.UnderdarkExplorer.class)); cards.add(new SetCardInfo("Undermountain Adventurer", 260, Rarity.RARE, mage.cards.u.UndermountainAdventurer.class));