mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
reworked various cards which use this.getId in their constructor
This commit is contained in:
parent
091fd16af9
commit
df1067ada7
15 changed files with 246 additions and 253 deletions
|
@ -12,8 +12,6 @@ import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.filter.common.FilterOwnedCard;
|
import mage.filter.common.FilterOwnedCard;
|
||||||
import mage.filter.predicate.Predicates;
|
|
||||||
import mage.filter.predicate.mageobject.CardIdPredicate;
|
|
||||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||||
import mage.target.common.TargetCardInHand;
|
import mage.target.common.TargetCardInHand;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
@ -25,19 +23,27 @@ import java.util.UUID;
|
||||||
*/
|
*/
|
||||||
public final class BlazingShoal extends CardImpl {
|
public final class BlazingShoal extends CardImpl {
|
||||||
|
|
||||||
|
private static final FilterOwnedCard filter
|
||||||
|
= new FilterOwnedCard("a red card with mana value X from your hand");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new ColorPredicate(ObjectColor.RED));
|
||||||
|
}
|
||||||
|
|
||||||
public BlazingShoal(UUID ownerId, CardSetInfo setInfo) {
|
public BlazingShoal(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{R}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{R}{R}");
|
||||||
this.subtype.add(SubType.ARCANE);
|
this.subtype.add(SubType.ARCANE);
|
||||||
|
|
||||||
|
|
||||||
// You may exile a red card with converted mana cost X from your hand rather than pay Blazing Shoal's mana cost.
|
// You may exile a red card with converted mana cost X from your hand rather than pay Blazing Shoal's mana cost.
|
||||||
FilterOwnedCard filter = new FilterOwnedCard("a red card with mana value X from your hand");
|
this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(
|
||||||
filter.add(new ColorPredicate(ObjectColor.RED));
|
new TargetCardInHand(filter), true
|
||||||
filter.add(Predicates.not(new CardIdPredicate(this.getId()))); // the exile cost can never be paid with the card itself
|
)));
|
||||||
this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter), true)));
|
|
||||||
|
|
||||||
// Target creature gets +X/+0 until end of turn.
|
// Target creature gets +X/+0 until end of turn.
|
||||||
this.getSpellAbility().addEffect(new BoostTargetEffect(ExileFromHandCostCardConvertedMana.instance, StaticValue.get(0), Duration.EndOfTurn));
|
this.getSpellAbility().addEffect(new BoostTargetEffect(
|
||||||
|
ExileFromHandCostCardConvertedMana.instance,
|
||||||
|
StaticValue.get(0), Duration.EndOfTurn
|
||||||
|
));
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.b;
|
package mage.cards.b;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
import mage.abilities.costs.AlternativeCostSourceAbility;
|
import mage.abilities.costs.AlternativeCostSourceAbility;
|
||||||
import mage.abilities.costs.common.ExileFromHandCost;
|
import mage.abilities.costs.common.ExileFromHandCost;
|
||||||
|
@ -11,29 +9,35 @@ import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.counters.CounterType;
|
import mage.counters.CounterType;
|
||||||
import mage.filter.common.FilterOwnedCard;
|
import mage.filter.common.FilterOwnedCard;
|
||||||
import mage.filter.predicate.Predicates;
|
|
||||||
import mage.filter.predicate.mageobject.CardIdPredicate;
|
|
||||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||||
import mage.target.common.TargetCardInHand;
|
import mage.target.common.TargetCardInHand;
|
||||||
import mage.target.common.TargetCreaturePermanentAmount;
|
import mage.target.common.TargetCreaturePermanentAmount;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LoneFox
|
* @author LoneFox
|
||||||
*/
|
*/
|
||||||
public final class BountyOfTheHunt extends CardImpl {
|
public final class BountyOfTheHunt extends CardImpl {
|
||||||
|
|
||||||
|
private static final FilterOwnedCard filter
|
||||||
|
= new FilterOwnedCard("a green card from your hand");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new ColorPredicate(ObjectColor.GREEN));
|
||||||
|
}
|
||||||
|
|
||||||
public BountyOfTheHunt(UUID ownerId, CardSetInfo setInfo) {
|
public BountyOfTheHunt(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{G}{G}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{G}{G}");
|
||||||
|
|
||||||
// You may exile a green card from your hand rather than pay Bounty of the Hunt's mana cost.
|
// You may exile a green card from your hand rather than pay Bounty of the Hunt's mana cost.
|
||||||
FilterOwnedCard filter = new FilterOwnedCard("green card from your hand");
|
|
||||||
filter.add(new ColorPredicate(ObjectColor.GREEN));
|
|
||||||
filter.add(Predicates.not(new CardIdPredicate(this.getId()))); // the exile cost can never be paid with the card itself
|
|
||||||
this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter))));
|
this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter))));
|
||||||
|
|
||||||
// Distribute three +1/+1 counters among one, two, or three target creatures. For each +1/+1 counter you put on a creature this way, remove a +1/+1 counter from that creature at the beginning of the next cleanup step.
|
// Distribute three +1/+1 counters among one, two, or three target creatures. For each +1/+1 counter you put on a creature this way, remove a +1/+1 counter from that creature at the beginning of the next cleanup step.
|
||||||
this.getSpellAbility().addEffect(new DistributeCountersEffect(CounterType.P1P1, 3, true, "one, two, or three target creatures"));
|
this.getSpellAbility().addEffect(new DistributeCountersEffect(
|
||||||
|
CounterType.P1P1, 3, true,
|
||||||
|
"one, two, or three target creatures"
|
||||||
|
));
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(3));
|
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(3));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
import mage.abilities.costs.AlternativeCostSourceAbility;
|
import mage.abilities.costs.AlternativeCostSourceAbility;
|
||||||
import mage.abilities.costs.common.ExileFromHandCost;
|
import mage.abilities.costs.common.ExileFromHandCost;
|
||||||
|
@ -12,24 +10,26 @@ import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.counters.CounterType;
|
import mage.counters.CounterType;
|
||||||
import mage.filter.common.FilterOwnedCard;
|
import mage.filter.common.FilterOwnedCard;
|
||||||
import mage.filter.predicate.Predicates;
|
|
||||||
import mage.filter.predicate.mageobject.CardIdPredicate;
|
|
||||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||||
import mage.target.common.TargetCardInHand;
|
import mage.target.common.TargetCardInHand;
|
||||||
import mage.target.common.TargetCreaturePermanentAmount;
|
import mage.target.common.TargetCreaturePermanentAmount;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Plopman
|
* @author Plopman
|
||||||
*/
|
*/
|
||||||
public final class Contagion extends CardImpl {
|
public final class Contagion extends CardImpl {
|
||||||
|
|
||||||
public Contagion(UUID ownerId, CardSetInfo setInfo) {
|
private static final FilterOwnedCard filter
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{B}{B}");
|
= new FilterOwnedCard("a black card from your hand");
|
||||||
|
|
||||||
FilterOwnedCard filter = new FilterOwnedCard("black card from your hand");
|
static {
|
||||||
filter.add(new ColorPredicate(ObjectColor.BLACK));
|
filter.add(new ColorPredicate(ObjectColor.BLACK));
|
||||||
filter.add(Predicates.not(new CardIdPredicate(this.getId()))); // the exile cost can never be paid with the card itself
|
}
|
||||||
|
|
||||||
|
public Contagion(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{B}{B}");
|
||||||
|
|
||||||
// You may pay 1 life and exile a black card from your hand rather than pay Contagion's mana cost.
|
// You may pay 1 life and exile a black card from your hand rather than pay Contagion's mana cost.
|
||||||
AlternativeCostSourceAbility ability = new AlternativeCostSourceAbility(new PayLifeCost(1));
|
AlternativeCostSourceAbility ability = new AlternativeCostSourceAbility(new PayLifeCost(1));
|
||||||
|
@ -38,7 +38,10 @@ public final class Contagion extends CardImpl {
|
||||||
|
|
||||||
// Distribute two -2/-1 counters among one or two target creatures.
|
// Distribute two -2/-1 counters among one or two target creatures.
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(2));
|
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(2));
|
||||||
this.getSpellAbility().addEffect(new DistributeCountersEffect(CounterType.M2M1, 2, false, "one or two target creatures"));
|
this.getSpellAbility().addEffect(new DistributeCountersEffect(
|
||||||
|
CounterType.M2M1, 2, false,
|
||||||
|
"one or two target creatures"
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
private Contagion(final Contagion card) {
|
private Contagion(final Contagion card) {
|
||||||
|
|
|
@ -14,8 +14,6 @@ import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.filter.common.FilterOwnedCard;
|
import mage.filter.common.FilterOwnedCard;
|
||||||
import mage.filter.predicate.Predicates;
|
|
||||||
import mage.filter.predicate.mageobject.CardIdPredicate;
|
|
||||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.stack.Spell;
|
import mage.game.stack.Spell;
|
||||||
|
@ -29,15 +27,21 @@ import java.util.UUID;
|
||||||
*/
|
*/
|
||||||
public final class DisruptingShoal extends CardImpl {
|
public final class DisruptingShoal extends CardImpl {
|
||||||
|
|
||||||
|
private static final FilterOwnedCard filter
|
||||||
|
= new FilterOwnedCard("a blue card with mana value X from your hand");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new ColorPredicate(ObjectColor.BLUE));
|
||||||
|
}
|
||||||
|
|
||||||
public DisruptingShoal(UUID ownerId, CardSetInfo setInfo) {
|
public DisruptingShoal(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{U}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{U}{U}");
|
||||||
this.subtype.add(SubType.ARCANE);
|
this.subtype.add(SubType.ARCANE);
|
||||||
|
|
||||||
// You may exile a blue card with converted mana cost X from your hand rather than pay Disrupting Shoal's mana cost.
|
// You may exile a blue card with converted mana cost X from your hand rather than pay Disrupting Shoal's mana cost.
|
||||||
FilterOwnedCard filter = new FilterOwnedCard("a blue card with mana value X from your hand");
|
this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(
|
||||||
filter.add(new ColorPredicate(ObjectColor.BLUE));
|
new TargetCardInHand(filter), true
|
||||||
filter.add(Predicates.not(new CardIdPredicate(this.getId()))); // the exile cost can never be paid with the card itself
|
)));
|
||||||
this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter), true)));
|
|
||||||
|
|
||||||
// 2/1/2005: Disrupting Shoal can target any spell, but does nothing unless that spell's converted mana cost is X.
|
// 2/1/2005: Disrupting Shoal can target any spell, but does nothing unless that spell's converted mana cost is X.
|
||||||
// Counter target spell if its converted mana cost is X.
|
// Counter target spell if its converted mana cost is X.
|
||||||
|
@ -96,5 +100,4 @@ class DisruptingShoalCounterTargetEffect extends OneShotEffect {
|
||||||
public String getText(Mode mode) {
|
public String getText(Mode mode) {
|
||||||
return "Counter target spell if its mana value is X";
|
return "Counter target spell if its mana value is X";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,20 +1,26 @@
|
||||||
package mage.cards.e;
|
package mage.cards.e;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
import mage.abilities.effects.common.ExileTargetEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.ReturnCreaturesFromExileEffect;
|
import mage.abilities.effects.common.ExileTargetForSourceEffect;
|
||||||
import mage.abilities.mana.ColorlessManaAbility;
|
import mage.abilities.mana.ColorlessManaAbility;
|
||||||
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.Outcome;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
import mage.game.ExileZone;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.players.Player;
|
||||||
import mage.target.common.TargetControlledCreaturePermanent;
|
import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public final class EndlessSands extends CardImpl {
|
public final class EndlessSands extends CardImpl {
|
||||||
|
|
||||||
|
@ -27,14 +33,13 @@ public final class EndlessSands extends CardImpl {
|
||||||
this.addAbility(new ColorlessManaAbility());
|
this.addAbility(new ColorlessManaAbility());
|
||||||
|
|
||||||
// {2}, {T}: Exile target creature you control.
|
// {2}, {T}: Exile target creature you control.
|
||||||
Ability exileAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(this.getId(), this.getIdName()), new ManaCostsImpl("{2}"));
|
Ability exileAbility = new SimpleActivatedAbility(new ExileTargetForSourceEffect(), new GenericManaCost(2));
|
||||||
exileAbility.addCost(new TapSourceCost());
|
exileAbility.addCost(new TapSourceCost());
|
||||||
exileAbility.addTarget(new TargetControlledCreaturePermanent());
|
exileAbility.addTarget(new TargetControlledCreaturePermanent());
|
||||||
this.addAbility(exileAbility);
|
this.addAbility(exileAbility);
|
||||||
|
|
||||||
// {4}, {T}, Sacrifice Endless Sands: Return each creature card exiled with Endless Sands to the battlefield under its owner's control.
|
// {4}, {T}, Sacrifice Endless Sands: Return each creature card exiled with Endless Sands to the battlefield under its owner's control.
|
||||||
ReturnCreaturesFromExileEffect returnFromExileEffect = new ReturnCreaturesFromExileEffect(this.getId(), true, "Return each creature card exiled with {this} to the battlefield under its owner's control.");
|
Ability returnAbility = new SimpleActivatedAbility(new EndlessSandsEffect(), new GenericManaCost(4));
|
||||||
Ability returnAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, returnFromExileEffect, new ManaCostsImpl("{4}"));
|
|
||||||
returnAbility.addCost(new TapSourceCost());
|
returnAbility.addCost(new TapSourceCost());
|
||||||
returnAbility.addCost(new SacrificeSourceCost());
|
returnAbility.addCost(new SacrificeSourceCost());
|
||||||
this.addAbility(returnAbility);
|
this.addAbility(returnAbility);
|
||||||
|
@ -49,3 +54,34 @@ public final class EndlessSands extends CardImpl {
|
||||||
return new EndlessSands(this);
|
return new EndlessSands(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class EndlessSandsEffect extends OneShotEffect {
|
||||||
|
|
||||||
|
EndlessSandsEffect() {
|
||||||
|
super(Outcome.Benefit);
|
||||||
|
staticText = "return each creature card exiled with {this} to the battlefield under its owner's control";
|
||||||
|
}
|
||||||
|
|
||||||
|
private EndlessSandsEffect(final EndlessSandsEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EndlessSandsEffect copy() {
|
||||||
|
return new EndlessSandsEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
Player player = game.getPlayer(source.getControllerId());
|
||||||
|
if (player == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
ExileZone exileZone = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source));
|
||||||
|
return player != null && exileZone != null
|
||||||
|
&& player.moveCards(
|
||||||
|
exileZone.getCards(game), Zone.BATTLEFIELD, source, game,
|
||||||
|
false, false, true, null
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -9,8 +9,6 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.filter.common.FilterOwnedCard;
|
import mage.filter.common.FilterOwnedCard;
|
||||||
import mage.filter.predicate.Predicates;
|
|
||||||
import mage.filter.predicate.mageobject.CardIdPredicate;
|
|
||||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||||
import mage.target.TargetSpell;
|
import mage.target.TargetSpell;
|
||||||
import mage.target.common.TargetCardInHand;
|
import mage.target.common.TargetCardInHand;
|
||||||
|
@ -22,14 +20,17 @@ import java.util.UUID;
|
||||||
*/
|
*/
|
||||||
public final class ForceOfWill extends CardImpl {
|
public final class ForceOfWill extends CardImpl {
|
||||||
|
|
||||||
|
private static final FilterOwnedCard filter
|
||||||
|
= new FilterOwnedCard("a blue card from your hand");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new ColorPredicate(ObjectColor.BLUE));
|
||||||
|
}
|
||||||
|
|
||||||
public ForceOfWill(UUID ownerId, CardSetInfo setInfo) {
|
public ForceOfWill(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{U}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{U}{U}");
|
||||||
|
|
||||||
// You may pay 1 life and exile a blue card from your hand rather than pay Force of Will's mana cost.
|
// You may pay 1 life and exile a blue card from your hand rather than pay Force of Will's mana cost.
|
||||||
FilterOwnedCard filter = new FilterOwnedCard("a blue card from your hand");
|
|
||||||
filter.add(new ColorPredicate(ObjectColor.BLUE));
|
|
||||||
filter.add(Predicates.not(new CardIdPredicate(this.getId()))); // the exile cost can never be paid with the card itself
|
|
||||||
|
|
||||||
AlternativeCostSourceAbility ability = new AlternativeCostSourceAbility(new PayLifeCost(1));
|
AlternativeCostSourceAbility ability = new AlternativeCostSourceAbility(new PayLifeCost(1));
|
||||||
ability.addCost(new ExileFromHandCost(new TargetCardInHand(filter)));
|
ability.addCost(new ExileFromHandCost(new TargetCardInHand(filter)));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
import mage.abilities.costs.AlternativeCostSourceAbility;
|
import mage.abilities.costs.AlternativeCostSourceAbility;
|
||||||
import mage.abilities.costs.common.ExileFromHandCost;
|
import mage.abilities.costs.common.ExileFromHandCost;
|
||||||
|
@ -11,34 +9,33 @@ import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.filter.FilterSpell;
|
import mage.filter.FilterSpell;
|
||||||
import mage.filter.common.FilterOwnedCard;
|
import mage.filter.common.FilterOwnedCard;
|
||||||
import mage.filter.predicate.Predicates;
|
|
||||||
import mage.filter.predicate.mageobject.CardIdPredicate;
|
|
||||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||||
import mage.filter.predicate.other.NumberOfTargetsPredicate;
|
import mage.filter.predicate.other.NumberOfTargetsPredicate;
|
||||||
import mage.target.TargetSpell;
|
import mage.target.TargetSpell;
|
||||||
import mage.target.common.TargetCardInHand;
|
import mage.target.common.TargetCardInHand;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author jonubuu
|
* @author jonubuu
|
||||||
*/
|
*/
|
||||||
public final class Misdirection extends CardImpl {
|
public final class Misdirection extends CardImpl {
|
||||||
|
|
||||||
|
private static final FilterOwnedCard filter
|
||||||
|
= new FilterOwnedCard("a blue card from your hand");
|
||||||
|
|
||||||
private static final FilterSpell filter2 = new FilterSpell("spell with a single target");
|
private static final FilterSpell filter2 = new FilterSpell("spell with a single target");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
filter.add(new ColorPredicate(ObjectColor.BLUE));
|
||||||
filter2.add(new NumberOfTargetsPredicate(1));
|
filter2.add(new NumberOfTargetsPredicate(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Misdirection(UUID ownerId, CardSetInfo setInfo) {
|
public Misdirection(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{U}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{U}{U}");
|
||||||
|
|
||||||
// You may exile a blue card from your hand rather than pay Misdirection's mana cost.
|
// You may exile a blue card from your hand rather than pay Misdirection's mana cost.
|
||||||
FilterOwnedCard filterCardInHand = new FilterOwnedCard("a blue card from your hand");
|
this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter))));
|
||||||
filterCardInHand.add(new ColorPredicate(ObjectColor.BLUE));
|
|
||||||
|
|
||||||
// the exile cost can never be paid with the card itself
|
|
||||||
filterCardInHand.add(Predicates.not(new CardIdPredicate(this.getId())));
|
|
||||||
this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filterCardInHand))));
|
|
||||||
|
|
||||||
// Change the target of target spell with a single target.
|
// Change the target of target spell with a single target.
|
||||||
this.getSpellAbility().addEffect(new ChooseNewTargetsTargetEffect(true, true));
|
this.getSpellAbility().addEffect(new ChooseNewTargetsTargetEffect(true, true));
|
||||||
|
@ -54,4 +51,3 @@ public final class Misdirection extends CardImpl {
|
||||||
return new Misdirection(this);
|
return new Misdirection(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.n;
|
package mage.cards.n;
|
||||||
|
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
|
@ -11,33 +10,34 @@ import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.filter.common.FilterOwnedCard;
|
import mage.filter.common.FilterOwnedCard;
|
||||||
import mage.filter.predicate.Predicates;
|
|
||||||
import mage.filter.predicate.mageobject.CardIdPredicate;
|
|
||||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||||
import mage.target.common.TargetCardInHand;
|
import mage.target.common.TargetCardInHand;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class NourishingShoal extends CardImpl {
|
public final class NourishingShoal extends CardImpl {
|
||||||
|
|
||||||
|
private static final FilterOwnedCard filter
|
||||||
|
= new FilterOwnedCard("a red card with mana value X from your hand");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new ColorPredicate(ObjectColor.GREEN));
|
||||||
|
}
|
||||||
|
|
||||||
public NourishingShoal(UUID ownerId, CardSetInfo setInfo) {
|
public NourishingShoal(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{G}{G}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{G}{G}");
|
||||||
this.subtype.add(SubType.ARCANE);
|
this.subtype.add(SubType.ARCANE);
|
||||||
|
|
||||||
|
|
||||||
// You may exile a green card with converted mana cost X from your hand rather than pay Nourishing Shoal's mana cost.
|
// You may exile a green card with converted mana cost X from your hand rather than pay Nourishing Shoal's mana cost.
|
||||||
FilterOwnedCard filter = new FilterOwnedCard("a green card with mana value X from your hand");
|
this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(
|
||||||
filter.add(new ColorPredicate(ObjectColor.GREEN));
|
new TargetCardInHand(filter), true
|
||||||
filter.add(Predicates.not(new CardIdPredicate(this.getId()))); // the exile cost can never be paid with the card itself
|
)));
|
||||||
this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter), true)));
|
|
||||||
|
|
||||||
// You gain X life.
|
// You gain X life.
|
||||||
this.getSpellAbility().addEffect(new GainLifeEffect(ExileFromHandCostCardConvertedMana.instance));
|
this.getSpellAbility().addEffect(new GainLifeEffect(ExileFromHandCostCardConvertedMana.instance));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private NourishingShoal(final NourishingShoal card) {
|
private NourishingShoal(final NourishingShoal card) {
|
||||||
|
|
|
@ -1,41 +1,38 @@
|
||||||
|
|
||||||
package mage.cards.o;
|
package mage.cards.o;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.StateTriggeredAbility;
|
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.common.SkipUntapOptionalAbility;
|
import mage.abilities.common.SkipUntapOptionalAbility;
|
||||||
import mage.abilities.condition.CompoundCondition;
|
|
||||||
import mage.abilities.condition.Condition;
|
|
||||||
import mage.abilities.condition.common.SourceTappedCondition;
|
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
import mage.abilities.decorator.ConditionalContinuousEffect;
|
import mage.abilities.effects.ContinuousEffectImpl;
|
||||||
import mage.abilities.effects.common.InfoEffect;
|
|
||||||
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.*;
|
||||||
import mage.constants.SubType;
|
import mage.filter.FilterPermanent;
|
||||||
import mage.constants.Duration;
|
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.filter.predicate.ObjectSourcePlayer;
|
import mage.filter.predicate.ObjectSourcePlayer;
|
||||||
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.TargetPermanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* @author TheElk801
|
||||||
* @author LevelX2
|
|
||||||
*/
|
*/
|
||||||
public final class OldManOfTheSea extends CardImpl {
|
public final class OldManOfTheSea extends CardImpl {
|
||||||
|
|
||||||
|
private static final FilterPermanent filter
|
||||||
|
= new FilterCreaturePermanent("creature with less than or equal power");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(OldManOfTheSeaPredicate.instance);
|
||||||
|
}
|
||||||
|
|
||||||
public OldManOfTheSea(UUID ownerId, CardSetInfo setInfo) {
|
public OldManOfTheSea(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{U}");
|
||||||
this.subtype.add(SubType.DJINN);
|
this.subtype.add(SubType.DJINN);
|
||||||
|
|
||||||
this.power = new MageInt(2);
|
this.power = new MageInt(2);
|
||||||
|
@ -45,16 +42,9 @@ public final class OldManOfTheSea extends CardImpl {
|
||||||
this.addAbility(new SkipUntapOptionalAbility());
|
this.addAbility(new SkipUntapOptionalAbility());
|
||||||
|
|
||||||
// {tap}: Gain control of target creature with power less than or equal to Old Man of the Sea's power for as long as Old Man of the Sea remains tapped and that creature's power remains less than or equal to Old Man of the Sea's power.
|
// {tap}: Gain control of target creature with power less than or equal to Old Man of the Sea's power for as long as Old Man of the Sea remains tapped and that creature's power remains less than or equal to Old Man of the Sea's power.
|
||||||
FilterCreaturePermanent controllableCreatures = new FilterCreaturePermanent("creature with power less than or equal to Old Man of the Sea's power");
|
Ability ability = new SimpleActivatedAbility(new OldManOfTheSeaEffect(), new TapSourceCost());
|
||||||
controllableCreatures.add(new PowerLowerEqualSourcePredicate(this.getId()));
|
ability.addTarget(new TargetPermanent(filter));
|
||||||
ConditionalContinuousEffect effect = new ConditionalContinuousEffect(
|
|
||||||
new OldManOfTheSeaGainControlTargetEffect(Duration.Custom, true), new CompoundCondition(SourceTappedCondition.TAPPED, new SourcePowerGreaterEqualTargetCondition()),
|
|
||||||
"Gain control of target creature with power less than or equal to {this}'s power for as long as {this} remains tapped and that creature's power remains less than or equal to {this}'s power");
|
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost());
|
|
||||||
ability.addTarget(new TargetCreaturePermanent(controllableCreatures));
|
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
// internal ability to check condition
|
|
||||||
this.addAbility(new OldManOfTheSeaStateBasedTriggeredAbility());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private OldManOfTheSea(final OldManOfTheSea card) {
|
private OldManOfTheSea(final OldManOfTheSea card) {
|
||||||
|
@ -67,109 +57,61 @@ public final class OldManOfTheSea extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class OldManOfTheSeaGainControlTargetEffect extends GainControlTargetEffect {
|
enum OldManOfTheSeaPredicate implements ObjectSourcePlayerPredicate<Permanent> {
|
||||||
|
instance;
|
||||||
|
|
||||||
public OldManOfTheSeaGainControlTargetEffect(Duration duration, boolean fixedControl) {
|
@Override
|
||||||
super(duration, fixedControl);
|
public boolean apply(ObjectSourcePlayer<Permanent> input, Game game) {
|
||||||
|
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(input.getSourceId());
|
||||||
|
return sourcePermanent != null
|
||||||
|
&& input.getObject().getPower().getValue() <= sourcePermanent.getPower().getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class OldManOfTheSeaEffect extends ContinuousEffectImpl {
|
||||||
|
|
||||||
|
OldManOfTheSeaEffect() {
|
||||||
|
super(Duration.Custom, Outcome.GainControl);
|
||||||
|
staticText = "gain control of target creature with power less than or equal to {this}'s power for as long as {this} remains tapped and that creature's power remains less than or equal to {this}'s power";
|
||||||
}
|
}
|
||||||
|
|
||||||
public OldManOfTheSeaGainControlTargetEffect(final OldManOfTheSeaGainControlTargetEffect effect) {
|
private OldManOfTheSeaEffect(final OldManOfTheSeaEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(Ability source, Game game) {
|
public OldManOfTheSeaEffect copy() {
|
||||||
super.init(source, game);
|
return new OldManOfTheSeaEffect(this);
|
||||||
// save target id to be available for hidden state based triggered effect
|
|
||||||
game.getState().setValue("target" + source.getSourceId(), getTargetPointer().getFirst(game, source));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OldManOfTheSeaGainControlTargetEffect copy() {
|
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
|
||||||
return new OldManOfTheSeaGainControlTargetEffect(this);
|
Permanent sourcePermanent = source.getSourcePermanentIfItStillExists(game);
|
||||||
}
|
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||||
}
|
if (sourcePermanent == null || permanent == null || !sourcePermanent.isTapped()) {
|
||||||
|
discard();
|
||||||
/*
|
return false;
|
||||||
used a state based triggered effect here (not going to stack, so running hidden) to compare power of the controlled
|
|
||||||
creature to Old Man of the seas power. It's not possible to do this as condition of continuous effect, because the
|
|
||||||
time the effect checks its condition, the layered effects that modify power are not applied yet.
|
|
||||||
result is save to a state value to be available for the condition of the continuous effect
|
|
||||||
*/
|
|
||||||
class OldManOfTheSeaStateBasedTriggeredAbility extends StateTriggeredAbility {
|
|
||||||
|
|
||||||
public OldManOfTheSeaStateBasedTriggeredAbility() {
|
|
||||||
super(Zone.BATTLEFIELD, new InfoEffect(""));
|
|
||||||
this.setRuleVisible(false);
|
|
||||||
this.usesStack = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OldManOfTheSeaStateBasedTriggeredAbility(final OldManOfTheSeaStateBasedTriggeredAbility ability) {
|
|
||||||
super(ability);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public OldManOfTheSeaStateBasedTriggeredAbility copy() {
|
|
||||||
return new OldManOfTheSeaStateBasedTriggeredAbility(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
|
||||||
Permanent sourcePermanent = game.getPermanent(getSourceId());
|
|
||||||
if (sourcePermanent != null && sourcePermanent.isTapped()) {
|
|
||||||
UUID controlledCreatureId = (UUID) game.getState().getValue("target" + getSourceId());
|
|
||||||
if (controlledCreatureId != null) {
|
|
||||||
Permanent controlledCreature = game.getPermanent(controlledCreatureId);
|
|
||||||
if (controlledCreature != null) {
|
|
||||||
if (controlledCreature.getPower().getValue() > sourcePermanent.getPower().getValue()) {
|
|
||||||
game.getState().setValue("powerCondition" + getSourceId(), Boolean.TRUE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
switch (layer) {
|
||||||
|
case ControlChangingEffects_2:
|
||||||
|
permanent.changeControllerId(source.getControllerId(), game, source);
|
||||||
|
return true;
|
||||||
|
case RulesEffects:
|
||||||
|
if (permanent.getPower().getValue() > sourcePermanent.getPower().getValue()) {
|
||||||
|
discard();
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
class SourcePowerGreaterEqualTargetCondition implements Condition {
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Object object = game.getState().getValue("powerCondition" + source.getSourceId());
|
|
||||||
if (object != null && (Boolean) object) {
|
|
||||||
// reset the values
|
|
||||||
game.getState().setValue("powerCondition" + source.getSourceId(), Boolean.FALSE);
|
|
||||||
game.getState().setValue("target" + source.getSourceId(), null);
|
|
||||||
// stop controlling target
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
class PowerLowerEqualSourcePredicate implements ObjectSourcePlayerPredicate<Permanent> {
|
|
||||||
|
|
||||||
UUID sourceId;
|
|
||||||
|
|
||||||
public PowerLowerEqualSourcePredicate(UUID sourceId) {
|
|
||||||
this.sourceId = sourceId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(ObjectSourcePlayer<Permanent> input, Game game) {
|
public boolean hasLayer(Layer layer) {
|
||||||
Permanent sourcePermanent = game.getPermanent(sourceId);
|
return layer == Layer.ControlChangingEffects_2 || layer == Layer.RulesEffects;
|
||||||
Permanent permanent = input.getObject();
|
|
||||||
if (permanent != null && sourcePermanent != null) {
|
|
||||||
if (permanent.getPower().getValue() <= sourcePermanent.getPower().getValue()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "creature with power less than or equal to {this}'s power";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,12 +12,13 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||||
import mage.abilities.keyword.FlyingAbility;
|
import mage.abilities.keyword.FlyingAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.*;
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.SubType;
|
||||||
|
import mage.constants.SuperType;
|
||||||
import mage.counters.CounterType;
|
import mage.counters.CounterType;
|
||||||
import mage.filter.FilterPermanent;
|
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.filter.predicate.mageobject.AnotherPredicate;
|
import mage.filter.predicate.mageobject.AnotherPredicate;
|
||||||
import mage.filter.predicate.mageobject.CardIdPredicate;
|
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -43,12 +44,6 @@ public final class OliviaVoldaren extends CardImpl {
|
||||||
this.power = new MageInt(3);
|
this.power = new MageInt(3);
|
||||||
this.toughness = new MageInt(3);
|
this.toughness = new MageInt(3);
|
||||||
|
|
||||||
String rule = "Gain control of target Vampire for as long as you control {this}";
|
|
||||||
|
|
||||||
FilterPermanent filter2 = new FilterPermanent();
|
|
||||||
filter2.add(TargetController.YOU.getControllerPredicate());
|
|
||||||
filter2.add(new CardIdPredicate(this.getId()));
|
|
||||||
|
|
||||||
this.addAbility(FlyingAbility.getInstance());
|
this.addAbility(FlyingAbility.getInstance());
|
||||||
|
|
||||||
// {1}{R}: Olivia Voldaren deals 1 damage to another target creature. That creature becomes a Vampire in addition to its other types. Put a +1/+1 counter on Olivia Voldaren.
|
// {1}{R}: Olivia Voldaren deals 1 damage to another target creature. That creature becomes a Vampire in addition to its other types. Put a +1/+1 counter on Olivia Voldaren.
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.p;
|
package mage.cards.p;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
import mage.abilities.costs.AlternativeCostSourceAbility;
|
import mage.abilities.costs.AlternativeCostSourceAbility;
|
||||||
import mage.abilities.costs.common.ExileFromHandCost;
|
import mage.abilities.costs.common.ExileFromHandCost;
|
||||||
|
@ -10,26 +8,28 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.filter.common.FilterOwnedCard;
|
import mage.filter.common.FilterOwnedCard;
|
||||||
import mage.filter.predicate.Predicates;
|
|
||||||
import mage.filter.predicate.mageobject.CardIdPredicate;
|
|
||||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||||
import mage.target.common.TargetCardInHand;
|
import mage.target.common.TargetCardInHand;
|
||||||
import mage.target.common.TargetCreaturePermanentAmount;
|
import mage.target.common.TargetCreaturePermanentAmount;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Plopman
|
* @author Plopman
|
||||||
*/
|
*/
|
||||||
public final class Pyrokinesis extends CardImpl {
|
public final class Pyrokinesis extends CardImpl {
|
||||||
|
|
||||||
public Pyrokinesis(UUID ownerId, CardSetInfo setInfo) {
|
private static final FilterOwnedCard filter
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{4}{R}{R}");
|
= new FilterOwnedCard("a red card from your hand");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new ColorPredicate(ObjectColor.RED));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Pyrokinesis(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{R}{R}");
|
||||||
|
|
||||||
// You may exile a red card from your hand rather than pay Pyrokinesis's mana cost.
|
// You may exile a red card from your hand rather than pay Pyrokinesis's mana cost.
|
||||||
FilterOwnedCard filter = new FilterOwnedCard("a red card from your hand");
|
|
||||||
filter.add(new ColorPredicate(ObjectColor.RED));
|
|
||||||
filter.add(Predicates.not(new CardIdPredicate(this.getId()))); // the exile cost can never be paid with the card itself
|
|
||||||
this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter))));
|
this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter))));
|
||||||
|
|
||||||
// Pyrokinesis deals 4 damage divided as you choose among any number of target creatures.
|
// Pyrokinesis deals 4 damage divided as you choose among any number of target creatures.
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.r;
|
package mage.cards.r;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
import mage.abilities.costs.AlternativeCostSourceAbility;
|
import mage.abilities.costs.AlternativeCostSourceAbility;
|
||||||
import mage.abilities.costs.common.ExileFromHandCost;
|
import mage.abilities.costs.common.ExileFromHandCost;
|
||||||
|
@ -10,31 +8,35 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.common.FilterOwnedCard;
|
import mage.filter.common.FilterOwnedCard;
|
||||||
import mage.filter.predicate.Predicates;
|
|
||||||
import mage.filter.predicate.mageobject.CardIdPredicate;
|
|
||||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||||
import mage.target.common.TargetCardInHand;
|
import mage.target.common.TargetCardInHand;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author ciaccona007
|
* @author ciaccona007
|
||||||
*/
|
*/
|
||||||
public final class ReverentMantra extends CardImpl {
|
public final class ReverentMantra extends CardImpl {
|
||||||
|
|
||||||
|
private static final FilterOwnedCard filter
|
||||||
|
= new FilterOwnedCard("a white card from your hand");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new ColorPredicate(ObjectColor.WHITE));
|
||||||
|
}
|
||||||
|
|
||||||
public ReverentMantra(UUID ownerId, CardSetInfo setInfo) {
|
public ReverentMantra(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{W}");
|
||||||
|
|
||||||
// You may exile a white card from your hand rather than pay Reverent Mantra's mana cost.
|
// You may exile a white card from your hand rather than pay Reverent Mantra's mana cost.
|
||||||
FilterOwnedCard filter = new FilterOwnedCard("a white card from your hand");
|
|
||||||
filter.add(new ColorPredicate(ObjectColor.WHITE));
|
|
||||||
filter.add(Predicates.not(new CardIdPredicate(this.getId())));
|
|
||||||
|
|
||||||
this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter))));
|
this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter))));
|
||||||
|
|
||||||
// Choose a color. All creatures gain protection from the chosen color until end of turn.
|
// Choose a color. All creatures gain protection from the chosen color until end of turn.
|
||||||
this.getSpellAbility().addEffect(new GainProtectionFromColorAllEffect(Duration.EndOfTurn, new FilterCreaturePermanent()));
|
this.getSpellAbility().addEffect(new GainProtectionFromColorAllEffect(
|
||||||
|
Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
private ReverentMantra(final ReverentMantra card) {
|
private ReverentMantra(final ReverentMantra card) {
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.s;
|
package mage.cards.s;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
@ -16,8 +14,6 @@ import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.filter.common.FilterOwnedCard;
|
import mage.filter.common.FilterOwnedCard;
|
||||||
import mage.filter.predicate.Predicates;
|
|
||||||
import mage.filter.predicate.mageobject.CardIdPredicate;
|
|
||||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
|
@ -27,24 +23,33 @@ import mage.target.TargetSource;
|
||||||
import mage.target.common.TargetAnyTarget;
|
import mage.target.common.TargetAnyTarget;
|
||||||
import mage.target.common.TargetCardInHand;
|
import mage.target.common.TargetCardInHand;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class ShiningShoal extends CardImpl {
|
public final class ShiningShoal extends CardImpl {
|
||||||
|
|
||||||
|
private static final FilterOwnedCard filter
|
||||||
|
= new FilterOwnedCard("a white card with mana value X from your hand");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new ColorPredicate(ObjectColor.WHITE));
|
||||||
|
}
|
||||||
|
|
||||||
public ShiningShoal(UUID ownerId, CardSetInfo setInfo) {
|
public ShiningShoal(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{W}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{W}{W}");
|
||||||
this.subtype.add(SubType.ARCANE);
|
this.subtype.add(SubType.ARCANE);
|
||||||
|
|
||||||
// You may exile a white card with converted mana cost X from your hand rather than pay Shining Shoal's mana cost
|
// You may exile a white card with converted mana cost X from your hand rather than pay Shining Shoal's mana cost
|
||||||
FilterOwnedCard filter = new FilterOwnedCard("a white card with mana value X from your hand");
|
this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(
|
||||||
filter.add(new ColorPredicate(ObjectColor.WHITE));
|
new TargetCardInHand(filter), true
|
||||||
filter.add(Predicates.not(new CardIdPredicate(this.getId()))); // the exile cost can never be paid with the card itself
|
)));
|
||||||
this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter), true)));
|
|
||||||
|
|
||||||
// The next X damage that a source of your choice would deal to you and/or creatures you control this turn is dealt to any target instead.
|
// The next X damage that a source of your choice would deal to you and/or creatures you control this turn is dealt to any target instead.
|
||||||
this.getSpellAbility().addEffect(new ShiningShoalRedirectDamageTargetEffect(Duration.EndOfTurn, ExileFromHandCostCardConvertedMana.instance));
|
this.getSpellAbility().addEffect(new ShiningShoalRedirectDamageTargetEffect(
|
||||||
|
Duration.EndOfTurn, ExileFromHandCostCardConvertedMana.instance
|
||||||
|
));
|
||||||
this.getSpellAbility().addTarget(new TargetSource());
|
this.getSpellAbility().addTarget(new TargetSource());
|
||||||
this.getSpellAbility().addTarget(new TargetAnyTarget());
|
this.getSpellAbility().addTarget(new TargetAnyTarget());
|
||||||
}
|
}
|
||||||
|
@ -129,5 +134,4 @@ class ShiningShoalRedirectDamageTargetEffect extends RedirectDamageFromSourceToT
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.s;
|
package mage.cards.s;
|
||||||
|
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
|
@ -14,8 +13,6 @@ import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.filter.common.FilterOwnedCard;
|
import mage.filter.common.FilterOwnedCard;
|
||||||
import mage.filter.predicate.Predicates;
|
|
||||||
import mage.filter.predicate.mageobject.CardIdPredicate;
|
|
||||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||||
import mage.target.common.TargetCardInHand;
|
import mage.target.common.TargetCardInHand;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
@ -23,25 +20,29 @@ import mage.target.common.TargetCreaturePermanent;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class SickeningShoal extends CardImpl {
|
public final class SickeningShoal extends CardImpl {
|
||||||
|
|
||||||
|
private static final FilterOwnedCard filter
|
||||||
|
= new FilterOwnedCard("a black card with mana value X from your hand");
|
||||||
|
private static final DynamicValue xValue = new SignInversionDynamicValue(ExileFromHandCostCardConvertedMana.instance);
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new ColorPredicate(ObjectColor.BLACK));
|
||||||
|
}
|
||||||
|
|
||||||
public SickeningShoal(UUID ownerId, CardSetInfo setInfo) {
|
public SickeningShoal(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{B}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{B}{B}");
|
||||||
this.subtype.add(SubType.ARCANE);
|
this.subtype.add(SubType.ARCANE);
|
||||||
|
|
||||||
|
|
||||||
// You may exile a black card with converted mana cost X from your hand rather than pay Sickening Shoal's mana cost.
|
// You may exile a black card with converted mana cost X from your hand rather than pay Sickening Shoal's mana cost.
|
||||||
FilterOwnedCard filter = new FilterOwnedCard("a black card with mana value X from your hand");
|
this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(
|
||||||
filter.add(new ColorPredicate(ObjectColor.BLACK));
|
new TargetCardInHand(filter), true
|
||||||
filter.add(Predicates.not(new CardIdPredicate(this.getId()))); // the exile cost can never be paid with the card itself
|
)));
|
||||||
this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter), true)));
|
|
||||||
|
|
||||||
// Target creature gets -X/-X until end of turn.
|
// Target creature gets -X/-X until end of turn.
|
||||||
DynamicValue x = new SignInversionDynamicValue(ExileFromHandCostCardConvertedMana.instance);
|
this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn, true));
|
||||||
this.getSpellAbility().addEffect(new BoostTargetEffect(x, x, Duration.EndOfTurn, true));
|
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.s;
|
package mage.cards.s;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
import mage.abilities.costs.AlternativeCostSourceAbility;
|
import mage.abilities.costs.AlternativeCostSourceAbility;
|
||||||
import mage.abilities.costs.common.ExileFromHandCost;
|
import mage.abilities.costs.common.ExileFromHandCost;
|
||||||
|
@ -10,27 +8,29 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.filter.common.FilterOwnedCard;
|
import mage.filter.common.FilterOwnedCard;
|
||||||
import mage.filter.predicate.Predicates;
|
|
||||||
import mage.filter.predicate.mageobject.CardIdPredicate;
|
|
||||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||||
import mage.target.common.TargetCardInHand;
|
import mage.target.common.TargetCardInHand;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author emerald000
|
* @author emerald000
|
||||||
*/
|
*/
|
||||||
public final class Snapback extends CardImpl {
|
public final class Snapback extends CardImpl {
|
||||||
|
|
||||||
public Snapback(UUID ownerId, CardSetInfo setInfo) {
|
private static final FilterOwnedCard filter
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{U}");
|
= new FilterOwnedCard("a blue card from your hand");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new ColorPredicate(ObjectColor.BLUE));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Snapback(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}");
|
||||||
|
|
||||||
// You may exile a blue card from your hand rather than pay Snapback's mana cost.
|
// You may exile a blue card from your hand rather than pay Snapback's mana cost.
|
||||||
FilterOwnedCard filterCardInHand = new FilterOwnedCard("a blue card from your hand");
|
this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter))));
|
||||||
filterCardInHand.add(new ColorPredicate(ObjectColor.BLUE));
|
|
||||||
filterCardInHand.add(Predicates.not(new CardIdPredicate(this.getId())));
|
|
||||||
this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filterCardInHand))));
|
|
||||||
|
|
||||||
// Return target creature to its owner's hand.
|
// Return target creature to its owner's hand.
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||||
|
|
Loading…
Reference in a new issue