mirror of
https://github.com/correl/mage.git
synced 2024-11-28 19:19:55 +00:00
[BRO] Implement Portal to Phyrexia
This commit is contained in:
parent
2c7b2870a1
commit
f4155bb220
10 changed files with 95 additions and 44 deletions
|
@ -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;
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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?
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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);
|
||||
|
|
53
Mage.Sets/src/mage/cards/p/PortalToPhyrexia.java
Normal file
53
Mage.Sets/src/mage/cards/p/PortalToPhyrexia.java
Normal 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);
|
||||
}
|
||||
}
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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,10 +52,13 @@ public class BecomesBlackZombieAdditionEffect extends ContinuousEffectImpl {
|
|||
creature = game.getPermanentEntering(source.getTargets().getFirstTarget());
|
||||
}
|
||||
}
|
||||
if (creature != null) {
|
||||
if (creature == null) {
|
||||
this.used = true;
|
||||
return false;
|
||||
}
|
||||
switch (layer) {
|
||||
case TypeChangingEffects_4:
|
||||
creature.addSubType(game, SubType.ZOMBIE);
|
||||
creature.addSubType(game, subType);
|
||||
break;
|
||||
case ColorChangingEffects_5:
|
||||
if (this.giveBlackColor) {
|
||||
|
@ -69,10 +67,6 @@ public class BecomesBlackZombieAdditionEffect extends ContinuousEffectImpl {
|
|||
break;
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
this.used = true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue