diff --git a/Mage.Sets/src/mage/cards/d/DreadSlaver.java b/Mage.Sets/src/mage/cards/d/DreadSlaver.java index 286e7c56a4..49436e9111 100644 --- a/Mage.Sets/src/mage/cards/d/DreadSlaver.java +++ b/Mage.Sets/src/mage/cards/d/DreadSlaver.java @@ -6,7 +6,7 @@ import mage.abilities.Ability; import mage.abilities.common.DealtDamageAndDiedTriggeredAbility; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.BecomesBlackZombieAdditionEffect; +import mage.abilities.effects.common.continuous.AddCreatureTypeAdditionEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -67,7 +67,7 @@ class DreadSlaverEffect extends OneShotEffect { Card card = game.getCard(targetPointer.getFirst(game, source)); if (card != null) { if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) { - ContinuousEffect effect = new BecomesBlackZombieAdditionEffect(); + ContinuousEffect effect = new AddCreatureTypeAdditionEffect(SubType.ZOMBIE, true); effect.setTargetPointer(new FixedTarget(card.getId(), game)); game.addEffect(effect, source); return true; diff --git a/Mage.Sets/src/mage/cards/e/EverAfter.java b/Mage.Sets/src/mage/cards/e/EverAfter.java index 687eeae9a9..7b9a09c002 100644 --- a/Mage.Sets/src/mage/cards/e/EverAfter.java +++ b/Mage.Sets/src/mage/cards/e/EverAfter.java @@ -4,7 +4,7 @@ import java.util.UUID; import mage.abilities.effects.Effect; import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; import mage.abilities.effects.common.ReturnToLibrarySpellEffect; -import mage.abilities.effects.common.continuous.BecomesBlackZombieAdditionEffect; +import mage.abilities.effects.common.continuous.AddCreatureTypeAdditionEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -24,7 +24,7 @@ public final class EverAfter extends CardImpl { // to its other colors and types. Put Ever After on the bottom of its owner's library. this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect()); this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0, 2, StaticFilters.FILTER_CARD_CREATURES_YOUR_GRAVEYARD)); - Effect effect = new BecomesBlackZombieAdditionEffect(); + Effect effect = new AddCreatureTypeAdditionEffect(SubType.ZOMBIE, true); effect.setText("Each of those creatures is a black Zombie in addition to its other colors and types"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(new ReturnToLibrarySpellEffect(false)); diff --git a/Mage.Sets/src/mage/cards/g/GraveBetrayal.java b/Mage.Sets/src/mage/cards/g/GraveBetrayal.java index c3b7d8e102..2faec45717 100644 --- a/Mage.Sets/src/mage/cards/g/GraveBetrayal.java +++ b/Mage.Sets/src/mage/cards/g/GraveBetrayal.java @@ -10,7 +10,7 @@ import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.ReplacementEffectImpl; -import mage.abilities.effects.common.continuous.BecomesBlackZombieAdditionEffect; +import mage.abilities.effects.common.continuous.AddCreatureTypeAdditionEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -158,7 +158,7 @@ class GraveBetrayalReplacementEffect extends ReplacementEffectImpl { Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); if (creature != null) { creature.addCounters(CounterType.P1P1.createInstance(), source.getControllerId(), source, game, event.getAppliedEffects()); - ContinuousEffect effect = new BecomesBlackZombieAdditionEffect(); + ContinuousEffect effect = new AddCreatureTypeAdditionEffect(SubType.ZOMBIE, true); effect.setTargetPointer(new FixedTarget(creature.getId(), creature.getZoneChangeCounter(game) + 1)); game.addEffect(effect, source); //discard(); why? diff --git a/Mage.Sets/src/mage/cards/l/LilianaDeathsMajesty.java b/Mage.Sets/src/mage/cards/l/LilianaDeathsMajesty.java index 3c759a02ec..50ed987b3d 100644 --- a/Mage.Sets/src/mage/cards/l/LilianaDeathsMajesty.java +++ b/Mage.Sets/src/mage/cards/l/LilianaDeathsMajesty.java @@ -7,7 +7,7 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.DestroyAllEffect; import mage.abilities.effects.common.MillCardsControllerEffect; import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; -import mage.abilities.effects.common.continuous.BecomesBlackZombieAdditionEffect; +import mage.abilities.effects.common.continuous.AddCreatureTypeAdditionEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -45,7 +45,7 @@ public final class LilianaDeathsMajesty extends CardImpl { this.addAbility(ability); // -3: Return target creature card from your graveyard to the battlefield. That creature is a black Zombie in addition to its other colors and types. - ability = new LoyaltyAbility(new BecomesBlackZombieAdditionEffect() // because the effect has to be active for triggered effects that e.g. check if the creature entering is a Zombie, the continuous effect needs to be added before the card moving effect is applied + ability = new LoyaltyAbility(new AddCreatureTypeAdditionEffect(SubType.ZOMBIE, true) // because the effect has to be active for triggered effects that e.g. check if the creature entering is a Zombie, the continuous effect needs to be added before the card moving effect is applied .setText(""), -3); ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD)); ability.addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect() diff --git a/Mage.Sets/src/mage/cards/n/NecromanticSelection.java b/Mage.Sets/src/mage/cards/n/NecromanticSelection.java index 17e543848e..2329e8da56 100644 --- a/Mage.Sets/src/mage/cards/n/NecromanticSelection.java +++ b/Mage.Sets/src/mage/cards/n/NecromanticSelection.java @@ -5,10 +5,11 @@ import mage.abilities.Ability; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ExileSpellEffect; -import mage.abilities.effects.common.continuous.BecomesBlackZombieAdditionEffect; +import mage.abilities.effects.common.continuous.AddCreatureTypeAdditionEffect; import mage.cards.*; import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.SubType; import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.StaticFilters; @@ -94,7 +95,7 @@ class NecromanticSelectionEffect extends OneShotEffect { Card card = game.getCard(target.getFirstTarget()); if (card != null) { controller.moveCards(card, Zone.BATTLEFIELD, source, game); - ContinuousEffect effect = new BecomesBlackZombieAdditionEffect(); + ContinuousEffect effect = new AddCreatureTypeAdditionEffect(SubType.ZOMBIE, true); effect.setText("It's a black Zombie in addition to its other colors and types"); effect.setTargetPointer(new FixedTarget(card.getId(), game)); game.addEffect(effect, source); diff --git a/Mage.Sets/src/mage/cards/p/PortalToPhyrexia.java b/Mage.Sets/src/mage/cards/p/PortalToPhyrexia.java new file mode 100644 index 0000000000..f5da2256cc --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PortalToPhyrexia.java @@ -0,0 +1,53 @@ +package mage.cards.p; + +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; +import mage.abilities.effects.common.SacrificeOpponentsEffect; +import mage.abilities.effects.common.continuous.AddCreatureTypeAdditionEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.TargetController; +import mage.filter.FilterCard; +import mage.filter.StaticFilters; +import mage.filter.common.FilterCreatureCard; +import mage.target.common.TargetCardInGraveyard; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class PortalToPhyrexia extends CardImpl { + + private static final FilterCard filter = new FilterCreatureCard("creature card from a graveyard"); + + public PortalToPhyrexia(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{9}"); + + // When Portal to Phyrexia enters the battlefield, each opponent sacrifices three creatures. + this.addAbility(new EntersBattlefieldTriggeredAbility( + new SacrificeOpponentsEffect(3, StaticFilters.FILTER_PERMANENT_CREATURES) + )); + + // At the beginning of your upkeep, put target creature card from a graveyard onto the battlefield under your control. It's a Phyrexian in addition to its other types. + Ability ability = new BeginningOfUpkeepTriggeredAbility( + new ReturnFromGraveyardToBattlefieldTargetEffect(), TargetController.YOU, false + ); + ability.addEffect(new AddCreatureTypeAdditionEffect(SubType.PHYREXIAN, false)); + ability.addTarget(new TargetCardInGraveyard(filter)); + this.addAbility(ability); + } + + private PortalToPhyrexia(final PortalToPhyrexia card) { + super(card); + } + + @Override + public PortalToPhyrexia copy() { + return new PortalToPhyrexia(this); + } +} diff --git a/Mage.Sets/src/mage/cards/r/RiseFromTheGrave.java b/Mage.Sets/src/mage/cards/r/RiseFromTheGrave.java index f86781d790..709aab8bba 100644 --- a/Mage.Sets/src/mage/cards/r/RiseFromTheGrave.java +++ b/Mage.Sets/src/mage/cards/r/RiseFromTheGrave.java @@ -3,10 +3,11 @@ package mage.cards.r; import java.util.UUID; import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; -import mage.abilities.effects.common.continuous.BecomesBlackZombieAdditionEffect; +import mage.abilities.effects.common.continuous.AddCreatureTypeAdditionEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.constants.SubType; import mage.filter.common.FilterCreatureCard; import mage.target.common.TargetCardInGraveyard; @@ -23,7 +24,7 @@ public final class RiseFromTheGrave extends CardImpl { // Put target creature card from a graveyard onto the battlefield under your control. That creature is a black Zombie in addition to its other colors and types. this.getSpellAbility().addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card from a graveyard"))); this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect()); - this.getSpellAbility().addEffect(new BecomesBlackZombieAdditionEffect()); + this.getSpellAbility().addEffect(new AddCreatureTypeAdditionEffect(SubType.ZOMBIE, true)); } private RiseFromTheGrave(final RiseFromTheGrave card) { diff --git a/Mage.Sets/src/mage/cards/s/SummonThePack.java b/Mage.Sets/src/mage/cards/s/SummonThePack.java index c6ca36a5d3..812a624b48 100644 --- a/Mage.Sets/src/mage/cards/s/SummonThePack.java +++ b/Mage.Sets/src/mage/cards/s/SummonThePack.java @@ -10,7 +10,7 @@ import mage.abilities.Ability; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ChooseExpansionSetEffect; -import mage.abilities.effects.common.continuous.BecomesBlackZombieAdditionEffect; +import mage.abilities.effects.common.continuous.AddCreatureTypeAdditionEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -18,6 +18,7 @@ import mage.cards.ExpansionSet; import mage.cards.Sets; import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.SubType; import mage.constants.Zone; import mage.game.Game; import mage.players.Player; @@ -89,7 +90,7 @@ class SummonThePackEffect extends OneShotEffect { if (c != null && c.isCreature(game)) { message.append(c.getName()).append(" "); message.append(" (creature card) "); - ContinuousEffect effect2 = new BecomesBlackZombieAdditionEffect(false); + ContinuousEffect effect2 = new AddCreatureTypeAdditionEffect(SubType.ZOMBIE, false); effect2.setTargetPointer(new FixedTarget(c.getId())); game.addEffect(effect2, source); creatureCards.add(c); diff --git a/Mage.Sets/src/mage/sets/TheBrothersWar.java b/Mage.Sets/src/mage/sets/TheBrothersWar.java index f7442f6aa7..16c354177c 100644 --- a/Mage.Sets/src/mage/sets/TheBrothersWar.java +++ b/Mage.Sets/src/mage/sets/TheBrothersWar.java @@ -199,6 +199,7 @@ public final class TheBrothersWar extends ExpansionSet { cards.add(new SetCardInfo("Phyrexian Fleshgorger", 121, Rarity.MYTHIC, mage.cards.p.PhyrexianFleshgorger.class)); cards.add(new SetCardInfo("Plains", 268, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Platoon Dispenser", 36, Rarity.MYTHIC, mage.cards.p.PlatoonDispenser.class)); + cards.add(new SetCardInfo("Portal to Phyrexia", 240, Rarity.MYTHIC, mage.cards.p.PortalToPhyrexia.class)); cards.add(new SetCardInfo("Power Plant Worker", 241, Rarity.COMMON, mage.cards.p.PowerPlantWorker.class)); cards.add(new SetCardInfo("Powerstone Engineer", 20, Rarity.COMMON, mage.cards.p.PowerstoneEngineer.class)); cards.add(new SetCardInfo("Powerstone Fracture", 112, Rarity.COMMON, mage.cards.p.PowerstoneFracture.class)); diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesBlackZombieAdditionEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCreatureTypeAdditionEffect.java similarity index 54% rename from Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesBlackZombieAdditionEffect.java rename to Mage/src/main/java/mage/abilities/effects/common/continuous/AddCreatureTypeAdditionEffect.java index 17ddab7d19..817a3e839c 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesBlackZombieAdditionEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCreatureTypeAdditionEffect.java @@ -1,4 +1,3 @@ - package mage.abilities.effects.common.continuous; import mage.abilities.Ability; @@ -10,34 +9,30 @@ import mage.game.permanent.Permanent; /** * @author JRHerlehy Created on 4/8/17. */ -public class BecomesBlackZombieAdditionEffect extends ContinuousEffectImpl { +public class AddCreatureTypeAdditionEffect extends ContinuousEffectImpl { - private boolean giveBlackColor = true; + private final SubType subType; + private final boolean giveBlackColor; - public BecomesBlackZombieAdditionEffect() { + public AddCreatureTypeAdditionEffect(SubType subType, boolean giveBlackColor) { super(Duration.Custom, Outcome.Neutral); - this.giveBlackColor = true; - updateText(); - } - - public BecomesBlackZombieAdditionEffect(boolean giveBlackColor) { - this(); + this.subType = subType; this.giveBlackColor = giveBlackColor; updateText(); } - - public BecomesBlackZombieAdditionEffect(final BecomesBlackZombieAdditionEffect effect) { + public AddCreatureTypeAdditionEffect(final AddCreatureTypeAdditionEffect effect) { super(effect); + this.subType = effect.subType; this.giveBlackColor = effect.giveBlackColor; updateText(); } private void updateText() { if (this.giveBlackColor) { - this.staticText = "That creature is a black Zombie in addition to its other colors and types"; + this.staticText = "That creature is a black " + subType + " in addition to its other colors and types"; } else { - this.staticText = "That creature is a Zombie in addition to its other types"; + this.staticText = "That creature is a " + subType + " in addition to its other types"; } } @@ -57,22 +52,21 @@ public class BecomesBlackZombieAdditionEffect extends ContinuousEffectImpl { creature = game.getPermanentEntering(source.getTargets().getFirstTarget()); } } - if (creature != null) { - switch (layer) { - case TypeChangingEffects_4: - creature.addSubType(game, SubType.ZOMBIE); - break; - case ColorChangingEffects_5: - if (this.giveBlackColor) { - creature.getColor(game).setBlack(true); - } - break; - } - return true; - } else { + if (creature == null) { this.used = true; + return false; } - return false; + switch (layer) { + case TypeChangingEffects_4: + creature.addSubType(game, subType); + break; + case ColorChangingEffects_5: + if (this.giveBlackColor) { + creature.getColor(game).setBlack(true); + } + break; + } + return true; } @Override @@ -81,7 +75,7 @@ public class BecomesBlackZombieAdditionEffect extends ContinuousEffectImpl { } @Override - public BecomesBlackZombieAdditionEffect copy() { - return new BecomesBlackZombieAdditionEffect(this); + public AddCreatureTypeAdditionEffect copy() { + return new AddCreatureTypeAdditionEffect(this); } }