mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
Merge branch 'targetAdjustment' into master
This commit is contained in:
commit
3483b3a181
154 changed files with 3062 additions and 2964 deletions
|
@ -1,26 +1,26 @@
|
||||||
|
|
||||||
package mage.cards.a;
|
package mage.cards.a;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
|
import mage.abilities.costs.CostAdjuster;
|
||||||
import mage.abilities.costs.common.DiscardTargetCost;
|
import mage.abilities.costs.common.DiscardTargetCost;
|
||||||
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
|
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.common.InfoEffect;
|
||||||
import mage.abilities.effects.common.discard.DiscardCardYouChooseTargetEffect;
|
import mage.abilities.effects.common.discard.DiscardCardYouChooseTargetEffect;
|
||||||
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.TargetController;
|
import mage.constants.TargetController;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.TargetPlayer;
|
import mage.target.TargetPlayer;
|
||||||
import mage.target.common.TargetCardInHand;
|
import mage.target.common.TargetCardInHand;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author fireshoes
|
* @author fireshoes
|
||||||
*/
|
*/
|
||||||
public final class AbandonHope extends CardImpl {
|
public final class AbandonHope extends CardImpl {
|
||||||
|
@ -29,7 +29,7 @@ public final class AbandonHope extends CardImpl {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{1}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{1}{B}");
|
||||||
|
|
||||||
// As an additional cost to cast Abandon Hope, discard X cards.
|
// As an additional cost to cast Abandon Hope, discard X cards.
|
||||||
Ability ability = new SimpleStaticAbility(Zone.ALL, new AbandonHopeRuleEffect());
|
Ability ability = new SimpleStaticAbility(Zone.ALL, new InfoEffect("As an additional cost to cast this spell, discard X cards"));
|
||||||
ability.setRuleAtTheTop(true);
|
ability.setRuleAtTheTop(true);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
|
@ -37,44 +37,27 @@ public final class AbandonHope extends CardImpl {
|
||||||
ManacostVariableValue manaX = new ManacostVariableValue();
|
ManacostVariableValue manaX = new ManacostVariableValue();
|
||||||
this.getSpellAbility().addEffect(new DiscardCardYouChooseTargetEffect(manaX, TargetController.ANY));
|
this.getSpellAbility().addEffect(new DiscardCardYouChooseTargetEffect(manaX, TargetController.ANY));
|
||||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||||
|
this.getSpellAbility().setCostAdjuster(AbandonHopeAdjuster.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AbandonHope(final AbandonHope card) {
|
public AbandonHope(final AbandonHope card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustCosts(Ability ability, Game game) {
|
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
|
||||||
if (xValue > 0) {
|
|
||||||
ability.addCost(new DiscardTargetCost(new TargetCardInHand(xValue, xValue, new FilterCard("cards"))));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AbandonHope copy() {
|
public AbandonHope copy() {
|
||||||
return new AbandonHope(this);
|
return new AbandonHope(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class AbandonHopeRuleEffect extends OneShotEffect {
|
enum AbandonHopeAdjuster implements CostAdjuster {
|
||||||
|
instance;
|
||||||
public AbandonHopeRuleEffect() {
|
|
||||||
super(Outcome.Benefit);
|
|
||||||
this.staticText = "As an additional cost to cast this spell, discard X cards";
|
|
||||||
}
|
|
||||||
|
|
||||||
public AbandonHopeRuleEffect(final AbandonHopeRuleEffect effect) {
|
|
||||||
super(effect);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AbandonHopeRuleEffect copy() {
|
public void adjustCosts(Ability ability, Game game) {
|
||||||
return new AbandonHopeRuleEffect(this);
|
int xValue = ability.getManaCostsToPay().getX();
|
||||||
|
if (xValue > 0) {
|
||||||
|
ability.addCost(new DiscardTargetCost(new TargetCardInHand(xValue, xValue, StaticFilters.FILTER_CARD_CARDS)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -13,29 +13,42 @@ import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES;
|
import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author magenoxx_at_gmail.com
|
* @author magenoxx_at_gmail.com
|
||||||
*/
|
*/
|
||||||
public final class AetherBurst extends CardImpl {
|
public final class AetherBurst extends CardImpl {
|
||||||
|
|
||||||
private static final FilterCard filter = new FilterCard("cards named Aether Burst");
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(new NamePredicate("Aether Burst"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public AetherBurst(UUID ownerId, CardSetInfo setInfo) {
|
public AetherBurst(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}");
|
||||||
|
|
||||||
// Return up to X target creatures to their owners' hands, where X is one plus the number of cards named Aether Burst in all graveyards as you cast Aether Burst.
|
// Return up to X target creatures to their owners' hands, where X is one plus the number of cards named Aether Burst in all graveyards as you cast Aether Burst.
|
||||||
this.getSpellAbility().addEffect(new DynamicReturnToHandTargetEffect());
|
this.getSpellAbility().addEffect(new DynamicReturnToHandTargetEffect());
|
||||||
this.getSpellAbility().addTarget(new DynamicTargetCreaturePermanent());
|
this.getSpellAbility().addTarget(new DynamicTargetCreaturePermanent());
|
||||||
|
this.getSpellAbility().setTargetAdjuster(AetherBurstAdjuster.instance);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public AetherBurst(final AetherBurst card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AetherBurst copy() {
|
||||||
|
return new AetherBurst(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum AetherBurstAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
private static final FilterCard filter = new FilterCard("cards named Aether Burst");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new NamePredicate("Aether Burst"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -55,15 +68,6 @@ public final class AetherBurst extends CardImpl {
|
||||||
target.setMaxNumberOfTargets(amount + 1);
|
target.setMaxNumberOfTargets(amount + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public AetherBurst(final AetherBurst card) {
|
|
||||||
super(card);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public AetherBurst copy() {
|
|
||||||
return new AetherBurst(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class DynamicTargetCreaturePermanent extends TargetPermanent {
|
class DynamicTargetCreaturePermanent extends TargetPermanent {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.a;
|
package mage.cards.a;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.AttacksTriggeredAbility;
|
import mage.abilities.common.AttacksTriggeredAbility;
|
||||||
|
@ -21,17 +20,17 @@ import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class AetherstormRoc extends CardImpl {
|
public final class AetherstormRoc extends CardImpl {
|
||||||
|
|
||||||
private final UUID originalId;
|
|
||||||
|
|
||||||
public AetherstormRoc(UUID ownerId, CardSetInfo setInfo) {
|
public AetherstormRoc(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}{W}");
|
||||||
this.subtype.add(SubType.BIRD);
|
this.subtype.add(SubType.BIRD);
|
||||||
this.power = new MageInt(3);
|
this.power = new MageInt(3);
|
||||||
this.toughness = new MageInt(3);
|
this.toughness = new MageInt(3);
|
||||||
|
@ -47,30 +46,32 @@ public final class AetherstormRoc extends CardImpl {
|
||||||
Ability ability = new AttacksTriggeredAbility(doIfCostPaidEffect, false,
|
Ability ability = new AttacksTriggeredAbility(doIfCostPaidEffect, false,
|
||||||
"Whenever {this} attacks you may pay {E}{E}. If you do, put a +1/+1 counter on it and tap up to one target creature defending player controls.");
|
"Whenever {this} attacks you may pay {E}{E}. If you do, put a +1/+1 counter on it and tap up to one target creature defending player controls.");
|
||||||
ability.addTarget(new TargetCreaturePermanent(0, 1, new FilterCreaturePermanent("creature defending player controls"), false));
|
ability.addTarget(new TargetCreaturePermanent(0, 1, new FilterCreaturePermanent("creature defending player controls"), false));
|
||||||
originalId = ability.getOriginalId();
|
ability.setTargetAdjuster(AetherstormRocAdjuster.instance);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public AetherstormRoc(final AetherstormRoc card) {
|
public AetherstormRoc(final AetherstormRoc card) {
|
||||||
super(card);
|
super(card);
|
||||||
this.originalId = card.originalId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability.getOriginalId().equals(originalId)) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
|
|
||||||
UUID defenderId = game.getCombat().getDefenderId(ability.getSourceId());
|
|
||||||
filter.add(new ControllerIdPredicate(defenderId));
|
|
||||||
TargetCreaturePermanent target = new TargetCreaturePermanent(0, 1, filter, false);
|
|
||||||
ability.addTarget(target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AetherstormRoc copy() {
|
public AetherstormRoc copy() {
|
||||||
return new AetherstormRoc(this);
|
return new AetherstormRoc(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum AetherstormRocAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
|
||||||
|
UUID defenderId = game.getCombat().getDefenderId(ability.getSourceId());
|
||||||
|
filter.add(new ControllerIdPredicate(defenderId));
|
||||||
|
TargetCreaturePermanent target = new TargetCreaturePermanent(0, 1, filter, false);
|
||||||
|
ability.addTarget(target);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,9 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.a;
|
package mage.cards.a;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
|
import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
@ -18,9 +16,11 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.common.TargetCardInYourGraveyard;
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Quercitron
|
* @author Quercitron
|
||||||
*/
|
*/
|
||||||
public final class AphettoDredging extends CardImpl {
|
public final class AphettoDredging extends CardImpl {
|
||||||
|
@ -32,20 +32,7 @@ public final class AphettoDredging extends CardImpl {
|
||||||
Effect effect = new ReturnFromGraveyardToHandTargetEffect();
|
Effect effect = new ReturnFromGraveyardToHandTargetEffect();
|
||||||
effect.setText("Return up to three target creature cards of the creature type of your choice from your graveyard to your hand");
|
effect.setText("Return up to three target creature cards of the creature type of your choice from your graveyard to your hand");
|
||||||
this.getSpellAbility().addEffect(effect);
|
this.getSpellAbility().addEffect(effect);
|
||||||
}
|
this.getSpellAbility().setTargetAdjuster(AphettoDredgingAdjuster.instance);
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
Player controller = game.getPlayer(ability.getControllerId());
|
|
||||||
Choice typeChoice = new ChoiceCreatureType(game.getObject(ability.getSourceId()));
|
|
||||||
if (controller != null && controller.choose(Outcome.PutCreatureInPlay, typeChoice, game)) {
|
|
||||||
String chosenType = typeChoice.getChoice();
|
|
||||||
FilterCreatureCard filter = new FilterCreatureCard(chosenType + " cards");
|
|
||||||
filter.add(new SubtypePredicate(SubType.byDescription(chosenType)));
|
|
||||||
ability.addTarget(new TargetCardInYourGraveyard(0, 3, filter));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public AphettoDredging(final AphettoDredging card) {
|
public AphettoDredging(final AphettoDredging card) {
|
||||||
|
@ -57,3 +44,19 @@ public final class AphettoDredging extends CardImpl {
|
||||||
return new AphettoDredging(this);
|
return new AphettoDredging(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum AphettoDredgingAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
Player controller = game.getPlayer(ability.getControllerId());
|
||||||
|
Choice typeChoice = new ChoiceCreatureType(game.getObject(ability.getSourceId()));
|
||||||
|
if (controller != null && controller.choose(Outcome.PutCreatureInPlay, typeChoice, game)) {
|
||||||
|
String chosenType = typeChoice.getChoice();
|
||||||
|
FilterCreatureCard filter = new FilterCreatureCard(chosenType + " cards");
|
||||||
|
filter.add(new SubtypePredicate(SubType.byDescription(chosenType)));
|
||||||
|
ability.addTarget(new TargetCardInYourGraveyard(0, 3, filter));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,40 +1,32 @@
|
||||||
|
|
||||||
package mage.cards.a;
|
package mage.cards.a;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||||
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.SuperType;
|
||||||
|
import mage.filter.FilterPermanent;
|
||||||
import mage.filter.common.FilterLandPermanent;
|
import mage.filter.common.FilterLandPermanent;
|
||||||
|
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author TheElk801
|
* @author TheElk801
|
||||||
*/
|
*/
|
||||||
public final class Avalanche extends CardImpl {
|
public final class Avalanche extends CardImpl {
|
||||||
|
|
||||||
private static final FilterLandPermanent filter = new FilterLandPermanent("snow lands");
|
|
||||||
|
|
||||||
public Avalanche(UUID ownerId, CardSetInfo setInfo) {
|
public Avalanche(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{2}{R}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{2}{R}{R}");
|
||||||
|
|
||||||
// Destroy X target snow lands.
|
// Destroy X target snow lands.
|
||||||
this.getSpellAbility().addEffect(new DestroyTargetEffect("Destroy X target snow lands"));
|
this.getSpellAbility().addEffect(new DestroyTargetEffect("Destroy X target snow lands"));
|
||||||
this.getSpellAbility().addTarget(new TargetPermanent(filter));
|
this.getSpellAbility().setTargetAdjuster(AvalancheAdjuster.instance);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
|
||||||
ability.addTarget(new TargetPermanent(xValue, xValue, filter, false));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Avalanche(final Avalanche card) {
|
public Avalanche(final Avalanche card) {
|
||||||
|
@ -46,3 +38,19 @@ public final class Avalanche extends CardImpl {
|
||||||
return new Avalanche(this);
|
return new Avalanche(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum AvalancheAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
private static final FilterPermanent filter = new FilterLandPermanent("snow lands");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new SupertypePredicate(SuperType.SNOW));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
int xValue = ability.getManaCostsToPay().getX();
|
||||||
|
ability.addTarget(new TargetPermanent(xValue, xValue, filter, false));
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,9 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.b;
|
package mage.cards.b;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.effects.ContinuousEffect;
|
import mage.abilities.effects.ContinuousEffect;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
|
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
|
||||||
|
@ -18,6 +16,7 @@ import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -31,34 +30,37 @@ public final class BlatantThievery extends CardImpl {
|
||||||
|
|
||||||
// For each opponent, gain control of target permanent that player controls.
|
// For each opponent, gain control of target permanent that player controls.
|
||||||
this.getSpellAbility().addEffect(new BlatantThieveryEffect());
|
this.getSpellAbility().addEffect(new BlatantThieveryEffect());
|
||||||
|
this.getSpellAbility().setTargetAdjuster(BlatantThieveryAdjuster.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BlatantThievery(final BlatantThievery card) {
|
public BlatantThievery(final BlatantThievery card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
for (UUID opponentId : game.getOpponents(ability.getControllerId())) {
|
|
||||||
Player opponent = game.getPlayer(opponentId);
|
|
||||||
if (opponent != null) {
|
|
||||||
FilterPermanent filter = new FilterPermanent("Permanent of player " + opponent.getName());
|
|
||||||
filter.add(new ControllerIdPredicate(opponentId));
|
|
||||||
TargetPermanent targetPermanent = new TargetPermanent(filter);
|
|
||||||
ability.addTarget(targetPermanent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlatantThievery copy() {
|
public BlatantThievery copy() {
|
||||||
return new BlatantThievery(this);
|
return new BlatantThievery(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum BlatantThieveryAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
for (UUID opponentId : game.getOpponents(ability.getControllerId())) {
|
||||||
|
Player opponent = game.getPlayer(opponentId);
|
||||||
|
if (opponent != null) {
|
||||||
|
FilterPermanent filter = new FilterPermanent("Permanent of player " + opponent.getName());
|
||||||
|
filter.add(new ControllerIdPredicate(opponentId));
|
||||||
|
TargetPermanent targetPermanent = new TargetPermanent(filter);
|
||||||
|
ability.addTarget(targetPermanent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class BlatantThieveryEffect extends OneShotEffect {
|
class BlatantThieveryEffect extends OneShotEffect {
|
||||||
|
|
||||||
BlatantThieveryEffect() {
|
BlatantThieveryEffect() {
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.b;
|
package mage.cards.b;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
@ -16,9 +12,13 @@ import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.common.TargetArtifactPermanent;
|
import mage.target.common.TargetArtifactPermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author sinsedrix
|
* @author sinsedrix
|
||||||
*/
|
*/
|
||||||
public final class BuildersBane extends CardImpl {
|
public final class BuildersBane extends CardImpl {
|
||||||
|
@ -29,15 +29,7 @@ public final class BuildersBane extends CardImpl {
|
||||||
// Destroy X target artifacts. Builder's Bane deals damage to each player equal to the number of artifacts he or she controlled put into a graveyard this way.
|
// Destroy X target artifacts. Builder's Bane deals damage to each player equal to the number of artifacts he or she controlled put into a graveyard this way.
|
||||||
this.getSpellAbility().addTarget(new TargetArtifactPermanent());
|
this.getSpellAbility().addTarget(new TargetArtifactPermanent());
|
||||||
this.getSpellAbility().addEffect(new BuildersBaneEffect());
|
this.getSpellAbility().addEffect(new BuildersBaneEffect());
|
||||||
}
|
this.getSpellAbility().setTargetAdjuster(BuildersBaneAdjuster.instance);
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
|
||||||
ability.addTarget(new TargetArtifactPermanent(xValue, xValue));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public BuildersBane(final BuildersBane card) {
|
public BuildersBane(final BuildersBane card) {
|
||||||
|
@ -50,11 +42,22 @@ public final class BuildersBane extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum BuildersBaneAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
int xValue = ability.getManaCostsToPay().getX();
|
||||||
|
ability.addTarget(new TargetArtifactPermanent(xValue, xValue));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class BuildersBaneEffect extends OneShotEffect {
|
class BuildersBaneEffect extends OneShotEffect {
|
||||||
|
|
||||||
public BuildersBaneEffect() {
|
public BuildersBaneEffect() {
|
||||||
super(Outcome.DestroyPermanent);
|
super(Outcome.DestroyPermanent);
|
||||||
this.staticText = "Destroy X target artifacts. {this} deals damage to each player equal to the number of artifacts he or she controlled put into a graveyard this way";
|
this.staticText = "Destroy X target artifacts. {this} deals damage to each player equal to the number of artifacts they controlled that were put into a graveyard this way";
|
||||||
}
|
}
|
||||||
|
|
||||||
public BuildersBaneEffect(final BuildersBaneEffect effect) {
|
public BuildersBaneEffect(final BuildersBaneEffect effect) {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.b;
|
package mage.cards.b;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.DiesCreatureTriggeredAbility;
|
import mage.abilities.common.DiesCreatureTriggeredAbility;
|
||||||
import mage.abilities.effects.common.SacrificeEffect;
|
import mage.abilities.effects.common.SacrificeEffect;
|
||||||
|
@ -12,39 +11,29 @@ import mage.constants.Zone;
|
||||||
import mage.filter.StaticFilters;
|
import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class BurningSands extends CardImpl {
|
public final class BurningSands extends CardImpl {
|
||||||
|
|
||||||
private final UUID originalId;
|
|
||||||
|
|
||||||
public BurningSands(UUID ownerId, CardSetInfo setInfo) {
|
public BurningSands(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{R}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}{R}");
|
||||||
|
|
||||||
// Whenever a creature dies, that creature's controller sacrifices a land.
|
// Whenever a creature dies, that creature's controller sacrifices a land.
|
||||||
Ability ability = new DiesCreatureTriggeredAbility(new SacrificeEffect(StaticFilters.FILTER_LAND, 1, "that creature's controller"), false, false, true);
|
Ability ability = new DiesCreatureTriggeredAbility(new SacrificeEffect(
|
||||||
originalId = ability.getOriginalId();
|
StaticFilters.FILTER_LAND, 1, "that creature's controller"
|
||||||
|
), false, false, true);
|
||||||
|
ability.setTargetAdjuster(BurningSandsAdjuster.instance);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability.getOriginalId().equals(originalId)) {
|
|
||||||
UUID creatureId = ability.getEffects().get(0).getTargetPointer().getFirst(game, ability);
|
|
||||||
Permanent creature = (Permanent) game.getLastKnownInformation(creatureId, Zone.BATTLEFIELD);
|
|
||||||
if (creature != null) {
|
|
||||||
ability.getEffects().get(0).setTargetPointer(new FixedTarget(creature.getControllerId()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public BurningSands(final BurningSands card) {
|
public BurningSands(final BurningSands card) {
|
||||||
super(card);
|
super(card);
|
||||||
this.originalId = card.originalId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -52,3 +41,16 @@ public final class BurningSands extends CardImpl {
|
||||||
return new BurningSands(this);
|
return new BurningSands(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum BurningSandsAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
UUID creatureId = ability.getEffects().get(0).getTargetPointer().getFirst(game, ability);
|
||||||
|
Permanent creature = game.getPermanentOrLKIBattlefield(creatureId);
|
||||||
|
if (creature != null) {
|
||||||
|
ability.getEffects().get(0).setTargetPointer(new FixedTarget(creature.getControllerId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,18 +1,18 @@
|
||||||
|
|
||||||
package mage.cards.b;
|
package mage.cards.b;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||||
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.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetArtifactPermanent;
|
import mage.target.common.TargetArtifactPermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author spjspj
|
* @author spjspj
|
||||||
*/
|
*/
|
||||||
public final class ByForce extends CardImpl {
|
public final class ByForce extends CardImpl {
|
||||||
|
@ -23,15 +23,7 @@ public final class ByForce extends CardImpl {
|
||||||
// Destroy X target artifacts.
|
// Destroy X target artifacts.
|
||||||
this.getSpellAbility().addEffect(new DestroyTargetEffect("Destroy X target artifacts"));
|
this.getSpellAbility().addEffect(new DestroyTargetEffect("Destroy X target artifacts"));
|
||||||
this.getSpellAbility().addTarget(new TargetArtifactPermanent());
|
this.getSpellAbility().addTarget(new TargetArtifactPermanent());
|
||||||
}
|
this.getSpellAbility().setTargetAdjuster(ByForceAdjuster.instance);
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
|
||||||
ability.addTarget(new TargetArtifactPermanent(xValue, xValue));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ByForce(final ByForce card) {
|
public ByForce(final ByForce card) {
|
||||||
|
@ -43,3 +35,14 @@ public final class ByForce extends CardImpl {
|
||||||
return new ByForce(this);
|
return new ByForce(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum ByForceAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
int xValue = ability.getManaCostsToPay().getX();
|
||||||
|
ability.addTarget(new TargetArtifactPermanent(xValue, xValue));
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,14 +1,15 @@
|
||||||
|
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
|
import mage.abilities.costs.CostAdjuster;
|
||||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||||
import mage.abilities.effects.ContinuousEffect;
|
import mage.abilities.effects.ContinuousEffect;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.common.InfoEffect;
|
||||||
import mage.abilities.effects.common.continuous.SetPowerSourceEffect;
|
import mage.abilities.effects.common.continuous.SetPowerSourceEffect;
|
||||||
import mage.abilities.effects.common.continuous.SetToughnessSourceEffect;
|
import mage.abilities.effects.common.continuous.SetToughnessSourceEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
@ -21,8 +22,9 @@ import mage.filter.predicate.mageobject.ChosenSubtypePredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author jeffwadsworth
|
* @author jeffwadsworth
|
||||||
*/
|
*/
|
||||||
public final class CallerOfTheHunt extends CardImpl {
|
public final class CallerOfTheHunt extends CardImpl {
|
||||||
|
@ -34,14 +36,24 @@ public final class CallerOfTheHunt extends CardImpl {
|
||||||
|
|
||||||
// As an additional cost to cast Caller of the Hunt, choose a creature type.
|
// As an additional cost to cast Caller of the Hunt, choose a creature type.
|
||||||
// Caller of the Hunt's power and toughness are each equal to the number of creatures of the chosen type on the battlefield.
|
// Caller of the Hunt's power and toughness are each equal to the number of creatures of the chosen type on the battlefield.
|
||||||
this.addAbility(new SimpleStaticAbility(Zone.ALL, new CallerOfTheHuntAdditionalCostEffect()));
|
this.addAbility(new SimpleStaticAbility(Zone.ALL, new InfoEffect("as an additional cost to cast this spell, choose a creature type. \r"
|
||||||
|
+ "{this}'s power and toughness are each equal to the number of creatures of the chosen type on the battlefield")));
|
||||||
|
this.getSpellAbility().setCostAdjuster(CallerOfTheHuntAdjuster.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CallerOfTheHunt(final CallerOfTheHunt card) {
|
public CallerOfTheHunt(final CallerOfTheHunt card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CallerOfTheHunt copy() {
|
||||||
|
return new CallerOfTheHunt(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum CallerOfTheHuntAdjuster implements CostAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustCosts(Ability ability, Game game) {
|
public void adjustCosts(Ability ability, Game game) {
|
||||||
MageObject mageObject = game.getObject(ability.getSourceId());
|
MageObject mageObject = game.getObject(ability.getSourceId());
|
||||||
|
@ -56,34 +68,6 @@ public final class CallerOfTheHunt extends CardImpl {
|
||||||
game.addEffect(effectToughness, ability);
|
game.addEffect(effectToughness, ability);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public CallerOfTheHunt copy() {
|
|
||||||
return new CallerOfTheHunt(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class CallerOfTheHuntAdditionalCostEffect extends OneShotEffect {
|
|
||||||
|
|
||||||
public CallerOfTheHuntAdditionalCostEffect() {
|
|
||||||
super(Outcome.Benefit);
|
|
||||||
this.staticText = "as an additional cost to cast this spell, choose a creature type. \r"
|
|
||||||
+ "{this}'s power and toughness are each equal to the number of creatures of the chosen type on the battlefield";
|
|
||||||
}
|
|
||||||
|
|
||||||
public CallerOfTheHuntAdditionalCostEffect(final CallerOfTheHuntAdditionalCostEffect effect) {
|
|
||||||
super(effect);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CallerOfTheHuntAdditionalCostEffect copy() {
|
|
||||||
return new CallerOfTheHuntAdditionalCostEffect(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class ChooseCreatureTypeEffect extends OneShotEffect { // code by LevelX2, but that other version is not compatible with this card
|
class ChooseCreatureTypeEffect extends OneShotEffect { // code by LevelX2, but that other version is not compatible with this card
|
||||||
|
@ -116,5 +100,4 @@ class ChooseCreatureTypeEffect extends OneShotEffect { // code by LevelX2, but t
|
||||||
public ChooseCreatureTypeEffect copy() {
|
public ChooseCreatureTypeEffect copy() {
|
||||||
return new ChooseCreatureTypeEffect(this);
|
return new ChooseCreatureTypeEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||||
import mage.abilities.keyword.PersistAbility;
|
import mage.abilities.keyword.PersistAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
@ -10,13 +9,14 @@ import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author jeffwadsworth
|
* @author jeffwadsworth
|
||||||
*/
|
*/
|
||||||
public final class CauldronHaze extends CardImpl {
|
public final class CauldronHaze extends CardImpl {
|
||||||
|
|
||||||
private final String rule = "Choose any number of target creatures. Each of those creatures gains persist until end of turn";
|
private static final String rule = "Choose any number of target creatures. Each of those creatures gains persist until end of turn";
|
||||||
|
|
||||||
public CauldronHaze(UUID ownerId, CardSetInfo setInfo) {
|
public CauldronHaze(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W/B}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W/B}");
|
||||||
|
@ -24,7 +24,6 @@ public final class CauldronHaze extends CardImpl {
|
||||||
// Choose any number of target creatures. Each of those creatures gains persist until end of turn.
|
// Choose any number of target creatures. Each of those creatures gains persist until end of turn.
|
||||||
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(new PersistAbility(), Duration.EndOfTurn, rule));
|
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(new PersistAbility(), Duration.EndOfTurn, rule));
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE));
|
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public CauldronHaze(final CauldronHaze card) {
|
public CauldronHaze(final CauldronHaze card) {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
|
@ -22,14 +21,15 @@ import mage.filter.common.FilterCreatureCard;
|
||||||
import mage.filter.predicate.permanent.AnotherPredicate;
|
import mage.filter.predicate.permanent.AnotherPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetCardInYourGraveyard;
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class ChampionOfStraySouls extends CardImpl {
|
public final class ChampionOfStraySouls extends CardImpl {
|
||||||
|
|
||||||
private final UUID originalId;
|
|
||||||
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("other creatures");
|
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("other creatures");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
@ -37,7 +37,7 @@ public final class ChampionOfStraySouls extends CardImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ChampionOfStraySouls(UUID ownerId, CardSetInfo setInfo) {
|
public ChampionOfStraySouls(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{B}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}{B}");
|
||||||
this.subtype.add(SubType.SKELETON);
|
this.subtype.add(SubType.SKELETON);
|
||||||
this.subtype.add(SubType.WARRIOR);
|
this.subtype.add(SubType.WARRIOR);
|
||||||
|
|
||||||
|
@ -49,7 +49,6 @@ public final class ChampionOfStraySouls extends CardImpl {
|
||||||
* ability, before you pay any costs. You can't target any of the
|
* ability, before you pay any costs. You can't target any of the
|
||||||
* creatures you sacrifice.
|
* creatures you sacrifice.
|
||||||
*/
|
*/
|
||||||
//TODO: Make ability properly copiable
|
|
||||||
// {3}{B}{B}, {T}, Sacrifice X other creatures: Return X target creatures from your graveyard to the battlefield.
|
// {3}{B}{B}, {T}, Sacrifice X other creatures: Return X target creatures from your graveyard to the battlefield.
|
||||||
Effect effect = new ReturnFromGraveyardToBattlefieldTargetEffect();
|
Effect effect = new ReturnFromGraveyardToBattlefieldTargetEffect();
|
||||||
effect.setText("Return X target creatures from your graveyard to the battlefield");
|
effect.setText("Return X target creatures from your graveyard to the battlefield");
|
||||||
|
@ -57,32 +56,17 @@ public final class ChampionOfStraySouls extends CardImpl {
|
||||||
ability.addCost(new TapSourceCost());
|
ability.addCost(new TapSourceCost());
|
||||||
ability.addCost(new SacrificeXTargetCost(filter));
|
ability.addCost(new SacrificeXTargetCost(filter));
|
||||||
ability.addTarget(new TargetCardInYourGraveyard(0, Integer.MAX_VALUE, new FilterCreatureCard("creature cards from your graveyard")));
|
ability.addTarget(new TargetCardInYourGraveyard(0, Integer.MAX_VALUE, new FilterCreatureCard("creature cards from your graveyard")));
|
||||||
originalId = ability.getOriginalId();
|
ability.setTargetAdjuster(ChampionOfStraySoulsAdjuster.instance);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
// {5}{B}{B}: Put Champion of Stray Souls on top of your library from your graveyard.
|
// {5}{B}{B}: Put Champion of Stray Souls on top of your library from your graveyard.
|
||||||
this.addAbility(new SimpleActivatedAbility(Zone.GRAVEYARD,
|
this.addAbility(new SimpleActivatedAbility(Zone.GRAVEYARD,
|
||||||
new PutOnLibrarySourceEffect(true, "Put {this} on top of your library from your graveyard"),
|
new PutOnLibrarySourceEffect(true, "Put {this} on top of your library from your graveyard"),
|
||||||
new ManaCostsImpl("{5}{B}{B}")));
|
new ManaCostsImpl("{5}{B}{B}")));
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability.getOriginalId().equals(originalId)) {
|
|
||||||
for (Effect effect : ability.getEffects()) {
|
|
||||||
if (effect instanceof ReturnFromGraveyardToBattlefieldTargetEffect) {
|
|
||||||
int xValue = new GetXValue().calculate(game, ability, null);
|
|
||||||
ability.getTargets().clear();
|
|
||||||
ability.addTarget(new TargetCardInYourGraveyard(xValue, xValue, new FilterCreatureCard("creature cards from your graveyard")));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ChampionOfStraySouls(final ChampionOfStraySouls card) {
|
public ChampionOfStraySouls(final ChampionOfStraySouls card) {
|
||||||
super(card);
|
super(card);
|
||||||
this.originalId = card.originalId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -90,3 +74,18 @@ public final class ChampionOfStraySouls extends CardImpl {
|
||||||
return new ChampionOfStraySouls(this);
|
return new ChampionOfStraySouls(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum ChampionOfStraySoulsAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
for (Effect effect : ability.getEffects()) {
|
||||||
|
if (effect instanceof ReturnFromGraveyardToBattlefieldTargetEffect) {
|
||||||
|
int xValue = new GetXValue().calculate(game, ability, null);
|
||||||
|
ability.getTargets().clear();
|
||||||
|
ability.addTarget(new TargetCardInYourGraveyard(xValue, xValue, new FilterCreatureCard("creature cards from your graveyard")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -15,28 +15,33 @@ import mage.constants.CardType;
|
||||||
import mage.constants.TargetController;
|
import mage.constants.TargetController;
|
||||||
import mage.counters.CounterType;
|
import mage.counters.CounterType;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
import mage.filter.predicate.Predicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
import mage.target.common.TargetControlledCreaturePermanent;
|
import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class CitadelSiege extends CardImpl {
|
public final class CitadelSiege extends CardImpl {
|
||||||
|
|
||||||
private final static String ruleTrigger1 = "&bull Khans — At the beginning of combat on your turn, put two +1/+1 counters on target creature you control.";
|
private final static String ruleTrigger1 = "&bull Khans — At the beginning of combat on your turn, put two +1/+1 counters on target creature you control.";
|
||||||
private final static String ruleTrigger2 = "&bull Dragons — At the beginning of combat on each opponent's turn, tap target creature that player controls.";
|
private final static String ruleTrigger2 = "&bull Dragons — At the beginning of combat on each opponent's turn, tap target creature that player controls.";
|
||||||
|
private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("creature controlled by the active player");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(CitadelSiegePredicate.instance);
|
||||||
|
}
|
||||||
|
|
||||||
public CitadelSiege(UUID ownerId, CardSetInfo setInfo) {
|
public CitadelSiege(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{W}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}");
|
||||||
|
|
||||||
// As Citadel Siege enters the battlefield, choose Khans or Dragons.
|
// As Citadel Siege enters the battlefield, choose Khans or Dragons.
|
||||||
this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?","Khans", "Dragons"),null,
|
this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?", "Khans", "Dragons"), null,
|
||||||
"As {this} enters the battlefield, choose Khans or Dragons.",""));
|
"As {this} enters the battlefield, choose Khans or Dragons.", ""));
|
||||||
|
|
||||||
// * Khans - At the beginning of combat on your turn, put two +1/+1 counters on target creature you control.
|
// * Khans - At the beginning of combat on your turn, put two +1/+1 counters on target creature you control.
|
||||||
Ability ability = new ConditionalTriggeredAbility(
|
Ability ability = new ConditionalTriggeredAbility(
|
||||||
|
@ -51,21 +56,10 @@ public final class CitadelSiege extends CardImpl {
|
||||||
new BeginningOfCombatTriggeredAbility(new TapTargetEffect(), TargetController.OPPONENT, false),
|
new BeginningOfCombatTriggeredAbility(new TapTargetEffect(), TargetController.OPPONENT, false),
|
||||||
new ModeChoiceSourceCondition("Dragons"),
|
new ModeChoiceSourceCondition("Dragons"),
|
||||||
ruleTrigger2);
|
ruleTrigger2);
|
||||||
ability.addTarget(new TargetCreaturePermanent());
|
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (this.getAbilities().contains(ability) && ability.getRule().startsWith("&bull Dragons")) {
|
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature that player controls");
|
|
||||||
filter.add(new ControllerIdPredicate(game.getCombat().getAttackingPlayerId()));
|
|
||||||
ability.getTargets().clear();
|
|
||||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public CitadelSiege(final CitadelSiege card) {
|
public CitadelSiege(final CitadelSiege card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
@ -75,3 +69,12 @@ public final class CitadelSiege extends CardImpl {
|
||||||
return new CitadelSiege(this);
|
return new CitadelSiege(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum CitadelSiegePredicate implements Predicate<Permanent> {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Permanent input, Game game) {
|
||||||
|
return input.getControllerId().equals(game.getActivePlayerId());
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,9 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.dynamicvalue.common.MultikickerCount;
|
import mage.abilities.dynamicvalue.common.MultikickerCount;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.keyword.MultikickerAbility;
|
import mage.abilities.keyword.MultikickerAbility;
|
||||||
|
@ -15,6 +13,7 @@ import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.common.TargetAnyTarget;
|
import mage.target.common.TargetAnyTarget;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -31,27 +30,30 @@ public final class CometStorm extends CardImpl {
|
||||||
// Choose any target, then choose another any target for each time Comet Storm was kicked. Comet Storm deals X damage to each of them.
|
// Choose any target, then choose another any target for each time Comet Storm was kicked. Comet Storm deals X damage to each of them.
|
||||||
this.getSpellAbility().addEffect(new CometStormEffect());
|
this.getSpellAbility().addEffect(new CometStormEffect());
|
||||||
this.getSpellAbility().addTarget(new TargetAnyTarget(1));
|
this.getSpellAbility().addTarget(new TargetAnyTarget(1));
|
||||||
|
this.getSpellAbility().setTargetAdjuster(CometStormAdjuster.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CometStorm(final CometStorm card) {
|
public CometStorm(final CometStorm card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
int numbTargets = new MultikickerCount().calculate(game, ability, null) + 1;
|
|
||||||
ability.addTarget(new TargetAnyTarget(numbTargets));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CometStorm copy() {
|
public CometStorm copy() {
|
||||||
return new CometStorm(this);
|
return new CometStorm(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum CometStormAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
int numbTargets = new MultikickerCount().calculate(game, ability, null) + 1;
|
||||||
|
ability.addTarget(new TargetAnyTarget(numbTargets));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class CometStormEffect extends OneShotEffect {
|
class CometStormEffect extends OneShotEffect {
|
||||||
|
|
||||||
public CometStormEffect() {
|
public CometStormEffect() {
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
|
@ -22,9 +18,14 @@ import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author anonymous
|
* @author anonymous
|
||||||
*/
|
*/
|
||||||
public final class ConfusionInTheRanks extends CardImpl {
|
public final class ConfusionInTheRanks extends CardImpl {
|
||||||
|
@ -38,7 +39,6 @@ public final class ConfusionInTheRanks extends CardImpl {
|
||||||
new CardTypePredicate(CardType.ENCHANTMENT)
|
new CardTypePredicate(CardType.ENCHANTMENT)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
private final UUID originalId;
|
|
||||||
|
|
||||||
public ConfusionInTheRanks(UUID ownerId, CardSetInfo setInfo) {
|
public ConfusionInTheRanks(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}{R}");
|
||||||
|
@ -49,54 +49,18 @@ public final class ConfusionInTheRanks extends CardImpl {
|
||||||
new ExchangeControlTargetEffect(
|
new ExchangeControlTargetEffect(
|
||||||
Duration.EndOfGame,
|
Duration.EndOfGame,
|
||||||
"its controller chooses target permanent "
|
"its controller chooses target permanent "
|
||||||
+ "another player controls that shares a card type with it. "
|
+ "another player controls that shares a card type with it. "
|
||||||
+ "Exchange control of those permanents"
|
+ "Exchange control of those permanents"
|
||||||
),
|
),
|
||||||
filter, false, SetTargetPointer.PERMANENT, null
|
filter, false, SetTargetPointer.PERMANENT, null
|
||||||
);
|
);
|
||||||
ability.addTarget(new TargetPermanent());
|
ability.addTarget(new TargetPermanent());
|
||||||
originalId = ability.getOriginalId();
|
ability.setTargetAdjuster(ConfusionInTheRanksAdjuster.instance);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConfusionInTheRanks(final ConfusionInTheRanks card) {
|
public ConfusionInTheRanks(final ConfusionInTheRanks card) {
|
||||||
super(card);
|
super(card);
|
||||||
this.originalId = card.originalId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability.getOriginalId().equals(originalId)) {
|
|
||||||
UUID enteringPermanentId = null;
|
|
||||||
for (Effect effect : ability.getEffects()) {
|
|
||||||
enteringPermanentId = effect.getTargetPointer().getFirst(game, ability);
|
|
||||||
}
|
|
||||||
if (enteringPermanentId == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Permanent enteringPermanent = game.getPermanent(enteringPermanentId);
|
|
||||||
if (enteringPermanent == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ability.getTargets().clear();
|
|
||||||
FilterPermanent filterTarget = new FilterPermanent();
|
|
||||||
String message = "";
|
|
||||||
filterTarget.add(Predicates.not(new ControllerIdPredicate(enteringPermanent.getControllerId())));
|
|
||||||
Set<CardTypePredicate> cardTypesPredicates = new HashSet<>(1);
|
|
||||||
for (CardType cardTypeEntering : enteringPermanent.getCardType()) {
|
|
||||||
cardTypesPredicates.add(new CardTypePredicate(cardTypeEntering));
|
|
||||||
if (!message.isEmpty()) {
|
|
||||||
message += "or ";
|
|
||||||
}
|
|
||||||
message += cardTypeEntering.toString().toLowerCase(Locale.ENGLISH) + ' ';
|
|
||||||
}
|
|
||||||
filterTarget.add(Predicates.or(cardTypesPredicates));
|
|
||||||
message += "you don't control";
|
|
||||||
filterTarget.setMessage(message);
|
|
||||||
TargetPermanent target = new TargetPermanent(filterTarget);
|
|
||||||
target.setTargetController(enteringPermanent.getControllerId());
|
|
||||||
ability.getTargets().add(target);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -104,3 +68,40 @@ public final class ConfusionInTheRanks extends CardImpl {
|
||||||
return new ConfusionInTheRanks(this);
|
return new ConfusionInTheRanks(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum ConfusionInTheRanksAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
UUID enteringPermanentId = null;
|
||||||
|
for (Effect effect : ability.getEffects()) {
|
||||||
|
enteringPermanentId = effect.getTargetPointer().getFirst(game, ability);
|
||||||
|
}
|
||||||
|
if (enteringPermanentId == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Permanent enteringPermanent = game.getPermanent(enteringPermanentId);
|
||||||
|
if (enteringPermanent == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ability.getTargets().clear();
|
||||||
|
FilterPermanent filterTarget = new FilterPermanent();
|
||||||
|
String message = "";
|
||||||
|
filterTarget.add(Predicates.not(new ControllerIdPredicate(enteringPermanent.getControllerId())));
|
||||||
|
Set<CardTypePredicate> cardTypesPredicates = new HashSet<>(1);
|
||||||
|
for (CardType cardTypeEntering : enteringPermanent.getCardType()) {
|
||||||
|
cardTypesPredicates.add(new CardTypePredicate(cardTypeEntering));
|
||||||
|
if (!message.isEmpty()) {
|
||||||
|
message += "or ";
|
||||||
|
}
|
||||||
|
message += cardTypeEntering.toString().toLowerCase(Locale.ENGLISH) + ' ';
|
||||||
|
}
|
||||||
|
filterTarget.add(Predicates.or(cardTypesPredicates));
|
||||||
|
message += "you don't control";
|
||||||
|
filterTarget.setMessage(message);
|
||||||
|
TargetPermanent target = new TargetPermanent(filterTarget);
|
||||||
|
target.setTargetController(enteringPermanent.getControllerId());
|
||||||
|
ability.getTargets().add(target);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.AttacksTriggeredAbility;
|
import mage.abilities.common.AttacksTriggeredAbility;
|
||||||
|
@ -11,18 +10,23 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
|
import mage.filter.FilterPermanent;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
import mage.filter.predicate.permanent.DefendingPlayerControlsPredicate;
|
||||||
import mage.game.Game;
|
import mage.target.TargetPermanent;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author TheElk801
|
* @author TheElk801
|
||||||
*/
|
*/
|
||||||
public final class CovetedPeacock extends CardImpl {
|
public final class CovetedPeacock extends CardImpl {
|
||||||
|
|
||||||
private final UUID originalId;
|
public static final FilterPermanent filter = new FilterCreaturePermanent("creature defending player controls");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new DefendingPlayerControlsPredicate());
|
||||||
|
}
|
||||||
|
|
||||||
public CovetedPeacock(UUID ownerId, CardSetInfo setInfo) {
|
public CovetedPeacock(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}{U}");
|
||||||
|
@ -36,26 +40,12 @@ public final class CovetedPeacock extends CardImpl {
|
||||||
|
|
||||||
// Whenever Coveted Peacock attacks, you may goad target creature defending player controls.
|
// Whenever Coveted Peacock attacks, you may goad target creature defending player controls.
|
||||||
Ability ability = new AttacksTriggeredAbility(new GoadTargetEffect(), true, "Whenever {this} attacks, you may goad target creature defending player controls.");
|
Ability ability = new AttacksTriggeredAbility(new GoadTargetEffect(), true, "Whenever {this} attacks, you may goad target creature defending player controls.");
|
||||||
ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature defending player controls")));
|
ability.addTarget(new TargetPermanent(filter));
|
||||||
originalId = ability.getOriginalId();
|
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CovetedPeacock(final CovetedPeacock card) {
|
public CovetedPeacock(final CovetedPeacock card) {
|
||||||
super(card);
|
super(card);
|
||||||
this.originalId = card.originalId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability.getOriginalId().equals(originalId)) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
|
|
||||||
UUID defenderId = game.getCombat().getDefenderId(ability.getSourceId());
|
|
||||||
filter.add(new ControllerIdPredicate(defenderId));
|
|
||||||
TargetCreaturePermanent target = new TargetCreaturePermanent(filter);
|
|
||||||
ability.addTarget(target);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
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.ExileSourceCost;
|
import mage.abilities.costs.common.ExileSourceCost;
|
||||||
|
@ -15,29 +14,28 @@ import mage.constants.CardType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.target.common.TargetCardInGraveyard;
|
import mage.target.common.TargetCardInGraveyard;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author jeffwadsworth
|
* @author jeffwadsworth
|
||||||
*/
|
*/
|
||||||
public final class CrookOfCondemnation extends CardImpl {
|
public final class CrookOfCondemnation extends CardImpl {
|
||||||
|
|
||||||
private UUID exileId = UUID.randomUUID();
|
|
||||||
|
|
||||||
public CrookOfCondemnation(UUID ownerId, CardSetInfo setInfo) {
|
public CrookOfCondemnation(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
|
||||||
|
|
||||||
|
|
||||||
// {1}, {t}: Exile target card from a graveyard.
|
// {1}, {t}: Exile target card from a graveyard.
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(), new ManaCostsImpl("{1}"));
|
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(), new ManaCostsImpl("{1}"));
|
||||||
ability.addCost(new TapSourceCost());
|
ability.addCost(new TapSourceCost());
|
||||||
ability.addTarget(new TargetCardInGraveyard());
|
ability.addTarget(new TargetCardInGraveyard());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
// {1}, Exile Crook of Condemnation: Exile all cards from all graveyards.
|
// {1}, Exile Crook of Condemnation: Exile all cards from all graveyards.
|
||||||
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileGraveyardAllPlayersEffect(), new ManaCostsImpl("{1}"));
|
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileGraveyardAllPlayersEffect(), new ManaCostsImpl("{1}"));
|
||||||
ability2.addCost(new ExileSourceCost());
|
ability2.addCost(new ExileSourceCost());
|
||||||
this.addAbility(ability2);
|
this.addAbility(ability2);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public CrookOfCondemnation(final CrookOfCondemnation card) {
|
public CrookOfCondemnation(final CrookOfCondemnation card) {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
|
@ -11,68 +10,42 @@ import mage.abilities.effects.common.DamageTargetEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.common.TargetAnyTarget;
|
import mage.target.common.TargetAnyTarget;
|
||||||
import mage.target.common.TargetOpponent;
|
import mage.target.common.TargetOpponent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LoneFox
|
* @author LoneFox
|
||||||
|
|
||||||
*/
|
*/
|
||||||
public final class CuombajjWitches extends CardImpl {
|
public final class CuombajjWitches extends CardImpl {
|
||||||
|
|
||||||
private final UUID originalId;
|
|
||||||
|
|
||||||
public CuombajjWitches(UUID ownerId, CardSetInfo setInfo) {
|
public CuombajjWitches(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}{B}");
|
||||||
this.subtype.add(SubType.HUMAN);
|
this.subtype.add(SubType.HUMAN);
|
||||||
this.subtype.add(SubType.WIZARD);
|
this.subtype.add(SubType.WIZARD);
|
||||||
this.power = new MageInt(1);
|
this.power = new MageInt(1);
|
||||||
this.toughness = new MageInt(3);
|
this.toughness = new MageInt(3);
|
||||||
|
|
||||||
//TODO: Make ability properly copiable
|
|
||||||
// {T}: Cuombajj Witches deals 1 damage to any target and 1 damage to any target of an opponent's choice.
|
// {T}: Cuombajj Witches deals 1 damage to any target and 1 damage to any target of an opponent's choice.
|
||||||
Effect effect = new DamageTargetEffect(1);
|
Effect effect = new DamageTargetEffect(1);
|
||||||
effect.setText("{this} deals 1 damage to any target and 1 damage to any target of an opponent's choice");
|
effect.setText("{this} deals 1 damage to any target and 1 damage to any target of an opponent's choice");
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost());
|
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost());
|
||||||
ability.addTarget(new TargetAnyTarget());
|
ability.addTarget(new TargetAnyTarget());
|
||||||
ability.addTarget(new TargetAnyTarget());
|
ability.addTarget(new TargetAnyTarget());
|
||||||
|
ability.setTargetAdjuster(CuombajjWitchesAdjuster.instance);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
originalId = ability.getOriginalId();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if(ability.getOriginalId().equals(originalId)) {
|
|
||||||
Player controller = game.getPlayer(ability.getControllerId());
|
|
||||||
if(controller != null) {
|
|
||||||
UUID opponentId = null;
|
|
||||||
if(game.getOpponents(controller.getId()).size() > 1) {
|
|
||||||
Target target = new TargetOpponent(true);
|
|
||||||
if(controller.chooseTarget(Outcome.Neutral, target, ability, game)) {
|
|
||||||
opponentId = target.getFirstTarget();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
opponentId = game.getOpponents(controller.getId()).iterator().next();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(opponentId != null) {
|
|
||||||
ability.getTargets().get(1).setTargetController(opponentId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public CuombajjWitches(final CuombajjWitches card) {
|
public CuombajjWitches(final CuombajjWitches card) {
|
||||||
super(card);
|
super(card);
|
||||||
this.originalId = card.originalId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -80,3 +53,26 @@ public final class CuombajjWitches extends CardImpl {
|
||||||
return new CuombajjWitches(this);
|
return new CuombajjWitches(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum CuombajjWitchesAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
Player controller = game.getPlayer(ability.getControllerId());
|
||||||
|
if (controller != null) {
|
||||||
|
UUID opponentId = null;
|
||||||
|
if (game.getOpponents(controller.getId()).size() > 1) {
|
||||||
|
Target target = new TargetOpponent(true);
|
||||||
|
if (controller.chooseTarget(Outcome.Neutral, target, ability, game)) {
|
||||||
|
opponentId = target.getFirstTarget();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
opponentId = game.getOpponents(controller.getId()).iterator().next();
|
||||||
|
}
|
||||||
|
if (opponentId != null) {
|
||||||
|
ability.getTargets().get(1).setTargetController(opponentId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,15 +1,10 @@
|
||||||
|
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.AbilityType;
|
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
@ -18,9 +13,13 @@ import mage.game.permanent.Permanent;
|
||||||
import mage.game.permanent.token.CurseOfTheSwineBoarToken;
|
import mage.game.permanent.token.CurseOfTheSwineBoarToken;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class CurseOfTheSwine extends CardImpl {
|
public final class CurseOfTheSwine extends CardImpl {
|
||||||
|
@ -31,15 +30,7 @@ public final class CurseOfTheSwine extends CardImpl {
|
||||||
// Exile X target creatures. For each creature exiled this way, its controller creates a 2/2 green Boar creature token.
|
// Exile X target creatures. For each creature exiled this way, its controller creates a 2/2 green Boar creature token.
|
||||||
this.getSpellAbility().addEffect(new CurseOfTheSwineEffect());
|
this.getSpellAbility().addEffect(new CurseOfTheSwineEffect());
|
||||||
// Correct number of targets will be set in adjustTargets
|
// Correct number of targets will be set in adjustTargets
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
this.getSpellAbility().setTargetAdjuster(CurseOfTheSwineAdjuster.instance);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility && ability.getAbilityType() == AbilityType.SPELL) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
ability.addTarget(new TargetCreaturePermanent(ability.getManaCostsToPay().getX()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public CurseOfTheSwine(final CurseOfTheSwine card) {
|
public CurseOfTheSwine(final CurseOfTheSwine card) {
|
||||||
|
@ -52,6 +43,16 @@ public final class CurseOfTheSwine extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum CurseOfTheSwineAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
ability.addTarget(new TargetCreaturePermanent(ability.getManaCostsToPay().getX()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class CurseOfTheSwineEffect extends OneShotEffect {
|
class CurseOfTheSwineEffect extends OneShotEffect {
|
||||||
|
|
||||||
public CurseOfTheSwineEffect() {
|
public CurseOfTheSwineEffect() {
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.AttacksTriggeredAbility;
|
import mage.abilities.common.AttacksTriggeredAbility;
|
||||||
|
@ -12,7 +8,10 @@ import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffec
|
||||||
import mage.abilities.keyword.MeleeAbility;
|
import mage.abilities.keyword.MeleeAbility;
|
||||||
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.ComparisonType;
|
||||||
|
import mage.constants.SubType;
|
||||||
|
import mage.constants.WatcherScope;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.FilterCard;
|
||||||
import mage.filter.common.FilterCreatureCard;
|
import mage.filter.common.FilterCreatureCard;
|
||||||
import mage.filter.predicate.Predicates;
|
import mage.filter.predicate.Predicates;
|
||||||
|
@ -23,16 +22,21 @@ import mage.game.events.GameEvent;
|
||||||
import mage.game.events.GameEvent.EventType;
|
import mage.game.events.GameEvent.EventType;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.target.common.TargetCardInYourGraveyard;
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
import mage.watchers.Watcher;
|
import mage.watchers.Watcher;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author L_J
|
* @author L_J
|
||||||
*/
|
*/
|
||||||
public final class CustodiSoulcaller extends CardImpl {
|
public final class CustodiSoulcaller extends CardImpl {
|
||||||
|
|
||||||
public CustodiSoulcaller(UUID ownerId, CardSetInfo setInfo) {
|
public CustodiSoulcaller(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}{W}");
|
||||||
this.subtype.add(SubType.HUMAN);
|
this.subtype.add(SubType.HUMAN);
|
||||||
this.subtype.add(SubType.CLERIC);
|
this.subtype.add(SubType.CLERIC);
|
||||||
this.power = new MageInt(1);
|
this.power = new MageInt(1);
|
||||||
|
@ -45,25 +49,10 @@ public final class CustodiSoulcaller extends CardImpl {
|
||||||
Ability ability = new AttacksTriggeredAbility(new ReturnFromGraveyardToBattlefieldTargetEffect(), false);
|
Ability ability = new AttacksTriggeredAbility(new ReturnFromGraveyardToBattlefieldTargetEffect(), false);
|
||||||
ability.addWatcher(new CustodiSoulcallerWatcher());
|
ability.addWatcher(new CustodiSoulcallerWatcher());
|
||||||
ability.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card with converted mana cost X or less from your graveyard, where X is the number of players you attacked with a creature this combat")));
|
ability.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card with converted mana cost X or less from your graveyard, where X is the number of players you attacked with a creature this combat")));
|
||||||
|
ability.setTargetAdjuster(CustodiSoulcallerAdjuster.instance);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability.getClass().equals(AttacksTriggeredAbility.class)) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
CustodiSoulcallerWatcher watcher = game.getState().getWatcher(CustodiSoulcallerWatcher.class);
|
|
||||||
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(ability.getSourceId());
|
|
||||||
if (watcher != null && watcher.playersAttacked != null) {
|
|
||||||
int xValue = watcher.getNumberOfAttackedPlayers(sourcePermanent.getControllerId());
|
|
||||||
FilterCard filter = new FilterCard("creature card with converted mana cost " + xValue + " or less");
|
|
||||||
filter.add(new CardTypePredicate(CardType.CREATURE));
|
|
||||||
filter.add(Predicates.or(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue), new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, xValue)));
|
|
||||||
ability.getTargets().add(new TargetCardInYourGraveyard(filter));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public CustodiSoulcaller(final CustodiSoulcaller card) {
|
public CustodiSoulcaller(final CustodiSoulcaller card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
@ -74,9 +63,27 @@ public final class CustodiSoulcaller extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum CustodiSoulcallerAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
CustodiSoulcallerWatcher watcher = (CustodiSoulcallerWatcher) game.getState().getWatchers().get(CustodiSoulcallerWatcher.class.getSimpleName());
|
||||||
|
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(ability.getSourceId());
|
||||||
|
if (watcher != null) {
|
||||||
|
int xValue = watcher.getNumberOfAttackedPlayers(sourcePermanent.getControllerId());
|
||||||
|
FilterCard filter = new FilterCard("creature card with converted mana cost " + xValue + " or less");
|
||||||
|
filter.add(new CardTypePredicate(CardType.CREATURE));
|
||||||
|
filter.add(Predicates.or(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue), new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, xValue)));
|
||||||
|
ability.getTargets().add(new TargetCardInYourGraveyard(filter));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class CustodiSoulcallerWatcher extends Watcher {
|
class CustodiSoulcallerWatcher extends Watcher {
|
||||||
|
|
||||||
protected final HashMap<UUID, Set<UUID>> playersAttacked = new HashMap<>(0);
|
private final HashMap<UUID, Set<UUID>> playersAttacked = new HashMap<>(0);
|
||||||
|
|
||||||
CustodiSoulcallerWatcher() {
|
CustodiSoulcallerWatcher() {
|
||||||
super("CustodiSoulcallerWatcher", WatcherScope.GAME);
|
super("CustodiSoulcallerWatcher", WatcherScope.GAME);
|
||||||
|
@ -91,8 +98,7 @@ class CustodiSoulcallerWatcher extends Watcher {
|
||||||
public void watch(GameEvent event, Game game) {
|
public void watch(GameEvent event, Game game) {
|
||||||
if (event.getType() == EventType.BEGIN_COMBAT_STEP_PRE) {
|
if (event.getType() == EventType.BEGIN_COMBAT_STEP_PRE) {
|
||||||
this.playersAttacked.clear();
|
this.playersAttacked.clear();
|
||||||
}
|
} else if (event.getType() == EventType.ATTACKER_DECLARED) {
|
||||||
else if (event.getType() == EventType.ATTACKER_DECLARED) {
|
|
||||||
Set<UUID> attackedPlayers = this.playersAttacked.getOrDefault(event.getPlayerId(), new HashSet<>(1));
|
Set<UUID> attackedPlayers = this.playersAttacked.getOrDefault(event.getPlayerId(), new HashSet<>(1));
|
||||||
attackedPlayers.add(event.getTargetId());
|
attackedPlayers.add(event.getTargetId());
|
||||||
this.playersAttacked.put(event.getPlayerId(), attackedPlayers);
|
this.playersAttacked.put(event.getPlayerId(), attackedPlayers);
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
package mage.cards.d;
|
package mage.cards.d;
|
||||||
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
|
import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
@ -13,35 +12,24 @@ import mage.filter.common.FilterCreatureCard;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.common.TargetCardInYourGraveyard;
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class DeathDenied extends CardImpl {
|
public final class DeathDenied extends CardImpl {
|
||||||
|
|
||||||
public DeathDenied(UUID ownerId, CardSetInfo setInfo) {
|
public DeathDenied(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);
|
||||||
|
|
||||||
// Return X target creature cards from your graveyard to your hand.
|
// Return X target creature cards from your graveyard to your hand.
|
||||||
Effect effect = new ReturnFromGraveyardToHandTargetEffect();
|
Effect effect = new ReturnFromGraveyardToHandTargetEffect();
|
||||||
effect.setText("Return X target creature cards from your graveyard to your hand");
|
effect.setText("Return X target creature cards from your graveyard to your hand");
|
||||||
this.getSpellAbility().addEffect(effect);
|
this.getSpellAbility().addEffect(effect);
|
||||||
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(1, new FilterCreatureCard()));
|
this.getSpellAbility().setTargetAdjuster(DeathDeniedAdjuster.instance);
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
|
||||||
Target target = new TargetCardInYourGraveyard(xValue, new FilterCreatureCard((xValue != 1 ? " creature cards" : "creature card") + " from your graveyard"));
|
|
||||||
ability.addTarget(target);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public DeathDenied(final DeathDenied card) {
|
public DeathDenied(final DeathDenied card) {
|
||||||
|
@ -53,3 +41,15 @@ public final class DeathDenied extends CardImpl {
|
||||||
return new DeathDenied(this);
|
return new DeathDenied(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum DeathDeniedAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
int xValue = ability.getManaCostsToPay().getX();
|
||||||
|
Target target = new TargetCardInYourGraveyard(xValue, new FilterCreatureCard(new StringBuilder(xValue).append(xValue != 1 ? " creature cards" : "creature card").append(" from your graveyard").toString()));
|
||||||
|
ability.addTarget(target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.d;
|
package mage.cards.d;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
@ -13,17 +11,16 @@ import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
import mage.target.targetpointer.FirstTargetPointer;
|
import mage.target.targetpointer.FirstTargetPointer;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LoneFox
|
* @author LoneFox
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public final class DeathMatch extends CardImpl {
|
public final class DeathMatch extends CardImpl {
|
||||||
|
|
||||||
private final UUID originalId;
|
|
||||||
|
|
||||||
public DeathMatch(UUID ownerId, CardSetInfo setInfo) {
|
public DeathMatch(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}");
|
||||||
|
|
||||||
|
@ -32,24 +29,12 @@ public final class DeathMatch extends CardImpl {
|
||||||
Ability ability = new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new DeathMatchEffect(),
|
Ability ability = new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new DeathMatchEffect(),
|
||||||
StaticFilters.FILTER_PERMANENT_CREATURE, false, SetTargetPointer.PLAYER, "");
|
StaticFilters.FILTER_PERMANENT_CREATURE, false, SetTargetPointer.PLAYER, "");
|
||||||
ability.addTarget(new TargetCreaturePermanent());
|
ability.addTarget(new TargetCreaturePermanent());
|
||||||
|
ability.setTargetAdjuster(DeathMatchAdjuster.instance);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
originalId = ability.getOriginalId();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability.getOriginalId().equals(originalId)) {
|
|
||||||
UUID controllerId = ability.getEffects().get(0).getTargetPointer().getFirst(game, ability);
|
|
||||||
if (controllerId != null) {
|
|
||||||
ability.getTargets().get(0).setTargetController(controllerId);
|
|
||||||
ability.getEffects().get(0).setTargetPointer(new FirstTargetPointer());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public DeathMatch(final DeathMatch card) {
|
public DeathMatch(final DeathMatch card) {
|
||||||
super(card);
|
super(card);
|
||||||
this.originalId = card.originalId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -58,6 +43,19 @@ public final class DeathMatch extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum DeathMatchAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
UUID controllerId = ability.getEffects().get(0).getTargetPointer().getFirst(game, ability);
|
||||||
|
if (controllerId != null) {
|
||||||
|
ability.getTargets().get(0).setTargetController(controllerId);
|
||||||
|
ability.getEffects().get(0).setTargetPointer(new FirstTargetPointer());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class DeathMatchEffect extends OneShotEffect {
|
class DeathMatchEffect extends OneShotEffect {
|
||||||
|
|
||||||
public DeathMatchEffect() {
|
public DeathMatchEffect() {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.d;
|
package mage.cards.d;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.AttacksTriggeredAbility;
|
import mage.abilities.common.AttacksTriggeredAbility;
|
||||||
|
@ -13,24 +12,29 @@ import mage.abilities.effects.common.counter.RemoveCounterTargetEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.counters.CounterType;
|
import mage.counters.CounterType;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
import mage.filter.predicate.permanent.DefendingPlayerControlsPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.target.common.TargetControlledCreaturePermanent;
|
import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author spjspj
|
* @author spjspj
|
||||||
*/
|
*/
|
||||||
public final class DecimatorBeetle extends CardImpl {
|
public final class DecimatorBeetle extends CardImpl {
|
||||||
|
|
||||||
private final UUID originalId;
|
public static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new DefendingPlayerControlsPredicate());
|
||||||
|
}
|
||||||
|
|
||||||
public DecimatorBeetle(UUID ownerId, CardSetInfo setInfo) {
|
public DecimatorBeetle(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{G}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{G}");
|
||||||
|
@ -46,29 +50,14 @@ public final class DecimatorBeetle extends CardImpl {
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
// Whenever Decimator Beetle attacks, remove a -1/-1 counter from target creature you control and put a -1/-1 counter on up to one target creature defending player controls.
|
// Whenever Decimator Beetle attacks, remove a -1/-1 counter from target creature you control and put a -1/-1 counter on up to one target creature defending player controls.
|
||||||
Ability ability2 = new AttacksTriggeredAbility(new DecimatorBeetleEffect(), false);
|
ability = new AttacksTriggeredAbility(new DecimatorBeetleEffect(), false);
|
||||||
ability2.addTarget(new TargetControlledCreaturePermanent());
|
ability.addTarget(new TargetControlledCreaturePermanent());
|
||||||
ability2.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature defending player controls")));
|
ability.addTarget(new TargetCreaturePermanent(0, 1, filter, false));
|
||||||
this.addAbility(ability2);
|
this.addAbility(ability);
|
||||||
this.originalId = ability2.getOriginalId();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public DecimatorBeetle(final DecimatorBeetle card) {
|
public DecimatorBeetle(final DecimatorBeetle card) {
|
||||||
super(card);
|
super(card);
|
||||||
this.originalId = card.originalId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability.getOriginalId().equals(originalId)) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
ability.addTarget(new TargetControlledCreaturePermanent());
|
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
|
|
||||||
UUID defenderId = game.getCombat().getDefenderId(ability.getSourceId());
|
|
||||||
filter.add(new ControllerIdPredicate(defenderId));
|
|
||||||
TargetCreaturePermanent target = new TargetCreaturePermanent(0, 1, filter, false);
|
|
||||||
ability.addTarget(target);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.d;
|
package mage.cards.d;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
|
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.common.DamageTargetControllerEffect;
|
import mage.abilities.effects.common.DamageTargetControllerEffect;
|
||||||
|
@ -16,15 +14,17 @@ import mage.filter.common.FilterArtifactPermanent;
|
||||||
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
|
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetArtifactPermanent;
|
import mage.target.common.TargetArtifactPermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LoneFox
|
* @author LoneFox
|
||||||
*/
|
*/
|
||||||
public final class Detonate extends CardImpl {
|
public final class Detonate extends CardImpl {
|
||||||
|
|
||||||
public Detonate(UUID ownerId, CardSetInfo setInfo) {
|
public Detonate(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{R}");
|
||||||
|
|
||||||
// Destroy target artifact with converted mana cost X. It can't be regenerated. Detonate deals X damage to that artifact's controller.
|
// Destroy target artifact with converted mana cost X. It can't be regenerated. Detonate deals X damage to that artifact's controller.
|
||||||
this.getSpellAbility().addEffect(new DestroyTargetEffect(true));
|
this.getSpellAbility().addEffect(new DestroyTargetEffect(true));
|
||||||
|
@ -32,17 +32,7 @@ public final class Detonate extends CardImpl {
|
||||||
Effect effect = new DamageTargetControllerEffect(new ManacostVariableValue());
|
Effect effect = new DamageTargetControllerEffect(new ManacostVariableValue());
|
||||||
effect.setText("{this} deals X damage to that artifact's controller");
|
effect.setText("{this} deals X damage to that artifact's controller");
|
||||||
this.getSpellAbility().addEffect(effect);
|
this.getSpellAbility().addEffect(effect);
|
||||||
}
|
this.getSpellAbility().setTargetAdjuster(DetonateAdjuster.instance);
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if(ability instanceof SpellAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
|
||||||
FilterArtifactPermanent filter = new FilterArtifactPermanent("artifact with converted mana cost X");
|
|
||||||
filter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue));
|
|
||||||
ability.addTarget(new TargetArtifactPermanent(filter));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Detonate(final Detonate card) {
|
public Detonate(final Detonate card) {
|
||||||
|
@ -54,3 +44,16 @@ public final class Detonate extends CardImpl {
|
||||||
return new Detonate(this);
|
return new Detonate(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum DetonateAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
int xValue = ability.getManaCostsToPay().getX();
|
||||||
|
FilterArtifactPermanent filter = new FilterArtifactPermanent("artifact with converted mana cost X");
|
||||||
|
filter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue));
|
||||||
|
ability.addTarget(new TargetArtifactPermanent(filter));
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.d;
|
package mage.cards.d;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.MageObjectReference;
|
import mage.MageObjectReference;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
@ -13,11 +12,7 @@ import mage.abilities.keyword.FlyingAbility;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
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.Duration;
|
|
||||||
import mage.constants.Outcome;
|
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.FilterCard;
|
||||||
import mage.filter.predicate.Predicates;
|
import mage.filter.predicate.Predicates;
|
||||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||||
|
@ -29,10 +24,12 @@ import mage.game.events.ZoneChangeEvent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.common.TargetCardInOpponentsGraveyard;
|
import mage.target.common.TargetCardInOpponentsGraveyard;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class DiluvianPrimordial extends CardImpl {
|
public final class DiluvianPrimordial extends CardImpl {
|
||||||
|
@ -48,24 +45,9 @@ public final class DiluvianPrimordial extends CardImpl {
|
||||||
this.addAbility(FlyingAbility.getInstance());
|
this.addAbility(FlyingAbility.getInstance());
|
||||||
|
|
||||||
// When Diluvian Primordial enters the battlefield, for each opponent, you may cast up to one target instant or sorcery card from that player's graveyard without paying its mana cost. If a card cast this way would be put into a graveyard this turn, exile it instead.
|
// When Diluvian Primordial enters the battlefield, for each opponent, you may cast up to one target instant or sorcery card from that player's graveyard without paying its mana cost. If a card cast this way would be put into a graveyard this turn, exile it instead.
|
||||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new DiluvianPrimordialEffect(), false));
|
Ability ability = new EntersBattlefieldTriggeredAbility(new DiluvianPrimordialEffect(), false);
|
||||||
}
|
ability.setTargetAdjuster(DiluvianPrimordialAdjuster.instance);
|
||||||
|
this.addAbility(ability);
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof EntersBattlefieldTriggeredAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
for (UUID opponentId : game.getOpponents(ability.getControllerId())) {
|
|
||||||
Player opponent = game.getPlayer(opponentId);
|
|
||||||
if (opponent != null) {
|
|
||||||
FilterCard filter = new FilterCard("instant or sorcery card from " + opponent.getLogName() + "'s graveyard");
|
|
||||||
filter.add(new OwnerIdPredicate(opponentId));
|
|
||||||
filter.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), new CardTypePredicate(CardType.SORCERY)));
|
|
||||||
TargetCardInOpponentsGraveyard target = new TargetCardInOpponentsGraveyard(0, 1, filter);
|
|
||||||
ability.addTarget(target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public DiluvianPrimordial(final DiluvianPrimordial card) {
|
public DiluvianPrimordial(final DiluvianPrimordial card) {
|
||||||
|
@ -78,6 +60,26 @@ public final class DiluvianPrimordial extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum DiluvianPrimordialAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
for (UUID opponentId : game.getOpponents(ability.getControllerId())) {
|
||||||
|
Player opponent = game.getPlayer(opponentId);
|
||||||
|
if (opponent == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
FilterCard filter = new FilterCard("instant or sorcery card from " + opponent.getLogName() + "'s graveyard");
|
||||||
|
filter.add(new OwnerIdPredicate(opponentId));
|
||||||
|
filter.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), new CardTypePredicate(CardType.SORCERY)));
|
||||||
|
TargetCardInOpponentsGraveyard target = new TargetCardInOpponentsGraveyard(0, 1, filter);
|
||||||
|
ability.addTarget(target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class DiluvianPrimordialEffect extends OneShotEffect {
|
class DiluvianPrimordialEffect extends OneShotEffect {
|
||||||
|
|
||||||
public DiluvianPrimordialEffect() {
|
public DiluvianPrimordialEffect() {
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.d;
|
package mage.cards.d;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
@ -13,30 +11,21 @@ import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
|
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LoneFox
|
* @author LoneFox
|
||||||
*/
|
*/
|
||||||
public final class Disembowel extends CardImpl {
|
public final class Disembowel extends CardImpl {
|
||||||
|
|
||||||
public Disembowel(UUID ownerId, CardSetInfo setInfo) {
|
public Disembowel(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{B}");
|
||||||
|
|
||||||
// Destroy target creature with converted mana cost X.
|
// Destroy target creature with converted mana cost X.
|
||||||
this.getSpellAbility().addEffect(new DestroyTargetEffect());
|
this.getSpellAbility().addEffect(new DestroyTargetEffect("creature with converted mana cost X"));
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature with converted mana cost X")));
|
this.getSpellAbility().setTargetAdjuster(DisembowelAdjuster.instance);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if(ability instanceof SpellAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with converted mana cost X");
|
|
||||||
filter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue));
|
|
||||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Disembowel(final Disembowel card) {
|
public Disembowel(final Disembowel card) {
|
||||||
|
@ -48,3 +37,16 @@ public final class Disembowel extends CardImpl {
|
||||||
return new Disembowel(this);
|
return new Disembowel(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum DisembowelAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
int xValue = ability.getManaCostsToPay().getX();
|
||||||
|
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with converted mana cost X");
|
||||||
|
filter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue));
|
||||||
|
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,9 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.d;
|
package mage.cards.d;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.common.ReturnToHandTargetEffect;
|
import mage.abilities.effects.common.ReturnToHandTargetEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
@ -13,22 +11,23 @@ import mage.filter.common.FilterNonlandPermanent;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.common.TargetNonlandPermanent;
|
import mage.target.common.TargetNonlandPermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class DistortingWake extends CardImpl {
|
public final class DistortingWake extends CardImpl {
|
||||||
|
|
||||||
public DistortingWake(UUID ownerId, CardSetInfo setInfo) {
|
public DistortingWake(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{U}{U}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{U}{U}{U}");
|
||||||
|
|
||||||
|
|
||||||
// Return X target nonland permanents to their owners' hands.
|
// Return X target nonland permanents to their owners' hands.
|
||||||
Effect effect = new ReturnToHandTargetEffect();
|
Effect effect = new ReturnToHandTargetEffect();
|
||||||
effect.setText("Return X target nonland permanents to their owners' hands");
|
effect.setText("Return X target nonland permanents to their owners' hands");
|
||||||
this.getSpellAbility().addEffect(effect);
|
this.getSpellAbility().addEffect(effect);
|
||||||
this.getSpellAbility().addTarget(new TargetNonlandPermanent());
|
this.getSpellAbility().setTargetAdjuster(DistortingWakeAdjuster.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DistortingWake(final DistortingWake card) {
|
public DistortingWake(final DistortingWake card) {
|
||||||
|
@ -39,16 +38,17 @@ public final class DistortingWake extends CardImpl {
|
||||||
public DistortingWake copy() {
|
public DistortingWake copy() {
|
||||||
return new DistortingWake(this);
|
return new DistortingWake(this);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum DistortingWakeAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability instanceof SpellAbility) {
|
int xValue = ability.getManaCostsToPay().getX();
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
Target target = new TargetNonlandPermanent(xValue, xValue,
|
||||||
Target target = new TargetNonlandPermanent(xValue, xValue,
|
new FilterNonlandPermanent(xValue + " target nonland permanent(s)"), false);
|
||||||
new FilterNonlandPermanent(xValue + " target nonland permanent(s)"), false);
|
ability.getTargets().clear();
|
||||||
ability.getTargets().clear();
|
ability.getTargets().add(target);
|
||||||
ability.getTargets().add(target);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
|
@ -1,9 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.d;
|
package mage.cards.d;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
|
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
@ -15,38 +12,43 @@ import mage.filter.predicate.Predicates;
|
||||||
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
|
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author fireshoes
|
* @author fireshoes
|
||||||
*/
|
*/
|
||||||
public final class Dominate extends CardImpl {
|
public final class Dominate extends CardImpl {
|
||||||
|
|
||||||
public Dominate(UUID ownerId, CardSetInfo setInfo) {
|
public Dominate(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{1}{U}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{1}{U}{U}");
|
||||||
|
|
||||||
// Gain control of target creature with converted mana cost X or less.
|
// Gain control of target creature with converted mana cost X or less.
|
||||||
this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.Custom, true));
|
this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.Custom, true));
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature with converted mana cost X or less")));
|
this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature with converted mana cost X or less")));
|
||||||
|
this.getSpellAbility().setTargetAdjuster(DominateAdjuster.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Dominate(final Dominate card) {
|
public Dominate(final Dominate card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if(ability instanceof SpellAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with converted mana cost X or less");
|
|
||||||
filter.add(Predicates.not(new ConvertedManaCostPredicate(ComparisonType.MORE_THAN, xValue)));
|
|
||||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Dominate copy() {
|
public Dominate copy() {
|
||||||
return new Dominate(this);
|
return new Dominate(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum DominateAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
int xValue = ability.getManaCostsToPay().getX();
|
||||||
|
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with converted mana cost X or less");
|
||||||
|
filter.add(Predicates.not(new ConvertedManaCostPredicate(ComparisonType.MORE_THAN, xValue)));
|
||||||
|
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,15 +1,14 @@
|
||||||
|
|
||||||
package mage.cards.d;
|
package mage.cards.d;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.costs.CostAdjuster;
|
||||||
import mage.abilities.costs.common.RevealTargetFromHandCost;
|
import mage.abilities.costs.common.RevealTargetFromHandCost;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.DamageTargetEffect;
|
import mage.abilities.effects.common.DamageTargetEffect;
|
||||||
import mage.abilities.effects.common.InfoEffect;
|
import mage.abilities.effects.common.InfoEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.AbilityType;
|
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
|
@ -22,23 +21,19 @@ import mage.target.common.TargetCardInHand;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
import mage.watchers.common.DragonOnTheBattlefieldWhileSpellWasCastWatcher;
|
import mage.watchers.common.DragonOnTheBattlefieldWhileSpellWasCastWatcher;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class DraconicRoar extends CardImpl {
|
public final class DraconicRoar extends CardImpl {
|
||||||
|
|
||||||
private static final FilterCard filter = new FilterCard("a Dragon card from your hand (you don't have to)");
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(new SubtypePredicate(SubType.DRAGON));
|
|
||||||
}
|
|
||||||
|
|
||||||
public DraconicRoar(UUID ownerId, CardSetInfo setInfo) {
|
public DraconicRoar(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}");
|
||||||
|
|
||||||
// As an additional cost to cast Draconic Roar, you may reveal a Dragon card from your hand.
|
// As an additional cost to cast Draconic Roar, you may reveal a Dragon card from your hand.
|
||||||
this.getSpellAbility().addEffect(new InfoEffect("as an additional cost to cast this spell, you may reveal a Dragon card from your hand"));
|
this.getSpellAbility().addEffect(new InfoEffect("as an additional cost to cast this spell, you may reveal a Dragon card from your hand"));
|
||||||
|
this.getSpellAbility().setCostAdjuster(DraconicRoarAdjuster.instance);
|
||||||
|
|
||||||
// Draconic Roar deals 3 damage to target creature. If you revealed a Dragon card or controlled a Dragon as you cast Draconic Roar, Draconic Roar deals 3 damage to that creature's controller.
|
// Draconic Roar deals 3 damage to target creature. If you revealed a Dragon card or controlled a Dragon as you cast Draconic Roar, Draconic Roar deals 3 damage to that creature's controller.
|
||||||
this.getSpellAbility().addEffect(new DamageTargetEffect(3));
|
this.getSpellAbility().addEffect(new DamageTargetEffect(3));
|
||||||
|
@ -47,18 +42,6 @@ public final class DraconicRoar extends CardImpl {
|
||||||
this.getSpellAbility().addWatcher(new DragonOnTheBattlefieldWhileSpellWasCastWatcher());
|
this.getSpellAbility().addWatcher(new DragonOnTheBattlefieldWhileSpellWasCastWatcher());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustCosts(Ability ability, Game game) {
|
|
||||||
if (ability.getAbilityType() == AbilityType.SPELL) {
|
|
||||||
Player controller = game.getPlayer(ability.getControllerId());
|
|
||||||
if (controller != null) {
|
|
||||||
if (controller.getHand().count(filter, game) > 0) {
|
|
||||||
ability.addCost(new RevealTargetFromHandCost(new TargetCardInHand(0,1, filter)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public DraconicRoar(final DraconicRoar card) {
|
public DraconicRoar(final DraconicRoar card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
@ -69,6 +52,25 @@ public final class DraconicRoar extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum DraconicRoarAdjuster implements CostAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
private static final FilterCard filter = new FilterCard("a Dragon card from your hand (you don't have to)");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new SubtypePredicate(SubType.DRAGON));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustCosts(Ability ability, Game game) {
|
||||||
|
Player controller = game.getPlayer(ability.getControllerId());
|
||||||
|
if (controller != null) {
|
||||||
|
if (controller.getHand().count(filter, game) > 0) {
|
||||||
|
ability.addCost(new RevealTargetFromHandCost(new TargetCardInHand(0, 1, filter)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class DraconicRoarEffect extends OneShotEffect {
|
class DraconicRoarEffect extends OneShotEffect {
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
|
|
||||||
package mage.cards.d;
|
package mage.cards.d;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.condition.Condition;
|
import mage.abilities.condition.Condition;
|
||||||
import mage.abilities.costs.Cost;
|
import mage.abilities.costs.Cost;
|
||||||
|
import mage.abilities.costs.CostAdjuster;
|
||||||
import mage.abilities.costs.common.RevealTargetFromHandCost;
|
import mage.abilities.costs.common.RevealTargetFromHandCost;
|
||||||
import mage.abilities.decorator.ConditionalContinuousRuleModifyingEffect;
|
import mage.abilities.decorator.ConditionalContinuousRuleModifyingEffect;
|
||||||
import mage.abilities.effects.ContinuousRuleModifyingEffect;
|
import mage.abilities.effects.ContinuousRuleModifyingEffect;
|
||||||
|
@ -25,24 +25,20 @@ import mage.game.stack.Spell;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.common.TargetCardInHand;
|
import mage.target.common.TargetCardInHand;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author jeffwadsworth
|
* @author jeffwadsworth
|
||||||
*/
|
*/
|
||||||
public final class DragonlordsPrerogative extends CardImpl {
|
public final class DragonlordsPrerogative extends CardImpl {
|
||||||
|
|
||||||
private static final FilterCard filter = new FilterCard("a Dragon card from your hand");
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(new SubtypePredicate(SubType.DRAGON));
|
|
||||||
}
|
|
||||||
|
|
||||||
public DragonlordsPrerogative(UUID ownerId, CardSetInfo setInfo) {
|
public DragonlordsPrerogative(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{4}{U}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{U}{U}");
|
||||||
|
|
||||||
// As an additional cost to cast Dragonlord's Prerogative, you may reveal a Dragon card from your hand.
|
// As an additional cost to cast Dragonlord's Prerogative, you may reveal a Dragon card from your hand.
|
||||||
this.getSpellAbility().addEffect(new InfoEffect("as an additional cost to cast this spell, you may reveal a Dragon card from your hand"));
|
this.getSpellAbility().addEffect(new InfoEffect("as an additional cost to cast this spell, you may reveal a Dragon card from your hand"));
|
||||||
|
this.getSpellAbility().setCostAdjuster(DragonlordsPrerogativeAdjuster.instance);
|
||||||
|
|
||||||
// If you revealed a Dragon card or controlled a Dragon as you cast Dragonlord's Prerogative, Dragonlord's Prerogative can't be countered.
|
// If you revealed a Dragon card or controlled a Dragon as you cast Dragonlord's Prerogative, Dragonlord's Prerogative can't be countered.
|
||||||
Condition condition = new DragonlordsPrerogativeCondition();
|
Condition condition = new DragonlordsPrerogativeCondition();
|
||||||
ContinuousRuleModifyingEffect cantBeCountered = new CantBeCounteredSourceEffect();
|
ContinuousRuleModifyingEffect cantBeCountered = new CantBeCounteredSourceEffect();
|
||||||
|
@ -50,22 +46,12 @@ public final class DragonlordsPrerogative extends CardImpl {
|
||||||
conditionalCantBeCountered.setText("<br/>If you revealed a Dragon card or controlled a Dragon as you cast {this}, this spell can't be countered");
|
conditionalCantBeCountered.setText("<br/>If you revealed a Dragon card or controlled a Dragon as you cast {this}, this spell can't be countered");
|
||||||
Ability ability = new SimpleStaticAbility(Zone.STACK, conditionalCantBeCountered);
|
Ability ability = new SimpleStaticAbility(Zone.STACK, conditionalCantBeCountered);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
// Draw four cards.
|
// Draw four cards.
|
||||||
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(4));
|
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(4));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustCosts(Ability ability, Game game) {
|
|
||||||
Player controller = game.getPlayer(ability.getControllerId());
|
|
||||||
if (controller != null) {
|
|
||||||
if (controller.getHand().count(filter, game) > 0) {
|
|
||||||
ability.addCost(new RevealTargetFromHandCost(new TargetCardInHand(0,1, filter)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public DragonlordsPrerogative(final DragonlordsPrerogative card) {
|
public DragonlordsPrerogative(final DragonlordsPrerogative card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
@ -76,6 +62,25 @@ public final class DragonlordsPrerogative extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum DragonlordsPrerogativeAdjuster implements CostAdjuster {
|
||||||
|
instance;
|
||||||
|
private static final FilterCard filter = new FilterCard("a Dragon card from your hand");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new SubtypePredicate(SubType.DRAGON));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustCosts(Ability ability, Game game) {
|
||||||
|
Player controller = game.getPlayer(ability.getControllerId());
|
||||||
|
if (controller != null) {
|
||||||
|
if (controller.getHand().count(filter, game) > 0) {
|
||||||
|
ability.addCost(new RevealTargetFromHandCost(new TargetCardInHand(0, 1, filter)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class DragonlordsPrerogativeCondition implements Condition {
|
class DragonlordsPrerogativeCondition implements Condition {
|
||||||
|
|
||||||
private final static FilterControlledPermanent filter = new FilterControlledPermanent("Dragon");
|
private final static FilterControlledPermanent filter = new FilterControlledPermanent("Dragon");
|
||||||
|
@ -89,7 +94,7 @@ class DragonlordsPrerogativeCondition implements Condition {
|
||||||
boolean applies = false;
|
boolean applies = false;
|
||||||
Spell spell = game.getStack().getSpell(source.getSourceId());
|
Spell spell = game.getStack().getSpell(source.getSourceId());
|
||||||
if (spell != null && spell.getSpellAbility() != null) {
|
if (spell != null && spell.getSpellAbility() != null) {
|
||||||
for(Cost cost: spell.getSpellAbility().getCosts()) {
|
for (Cost cost : spell.getSpellAbility().getCosts()) {
|
||||||
if (cost instanceof RevealTargetFromHandCost) {
|
if (cost instanceof RevealTargetFromHandCost) {
|
||||||
applies = !cost.getTargets().isEmpty();
|
applies = !cost.getTargets().isEmpty();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.d;
|
package mage.cards.d;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
|
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
|
||||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||||
|
@ -16,39 +13,25 @@ import mage.filter.predicate.Predicates;
|
||||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class DregsOfSorrow extends CardImpl {
|
public final class DregsOfSorrow extends CardImpl {
|
||||||
|
|
||||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creatures");
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK)));
|
|
||||||
}
|
|
||||||
|
|
||||||
public DregsOfSorrow(UUID ownerId, CardSetInfo setInfo) {
|
public DregsOfSorrow(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{4}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{4}{B}");
|
||||||
|
|
||||||
|
|
||||||
// Destroy X target nonblack creatures. Draw X cards.
|
// Destroy X target nonblack creatures. Draw X cards.
|
||||||
this.getSpellAbility().addEffect(new DestroyTargetEffect("Destroy X target nonblack creatures"));
|
this.getSpellAbility().addEffect(new DestroyTargetEffect("Destroy X target nonblack creatures"));
|
||||||
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(new ManacostVariableValue()));
|
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(new ManacostVariableValue()));
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
|
this.getSpellAbility().setTargetAdjuster(DregsOfSorrowAdjuster.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
|
||||||
ability.addTarget(new TargetCreaturePermanent(xValue, xValue, filter, false));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public DregsOfSorrow(final DregsOfSorrow card) {
|
public DregsOfSorrow(final DregsOfSorrow card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
@ -58,3 +41,19 @@ public final class DregsOfSorrow extends CardImpl {
|
||||||
return new DregsOfSorrow(this);
|
return new DregsOfSorrow(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum DregsOfSorrowAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creatures");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
int xValue = ability.getManaCostsToPay().getX();
|
||||||
|
ability.addTarget(new TargetCreaturePermanent(xValue, xValue, filter, false));
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,9 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.d;
|
package mage.cards.d;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.condition.common.KickedCondition;
|
import mage.abilities.condition.common.KickedCondition;
|
||||||
import mage.abilities.costs.Cost;
|
import mage.abilities.costs.Cost;
|
||||||
import mage.abilities.costs.Costs;
|
import mage.abilities.costs.Costs;
|
||||||
|
@ -19,6 +17,7 @@ import mage.filter.common.FilterControlledLandPermanent;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetControlledPermanent;
|
import mage.target.common.TargetControlledPermanent;
|
||||||
import mage.target.common.TargetLandPermanent;
|
import mage.target.common.TargetLandPermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -27,34 +26,38 @@ import mage.target.common.TargetLandPermanent;
|
||||||
public final class DwarvenLandslide extends CardImpl {
|
public final class DwarvenLandslide extends CardImpl {
|
||||||
|
|
||||||
public DwarvenLandslide(UUID ownerId, CardSetInfo setInfo) {
|
public DwarvenLandslide(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{R}");
|
||||||
|
|
||||||
// Kicker-{2}{R}, Sacrifice a land.
|
// Kicker-{2}{R}, Sacrifice a land.
|
||||||
Costs<Cost> kickerCosts = new CostsImpl<>();
|
Costs<Cost> kickerCosts = new CostsImpl<>();
|
||||||
kickerCosts.add(new ManaCostsImpl<>("{2}{R}"));
|
kickerCosts.add(new ManaCostsImpl<>("{2}{R}"));
|
||||||
kickerCosts.add(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledLandPermanent("a land"))));
|
kickerCosts.add(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledLandPermanent("a land"))));
|
||||||
this.addAbility(new KickerAbility(kickerCosts));
|
this.addAbility(new KickerAbility(kickerCosts));
|
||||||
|
|
||||||
// Destroy target land. If Dwarven Landslide was kicked, destroy another target land.
|
// Destroy target land. If Dwarven Landslide was kicked, destroy another target land.
|
||||||
getSpellAbility().addEffect(new DestroyTargetEffect("Destroy target land. if this spell was kicked, destroy another target land"));
|
getSpellAbility().addEffect(new DestroyTargetEffect("Destroy target land. if this spell was kicked, destroy another target land"));
|
||||||
getSpellAbility().addTarget(new TargetLandPermanent());
|
getSpellAbility().addTarget(new TargetLandPermanent());
|
||||||
|
getSpellAbility().setTargetAdjuster(DwarvenLandslideAdjuster.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DwarvenLandslide(final DwarvenLandslide card) {
|
public DwarvenLandslide(final DwarvenLandslide card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
if (KickedCondition.instance.apply(game, ability)) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
getSpellAbility().addTarget(new TargetLandPermanent(2));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DwarvenLandslide copy() {
|
public DwarvenLandslide copy() {
|
||||||
return new DwarvenLandslide(this);
|
return new DwarvenLandslide(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum DwarvenLandslideAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
if (KickedCondition.instance.apply(game, ability)) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
ability.addTarget(new TargetLandPermanent(2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,38 +1,38 @@
|
||||||
|
|
||||||
package mage.cards.e;
|
package mage.cards.e;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.effects.ContinuousEffect;
|
|
||||||
import mage.abilities.effects.OneShotEffect;
|
|
||||||
import mage.abilities.effects.common.combat.CantBlockTargetEffect;
|
import mage.abilities.effects.common.combat.CantBlockTargetEffect;
|
||||||
import mage.abilities.keyword.EternalizeAbility;
|
import mage.abilities.keyword.EternalizeAbility;
|
||||||
import mage.abilities.keyword.HasteAbility;
|
import mage.abilities.keyword.HasteAbility;
|
||||||
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.ComparisonType;
|
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.SubType;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.filter.predicate.mageobject.PowerPredicate;
|
import mage.filter.predicate.ObjectSourcePlayer;
|
||||||
|
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author jeffwadsworth
|
* @author jeffwadsworth
|
||||||
*/
|
*/
|
||||||
public final class EarthshakerKhenra extends CardImpl {
|
public final class EarthshakerKhenra extends CardImpl {
|
||||||
|
|
||||||
private final UUID originalId;
|
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power less than or equal to this creature's power");
|
||||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power less than or equal to {this}'s power");
|
|
||||||
|
static {
|
||||||
|
filter.add(EarthshakerKhenraPredicate.instance);
|
||||||
|
}
|
||||||
|
|
||||||
public EarthshakerKhenra(UUID ownerId, CardSetInfo setInfo) {
|
public EarthshakerKhenra(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}");
|
||||||
|
@ -46,32 +46,20 @@ public final class EarthshakerKhenra extends CardImpl {
|
||||||
this.addAbility(HasteAbility.getInstance());
|
this.addAbility(HasteAbility.getInstance());
|
||||||
|
|
||||||
// When Earthshaker Khenra enters the battlefield, target creature with power less than or equal to Earthshaker Khenra's power can't block this turn.
|
// When Earthshaker Khenra enters the battlefield, target creature with power less than or equal to Earthshaker Khenra's power can't block this turn.
|
||||||
Ability ability = new EntersBattlefieldTriggeredAbility(new EarthshakerKhenraEffect());
|
Ability ability = new EntersBattlefieldTriggeredAbility(
|
||||||
|
new CantBlockTargetEffect(Duration.EndOfTurn)
|
||||||
|
.setText("target creature with power less than or equal " +
|
||||||
|
"to {this}'s power can't block this turn")
|
||||||
|
);
|
||||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
originalId = ability.getOriginalId();
|
|
||||||
|
|
||||||
// Eternalize {4}{R}{R}
|
// Eternalize {4}{R}{R}
|
||||||
this.addAbility(new EternalizeAbility(new ManaCostsImpl("{4}{R}{R}"), this));
|
this.addAbility(new EternalizeAbility(new ManaCostsImpl("{4}{R}{R}"), this));
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability.getOriginalId().equals(originalId)) {
|
|
||||||
Permanent sourcePermanent = game.getPermanent(ability.getSourceId());
|
|
||||||
if (sourcePermanent != null) {
|
|
||||||
FilterCreaturePermanent targetFilter = new FilterCreaturePermanent("creature with power less than or equal to " + getLogName() + "'s power");
|
|
||||||
targetFilter.add(new PowerPredicate(ComparisonType.FEWER_THAN, sourcePermanent.getPower().getValue() + 1));
|
|
||||||
ability.getTargets().clear();
|
|
||||||
ability.getTargets().add(new TargetCreaturePermanent(targetFilter));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public EarthshakerKhenra(final EarthshakerKhenra card) {
|
public EarthshakerKhenra(final EarthshakerKhenra card) {
|
||||||
super(card);
|
super(card);
|
||||||
this.originalId = card.originalId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -80,39 +68,12 @@ public final class EarthshakerKhenra extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class EarthshakerKhenraEffect extends OneShotEffect {
|
enum EarthshakerKhenraPredicate implements ObjectSourcePlayerPredicate<ObjectSourcePlayer<Card>> {
|
||||||
|
instance;
|
||||||
public EarthshakerKhenraEffect() {
|
|
||||||
super(Outcome.UnboostCreature);
|
|
||||||
this.staticText = "target creature with power less than or equal to {this}'s power can't block this turn";
|
|
||||||
}
|
|
||||||
|
|
||||||
public EarthshakerKhenraEffect(final EarthshakerKhenraEffect effect) {
|
|
||||||
super(effect);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EarthshakerKhenraEffect copy() {
|
public boolean apply(ObjectSourcePlayer<Card> input, Game game) {
|
||||||
return new EarthshakerKhenraEffect(this);
|
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(input.getSourceId());
|
||||||
}
|
return sourcePermanent != null && input.getObject().getPower().getValue() <= sourcePermanent.getPower().getValue();
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
Permanent sourceObject = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
|
||||||
if (sourceObject != null) {
|
|
||||||
Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
|
|
||||||
/*
|
|
||||||
27.06.2017 The target creature's power is checked when you target it with Earthshaker Khenra's ability
|
|
||||||
and when that ability resolves. Once the ability resolves, if the creature's power increases
|
|
||||||
or Earthshaker Khenra's power decreases, the target creature will still be unable to block.
|
|
||||||
*/
|
|
||||||
if (targetCreature != null && targetCreature.getPower().getValue() <= sourceObject.getPower().getValue()) {
|
|
||||||
ContinuousEffect effect = new CantBlockTargetEffect(Duration.EndOfTurn);
|
|
||||||
effect.setTargetPointer(new FixedTarget(targetCreature, game));
|
|
||||||
game.addEffect(effect, source);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.e;
|
package mage.cards.e;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -9,11 +8,11 @@ import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.AbilityType;
|
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -22,7 +21,7 @@ import mage.target.common.TargetCreaturePermanent;
|
||||||
public final class EliminateTheCompetition extends CardImpl {
|
public final class EliminateTheCompetition extends CardImpl {
|
||||||
|
|
||||||
public EliminateTheCompetition(UUID ownerId, CardSetInfo setInfo) {
|
public EliminateTheCompetition(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{4}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{B}");
|
||||||
|
|
||||||
// As an additional cost to cast Eliminate the Competition, sacrifice X creatures.
|
// As an additional cost to cast Eliminate the Competition, sacrifice X creatures.
|
||||||
this.getSpellAbility().addCost(new SacrificeXTargetCost(new FilterControlledCreaturePermanent("creatures"), true));
|
this.getSpellAbility().addCost(new SacrificeXTargetCost(new FilterControlledCreaturePermanent("creatures"), true));
|
||||||
|
@ -32,23 +31,26 @@ public final class EliminateTheCompetition extends CardImpl {
|
||||||
effect.setText("Destroy X target creatures");
|
effect.setText("Destroy X target creatures");
|
||||||
this.getSpellAbility().addEffect(effect);
|
this.getSpellAbility().addEffect(effect);
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||||
|
this.getSpellAbility().setTargetAdjuster(EliminateTheCompetitionAdjuster.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public EliminateTheCompetition(final EliminateTheCompetition card) {
|
public EliminateTheCompetition(final EliminateTheCompetition card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability.getAbilityType() == AbilityType.SPELL) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
int sac = new GetXValue().calculate(game, ability, null);
|
|
||||||
ability.addTarget(new TargetCreaturePermanent(sac, sac));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EliminateTheCompetition copy() {
|
public EliminateTheCompetition copy() {
|
||||||
return new EliminateTheCompetition(this);
|
return new EliminateTheCompetition(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum EliminateTheCompetitionAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
int sac = new GetXValue().calculate(game, ability, null);
|
||||||
|
ability.addTarget(new TargetCreaturePermanent(sac, sac));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
|
|
||||||
package mage.cards.e;
|
package mage.cards.e;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.MageObjectReference;
|
import mage.MageObjectReference;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
|
import mage.abilities.costs.CostAdjuster;
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
import mage.abilities.costs.mana.GenericManaCost;
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
|
@ -25,8 +25,9 @@ import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetCard;
|
import mage.target.TargetCard;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class EliteArcanist extends CardImpl {
|
public final class EliteArcanist extends CardImpl {
|
||||||
|
@ -45,6 +46,7 @@ public final class EliteArcanist extends CardImpl {
|
||||||
// {X}, {T}: Copy the exiled card. You may cast the copy without paying its mana cost. X is the converted mana cost of the exiled card.
|
// {X}, {T}: Copy the exiled card. You may cast the copy without paying its mana cost. X is the converted mana cost of the exiled card.
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new EliteArcanistCopyEffect(), new ManaCostsImpl("{X}"));
|
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new EliteArcanistCopyEffect(), new ManaCostsImpl("{X}"));
|
||||||
ability.addCost(new TapSourceCost());
|
ability.addCost(new TapSourceCost());
|
||||||
|
ability.setCostAdjuster(EliteArcanistAdjuster.instance);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,29 +54,35 @@ public final class EliteArcanist extends CardImpl {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustCosts(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SimpleActivatedAbility) {
|
|
||||||
Permanent sourcePermanent = game.getPermanent(ability.getSourceId());
|
|
||||||
if (sourcePermanent != null && sourcePermanent.getImprinted() != null && !sourcePermanent.getImprinted().isEmpty()) {
|
|
||||||
Card imprintedInstant = game.getCard(sourcePermanent.getImprinted().get(0));
|
|
||||||
if (imprintedInstant != null) {
|
|
||||||
int cmc = imprintedInstant.getConvertedManaCost();
|
|
||||||
if (cmc > 0) {
|
|
||||||
ability.getManaCostsToPay().clear();
|
|
||||||
ability.getManaCostsToPay().add(new GenericManaCost(cmc));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EliteArcanist copy() {
|
public EliteArcanist copy() {
|
||||||
return new EliteArcanist(this);
|
return new EliteArcanist(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum EliteArcanistAdjuster implements CostAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustCosts(Ability ability, Game game) {
|
||||||
|
Permanent sourcePermanent = game.getPermanent(ability.getSourceId());
|
||||||
|
if (sourcePermanent == null
|
||||||
|
|| sourcePermanent.getImprinted() == null
|
||||||
|
|| sourcePermanent.getImprinted().isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Card imprintedInstant = game.getCard(sourcePermanent.getImprinted().get(0));
|
||||||
|
if (imprintedInstant == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int cmc = imprintedInstant.getConvertedManaCost();
|
||||||
|
if (cmc > 0) {
|
||||||
|
ability.getManaCostsToPay().clear();
|
||||||
|
ability.getManaCostsToPay().add(new GenericManaCost(cmc));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class EliteArcanistImprintEffect extends OneShotEffect {
|
class EliteArcanistImprintEffect extends OneShotEffect {
|
||||||
|
|
||||||
private static final FilterCard filter = new FilterCard("instant card from your hand");
|
private static final FilterCard filter = new FilterCard("instant card from your hand");
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
|
|
||||||
package mage.cards.e;
|
package mage.cards.e;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.AttacksCreatureYouControlTriggeredAbility;
|
import mage.abilities.common.AttacksCreatureYouControlTriggeredAbility;
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
import mage.abilities.effects.Effect;
|
|
||||||
import mage.abilities.effects.common.TapTargetEffect;
|
import mage.abilities.effects.common.TapTargetEffect;
|
||||||
import mage.abilities.effects.keyword.BolsterEffect;
|
import mage.abilities.effects.keyword.BolsterEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
@ -16,25 +14,29 @@ import mage.constants.SubType;
|
||||||
import mage.counters.CounterType;
|
import mage.counters.CounterType;
|
||||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
|
||||||
import mage.filter.predicate.permanent.CounterPredicate;
|
import mage.filter.predicate.permanent.CounterPredicate;
|
||||||
|
import mage.filter.predicate.permanent.DefendingPlayerControlsPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author emerald000
|
* @author emerald000
|
||||||
*/
|
*/
|
||||||
public final class EliteScaleguard extends CardImpl {
|
public final class EliteScaleguard extends CardImpl {
|
||||||
|
|
||||||
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("creature you control with a +1/+1 counter on it");
|
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("creature you control with a +1/+1 counter on it");
|
||||||
|
private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("creature defending player controls");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
filter.add(new CounterPredicate(CounterType.P1P1));
|
filter.add(new CounterPredicate(CounterType.P1P1));
|
||||||
|
filter2.add(new DefendingPlayerControlsPredicate());
|
||||||
}
|
}
|
||||||
|
|
||||||
public EliteScaleguard(UUID ownerId, CardSetInfo setInfo) {
|
public EliteScaleguard(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W}");
|
||||||
this.subtype.add(SubType.HUMAN);
|
this.subtype.add(SubType.HUMAN);
|
||||||
this.subtype.add(SubType.SOLDIER);
|
this.subtype.add(SubType.SOLDIER);
|
||||||
this.power = new MageInt(2);
|
this.power = new MageInt(2);
|
||||||
|
@ -42,32 +44,16 @@ public final class EliteScaleguard extends CardImpl {
|
||||||
|
|
||||||
// When Elite Scaleguard enters the battlefield, bolster 2.
|
// When Elite Scaleguard enters the battlefield, bolster 2.
|
||||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new BolsterEffect(2)));
|
this.addAbility(new EntersBattlefieldTriggeredAbility(new BolsterEffect(2)));
|
||||||
|
|
||||||
// Whenever a creature you control with a +1/+1 counter on it attacks, tap target creature defending player controls.
|
// Whenever a creature you control with a +1/+1 counter on it attacks, tap target creature defending player controls.
|
||||||
Ability ability = new AttacksCreatureYouControlTriggeredAbility(new EliteScaleguardTapEffect(), false, filter, true);
|
Ability ability = new AttacksCreatureYouControlTriggeredAbility(new EliteScaleguardTapEffect(), false, filter, true);
|
||||||
ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature defending player controls")));
|
ability.addTarget(new TargetCreaturePermanent(filter2));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
public EliteScaleguard(final EliteScaleguard card) {
|
public EliteScaleguard(final EliteScaleguard card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof AttacksCreatureYouControlTriggeredAbility) {
|
|
||||||
FilterCreaturePermanent filterDefender = new FilterCreaturePermanent("creature defending player controls");
|
|
||||||
for (Effect effect : ability.getEffects()) {
|
|
||||||
if (effect instanceof EliteScaleguardTapEffect) {
|
|
||||||
filterDefender.add(new ControllerIdPredicate(game.getCombat().getDefendingPlayerId(effect.getTargetPointer().getFirst(game, ability), game)));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ability.getTargets().clear();
|
|
||||||
TargetCreaturePermanent target = new TargetCreaturePermanent(filterDefender);
|
|
||||||
ability.addTarget(target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EliteScaleguard copy() {
|
public EliteScaleguard copy() {
|
||||||
|
@ -76,20 +62,20 @@ public final class EliteScaleguard extends CardImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
class EliteScaleguardTapEffect extends TapTargetEffect {
|
class EliteScaleguardTapEffect extends TapTargetEffect {
|
||||||
|
|
||||||
EliteScaleguardTapEffect() {
|
EliteScaleguardTapEffect() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
EliteScaleguardTapEffect(final EliteScaleguardTapEffect effect) {
|
EliteScaleguardTapEffect(final EliteScaleguardTapEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EliteScaleguardTapEffect copy() {
|
public EliteScaleguardTapEffect copy() {
|
||||||
return new EliteScaleguardTapEffect(this);
|
return new EliteScaleguardTapEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.e;
|
package mage.cards.e;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
|
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
@ -14,38 +12,45 @@ import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
|
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author TheElk801
|
* @author TheElk801
|
||||||
*/
|
*/
|
||||||
public final class EntrancingMelody extends CardImpl {
|
public final class EntrancingMelody extends CardImpl {
|
||||||
|
|
||||||
|
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with converted mana cost X");
|
||||||
|
|
||||||
public EntrancingMelody(UUID ownerId, CardSetInfo setInfo) {
|
public EntrancingMelody(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{U}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{U}{U}");
|
||||||
|
|
||||||
// Gain control of target creature with converted mana cost X.
|
// Gain control of target creature with converted mana cost X.
|
||||||
this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.Custom, true));
|
this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.Custom, true));
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature with converted mana cost X")));
|
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
|
||||||
|
this.getSpellAbility().setTargetAdjuster(EntrancingMelodyAdjuster.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntrancingMelody(final EntrancingMelody card) {
|
public EntrancingMelody(final EntrancingMelody card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with converted mana cost X");
|
|
||||||
filter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue));
|
|
||||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EntrancingMelody copy() {
|
public EntrancingMelody copy() {
|
||||||
return new EntrancingMelody(this);
|
return new EntrancingMelody(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum EntrancingMelodyAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
int xValue = ability.getManaCostsToPay().getX();
|
||||||
|
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with converted mana cost " + xValue);
|
||||||
|
filter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue));
|
||||||
|
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,7 +2,6 @@ package mage.cards.e;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
|
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
|
||||||
import mage.abilities.keyword.MiracleAbility;
|
import mage.abilities.keyword.MiracleAbility;
|
||||||
|
@ -14,6 +13,7 @@ import mage.filter.common.FilterCreatureCard;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.common.TargetCardInYourGraveyard;
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -27,25 +27,10 @@ public final class EntreatTheDead extends CardImpl {
|
||||||
// Return X target creature cards from your graveyard to the battlefield.
|
// Return X target creature cards from your graveyard to the battlefield.
|
||||||
this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect());
|
this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect());
|
||||||
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(1, StaticFilters.FILTER_CARD_CREATURE));
|
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(1, StaticFilters.FILTER_CARD_CREATURE));
|
||||||
|
this.getSpellAbility().setTargetAdjuster(EntreatTheDeadAdjuster.instance);
|
||||||
|
|
||||||
// Miracle {X}{B}{B}
|
// Miracle {X}{B}{B}
|
||||||
this.addAbility(new MiracleAbility(this, new ManaCostsImpl("{X}{B}{B}")));
|
this.addAbility(new MiracleAbility(this, new ManaCostsImpl("{X}{B}{B}")));
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
|
||||||
String filterName = xValue
|
|
||||||
+ (xValue != 1 ? " creature cards" : "creature card")
|
|
||||||
+ " from your graveyard";
|
|
||||||
Target target = new TargetCardInYourGraveyard(
|
|
||||||
xValue, new FilterCreatureCard(filterName)
|
|
||||||
);
|
|
||||||
ability.addTarget(target);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntreatTheDead(final EntreatTheDead card) {
|
public EntreatTheDead(final EntreatTheDead card) {
|
||||||
|
@ -57,3 +42,20 @@ public final class EntreatTheDead extends CardImpl {
|
||||||
return new EntreatTheDead(this);
|
return new EntreatTheDead(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum EntreatTheDeadAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
int xValue = ability.getManaCostsToPay().getX();
|
||||||
|
String filterName = xValue
|
||||||
|
+ (xValue != 1 ? " creature cards" : "creature card")
|
||||||
|
+ " from your graveyard";
|
||||||
|
Target target = new TargetCardInYourGraveyard(
|
||||||
|
xValue, new FilterCreatureCard(filterName)
|
||||||
|
);
|
||||||
|
ability.addTarget(target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.f;
|
package mage.cards.f;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -16,38 +15,30 @@ import mage.filter.common.FilterControlledLandPermanent;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetControlledPermanent;
|
import mage.target.common.TargetControlledPermanent;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author LoneFox
|
* @author LoneFox
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
public final class FallingTimber extends CardImpl {
|
public final class FallingTimber extends CardImpl {
|
||||||
|
|
||||||
private final UUID originalId;
|
|
||||||
|
|
||||||
public FallingTimber(UUID ownerId, CardSetInfo setInfo) {
|
public FallingTimber(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{G}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{G}");
|
||||||
|
|
||||||
// Kicker-Sacrifice a land.
|
// Kicker-Sacrifice a land.
|
||||||
this.addAbility(new KickerAbility(new SacrificeTargetCost(new TargetControlledPermanent(1, 1, new FilterControlledLandPermanent("a land"), true))));
|
this.addAbility(new KickerAbility(new SacrificeTargetCost(new TargetControlledPermanent(1, 1, new FilterControlledLandPermanent("a land"), true))));
|
||||||
|
|
||||||
// Prevent all combat damage target creature would deal this turn. If Falling Timber was kicked, prevent all combat damage another target creature would deal this turn.
|
// Prevent all combat damage target creature would deal this turn. If Falling Timber was kicked, prevent all combat damage another target creature would deal this turn.
|
||||||
Effect effect = new PreventDamageByTargetEffect(Duration.EndOfTurn, true);
|
Effect effect = new PreventDamageByTargetEffect(Duration.EndOfTurn, true);
|
||||||
effect.setText("Prevent all combat damage target creature would deal this turn. if this spell was kicked, prevent all combat damage another target creature would deal this turn.");
|
effect.setText("Prevent all combat damage target creature would deal this turn. if this spell was kicked, prevent all combat damage another target creature would deal this turn.");
|
||||||
this.getSpellAbility().addEffect(effect);
|
this.getSpellAbility().addEffect(effect);
|
||||||
originalId = this.getSpellAbility().getOriginalId();
|
this.getSpellAbility().setTargetAdjuster(FallingTimberAdjuster.instance);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if(ability.getOriginalId().equals(originalId)) {
|
|
||||||
ability.addTarget(new TargetCreaturePermanent(KickedCondition.instance.apply(game, ability) ? 2 : 1));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public FallingTimber(final FallingTimber card) {
|
public FallingTimber(final FallingTimber card) {
|
||||||
super(card);
|
super(card);
|
||||||
this.originalId = card.originalId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -55,3 +46,13 @@ public final class FallingTimber extends CardImpl {
|
||||||
return new FallingTimber(this);
|
return new FallingTimber(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum FallingTimberAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
ability.addTarget(new TargetCreaturePermanent(KickedCondition.instance.apply(game, ability) ? 2 : 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.f;
|
package mage.cards.f;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.condition.common.KickedCondition;
|
import mage.abilities.condition.common.KickedCondition;
|
||||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||||
import mage.abilities.effects.common.DamageMultiEffect;
|
import mage.abilities.effects.common.DamageMultiEffect;
|
||||||
|
@ -16,6 +14,7 @@ import mage.game.Game;
|
||||||
import mage.target.common.TargetAnyTarget;
|
import mage.target.common.TargetAnyTarget;
|
||||||
import mage.target.common.TargetAnyTargetAmount;
|
import mage.target.common.TargetAnyTargetAmount;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -39,26 +38,29 @@ public final class FightWithFire extends CardImpl {
|
||||||
+ "<i> (Those targets can include players and planeswalkers.)</i>"
|
+ "<i> (Those targets can include players and planeswalkers.)</i>"
|
||||||
));
|
));
|
||||||
this.getSpellAbility().addTarget(new TargetAnyTarget());
|
this.getSpellAbility().addTarget(new TargetAnyTarget());
|
||||||
|
this.getSpellAbility().setTargetAdjuster(FightWithFireAdjuster.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FightWithFire(final FightWithFire card) {
|
public FightWithFire(final FightWithFire card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
if (KickedCondition.instance.apply(game, ability)) {
|
|
||||||
ability.addTarget(new TargetAnyTargetAmount(10));
|
|
||||||
} else {
|
|
||||||
ability.addTarget(new TargetCreaturePermanent());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FightWithFire copy() {
|
public FightWithFire copy() {
|
||||||
return new FightWithFire(this);
|
return new FightWithFire(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum FightWithFireAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
if (KickedCondition.instance.apply(game, ability)) {
|
||||||
|
ability.addTarget(new TargetAnyTargetAmount(10));
|
||||||
|
} else {
|
||||||
|
ability.addTarget(new TargetCreaturePermanent());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
|
|
||||||
package mage.cards.f;
|
package mage.cards.f;
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.costs.CostAdjuster;
|
||||||
import mage.abilities.costs.mana.GenericManaCost;
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
@ -14,8 +14,9 @@ import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.common.TargetAnyTarget;
|
import mage.target.common.TargetAnyTarget;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
*/
|
*/
|
||||||
public final class Fireball extends CardImpl {
|
public final class Fireball extends CardImpl {
|
||||||
|
@ -27,14 +28,7 @@ public final class Fireball extends CardImpl {
|
||||||
// Fireball costs 1 more to cast for each target beyond the first.
|
// Fireball costs 1 more to cast for each target beyond the first.
|
||||||
this.getSpellAbility().addTarget(new FireballTargetCreatureOrPlayer(0, Integer.MAX_VALUE));
|
this.getSpellAbility().addTarget(new FireballTargetCreatureOrPlayer(0, Integer.MAX_VALUE));
|
||||||
this.getSpellAbility().addEffect(new FireballEffect());
|
this.getSpellAbility().addEffect(new FireballEffect());
|
||||||
}
|
this.getSpellAbility().setCostAdjuster(FireballAdjuster.instance);
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustCosts(Ability ability, Game game) {
|
|
||||||
int numTargets = ability.getTargets().isEmpty() ? 0 : ability.getTargets().get(0).getTargets().size();
|
|
||||||
if (numTargets > 1) {
|
|
||||||
ability.getManaCostsToPay().add(new GenericManaCost(numTargets - 1));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Fireball(final Fireball card) {
|
public Fireball(final Fireball card) {
|
||||||
|
@ -47,6 +41,18 @@ public final class Fireball extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum FireballAdjuster implements CostAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustCosts(Ability ability, Game game) {
|
||||||
|
int numTargets = ability.getTargets().isEmpty() ? 0 : ability.getTargets().get(0).getTargets().size();
|
||||||
|
if (numTargets > 1) {
|
||||||
|
ability.getManaCostsToPay().add(new GenericManaCost(numTargets - 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class FireballEffect extends OneShotEffect {
|
class FireballEffect extends OneShotEffect {
|
||||||
|
|
||||||
public FireballEffect() {
|
public FireballEffect() {
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.f;
|
package mage.cards.f;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -16,6 +15,7 @@ import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.common.TargetAnyTarget;
|
import mage.target.common.TargetAnyTarget;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -24,19 +24,28 @@ import mage.target.common.TargetAnyTarget;
|
||||||
public final class Firestorm extends CardImpl {
|
public final class Firestorm extends CardImpl {
|
||||||
|
|
||||||
public Firestorm(UUID ownerId, CardSetInfo setInfo) {
|
public Firestorm(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}");
|
||||||
|
|
||||||
|
|
||||||
// As an additional cost to cast Firestorm, discard X cards.
|
// As an additional cost to cast Firestorm, discard X cards.
|
||||||
this.getSpellAbility().addCost(new DiscardXTargetCost(new FilterCard("cards"), true));
|
this.getSpellAbility().addCost(new DiscardXTargetCost(new FilterCard("cards"), true));
|
||||||
// Firestorm deals X damage to each of X target creatures and/or players.
|
// Firestorm deals X damage to each of X target creatures and/or players.
|
||||||
this.getSpellAbility().addEffect(new FirestormEffect());
|
this.getSpellAbility().addEffect(new FirestormEffect());
|
||||||
|
this.getSpellAbility().setTargetAdjuster(FirestormAdjuster.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Firestorm(final Firestorm card) {
|
public Firestorm(final Firestorm card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Firestorm copy() {
|
||||||
|
return new Firestorm(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum FirestormAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
int xValue = new GetXValue().calculate(game, ability, null);
|
int xValue = new GetXValue().calculate(game, ability, null);
|
||||||
|
@ -45,11 +54,6 @@ public final class Firestorm extends CardImpl {
|
||||||
ability.addTarget(target);
|
ability.addTarget(target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Firestorm copy() {
|
|
||||||
return new Firestorm(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class FirestormEffect extends OneShotEffect {
|
class FirestormEffect extends OneShotEffect {
|
||||||
|
@ -85,9 +89,6 @@ class FirestormEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FirestormEffect copy() {
|
public FirestormEffect copy() {
|
||||||
|
|
|
@ -1,15 +1,14 @@
|
||||||
|
|
||||||
package mage.cards.f;
|
package mage.cards.f;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.costs.CostAdjuster;
|
||||||
import mage.abilities.costs.common.RevealTargetFromHandCost;
|
import mage.abilities.costs.common.RevealTargetFromHandCost;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.InfoEffect;
|
import mage.abilities.effects.common.InfoEffect;
|
||||||
import mage.abilities.effects.common.SacrificeEffect;
|
import mage.abilities.effects.common.SacrificeEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.AbilityType;
|
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
|
@ -22,23 +21,19 @@ import mage.target.TargetPlayer;
|
||||||
import mage.target.common.TargetCardInHand;
|
import mage.target.common.TargetCardInHand;
|
||||||
import mage.watchers.common.DragonOnTheBattlefieldWhileSpellWasCastWatcher;
|
import mage.watchers.common.DragonOnTheBattlefieldWhileSpellWasCastWatcher;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class FoulTongueInvocation extends CardImpl {
|
public final class FoulTongueInvocation extends CardImpl {
|
||||||
|
|
||||||
private static final FilterCard filter = new FilterCard("a Dragon card from your hand (you don't have to)");
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(new SubtypePredicate(SubType.DRAGON));
|
|
||||||
}
|
|
||||||
|
|
||||||
public FoulTongueInvocation(UUID ownerId, CardSetInfo setInfo) {
|
public FoulTongueInvocation(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{B}");
|
||||||
|
|
||||||
// As an additional cost to cast Foul-Tongue Invocation, you may reveal a Dragon card from your hand.
|
// As an additional cost to cast Foul-Tongue Invocation, you may reveal a Dragon card from your hand.
|
||||||
this.getSpellAbility().addEffect(new InfoEffect("as an additional cost to cast this spell, you may reveal a Dragon card from your hand"));
|
this.getSpellAbility().addEffect(new InfoEffect("as an additional cost to cast this spell, you may reveal a Dragon card from your hand"));
|
||||||
|
this.getSpellAbility().setCostAdjuster(FoulTongueInvocationAdjuster.instance);
|
||||||
|
|
||||||
// Target player sacrifices a creature. If you revealed a Dragon card or controlled a Dragon as you cast Foul-Tongue Invocation, you gain 4 life.
|
// Target player sacrifices a creature. If you revealed a Dragon card or controlled a Dragon as you cast Foul-Tongue Invocation, you gain 4 life.
|
||||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||||
|
@ -47,18 +42,6 @@ public final class FoulTongueInvocation extends CardImpl {
|
||||||
this.getSpellAbility().addWatcher(new DragonOnTheBattlefieldWhileSpellWasCastWatcher());
|
this.getSpellAbility().addWatcher(new DragonOnTheBattlefieldWhileSpellWasCastWatcher());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustCosts(Ability ability, Game game) {
|
|
||||||
if (ability.getAbilityType() == AbilityType.SPELL) {
|
|
||||||
Player controller = game.getPlayer(ability.getControllerId());
|
|
||||||
if (controller != null) {
|
|
||||||
if (controller.getHand().count(filter, game) > 0) {
|
|
||||||
ability.addCost(new RevealTargetFromHandCost(new TargetCardInHand(0, 1, filter)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public FoulTongueInvocation(final FoulTongueInvocation card) {
|
public FoulTongueInvocation(final FoulTongueInvocation card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
@ -69,6 +52,25 @@ public final class FoulTongueInvocation extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum FoulTongueInvocationAdjuster implements CostAdjuster {
|
||||||
|
instance;
|
||||||
|
private static final FilterCard filter = new FilterCard("a Dragon card from your hand (you don't have to)");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new SubtypePredicate(SubType.DRAGON));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustCosts(Ability ability, Game game) {
|
||||||
|
Player controller = game.getPlayer(ability.getControllerId());
|
||||||
|
if (controller != null) {
|
||||||
|
if (controller.getHand().count(filter, game) > 0) {
|
||||||
|
ability.addCost(new RevealTargetFromHandCost(new TargetCardInHand(0, 1, filter)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class FoulTongueInvocationEffect extends OneShotEffect {
|
class FoulTongueInvocationEffect extends OneShotEffect {
|
||||||
|
|
||||||
public FoulTongueInvocationEffect() {
|
public FoulTongueInvocationEffect() {
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.g;
|
package mage.cards.g;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||||
import mage.abilities.keyword.AssistAbility;
|
import mage.abilities.keyword.AssistAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
@ -14,9 +12,11 @@ import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.filter.predicate.mageobject.PowerPredicate;
|
import mage.filter.predicate.mageobject.PowerPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author TheElk801
|
* @author TheElk801
|
||||||
*/
|
*/
|
||||||
public final class GangUp extends CardImpl {
|
public final class GangUp extends CardImpl {
|
||||||
|
@ -28,27 +28,29 @@ public final class GangUp extends CardImpl {
|
||||||
this.addAbility(new AssistAbility());
|
this.addAbility(new AssistAbility());
|
||||||
|
|
||||||
// Destroy target creature with power X or less.
|
// Destroy target creature with power X or less.
|
||||||
this.getSpellAbility().addEffect(new DestroyTargetEffect());
|
this.getSpellAbility().addEffect(new DestroyTargetEffect("destroy target creature with power X or less"));
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature with power X or less")));
|
this.getSpellAbility().setTargetAdjuster(GangUpAdjuster.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public GangUp(final GangUp card) {
|
public GangUp(final GangUp card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
|
||||||
ability.getTargets().clear();
|
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power " + xValue + " or less");
|
|
||||||
filter.add(new PowerPredicate(ComparisonType.FEWER_THAN, xValue + 1));
|
|
||||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GangUp copy() {
|
public GangUp copy() {
|
||||||
return new GangUp(this);
|
return new GangUp(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum GangUpAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
int xValue = ability.getManaCostsToPay().getX();
|
||||||
|
ability.getTargets().clear();
|
||||||
|
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power " + xValue + " or less");
|
||||||
|
filter.add(new PowerPredicate(ComparisonType.FEWER_THAN, xValue + 1));
|
||||||
|
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,20 +1,21 @@
|
||||||
|
|
||||||
package mage.cards.g;
|
package mage.cards.g;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.effects.common.TapTargetEffect;
|
import mage.abilities.effects.common.TapTargetEffect;
|
||||||
import mage.abilities.effects.keyword.ScryEffect;
|
import mage.abilities.effects.keyword.ScryEffect;
|
||||||
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 static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class GlimpseTheSunGod extends CardImpl {
|
public final class GlimpseTheSunGod extends CardImpl {
|
||||||
|
@ -24,26 +25,27 @@ public final class GlimpseTheSunGod extends CardImpl {
|
||||||
|
|
||||||
// Tap X target creatures. Scry 1.
|
// Tap X target creatures. Scry 1.
|
||||||
this.getSpellAbility().addEffect(new TapTargetEffect("X target creatures"));
|
this.getSpellAbility().addEffect(new TapTargetEffect("X target creatures"));
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1, FILTER_PERMANENT_CREATURES, false));
|
|
||||||
this.getSpellAbility().addEffect(new ScryEffect(1));
|
this.getSpellAbility().addEffect(new ScryEffect(1));
|
||||||
|
this.getSpellAbility().setTargetAdjuster(GlimpseTheSunGodAdjuster.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public GlimpseTheSunGod(final GlimpseTheSunGod card) {
|
public GlimpseTheSunGod(final GlimpseTheSunGod card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
int numberToTap = ability.getManaCostsToPay().getX();
|
|
||||||
numberToTap = Math.min(game.getBattlefield().count(FILTER_PERMANENT_CREATURES, ability.getSourceId(), ability.getControllerId(), game), numberToTap);
|
|
||||||
ability.addTarget(new TargetCreaturePermanent(numberToTap, numberToTap, FILTER_PERMANENT_CREATURES, false));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GlimpseTheSunGod copy() {
|
public GlimpseTheSunGod copy() {
|
||||||
return new GlimpseTheSunGod(this);
|
return new GlimpseTheSunGod(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum GlimpseTheSunGodAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
int numberToTap = ability.getManaCostsToPay().getX();
|
||||||
|
ability.addTarget(new TargetCreaturePermanent(numberToTap, numberToTap, FILTER_PERMANENT_CREATURES, false));
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.g;
|
package mage.cards.g;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.condition.common.KickedCondition;
|
import mage.abilities.condition.common.KickedCondition;
|
||||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||||
|
@ -19,19 +18,28 @@ import mage.game.Game;
|
||||||
import mage.target.common.TargetControlledPermanent;
|
import mage.target.common.TargetControlledPermanent;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
import mage.target.common.TargetPlayerOrPlaneswalker;
|
import mage.target.common.TargetPlayerOrPlaneswalker;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class GoblinBarrage extends CardImpl {
|
public final class GoblinBarrage extends CardImpl {
|
||||||
|
|
||||||
|
private static final FilterControlledPermanent filter = new FilterControlledPermanent("an artifact or Goblin");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(Predicates.or(
|
||||||
|
new CardTypePredicate(CardType.ARTIFACT),
|
||||||
|
new SubtypePredicate(SubType.GOBLIN)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
public GoblinBarrage(UUID ownerId, CardSetInfo setInfo) {
|
public GoblinBarrage(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{R}");
|
||||||
|
|
||||||
// Kicker—Sacrifice an artifact or Goblin.
|
// Kicker—Sacrifice an artifact or Goblin.
|
||||||
FilterControlledPermanent filter = new FilterControlledPermanent("an artifact or Goblin");
|
|
||||||
filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), new SubtypePredicate(SubType.GOBLIN)));
|
|
||||||
this.addAbility(new KickerAbility(new SacrificeTargetCost(new TargetControlledPermanent(filter))));
|
this.addAbility(new KickerAbility(new SacrificeTargetCost(new TargetControlledPermanent(filter))));
|
||||||
|
|
||||||
// Goblin Barrage deals 4 damage to target creature. If this spell was kicked, it also deals 4 damage to target player or planeswalker.
|
// Goblin Barrage deals 4 damage to target creature. If this spell was kicked, it also deals 4 damage to target player or planeswalker.
|
||||||
|
@ -40,13 +48,7 @@ public final class GoblinBarrage extends CardImpl {
|
||||||
+ "it also deals 4 damage to target player or planeswalker")
|
+ "it also deals 4 damage to target player or planeswalker")
|
||||||
);
|
);
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||||
}
|
this.getSpellAbility().setTargetAdjuster(GoblinBarrageAdjuster.instance);
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (KickedCondition.instance.apply(game, ability)) {
|
|
||||||
ability.addTarget(new TargetPlayerOrPlaneswalker());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public GoblinBarrage(final GoblinBarrage card) {
|
public GoblinBarrage(final GoblinBarrage card) {
|
||||||
|
@ -58,3 +60,14 @@ public final class GoblinBarrage extends CardImpl {
|
||||||
return new GoblinBarrage(this);
|
return new GoblinBarrage(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum GoblinBarrageAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
if (KickedCondition.instance.apply(game, ability)) {
|
||||||
|
ability.addTarget(new TargetPlayerOrPlaneswalker());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,8 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.g;
|
package mage.cards.g;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.AttacksTriggeredAbility;
|
import mage.abilities.common.AttacksTriggeredAbility;
|
||||||
|
@ -12,16 +10,21 @@ import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
import mage.filter.predicate.permanent.DefendingPlayerControlsPredicate;
|
||||||
import mage.game.Game;
|
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author TheElk801
|
* @author TheElk801
|
||||||
*/
|
*/
|
||||||
public final class GoblinRacketeer extends CardImpl {
|
public final class GoblinRacketeer extends CardImpl {
|
||||||
|
|
||||||
private final UUID originalId;
|
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new DefendingPlayerControlsPredicate());
|
||||||
|
}
|
||||||
|
|
||||||
public GoblinRacketeer(UUID ownerId, CardSetInfo setInfo) {
|
public GoblinRacketeer(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}");
|
||||||
|
@ -33,27 +36,12 @@ public final class GoblinRacketeer extends CardImpl {
|
||||||
|
|
||||||
// Whenever Goblin Racketeer attacks, you may goad target creature defending player controls.
|
// Whenever Goblin Racketeer attacks, you may goad target creature defending player controls.
|
||||||
Ability ability = new AttacksTriggeredAbility(new GoadTargetEffect(), true, "Whenever {this} attacks, you may goad target creature defending player controls");
|
Ability ability = new AttacksTriggeredAbility(new GoadTargetEffect(), true, "Whenever {this} attacks, you may goad target creature defending player controls");
|
||||||
ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature defending player controls")));
|
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||||
originalId = ability.getOriginalId();
|
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
public GoblinRacketeer(final GoblinRacketeer card) {
|
public GoblinRacketeer(final GoblinRacketeer card) {
|
||||||
super(card);
|
super(card);
|
||||||
this.originalId = card.originalId;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability.getOriginalId().equals(originalId)) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
|
|
||||||
UUID defenderId = game.getCombat().getDefenderId(ability.getSourceId());
|
|
||||||
filter.add(new ControllerIdPredicate(defenderId));
|
|
||||||
TargetCreaturePermanent target = new TargetCreaturePermanent(filter);
|
|
||||||
ability.addTarget(target);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.g;
|
package mage.cards.g;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
import mage.abilities.common.delayed.OnLeaveReturnExiledToBattlefieldAbility;
|
import mage.abilities.common.delayed.OnLeaveReturnExiledToBattlefieldAbility;
|
||||||
|
@ -23,10 +22,12 @@ import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
import mage.util.CardUtil;
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author fireshoes
|
* @author fireshoes
|
||||||
*/
|
*/
|
||||||
public final class GraspOfFate extends CardImpl {
|
public final class GraspOfFate extends CardImpl {
|
||||||
|
@ -36,8 +37,8 @@ public final class GraspOfFate extends CardImpl {
|
||||||
|
|
||||||
// When Grasp of Fate enters the battlefield, for each opponent, exile up to one target nonland permanent that player controls until Grasp of Fate leaves the battlefield.
|
// When Grasp of Fate enters the battlefield, for each opponent, exile up to one target nonland permanent that player controls until Grasp of Fate leaves the battlefield.
|
||||||
Ability ability = new EntersBattlefieldTriggeredAbility(new GraspOfFateExileEffect());
|
Ability ability = new EntersBattlefieldTriggeredAbility(new GraspOfFateExileEffect());
|
||||||
ability.addTarget(new TargetPermanent());
|
|
||||||
ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility()));
|
ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility()));
|
||||||
|
ability.setTargetAdjuster(GraspOfFateAdjuster.instance);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,29 +46,32 @@ public final class GraspOfFate extends CardImpl {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof EntersBattlefieldTriggeredAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
for (UUID opponentId : game.getOpponents(ability.getControllerId())) {
|
|
||||||
Player opponent = game.getPlayer(opponentId);
|
|
||||||
if (opponent != null) {
|
|
||||||
FilterPermanent filter = new FilterPermanent("nonland permanent from opponent " + opponent.getLogName());
|
|
||||||
filter.add(new ControllerIdPredicate(opponentId));
|
|
||||||
filter.add(Predicates.not(new CardTypePredicate(CardType.LAND)));
|
|
||||||
TargetPermanent target = new TargetPermanent(0, 1, filter, false);
|
|
||||||
ability.addTarget(target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GraspOfFate copy() {
|
public GraspOfFate copy() {
|
||||||
return new GraspOfFate(this);
|
return new GraspOfFate(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum GraspOfFateAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
for (UUID opponentId : game.getOpponents(ability.getControllerId())) {
|
||||||
|
Player opponent = game.getPlayer(opponentId);
|
||||||
|
if (opponent == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
FilterPermanent filter = new FilterPermanent("nonland permanent from opponent " + opponent.getLogName());
|
||||||
|
filter.add(new ControllerIdPredicate(opponentId));
|
||||||
|
filter.add(Predicates.not(new CardTypePredicate(CardType.LAND)));
|
||||||
|
TargetPermanent target = new TargetPermanent(0, 1, filter, false);
|
||||||
|
ability.addTarget(target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class GraspOfFateExileEffect extends OneShotEffect {
|
class GraspOfFateExileEffect extends OneShotEffect {
|
||||||
|
|
||||||
public GraspOfFateExileEffect() {
|
public GraspOfFateExileEffect() {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.g;
|
package mage.cards.g;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.AttacksTriggeredAbility;
|
import mage.abilities.common.AttacksTriggeredAbility;
|
||||||
|
@ -11,20 +10,22 @@ import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.FilterCard;
|
||||||
import mage.filter.predicate.other.OwnerIdPredicate;
|
import mage.filter.predicate.permanent.DefendingPlayerOwnsCardPredicate;
|
||||||
import mage.game.Game;
|
|
||||||
import mage.players.Player;
|
|
||||||
import mage.target.common.TargetCardInGraveyard;
|
import mage.target.common.TargetCardInGraveyard;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author jeffwadsworth
|
* @author jeffwadsworth
|
||||||
*/
|
*/
|
||||||
public final class GravenAbomination extends CardImpl {
|
public final class GravenAbomination extends CardImpl {
|
||||||
|
|
||||||
private final UUID originalId;
|
private static final String rule = "Whenever {this} attacks, exile target card from defending player's graveyard.";
|
||||||
|
private static final FilterCard filter = new FilterCard("card from defending player's graveyard");
|
||||||
|
|
||||||
private final static String rule = "Whenever {this} attacks, exile target card from defending player's graveyard.";
|
static {
|
||||||
|
filter.add(new DefendingPlayerOwnsCardPredicate());
|
||||||
|
}
|
||||||
|
|
||||||
public GravenAbomination(UUID ownerId, CardSetInfo setInfo) {
|
public GravenAbomination(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}");
|
||||||
|
@ -35,30 +36,12 @@ public final class GravenAbomination extends CardImpl {
|
||||||
|
|
||||||
// Whenever Graven Abomination attacks, exile target card from defending player's graveyard.
|
// Whenever Graven Abomination attacks, exile target card from defending player's graveyard.
|
||||||
Ability ability = new AttacksTriggeredAbility(new ExileTargetEffect(), false, rule);
|
Ability ability = new AttacksTriggeredAbility(new ExileTargetEffect(), false, rule);
|
||||||
ability.addTarget(new TargetCardInGraveyard());
|
ability.addTarget(new TargetCardInGraveyard(filter));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
originalId = ability.getOriginalId();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
UUID gravenAbominationId = ability.getSourceId();
|
|
||||||
FilterCard filter = new FilterCard("target card from defending player's graveyard");
|
|
||||||
if (ability.getOriginalId().equals(originalId)) {
|
|
||||||
UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(gravenAbominationId, game);
|
|
||||||
Player defendingPlayer = game.getPlayer(defendingPlayerId);
|
|
||||||
if (defendingPlayer != null) {
|
|
||||||
filter.add(new OwnerIdPredicate(defendingPlayerId));
|
|
||||||
ability.getTargets().clear();
|
|
||||||
ability.getTargets().add(new TargetCardInGraveyard(filter));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public GravenAbomination(final GravenAbomination card) {
|
public GravenAbomination(final GravenAbomination card) {
|
||||||
super(card);
|
super(card);
|
||||||
this.originalId = card.originalId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.g;
|
package mage.cards.g;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.effects.common.TapTargetEffect;
|
import mage.abilities.effects.common.TapTargetEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
@ -11,41 +9,40 @@ import mage.constants.CardType;
|
||||||
import mage.filter.common.FilterNonlandPermanent;
|
import mage.filter.common.FilterNonlandPermanent;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class Gridlock extends CardImpl {
|
public final class Gridlock extends CardImpl {
|
||||||
private static final FilterNonlandPermanent filter = new FilterNonlandPermanent("nonland permanents");
|
|
||||||
|
|
||||||
public Gridlock(UUID ownerId, CardSetInfo setInfo) {
|
public Gridlock(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{U}");
|
||||||
|
|
||||||
|
|
||||||
// Tap X target nonland permanents.
|
// Tap X target nonland permanents.
|
||||||
this.getSpellAbility().addEffect(new TapTargetEffect());
|
this.getSpellAbility().addEffect(new TapTargetEffect("X target nonland permanents"));
|
||||||
// Correct number of targets will be set in adjustTargets
|
this.getSpellAbility().setTargetAdjuster(GridlockAdjuster.instance);
|
||||||
this.getSpellAbility().addTarget(new TargetPermanent(0, 1,filter, false));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Gridlock(final Gridlock card) {
|
public Gridlock(final Gridlock card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
int numberToTap = ability.getManaCostsToPay().getX();
|
|
||||||
numberToTap = Math.min(game.getBattlefield().count(filter, ability.getSourceId(), ability.getControllerId(), game), numberToTap);
|
|
||||||
ability.addTarget(new TargetPermanent(numberToTap, filter));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Gridlock copy() {
|
public Gridlock copy() {
|
||||||
return new Gridlock(this);
|
return new Gridlock(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum GridlockAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
private static final FilterNonlandPermanent filter = new FilterNonlandPermanent("nonland permanents");
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
ability.addTarget(new TargetPermanent(ability.getManaCostsToPay().getX(), filter));
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,9 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.g;
|
package mage.cards.g;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageObjectReference;
|
import mage.MageObjectReference;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
|
@ -17,10 +14,14 @@ import mage.filter.predicate.Predicates;
|
||||||
import mage.filter.predicate.mageobject.CardIdPredicate;
|
import mage.filter.predicate.mageobject.CardIdPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetCardInGraveyard;
|
import mage.target.common.TargetCardInGraveyard;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
import mage.watchers.common.CardsPutIntoGraveyardWatcher;
|
import mage.watchers.common.CardsPutIntoGraveyardWatcher;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class GrimReturn extends CardImpl {
|
public final class GrimReturn extends CardImpl {
|
||||||
|
@ -28,13 +29,13 @@ public final class GrimReturn extends CardImpl {
|
||||||
private static final String textFilter = "creature card in a graveyard that was put there from the battlefield this turn";
|
private static final String textFilter = "creature card in a graveyard that was put there from the battlefield this turn";
|
||||||
|
|
||||||
public GrimReturn(UUID ownerId, CardSetInfo setInfo) {
|
public GrimReturn(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{B}");
|
||||||
|
|
||||||
// Choose target creature card in a graveyard that was put there from the battlefield this turn. Put that card onto the battlefield under your control.
|
// Choose target creature card in a graveyard that was put there from the battlefield this turn. Put that card onto the battlefield under your control.
|
||||||
Effect effect = new ReturnFromGraveyardToBattlefieldTargetEffect();
|
Effect effect = new ReturnFromGraveyardToBattlefieldTargetEffect();
|
||||||
effect.setText("Choose target creature card in a graveyard that was put there from the battlefield this turn. Put that card onto the battlefield under your control");
|
effect.setText("Choose target creature card in a graveyard that was put there from the battlefield this turn. Put that card onto the battlefield under your control");
|
||||||
this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect());
|
this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect());
|
||||||
this.getSpellAbility().addTarget(new TargetCardInGraveyard(new FilterCreatureCard(textFilter)));
|
this.getSpellAbility().setTargetAdjuster(GrimReturnAdjuster.instance);
|
||||||
this.getSpellAbility().addWatcher(new CardsPutIntoGraveyardWatcher());
|
this.getSpellAbility().addWatcher(new CardsPutIntoGraveyardWatcher());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,22 +47,27 @@ public final class GrimReturn extends CardImpl {
|
||||||
public GrimReturn copy() {
|
public GrimReturn copy() {
|
||||||
return new GrimReturn(this);
|
return new GrimReturn(this);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum GrimReturnAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
private static final String textFilter = "creature card in a graveyard that was put there from the battlefield this turn";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
CardsPutIntoGraveyardWatcher watcher = game.getState().getWatcher(CardsPutIntoGraveyardWatcher.class);
|
CardsPutIntoGraveyardWatcher watcher = game.getState().getWatcher(CardsPutIntoGraveyardWatcher.class);
|
||||||
if (watcher != null) {
|
if (watcher == null) {
|
||||||
FilterCard filter = new FilterCreatureCard(textFilter);
|
return;
|
||||||
List<CardIdPredicate> uuidPredicates = new ArrayList<>();
|
|
||||||
for (MageObjectReference mor : watcher.getCardsPutToGraveyardFromBattlefield()) {
|
|
||||||
if (game.getState().getZoneChangeCounter(mor.getSourceId()) == mor.getZoneChangeCounter()) {
|
|
||||||
uuidPredicates.add(new CardIdPredicate(mor.getSourceId()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
filter.add(Predicates.or(uuidPredicates));
|
|
||||||
ability.getTargets().clear();
|
|
||||||
ability.addTarget(new TargetCardInGraveyard(filter));
|
|
||||||
}
|
}
|
||||||
|
FilterCard filter = new FilterCreatureCard(textFilter);
|
||||||
|
List<CardIdPredicate> uuidPredicates = new ArrayList<>();
|
||||||
|
for (MageObjectReference mor : watcher.getCardsPutToGraveyardFromBattlefield()) {
|
||||||
|
if (mor.zoneCounterIsCurrent(game)) {
|
||||||
|
uuidPredicates.add(new CardIdPredicate(mor.getSourceId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
filter.add(Predicates.or(uuidPredicates));
|
||||||
|
ability.getTargets().clear();
|
||||||
|
ability.addTarget(new TargetCardInGraveyard(filter));
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,12 +1,8 @@
|
||||||
|
|
||||||
package mage.cards.h;
|
package mage.cards.h;
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
@ -21,10 +17,14 @@ import mage.game.permanent.token.EmptyToken;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.common.TargetCardInYourGraveyard;
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
import mage.util.CardUtil;
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author emerald000
|
* @author emerald000
|
||||||
*/
|
*/
|
||||||
public final class HourOfEternity extends CardImpl {
|
public final class HourOfEternity extends CardImpl {
|
||||||
|
@ -34,17 +34,7 @@ public final class HourOfEternity extends CardImpl {
|
||||||
|
|
||||||
// Exile X target creature cards from your graveyard. For each card exiled this way, create a token that's a copy of that card, except it's a 4/4 black Zombie.
|
// Exile X target creature cards from your graveyard. For each card exiled this way, create a token that's a copy of that card, except it's a 4/4 black Zombie.
|
||||||
this.getSpellAbility().addEffect(new HourOfEternityEffect());
|
this.getSpellAbility().addEffect(new HourOfEternityEffect());
|
||||||
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0, Integer.MAX_VALUE, new FilterCreatureCard("creature cards from your graveyard")));
|
this.getSpellAbility().setTargetAdjuster(HourOfEternityAdjuster.instance);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
|
||||||
Target target = new TargetCardInYourGraveyard(xValue, new FilterCreatureCard((xValue != 1 ? " creature cards" : "creature card") + " from your graveyard"));
|
|
||||||
ability.addTarget(target);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public HourOfEternity(final HourOfEternity card) {
|
public HourOfEternity(final HourOfEternity card) {
|
||||||
|
@ -57,11 +47,25 @@ public final class HourOfEternity extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum HourOfEternityAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
int xValue = ability.getManaCostsToPay().getX();
|
||||||
|
Target target = new TargetCardInYourGraveyard(xValue, new FilterCreatureCard((xValue != 1 ? " creature cards" : "creature card") + " from your graveyard"));
|
||||||
|
ability.addTarget(target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class HourOfEternityEffect extends OneShotEffect {
|
class HourOfEternityEffect extends OneShotEffect {
|
||||||
|
|
||||||
HourOfEternityEffect() {
|
HourOfEternityEffect() {
|
||||||
super(Outcome.PutCreatureInPlay);
|
super(Outcome.PutCreatureInPlay);
|
||||||
this.staticText = "Exile X target creature cards from your graveyard. For each card exiled this way, create a token that's a copy of that card, except it's a 4/4 black Zombie";
|
this.staticText = "Exile X target creature cards from your graveyard. " +
|
||||||
|
"For each card exiled this way, create a token that's a copy of that card, " +
|
||||||
|
"except it's a 4/4 black Zombie";
|
||||||
}
|
}
|
||||||
|
|
||||||
HourOfEternityEffect(final HourOfEternityEffect effect) {
|
HourOfEternityEffect(final HourOfEternityEffect effect) {
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.i;
|
package mage.cards.i;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.condition.LockedInCondition;
|
import mage.abilities.condition.LockedInCondition;
|
||||||
import mage.abilities.condition.common.FerociousCondition;
|
import mage.abilities.condition.common.FerociousCondition;
|
||||||
import mage.abilities.decorator.ConditionalContinuousRuleModifyingEffect;
|
import mage.abilities.decorator.ConditionalContinuousRuleModifyingEffect;
|
||||||
|
@ -13,12 +11,13 @@ import mage.abilities.effects.common.TapTargetEffect;
|
||||||
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.filter.StaticFilters;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author emerald000
|
* @author emerald000
|
||||||
*/
|
*/
|
||||||
public final class IcyBlast extends CardImpl {
|
public final class IcyBlast extends CardImpl {
|
||||||
|
@ -28,7 +27,6 @@ public final class IcyBlast extends CardImpl {
|
||||||
|
|
||||||
// Tap X target creatures.
|
// Tap X target creatures.
|
||||||
this.getSpellAbility().addEffect(new TapTargetEffect("X target creatures"));
|
this.getSpellAbility().addEffect(new TapTargetEffect("X target creatures"));
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1, StaticFilters.FILTER_PERMANENT_CREATURE, false));
|
|
||||||
|
|
||||||
// <i>Ferocious</i> — If you control a creature with power 4 or greater, those creatures don't untap during their controllers' next untap steps.
|
// <i>Ferocious</i> — If you control a creature with power 4 or greater, those creatures don't untap during their controllers' next untap steps.
|
||||||
Effect effect = new ConditionalContinuousRuleModifyingEffect(
|
Effect effect = new ConditionalContinuousRuleModifyingEffect(
|
||||||
|
@ -36,24 +34,25 @@ public final class IcyBlast extends CardImpl {
|
||||||
new LockedInCondition(FerociousCondition.instance));
|
new LockedInCondition(FerociousCondition.instance));
|
||||||
effect.setText("<br/><i>Ferocious</i> — If you control a creature with power 4 or greater, those creatures don't untap during their controllers' next untap steps");
|
effect.setText("<br/><i>Ferocious</i> — If you control a creature with power 4 or greater, those creatures don't untap during their controllers' next untap steps");
|
||||||
this.getSpellAbility().addEffect(effect);
|
this.getSpellAbility().addEffect(effect);
|
||||||
|
this.getSpellAbility().setTargetAdjuster(IcyBlastAdjuster.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IcyBlast(final IcyBlast card) {
|
public IcyBlast(final IcyBlast card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
int numberToTap = ability.getManaCostsToPay().getX();
|
|
||||||
numberToTap = Math.min(game.getBattlefield().count(StaticFilters.FILTER_PERMANENT_CREATURE, ability.getSourceId(), ability.getControllerId(), game), numberToTap);
|
|
||||||
ability.addTarget(new TargetCreaturePermanent(numberToTap));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IcyBlast copy() {
|
public IcyBlast copy() {
|
||||||
return new IcyBlast(this);
|
return new IcyBlast(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum IcyBlastAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
ability.addTarget(new TargetCreaturePermanent(ability.getManaCostsToPay().getX()));
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,7 +2,6 @@
|
||||||
package mage.cards.i;
|
package mage.cards.i;
|
||||||
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.*;
|
import mage.cards.*;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
@ -16,53 +15,64 @@ import mage.game.permanent.Permanent;
|
||||||
import mage.players.Library;
|
import mage.players.Library;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class IndomitableCreativity extends CardImpl {
|
public final class IndomitableCreativity extends CardImpl {
|
||||||
|
|
||||||
private static final FilterPermanent filter = new FilterPermanent("artifacts and/or creatures");
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.CREATURE)));
|
|
||||||
}
|
|
||||||
|
|
||||||
public IndomitableCreativity(UUID ownerId, CardSetInfo setInfo) {
|
public IndomitableCreativity(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{R}{R}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{R}{R}{R}");
|
||||||
|
|
||||||
// Destroy X target artifacts and/or creatures. For each permanent destroyed this way, its controller reveals cards from the top of their library until an artifact or creature card is revealed and exiles that card. Those players put the exiled card onto the battlefield, then shuffle their libraries.
|
// Destroy X target artifacts and/or creatures. For each permanent destroyed this way, its controller reveals cards from the top of their library until an artifact or creature card is revealed and exiles that card. Those players put the exiled card onto the battlefield, then shuffle their libraries.
|
||||||
getSpellAbility().addEffect(new IndomitableCreativityEffect());
|
this.getSpellAbility().addEffect(new IndomitableCreativityEffect());
|
||||||
this.getSpellAbility().addTarget(new TargetPermanent(filter));
|
this.getSpellAbility().setTargetAdjuster(IndomitableCreativityAdjuster.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IndomitableCreativity(final IndomitableCreativity card) {
|
public IndomitableCreativity(final IndomitableCreativity card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
|
||||||
ability.addTarget(new TargetPermanent(xValue, xValue, filter, false));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IndomitableCreativity copy() {
|
public IndomitableCreativity copy() {
|
||||||
return new IndomitableCreativity(this);
|
return new IndomitableCreativity(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum IndomitableCreativityAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
private static final FilterPermanent filter = new FilterPermanent("artifacts and/or creatures");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(Predicates.or(
|
||||||
|
new CardTypePredicate(CardType.ARTIFACT),
|
||||||
|
new CardTypePredicate(CardType.CREATURE)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
int xValue = ability.getManaCostsToPay().getX();
|
||||||
|
ability.addTarget(new TargetPermanent(xValue, xValue, filter, false));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class IndomitableCreativityEffect extends OneShotEffect {
|
class IndomitableCreativityEffect extends OneShotEffect {
|
||||||
|
|
||||||
public IndomitableCreativityEffect() {
|
public IndomitableCreativityEffect() {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.Benefit);
|
||||||
this.staticText = "Destroy X target artifacts and/or creatures. For each permanent destroyed this way, its controller reveals cards from the top of their library until an artifact or creature card is revealed and exiles that card. Those players put the exiled card onto the battlefield, then shuffle their libraries";
|
this.staticText = "Destroy X target artifacts and/or creatures. " +
|
||||||
|
"For each permanent destroyed this way, " +
|
||||||
|
"its controller reveals cards from the top of their library" +
|
||||||
|
" until an artifact or creature card is revealed and exiles that card. " +
|
||||||
|
"Those players put the exiled card onto the battlefield, then shuffle their libraries";
|
||||||
}
|
}
|
||||||
|
|
||||||
public IndomitableCreativityEffect(final IndomitableCreativityEffect effect) {
|
public IndomitableCreativityEffect(final IndomitableCreativityEffect effect) {
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.j;
|
package mage.cards.j;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.condition.common.KickedCondition;
|
import mage.abilities.condition.common.KickedCondition;
|
||||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
|
@ -18,6 +16,7 @@ import mage.filter.predicate.mageobject.AnotherTargetPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
import mage.target.targetpointer.SecondTargetPointer;
|
import mage.target.targetpointer.SecondTargetPointer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -43,18 +42,7 @@ public final class Jilt extends CardImpl {
|
||||||
Target target = new TargetCreaturePermanent();
|
Target target = new TargetCreaturePermanent();
|
||||||
target.setTargetTag(1);
|
target.setTargetTag(1);
|
||||||
this.getSpellAbility().addTarget(target);
|
this.getSpellAbility().addTarget(target);
|
||||||
}
|
this.getSpellAbility().setTargetAdjuster(JiltAdjuster.instance);
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility && KickedCondition.instance.apply(game, ability)) {
|
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("Another creature: Damaged");
|
|
||||||
filter.add(new AnotherTargetPredicate(2));
|
|
||||||
Target target = new TargetCreaturePermanent(filter);
|
|
||||||
target.setTargetTag(2);
|
|
||||||
ability.addTarget(target);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Jilt(final Jilt card) {
|
public Jilt(final Jilt card) {
|
||||||
|
@ -66,3 +54,20 @@ public final class Jilt extends CardImpl {
|
||||||
return new Jilt(this);
|
return new Jilt(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum JiltAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
if (!KickedCondition.instance.apply(game, ability)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
FilterCreaturePermanent filter = new FilterCreaturePermanent("Another creature: Damaged");
|
||||||
|
filter.add(new AnotherTargetPredicate(2));
|
||||||
|
Target target = new TargetCreaturePermanent(filter);
|
||||||
|
target.setTargetTag(2);
|
||||||
|
ability.addTarget(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.k;
|
package mage.cards.k;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
@ -17,9 +15,11 @@ import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author sinsedrix
|
* @author sinsedrix
|
||||||
*/
|
*/
|
||||||
public final class KaerveksPurge extends CardImpl {
|
public final class KaerveksPurge extends CardImpl {
|
||||||
|
@ -28,19 +28,8 @@ public final class KaerveksPurge extends CardImpl {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{B}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{B}{R}");
|
||||||
|
|
||||||
// Destroy target creature with converted mana cost X. If that creature dies this way, Kaervek's Purge deals damage equal to the creature's power to the creature's controller.
|
// Destroy target creature with converted mana cost X. If that creature dies this way, Kaervek's Purge deals damage equal to the creature's power to the creature's controller.
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature with converted mana cost X")));
|
|
||||||
this.getSpellAbility().addEffect(new KaerveksPurgeEffect());
|
this.getSpellAbility().addEffect(new KaerveksPurgeEffect());
|
||||||
}
|
this.getSpellAbility().setTargetAdjuster(KaerveksPurgeAdjuster.instance);
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with converted mana cost X");
|
|
||||||
filter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue));
|
|
||||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public KaerveksPurge(final KaerveksPurge card) {
|
public KaerveksPurge(final KaerveksPurge card) {
|
||||||
|
@ -53,11 +42,27 @@ public final class KaerveksPurge extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum KaerveksPurgeAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
int xValue = ability.getManaCostsToPay().getX();
|
||||||
|
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with converted mana cost " + xValue);
|
||||||
|
filter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue));
|
||||||
|
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class KaerveksPurgeEffect extends OneShotEffect {
|
class KaerveksPurgeEffect extends OneShotEffect {
|
||||||
|
|
||||||
public KaerveksPurgeEffect() {
|
public KaerveksPurgeEffect() {
|
||||||
super(Outcome.DestroyPermanent);
|
super(Outcome.DestroyPermanent);
|
||||||
this.staticText = "Destroy target creature with converted mana cost X. If that creature dies this way, {this} deals damage equal to the creature's power to the creature's controller";
|
this.staticText = "Destroy target creature with converted mana cost X. " +
|
||||||
|
"If that creature dies this way, " +
|
||||||
|
"{this} deals damage equal to the creature's power" +
|
||||||
|
" to the creature's controller";
|
||||||
}
|
}
|
||||||
|
|
||||||
public KaerveksPurgeEffect(final KaerveksPurgeEffect effect) {
|
public KaerveksPurgeEffect(final KaerveksPurgeEffect effect) {
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
|
|
||||||
package mage.cards.k;
|
package mage.cards.k;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
import mage.abilities.costs.Cost;
|
import mage.abilities.costs.Cost;
|
||||||
import mage.abilities.costs.CostImpl;
|
import mage.abilities.costs.CostImpl;
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
|
||||||
import mage.abilities.effects.common.DamageTargetEffect;
|
import mage.abilities.effects.common.DamageTargetEffect;
|
||||||
import mage.abilities.keyword.CumulativeUpkeepAbility;
|
import mage.abilities.keyword.CumulativeUpkeepAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
@ -21,9 +20,11 @@ import mage.players.Player;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.common.TargetAnyTarget;
|
import mage.target.common.TargetAnyTarget;
|
||||||
import mage.target.common.TargetOpponent;
|
import mage.target.common.TargetOpponent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author L_J
|
* @author L_J
|
||||||
*/
|
*/
|
||||||
public final class KarplusanMinotaur extends CardImpl {
|
public final class KarplusanMinotaur extends CardImpl {
|
||||||
|
@ -39,36 +40,10 @@ public final class KarplusanMinotaur extends CardImpl {
|
||||||
this.addAbility(new CumulativeUpkeepAbility(new KarplusanMinotaurCost()));
|
this.addAbility(new CumulativeUpkeepAbility(new KarplusanMinotaurCost()));
|
||||||
|
|
||||||
// Whenever you win a coin flip, Karplusan Minotaur deals 1 damage to any target.
|
// Whenever you win a coin flip, Karplusan Minotaur deals 1 damage to any target.
|
||||||
Ability abilityWin = new KarplusanMinotaurFlipWinTriggeredAbility();
|
this.addAbility(new KarplusanMinotaurFlipWinTriggeredAbility());
|
||||||
abilityWin.addTarget(new TargetAnyTarget());
|
|
||||||
this.addAbility(abilityWin);
|
|
||||||
|
|
||||||
//TODO: Make ability properly copiable
|
|
||||||
// Whenever you lose a coin flip, Karplusan Minotaur deals 1 damage to any target of an opponent's choice.
|
// Whenever you lose a coin flip, Karplusan Minotaur deals 1 damage to any target of an opponent's choice.
|
||||||
Ability abilityLose = new KarplusanMinotaurFlipLoseTriggeredAbility();
|
this.addAbility(new KarplusanMinotaurFlipLoseTriggeredAbility());
|
||||||
abilityLose.addTarget(new TargetAnyTarget());
|
|
||||||
this.addAbility(abilityLose);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof KarplusanMinotaurFlipLoseTriggeredAbility) {
|
|
||||||
Player controller = game.getPlayer(ability.getControllerId());
|
|
||||||
if (controller != null) {
|
|
||||||
UUID opponentId = null;
|
|
||||||
if (game.getOpponents(controller.getId()).size() > 1) {
|
|
||||||
Target target = new TargetOpponent(true);
|
|
||||||
if (controller.chooseTarget(Outcome.Neutral, target, ability, game)) {
|
|
||||||
opponentId = target.getFirstTarget();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
opponentId = game.getOpponents(controller.getId()).iterator().next();
|
|
||||||
}
|
|
||||||
if (opponentId != null) {
|
|
||||||
ability.getTargets().get(0).setTargetController(opponentId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public KarplusanMinotaur(final KarplusanMinotaur card) {
|
public KarplusanMinotaur(final KarplusanMinotaur card) {
|
||||||
|
@ -81,10 +56,35 @@ public final class KarplusanMinotaur extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum KarplusanMinotaurAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
Player controller = game.getPlayer(ability.getControllerId());
|
||||||
|
if (controller == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
UUID opponentId = null;
|
||||||
|
if (game.getOpponents(controller.getId()).size() > 1) {
|
||||||
|
Target target = new TargetOpponent(true);
|
||||||
|
if (controller.chooseTarget(Outcome.Neutral, target, ability, game)) {
|
||||||
|
opponentId = target.getFirstTarget();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
opponentId = game.getOpponents(controller.getId()).iterator().next();
|
||||||
|
}
|
||||||
|
if (opponentId != null) {
|
||||||
|
ability.getTargets().get(0).setTargetController(opponentId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class KarplusanMinotaurFlipWinTriggeredAbility extends TriggeredAbilityImpl {
|
class KarplusanMinotaurFlipWinTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
public KarplusanMinotaurFlipWinTriggeredAbility() {
|
public KarplusanMinotaurFlipWinTriggeredAbility() {
|
||||||
super(Zone.BATTLEFIELD, new DamageTargetEffect(1), false);
|
super(Zone.BATTLEFIELD, new DamageTargetEffect(1), false);
|
||||||
|
this.addTarget(new TargetAnyTarget());
|
||||||
}
|
}
|
||||||
|
|
||||||
public KarplusanMinotaurFlipWinTriggeredAbility(final KarplusanMinotaurFlipWinTriggeredAbility ability) {
|
public KarplusanMinotaurFlipWinTriggeredAbility(final KarplusanMinotaurFlipWinTriggeredAbility ability) {
|
||||||
|
@ -116,6 +116,8 @@ class KarplusanMinotaurFlipLoseTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
public KarplusanMinotaurFlipLoseTriggeredAbility() {
|
public KarplusanMinotaurFlipLoseTriggeredAbility() {
|
||||||
super(Zone.BATTLEFIELD, new DamageTargetEffect(1), false);
|
super(Zone.BATTLEFIELD, new DamageTargetEffect(1), false);
|
||||||
|
this.addTarget(new TargetAnyTarget());
|
||||||
|
targetAdjuster = KarplusanMinotaurAdjuster.instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public KarplusanMinotaurFlipLoseTriggeredAbility(final KarplusanMinotaurFlipLoseTriggeredAbility ability) {
|
public KarplusanMinotaurFlipLoseTriggeredAbility(final KarplusanMinotaurFlipLoseTriggeredAbility ability) {
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
*/
|
*/
|
||||||
package mage.cards.k;
|
package mage.cards.k;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
|
@ -35,32 +34,25 @@ import mage.abilities.costs.common.TapSourceCost;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.filter.FilterOpponent;
|
import mage.filter.FilterOpponent;
|
||||||
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.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetPlayer;
|
import mage.target.TargetPlayer;
|
||||||
import mage.target.common.TargetOpponent;
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author jeffwadsworth
|
* @author jeffwadsworth
|
||||||
*/
|
*/
|
||||||
public class KeeperOfTheMind extends CardImpl {
|
public class KeeperOfTheMind extends CardImpl {
|
||||||
|
|
||||||
public final UUID originalId;
|
|
||||||
private static final FilterOpponent filter = new FilterOpponent();
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(new KeeperOfTheMindPredicate());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public KeeperOfTheMind(UUID ownerId, CardSetInfo setInfo) {
|
public KeeperOfTheMind(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}{U}");
|
||||||
|
|
||||||
|
@ -74,28 +66,12 @@ public class KeeperOfTheMind extends CardImpl {
|
||||||
effect.setText("Choose target opponent who had at least two more cards in hand than you did as you activated this ability. Draw a card.");
|
effect.setText("Choose target opponent who had at least two more cards in hand than you did as you activated this ability. Draw a card.");
|
||||||
Ability ability = new SimpleActivatedAbility(effect, new ManaCostsImpl("{U}"));
|
Ability ability = new SimpleActivatedAbility(effect, new ManaCostsImpl("{U}"));
|
||||||
ability.addCost(new TapSourceCost());
|
ability.addCost(new TapSourceCost());
|
||||||
ability.addTarget(new TargetOpponent());
|
ability.setTargetAdjuster(KeeperOfTheMindAdjuster.instance);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
originalId = ability.getOriginalId();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability.getOriginalId().equals(originalId)) {
|
|
||||||
Player activePlayer = game.getPlayer(game.getActivePlayerId());
|
|
||||||
if (activePlayer != null) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
TargetPlayer target = new TargetPlayer(1, 1, false, filter);
|
|
||||||
target.setTargetController(activePlayer.getId());
|
|
||||||
ability.getTargets().add(target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public KeeperOfTheMind(final KeeperOfTheMind card) {
|
public KeeperOfTheMind(final KeeperOfTheMind card) {
|
||||||
super(card);
|
super(card);
|
||||||
this.originalId = card.originalId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -104,6 +80,28 @@ public class KeeperOfTheMind extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum KeeperOfTheMindAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
private static final FilterOpponent filter = new FilterOpponent();
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new KeeperOfTheMindPredicate());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
Player activePlayer = game.getPlayer(game.getActivePlayerId());
|
||||||
|
if (activePlayer == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ability.getTargets().clear();
|
||||||
|
TargetPlayer target = new TargetPlayer(1, 1, false, filter);
|
||||||
|
target.setTargetController(activePlayer.getId());
|
||||||
|
ability.addTarget(target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class KeeperOfTheMindPredicate implements ObjectSourcePlayerPredicate<ObjectSourcePlayer<Player>> {
|
class KeeperOfTheMindPredicate implements ObjectSourcePlayerPredicate<ObjectSourcePlayer<Player>> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.k;
|
package mage.cards.k;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
@ -13,21 +11,21 @@ import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.filter.predicate.mageobject.PowerPredicate;
|
import mage.filter.predicate.mageobject.PowerPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class KillingGlare extends CardImpl {
|
public final class KillingGlare extends CardImpl {
|
||||||
|
|
||||||
public KillingGlare (UUID ownerId, CardSetInfo setInfo) {
|
public KillingGlare(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{B}");
|
||||||
|
|
||||||
|
|
||||||
// Destroy target creature with power X or less.
|
// Destroy target creature with power X or less.
|
||||||
this.getSpellAbility().addEffect(new DestroyTargetEffect());
|
this.getSpellAbility().addEffect(new DestroyTargetEffect("destroy target creature with power X or less"));
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature with power X or less")));
|
this.getSpellAbility().setTargetAdjuster(KillingGlareAdjuster.instance);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public KillingGlare(final KillingGlare card) {
|
public KillingGlare(final KillingGlare card) {
|
||||||
|
@ -35,19 +33,20 @@ public final class KillingGlare extends CardImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public KillingGlare copy() {
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
|
||||||
ability.getTargets().clear();
|
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power " + xValue + " or less");
|
|
||||||
filter.add(new PowerPredicate(ComparisonType.FEWER_THAN, xValue + 1));
|
|
||||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public KillingGlare copy() {
|
|
||||||
return new KillingGlare(this);
|
return new KillingGlare(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum KillingGlareAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
int xValue = ability.getManaCostsToPay().getX();
|
||||||
|
ability.getTargets().clear();
|
||||||
|
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power " + xValue + " or less");
|
||||||
|
filter.add(new PowerPredicate(ComparisonType.FEWER_THAN, xValue + 1));
|
||||||
|
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,29 +1,32 @@
|
||||||
|
|
||||||
package mage.cards.k;
|
package mage.cards.k;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility;
|
import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility;
|
||||||
import mage.abilities.effects.common.continuous.AssignNoCombatDamageSourceEffect;
|
import mage.abilities.effects.common.continuous.AssignNoCombatDamageSourceEffect;
|
||||||
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
|
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
|
||||||
import mage.constants.SubType;
|
|
||||||
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.Duration;
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.filter.common.FilterArtifactPermanent;
|
import mage.filter.common.FilterArtifactPermanent;
|
||||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
import mage.filter.predicate.permanent.DefendingPlayerControlsPredicate;
|
||||||
import mage.game.Game;
|
|
||||||
import mage.target.common.TargetArtifactPermanent;
|
import mage.target.common.TargetArtifactPermanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author TheElk801
|
* @author TheElk801
|
||||||
*/
|
*/
|
||||||
public final class KukemssaPirates extends CardImpl {
|
public final class KukemssaPirates extends CardImpl {
|
||||||
|
|
||||||
private final UUID originalId;
|
private static final FilterArtifactPermanent filter = new FilterArtifactPermanent("artifact defending player controls");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new DefendingPlayerControlsPredicate());
|
||||||
|
}
|
||||||
|
|
||||||
public KukemssaPirates(UUID ownerId, CardSetInfo setInfo) {
|
public KukemssaPirates(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}");
|
||||||
|
@ -36,26 +39,12 @@ public final class KukemssaPirates extends CardImpl {
|
||||||
// Whenever Kukemssa Pirates attacks and isn't blocked, you may gain control of target artifact defending player controls. If you do, Kukemssa Pirates assigns no combat damage this turn.
|
// Whenever Kukemssa Pirates attacks and isn't blocked, you may gain control of target artifact defending player controls. If you do, Kukemssa Pirates assigns no combat damage this turn.
|
||||||
Ability ability = new AttacksAndIsNotBlockedTriggeredAbility(new GainControlTargetEffect(Duration.Custom), true);
|
Ability ability = new AttacksAndIsNotBlockedTriggeredAbility(new GainControlTargetEffect(Duration.Custom), true);
|
||||||
ability.addEffect(new AssignNoCombatDamageSourceEffect(Duration.EndOfTurn, true));
|
ability.addEffect(new AssignNoCombatDamageSourceEffect(Duration.EndOfTurn, true));
|
||||||
ability.addTarget(new TargetArtifactPermanent(new FilterArtifactPermanent("artifact defending player controls")));
|
ability.addTarget(new TargetArtifactPermanent(filter));
|
||||||
originalId = ability.getOriginalId();
|
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
public KukemssaPirates(final KukemssaPirates card) {
|
public KukemssaPirates(final KukemssaPirates card) {
|
||||||
super(card);
|
super(card);
|
||||||
this.originalId = card.originalId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability.getOriginalId().equals(originalId)) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
FilterArtifactPermanent filter = new FilterArtifactPermanent("artifact defending player controls");
|
|
||||||
UUID defenderId = game.getCombat().getDefenderId(ability.getSourceId());
|
|
||||||
filter.add(new ControllerIdPredicate(defenderId));
|
|
||||||
TargetArtifactPermanent target = new TargetArtifactPermanent(filter);
|
|
||||||
ability.addTarget(target);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.l;
|
package mage.cards.l;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -21,6 +20,7 @@ import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.command.emblems.LilianaDefiantNecromancerEmblem;
|
import mage.game.command.emblems.LilianaDefiantNecromancerEmblem;
|
||||||
import mage.target.common.TargetCardInYourGraveyard;
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -28,14 +28,12 @@ import mage.target.common.TargetCardInYourGraveyard;
|
||||||
*/
|
*/
|
||||||
public final class LilianaDefiantNecromancer extends CardImpl {
|
public final class LilianaDefiantNecromancer extends CardImpl {
|
||||||
|
|
||||||
private static final FilterCreatureCard filter = new FilterCreatureCard("nonlegendary creature with converted mana cost X from your graveyard");
|
protected static final FilterCreatureCard filter = new FilterCreatureCard("nonlegendary creature with converted mana cost X from your graveyard");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
filter.add(Predicates.not(new SupertypePredicate(SuperType.LEGENDARY)));
|
filter.add(Predicates.not(new SupertypePredicate(SuperType.LEGENDARY)));
|
||||||
}
|
}
|
||||||
|
|
||||||
UUID ability2Id;
|
|
||||||
|
|
||||||
public LilianaDefiantNecromancer(UUID ownerId, CardSetInfo setInfo) {
|
public LilianaDefiantNecromancer(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "");
|
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "");
|
||||||
this.addSuperType(SuperType.LEGENDARY);
|
this.addSuperType(SuperType.LEGENDARY);
|
||||||
|
@ -49,36 +47,18 @@ public final class LilianaDefiantNecromancer extends CardImpl {
|
||||||
// +2: Each player discards a card.
|
// +2: Each player discards a card.
|
||||||
this.addAbility(new LoyaltyAbility(new DiscardEachPlayerEffect(1, false), 2));
|
this.addAbility(new LoyaltyAbility(new DiscardEachPlayerEffect(1, false), 2));
|
||||||
|
|
||||||
//TODO: Make ability properly copiable
|
|
||||||
// -X: Return target nonlegendary creature with converted mana cost X from your graveyard to the battlefield.
|
// -X: Return target nonlegendary creature with converted mana cost X from your graveyard to the battlefield.
|
||||||
Ability ability = new LoyaltyAbility(new ReturnFromGraveyardToBattlefieldTargetEffect());
|
Ability ability = new LoyaltyAbility(new ReturnFromGraveyardToBattlefieldTargetEffect());
|
||||||
ability2Id = ability.getOriginalId();
|
|
||||||
ability.addTarget(new TargetCardInYourGraveyard(filter));
|
ability.addTarget(new TargetCardInYourGraveyard(filter));
|
||||||
|
ability.setTargetAdjuster(LilianaDefiantNecromancerAdjuster.instance);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
//-8: You get an emblem with "Whenever a creature dies, return it to the battlefield under your control at the beginning of the next end step.";
|
//-8: You get an emblem with "Whenever a creature dies, return it to the battlefield under your control at the beginning of the next end step.";
|
||||||
this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new LilianaDefiantNecromancerEmblem()), -8));
|
this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new LilianaDefiantNecromancerEmblem()), -8));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability.getOriginalId().equals(ability2Id)) {
|
|
||||||
int cmc = 0;
|
|
||||||
for (Cost cost : ability.getCosts()) {
|
|
||||||
if (cost instanceof PayVariableLoyaltyCost) {
|
|
||||||
cmc = ((PayVariableLoyaltyCost) cost).getAmount();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FilterCard newFilter = filter.copy();
|
|
||||||
newFilter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, cmc));
|
|
||||||
ability.getTargets().clear();
|
|
||||||
ability.addTarget(new TargetCardInYourGraveyard(newFilter));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public LilianaDefiantNecromancer(final LilianaDefiantNecromancer card) {
|
public LilianaDefiantNecromancer(final LilianaDefiantNecromancer card) {
|
||||||
super(card);
|
super(card);
|
||||||
this.ability2Id = card.ability2Id;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -86,3 +66,21 @@ public final class LilianaDefiantNecromancer extends CardImpl {
|
||||||
return new LilianaDefiantNecromancer(this);
|
return new LilianaDefiantNecromancer(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum LilianaDefiantNecromancerAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
int cmc = 0;
|
||||||
|
for (Cost cost : ability.getCosts()) {
|
||||||
|
if (cost instanceof PayVariableLoyaltyCost) {
|
||||||
|
cmc = ((PayVariableLoyaltyCost) cost).getAmount();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FilterCard newFilter = LilianaDefiantNecromancer.filter.copy();
|
||||||
|
newFilter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, cmc));
|
||||||
|
ability.getTargets().clear();
|
||||||
|
ability.addTarget(new TargetCardInYourGraveyard(newFilter));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.l;
|
package mage.cards.l;
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
|
@ -12,50 +9,38 @@ import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.common.TargetCreaturePermanentAmount;
|
import mage.target.common.TargetCreaturePermanentAmount;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2 & L_J
|
* @author LevelX2 & L_J
|
||||||
*/
|
*/
|
||||||
public final class LivingInferno extends CardImpl {
|
public final class LivingInferno extends CardImpl {
|
||||||
|
|
||||||
private final UUID originalId;
|
|
||||||
|
|
||||||
public LivingInferno(UUID ownerId, CardSetInfo setInfo) {
|
public LivingInferno(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{6}{R}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{6}{R}{R}");
|
||||||
this.subtype.add(SubType.ELEMENTAL);
|
this.subtype.add(SubType.ELEMENTAL);
|
||||||
this.power = new MageInt(8);
|
this.power = new MageInt(8);
|
||||||
this.toughness = new MageInt(5);
|
this.toughness = new MageInt(5);
|
||||||
|
|
||||||
// {T}: Living Inferno deals damage equal to its power divided as you choose among any number of target creatures. Each of those creatures deals damage equal to its power to Living Inferno.
|
// {T}: Living Inferno deals damage equal to its power divided as you choose among any number of target creatures. Each of those creatures deals damage equal to its power to Living Inferno.
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LivingInfernoEffect(), new TapSourceCost());
|
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LivingInfernoEffect(), new TapSourceCost());
|
||||||
ability.addTarget(new TargetCreaturePermanentAmount(1));
|
ability.setTargetAdjuster(LivingInfernoAdjuster.instance);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
originalId = ability.getOriginalId();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if(ability.getOriginalId().equals(originalId)) {
|
|
||||||
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(ability.getSourceId());
|
|
||||||
if (sourcePermanent != null) {
|
|
||||||
int xValue = sourcePermanent.getPower().getValue();
|
|
||||||
ability.getTargets().clear();
|
|
||||||
ability.addTarget(new TargetCreaturePermanentAmount(xValue));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public LivingInferno(final LivingInferno card) {
|
public LivingInferno(final LivingInferno card) {
|
||||||
super(card);
|
super(card);
|
||||||
this.originalId = card.originalId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -64,11 +49,26 @@ public final class LivingInferno extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum LivingInfernoAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(ability.getSourceId());
|
||||||
|
if (sourcePermanent != null) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
ability.addTarget(new TargetCreaturePermanentAmount(sourcePermanent.getPower().getValue()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class LivingInfernoEffect extends OneShotEffect {
|
class LivingInfernoEffect extends OneShotEffect {
|
||||||
|
|
||||||
public LivingInfernoEffect() {
|
public LivingInfernoEffect() {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.Benefit);
|
||||||
this.staticText = "{this} deals damage equal to its power divided as you choose among any number of target creatures. Each of those creatures deals damage equal to its power to {this}";
|
this.staticText = "{this} deals damage equal to its power " +
|
||||||
|
"divided as you choose among any number of target creatures. " +
|
||||||
|
"Each of those creatures deals damage equal to its power to {this}";
|
||||||
}
|
}
|
||||||
|
|
||||||
public LivingInfernoEffect(final LivingInfernoEffect effect) {
|
public LivingInfernoEffect(final LivingInfernoEffect effect) {
|
||||||
|
|
|
@ -29,7 +29,7 @@ import mage.watchers.common.PlayerLostLifeWatcher;
|
||||||
*/
|
*/
|
||||||
public final class LuminarchAscension extends CardImpl {
|
public final class LuminarchAscension extends CardImpl {
|
||||||
|
|
||||||
private String rule = "At the beginning of each opponent's end step, if you didn't lose life this turn, you may put a quest counter on {this}. (Damage causes loss of life.)";
|
private static final String rule = "At the beginning of each opponent's end step, if you didn't lose life this turn, you may put a quest counter on {this}. (Damage causes loss of life.)";
|
||||||
|
|
||||||
public LuminarchAscension(UUID ownerId, CardSetInfo setInfo) {
|
public LuminarchAscension(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}");
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.l;
|
package mage.cards.l;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
|
@ -10,8 +9,8 @@ import mage.abilities.keyword.VigilanceAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
@ -19,15 +18,17 @@ import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class LuminatePrimordial extends CardImpl {
|
public final class LuminatePrimordial extends CardImpl {
|
||||||
|
|
||||||
public LuminatePrimordial(UUID ownerId, CardSetInfo setInfo) {
|
public LuminatePrimordial(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{W}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{W}{W}");
|
||||||
this.subtype.add(SubType.AVATAR);
|
this.subtype.add(SubType.AVATAR);
|
||||||
|
|
||||||
this.power = new MageInt(4);
|
this.power = new MageInt(4);
|
||||||
|
@ -38,23 +39,9 @@ public final class LuminatePrimordial extends CardImpl {
|
||||||
|
|
||||||
// When Luminate Primordial enters the battlefield, for each opponent, exile up to one target creature
|
// When Luminate Primordial enters the battlefield, for each opponent, exile up to one target creature
|
||||||
// that player controls and that player gains life equal to its power.
|
// that player controls and that player gains life equal to its power.
|
||||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new LuminatePrimordialEffect(),false));
|
Ability ability = new EntersBattlefieldTriggeredAbility(new LuminatePrimordialEffect(), false);
|
||||||
}
|
ability.setTargetAdjuster(LuminatePrimordialAdjuster.instance);
|
||||||
|
this.addAbility(ability);
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof EntersBattlefieldTriggeredAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
for(UUID opponentId : game.getOpponents(ability.getControllerId())) {
|
|
||||||
Player opponent = game.getPlayer(opponentId);
|
|
||||||
if (opponent != null) {
|
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature from opponent " + opponent.getLogName());
|
|
||||||
filter.add(new ControllerIdPredicate(opponentId));
|
|
||||||
TargetCreaturePermanent target = new TargetCreaturePermanent(0,1, filter,false);
|
|
||||||
ability.addTarget(target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public LuminatePrimordial(final LuminatePrimordial card) {
|
public LuminatePrimordial(final LuminatePrimordial card) {
|
||||||
|
@ -67,6 +54,24 @@ public final class LuminatePrimordial extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum LuminatePrimordialAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
for (UUID opponentId : game.getOpponents(ability.getControllerId())) {
|
||||||
|
Player opponent = game.getPlayer(opponentId);
|
||||||
|
if (opponent != null) {
|
||||||
|
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature from opponent " + opponent.getLogName());
|
||||||
|
filter.add(new ControllerIdPredicate(opponentId));
|
||||||
|
TargetCreaturePermanent target = new TargetCreaturePermanent(0, 1, filter, false);
|
||||||
|
ability.addTarget(target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class LuminatePrimordialEffect extends OneShotEffect {
|
class LuminatePrimordialEffect extends OneShotEffect {
|
||||||
|
|
||||||
public LuminatePrimordialEffect() {
|
public LuminatePrimordialEffect() {
|
||||||
|
@ -85,7 +90,7 @@ class LuminatePrimordialEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
for (Target target: source.getTargets()) {
|
for (Target target : source.getTargets()) {
|
||||||
if (target instanceof TargetCreaturePermanent) {
|
if (target instanceof TargetCreaturePermanent) {
|
||||||
Permanent targetCreature = game.getPermanent(target.getFirstTarget());
|
Permanent targetCreature = game.getPermanent(target.getFirstTarget());
|
||||||
if (targetCreature != null && !targetCreature.isControlledBy(source.getControllerId())) {
|
if (targetCreature != null && !targetCreature.isControlledBy(source.getControllerId())) {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.condition.common.KickedCondition;
|
import mage.abilities.condition.common.KickedCondition;
|
||||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||||
|
@ -13,18 +12,17 @@ import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.filter.common.FilterControlledLandPermanent;
|
import mage.filter.common.FilterControlledLandPermanent;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetControlledPermanent;
|
|
||||||
import mage.target.common.TargetAnyTarget;
|
import mage.target.common.TargetAnyTarget;
|
||||||
|
import mage.target.common.TargetControlledPermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LoneFox
|
* @author LoneFox
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public final class MagmaBurst extends CardImpl {
|
public final class MagmaBurst extends CardImpl {
|
||||||
|
|
||||||
private final UUID originalId;
|
|
||||||
|
|
||||||
public MagmaBurst(UUID ownerId, CardSetInfo setInfo) {
|
public MagmaBurst(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{R}");
|
||||||
|
|
||||||
|
@ -32,21 +30,13 @@ public final class MagmaBurst extends CardImpl {
|
||||||
this.addAbility(new KickerAbility(new SacrificeTargetCost(new TargetControlledPermanent(2, 2, new FilterControlledLandPermanent("two lands"), true))));
|
this.addAbility(new KickerAbility(new SacrificeTargetCost(new TargetControlledPermanent(2, 2, new FilterControlledLandPermanent("two lands"), true))));
|
||||||
// Magma Burst deals 3 damage to any target. If Magma Burst was kicked, it deals 3 damage to another any target.
|
// Magma Burst deals 3 damage to any target. If Magma Burst was kicked, it deals 3 damage to another any target.
|
||||||
Effect effect = new DamageTargetEffect(3);
|
Effect effect = new DamageTargetEffect(3);
|
||||||
effect.setText("{this} deals 3 damage to any target. if this spell was kicked, it deals 3 damage to another target.");
|
effect.setText("{this} deals 3 damage to any target. If this spell was kicked, it deals 3 damage to another target.");
|
||||||
this.getSpellAbility().addEffect(effect);
|
this.getSpellAbility().addEffect(effect);
|
||||||
originalId = this.getSpellAbility().getOriginalId();
|
this.getSpellAbility().setTargetAdjuster(MagmaBurstAdjuster.instance);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability.getOriginalId().equals(originalId)) {
|
|
||||||
ability.addTarget(new TargetAnyTarget(KickedCondition.instance.apply(game, ability) ? 2 : 1));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MagmaBurst(final MagmaBurst card) {
|
public MagmaBurst(final MagmaBurst card) {
|
||||||
super(card);
|
super(card);
|
||||||
this.originalId = card.originalId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -54,3 +44,12 @@ public final class MagmaBurst extends CardImpl {
|
||||||
return new MagmaBurst(this);
|
return new MagmaBurst(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum MagmaBurstAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.addTarget(new TargetAnyTarget(KickedCondition.instance.apply(game, ability) ? 2 : 1));
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,9 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
|
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
|
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
|
||||||
|
@ -16,38 +14,24 @@ import mage.filter.predicate.Predicates;
|
||||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LoneFox
|
* @author LoneFox
|
||||||
*/
|
*/
|
||||||
public final class MaliciousAdvice extends CardImpl {
|
public final class MaliciousAdvice extends CardImpl {
|
||||||
|
|
||||||
private static final FilterPermanent filter = new FilterPermanent("artifacts, creatures, and/or lands");
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(Predicates.or(
|
|
||||||
new CardTypePredicate(CardType.ARTIFACT),
|
|
||||||
new CardTypePredicate(CardType.CREATURE),
|
|
||||||
new CardTypePredicate(CardType.LAND)));
|
|
||||||
}
|
|
||||||
|
|
||||||
public MaliciousAdvice(UUID ownerId, CardSetInfo setInfo) {
|
public MaliciousAdvice(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{U}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{U}{B}");
|
||||||
|
|
||||||
// Tap X target artifacts, creatures, and/or lands. You lose X life.
|
// Tap X target artifacts, creatures, and/or lands. You lose X life.
|
||||||
Effect effect = new TapTargetEffect();
|
Effect effect = new TapTargetEffect();
|
||||||
effect.setText("X target artifacts, creatures, and/or lands");
|
effect.setText("X target artifacts, creatures, and/or lands.");
|
||||||
this.getSpellAbility().addEffect(effect);
|
this.getSpellAbility().addEffect(effect);
|
||||||
this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(new ManacostVariableValue()));
|
this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(new ManacostVariableValue()));
|
||||||
}
|
this.getSpellAbility().setTargetAdjuster(MaliciousAdviceAdjuster.instance);
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
ability.addTarget(new TargetPermanent(ability.getManaCostsToPay().getX(), filter));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MaliciousAdvice(final MaliciousAdvice card) {
|
public MaliciousAdvice(final MaliciousAdvice card) {
|
||||||
|
@ -59,3 +43,22 @@ public final class MaliciousAdvice extends CardImpl {
|
||||||
return new MaliciousAdvice(this);
|
return new MaliciousAdvice(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum MaliciousAdviceAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
private static final FilterPermanent filter = new FilterPermanent("artifacts, creatures, and/or lands");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(Predicates.or(
|
||||||
|
new CardTypePredicate(CardType.ARTIFACT),
|
||||||
|
new CardTypePredicate(CardType.CREATURE),
|
||||||
|
new CardTypePredicate(CardType.LAND)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
ability.addTarget(new TargetPermanent(ability.getManaCostsToPay().getX(), filter));
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,80 +1,55 @@
|
||||||
|
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.condition.common.KickedCondition;
|
|
||||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
|
||||||
import mage.abilities.dynamicvalue.common.MultikickerCount;
|
import mage.abilities.dynamicvalue.common.MultikickerCount;
|
||||||
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
|
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
|
||||||
import mage.abilities.effects.common.continuous.BoostAllEffect;
|
import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
||||||
import mage.abilities.keyword.MultikickerAbility;
|
import mage.abilities.keyword.MultikickerAbility;
|
||||||
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.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.TargetController;
|
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.FilterCard;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreatureCard;
|
||||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
|
||||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetCardInYourGraveyard;
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author jeffwadsworth
|
* @author jeffwadsworth
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public final class MarshalsAnthem extends CardImpl {
|
public final class MarshalsAnthem extends CardImpl {
|
||||||
|
|
||||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures you control");
|
private static final String rule = "return up to X target creature cards from your graveyard to the battlefield, " +
|
||||||
private static final FilterCard filterCard = new FilterCard("creature card in your graveyard");
|
"where X is the number of times {this} was kicked";
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(new ControllerPredicate(TargetController.YOU));
|
|
||||||
filterCard.add(new CardTypePredicate(CardType.CREATURE));
|
|
||||||
}
|
|
||||||
|
|
||||||
private final UUID originalId;
|
|
||||||
|
|
||||||
public MarshalsAnthem(UUID ownerId, CardSetInfo setInfo) {
|
public MarshalsAnthem(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{W}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}");
|
||||||
|
|
||||||
// Multikicker {1}{W}
|
// Multikicker {1}{W}
|
||||||
this.addAbility(new MultikickerAbility("{1}{W}"));
|
this.addAbility(new MultikickerAbility("{1}{W}"));
|
||||||
|
|
||||||
// Creatures you control get +1/+1.
|
// Creatures you control get +1/+1.
|
||||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, false)));
|
this.addAbility(new SimpleStaticAbility(
|
||||||
|
Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield)
|
||||||
|
));
|
||||||
|
|
||||||
// When Marshal's Anthem enters the battlefield, return up to X target creature cards from your graveyard to the battlefield, where X is the number of times Marshal's Anthem was kicked.
|
// When Marshal's Anthem enters the battlefield, return up to X target creature cards from your graveyard to the battlefield, where X is the number of times Marshal's Anthem was kicked.
|
||||||
//TODO this should always trigger, even if it wasn't kicked
|
Ability ability = new EntersBattlefieldTriggeredAbility(
|
||||||
Ability ability = new ConditionalInterveningIfTriggeredAbility(
|
new ReturnFromGraveyardToBattlefieldTargetEffect().setText(rule), false
|
||||||
new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToBattlefieldTargetEffect(), false),
|
);
|
||||||
KickedCondition.instance,
|
ability.setTargetAdjuster(MarshalsAnthemAdjuster.instance);
|
||||||
"When {this} enters the battlefield, return up to X target creature cards from your graveyard to the battlefield, where X is the number of times {this} was kicked.");
|
|
||||||
originalId = ability.getOriginalId();
|
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability.getOriginalId().equals(originalId)) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
int numbTargets = new MultikickerCount().calculate(game, ability, null);
|
|
||||||
if (numbTargets > 0) {
|
|
||||||
ability.addTarget(new TargetCardInYourGraveyard(0, numbTargets, filterCard));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MarshalsAnthem(final MarshalsAnthem card) {
|
public MarshalsAnthem(final MarshalsAnthem card) {
|
||||||
super(card);
|
super(card);
|
||||||
this.originalId = card.originalId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -82,3 +57,17 @@ public final class MarshalsAnthem extends CardImpl {
|
||||||
return new MarshalsAnthem(this);
|
return new MarshalsAnthem(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum MarshalsAnthemAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
private static final FilterCard filter = new FilterCreatureCard("creature card in your graveyard");
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
int numbTargets = new MultikickerCount().calculate(game, ability, null);
|
||||||
|
if (numbTargets > 0) {
|
||||||
|
ability.addTarget(new TargetCardInYourGraveyard(0, numbTargets, filter));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
@ -25,17 +24,17 @@ import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.common.TargetCardInASingleGraveyard;
|
import mage.target.common.TargetCardInASingleGraveyard;
|
||||||
import mage.target.common.TargetCardInHand;
|
import mage.target.common.TargetCardInHand;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author emerald000
|
* @author emerald000
|
||||||
*/
|
*/
|
||||||
public final class MartyrOfBones extends CardImpl {
|
public final class MartyrOfBones extends CardImpl {
|
||||||
|
|
||||||
private final UUID originalId;
|
|
||||||
|
|
||||||
public MartyrOfBones(UUID ownerId, CardSetInfo setInfo) {
|
public MartyrOfBones(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}");
|
||||||
this.subtype.add(SubType.HUMAN);
|
this.subtype.add(SubType.HUMAN);
|
||||||
this.subtype.add(SubType.WIZARD);
|
this.subtype.add(SubType.WIZARD);
|
||||||
|
|
||||||
|
@ -49,27 +48,12 @@ public final class MartyrOfBones extends CardImpl {
|
||||||
ability.addCost(new RevealVariableBlackCardsFromHandCost());
|
ability.addCost(new RevealVariableBlackCardsFromHandCost());
|
||||||
ability.addCost(new SacrificeSourceCost());
|
ability.addCost(new SacrificeSourceCost());
|
||||||
ability.addTarget(new TargetCardInASingleGraveyard(0, 1, new FilterCard("cards in a single graveyard")));
|
ability.addTarget(new TargetCardInASingleGraveyard(0, 1, new FilterCard("cards in a single graveyard")));
|
||||||
originalId = ability.getOriginalId();
|
ability.setTargetAdjuster(MartyrOfBonesAdjuster.instance);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MartyrOfBones(final MartyrOfBones card) {
|
public MartyrOfBones(final MartyrOfBones card) {
|
||||||
super(card);
|
super(card);
|
||||||
this.originalId = card.originalId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability.getOriginalId().equals(originalId)) {
|
|
||||||
int amount = 0;
|
|
||||||
for (Cost cost : ability.getCosts()) {
|
|
||||||
if (cost instanceof RevealVariableBlackCardsFromHandCost) {
|
|
||||||
amount = ((VariableCost) cost).getAmount();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ability.getTargets().clear();
|
|
||||||
ability.addTarget(new TargetCardInASingleGraveyard(0, amount, new FilterCard()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -78,6 +62,22 @@ public final class MartyrOfBones extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum MartyrOfBonesAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
int amount = 0;
|
||||||
|
for (Cost cost : ability.getCosts()) {
|
||||||
|
if (cost instanceof RevealVariableBlackCardsFromHandCost) {
|
||||||
|
amount = ((VariableCost) cost).getAmount();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ability.getTargets().clear();
|
||||||
|
ability.addTarget(new TargetCardInASingleGraveyard(0, amount, new FilterCard()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class RevealVariableBlackCardsFromHandCost extends VariableCostImpl {
|
class RevealVariableBlackCardsFromHandCost extends VariableCostImpl {
|
||||||
|
|
||||||
private static final FilterCard filter = new FilterCard("X black cards from your hand");
|
private static final FilterCard filter = new FilterCard("X black cards from your hand");
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.effects.ContinuousEffect;
|
import mage.abilities.effects.ContinuousEffect;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||||
|
@ -21,6 +19,7 @@ import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -34,22 +33,7 @@ public final class MassMutiny extends CardImpl {
|
||||||
|
|
||||||
// For each opponent, gain control of up to one target creature that player controls until end of turn. Untap those creatures. They gain haste until end of turn.
|
// For each opponent, gain control of up to one target creature that player controls until end of turn. Untap those creatures. They gain haste until end of turn.
|
||||||
this.getSpellAbility().addEffect(new MassMutinyEffect());
|
this.getSpellAbility().addEffect(new MassMutinyEffect());
|
||||||
}
|
this.getSpellAbility().setTargetAdjuster(MassMutinyAdjuster.instance);
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
for (UUID opponentId : game.getOpponents(ability.getControllerId())) {
|
|
||||||
Player opponent = game.getPlayer(opponentId);
|
|
||||||
if (opponent != null) {
|
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature from opponent " + opponent.getName());
|
|
||||||
filter.add(new ControllerIdPredicate(opponentId));
|
|
||||||
TargetCreaturePermanent target = new TargetCreaturePermanent(0, 1, filter, false);
|
|
||||||
ability.addTarget(target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MassMutiny(final MassMutiny card) {
|
public MassMutiny(final MassMutiny card) {
|
||||||
|
@ -62,6 +46,24 @@ public final class MassMutiny extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum MassMutinyAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
for (UUID opponentId : game.getOpponents(ability.getControllerId())) {
|
||||||
|
Player opponent = game.getPlayer(opponentId);
|
||||||
|
if (opponent != null) {
|
||||||
|
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature from opponent " + opponent.getName());
|
||||||
|
filter.add(new ControllerIdPredicate(opponentId));
|
||||||
|
TargetCreaturePermanent target = new TargetCreaturePermanent(0, 1, filter, false);
|
||||||
|
ability.addTarget(target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class MassMutinyEffect extends OneShotEffect {
|
class MassMutinyEffect extends OneShotEffect {
|
||||||
|
|
||||||
public MassMutinyEffect() {
|
public MassMutinyEffect() {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
@ -20,14 +19,13 @@ import mage.filter.FilterSpell;
|
||||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||||
import mage.target.TargetPlayer;
|
import mage.target.TargetPlayer;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author jeffwadsworth
|
* @author jeffwadsworth
|
||||||
*/
|
*/
|
||||||
public final class MerrowBonegnawer extends CardImpl {
|
public final class MerrowBonegnawer extends CardImpl {
|
||||||
|
|
||||||
private UUID exileId = UUID.randomUUID();
|
|
||||||
|
|
||||||
private static final FilterSpell filter = new FilterSpell("a black spell");
|
private static final FilterSpell filter = new FilterSpell("a black spell");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
@ -43,7 +41,7 @@ public final class MerrowBonegnawer extends CardImpl {
|
||||||
this.toughness = new MageInt(1);
|
this.toughness = new MageInt(1);
|
||||||
|
|
||||||
// {tap}: Target player exiles a card from their graveyard.
|
// {tap}: Target player exiles a card from their graveyard.
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileFromZoneTargetEffect(Zone.GRAVEYARD, exileId, getIdName(), new FilterCard()), new TapSourceCost());
|
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileFromZoneTargetEffect(Zone.GRAVEYARD, null, getIdName(), new FilterCard()), new TapSourceCost());
|
||||||
ability.addTarget(new TargetPlayer());
|
ability.addTarget(new TargetPlayer());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -13,6 +12,7 @@ import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.common.TargetAnyTarget;
|
import mage.target.common.TargetAnyTarget;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -21,7 +21,7 @@ import mage.target.common.TargetAnyTarget;
|
||||||
public final class MeteorBlast extends CardImpl {
|
public final class MeteorBlast extends CardImpl {
|
||||||
|
|
||||||
public MeteorBlast(UUID ownerId, CardSetInfo setInfo) {
|
public MeteorBlast(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{R}{R}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{R}{R}{R}");
|
||||||
|
|
||||||
// Meteor Blast deals 4 damage to each of X target creatures and/or players.
|
// Meteor Blast deals 4 damage to each of X target creatures and/or players.
|
||||||
this.getSpellAbility().addEffect(new MeteorBlastEffect());
|
this.getSpellAbility().addEffect(new MeteorBlastEffect());
|
||||||
|
@ -31,6 +31,15 @@ public final class MeteorBlast extends CardImpl {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MeteorBlast copy() {
|
||||||
|
return new MeteorBlast(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum MeteorBlastAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
int xValue = ability.getManaCostsToPay().getX();
|
||||||
|
@ -39,11 +48,6 @@ public final class MeteorBlast extends CardImpl {
|
||||||
ability.addTarget(target);
|
ability.addTarget(target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public MeteorBlast copy() {
|
|
||||||
return new MeteorBlast(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class MeteorBlastEffect extends OneShotEffect {
|
class MeteorBlastEffect extends OneShotEffect {
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
@ -17,9 +15,11 @@ import mage.game.Game;
|
||||||
import mage.game.permanent.token.ZombieToken;
|
import mage.game.permanent.token.ZombieToken;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.common.TargetCardInYourGraveyard;
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Skyler Sell
|
* @author Skyler Sell
|
||||||
*/
|
*/
|
||||||
public final class MidnightRitual extends CardImpl {
|
public final class MidnightRitual extends CardImpl {
|
||||||
|
@ -31,14 +31,7 @@ public final class MidnightRitual extends CardImpl {
|
||||||
// For each creature card exiled this way, create a 2/2 black Zombie creature token.
|
// For each creature card exiled this way, create a 2/2 black Zombie creature token.
|
||||||
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD));
|
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD));
|
||||||
this.getSpellAbility().addEffect(new MidnightRitualEffect());
|
this.getSpellAbility().addEffect(new MidnightRitualEffect());
|
||||||
}
|
this.getSpellAbility().setTargetAdjuster(MidnightRitualAdjuster.instance);
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
ability.addTarget(new TargetCardInYourGraveyard(ability.getManaCostsToPay().getX(), StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MidnightRitual(final MidnightRitual card) {
|
public MidnightRitual(final MidnightRitual card) {
|
||||||
|
@ -51,6 +44,16 @@ public final class MidnightRitual extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum MidnightRitualAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
ability.addTarget(new TargetCardInYourGraveyard(ability.getManaCostsToPay().getX(), StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class MidnightRitualEffect extends OneShotEffect {
|
class MidnightRitualEffect extends OneShotEffect {
|
||||||
|
|
||||||
public MidnightRitualEffect() {
|
public MidnightRitualEffect() {
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
|
@ -11,8 +10,8 @@ import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
|
@ -20,59 +19,36 @@ import mage.players.Player;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
import mage.target.common.TargetOpponentsCreaturePermanent;
|
import mage.target.common.TargetOpponentsCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author L_J
|
* @author L_J
|
||||||
*/
|
*/
|
||||||
public final class MoggAssassin extends CardImpl {
|
public final class MoggAssassin extends CardImpl {
|
||||||
|
|
||||||
private final UUID originalId;
|
|
||||||
|
|
||||||
public MoggAssassin(UUID ownerId, CardSetInfo setInfo) {
|
public MoggAssassin(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}");
|
||||||
this.subtype.add(SubType.GOBLIN);
|
this.subtype.add(SubType.GOBLIN);
|
||||||
this.subtype.add(SubType.ASSASSIN);
|
this.subtype.add(SubType.ASSASSIN);
|
||||||
this.power = new MageInt(2);
|
this.power = new MageInt(2);
|
||||||
this.toughness = new MageInt(1);
|
this.toughness = new MageInt(1);
|
||||||
|
|
||||||
//TODO: Make ability properly copiable
|
|
||||||
// {T}: You choose target creature an opponent controls, and that opponent chooses target creature. Flip a coin. If you win the flip, destroy the creature you chose. If you lose the flip, destroy the creature your opponent chose.
|
// {T}: You choose target creature an opponent controls, and that opponent chooses target creature. Flip a coin. If you win the flip, destroy the creature you chose. If you lose the flip, destroy the creature your opponent chose.
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MoggAssassinEffect(), new TapSourceCost());
|
Ability ability = new SimpleActivatedAbility(
|
||||||
|
Zone.BATTLEFIELD,
|
||||||
|
new MoggAssassinEffect(),
|
||||||
|
new TapSourceCost()
|
||||||
|
);
|
||||||
ability.addTarget(new TargetOpponentsCreaturePermanent());
|
ability.addTarget(new TargetOpponentsCreaturePermanent());
|
||||||
ability.addTarget(new TargetCreaturePermanent());
|
ability.addTarget(new TargetCreaturePermanent());
|
||||||
|
ability.setTargetAdjuster(MoggAssassinAdjuster.instance);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
originalId = ability.getOriginalId();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability.getOriginalId().equals(originalId)) {
|
|
||||||
Player controller = game.getPlayer(ability.getControllerId());
|
|
||||||
if (controller != null) {
|
|
||||||
UUID opponentId = null;
|
|
||||||
if (game.getOpponents(controller.getId()).size() > 1) {
|
|
||||||
Target target = ability.getTargets().get(0);
|
|
||||||
if (controller.chooseTarget(Outcome.DestroyPermanent, target, ability, game)) {
|
|
||||||
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
|
||||||
opponentId = permanent.getControllerId();
|
|
||||||
} else {
|
|
||||||
opponentId = game.getOpponents(controller.getId()).iterator().next();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
opponentId = game.getOpponents(controller.getId()).iterator().next();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (opponentId != null) {
|
|
||||||
ability.getTargets().get(1).setTargetController(opponentId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MoggAssassin(final MoggAssassin card) {
|
public MoggAssassin(final MoggAssassin card) {
|
||||||
super(card);
|
super(card);
|
||||||
this.originalId = card.originalId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -82,6 +58,34 @@ public final class MoggAssassin extends CardImpl {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum MoggAssassinAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
Player controller = game.getPlayer(ability.getControllerId());
|
||||||
|
if (controller == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
UUID opponentId = null;
|
||||||
|
if (game.getOpponents(controller.getId()).size() > 1) {
|
||||||
|
Target target = ability.getTargets().get(0);
|
||||||
|
if (controller.chooseTarget(Outcome.DestroyPermanent, target, ability, game)) {
|
||||||
|
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
||||||
|
opponentId = permanent.getControllerId();
|
||||||
|
} else {
|
||||||
|
opponentId = game.getOpponents(controller.getId()).iterator().next();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
opponentId = game.getOpponents(controller.getId()).iterator().next();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (opponentId != null) {
|
||||||
|
ability.getTargets().get(1).setTargetController(opponentId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class MoggAssassinEffect extends OneShotEffect {
|
class MoggAssassinEffect extends OneShotEffect {
|
||||||
|
|
||||||
public MoggAssassinEffect() {
|
public MoggAssassinEffect() {
|
||||||
|
@ -100,21 +104,21 @@ class MoggAssassinEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (controller != null) {
|
if (controller == null) {
|
||||||
Permanent chosenPermanent = game.getPermanent(source.getTargets().get(0).getFirstTarget());
|
return false;
|
||||||
Permanent opponentsPermanent = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
}
|
||||||
if (controller.flipCoin(game)) {
|
Permanent chosenPermanent = game.getPermanent(source.getTargets().get(0).getFirstTarget());
|
||||||
if (chosenPermanent != null) {
|
Permanent opponentsPermanent = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
||||||
chosenPermanent.destroy(source.getSourceId(), game, false);
|
if (controller.flipCoin(game)) {
|
||||||
return true;
|
if (chosenPermanent != null) {
|
||||||
}
|
chosenPermanent.destroy(source.getSourceId(), game, false);
|
||||||
} else {
|
return true;
|
||||||
if (opponentsPermanent != null) {
|
}
|
||||||
opponentsPermanent.destroy(source.getSourceId(), game, false);
|
} else {
|
||||||
return true;
|
if (opponentsPermanent != null) {
|
||||||
}
|
opponentsPermanent.destroy(source.getSourceId(), game, false);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
|
@ -12,20 +11,22 @@ import mage.abilities.keyword.IntimidateAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.ColoredManaSymbol;
|
import mage.constants.ColoredManaSymbol;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class MogissMarauder extends CardImpl {
|
public final class MogissMarauder extends CardImpl {
|
||||||
|
|
||||||
public MogissMarauder(UUID ownerId, CardSetInfo setInfo) {
|
public MogissMarauder(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}");
|
||||||
this.subtype.add(SubType.HUMAN);
|
this.subtype.add(SubType.HUMAN);
|
||||||
this.subtype.add(SubType.BERSERKER);
|
this.subtype.add(SubType.BERSERKER);
|
||||||
|
|
||||||
|
@ -35,24 +36,13 @@ public final class MogissMarauder extends CardImpl {
|
||||||
// When Mogis's Marauder enters the battlefield, up to X target creatures each gain intimidate and haste, where X is your devotion to black.
|
// When Mogis's Marauder enters the battlefield, up to X target creatures each gain intimidate and haste, where X is your devotion to black.
|
||||||
Ability ability = new EntersBattlefieldTriggeredAbility(
|
Ability ability = new EntersBattlefieldTriggeredAbility(
|
||||||
new GainAbilityTargetEffect(IntimidateAbility.getInstance(), Duration.EndOfTurn,
|
new GainAbilityTargetEffect(IntimidateAbility.getInstance(), Duration.EndOfTurn,
|
||||||
"up to X target creatures each gain intimidate"), false);
|
"up to X target creatures each gain intimidate"), false);
|
||||||
ability.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn,
|
ability.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn,
|
||||||
"and haste until end of turn, where X is your devotion to black"));
|
"and haste until end of turn, where X is your devotion to black"));
|
||||||
ability.addTarget(new TargetCreaturePermanent());
|
ability.setTargetAdjuster(MogissMarauderAdjuster.instance);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof EntersBattlefieldTriggeredAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
int numbTargets = new DevotionCount(ColoredManaSymbol.B).calculate(game, ability, null);
|
|
||||||
if (numbTargets > 0) {
|
|
||||||
ability.addTarget(new TargetCreaturePermanent(0,numbTargets));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public MogissMarauder(final MogissMarauder card) {
|
public MogissMarauder(final MogissMarauder card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
@ -62,3 +52,16 @@ public final class MogissMarauder extends CardImpl {
|
||||||
return new MogissMarauder(this);
|
return new MogissMarauder(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum MogissMarauderAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
int numbTargets = new DevotionCount(ColoredManaSymbol.B).calculate(game, ability, null);
|
||||||
|
if (numbTargets > 0) {
|
||||||
|
ability.addTarget(new TargetCreaturePermanent(0, numbTargets));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,9 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
|
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
|
||||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||||
import mage.abilities.effects.common.GainLifeEffect;
|
import mage.abilities.effects.common.GainLifeEffect;
|
||||||
|
@ -11,13 +9,16 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.ComparisonType;
|
import mage.constants.ComparisonType;
|
||||||
|
import mage.filter.FilterPermanent;
|
||||||
import mage.filter.common.FilterArtifactOrEnchantmentPermanent;
|
import mage.filter.common.FilterArtifactOrEnchantmentPermanent;
|
||||||
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
|
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LoneFox
|
* @author LoneFox
|
||||||
*/
|
*/
|
||||||
public final class Molder extends CardImpl {
|
public final class Molder extends CardImpl {
|
||||||
|
@ -26,20 +27,9 @@ public final class Molder extends CardImpl {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{G}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{G}");
|
||||||
|
|
||||||
// Destroy target artifact or enchantment with converted mana cost X. It can't be regenerated. You gain X life.
|
// Destroy target artifact or enchantment with converted mana cost X. It can't be regenerated. You gain X life.
|
||||||
this.getSpellAbility().addEffect(new DestroyTargetEffect(true));
|
this.getSpellAbility().addEffect(new DestroyTargetEffect("Destroy target artifact or enchantment with converted mana cost X.", true));
|
||||||
this.getSpellAbility().addTarget(new TargetPermanent(new FilterArtifactOrEnchantmentPermanent("artifact or enchantment with converted mana cost X")));
|
|
||||||
this.getSpellAbility().addEffect(new GainLifeEffect(new ManacostVariableValue()));
|
this.getSpellAbility().addEffect(new GainLifeEffect(new ManacostVariableValue()));
|
||||||
}
|
this.getSpellAbility().setTargetAdjuster(MolderAdjuster.instance);
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
|
||||||
FilterArtifactOrEnchantmentPermanent filter = new FilterArtifactOrEnchantmentPermanent("artifact or enchantment with converted mana cost X");
|
|
||||||
filter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue));
|
|
||||||
ability.addTarget(new TargetPermanent(filter));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Molder(final Molder card) {
|
public Molder(final Molder card) {
|
||||||
|
@ -51,3 +41,16 @@ public final class Molder extends CardImpl {
|
||||||
return new Molder(this);
|
return new Molder(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum MolderAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
int xValue = ability.getManaCostsToPay().getX();
|
||||||
|
FilterPermanent filter = new FilterArtifactOrEnchantmentPermanent("artifact or enchantment with converted mana cost " + xValue);
|
||||||
|
filter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue));
|
||||||
|
ability.addTarget(new TargetPermanent(filter));
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
|
@ -13,9 +12,9 @@ import mage.abilities.keyword.HasteAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
@ -23,16 +22,18 @@ import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class MoltenPrimordial extends CardImpl {
|
public final class MoltenPrimordial extends CardImpl {
|
||||||
|
|
||||||
public MoltenPrimordial(UUID ownerId, CardSetInfo setInfo) {
|
public MoltenPrimordial(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{R}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{R}{R}");
|
||||||
this.subtype.add(SubType.AVATAR);
|
this.subtype.add(SubType.AVATAR);
|
||||||
|
|
||||||
this.power = new MageInt(6);
|
this.power = new MageInt(6);
|
||||||
|
@ -42,23 +43,9 @@ public final class MoltenPrimordial extends CardImpl {
|
||||||
this.addAbility(HasteAbility.getInstance());
|
this.addAbility(HasteAbility.getInstance());
|
||||||
|
|
||||||
// When Molten Primordial enters the battlefield, for each opponent, take control of up to one target creature that player controls until end of turn. Untap those creatures. They have haste until end of turn.
|
// When Molten Primordial enters the battlefield, for each opponent, take control of up to one target creature that player controls until end of turn. Untap those creatures. They have haste until end of turn.
|
||||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new MoltenPrimordialEffect(),false));
|
Ability ability = new EntersBattlefieldTriggeredAbility(new MoltenPrimordialEffect(), false);
|
||||||
}
|
ability.setTargetAdjuster(MoltenPrimordialAdjuster.instance);
|
||||||
|
this.addAbility(ability);
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof EntersBattlefieldTriggeredAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
for(UUID opponentId : game.getOpponents(ability.getControllerId())) {
|
|
||||||
Player opponent = game.getPlayer(opponentId);
|
|
||||||
if (opponent != null) {
|
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature from opponent " + opponent.getLogName());
|
|
||||||
filter.add(new ControllerIdPredicate(opponentId));
|
|
||||||
TargetCreaturePermanent target = new TargetCreaturePermanent(0,1, filter,false);
|
|
||||||
ability.addTarget(target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MoltenPrimordial(final MoltenPrimordial card) {
|
public MoltenPrimordial(final MoltenPrimordial card) {
|
||||||
|
@ -71,6 +58,24 @@ public final class MoltenPrimordial extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum MoltenPrimordialAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
for (UUID opponentId : game.getOpponents(ability.getControllerId())) {
|
||||||
|
Player opponent = game.getPlayer(opponentId);
|
||||||
|
if (opponent != null) {
|
||||||
|
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature from opponent " + opponent.getLogName());
|
||||||
|
filter.add(new ControllerIdPredicate(opponentId));
|
||||||
|
TargetCreaturePermanent target = new TargetCreaturePermanent(0, 1, filter, false);
|
||||||
|
ability.addTarget(target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class MoltenPrimordialEffect extends OneShotEffect {
|
class MoltenPrimordialEffect extends OneShotEffect {
|
||||||
|
|
||||||
public MoltenPrimordialEffect() {
|
public MoltenPrimordialEffect() {
|
||||||
|
@ -90,7 +95,7 @@ class MoltenPrimordialEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
for (Target target: source.getTargets()) {
|
for (Target target : source.getTargets()) {
|
||||||
if (target instanceof TargetCreaturePermanent) {
|
if (target instanceof TargetCreaturePermanent) {
|
||||||
Permanent targetCreature = game.getPermanent(target.getFirstTarget());
|
Permanent targetCreature = game.getPermanent(target.getFirstTarget());
|
||||||
if (targetCreature != null) {
|
if (targetCreature != null) {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.n;
|
package mage.cards.n;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.costs.Cost;
|
import mage.abilities.costs.Cost;
|
||||||
import mage.abilities.costs.VariableCost;
|
import mage.abilities.costs.VariableCost;
|
||||||
|
@ -19,15 +18,17 @@ import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.common.TargetCardInHand;
|
import mage.target.common.TargetCardInHand;
|
||||||
import mage.target.common.TargetCreatureOrPlaneswalker;
|
import mage.target.common.TargetCreatureOrPlaneswalker;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class NahirisWrath extends CardImpl {
|
public final class NahirisWrath extends CardImpl {
|
||||||
|
|
||||||
public NahirisWrath(UUID ownerId, CardSetInfo setInfo) {
|
public NahirisWrath(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}");
|
||||||
|
|
||||||
// As an additional cost to cast Nahiri's Wrath, discard X cards.
|
// As an additional cost to cast Nahiri's Wrath, discard X cards.
|
||||||
this.getSpellAbility().addCost(new NahirisWrathAdditionalCost());
|
this.getSpellAbility().addCost(new NahirisWrathAdditionalCost());
|
||||||
|
@ -36,8 +37,22 @@ public final class NahirisWrath extends CardImpl {
|
||||||
Effect effect = new DamageTargetEffect(new DiscardCostCardConvertedMana());
|
Effect effect = new DamageTargetEffect(new DiscardCostCardConvertedMana());
|
||||||
effect.setText("{this} deals damage equal to the total converted mana cost of the discarded cards to each of up to X target creatures and/or planeswalkers");
|
effect.setText("{this} deals damage equal to the total converted mana cost of the discarded cards to each of up to X target creatures and/or planeswalkers");
|
||||||
this.getSpellAbility().addEffect(effect);
|
this.getSpellAbility().addEffect(effect);
|
||||||
|
this.getSpellAbility().setTargetAdjuster(NahirisWrathAdjuster.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public NahirisWrath(final NahirisWrath card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NahirisWrath copy() {
|
||||||
|
return new NahirisWrath(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum NahirisWrathAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
ability.getTargets().clear();
|
ability.getTargets().clear();
|
||||||
|
@ -52,15 +67,6 @@ public final class NahirisWrath extends CardImpl {
|
||||||
ability.addTarget(new TargetCreatureOrPlaneswalker(0, numTargets, new FilterCreatureOrPlaneswalkerPermanent(), false));
|
ability.addTarget(new TargetCreatureOrPlaneswalker(0, numTargets, new FilterCreatureOrPlaneswalkerPermanent(), false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public NahirisWrath(final NahirisWrath card) {
|
|
||||||
super(card);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NahirisWrath copy() {
|
|
||||||
return new NahirisWrath(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class NahirisWrathAdditionalCost extends VariableCostImpl {
|
class NahirisWrathAdditionalCost extends VariableCostImpl {
|
||||||
|
|
|
@ -26,11 +26,11 @@ import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.target.common.TargetCardInLibrary;
|
import mage.target.common.TargetCardInLibrary;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author spjspj
|
* @author spjspj
|
||||||
*/
|
*/
|
||||||
public final class NazahnReveredBladesmith extends CardImpl {
|
public final class NazahnReveredBladesmith extends CardImpl {
|
||||||
|
@ -65,25 +65,10 @@ public final class NazahnReveredBladesmith extends CardImpl {
|
||||||
// Whenever an equipped creature you control attacks, you may tap target creature defending player controls.
|
// Whenever an equipped creature you control attacks, you may tap target creature defending player controls.
|
||||||
Ability ability = new AttacksCreatureYouControlTriggeredAbility(new NazahnTapEffect(), true, equippedFilter, true);
|
Ability ability = new AttacksCreatureYouControlTriggeredAbility(new NazahnTapEffect(), true, equippedFilter, true);
|
||||||
ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature defending player controls")));
|
ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature defending player controls")));
|
||||||
|
ability.setTargetAdjuster(NazahnReveredBladesmithAdjuster.instance);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof AttacksCreatureYouControlTriggeredAbility) {
|
|
||||||
FilterCreaturePermanent filterDefender = new FilterCreaturePermanent("creature defending player controls");
|
|
||||||
for (Effect effect : ability.getEffects()) {
|
|
||||||
if (effect instanceof NazahnTapEffect) {
|
|
||||||
filterDefender.add(new ControllerIdPredicate(game.getCombat().getDefendingPlayerId(effect.getTargetPointer().getFirst(game, ability), game)));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ability.getTargets().clear();
|
|
||||||
TargetCreaturePermanent target = new TargetCreaturePermanent(filterDefender);
|
|
||||||
ability.addTarget(target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public NazahnReveredBladesmith(final NazahnReveredBladesmith card) {
|
public NazahnReveredBladesmith(final NazahnReveredBladesmith card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
@ -94,6 +79,24 @@ public final class NazahnReveredBladesmith extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum NazahnReveredBladesmithAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
FilterCreaturePermanent filterDefender = new FilterCreaturePermanent("creature defending player controls");
|
||||||
|
for (Effect effect : ability.getEffects()) {
|
||||||
|
if (effect instanceof NazahnTapEffect) {
|
||||||
|
filterDefender.add(new ControllerIdPredicate(game.getCombat().getDefendingPlayerId(effect.getTargetPointer().getFirst(game, ability), game)));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ability.getTargets().clear();
|
||||||
|
TargetCreaturePermanent target = new TargetCreaturePermanent(filterDefender);
|
||||||
|
ability.addTarget(target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class NazahnTapEffect extends TapTargetEffect {
|
class NazahnTapEffect extends TapTargetEffect {
|
||||||
|
|
||||||
NazahnTapEffect() {
|
NazahnTapEffect() {
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
|
|
||||||
package mage.cards.n;
|
package mage.cards.n;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.costs.Cost;
|
import mage.abilities.costs.Cost;
|
||||||
|
import mage.abilities.costs.CostAdjuster;
|
||||||
import mage.abilities.costs.VariableCost;
|
import mage.abilities.costs.VariableCost;
|
||||||
import mage.abilities.costs.common.ExileFromGraveCost;
|
import mage.abilities.costs.common.ExileFromGraveCost;
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
|
@ -21,8 +21,8 @@ import mage.abilities.keyword.FlyingAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.FilterCard;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
@ -30,15 +30,17 @@ import mage.players.Player;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.common.TargetCardInYourGraveyard;
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class NecropolisFiend extends CardImpl {
|
public final class NecropolisFiend extends CardImpl {
|
||||||
|
|
||||||
public NecropolisFiend(UUID ownerId, CardSetInfo setInfo) {
|
public NecropolisFiend(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{7}{B}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{7}{B}{B}");
|
||||||
this.subtype.add(SubType.DEMON);
|
this.subtype.add(SubType.DEMON);
|
||||||
|
|
||||||
this.power = new MageInt(4);
|
this.power = new MageInt(4);
|
||||||
|
@ -46,54 +48,29 @@ public final class NecropolisFiend extends CardImpl {
|
||||||
|
|
||||||
// Delve
|
// Delve
|
||||||
this.addAbility(new DelveAbility());
|
this.addAbility(new DelveAbility());
|
||||||
|
|
||||||
// Flying
|
// Flying
|
||||||
this.addAbility(FlyingAbility.getInstance());
|
this.addAbility(FlyingAbility.getInstance());
|
||||||
//TODO: Make ability properly copiable
|
|
||||||
// {X}, {T}, Exile X cards from your graveyard: Target creature gets -X/-X until end of turn.
|
// {X}, {T}, Exile X cards from your graveyard: Target creature gets -X/-X until end of turn.
|
||||||
DynamicValue xValue = new SignInversionDynamicValue(new ManacostVariableValue());
|
DynamicValue xValue = new SignInversionDynamicValue(new ManacostVariableValue());
|
||||||
Effect effect = new BoostTargetEffect(xValue,xValue,Duration.EndOfTurn);
|
Effect effect = new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn);
|
||||||
effect.setText("Target creature gets -X/-X until end of turn");
|
effect.setText("Target creature gets -X/-X until end of turn");
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}"));
|
Ability ability = new SimpleActivatedAbility(
|
||||||
|
Zone.BATTLEFIELD, effect,
|
||||||
|
new ManaCostsImpl("{X}")
|
||||||
|
);
|
||||||
ability.addCost(new TapSourceCost());
|
ability.addCost(new TapSourceCost());
|
||||||
ability.addTarget(new TargetCreaturePermanent());
|
ability.addTarget(new TargetCreaturePermanent());
|
||||||
ability.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(1,1,new FilterCard("cards from your graveyard")), "Exile X cards from your graveyard"));
|
ability.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(
|
||||||
|
1, 1, new FilterCard("cards from your graveyard")
|
||||||
|
), "Exile X cards from your graveyard"));
|
||||||
|
ability.setTargetAdjuster(NecropolisFiendTargetAdjuster.instance);
|
||||||
|
ability.setCostAdjuster(NecropolisFiendCostAdjuster.instance);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustCosts(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SimpleActivatedAbility) {
|
|
||||||
Player controller = game.getPlayer(ability.getControllerId());
|
|
||||||
if (controller != null) {
|
|
||||||
for (VariableCost variableCost: ability.getManaCostsToPay().getVariableCosts()) {
|
|
||||||
if (variableCost instanceof VariableManaCost) {
|
|
||||||
((VariableManaCost)variableCost).setMaxX(controller.getGraveyard().size());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SimpleActivatedAbility) {
|
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
|
||||||
for(Cost cost: ability.getCosts()) {
|
|
||||||
if (cost instanceof ExileFromGraveCost) {
|
|
||||||
ExileFromGraveCost exileCost = (ExileFromGraveCost) cost;
|
|
||||||
for(Target target: exileCost.getTargets()) {
|
|
||||||
if (target instanceof TargetCardInYourGraveyard) {
|
|
||||||
target.setMaxNumberOfTargets(xValue);
|
|
||||||
target.setMinNumberOfTargets(xValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public NecropolisFiend(final NecropolisFiend card) {
|
public NecropolisFiend(final NecropolisFiend card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
@ -103,3 +80,41 @@ public final class NecropolisFiend extends CardImpl {
|
||||||
return new NecropolisFiend(this);
|
return new NecropolisFiend(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum NecropolisFiendCostAdjuster implements CostAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustCosts(Ability ability, Game game) {
|
||||||
|
Player controller = game.getPlayer(ability.getControllerId());
|
||||||
|
if (controller == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (VariableCost variableCost : ability.getManaCostsToPay().getVariableCosts()) {
|
||||||
|
if (variableCost instanceof VariableManaCost) {
|
||||||
|
((VariableManaCost) variableCost).setMaxX(controller.getGraveyard().size());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum NecropolisFiendTargetAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
int xValue = ability.getManaCostsToPay().getX();
|
||||||
|
for (Cost cost : ability.getCosts()) {
|
||||||
|
if (!(cost instanceof ExileFromGraveCost)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
ExileFromGraveCost exileCost = (ExileFromGraveCost) cost;
|
||||||
|
for (Target target : exileCost.getTargets()) {
|
||||||
|
if (target instanceof TargetCardInYourGraveyard) {
|
||||||
|
target.setMaxNumberOfTargets(xValue);
|
||||||
|
target.setMinNumberOfTargets(xValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.n;
|
package mage.cards.n;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||||
import mage.abilities.common.DiesAttachedTriggeredAbility;
|
import mage.abilities.common.DiesAttachedTriggeredAbility;
|
||||||
|
@ -15,35 +14,24 @@ import mage.abilities.keyword.EnchantAbility;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.AttachmentType;
|
import mage.constants.*;
|
||||||
import mage.constants.CardType;
|
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Duration;
|
|
||||||
import mage.constants.Outcome;
|
|
||||||
import mage.constants.TargetController;
|
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
|
||||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.common.TargetOpponentsCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
*/
|
*/
|
||||||
public final class NecroticPlague extends CardImpl {
|
public final class NecroticPlague extends CardImpl {
|
||||||
|
|
||||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls");
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(new ControllerPredicate(TargetController.OPPONENT));
|
|
||||||
}
|
|
||||||
|
|
||||||
public NecroticPlague(UUID ownerId, CardSetInfo setInfo) {
|
public NecroticPlague(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{B}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}");
|
||||||
|
|
||||||
this.subtype.add(SubType.AURA);
|
this.subtype.add(SubType.AURA);
|
||||||
|
|
||||||
|
@ -53,33 +41,18 @@ public final class NecroticPlague extends CardImpl {
|
||||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment));
|
this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment));
|
||||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
// Enchanted creature has "At the beginning of your upkeep, sacrifice this creature."
|
// Enchanted creature has "At the beginning of your upkeep, sacrifice this creature."
|
||||||
// When enchanted creature dies, its controller chooses target creature one of their opponents controls. Return Necrotic Plague from its owner's graveyard to the battlefield attached to that creature.
|
// When enchanted creature dies, its controller chooses target creature one of their opponents controls. Return Necrotic Plague from its owner's graveyard to the battlefield attached to that creature.
|
||||||
Ability gainedAbility = new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceEffect(), TargetController.YOU, false);
|
ability = new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceEffect(), TargetController.YOU, false);
|
||||||
Effect effect = new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA, Duration.WhileOnBattlefield);
|
Effect effect = new GainAbilityAttachedEffect(ability, AttachmentType.AURA, Duration.WhileOnBattlefield);
|
||||||
effect.setText("Enchanted creature has \"At the beginning of your upkeep, sacrifice this creature.\"");
|
effect.setText("Enchanted creature has \"At the beginning of your upkeep, sacrifice this creature.\"");
|
||||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
|
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
|
||||||
this.addAbility(new DiesAttachedTriggeredAbility(new NecroticPlagueEffect(), "enchanted creature", false));
|
|
||||||
|
|
||||||
}
|
ability = new DiesAttachedTriggeredAbility(new NecroticPlagueEffect(), "enchanted creature", false);
|
||||||
|
ability.setTargetAdjuster(NecroticPlagueAdjuster.instance);
|
||||||
|
this.addAbility(ability);
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof DiesAttachedTriggeredAbility) {
|
|
||||||
Permanent attachedTo = null;
|
|
||||||
for (Effect effect : ability.getEffects()) {
|
|
||||||
attachedTo = (Permanent) effect.getValue("attachedTo");
|
|
||||||
}
|
|
||||||
if (attachedTo != null) {
|
|
||||||
Player creatureController = game.getPlayer(attachedTo.getControllerId());
|
|
||||||
if (creatureController != null) {
|
|
||||||
ability.setControllerId(creatureController.getId());
|
|
||||||
ability.getTargets().clear();
|
|
||||||
TargetPermanent target = new TargetPermanent(filter);
|
|
||||||
ability.getTargets().add(target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public NecroticPlague(final NecroticPlague card) {
|
public NecroticPlague(final NecroticPlague card) {
|
||||||
|
@ -93,11 +66,35 @@ public final class NecroticPlague extends CardImpl {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum NecroticPlagueAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
Permanent attachedTo = null;
|
||||||
|
for (Effect effect : ability.getEffects()) {
|
||||||
|
attachedTo = (Permanent) effect.getValue("attachedTo");
|
||||||
|
}
|
||||||
|
if (attachedTo == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Player creatureController = game.getPlayer(attachedTo.getControllerId());
|
||||||
|
if (creatureController == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ability.setControllerId(creatureController.getId());
|
||||||
|
ability.getTargets().clear();
|
||||||
|
TargetPermanent target = new TargetOpponentsCreaturePermanent();
|
||||||
|
ability.getTargets().add(target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class NecroticPlagueEffect extends OneShotEffect {
|
class NecroticPlagueEffect extends OneShotEffect {
|
||||||
|
|
||||||
public NecroticPlagueEffect() {
|
public NecroticPlagueEffect() {
|
||||||
super(Outcome.PutCardInPlay);
|
super(Outcome.PutCardInPlay);
|
||||||
staticText = "its controller chooses target creature one of their opponents controls. Return {this} from its owner's graveyard to the battlefield attached to that creature";
|
staticText = "its controller chooses target creature one of their opponents controls. " +
|
||||||
|
"Return {this} from its owner's graveyard to the battlefield attached to that creature";
|
||||||
}
|
}
|
||||||
|
|
||||||
public NecroticPlagueEffect(final NecroticPlagueEffect effect) {
|
public NecroticPlagueEffect(final NecroticPlagueEffect effect) {
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.n;
|
package mage.cards.n;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.costs.common.DiscardXTargetCost;
|
import mage.abilities.costs.common.DiscardXTargetCost;
|
||||||
import mage.abilities.dynamicvalue.common.GetXValue;
|
import mage.abilities.dynamicvalue.common.GetXValue;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
|
@ -15,11 +13,12 @@ import mage.constants.CardType;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.FilterCard;
|
||||||
import mage.filter.StaticFilters;
|
import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.Target;
|
|
||||||
import mage.target.common.TargetCardInYourGraveyard;
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class NostalgicDreams extends CardImpl {
|
public final class NostalgicDreams extends CardImpl {
|
||||||
|
@ -33,27 +32,31 @@ public final class NostalgicDreams extends CardImpl {
|
||||||
Effect effect = new ReturnFromGraveyardToHandTargetEffect();
|
Effect effect = new ReturnFromGraveyardToHandTargetEffect();
|
||||||
effect.setText("Return X target cards from your graveyard to your hand");
|
effect.setText("Return X target cards from your graveyard to your hand");
|
||||||
this.getSpellAbility().addEffect(effect);
|
this.getSpellAbility().addEffect(effect);
|
||||||
|
this.getSpellAbility().setTargetAdjuster(NostalgicDreamsAdjuster.instance);
|
||||||
|
|
||||||
// Exile Nostalgic Dreams.
|
// Exile Nostalgic Dreams.
|
||||||
this.getSpellAbility().addEffect(ExileSpellEffect.getInstance());
|
this.getSpellAbility().addEffect(ExileSpellEffect.getInstance());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public NostalgicDreams(final NostalgicDreams card) {
|
public NostalgicDreams(final NostalgicDreams card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
int xValue = new GetXValue().calculate(game, ability, null);
|
|
||||||
Target target = new TargetCardInYourGraveyard(xValue, StaticFilters.FILTER_CARD_FROM_YOUR_GRAVEYARD);
|
|
||||||
ability.addTarget(target);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NostalgicDreams copy() {
|
public NostalgicDreams copy() {
|
||||||
return new NostalgicDreams(this);
|
return new NostalgicDreams(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum NostalgicDreamsAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
ability.addTarget(new TargetCardInYourGraveyard(
|
||||||
|
new GetXValue().calculate(game, ability, null),
|
||||||
|
StaticFilters.FILTER_CARD_FROM_YOUR_GRAVEYARD
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.n;
|
package mage.cards.n;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
|
||||||
import mage.abilities.effects.common.continuous.BoostAllEffect;
|
import mage.abilities.effects.common.continuous.BoostAllEffect;
|
||||||
|
@ -10,42 +9,45 @@ import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.filter.FilterPermanent;
|
import mage.filter.FilterPermanent;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
|
import mage.filter.predicate.ObjectSourcePlayer;
|
||||||
|
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
||||||
import mage.filter.predicate.Predicates;
|
import mage.filter.predicate.Predicates;
|
||||||
import mage.filter.predicate.mageobject.CardIdPredicate;
|
|
||||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author jeffwadsworth
|
* @author jeffwadsworth
|
||||||
*/
|
*/
|
||||||
public final class NoxiousGhoul extends CardImpl {
|
public final class NoxiousGhoul extends CardImpl {
|
||||||
|
|
||||||
final FilterPermanent filter = new FilterPermanent("Noxious Ghoul or another Zombie");
|
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
||||||
final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("non-Zombie");
|
private static final FilterPermanent filter2 = new FilterPermanent();
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new CardTypePredicate(CardType.CREATURE));
|
||||||
|
filter.add(Predicates.not(new SubtypePredicate(SubType.ZOMBIE)));
|
||||||
|
filter2.add(NoxiousGhoulPredicate.instance);
|
||||||
|
}
|
||||||
|
|
||||||
public NoxiousGhoul(UUID ownerId, CardSetInfo setInfo) {
|
public NoxiousGhoul(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
|
||||||
this.subtype.add(SubType.ZOMBIE);
|
this.subtype.add(SubType.ZOMBIE);
|
||||||
|
|
||||||
this.power = new MageInt(3);
|
this.power = new MageInt(3);
|
||||||
this.toughness = new MageInt(3);
|
this.toughness = new MageInt(3);
|
||||||
|
|
||||||
filter.add(Predicates.or(
|
|
||||||
new CardIdPredicate(this.getId()),
|
|
||||||
new SubtypePredicate(SubType.ZOMBIE)));
|
|
||||||
|
|
||||||
filter2.add(new CardTypePredicate(CardType.CREATURE));
|
|
||||||
filter2.add(Predicates.not(
|
|
||||||
new SubtypePredicate(SubType.ZOMBIE)));
|
|
||||||
|
|
||||||
final String rule = "Whenever {this} or another Zombie enters the battlefield, all non-Zombie creatures get -1/-1 until end of turn.";
|
|
||||||
|
|
||||||
// Whenever Noxious Ghoul or another Zombie enters the battlefield, all non-Zombie creatures get -1/-1 until end of turn.
|
// Whenever Noxious Ghoul or another Zombie enters the battlefield, all non-Zombie creatures get -1/-1 until end of turn.
|
||||||
this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new BoostAllEffect(-1, -1, Duration.EndOfTurn, filter2, false), filter, false, rule));
|
this.addAbility(new EntersBattlefieldAllTriggeredAbility(
|
||||||
|
new BoostAllEffect(-1, -1, Duration.EndOfTurn, filter, false),
|
||||||
|
filter2, "Whenever {this} or another Zombie enters the battlefield, " +
|
||||||
|
"all non-Zombie creatures get -1/-1 until end of turn."
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public NoxiousGhoul(final NoxiousGhoul card) {
|
public NoxiousGhoul(final NoxiousGhoul card) {
|
||||||
|
@ -57,3 +59,13 @@ public final class NoxiousGhoul extends CardImpl {
|
||||||
return new NoxiousGhoul(this);
|
return new NoxiousGhoul(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum NoxiousGhoulPredicate implements ObjectSourcePlayerPredicate<ObjectSourcePlayer<Permanent>> {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(ObjectSourcePlayer<Permanent> input, Game game) {
|
||||||
|
return input.getObject().hasSubtype(SubType.ZOMBIE, game)
|
||||||
|
|| input.getObject().getId().equals(input.getSourceId());
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,15 +1,10 @@
|
||||||
|
|
||||||
package mage.cards.o;
|
package mage.cards.o;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.Card;
|
import mage.cards.*;
|
||||||
import mage.cards.CardImpl;
|
|
||||||
import mage.cards.CardSetInfo;
|
|
||||||
import mage.cards.Cards;
|
|
||||||
import mage.cards.CardsImpl;
|
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.TargetController;
|
import mage.constants.TargetController;
|
||||||
|
@ -21,20 +16,15 @@ import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetPlayer;
|
import mage.target.TargetPlayer;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Plopman
|
* @author Plopman
|
||||||
*/
|
*/
|
||||||
public final class OathOfDruids extends CardImpl {
|
public final class OathOfDruids extends CardImpl {
|
||||||
|
|
||||||
private final UUID originalId;
|
|
||||||
private static final FilterPlayer filter = new FilterPlayer();
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(new OathOfDruidsPredicate());
|
|
||||||
}
|
|
||||||
|
|
||||||
public OathOfDruids(UUID ownerId, CardSetInfo setInfo) {
|
public OathOfDruids(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}");
|
||||||
|
|
||||||
|
@ -42,27 +32,12 @@ public final class OathOfDruids extends CardImpl {
|
||||||
// The first player may reveal cards from the top of their library until he or she reveals a creature card.
|
// The first player may reveal cards from the top of their library until he or she reveals a creature card.
|
||||||
// If he or she does, that player puts that card onto the battlefield and all other cards revealed this way into their graveyard.
|
// If he or she does, that player puts that card onto the battlefield and all other cards revealed this way into their graveyard.
|
||||||
Ability ability = new BeginningOfUpkeepTriggeredAbility(new OathOfDruidsEffect(), TargetController.ANY, false);
|
Ability ability = new BeginningOfUpkeepTriggeredAbility(new OathOfDruidsEffect(), TargetController.ANY, false);
|
||||||
ability.addTarget(new TargetPlayer(1, 1, false, filter));
|
ability.setTargetAdjuster(OathOfDruidsAdjuster.instance);
|
||||||
originalId = ability.getOriginalId();
|
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability.getOriginalId().equals(originalId)) {
|
|
||||||
Player activePlayer = game.getPlayer(game.getActivePlayerId());
|
|
||||||
if (activePlayer != null) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
TargetPlayer target = new TargetPlayer(1, 1, false, filter);
|
|
||||||
target.setTargetController(activePlayer.getId());
|
|
||||||
ability.getTargets().add(target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public OathOfDruids(final OathOfDruids card) {
|
public OathOfDruids(final OathOfDruids card) {
|
||||||
super(card);
|
super(card);
|
||||||
this.originalId = card.originalId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -71,6 +46,26 @@ public final class OathOfDruids extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum OathOfDruidsAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
private static final FilterPlayer filter = new FilterPlayer();
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new OathOfDruidsPredicate());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
Player activePlayer = game.getPlayer(game.getActivePlayerId());
|
||||||
|
if (activePlayer != null) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
TargetPlayer target = new TargetPlayer(1, 1, false, filter);
|
||||||
|
target.setTargetController(activePlayer.getId());
|
||||||
|
ability.getTargets().add(target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class OathOfDruidsPredicate implements ObjectSourcePlayerPredicate<ObjectSourcePlayer<Player>> {
|
class OathOfDruidsPredicate implements ObjectSourcePlayerPredicate<ObjectSourcePlayer<Player>> {
|
||||||
|
|
||||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.o;
|
package mage.cards.o;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||||
|
@ -15,57 +14,36 @@ import mage.constants.TargetController;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.FilterCard;
|
||||||
import mage.filter.FilterPlayer;
|
import mage.filter.FilterPlayer;
|
||||||
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.common.FilterCreatureCard;
|
import mage.filter.common.FilterCreatureCard;
|
||||||
import mage.filter.predicate.ObjectSourcePlayer;
|
import mage.filter.predicate.ObjectSourcePlayer;
|
||||||
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
||||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
|
||||||
import mage.filter.predicate.other.OwnerIdPredicate;
|
import mage.filter.predicate.other.OwnerIdPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.TargetPlayer;
|
import mage.target.TargetPlayer;
|
||||||
import mage.target.common.TargetCardInGraveyard;
|
import mage.target.common.TargetCardInGraveyard;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author TheElk801
|
* @author TheElk801
|
||||||
*/
|
*/
|
||||||
public final class OathOfGhouls extends CardImpl {
|
public final class OathOfGhouls extends CardImpl {
|
||||||
|
|
||||||
private final UUID originalId;
|
|
||||||
private static final FilterPlayer filter = new FilterPlayer();
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(new OathOfGhoulsPredicate());
|
|
||||||
}
|
|
||||||
|
|
||||||
public OathOfGhouls(UUID ownerId, CardSetInfo setInfo) {
|
public OathOfGhouls(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}");
|
||||||
|
|
||||||
// At the beginning of each player's upkeep, that player chooses target player whose graveyard has fewer creature cards in it than their graveyard does and is their opponent. The first player may return a creature card from their graveyard to their hand.
|
// At the beginning of each player's upkeep, that player chooses target player whose graveyard has fewer creature cards in it than their graveyard does and is their opponent. The first player may return a creature card from their graveyard to their hand.
|
||||||
Ability ability = new BeginningOfUpkeepTriggeredAbility(new OathOfGhoulsEffect(), TargetController.ANY, false);
|
Ability ability = new BeginningOfUpkeepTriggeredAbility(new OathOfGhoulsEffect(), TargetController.ANY, false);
|
||||||
ability.addTarget(new TargetPlayer(1, 1, false, filter));
|
ability.setTargetAdjuster(OathOfGhoulsAdjuster.instance);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
originalId = ability.getOriginalId();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability.getOriginalId().equals(originalId)) {
|
|
||||||
Player activePlayer = game.getPlayer(game.getActivePlayerId());
|
|
||||||
if (activePlayer != null) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
TargetPlayer target = new TargetPlayer(1, 1, false, filter);
|
|
||||||
target.setTargetController(activePlayer.getId());
|
|
||||||
ability.getTargets().add(target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public OathOfGhouls(final OathOfGhouls card) {
|
public OathOfGhouls(final OathOfGhouls card) {
|
||||||
super(card);
|
super(card);
|
||||||
this.originalId = card.originalId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -74,14 +52,28 @@ public final class OathOfGhouls extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class OathOfGhoulsPredicate implements ObjectSourcePlayerPredicate<ObjectSourcePlayer<Player>> {
|
enum OathOfGhoulsAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
private static final FilterCard filter = new FilterCard("creature cards");
|
private static final FilterPlayer filter = new FilterPlayer();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
filter.add(new CardTypePredicate(CardType.CREATURE));
|
filter.add(new OathOfGhoulsPredicate());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
Player activePlayer = game.getPlayer(game.getActivePlayerId());
|
||||||
|
if (activePlayer != null) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
TargetPlayer target = new TargetPlayer(1, 1, false, filter);
|
||||||
|
target.setTargetController(activePlayer.getId());
|
||||||
|
ability.getTargets().add(target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class OathOfGhoulsPredicate implements ObjectSourcePlayerPredicate<ObjectSourcePlayer<Player>> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(ObjectSourcePlayer<Player> input, Game game) {
|
public boolean apply(ObjectSourcePlayer<Player> input, Game game) {
|
||||||
Player targetPlayer = input.getObject();
|
Player targetPlayer = input.getObject();
|
||||||
|
@ -91,8 +83,8 @@ class OathOfGhoulsPredicate implements ObjectSourcePlayerPredicate<ObjectSourceP
|
||||||
|| !firstPlayer.hasOpponent(targetPlayer.getId(), game)) {
|
|| !firstPlayer.hasOpponent(targetPlayer.getId(), game)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int countGraveyardTargetPlayer = targetPlayer.getGraveyard().getCards(filter, game).size();
|
int countGraveyardTargetPlayer = targetPlayer.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, game).size();
|
||||||
int countGraveyardFirstPlayer = firstPlayer.getGraveyard().getCards(filter, game).size();
|
int countGraveyardFirstPlayer = firstPlayer.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, game).size();
|
||||||
|
|
||||||
return countGraveyardTargetPlayer < countGraveyardFirstPlayer;
|
return countGraveyardTargetPlayer < countGraveyardFirstPlayer;
|
||||||
}
|
}
|
||||||
|
@ -105,13 +97,6 @@ class OathOfGhoulsPredicate implements ObjectSourcePlayerPredicate<ObjectSourceP
|
||||||
|
|
||||||
class OathOfGhoulsEffect extends OneShotEffect {
|
class OathOfGhoulsEffect extends OneShotEffect {
|
||||||
|
|
||||||
// private static final FilterCard filter = new FilterCard("creature card");
|
|
||||||
//
|
|
||||||
// static {
|
|
||||||
// filter.add(new CardTypePredicate(CardType.CREATURE));
|
|
||||||
// filter.add(new OwnerPredicate(TargetController.ACTIVE));
|
|
||||||
// }
|
|
||||||
|
|
||||||
public OathOfGhoulsEffect() {
|
public OathOfGhoulsEffect() {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.Benefit);
|
||||||
staticText = "that player chooses target player whose graveyard has fewer creature cards in it than their graveyard does and is their opponent. The first player may return a creature card from their graveyard to their hand";
|
staticText = "that player chooses target player whose graveyard has fewer creature cards in it than their graveyard does and is their opponent. The first player may return a creature card from their graveyard to their hand";
|
||||||
|
@ -132,8 +117,7 @@ class OathOfGhoulsEffect extends OneShotEffect {
|
||||||
filter.add(new OwnerIdPredicate(firstPlayer.getId()));
|
filter.add(new OwnerIdPredicate(firstPlayer.getId()));
|
||||||
Target target = new TargetCardInGraveyard(filter);
|
Target target = new TargetCardInGraveyard(filter);
|
||||||
target.setNotTarget(true);
|
target.setNotTarget(true);
|
||||||
// target.setTargetController(firstPlayer.getId());
|
if (target.canChoose(source.getSourceId(), firstPlayer.getId(), game)
|
||||||
if (target.canChoose(source.getSourceId(),firstPlayer.getId(), game)
|
|
||||||
&& firstPlayer.chooseUse(outcome, "Return a creature card from your graveyard to your hand?", source, game)
|
&& firstPlayer.chooseUse(outcome, "Return a creature card from your graveyard to your hand?", source, game)
|
||||||
&& firstPlayer.chooseTarget(Outcome.ReturnToHand, target, source, game)) {
|
&& firstPlayer.chooseTarget(Outcome.ReturnToHand, target, source, game)) {
|
||||||
Card card = game.getCard(target.getFirstTarget());
|
Card card = game.getCard(target.getFirstTarget());
|
||||||
|
|
|
@ -12,7 +12,6 @@ import mage.constants.Outcome;
|
||||||
import mage.constants.TargetController;
|
import mage.constants.TargetController;
|
||||||
import mage.filter.FilterPlayer;
|
import mage.filter.FilterPlayer;
|
||||||
import mage.filter.StaticFilters;
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.common.FilterLandPermanent;
|
|
||||||
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;
|
||||||
|
@ -20,6 +19,7 @@ import mage.players.Player;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.TargetPlayer;
|
import mage.target.TargetPlayer;
|
||||||
import mage.target.common.TargetCardInLibrary;
|
import mage.target.common.TargetCardInLibrary;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -29,29 +29,15 @@ import java.util.UUID;
|
||||||
*/
|
*/
|
||||||
public final class OathOfLieges extends CardImpl {
|
public final class OathOfLieges extends CardImpl {
|
||||||
|
|
||||||
private static final FilterPlayer FILTER = new FilterPlayer("player who controls more lands than you do and is your opponent");
|
|
||||||
|
|
||||||
static {
|
|
||||||
FILTER.add(new OathOfLiegesPredicate());
|
|
||||||
}
|
|
||||||
|
|
||||||
public OathOfLieges(UUID ownerId, CardSetInfo setInfo) {
|
public OathOfLieges(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}");
|
||||||
|
|
||||||
// At the beginning of each player's upkeep, that player chooses target player who controls more lands than he or she does and is their opponent. The first player may search their library for a basic land card, put that card onto the battlefield, then shuffle their library.
|
// At the beginning of each player's upkeep, that player chooses target player who controls more lands than he or she does and is their opponent. The first player may search their library for a basic land card, put that card onto the battlefield, then shuffle their library.
|
||||||
Ability ability = new BeginningOfUpkeepTriggeredAbility(new OathOfLiegesEffect(), TargetController.ANY, false);
|
Ability ability = new BeginningOfUpkeepTriggeredAbility(new OathOfLiegesEffect(), TargetController.ANY, false);
|
||||||
ability.addTarget(new TargetPlayer(1, 1, false, FILTER));
|
ability.setTargetAdjuster(OathOfLiegesAdjuster.instance);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
// target controller must be active player (even for copies)
|
|
||||||
for (Target target : ability.getTargets()) {
|
|
||||||
target.setTargetController(game.getActivePlayerId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public OathOfLieges(final OathOfLieges card) {
|
public OathOfLieges(final OathOfLieges card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
@ -62,6 +48,26 @@ public final class OathOfLieges extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum OathOfLiegesAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
private static final FilterPlayer FILTER = new FilterPlayer("player who controls more lands than you do and is your opponent");
|
||||||
|
|
||||||
|
static {
|
||||||
|
FILTER.add(new OathOfLiegesPredicate());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
Player activePlayer = game.getPlayer(game.getActivePlayerId());
|
||||||
|
if (activePlayer != null) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
TargetPlayer target = new TargetPlayer(1, 1, false, FILTER);
|
||||||
|
target.setTargetController(activePlayer.getId());
|
||||||
|
ability.getTargets().add(target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class OathOfLiegesEffect extends OneShotEffect {
|
class OathOfLiegesEffect extends OneShotEffect {
|
||||||
|
|
||||||
public OathOfLiegesEffect() {
|
public OathOfLiegesEffect() {
|
||||||
|
@ -97,29 +103,20 @@ class OathOfLiegesEffect extends OneShotEffect {
|
||||||
|
|
||||||
class OathOfLiegesPredicate implements ObjectSourcePlayerPredicate<ObjectSourcePlayer<Player>> {
|
class OathOfLiegesPredicate implements ObjectSourcePlayerPredicate<ObjectSourcePlayer<Player>> {
|
||||||
|
|
||||||
private static final FilterLandPermanent FILTER = new FilterLandPermanent();
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(ObjectSourcePlayer<Player> input, Game game) {
|
public boolean apply(ObjectSourcePlayer<Player> input, Game game) {
|
||||||
// input.getPlayerId() -- source controller id
|
|
||||||
// input.getObject() -- checking player
|
|
||||||
|
|
||||||
Player targetPlayer = input.getObject();
|
Player targetPlayer = input.getObject();
|
||||||
//Get active input.playerId because adjust target is used after canTarget function
|
//Get active input.playerId because adjust target is used after canTarget function
|
||||||
Player activePlayer = game.getPlayer(game.getActivePlayerId());
|
UUID activePlayerId = game.getActivePlayerId();
|
||||||
|
if (targetPlayer == null || activePlayerId == null) {
|
||||||
if (targetPlayer == null || activePlayer == null) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (!targetPlayer.hasOpponent(activePlayerId, game)) {
|
||||||
// must be opponent
|
|
||||||
if (!activePlayer.hasOpponent(targetPlayer.getId(), game)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
int countTargetPlayer = game.getBattlefield().countAll(StaticFilters.FILTER_LAND, targetPlayer.getId(), game);
|
||||||
|
int countActivePlayer = game.getBattlefield().countAll(StaticFilters.FILTER_LAND, activePlayerId, game);
|
||||||
|
|
||||||
// must have more lands than active player
|
|
||||||
int countTargetPlayer = game.getBattlefield().countAll(FILTER, targetPlayer.getId(), game);
|
|
||||||
int countActivePlayer = game.getBattlefield().countAll(FILTER, activePlayer.getId(), game);
|
|
||||||
return countTargetPlayer > countActivePlayer;
|
return countTargetPlayer > countActivePlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.o;
|
package mage.cards.o;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||||
|
@ -17,46 +16,26 @@ import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetPlayer;
|
import mage.target.TargetPlayer;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author TheElk801
|
* @author TheElk801
|
||||||
*/
|
*/
|
||||||
public final class OathOfMages extends CardImpl {
|
public final class OathOfMages extends CardImpl {
|
||||||
|
|
||||||
private final UUID originalId;
|
|
||||||
private static final FilterPlayer filter = new FilterPlayer();
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(new OathOfMagesPredicate());
|
|
||||||
}
|
|
||||||
|
|
||||||
public OathOfMages(UUID ownerId, CardSetInfo setInfo) {
|
public OathOfMages(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}");
|
||||||
|
|
||||||
// At the beginning of each player's upkeep, that player chooses target player who has more life than he or she does and is their opponent. The first player may have Oath of Mages deal 1 damage to the second player.
|
// At the beginning of each player's upkeep, that player chooses target player who has more life than he or she does and is their opponent. The first player may have Oath of Mages deal 1 damage to the second player.
|
||||||
Ability ability = new BeginningOfUpkeepTriggeredAbility(new OathOfMagesEffect(), TargetController.ANY, false);
|
Ability ability = new BeginningOfUpkeepTriggeredAbility(new OathOfMagesEffect(), TargetController.ANY, false);
|
||||||
ability.addTarget(new TargetPlayer(1, 1, false, filter));
|
ability.setTargetAdjuster(OathOfMagesAdjuster.instance);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
originalId = ability.getOriginalId();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability.getOriginalId().equals(originalId)) {
|
|
||||||
Player activePlayer = game.getPlayer(game.getActivePlayerId());
|
|
||||||
if (activePlayer != null) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
TargetPlayer target = new TargetPlayer(1, 1, false, filter);
|
|
||||||
target.setTargetController(activePlayer.getId());
|
|
||||||
ability.getTargets().add(target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public OathOfMages(final OathOfMages card) {
|
public OathOfMages(final OathOfMages card) {
|
||||||
super(card);
|
super(card);
|
||||||
this.originalId = card.originalId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -65,6 +44,26 @@ public final class OathOfMages extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum OathOfMagesAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
private static final FilterPlayer filter = new FilterPlayer();
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new OathOfMagesPredicate());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
Player activePlayer = game.getPlayer(game.getActivePlayerId());
|
||||||
|
if (activePlayer != null) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
TargetPlayer target = new TargetPlayer(1, 1, false, filter);
|
||||||
|
target.setTargetController(activePlayer.getId());
|
||||||
|
ability.getTargets().add(target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class OathOfMagesPredicate implements ObjectSourcePlayerPredicate<ObjectSourcePlayer<Player>> {
|
class OathOfMagesPredicate implements ObjectSourcePlayerPredicate<ObjectSourcePlayer<Player>> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.o;
|
package mage.cards.o;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||||
|
@ -17,47 +16,26 @@ import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetPlayer;
|
import mage.target.TargetPlayer;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author jeffwadsworth
|
* @author jeffwadsworth
|
||||||
*/
|
*/
|
||||||
public final class OathOfScholars extends CardImpl {
|
public final class OathOfScholars extends CardImpl {
|
||||||
|
|
||||||
private final UUID originalId;
|
|
||||||
private static final FilterPlayer filter = new FilterPlayer();
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(new OathOfScholarsPredicate());
|
|
||||||
}
|
|
||||||
|
|
||||||
public OathOfScholars(UUID ownerId, CardSetInfo setInfo) {
|
public OathOfScholars(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}");
|
||||||
|
|
||||||
// At the beginning of each player's upkeep, that player chooses target player who has more cards in hand than he or she does and is their opponent. The first player may discard their hand and draw three cards.
|
// At the beginning of each player's upkeep, that player chooses target player who has more cards in hand than he or she does and is their opponent. The first player may discard their hand and draw three cards.
|
||||||
Ability ability = new BeginningOfUpkeepTriggeredAbility(new OathOfScholarsEffect(), TargetController.ANY, false);
|
Ability ability = new BeginningOfUpkeepTriggeredAbility(new OathOfScholarsEffect(), TargetController.ANY, false);
|
||||||
ability.addTarget(new TargetPlayer(1, 1, false, filter));
|
ability.setTargetAdjuster(OathOfScholarsAdjuster.instance);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
originalId = ability.getOriginalId();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability.getOriginalId().equals(originalId)) {
|
|
||||||
Player activePlayer = game.getPlayer(game.getActivePlayerId());
|
|
||||||
if (activePlayer != null) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
TargetPlayer target = new TargetPlayer(1, 1, false, filter);
|
|
||||||
target.setTargetController(activePlayer.getId());
|
|
||||||
ability.getTargets().add(target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public OathOfScholars(final OathOfScholars card) {
|
public OathOfScholars(final OathOfScholars card) {
|
||||||
super(card);
|
super(card);
|
||||||
this.originalId = card.originalId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -66,6 +44,26 @@ public final class OathOfScholars extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum OathOfScholarsAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
private static final FilterPlayer filter = new FilterPlayer();
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new OathOfScholarsPredicate());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
Player activePlayer = game.getPlayer(game.getActivePlayerId());
|
||||||
|
if (activePlayer != null) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
TargetPlayer target = new TargetPlayer(1, 1, false, filter);
|
||||||
|
target.setTargetController(activePlayer.getId());
|
||||||
|
ability.getTargets().add(target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class OathOfScholarsPredicate implements ObjectSourcePlayerPredicate<ObjectSourcePlayer<Player>> {
|
class OathOfScholarsPredicate implements ObjectSourcePlayerPredicate<ObjectSourcePlayer<Player>> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.o;
|
package mage.cards.o;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
|
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||||
|
@ -13,12 +11,13 @@ 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.StaticFilters;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class OpenIntoWonder extends CardImpl {
|
public final class OpenIntoWonder extends CardImpl {
|
||||||
|
@ -30,28 +29,28 @@ public final class OpenIntoWonder extends CardImpl {
|
||||||
Effect effect = new CantBeBlockedTargetEffect(Duration.EndOfTurn);
|
Effect effect = new CantBeBlockedTargetEffect(Duration.EndOfTurn);
|
||||||
effect.setText("X target creatures can't be blocked this turn");
|
effect.setText("X target creatures can't be blocked this turn");
|
||||||
this.getSpellAbility().addEffect(effect);
|
this.getSpellAbility().addEffect(effect);
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1, StaticFilters.FILTER_PERMANENT_CREATURE, false));
|
|
||||||
Ability abilityToGain = new DealsCombatDamageToAPlayerTriggeredAbility(new DrawCardSourceControllerEffect(1), false);
|
Ability abilityToGain = new DealsCombatDamageToAPlayerTriggeredAbility(new DrawCardSourceControllerEffect(1), false);
|
||||||
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(abilityToGain, Duration.EndOfTurn,
|
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(abilityToGain, Duration.EndOfTurn,
|
||||||
"Until end of turn, those creatures gain \"Whenever this creature deals combat damage to a player, draw a card.\""));
|
"Until end of turn, those creatures gain \"Whenever this creature deals combat damage to a player, draw a card.\""));
|
||||||
|
this.getSpellAbility().setTargetAdjuster(OpenIntoWonderAdjuster.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public OpenIntoWonder(final OpenIntoWonder card) {
|
public OpenIntoWonder(final OpenIntoWonder card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
int numberOfTargets = ability.getManaCostsToPay().getX();
|
|
||||||
numberOfTargets = Math.min(game.getBattlefield().count(StaticFilters.FILTER_PERMANENT_CREATURE, ability.getSourceId(), ability.getControllerId(), game), numberOfTargets);
|
|
||||||
ability.addTarget(new TargetCreaturePermanent(numberOfTargets));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OpenIntoWonder copy() {
|
public OpenIntoWonder copy() {
|
||||||
return new OpenIntoWonder(this);
|
return new OpenIntoWonder(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum OpenIntoWonderAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
ability.addTarget(new TargetCreaturePermanent(ability.getManaCostsToPay().getX()));
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.o;
|
package mage.cards.o;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
|
@ -22,10 +21,11 @@ import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Styxo
|
* @author Styxo
|
||||||
*/
|
*/
|
||||||
public final class OpenSeason extends CardImpl {
|
public final class OpenSeason extends CardImpl {
|
||||||
|
@ -37,7 +37,7 @@ public final class OpenSeason extends CardImpl {
|
||||||
Effect effect = new AddCountersTargetEffect(CounterType.BOUNTY.createInstance());
|
Effect effect = new AddCountersTargetEffect(CounterType.BOUNTY.createInstance());
|
||||||
effect.setText("for each opponent, put a bounty counter on target creature that player controls");
|
effect.setText("for each opponent, put a bounty counter on target creature that player controls");
|
||||||
Ability ability = new EntersBattlefieldTriggeredAbility(effect);
|
Ability ability = new EntersBattlefieldTriggeredAbility(effect);
|
||||||
ability.addTarget(new TargetCreaturePermanent());
|
ability.setTargetAdjuster(OpenSeasonAdjuster.instance);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
// Creatures your opponent control with bounty counters on them can't activate abilities
|
// Creatures your opponent control with bounty counters on them can't activate abilities
|
||||||
|
@ -48,19 +48,6 @@ public final class OpenSeason extends CardImpl {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof EntersBattlefieldTriggeredAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
for (UUID opponentId : game.getOpponents(ability.getControllerId())) {
|
|
||||||
Player opponent = game.getPlayer(opponentId);
|
|
||||||
if (opponent != null) {
|
|
||||||
ability.addTarget(new TargetPermanent(new FilterCreaturePermanent("creature from opponent " + opponent.getLogName())));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public OpenSeason(final OpenSeason card) {
|
public OpenSeason(final OpenSeason card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
@ -71,6 +58,21 @@ public final class OpenSeason extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum OpenSeasonAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
for (UUID opponentId : game.getOpponents(ability.getControllerId())) {
|
||||||
|
Player opponent = game.getPlayer(opponentId);
|
||||||
|
if (opponent != null) {
|
||||||
|
ability.addTarget(new TargetPermanent(new FilterCreaturePermanent("creature from opponent " + opponent.getLogName())));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class OpenSeasonRestrictionEffect extends RestrictionEffect {
|
class OpenSeasonRestrictionEffect extends RestrictionEffect {
|
||||||
|
|
||||||
public OpenSeasonRestrictionEffect() {
|
public OpenSeasonRestrictionEffect() {
|
||||||
|
|
|
@ -3,7 +3,6 @@ package mage.cards.o;
|
||||||
|
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.condition.common.KickedCondition;
|
import mage.abilities.condition.common.KickedCondition;
|
||||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
@ -18,17 +17,17 @@ import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author jeffwadsworth
|
* @author jeffwadsworth
|
||||||
*/
|
*/
|
||||||
public final class OrimsThunder extends CardImpl {
|
public final class OrimsThunder extends CardImpl {
|
||||||
|
|
||||||
public OrimsThunder(UUID ownerId, CardSetInfo setInfo) {
|
public OrimsThunder(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{W}");
|
||||||
|
|
||||||
// Kicker {R}
|
// Kicker {R}
|
||||||
this.addAbility(new KickerAbility("{R}"));
|
this.addAbility(new KickerAbility("{R}"));
|
||||||
|
@ -39,16 +38,9 @@ public final class OrimsThunder extends CardImpl {
|
||||||
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
|
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
|
||||||
new OrimsThunderEffect2(),
|
new OrimsThunderEffect2(),
|
||||||
KickedCondition.instance,
|
KickedCondition.instance,
|
||||||
"If Orim's Thunder was kicked, it deals damage equal to that permanent's converted mana cost to target creature"));
|
"If Orim's Thunder was kicked, it deals damage equal to that permanent's converted mana cost to target creature")
|
||||||
}
|
);
|
||||||
|
this.getSpellAbility().setTargetAdjuster(OrimsThunderAdjuster.instance);
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
if (KickedCondition.instance.apply(game, ability)) {
|
|
||||||
ability.addTarget(new TargetCreaturePermanent());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrimsThunder(final OrimsThunder card) {
|
public OrimsThunder(final OrimsThunder card) {
|
||||||
|
@ -61,6 +53,18 @@ public final class OrimsThunder extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum OrimsThunderAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
if (KickedCondition.instance.apply(game, ability)) {
|
||||||
|
ability.addTarget(new TargetCreaturePermanent());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
class OrimsThunderEffect2 extends OneShotEffect {
|
class OrimsThunderEffect2 extends OneShotEffect {
|
||||||
|
|
||||||
OrimsThunderEffect2() {
|
OrimsThunderEffect2() {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.p;
|
package mage.cards.p;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
@ -16,39 +15,31 @@ import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.common.TargetAnyTarget;
|
import mage.target.common.TargetAnyTarget;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class Pandemonium extends CardImpl {
|
public final class Pandemonium extends CardImpl {
|
||||||
|
|
||||||
private final UUID originalId;
|
|
||||||
|
|
||||||
public Pandemonium(UUID ownerId, CardSetInfo setInfo) {
|
public Pandemonium(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}");
|
||||||
|
|
||||||
// Whenever a creature enters the battlefield, that creature's controller may have it deal damage equal to its power to any target of their choice.
|
// Whenever a creature enters the battlefield, that creature's controller may have it deal damage equal to its power to any target of their choice.
|
||||||
Ability ability = new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new PandemoniumEffect(), StaticFilters.FILTER_PERMANENT_CREATURE, false, SetTargetPointer.PERMANENT, "");
|
Ability ability = new EntersBattlefieldAllTriggeredAbility(
|
||||||
|
Zone.BATTLEFIELD, new PandemoniumEffect(),
|
||||||
|
StaticFilters.FILTER_PERMANENT_CREATURE,
|
||||||
|
false, SetTargetPointer.PERMANENT, ""
|
||||||
|
);
|
||||||
ability.addTarget(new TargetAnyTarget());
|
ability.addTarget(new TargetAnyTarget());
|
||||||
originalId = ability.getOriginalId();
|
ability.setTargetAdjuster(PandemoniumAdjuster.instance);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Pandemonium(final Pandemonium card) {
|
public Pandemonium(final Pandemonium card) {
|
||||||
super(card);
|
super(card);
|
||||||
this.originalId = card.originalId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability.getOriginalId().equals(originalId)) {
|
|
||||||
UUID creatureId = ability.getEffects().get(0).getTargetPointer().getFirst(game, ability);
|
|
||||||
Permanent creature = game.getPermanent(creatureId);
|
|
||||||
if (creature != null) {
|
|
||||||
ability.getTargets().get(0).setTargetController(creature.getControllerId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -57,6 +48,19 @@ public final class Pandemonium extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum PandemoniumAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
UUID creatureId = ability.getEffects().get(0).getTargetPointer().getFirst(game, ability);
|
||||||
|
Permanent creature = game.getPermanent(creatureId);
|
||||||
|
if (creature != null) {
|
||||||
|
ability.getTargets().get(0).setTargetController(creature.getControllerId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class PandemoniumEffect extends OneShotEffect {
|
class PandemoniumEffect extends OneShotEffect {
|
||||||
|
|
||||||
public PandemoniumEffect() {
|
public PandemoniumEffect() {
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.p;
|
package mage.cards.p;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||||
import mage.abilities.keyword.IslandwalkAbility;
|
import mage.abilities.keyword.IslandwalkAbility;
|
||||||
|
@ -11,34 +9,26 @@ 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.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author fireshoes
|
* @author fireshoes
|
||||||
*/
|
*/
|
||||||
public final class PartWater extends CardImpl {
|
public final class PartWater extends CardImpl {
|
||||||
|
|
||||||
public PartWater(UUID ownerId, CardSetInfo setInfo) {
|
public PartWater(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{X}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{X}{U}");
|
||||||
|
|
||||||
// X target creatures gain islandwalk until end of turn.
|
// X target creatures gain islandwalk until end of turn.
|
||||||
Effect effect = new GainAbilityTargetEffect(new IslandwalkAbility(false), Duration.EndOfTurn);
|
Effect effect = new GainAbilityTargetEffect(new IslandwalkAbility(false), Duration.EndOfTurn);
|
||||||
effect.setText("X target creatures gain islandwalk until end of turn");
|
effect.setText("X target creatures gain islandwalk until end of turn");
|
||||||
this.getSpellAbility().getEffects().add(effect);
|
this.getSpellAbility().getEffects().add(effect);
|
||||||
this.getSpellAbility().getTargets().add(new TargetCreaturePermanent(1,1));
|
this.getSpellAbility().getTargets().add(new TargetCreaturePermanent());
|
||||||
}
|
this.getSpellAbility().setTargetAdjuster(PartWaterAdjuster.instance);
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures gain islandwalk until end of turn");
|
|
||||||
ability.getTargets().add(new TargetCreaturePermanent(0, xValue, filter, false));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public PartWater(final PartWater card) {
|
public PartWater(final PartWater card) {
|
||||||
|
@ -50,3 +40,13 @@ public final class PartWater extends CardImpl {
|
||||||
return new PartWater(this);
|
return new PartWater(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum PartWaterAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
ability.getTargets().add(new TargetCreaturePermanent(ability.getManaCostsToPay().getX()));
|
||||||
|
}
|
||||||
|
}
|
|
@ -21,14 +21,13 @@ import mage.util.functions.ApplyToPermanent;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author North
|
* @author North
|
||||||
*/
|
*/
|
||||||
public final class PhantasmalImage extends CardImpl {
|
public final class PhantasmalImage extends CardImpl {
|
||||||
|
|
||||||
private static final String effectText = "a copy of any creature on the battlefield, except it's an Illusion in addition to its other types and it has \"When this creature becomes the target of a spell or ability, sacrifice it.\"";
|
private static final String effectText = "a copy of any creature on the battlefield, except it's an Illusion in addition to its other types and it has \"When this creature becomes the target of a spell or ability, sacrifice it.\"";
|
||||||
|
|
||||||
ApplyToPermanent phantasmalImageApplier = new ApplyToPermanent() {
|
private static final ApplyToPermanent phantasmalImageApplier = new ApplyToPermanent() {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) {
|
public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) {
|
||||||
if (!permanent.hasSubtype(SubType.ILLUSION, game)) {
|
if (!permanent.hasSubtype(SubType.ILLUSION, game)) {
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
|
|
||||||
package mage.cards.p;
|
package mage.cards.p;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
import mage.abilities.costs.CostAdjuster;
|
||||||
import mage.abilities.costs.common.PayLifeCost;
|
import mage.abilities.costs.common.PayLifeCost;
|
||||||
import mage.abilities.effects.common.DestroyMultiTargetEffect;
|
import mage.abilities.effects.common.DestroyMultiTargetEffect;
|
||||||
import mage.abilities.effects.common.InfoEffect;
|
import mage.abilities.effects.common.InfoEffect;
|
||||||
|
@ -13,9 +12,11 @@ import mage.constants.CardType;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author escplan9 - Derek Monturo
|
* @author escplan9 - Derek Monturo
|
||||||
*/
|
*/
|
||||||
public final class PhyrexianPurge extends CardImpl {
|
public final class PhyrexianPurge extends CardImpl {
|
||||||
|
@ -28,26 +29,8 @@ public final class PhyrexianPurge extends CardImpl {
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE));
|
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE));
|
||||||
this.getSpellAbility().addEffect(new DestroyMultiTargetEffect());
|
this.getSpellAbility().addEffect(new DestroyMultiTargetEffect());
|
||||||
this.getSpellAbility().addEffect(new InfoEffect("<br><br>{this} costs 3 life more to cast for each target"));
|
this.getSpellAbility().addEffect(new InfoEffect("<br><br>{this} costs 3 life more to cast for each target"));
|
||||||
}
|
this.getSpellAbility().setTargetAdjuster(PhyrexianPurgeTargetAdjuster.instance);
|
||||||
|
this.getSpellAbility().setCostAdjuster(PhyrexianPurgeCostAdjuster.instance);
|
||||||
@Override
|
|
||||||
public void adjustCosts(Ability ability, Game game) {
|
|
||||||
int numTargets = ability.getTargets().get(0).getTargets().size();
|
|
||||||
if (numTargets > 0) {
|
|
||||||
ability.getCosts().add(new PayLifeCost(numTargets * 3));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
Player you = game.getPlayer(ownerId);
|
|
||||||
if(you != null) {
|
|
||||||
int maxTargets = you.getLife() / 3;
|
|
||||||
ability.addTarget(new TargetCreaturePermanent(0, maxTargets));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public PhyrexianPurge(final PhyrexianPurge card) {
|
public PhyrexianPurge(final PhyrexianPurge card) {
|
||||||
|
@ -59,3 +42,27 @@ public final class PhyrexianPurge extends CardImpl {
|
||||||
return new PhyrexianPurge(this);
|
return new PhyrexianPurge(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum PhyrexianPurgeCostAdjuster implements CostAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustCosts(Ability ability, Game game) {
|
||||||
|
int numTargets = ability.getTargets().get(0).getTargets().size();
|
||||||
|
if (numTargets > 0) {
|
||||||
|
ability.getCosts().add(new PayLifeCost(numTargets * 3));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum PhyrexianPurgeTargetAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
Player you = game.getPlayer(ability.getControllerId());
|
||||||
|
int maxTargets = you.getLife() / 3;
|
||||||
|
ability.addTarget(new TargetCreaturePermanent(0, maxTargets));
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.p;
|
package mage.cards.p;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -17,39 +16,30 @@ import mage.filter.common.FilterControlledLandPermanent;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetControlledPermanent;
|
import mage.target.common.TargetControlledPermanent;
|
||||||
import mage.target.common.TargetAnyTargetAmount;
|
import mage.target.common.TargetAnyTargetAmount;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author LoneFox
|
* @author LoneFox
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
public final class PollenRemedy extends CardImpl {
|
public final class PollenRemedy extends CardImpl {
|
||||||
|
|
||||||
private final UUID originalId;
|
|
||||||
|
|
||||||
public PollenRemedy(UUID ownerId, CardSetInfo setInfo) {
|
public PollenRemedy(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{W}");
|
||||||
|
|
||||||
// Kicker-Sacrifice a land.
|
// Kicker-Sacrifice a land.
|
||||||
this.addAbility(new KickerAbility(new SacrificeTargetCost(new TargetControlledPermanent(1, 1, new FilterControlledLandPermanent("a land"), true))));
|
this.addAbility(new KickerAbility(new SacrificeTargetCost(new TargetControlledPermanent(1, 1, new FilterControlledLandPermanent("a land"), true))));
|
||||||
// Prevent the next 3 damage that would be dealt this turn to any number of target creatures and/or players, divided as you choose. If Pollen Remedy was kicked, prevent the next 6 damage this way instead.
|
// Prevent the next 3 damage that would be dealt this turn to any number of target creatures and/or players, divided as you choose. If Pollen Remedy was kicked, prevent the next 6 damage this way instead.
|
||||||
Effect effect = new ConditionalReplacementEffect(new PreventDamageToTargetMultiAmountEffect(Duration.EndOfTurn, 6),
|
Effect effect = new ConditionalReplacementEffect(new PreventDamageToTargetMultiAmountEffect(Duration.EndOfTurn, 6),
|
||||||
KickedCondition.instance, new PreventDamageToTargetMultiAmountEffect(Duration.EndOfTurn, 3));
|
KickedCondition.instance, new PreventDamageToTargetMultiAmountEffect(Duration.EndOfTurn, 3));
|
||||||
effect.setText("Prevent the next 3 damage that would be dealt this turn to any number of targets, divided as you choose. if this spell was kicked, prevent the next 6 damage this way instead.");
|
effect.setText("Prevent the next 3 damage that would be dealt this turn to any number of targets, divided as you choose. if this spell was kicked, prevent the next 6 damage this way instead.");
|
||||||
this.getSpellAbility().addEffect(effect);
|
this.getSpellAbility().addEffect(effect);
|
||||||
originalId = this.getSpellAbility().getOriginalId();
|
this.getSpellAbility().setTargetAdjuster(PollenRemedyAdjuster.instance);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if(ability.getOriginalId().equals(originalId)) {
|
|
||||||
ability.addTarget(new TargetAnyTargetAmount(KickedCondition.instance.apply(game, ability) ? 6 : 3));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public PollenRemedy(final PollenRemedy card) {
|
public PollenRemedy(final PollenRemedy card) {
|
||||||
super(card);
|
super(card);
|
||||||
this.originalId = card.originalId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -57,3 +47,12 @@ public final class PollenRemedy extends CardImpl {
|
||||||
return new PollenRemedy(this);
|
return new PollenRemedy(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum PollenRemedyAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.addTarget(new TargetAnyTargetAmount(KickedCondition.instance.apply(game, ability) ? 6 : 3));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.p;
|
package mage.cards.p;
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.BecomesMonstrousSourceTriggeredAbility;
|
import mage.abilities.common.BecomesMonstrousSourceTriggeredAbility;
|
||||||
|
@ -12,47 +9,44 @@ import mage.abilities.keyword.MonstrosityAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.constants.SuperType;
|
import mage.constants.SuperType;
|
||||||
import mage.constants.TargetController;
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
|
||||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.common.TargetCreaturePermanentAmount;
|
import mage.target.common.TargetCreaturePermanentAmount;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* * The value of X in Polukranos's last ability is equal to the value chosen
|
* * The value of X in Polukranos's last ability is equal to the value chosen
|
||||||
* for X when its activated ability was activated.
|
* for X when its activated ability was activated.
|
||||||
*
|
* <p>
|
||||||
* * The number of targets chosen for the triggered ability must be at least one
|
* * The number of targets chosen for the triggered ability must be at least one
|
||||||
* (if X wasn't 0) and at most X. You choose the division of damage as you put
|
* (if X wasn't 0) and at most X. You choose the division of damage as you put
|
||||||
* the ability on the stack, not as it resolves. Each target must be assigned
|
* the ability on the stack, not as it resolves. Each target must be assigned
|
||||||
* at least 1 damage. In multiplayer games, you may choose creatures controlled
|
* at least 1 damage. In multiplayer games, you may choose creatures controlled
|
||||||
* by different opponents.
|
* by different opponents.
|
||||||
*
|
* <p>
|
||||||
* * If some, but not all, of the ability's targets become illegal, you can't change
|
* * If some, but not all, of the ability's targets become illegal, you can't change
|
||||||
* the division of damage. Damage that would've been dealt to illegal targets
|
* the division of damage. Damage that would've been dealt to illegal targets
|
||||||
* simply isn't dealt.
|
* simply isn't dealt.
|
||||||
*
|
* <p>
|
||||||
* * As Polukranos's triggered ability resolves, Polukranos deals damage first, then
|
* * As Polukranos's triggered ability resolves, Polukranos deals damage first, then
|
||||||
* the target creatures do. Although no creature will die until after the ability
|
* the target creatures do. Although no creature will die until after the ability
|
||||||
* finishes resolving, the order could matter if Polukranos has wither or infect.
|
* finishes resolving, the order could matter if Polukranos has wither or infect.
|
||||||
*
|
*
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class PolukranosWorldEater extends CardImpl {
|
public final class PolukranosWorldEater extends CardImpl {
|
||||||
|
|
||||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
|
||||||
static {
|
|
||||||
filter.add(new ControllerPredicate(TargetController.OPPONENT));
|
|
||||||
}
|
|
||||||
|
|
||||||
public PolukranosWorldEater(UUID ownerId, CardSetInfo setInfo) {
|
public PolukranosWorldEater(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}{G}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{G}");
|
||||||
addSuperType(SuperType.LEGENDARY);
|
addSuperType(SuperType.LEGENDARY);
|
||||||
this.subtype.add(SubType.HYDRA);
|
this.subtype.add(SubType.HYDRA);
|
||||||
|
|
||||||
|
@ -61,20 +55,11 @@ public final class PolukranosWorldEater extends CardImpl {
|
||||||
|
|
||||||
// {X}{X}{G}: Monstrosity X.
|
// {X}{X}{G}: Monstrosity X.
|
||||||
this.addAbility(new MonstrosityAbility("{X}{X}{G}", Integer.MAX_VALUE));
|
this.addAbility(new MonstrosityAbility("{X}{X}{G}", Integer.MAX_VALUE));
|
||||||
|
|
||||||
// When Polukranos, World Eater becomes monstrous, it deals X damage divided as you choose among any number of target creatures your opponents control. Each of those creatures deals damage equal to its power to Polukranos.
|
// When Polukranos, World Eater becomes monstrous, it deals X damage divided as you choose among any number of target creatures your opponents control. Each of those creatures deals damage equal to its power to Polukranos.
|
||||||
Ability ability = new BecomesMonstrousSourceTriggeredAbility(new PolukranosWorldEaterEffect());
|
Ability ability = new BecomesMonstrousSourceTriggeredAbility(new PolukranosWorldEaterEffect());
|
||||||
ability.addTarget(new TargetCreaturePermanentAmount(1, filter));
|
ability.setTargetAdjuster(PolukranosWorldEaterAdjuster.instance);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof BecomesMonstrousSourceTriggeredAbility) {
|
|
||||||
int xValue = ((BecomesMonstrousSourceTriggeredAbility) ability).getMonstrosityValue();
|
|
||||||
ability.getTargets().clear();
|
|
||||||
ability.addTarget(new TargetCreaturePermanentAmount(xValue, filter));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public PolukranosWorldEater(final PolukranosWorldEater card) {
|
public PolukranosWorldEater(final PolukranosWorldEater card) {
|
||||||
|
@ -87,6 +72,17 @@ public final class PolukranosWorldEater extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum PolukranosWorldEaterAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
int xValue = ((BecomesMonstrousSourceTriggeredAbility) ability).getMonstrosityValue();
|
||||||
|
ability.getTargets().clear();
|
||||||
|
ability.addTarget(new TargetCreaturePermanentAmount(xValue, StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURE));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class PolukranosWorldEaterEffect extends OneShotEffect {
|
class PolukranosWorldEaterEffect extends OneShotEffect {
|
||||||
|
|
||||||
public PolukranosWorldEaterEffect() {
|
public PolukranosWorldEaterEffect() {
|
||||||
|
@ -108,7 +104,7 @@ class PolukranosWorldEaterEffect extends OneShotEffect {
|
||||||
if (!source.getTargets().isEmpty()) {
|
if (!source.getTargets().isEmpty()) {
|
||||||
Target multiTarget = source.getTargets().get(0);
|
Target multiTarget = source.getTargets().get(0);
|
||||||
Set<Permanent> permanents = new HashSet<>();
|
Set<Permanent> permanents = new HashSet<>();
|
||||||
for (UUID target: multiTarget.getTargets()) {
|
for (UUID target : multiTarget.getTargets()) {
|
||||||
Permanent permanent = game.getPermanent(target);
|
Permanent permanent = game.getPermanent(target);
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
permanents.add(permanent);
|
permanents.add(permanent);
|
||||||
|
@ -118,7 +114,7 @@ class PolukranosWorldEaterEffect extends OneShotEffect {
|
||||||
// Each of those creatures deals damage equal to its power to Polukranos
|
// Each of those creatures deals damage equal to its power to Polukranos
|
||||||
Permanent sourceCreature = game.getPermanent(source.getSourceId());
|
Permanent sourceCreature = game.getPermanent(source.getSourceId());
|
||||||
if (sourceCreature != null) {
|
if (sourceCreature != null) {
|
||||||
for (Permanent permanent :permanents) {
|
for (Permanent permanent : permanents) {
|
||||||
sourceCreature.damage(permanent.getPower().getValue(), permanent.getId(), game, false, true);
|
sourceCreature.damage(permanent.getPower().getValue(), permanent.getId(), game, false, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@ import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.common.TargetCardInYourGraveyard;
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -34,6 +35,7 @@ public final class PostmortemLunge extends CardImpl {
|
||||||
// Return target creature card with converted mana cost X from your graveyard to the battlefield. It gains haste. Exile it at the beginning of the next end step.
|
// Return target creature card with converted mana cost X from your graveyard to the battlefield. It gains haste. Exile it at the beginning of the next end step.
|
||||||
this.getSpellAbility().addEffect(new PostmortemLungeEffect());
|
this.getSpellAbility().addEffect(new PostmortemLungeEffect());
|
||||||
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD));
|
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD));
|
||||||
|
this.getSpellAbility().setTargetAdjuster(PostmortemLungeAdjuster.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PostmortemLunge(final PostmortemLunge card) {
|
public PostmortemLunge(final PostmortemLunge card) {
|
||||||
|
@ -44,16 +46,18 @@ public final class PostmortemLunge extends CardImpl {
|
||||||
public PostmortemLunge copy() {
|
public PostmortemLunge copy() {
|
||||||
return new PostmortemLunge(this);
|
return new PostmortemLunge(this);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum PostmortemLungeAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability.getAbilityType() == AbilityType.SPELL) { // otherwise the target is also added to the delayed triggered ability
|
ability.getTargets().clear();
|
||||||
ability.getTargets().clear();
|
int xValue = ability.getManaCostsToPay().getX();
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
FilterCard filter = new FilterCreatureCard("creature card with converted mana cost " + xValue + " or less from your graveyard");
|
||||||
FilterCard filter = new FilterCreatureCard("creature card with converted mana cost " + xValue + " or less from your graveyard");
|
filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, xValue + 1));
|
||||||
filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, xValue + 1));
|
ability.getTargets().add(new TargetCardInYourGraveyard(filter));
|
||||||
ability.getTargets().add(new TargetCardInYourGraveyard(filter));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.p;
|
package mage.cards.p;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.condition.common.KickedCondition;
|
import mage.abilities.condition.common.KickedCondition;
|
||||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||||
import mage.abilities.effects.common.DrawDiscardControllerEffect;
|
import mage.abilities.effects.common.DrawDiscardControllerEffect;
|
||||||
|
@ -14,9 +12,11 @@ import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.TargetPlayer;
|
import mage.target.TargetPlayer;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author fireshoes
|
* @author fireshoes
|
||||||
*/
|
*/
|
||||||
public final class Probe extends CardImpl {
|
public final class Probe extends CardImpl {
|
||||||
|
@ -33,16 +33,7 @@ public final class Probe extends CardImpl {
|
||||||
new DiscardTargetEffect(2),
|
new DiscardTargetEffect(2),
|
||||||
KickedCondition.instance,
|
KickedCondition.instance,
|
||||||
"<br><br>if this spell was kicked, target player discards two cards"));
|
"<br><br>if this spell was kicked, target player discards two cards"));
|
||||||
}
|
this.getSpellAbility().setTargetAdjuster(ProbeAdjuster.instance);
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof SpellAbility) {
|
|
||||||
ability.getTargets().clear();
|
|
||||||
if (KickedCondition.instance.apply(game, ability)) {
|
|
||||||
ability.addTarget(new TargetPlayer());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Probe(final Probe card) {
|
public Probe(final Probe card) {
|
||||||
|
@ -54,3 +45,15 @@ public final class Probe extends CardImpl {
|
||||||
return new Probe(this);
|
return new Probe(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum ProbeAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
ability.getTargets().clear();
|
||||||
|
if (KickedCondition.instance.apply(game, ability)) {
|
||||||
|
ability.addTarget(new TargetPlayer());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.p;
|
package mage.cards.p;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.Mode;
|
import mage.abilities.Mode;
|
||||||
import mage.abilities.dynamicvalue.DynamicValue;
|
import mage.abilities.dynamicvalue.DynamicValue;
|
||||||
|
@ -26,6 +25,9 @@ import mage.game.Game;
|
||||||
import mage.target.TargetPlayer;
|
import mage.target.TargetPlayer;
|
||||||
import mage.target.common.TargetCardInYourGraveyard;
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
|
@ -64,27 +66,8 @@ public final class ProfaneCommand extends CardImpl {
|
||||||
mode.addEffect(effect);
|
mode.addEffect(effect);
|
||||||
mode.addTarget(new TargetCreaturePermanent(0, 1));
|
mode.addTarget(new TargetCreaturePermanent(0, 1));
|
||||||
this.getSpellAbility().addMode(mode);
|
this.getSpellAbility().addMode(mode);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
this.getSpellAbility().setTargetAdjuster(ProfaneCommandAdjuster.instance);
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
// adjust targets is called for every selected mode
|
|
||||||
Mode mode = ability.getModes().getMode();
|
|
||||||
for (Effect effect : mode.getEffects()) {
|
|
||||||
if (effect instanceof ReturnFromGraveyardToBattlefieldTargetEffect) {
|
|
||||||
mode.getTargets().clear();
|
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
|
||||||
FilterCard filter = new FilterCreatureCard("creature card with converted mana cost " + xValue + " or less from your graveyard");
|
|
||||||
filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, xValue + 1));
|
|
||||||
mode.addTarget(new TargetCardInYourGraveyard(filter));
|
|
||||||
}
|
|
||||||
if (effect instanceof GainAbilityTargetEffect) {
|
|
||||||
mode.getTargets().clear();
|
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures gain fear until end of turn");
|
|
||||||
mode.addTarget(new TargetCreaturePermanent(0, xValue, filter, false));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProfaneCommand(final ProfaneCommand card) {
|
public ProfaneCommand(final ProfaneCommand card) {
|
||||||
|
@ -96,3 +79,27 @@ public final class ProfaneCommand extends CardImpl {
|
||||||
return new ProfaneCommand(this);
|
return new ProfaneCommand(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum ProfaneCommandAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
// adjust targets is called for every selected mode
|
||||||
|
Mode mode = ability.getModes().getMode();
|
||||||
|
int xValue = ability.getManaCostsToPay().getX();
|
||||||
|
for (Effect effect : mode.getEffects()) {
|
||||||
|
if (effect instanceof ReturnFromGraveyardToBattlefieldTargetEffect) {
|
||||||
|
mode.getTargets().clear();
|
||||||
|
FilterCard filter = new FilterCreatureCard("creature card with converted mana cost " + xValue + " or less from your graveyard");
|
||||||
|
filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, xValue + 1));
|
||||||
|
mode.addTarget(new TargetCardInYourGraveyard(filter));
|
||||||
|
}
|
||||||
|
if (effect instanceof GainAbilityTargetEffect) {
|
||||||
|
mode.getTargets().clear();
|
||||||
|
FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures gain fear until end of turn");
|
||||||
|
mode.addTarget(new TargetCreaturePermanent(0, xValue, filter, false));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.q;
|
package mage.cards.q;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldAbility;
|
import mage.abilities.common.EntersBattlefieldAbility;
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
|
@ -21,10 +20,12 @@ import mage.filter.predicate.permanent.ControllerPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
import mage.util.CardUtil;
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class QuarantineField extends CardImpl {
|
public final class QuarantineField extends CardImpl {
|
||||||
|
@ -35,42 +36,43 @@ public final class QuarantineField extends CardImpl {
|
||||||
// Quarantine Field enters the battlefield with X isolation counters on it.
|
// Quarantine Field enters the battlefield with X isolation counters on it.
|
||||||
this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.ISOLATION.createInstance())));
|
this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.ISOLATION.createInstance())));
|
||||||
|
|
||||||
// When Quarantine Field enters the battlefield, for each isolation counter on it, exile up to one target nonland permanent an opponenet controls until Quarantine Field leaves the battlefield.
|
// When Quarantine Field enters the battlefield, for each isolation counter on it, exile up to one target nonland permanent an opponent controls until Quarantine Field leaves the battlefield.
|
||||||
Ability ability = new EntersBattlefieldTriggeredAbility(new QuarantineFieldEffect(), false);
|
Ability ability = new EntersBattlefieldTriggeredAbility(new QuarantineFieldEffect(), false);
|
||||||
ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility()));
|
ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility()));
|
||||||
|
ability.setTargetAdjuster(QuarantineFieldAdjuster.instance);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public QuarantineField(final QuarantineField card) {
|
public QuarantineField(final QuarantineField card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
|
||||||
if (ability instanceof EntersBattlefieldTriggeredAbility) {
|
|
||||||
Permanent sourceObject = game.getPermanent(ability.getSourceId());
|
|
||||||
if (sourceObject != null) {
|
|
||||||
int isolationCounters = sourceObject.getCounters(game).getCount(CounterType.ISOLATION);
|
|
||||||
FilterNonlandPermanent filter = new FilterNonlandPermanent("up to " + isolationCounters + " nonland permanents controlled by any opponents");
|
|
||||||
filter.add(new ControllerPredicate(TargetController.OPPONENT));
|
|
||||||
ability.addTarget(new TargetPermanent(0, isolationCounters, filter, false));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QuarantineField copy() {
|
public QuarantineField copy() {
|
||||||
return new QuarantineField(this);
|
return new QuarantineField(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum QuarantineFieldAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
Permanent sourceObject = game.getPermanent(ability.getSourceId());
|
||||||
|
if (sourceObject != null) {
|
||||||
|
int isolationCounters = sourceObject.getCounters(game).getCount(CounterType.ISOLATION);
|
||||||
|
FilterNonlandPermanent filter = new FilterNonlandPermanent("up to " + isolationCounters + " nonland permanents controlled by an opponent");
|
||||||
|
filter.add(new ControllerPredicate(TargetController.OPPONENT));
|
||||||
|
ability.addTarget(new TargetPermanent(0, isolationCounters, filter, false));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class QuarantineFieldEffect extends OneShotEffect {
|
class QuarantineFieldEffect extends OneShotEffect {
|
||||||
|
|
||||||
public QuarantineFieldEffect() {
|
public QuarantineFieldEffect() {
|
||||||
super(Outcome.Exile);
|
super(Outcome.Exile);
|
||||||
this.staticText = "for each isolation counter on it, exile up to one target nonland permanent an opponenet controls until {this} leaves the battlefield";
|
this.staticText = "for each isolation counter on it, exile up to one target nonland permanent an opponent controls until {this} leaves the battlefield";
|
||||||
}
|
}
|
||||||
|
|
||||||
public QuarantineFieldEffect(final QuarantineFieldEffect effect) {
|
public QuarantineFieldEffect(final QuarantineFieldEffect effect) {
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue