[BRO] Implement Portal to Phyrexia

This commit is contained in:
Evan Kranzler 2022-11-09 09:16:11 -05:00
parent 2c7b2870a1
commit f4155bb220
10 changed files with 95 additions and 44 deletions

View file

@ -6,7 +6,7 @@ import mage.abilities.Ability;
import mage.abilities.common.DealtDamageAndDiedTriggeredAbility; import mage.abilities.common.DealtDamageAndDiedTriggeredAbility;
import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect; 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.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
@ -67,7 +67,7 @@ class DreadSlaverEffect extends OneShotEffect {
Card card = game.getCard(targetPointer.getFirst(game, source)); Card card = game.getCard(targetPointer.getFirst(game, source));
if (card != null) { if (card != null) {
if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) { 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)); effect.setTargetPointer(new FixedTarget(card.getId(), game));
game.addEffect(effect, source); game.addEffect(effect, source);
return true; return true;

View file

@ -4,7 +4,7 @@ import java.util.UUID;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
import mage.abilities.effects.common.ReturnToLibrarySpellEffect; 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.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; 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. // to its other colors and types. Put Ever After on the bottom of its owner's library.
this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect()); this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect());
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0, 2, StaticFilters.FILTER_CARD_CREATURES_YOUR_GRAVEYARD)); 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"); 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(effect);
this.getSpellAbility().addEffect(new ReturnToLibrarySpellEffect(false)); this.getSpellAbility().addEffect(new ReturnToLibrarySpellEffect(false));

View file

@ -10,7 +10,7 @@ import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.ReplacementEffectImpl; 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.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
@ -158,7 +158,7 @@ class GraveBetrayalReplacementEffect extends ReplacementEffectImpl {
Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget();
if (creature != null) { if (creature != null) {
creature.addCounters(CounterType.P1P1.createInstance(), source.getControllerId(), source, game, event.getAppliedEffects()); 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)); effect.setTargetPointer(new FixedTarget(creature.getId(), creature.getZoneChangeCounter(game) + 1));
game.addEffect(effect, source); game.addEffect(effect, source);
//discard(); why? //discard(); why?

View file

@ -7,7 +7,7 @@ import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DestroyAllEffect; import mage.abilities.effects.common.DestroyAllEffect;
import mage.abilities.effects.common.MillCardsControllerEffect; import mage.abilities.effects.common.MillCardsControllerEffect;
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; 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.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
@ -45,7 +45,7 @@ public final class LilianaDeathsMajesty extends CardImpl {
this.addAbility(ability); 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. // -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); .setText(""), -3);
ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD)); ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD));
ability.addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect() ability.addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect()

View file

@ -5,10 +5,11 @@ import mage.abilities.Ability;
import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileSpellEffect; 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.cards.*;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.StaticFilters; import mage.filter.StaticFilters;
@ -94,7 +95,7 @@ class NecromanticSelectionEffect extends OneShotEffect {
Card card = game.getCard(target.getFirstTarget()); Card card = game.getCard(target.getFirstTarget());
if (card != null) { if (card != null) {
controller.moveCards(card, Zone.BATTLEFIELD, source, game); 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.setText("It's a black Zombie in addition to its other colors and types");
effect.setTargetPointer(new FixedTarget(card.getId(), game)); effect.setTargetPointer(new FixedTarget(card.getId(), game));
game.addEffect(effect, source); game.addEffect(effect, source);

View file

@ -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);
}
}

View file

@ -3,10 +3,11 @@ package mage.cards.r;
import java.util.UUID; import java.util.UUID;
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; 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.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.common.FilterCreatureCard; import mage.filter.common.FilterCreatureCard;
import mage.target.common.TargetCardInGraveyard; 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. // 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().addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card from a graveyard")));
this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect()); this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect());
this.getSpellAbility().addEffect(new BecomesBlackZombieAdditionEffect()); this.getSpellAbility().addEffect(new AddCreatureTypeAdditionEffect(SubType.ZOMBIE, true));
} }
private RiseFromTheGrave(final RiseFromTheGrave card) { private RiseFromTheGrave(final RiseFromTheGrave card) {

View file

@ -10,7 +10,7 @@ import mage.abilities.Ability;
import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ChooseExpansionSetEffect; 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.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
@ -18,6 +18,7 @@ import mage.cards.ExpansionSet;
import mage.cards.Sets; import mage.cards.Sets;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.players.Player; import mage.players.Player;
@ -89,7 +90,7 @@ class SummonThePackEffect extends OneShotEffect {
if (c != null && c.isCreature(game)) { if (c != null && c.isCreature(game)) {
message.append(c.getName()).append(" "); message.append(c.getName()).append(" ");
message.append(" (creature card) "); message.append(" (creature card) ");
ContinuousEffect effect2 = new BecomesBlackZombieAdditionEffect(false); ContinuousEffect effect2 = new AddCreatureTypeAdditionEffect(SubType.ZOMBIE, false);
effect2.setTargetPointer(new FixedTarget(c.getId())); effect2.setTargetPointer(new FixedTarget(c.getId()));
game.addEffect(effect2, source); game.addEffect(effect2, source);
creatureCards.add(c); creatureCards.add(c);

View file

@ -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("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("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("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("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 Engineer", 20, Rarity.COMMON, mage.cards.p.PowerstoneEngineer.class));
cards.add(new SetCardInfo("Powerstone Fracture", 112, Rarity.COMMON, mage.cards.p.PowerstoneFracture.class)); cards.add(new SetCardInfo("Powerstone Fracture", 112, Rarity.COMMON, mage.cards.p.PowerstoneFracture.class));

View file

@ -1,4 +1,3 @@
package mage.abilities.effects.common.continuous; package mage.abilities.effects.common.continuous;
import mage.abilities.Ability; import mage.abilities.Ability;
@ -10,34 +9,30 @@ import mage.game.permanent.Permanent;
/** /**
* @author JRHerlehy Created on 4/8/17. * @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); super(Duration.Custom, Outcome.Neutral);
this.giveBlackColor = true; this.subType = subType;
updateText();
}
public BecomesBlackZombieAdditionEffect(boolean giveBlackColor) {
this();
this.giveBlackColor = giveBlackColor; this.giveBlackColor = giveBlackColor;
updateText(); updateText();
} }
public AddCreatureTypeAdditionEffect(final AddCreatureTypeAdditionEffect effect) {
public BecomesBlackZombieAdditionEffect(final BecomesBlackZombieAdditionEffect effect) {
super(effect); super(effect);
this.subType = effect.subType;
this.giveBlackColor = effect.giveBlackColor; this.giveBlackColor = effect.giveBlackColor;
updateText(); updateText();
} }
private void updateText() { private void updateText() {
if (this.giveBlackColor) { 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 { } 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()); creature = game.getPermanentEntering(source.getTargets().getFirstTarget());
} }
} }
if (creature != null) { 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 {
this.used = true; 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 @Override
@ -81,7 +75,7 @@ public class BecomesBlackZombieAdditionEffect extends ContinuousEffectImpl {
} }
@Override @Override
public BecomesBlackZombieAdditionEffect copy() { public AddCreatureTypeAdditionEffect copy() {
return new BecomesBlackZombieAdditionEffect(this); return new AddCreatureTypeAdditionEffect(this);
} }
} }