mirror of
https://github.com/correl/mage.git
synced 2025-01-11 19:13:02 +00:00
Improved text generation for TargetCardInASingleGraveyard (additional to #6557)
This commit is contained in:
parent
520937e68a
commit
05950dcc2f
18 changed files with 88 additions and 157 deletions
|
@ -1,40 +1,36 @@
|
|||
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.game.Game;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.common.TargetCardInASingleGraveyard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
*/
|
||||
public final class CarrionBeetles extends CardImpl {
|
||||
|
||||
public CarrionBeetles(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}");
|
||||
this.subtype.add(SubType.INSECT);
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// {2}{B}, {tap}: Exile up to three target cards from a single graveyard.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CarrionBeetlesExileEffect(), new ManaCostsImpl("{2}{B}"));
|
||||
// {2}{B}, {T}: Exile up to three target cards from a single graveyard.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(), new ManaCostsImpl("{2}{B}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addTarget(new TargetCardInASingleGraveyard(0, 3, new FilterCard("up to three target cards from a single graveyard")));
|
||||
ability.addTarget(new TargetCardInASingleGraveyard(0, 3, StaticFilters.FILTER_CARD_CARDS));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
@ -47,31 +43,3 @@ public final class CarrionBeetles extends CardImpl {
|
|||
return new CarrionBeetles(this);
|
||||
}
|
||||
}
|
||||
|
||||
class CarrionBeetlesExileEffect extends OneShotEffect {
|
||||
|
||||
public CarrionBeetlesExileEffect() {
|
||||
super(Outcome.Exile);
|
||||
this.staticText = "Exile up to three target cards from a single graveyard";
|
||||
}
|
||||
|
||||
public CarrionBeetlesExileEffect(final CarrionBeetlesExileEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CarrionBeetlesExileEffect copy() {
|
||||
return new CarrionBeetlesExileEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (UUID targetID : source.getTargets().get(0).getTargets()) {
|
||||
Card card = game.getCard(targetID);
|
||||
if (card != null) {
|
||||
card.moveToExile(null, "", source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,26 +1,25 @@
|
|||
|
||||
package mage.cards.d;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.common.TargetCardInASingleGraveyard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author ilcartographer
|
||||
*/
|
||||
public final class Decompose extends CardImpl {
|
||||
|
||||
public Decompose(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}");
|
||||
|
||||
// Exile up to three target cards from a single graveyard.
|
||||
this.getSpellAbility().addEffect(new ExileTargetEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCardInASingleGraveyard(0, 3, new FilterCard("cards from a single graveyard")));
|
||||
this.getSpellAbility().addTarget(new TargetCardInASingleGraveyard(0, 3, StaticFilters.FILTER_CARD_CARDS));
|
||||
}
|
||||
|
||||
public Decompose(final Decompose card) {
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.f;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
|
@ -13,17 +11,18 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.common.TargetCardInASingleGraveyard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author cbt33
|
||||
*/
|
||||
public final class FamishedGhoul extends CardImpl {
|
||||
|
||||
public FamishedGhoul(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}");
|
||||
this.subtype.add(SubType.ZOMBIE);
|
||||
|
||||
this.power = new MageInt(3);
|
||||
|
@ -32,7 +31,7 @@ public final class FamishedGhoul extends CardImpl {
|
|||
// {1}{B}, Sacrifice Famished Ghoul: Exile up to two target cards from a single graveyard.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(), new ManaCostsImpl("{1}{B}"));
|
||||
ability.addCost(new SacrificeSourceCost());
|
||||
ability.addTarget(new TargetCardInASingleGraveyard(0, 2, new FilterCard("cards from a single graveyard")));
|
||||
ability.addTarget(new TargetCardInASingleGraveyard(0, 2, StaticFilters.FILTER_CARD_CARDS));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ import mage.MageInt;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.ExileTargetForSourceEffect;
|
||||
import mage.abilities.effects.common.ReturnFromExileForSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -12,7 +11,7 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.common.TargetCardInASingleGraveyard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -30,9 +29,8 @@ public final class Gravegouger extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// When Gravegouger enters the battlefield, exile up to two target cards from a single graveyard.
|
||||
Effect effect = new ExileTargetForSourceEffect();
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(effect, false);
|
||||
ability.addTarget(new TargetCardInASingleGraveyard(0, 2, new FilterCard("cards from a single graveyard")));
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new ExileTargetForSourceEffect(), false);
|
||||
ability.addTarget(new TargetCardInASingleGraveyard(0, 2, StaticFilters.FILTER_CARD_CARDS));
|
||||
this.addAbility(ability);
|
||||
|
||||
// When Gravegouger leaves the battlefield, return the exiled cards to their owner's graveyard.
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.m;
|
||||
|
||||
import mage.MageInt;
|
||||
|
@ -11,7 +10,6 @@ import mage.abilities.costs.VariableCostImpl;
|
|||
import mage.abilities.costs.common.RevealTargetFromHandCost;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
@ -19,6 +17,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
@ -41,13 +40,12 @@ public final class MartyrOfBones extends CardImpl {
|
|||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
//TODO: Make ability properly copiable
|
||||
// TODO: Make ability properly copiable
|
||||
// {1}, Reveal X black cards from your hand, Sacrifice Martyr of Bones: Exile up to X target cards from a single graveyard.
|
||||
Effect effect = new ExileTargetEffect(null, null, Zone.GRAVEYARD);
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(1));
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(), new GenericManaCost(1));
|
||||
ability.addCost(new RevealVariableBlackCardsFromHandCost());
|
||||
ability.addCost(new SacrificeSourceCost());
|
||||
ability.addTarget(new TargetCardInASingleGraveyard(0, 1, new FilterCard("cards in a single graveyard")));
|
||||
ability.addTarget(new TargetCardInASingleGraveyard(0, 1, StaticFilters.FILTER_CARD_CARDS));
|
||||
ability.setTargetAdjuster(MartyrOfBonesAdjuster.instance);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
@ -74,7 +72,7 @@ enum MartyrOfBonesAdjuster implements TargetAdjuster {
|
|||
}
|
||||
}
|
||||
ability.getTargets().clear();
|
||||
ability.addTarget(new TargetCardInASingleGraveyard(0, amount, new FilterCard()));
|
||||
ability.addTarget(new TargetCardInASingleGraveyard(0, amount, StaticFilters.FILTER_CARD_CARDS));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.n;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.ExileFromGraveCost;
|
||||
|
@ -15,19 +13,19 @@ import mage.filter.common.FilterCreatureCard;
|
|||
import mage.game.permanent.token.SaprolingToken;
|
||||
import mage.target.common.TargetCardInASingleGraveyard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class NightSoil extends CardImpl {
|
||||
|
||||
public NightSoil(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{G}{G}");
|
||||
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{G}{G}");
|
||||
|
||||
// {1}, Exile two creature cards from a single graveyard: Create a 1/1 green Saproling creature token.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SaprolingToken()), new GenericManaCost(1));
|
||||
ability.addCost(new ExileFromGraveCost(new TargetCardInASingleGraveyard(2,2, new FilterCreatureCard("two creature cards from a single graveyard"))));
|
||||
ability.addCost(new ExileFromGraveCost(new TargetCardInASingleGraveyard(2, 2, new FilterCreatureCard("two creature cards"))));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.r;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
|
@ -13,11 +11,12 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.common.TargetCardInASingleGraveyard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX, North
|
||||
*/
|
||||
public final class RagDealer extends CardImpl {
|
||||
|
@ -33,7 +32,7 @@ public final class RagDealer extends CardImpl {
|
|||
// {2}{B}, {T}: Exile up to three target cards from a single graveyard.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(), new ManaCostsImpl("{2}{B}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addTarget(new TargetCardInASingleGraveyard(0, 3, new FilterCard("cards from a single graveyard")));
|
||||
ability.addTarget(new TargetCardInASingleGraveyard(0, 3, StaticFilters.FILTER_CARD_CARDS));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
|
||||
package mage.cards.r;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.abilities.keyword.CyclingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.common.TargetCardInASingleGraveyard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
*/
|
||||
public final class RapidDecay extends CardImpl {
|
||||
|
@ -22,7 +21,7 @@ public final class RapidDecay extends CardImpl {
|
|||
|
||||
// Exile up to three target cards from a single graveyard.
|
||||
this.getSpellAbility().addEffect(new ExileTargetEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCardInASingleGraveyard(0, 3, new FilterCard("cards from a single graveyard")));
|
||||
this.getSpellAbility().addTarget(new TargetCardInASingleGraveyard(0, 3, StaticFilters.FILTER_CARD_CARDS));
|
||||
|
||||
// Cycling {2}
|
||||
this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}")));
|
||||
|
|
|
@ -22,7 +22,7 @@ public final class RatsFeast extends CardImpl {
|
|||
|
||||
// Exile X target cards from a single graveyard.
|
||||
this.getSpellAbility().addEffect(new ExileTargetEffect(
|
||||
"Exile X target cards from a single graveyard.", true
|
||||
"Exile X target cards from a single graveyard", true
|
||||
));
|
||||
this.getSpellAbility().setTargetAdjuster(RatsFeastAdjuster.instance);
|
||||
}
|
||||
|
@ -44,6 +44,6 @@ enum RatsFeastAdjuster implements TargetAdjuster {
|
|||
public void adjustTargets(Ability ability, Game game) {
|
||||
int xValue = ability.getManaCostsToPay().getX();
|
||||
ability.getTargets().clear();
|
||||
ability.addTarget(new TargetCardInASingleGraveyard(xValue, xValue, StaticFilters.FILTER_CARD));
|
||||
ability.addTarget(new TargetCardInASingleGraveyard(xValue, xValue, StaticFilters.FILTER_CARD_CARDS));
|
||||
}
|
||||
}
|
|
@ -1,25 +1,26 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.abilities.keyword.CyclingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.common.TargetCardInASingleGraveyard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author Stravant
|
||||
*/
|
||||
public final class ScarabFeast extends CardImpl {
|
||||
public ScarabFeast(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}");
|
||||
|
||||
// Exile up to three target cards from a single graveyard.
|
||||
getSpellAbility().addEffect(new ExileTargetEffect());
|
||||
getSpellAbility().addTarget(new TargetCardInASingleGraveyard(0, 3, new FilterCard("cards from a single graveyard")));
|
||||
getSpellAbility().addTarget(new TargetCardInASingleGraveyard(0, 3, StaticFilters.FILTER_CARD_CARDS));
|
||||
|
||||
// Cycling {B}
|
||||
addAbility(new CyclingAbility(new ManaCostsImpl("{B}")));
|
||||
|
|
|
@ -8,7 +8,7 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInASingleGraveyard;
|
||||
|
@ -23,10 +23,9 @@ public final class SereneRemembrance extends CardImpl {
|
|||
public SereneRemembrance(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}");
|
||||
|
||||
|
||||
// Shuffle Serene Remembrance and up to three target cards from a single graveyard into their owners' libraries.
|
||||
this.getSpellAbility().addEffect(new SereneRemembranceEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCardInASingleGraveyard(0, 3, new FilterCard("up to three target cards from a single graveyard")));
|
||||
this.getSpellAbility().addTarget(new TargetCardInASingleGraveyard(0, 3, StaticFilters.FILTER_CARD_CARDS));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.abilities.keyword.TransmuteAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.common.TargetCardInASingleGraveyard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class ShredMemory extends CardImpl {
|
||||
|
||||
public ShredMemory(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{B}");
|
||||
|
||||
// Exile up to four target cards from a single graveyard.
|
||||
this.getSpellAbility().addEffect(new ExileTargetEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCardInASingleGraveyard(0, 4, new FilterCard("cards from a single graveyard")));
|
||||
this.getSpellAbility().addTarget(new TargetCardInASingleGraveyard(0, 4, StaticFilters.FILTER_CARD_CARDS));
|
||||
|
||||
// Transmute {1}{B}{B}
|
||||
this.addAbility(new TransmuteAbility("{1}{B}{B}"));
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ExileTargetForSourceEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
@ -21,15 +21,15 @@ import mage.game.stack.Spell;
|
|||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInASingleGraveyard;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author emerald000
|
||||
*/
|
||||
public final class SpellweaverHelix extends CardImpl {
|
||||
|
||||
private static final FilterCard filter = new FilterCard("sorcery cards from a single graveyard");
|
||||
private static final FilterCard filter = new FilterCard("sorcery cards");
|
||||
|
||||
static {
|
||||
filter.add(CardType.SORCERY.getPredicate());
|
||||
|
@ -39,7 +39,7 @@ public final class SpellweaverHelix extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
|
||||
|
||||
// Imprint - When Spellweaver Helix enters the battlefield, you may exile two target sorcery cards from a single graveyard.
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new SpellweaverHelixImprintEffect(), true, "Imprint — ");
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new ExileTargetForSourceEffect(), true, "Imprint — ");
|
||||
ability.addTarget(new TargetCardInASingleGraveyard(2, 2, filter));
|
||||
this.addAbility(ability);
|
||||
|
||||
|
@ -57,42 +57,6 @@ public final class SpellweaverHelix extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class SpellweaverHelixImprintEffect extends OneShotEffect {
|
||||
|
||||
SpellweaverHelixImprintEffect() {
|
||||
super(Outcome.Exile);
|
||||
this.staticText = "you may exile two target sorcery cards from a single graveyard";
|
||||
}
|
||||
|
||||
SpellweaverHelixImprintEffect(final SpellweaverHelixImprintEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpellweaverHelixImprintEffect copy() {
|
||||
return new SpellweaverHelixImprintEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
for (UUID targetId : this.getTargetPointer().getTargets(game, source)) {
|
||||
Card card = game.getCard(targetId);
|
||||
if (card != null) {
|
||||
controller.moveCardsToExile(card, source, game, true, CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()), source.getSourceObject(game).getIdName());
|
||||
if (sourcePermanent != null) {
|
||||
sourcePermanent.imprint(targetId, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class SpellweaverHelixTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
SpellweaverHelixTriggeredAbility() {
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
|
@ -20,13 +17,16 @@ import mage.target.targetpointer.FirstTargetPointer;
|
|||
import mage.target.targetpointer.SecondTargetPointer;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class ExileTargetEffect extends OneShotEffect {
|
||||
|
||||
private Zone onlyFromZone;
|
||||
private final Zone onlyFromZone;
|
||||
private String exileZone = null;
|
||||
private UUID exileId = null;
|
||||
protected boolean multitargetHandling;
|
||||
|
@ -42,6 +42,9 @@ public class ExileTargetEffect extends OneShotEffect {
|
|||
this.multitargetHandling = multitargetHandling;
|
||||
}
|
||||
|
||||
/**
|
||||
* Exile cards to normal exile window (but it can exile to source's exile window after toSourceExileZone change)
|
||||
*/
|
||||
public ExileTargetEffect() {
|
||||
this(null, "");
|
||||
}
|
||||
|
|
|
@ -21,6 +21,10 @@ import java.util.UUID;
|
|||
*/
|
||||
public class ExileTargetForSourceEffect extends OneShotEffect {
|
||||
|
||||
/**
|
||||
* Exile cards to source's exile window (e.g. if it have another effect like return from exile later)
|
||||
* TODO: delete that effect and replace it by ExileTargetEffect (it have special param for same purpose)
|
||||
*/
|
||||
public ExileTargetForSourceEffect() {
|
||||
super(Outcome.Exile);
|
||||
}
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
package mage.filter;
|
||||
|
||||
import mage.cards.Card;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.predicate.*;
|
||||
import mage.game.Game;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.predicate.*;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
|
@ -95,4 +96,9 @@ public class FilterCard extends FilterObject<Card> {
|
|||
throw new IllegalArgumentException("Card filter doesn't support controller predicate");
|
||||
}
|
||||
}
|
||||
|
||||
public FilterCard withMessage(String message) {
|
||||
this.setMessage(message);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
package mage.filter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import mage.filter.predicate.Predicate;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.game.Game;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param <E>
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
* @author North
|
||||
* @param <E>
|
||||
*/
|
||||
public abstract class FilterImpl<E> implements Filter<E> {
|
||||
|
||||
|
@ -78,5 +78,4 @@ public abstract class FilterImpl<E> implements Filter<E> {
|
|||
public List<Predicate<? super E>> getPredicates() {
|
||||
return predicates;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
|
||||
|
||||
package mage.target.common;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.Zone;
|
||||
|
@ -10,17 +7,17 @@ import mage.filter.FilterCard;
|
|||
import mage.game.Game;
|
||||
import mage.target.TargetCard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
|
||||
public class TargetCardInASingleGraveyard extends TargetCard {
|
||||
|
||||
public TargetCardInASingleGraveyard(int minNumTargets, int maxNumTargets, FilterCard filter) {
|
||||
super(minNumTargets, maxNumTargets, Zone.GRAVEYARD, filter);
|
||||
// workaround to add extra message to final ability text
|
||||
super(minNumTargets, maxNumTargets, Zone.GRAVEYARD, filter.copy().withMessage(filter.getMessage() + " from a single graveyard"));
|
||||
}
|
||||
|
||||
public TargetCardInASingleGraveyard(final TargetCardInASingleGraveyard target) {
|
||||
|
@ -41,9 +38,9 @@ public class TargetCardInASingleGraveyard extends TargetCard {
|
|||
return super.canTarget(id, source, game);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TargetCardInASingleGraveyard copy() {
|
||||
return new TargetCardInASingleGraveyard(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue