diff --git a/Mage.Sets/src/mage/cards/p/ProfoundJourney.java b/Mage.Sets/src/mage/cards/p/ProfoundJourney.java index e52a841b1d5..fbe064a4bc7 100644 --- a/Mage.Sets/src/mage/cards/p/ProfoundJourney.java +++ b/Mage.Sets/src/mage/cards/p/ProfoundJourney.java @@ -8,7 +8,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.filter.FilterCard; -import mage.filter.predicate.Predicates; +import mage.filter.common.FilterPermanentCard; import mage.target.common.TargetCardInYourGraveyard; /** @@ -17,16 +17,7 @@ import mage.target.common.TargetCardInYourGraveyard; */ public final class ProfoundJourney extends CardImpl { - private static final FilterCard filter = new FilterCard("permanent card from your graveyard"); - - static { - filter.add(Predicates.or( - CardType.ARTIFACT.getPredicate(), - CardType.CREATURE.getPredicate(), - CardType.ENCHANTMENT.getPredicate(), - CardType.LAND.getPredicate(), - CardType.PLANESWALKER.getPredicate())); - } + private static final FilterCard filter = new FilterPermanentCard("permanent card from your graveyard"); public ProfoundJourney(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{5}{W}{W}"); diff --git a/Mage.Sets/src/mage/cards/w/WhatMustBeDone.java b/Mage.Sets/src/mage/cards/w/WhatMustBeDone.java new file mode 100644 index 00000000000..62fef04da9e --- /dev/null +++ b/Mage.Sets/src/mage/cards/w/WhatMustBeDone.java @@ -0,0 +1,110 @@ +package mage.cards.w; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.common.DestroyAllEffect; +import mage.abilities.effects.common.InfoEffect; +import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.counters.CounterType; +import mage.filter.FilterCard; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterPermanentCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.HistoricPredicate; +import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author anonymous + */ +public final class WhatMustBeDone extends CardImpl { + + private static final FilterPermanent filterArtifactsAndCreatures = new FilterPermanent("artifacts and creatures"); + static { + filterArtifactsAndCreatures.add(Predicates.or( + CardType.ARTIFACT.getPredicate(), + CardType.CREATURE.getPredicate() + )); + } + + private static final FilterCard filterHistoricPermanentCard = new FilterPermanentCard("historic permanent card from your graveyard"); + static { + filterHistoricPermanentCard.add(HistoricPredicate.instance); + } + + public WhatMustBeDone(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{W}{W}"); + + // Choose one -- + // * Let the World Burn -- Destroy all artifacts and creatures. + this.getSpellAbility().addEffect(new DestroyAllEffect(filterArtifactsAndCreatures)); + this.getSpellAbility().withFirstModeFlavorWord("Let the World Burn"); + + // * Release Juno -- Return target historic permanent card from your graveyard to the battlefield. It enters with two additional +1/+1 counters on it if it's a creature. + this.getSpellAbility().addMode(new Mode( + new WhatMustBeDoneReplacementEffect( + )).addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect() + ).addTarget(new TargetCardInYourGraveyard(filterHistoricPermanentCard) + ).addEffect(new InfoEffect("It enters with two additional +1/+1 counters on it if it's a creature. " + + "(Artifacts, legendaries, and Sagas are historic.)" ) + ).withFlavorWord("Release Juno")); + } + + private WhatMustBeDone(final WhatMustBeDone card) { + super(card); + } + + @Override + public WhatMustBeDone copy() { + return new WhatMustBeDone(this); + } +} + +class WhatMustBeDoneReplacementEffect extends ReplacementEffectImpl { + + WhatMustBeDoneReplacementEffect() { + super(Duration.EndOfStep, Outcome.BoostCreature); + } + + private WhatMustBeDoneReplacementEffect(final WhatMustBeDoneReplacementEffect effect) { + super(effect); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + return getTargetPointer().getTargets(game, source).contains(event.getTargetId()); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); + if (permanent == null || !permanent.isCreature(game)) { + return false; + } + permanent.addCounters(CounterType.P1P1.createInstance(2), source.getControllerId(), source, game, event.getAppliedEffects()); + discard(); + return false; + } + + @Override + public WhatMustBeDoneReplacementEffect copy() { + return new WhatMustBeDoneReplacementEffect(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/AssassinsCreed.java b/Mage.Sets/src/mage/sets/AssassinsCreed.java index 3ffa041e3a9..a0224341c63 100644 --- a/Mage.Sets/src/mage/sets/AssassinsCreed.java +++ b/Mage.Sets/src/mage/sets/AssassinsCreed.java @@ -324,9 +324,9 @@ public final class AssassinsCreed extends ExpansionSet { cards.add(new SetCardInfo("Viewpoint Synchronization", 223, Rarity.UNCOMMON, mage.cards.v.ViewpointSynchronization.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Viewpoint Synchronization", 43, Rarity.UNCOMMON, mage.cards.v.ViewpointSynchronization.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Waterlogged Grove", 116, Rarity.RARE, mage.cards.w.WaterloggedGrove.class)); - //cards.add(new SetCardInfo("What Must Be Done", 11, Rarity.RARE, mage.cards.w.WhatMustBeDone.class, NON_FULL_USE_VARIOUS)); - //cards.add(new SetCardInfo("What Must Be Done", 157, Rarity.RARE, mage.cards.w.WhatMustBeDone.class, NON_FULL_USE_VARIOUS)); - //cards.add(new SetCardInfo("What Must Be Done", 184, Rarity.RARE, mage.cards.w.WhatMustBeDone.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("What Must Be Done", 11, Rarity.RARE, mage.cards.w.WhatMustBeDone.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("What Must Be Done", 157, Rarity.RARE, mage.cards.w.WhatMustBeDone.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("What Must Be Done", 184, Rarity.RARE, mage.cards.w.WhatMustBeDone.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Yggdrasil, Rebirth Engine", 126, Rarity.MYTHIC, mage.cards.y.YggdrasilRebirthEngine.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Yggdrasil, Rebirth Engine", 264, Rarity.MYTHIC, mage.cards.y.YggdrasilRebirthEngine.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Yggdrasil, Rebirth Engine", 78, Rarity.MYTHIC, mage.cards.y.YggdrasilRebirthEngine.class, NON_FULL_USE_VARIOUS));