mirror of
https://github.com/correl/mage.git
synced 2024-12-27 11:07:39 +00:00
updated target adjusters E through M
This commit is contained in:
parent
f6ed3a4d19
commit
1e94ebdd82
21 changed files with 480 additions and 495 deletions
|
@ -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,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(new StringBuilder(xValue).append(xValue != 1 ? " creature cards" : "creature card").append(" from your graveyard").toString()));
|
|
||||||
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.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,22 +40,31 @@ 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);
|
|
||||||
|
public KarplusanMinotaur(final KarplusanMinotaur card) {
|
||||||
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public KarplusanMinotaur copy() {
|
||||||
|
return new KarplusanMinotaur(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum KarplusanMinotaurAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability instanceof KarplusanMinotaurFlipLoseTriggeredAbility) {
|
|
||||||
Player controller = game.getPlayer(ability.getControllerId());
|
Player controller = game.getPlayer(ability.getControllerId());
|
||||||
if (controller != null) {
|
if (controller == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
UUID opponentId = null;
|
UUID opponentId = null;
|
||||||
if (game.getOpponents(controller.getId()).size() > 1) {
|
if (game.getOpponents(controller.getId()).size() > 1) {
|
||||||
Target target = new TargetOpponent(true);
|
Target target = new TargetOpponent(true);
|
||||||
|
@ -68,23 +78,13 @@ public final class KarplusanMinotaur extends CardImpl {
|
||||||
ability.getTargets().get(0).setTargetController(opponentId);
|
ability.getTargets().get(0).setTargetController(opponentId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public KarplusanMinotaur(final KarplusanMinotaur card) {
|
|
||||||
super(card);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public KarplusanMinotaur copy() {
|
|
||||||
return new KarplusanMinotaur(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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,41 +11,42 @@ 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) {
|
||||||
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(new StringBuilder("creature with power ").append(xValue).append(" or less").toString());
|
|
||||||
filter.add(new PowerPredicate(ComparisonType.FEWER_THAN, xValue + 1));
|
|
||||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public KillingGlare copy() {
|
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,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) {
|
||||||
|
|
|
@ -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,18 +48,25 @@ 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 MartyrOfBones copy() {
|
||||||
|
return new MartyrOfBones(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum MartyrOfBonesAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability.getOriginalId().equals(originalId)) {
|
|
||||||
int amount = 0;
|
int amount = 0;
|
||||||
for (Cost cost : ability.getCosts()) {
|
for (Cost cost : ability.getCosts()) {
|
||||||
if (cost instanceof RevealVariableBlackCardsFromHandCost) {
|
if (cost instanceof RevealVariableBlackCardsFromHandCost) {
|
||||||
|
@ -70,12 +76,6 @@ public final class MartyrOfBones extends CardImpl {
|
||||||
ability.getTargets().clear();
|
ability.getTargets().clear();
|
||||||
ability.addTarget(new TargetCardInASingleGraveyard(0, amount, new FilterCard()));
|
ability.addTarget(new TargetCardInASingleGraveyard(0, amount, new FilterCard()));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public MartyrOfBones copy() {
|
|
||||||
return new MartyrOfBones(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class RevealVariableBlackCardsFromHandCost extends VariableCostImpl {
|
class RevealVariableBlackCardsFromHandCost extends VariableCostImpl {
|
||||||
|
|
|
@ -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,36 +19,54 @@ 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();
|
}
|
||||||
|
|
||||||
|
public MoggAssassin(final MoggAssassin card) {
|
||||||
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MoggAssassin copy() {
|
||||||
|
return new MoggAssassin(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
enum MoggAssassinAdjuster implements TargetAdjuster {
|
||||||
|
instance;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability.getOriginalId().equals(originalId)) {
|
|
||||||
Player controller = game.getPlayer(ability.getControllerId());
|
Player controller = game.getPlayer(ability.getControllerId());
|
||||||
if (controller != null) {
|
if (controller == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
UUID opponentId = null;
|
UUID opponentId = null;
|
||||||
if (game.getOpponents(controller.getId()).size() > 1) {
|
if (game.getOpponents(controller.getId()).size() > 1) {
|
||||||
Target target = ability.getTargets().get(0);
|
Target target = ability.getTargets().get(0);
|
||||||
|
@ -67,19 +84,6 @@ public final class MoggAssassin extends CardImpl {
|
||||||
ability.getTargets().get(1).setTargetController(opponentId);
|
ability.getTargets().get(1).setTargetController(opponentId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public MoggAssassin(final MoggAssassin card) {
|
|
||||||
super(card);
|
|
||||||
this.originalId = card.originalId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public MoggAssassin copy() {
|
|
||||||
return new MoggAssassin(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class MoggAssassinEffect extends OneShotEffect {
|
class MoggAssassinEffect extends OneShotEffect {
|
||||||
|
@ -100,9 +104,10 @@ 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) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
Permanent chosenPermanent = game.getPermanent(source.getTargets().get(0).getFirstTarget());
|
Permanent chosenPermanent = game.getPermanent(source.getTargets().get(0).getFirstTarget());
|
||||||
Permanent opponentsPermanent = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
Permanent opponentsPermanent = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
||||||
if (controller.flipCoin(game)) {
|
if (controller.flipCoin(game)) {
|
||||||
|
@ -116,7 +121,6 @@ class MoggAssassinEffect extends OneShotEffect {
|
||||||
return true;
|
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);
|
||||||
|
|
||||||
|
@ -38,21 +39,10 @@ public final class MogissMarauder extends CardImpl {
|
||||||
"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.abilities.effects.common;
|
package mage.abilities.effects.common;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.Mode;
|
import mage.abilities.Mode;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
@ -13,8 +12,9 @@ import mage.target.targetpointer.FirstTargetPointer;
|
||||||
import mage.target.targetpointer.SecondTargetPointer;
|
import mage.target.targetpointer.SecondTargetPointer;
|
||||||
import mage.util.CardUtil;
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
*/
|
*/
|
||||||
public class DestroyTargetEffect extends OneShotEffect {
|
public class DestroyTargetEffect extends OneShotEffect {
|
||||||
|
@ -27,14 +27,18 @@ public class DestroyTargetEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
|
|
||||||
public DestroyTargetEffect(String ruleText) {
|
public DestroyTargetEffect(String ruleText) {
|
||||||
this(false);
|
this(ruleText, false);
|
||||||
staticText = ruleText;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public DestroyTargetEffect(boolean noRegen) {
|
public DestroyTargetEffect(boolean noRegen) {
|
||||||
this(noRegen, false);
|
this(noRegen, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DestroyTargetEffect(String ruleText, boolean noRegen) {
|
||||||
|
this(noRegen, false);
|
||||||
|
staticText = ruleText;
|
||||||
|
}
|
||||||
|
|
||||||
public DestroyTargetEffect(boolean noRegen, boolean multitargetHandling) {
|
public DestroyTargetEffect(boolean noRegen, boolean multitargetHandling) {
|
||||||
super(Outcome.DestroyPermanent);
|
super(Outcome.DestroyPermanent);
|
||||||
this.noRegen = noRegen;
|
this.noRegen = noRegen;
|
||||||
|
|
Loading…
Reference in a new issue