From 4edb9ce270e6455a64bf743b1b0d4aca87fd7944 Mon Sep 17 00:00:00 2001 From: Susucre <34709007+Susucre@users.noreply.github.com> Date: Wed, 1 May 2024 19:14:08 +0200 Subject: [PATCH] implement [PIP] The Master, Transcendent --- .../mage/cards/t/TheMasterTranscendent.java | 131 ++++++++++++++++++ Mage.Sets/src/mage/sets/Fallout.java | 1 + 2 files changed, 132 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/t/TheMasterTranscendent.java diff --git a/Mage.Sets/src/mage/cards/t/TheMasterTranscendent.java b/Mage.Sets/src/mage/cards/t/TheMasterTranscendent.java new file mode 100644 index 000000000000..6f0a4b4b8f1d --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TheMasterTranscendent.java @@ -0,0 +1,131 @@ +package mage.cards.t; + +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.counters.CounterType; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.card.MilledThisTurnPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.TargetPlayer; +import mage.target.common.TargetCardInGraveyard; +import mage.watchers.common.CardsMilledWatcher; + +import java.util.UUID; + +/** + * @author Susucr + */ +public final class TheMasterTranscendent extends CardImpl { + + private static final FilterCard filter = new FilterCreatureCard("creature card in a graveyard that was milled this turn"); + + static { + filter.add(MilledThisTurnPredicate.instance); + } + + public TheMasterTranscendent(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{1}{B}{G}{U}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.MUTANT); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // When The Master, Transcendent enters the battlefield, target player gets two rad counters. + Ability ability = new EntersBattlefieldTriggeredAbility(new AddCountersTargetEffect(CounterType.RAD.createInstance(2))); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + + // {T}: Put target creature card in a graveyard that was milled this turn onto the battlefield under your control. It's a green Mutant with base power and toughness 3/3. + ability = new SimpleActivatedAbility( + new ReturnFromGraveyardToBattlefieldTargetEffect(), + new TapSourceCost() + ); + ability.addEffect(new TheMasterTranscendentContinuousEffect()); + ability.addTarget(new TargetCardInGraveyard(filter)); + this.addAbility(ability, new CardsMilledWatcher()); + } + + private TheMasterTranscendent(final TheMasterTranscendent card) { + super(card); + } + + @Override + public TheMasterTranscendent copy() { + return new TheMasterTranscendent(this); + } +} + +class TheMasterTranscendentContinuousEffect extends ContinuousEffectImpl { + + TheMasterTranscendentContinuousEffect() { + super(Duration.Custom, Outcome.Neutral); + staticText = "It's a green Mutant with base power and toughness 3/3"; + } + + protected TheMasterTranscendentContinuousEffect(final TheMasterTranscendentContinuousEffect effect) { + super(effect); + } + + @Override + public TheMasterTranscendentContinuousEffect copy() { + return new TheMasterTranscendentContinuousEffect(this); + } + + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.TypeChangingEffects_4 + || layer == Layer.ColorChangingEffects_5 + || layer == Layer.PTChangingEffects_7; + } + + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + Permanent creature; + if (source.getTargets().getFirstTarget() == null) { + creature = game.getPermanent(getTargetPointer().getFirst(game, source)); + } else { + creature = game.getPermanent(source.getTargets().getFirstTarget()); + if (creature == null) { + creature = game.getPermanentEntering(source.getTargets().getFirstTarget()); + } + } + if (creature == null) { + this.used = true; + return false; + } + switch (layer) { + case TypeChangingEffects_4: + creature.removeAllCreatureTypes(game); + creature.addSubType(game, SubType.MUTANT); + break; + case ColorChangingEffects_5: + creature.getColor(game).setColor(ObjectColor.GREEN); + break; + case PTChangingEffects_7: + if (sublayer == SubLayer.SetPT_7b) { + creature.getPower().setModifiedBaseValue(3); + creature.getToughness().setModifiedBaseValue(3); + } + break; + } + return true; + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/Fallout.java b/Mage.Sets/src/mage/sets/Fallout.java index 9ee352fda34d..7fa2bc2b69c3 100644 --- a/Mage.Sets/src/mage/sets/Fallout.java +++ b/Mage.Sets/src/mage/sets/Fallout.java @@ -333,6 +333,7 @@ private Fallout() { cards.add(new SetCardInfo("Temple of Triumph", 312, Rarity.RARE, mage.cards.t.TempleOfTriumph.class)); cards.add(new SetCardInfo("Temple of the False God", 311, Rarity.UNCOMMON, mage.cards.t.TempleOfTheFalseGod.class)); cards.add(new SetCardInfo("Terramorphic Expanse", 313, Rarity.COMMON, mage.cards.t.TerramorphicExpanse.class)); + cards.add(new SetCardInfo("The Master, Transcendent", 6, Rarity.MYTHIC, mage.cards.t.TheMasterTranscendent.class)); cards.add(new SetCardInfo("The Motherlode, Excavator", 62, Rarity.RARE, mage.cards.t.TheMotherlodeExcavator.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("The Motherlode, Excavator", 389, Rarity.RARE, mage.cards.t.TheMotherlodeExcavator.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("The Motherlode, Excavator", 590, Rarity.RARE, mage.cards.t.TheMotherlodeExcavator.class, NON_FULL_USE_VARIOUS));