forked from External/mage
fixed targets with "any number of"
This commit is contained in:
parent
44ad4f988f
commit
f405c7dd0d
6 changed files with 20 additions and 16 deletions
|
|
@ -82,7 +82,7 @@ class InameDeathAspectEffect extends SearchEffect<InameDeathAspectEffect> {
|
|||
}
|
||||
|
||||
public InameDeathAspectEffect() {
|
||||
super(new TargetCardInLibrary(0, 0, filter), Constants.Outcome.Neutral);
|
||||
super(new TargetCardInLibrary(0, Integer.MAX_VALUE, filter), Constants.Outcome.Neutral);
|
||||
staticText = "search your library for any number of Spirit cards and put them into your graveyard. If you do, shuffle your library";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ public class InameLifeAspect extends CardImpl<InameLifeAspect> {
|
|||
this.toughness = new MageInt(4);
|
||||
Ability ability = new DiesTriggeredAbility(new ExileSourceEffect(), true);
|
||||
ability.addEffect(new ReturnToHandTargetEffect());
|
||||
ability.addTarget(new TargetCardInYourGraveyard(0, 0, filter));
|
||||
ability.addTarget(new TargetCardInYourGraveyard(0, Integer.MAX_VALUE, filter));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public class HuntersFeast extends CardImpl<HuntersFeast> {
|
|||
super(ownerId, 182, "Hunters' Feast", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{G}");
|
||||
this.expansionSetCode = "M11";
|
||||
this.color.setGreen(true);
|
||||
this.getSpellAbility().addTarget(new TargetPlayer(0));
|
||||
this.getSpellAbility().addTarget(new TargetPlayer(0, Integer.MAX_VALUE, false));
|
||||
this.getSpellAbility().addEffect(new GainLifeTargetEffect(6));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,8 +35,6 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.Effects;
|
||||
import mage.abilities.effects.common.DrawCardControllerEffect;
|
||||
import mage.abilities.effects.common.DrawCardTargetEffect;
|
||||
import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect;
|
||||
|
|
@ -45,7 +43,6 @@ import mage.cards.CardImpl;
|
|||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
/**
|
||||
|
|
@ -75,7 +72,7 @@ public class JaceMemoryAdept extends CardImpl<JaceMemoryAdept> {
|
|||
|
||||
// -7: Any number of target players each draw twenty cards.
|
||||
LoyaltyAbility ability3 = new LoyaltyAbility(new JaceMemoryAdeptEffect(20), -7);
|
||||
ability3.addTarget(new TargetPlayer(0)); //any number
|
||||
ability3.addTarget(new TargetPlayer(0, Integer.MAX_VALUE, false)); //any number
|
||||
this.addAbility(ability3);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class FranticSalvage extends CardImpl<FranticSalvage> {
|
|||
|
||||
this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true));
|
||||
this.getSpellAbility().addEffect(new DrawCardControllerEffect(1));
|
||||
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0, 0, new FilterArtifactCard("artifact cards from your graveyard")));
|
||||
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0, Integer.MAX_VALUE, new FilterArtifactCard("artifact cards from your graveyard")));
|
||||
}
|
||||
|
||||
public FranticSalvage(final FranticSalvage card) {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ import java.util.HashMap;
|
|||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Logger;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Outcome;
|
||||
import mage.Constants.Rarity;
|
||||
|
|
@ -40,12 +39,12 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.costs.AlternativeCostImpl;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.target.TargetSpell;
|
||||
import mage.watchers.Watcher;
|
||||
import mage.watchers.WatcherImpl;
|
||||
|
|
@ -56,6 +55,8 @@ import mage.watchers.WatcherImpl;
|
|||
*/
|
||||
public class MindbreakTrap extends CardImpl<MindbreakTrap> {
|
||||
|
||||
private static final FilterSpell filter = new FilterSpell("spell to exile");
|
||||
|
||||
public MindbreakTrap(UUID ownerId) {
|
||||
super(ownerId, 57, "Mindbreak Trap", Rarity.MYTHIC, new CardType[]{CardType.INSTANT}, "{2}{U}{U}");
|
||||
this.expansionSetCode = "ZEN";
|
||||
|
|
@ -68,6 +69,7 @@ public class MindbreakTrap extends CardImpl<MindbreakTrap> {
|
|||
new MindbreakTrapAlternativeCost());
|
||||
this.addWatcher(new MindbreakTrapWatcher());
|
||||
// Exile any number of target spells.
|
||||
this.getSpellAbility().addTarget(new TargetSpell(0, Integer.MAX_VALUE, filter));
|
||||
this.getSpellAbility().addEffect(new MindbreakEffect());
|
||||
}
|
||||
|
||||
|
|
@ -169,12 +171,17 @@ class MindbreakEffect extends OneShotEffect<MindbreakEffect>{
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
TargetSpell target = new TargetSpell(new FilterSpell("spell to exile"));
|
||||
while(game.getPlayer(source.getControllerId()).choose(Outcome.Exile, target, source.getSourceId(), game)){
|
||||
game.getStack().getSpell(target.getFirstTarget()).moveToExile(null, null, source.getId(), game);
|
||||
target.clearChosen();
|
||||
}
|
||||
return true;
|
||||
int affectedTargets = 0;
|
||||
if (targetPointer.getTargets(source).size() > 0) {
|
||||
for (UUID spellId : targetPointer.getTargets(source)) {
|
||||
Spell spell = game.getStack().getSpell(spellId);
|
||||
if (spell != null) {
|
||||
spell.moveToExile(null, null, source.getId(), game);
|
||||
affectedTargets++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return affectedTargets > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue