1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-09 17:00:09 -09:00

updated cards J-N

This commit is contained in:
Evan Kranzler 2019-12-28 21:57:17 -05:00
parent f0e0493b18
commit d8a6007ec5
13 changed files with 178 additions and 204 deletions

View file

@ -3,7 +3,6 @@ package mage.cards.k;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.DevotionCount; import mage.abilities.dynamicvalue.common.DevotionCount;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.LoseCreatureTypeSourceEffect; import mage.abilities.effects.common.continuous.LoseCreatureTypeSourceEffect;
@ -12,7 +11,9 @@ import mage.abilities.hint.ValueHint;
import mage.abilities.keyword.IndestructibleAbility; import mage.abilities.keyword.IndestructibleAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.StaticFilters; import mage.filter.StaticFilters;
import mage.filter.predicate.Predicates; import mage.filter.predicate.Predicates;
@ -31,11 +32,10 @@ public final class KarametraGodOfHarvests extends CardImpl {
static { static {
filter.add(Predicates.or( filter.add(Predicates.or(
new SubtypePredicate(SubType.FOREST), new SubtypePredicate(SubType.FOREST),
new SubtypePredicate(SubType.PLAINS))); new SubtypePredicate(SubType.PLAINS)
));
} }
private static final DynamicValue xValue = new DevotionCount(ColoredManaSymbol.G, ColoredManaSymbol.W);
public KarametraGodOfHarvests(UUID ownerId, CardSetInfo setInfo) { public KarametraGodOfHarvests(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{3}{G}{W}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{3}{G}{W}");
addSuperType(SuperType.LEGENDARY); addSuperType(SuperType.LEGENDARY);
@ -48,13 +48,15 @@ public final class KarametraGodOfHarvests extends CardImpl {
this.addAbility(IndestructibleAbility.getInstance()); this.addAbility(IndestructibleAbility.getInstance());
// As long as your devotion to green and white is less than seven, Karametra isn't a creature. // As long as your devotion to green and white is less than seven, Karametra isn't a creature.
Effect effect = new LoseCreatureTypeSourceEffect(xValue, 7); Effect effect = new LoseCreatureTypeSourceEffect(DevotionCount.GW, 7);
effect.setText("As long as your devotion to green and white is less than seven, Karametra isn't a creature"); effect.setText("As long as your devotion to green and white is less than seven, {this} isn't a creature");
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect).addHint(new ValueHint("Devotion to green and white", xValue))); this.addAbility(new SimpleStaticAbility(effect).addHint(new ValueHint("Devotion to green and white", DevotionCount.GW)));
// Whenever you cast a creature spell, you may search your library for a Forest or Plains card, put it onto the battlefield tapped, then shuffle your library. // Whenever you cast a creature spell, you may search your library for a Forest or Plains card, put it onto the battlefield tapped, then shuffle your library.
this.addAbility(new SpellCastControllerTriggeredAbility( this.addAbility(new SpellCastControllerTriggeredAbility(
new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter), true), StaticFilters.FILTER_SPELL_A_CREATURE, true)); new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter), true),
StaticFilters.FILTER_SPELL_A_CREATURE, true
));
} }
public KarametraGodOfHarvests(final KarametraGodOfHarvests card) { public KarametraGodOfHarvests(final KarametraGodOfHarvests card) {

View file

@ -2,14 +2,12 @@ package mage.cards.k;
import mage.MageInt; import mage.MageInt;
import mage.Mana; import mage.Mana;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.DevotionCount; import mage.abilities.dynamicvalue.common.DevotionCount;
import mage.abilities.hint.ValueHint; import mage.abilities.hint.ValueHint;
import mage.abilities.mana.DynamicManaAbility; import mage.abilities.mana.DynamicManaAbility;
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.ColoredManaSymbol;
import mage.constants.SubType; import mage.constants.SubType;
import java.util.UUID; import java.util.UUID;
@ -19,8 +17,6 @@ import java.util.UUID;
*/ */
public final class KarametrasAcolyte extends CardImpl { public final class KarametrasAcolyte extends CardImpl {
private static final DynamicValue xValue = new DevotionCount(ColoredManaSymbol.G);
public KarametrasAcolyte(UUID ownerId, CardSetInfo setInfo) { public KarametrasAcolyte(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}");
this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.HUMAN);
@ -30,9 +26,10 @@ public final class KarametrasAcolyte extends CardImpl {
this.toughness = new MageInt(4); this.toughness = new MageInt(4);
// {T}: Add an amount of {G} equal to your devotion to green. // {T}: Add an amount of {G} equal to your devotion to green.
this.addAbility(new DynamicManaAbility(Mana.GreenMana(1), xValue, this.addAbility(new DynamicManaAbility(
"Add an amount of {G} equal to your devotion to green. (Each {G} in the mana costs of permanents you control counts towards your devotion to green.)") Mana.GreenMana(1), DevotionCount.G, "Add an amount of {G} equal to your devotion to green. " +
.addHint(new ValueHint("Devotion to green", xValue))); "(Each {G} in the mana costs of permanents you control counts towards your devotion to green.)"
).addHint(new ValueHint("Devotion to green", DevotionCount.G)));
} }
public KarametrasAcolyte(final KarametrasAcolyte card) { public KarametrasAcolyte(final KarametrasAcolyte card) {

View file

@ -3,7 +3,6 @@ package mage.cards.k;
import mage.MageInt; import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl; import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.DevotionCount; import mage.abilities.dynamicvalue.common.DevotionCount;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.DamageTargetEffect;
@ -16,7 +15,10 @@ import mage.cards.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.cards.CardsImpl; import mage.cards.CardsImpl;
import mage.constants.*; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType; import mage.game.events.GameEvent.EventType;
@ -32,8 +34,6 @@ import java.util.UUID;
*/ */
public final class KeranosGodOfStorms extends CardImpl { public final class KeranosGodOfStorms extends CardImpl {
private static final DynamicValue xValue = new DevotionCount(ColoredManaSymbol.U, ColoredManaSymbol.R);
public KeranosGodOfStorms(UUID ownerId, CardSetInfo setInfo) { public KeranosGodOfStorms(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{3}{U}{R}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{3}{U}{R}");
addSuperType(SuperType.LEGENDARY); addSuperType(SuperType.LEGENDARY);
@ -46,16 +46,14 @@ public final class KeranosGodOfStorms extends CardImpl {
this.addAbility(IndestructibleAbility.getInstance()); this.addAbility(IndestructibleAbility.getInstance());
// As long as your devotion to blue and red is less than seven, Keranos isn't a creature. // As long as your devotion to blue and red is less than seven, Keranos isn't a creature.
Effect effect = new LoseCreatureTypeSourceEffect(xValue, 7); Effect effect = new LoseCreatureTypeSourceEffect(DevotionCount.UR, 7);
effect.setText("As long as your devotion to blue and red is less than seven, Keranos isn't a creature"); effect.setText("As long as your devotion to blue and red is less than seven, {this} isn't a creature");
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect).addHint(new ValueHint("Devotion to blue and red", xValue))); this.addAbility(new SimpleStaticAbility(effect).addHint(new ValueHint("Devotion to blue and red", DevotionCount.UR)));
// Reveal the first card you draw on each of your turns. // Reveal the first card you draw on each of your turns.
// Whenever you reveal a land card this way, draw a card. // Whenever you reveal a land card this way, draw a card.
// Whenever you reveal a nonland card this way, Keranos deals 3 damage to any target. // Whenever you reveal a nonland card this way, Keranos deals 3 damage to any target.
this.addAbility(new KeranosGodOfStormsTriggeredAbility(), new CardsAmountDrawnThisTurnWatcher()); this.addAbility(new KeranosGodOfStormsTriggeredAbility(), new CardsAmountDrawnThisTurnWatcher());
} }
public KeranosGodOfStorms(final KeranosGodOfStorms card) { public KeranosGodOfStorms(final KeranosGodOfStorms card) {
@ -74,7 +72,7 @@ class KeranosGodOfStormsTriggeredAbility extends TriggeredAbilityImpl {
super(Zone.BATTLEFIELD, new InfoEffect(""), false); super(Zone.BATTLEFIELD, new InfoEffect(""), false);
} }
KeranosGodOfStormsTriggeredAbility(final KeranosGodOfStormsTriggeredAbility ability) { private KeranosGodOfStormsTriggeredAbility(final KeranosGodOfStormsTriggeredAbility ability) {
super(ability); super(ability);
} }
@ -90,36 +88,38 @@ class KeranosGodOfStormsTriggeredAbility extends TriggeredAbilityImpl {
@Override @Override
public boolean checkTrigger(GameEvent event, Game game) { public boolean checkTrigger(GameEvent event, Game game) {
if (event.getPlayerId().equals(this.getControllerId())) { if (!event.getPlayerId().equals(this.getControllerId())) {
if (game.isActivePlayer(this.getControllerId())) { return false;
CardsAmountDrawnThisTurnWatcher watcher =
game.getState().getWatcher(CardsAmountDrawnThisTurnWatcher.class);
if (watcher != null && watcher.getAmountCardsDrawn(event.getPlayerId()) != 1) {
return false;
}
Card card = game.getCard(event.getTargetId());
Player controller = game.getPlayer(this.getControllerId());
Permanent sourcePermanent = (Permanent) getSourceObject(game);
if (card != null && controller != null && sourcePermanent != null) {
controller.revealCards(sourcePermanent.getIdName(), new CardsImpl(card), game);
this.getTargets().clear();
this.getEffects().clear();
if (card.isLand()) {
this.addEffect(new DrawCardSourceControllerEffect(1));
} else {
this.addEffect(new DamageTargetEffect(3));
this.addTarget(new TargetAnyTarget());
}
return true;
}
}
} }
return false; if (!game.isActivePlayer(this.getControllerId())) {
return false;
}
CardsAmountDrawnThisTurnWatcher watcher =
game.getState().getWatcher(CardsAmountDrawnThisTurnWatcher.class);
if (watcher != null && watcher.getAmountCardsDrawn(event.getPlayerId()) != 1) {
return false;
}
Card card = game.getCard(event.getTargetId());
Player controller = game.getPlayer(this.getControllerId());
Permanent sourcePermanent = (Permanent) getSourceObject(game);
if (card == null || controller == null || sourcePermanent == null) {
return false;
}
controller.revealCards(sourcePermanent.getIdName(), new CardsImpl(card), game);
this.getTargets().clear();
this.getEffects().clear();
if (card.isLand()) {
this.addEffect(new DrawCardSourceControllerEffect(1));
} else {
this.addEffect(new DamageTargetEffect(3));
this.addTarget(new TargetAnyTarget());
}
return true;
} }
@Override @Override
public String getRule() { public String getRule() {
return "Reveal the first card you draw on each of your turns. Whenever you reveal a land card this way, draw a card. " + return "Reveal the first card you draw on each of your turns. Whenever you reveal a land card this way, draw a card. " +
"Whenever you reveal a nonland card this way, Keranos deals 3 damage to any target."; "Whenever you reveal a nonland card this way, {this} deals 3 damage to any target.";
} }
} }

View file

@ -5,7 +5,6 @@ import mage.Mana;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.BeginningOfPreCombatMainTriggeredAbility; import mage.abilities.common.BeginningOfPreCombatMainTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.DevotionCount; import mage.abilities.dynamicvalue.common.DevotionCount;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
@ -28,8 +27,6 @@ import java.util.UUID;
*/ */
public final class KlothysGodOfDestiny extends CardImpl { public final class KlothysGodOfDestiny extends CardImpl {
private static final DynamicValue xValue = new DevotionCount(ColoredManaSymbol.R, ColoredManaSymbol.G);
public KlothysGodOfDestiny(UUID ownerId, CardSetInfo setInfo) { public KlothysGodOfDestiny(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{1}{R}{G}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{1}{R}{G}");
@ -42,9 +39,9 @@ public final class KlothysGodOfDestiny extends CardImpl {
this.addAbility(IndestructibleAbility.getInstance()); this.addAbility(IndestructibleAbility.getInstance());
// As long as your devotion to red and green is less than seven, Klothys isn't a creature. // As long as your devotion to red and green is less than seven, Klothys isn't a creature.
Effect effect = new LoseCreatureTypeSourceEffect(xValue, 7); Effect effect = new LoseCreatureTypeSourceEffect(DevotionCount.RG, 7);
effect.setText("As long as your devotion to red and green is less than seven, {this} isn't a creature"); effect.setText("As long as your devotion to red and green is less than seven, {this} isn't a creature");
this.addAbility(new SimpleStaticAbility(effect).addHint(new ValueHint("Devotion to red and green", xValue))); this.addAbility(new SimpleStaticAbility(effect).addHint(new ValueHint("Devotion to red and green", DevotionCount.RG)));
// At the beginning of your precombat main phase, exile target card from a graveyard. If it was a land card, add {R} or {G}. Otherwise, you gain 2 life and Klothys deals 2 damage to each opponent. // At the beginning of your precombat main phase, exile target card from a graveyard. If it was a land card, add {R} or {G}. Otherwise, you gain 2 life and Klothys deals 2 damage to each opponent.
Ability ability = new BeginningOfPreCombatMainTriggeredAbility( Ability ability = new BeginningOfPreCombatMainTriggeredAbility(

View file

@ -1,13 +1,11 @@
package mage.cards.k; package mage.cards.k;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.DevotionCount; import mage.abilities.dynamicvalue.common.DevotionCount;
import mage.abilities.effects.common.continuous.BoostControlledEffect; import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.abilities.hint.ValueHint; import mage.abilities.hint.ValueHint;
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.ColoredManaSymbol;
import mage.constants.Duration; import mage.constants.Duration;
import mage.filter.StaticFilters; import mage.filter.StaticFilters;
@ -18,18 +16,16 @@ import java.util.UUID;
*/ */
public final class KlothyssDesign extends CardImpl { public final class KlothyssDesign extends CardImpl {
private static final DynamicValue xValue = new DevotionCount(ColoredManaSymbol.G);
public KlothyssDesign(UUID ownerId, CardSetInfo setInfo) { public KlothyssDesign(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{5}{G}"); super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{5}{G}");
// Creatures you control get +X/+X until end of turn, where X is your devotion to green. // Creatures you control get +X/+X until end of turn, where X is your devotion to green.
this.getSpellAbility().addEffect(new BoostControlledEffect( this.getSpellAbility().addEffect(new BoostControlledEffect(
xValue, xValue, Duration.EndOfTurn, DevotionCount.G, DevotionCount.G, Duration.EndOfTurn,
StaticFilters.FILTER_PERMANENT_CREATURES, StaticFilters.FILTER_PERMANENT_CREATURES,
false, true false, true
)); ));
this.getSpellAbility().addHint(new ValueHint("Devotion to green", xValue)); this.getSpellAbility().addHint(new ValueHint("Devotion to green", DevotionCount.G));
} }
private KlothyssDesign(final KlothyssDesign card) { private KlothyssDesign(final KlothyssDesign card) {

View file

@ -3,7 +3,6 @@ package mage.cards.k;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.DevotionCount; import mage.abilities.dynamicvalue.common.DevotionCount;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.ReplacementEffectImpl;
@ -24,8 +23,6 @@ import java.util.UUID;
*/ */
public final class KruphixGodOfHorizons extends CardImpl { public final class KruphixGodOfHorizons extends CardImpl {
private static final DynamicValue xValue = new DevotionCount(ColoredManaSymbol.G, ColoredManaSymbol.U);
public KruphixGodOfHorizons(UUID ownerId, CardSetInfo setInfo) { public KruphixGodOfHorizons(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{3}{G}{U}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{3}{G}{U}");
addSuperType(SuperType.LEGENDARY); addSuperType(SuperType.LEGENDARY);
@ -36,20 +33,23 @@ public final class KruphixGodOfHorizons extends CardImpl {
// Indestructible // Indestructible
this.addAbility(IndestructibleAbility.getInstance()); this.addAbility(IndestructibleAbility.getInstance());
// As long as your devotion to green and blue is less than seven, Kruhpix isn't a creature. // As long as your devotion to green and blue is less than seven, Kruhpix isn't a creature.
Effect effect = new LoseCreatureTypeSourceEffect(xValue, 7); Effect effect = new LoseCreatureTypeSourceEffect(DevotionCount.GU, 7);
effect.setText("As long as your devotion to green and blue is less than seven, Kruhpix isn't a creature"); effect.setText("As long as your devotion to green and blue is less than seven, {this} isn't a creature");
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect).addHint(new ValueHint("Devotion to green and blue", xValue))); this.addAbility(new SimpleStaticAbility(effect).addHint(new ValueHint("Devotion to green and blue", DevotionCount.GU)));
// You have no maximum hand size. // You have no maximum hand size.
effect = new MaximumHandSizeControllerEffect(Integer.MAX_VALUE, Duration.WhileOnBattlefield, MaximumHandSizeControllerEffect.HandSizeModification.SET); this.addAbility(new SimpleStaticAbility(new MaximumHandSizeControllerEffect(
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); Integer.MAX_VALUE, Duration.WhileOnBattlefield,
MaximumHandSizeControllerEffect.HandSizeModification.SET
)));
// If unused mana would empty from your mana pool, that mana becomes colorless instead. // If unused mana would empty from your mana pool, that mana becomes colorless instead.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new KruphixGodOfHorizonsEffect())); this.addAbility(new SimpleStaticAbility(new KruphixGodOfHorizonsEffect()));
} }
public KruphixGodOfHorizons(final KruphixGodOfHorizons card) { private KruphixGodOfHorizons(final KruphixGodOfHorizons card) {
super(card); super(card);
} }
@ -61,12 +61,12 @@ public final class KruphixGodOfHorizons extends CardImpl {
class KruphixGodOfHorizonsEffect extends ReplacementEffectImpl { class KruphixGodOfHorizonsEffect extends ReplacementEffectImpl {
public KruphixGodOfHorizonsEffect() { KruphixGodOfHorizonsEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit); super(Duration.WhileOnBattlefield, Outcome.Benefit);
staticText = "If you would lose unspent mana, that mana becomes colorless instead."; staticText = "If you would lose unspent mana, that mana becomes colorless instead.";
} }
public KruphixGodOfHorizonsEffect(final KruphixGodOfHorizonsEffect effect) { private KruphixGodOfHorizonsEffect(final KruphixGodOfHorizonsEffect effect) {
super(effect); super(effect);
} }

View file

@ -5,7 +5,6 @@ import mage.Mana;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.SpellAbility; import mage.abilities.SpellAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.DevotionCount; import mage.abilities.dynamicvalue.common.DevotionCount;
import mage.abilities.effects.common.cost.CostModificationEffectImpl; import mage.abilities.effects.common.cost.CostModificationEffectImpl;
import mage.abilities.hint.ValueHint; import mage.abilities.hint.ValueHint;
@ -30,10 +29,10 @@ public final class MarshmistTitan extends CardImpl {
// Marshmist Titan costs {X} less to cast, where X is your devotion to black. // Marshmist Titan costs {X} less to cast, where X is your devotion to black.
this.addAbility(new SimpleStaticAbility(Zone.STACK, new MarshmistTitanCostReductionEffect()) this.addAbility(new SimpleStaticAbility(Zone.STACK, new MarshmistTitanCostReductionEffect())
.addHint(new ValueHint("Devotion to black", MarshmistTitanCostReductionEffect.xValue))); .addHint(new ValueHint("Devotion to black", DevotionCount.B)));
} }
public MarshmistTitan(final MarshmistTitan card) { private MarshmistTitan(final MarshmistTitan card) {
super(card); super(card);
} }
@ -45,14 +44,13 @@ public final class MarshmistTitan extends CardImpl {
class MarshmistTitanCostReductionEffect extends CostModificationEffectImpl { class MarshmistTitanCostReductionEffect extends CostModificationEffectImpl {
static final DynamicValue xValue = new DevotionCount(ColoredManaSymbol.B); MarshmistTitanCostReductionEffect() {
public MarshmistTitanCostReductionEffect() {
super(Duration.Custom, Outcome.Benefit, CostModificationType.REDUCE_COST); super(Duration.Custom, Outcome.Benefit, CostModificationType.REDUCE_COST);
staticText = "{this} costs {X} less to cast, where X is your devotion to black <i>(Each {B} in the mana costs of permanents you control counts toward your devotion to black.)</i> "; staticText = "{this} costs {X} less to cast, where X is your devotion to black. " +
"<i>(Each {B} in the mana costs of permanents you control counts toward your devotion to black.)</i> ";
} }
public MarshmistTitanCostReductionEffect(final MarshmistTitanCostReductionEffect effect) { private MarshmistTitanCostReductionEffect(final MarshmistTitanCostReductionEffect effect) {
super(effect); super(effect);
} }
@ -60,22 +58,19 @@ class MarshmistTitanCostReductionEffect extends CostModificationEffectImpl {
public boolean apply(Game game, Ability source, Ability abilityToModify) { public boolean apply(Game game, Ability source, Ability abilityToModify) {
SpellAbility spellAbility = (SpellAbility) abilityToModify; SpellAbility spellAbility = (SpellAbility) abilityToModify;
Mana mana = spellAbility.getManaCostsToPay().getMana(); Mana mana = spellAbility.getManaCostsToPay().getMana();
if (mana.getGeneric() > 0) { if (mana.getGeneric() == 0) {
int count = xValue.calculate(game, source, this); return false;
int newCount = mana.getGeneric() - count;
if (newCount < 0) {
newCount = 0;
}
mana.setGeneric(newCount);
spellAbility.getManaCostsToPay().load(mana.toString());
return true;
} }
return false; int count = DevotionCount.B.calculate(game, source, this);
mana.setGeneric(Math.max(mana.getGeneric() - count, 0));
spellAbility.getManaCostsToPay().load(mana.toString());
return true;
} }
@Override @Override
public boolean applies(Ability abilityToModify, Ability source, Game game) { public boolean applies(Ability abilityToModify, Ability source, Game game) {
return abilityToModify.getSourceId().equals(source.getSourceId()) && (abilityToModify instanceof SpellAbility); return abilityToModify instanceof SpellAbility
&& abilityToModify.getSourceId().equals(source.getSourceId());
} }
@Override @Override

View file

@ -4,7 +4,6 @@ import mage.MageInt;
import mage.ObjectColor; import mage.ObjectColor;
import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.DevotionCount; import mage.abilities.dynamicvalue.common.DevotionCount;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.CreateTokenEffect;
@ -13,9 +12,10 @@ import mage.abilities.hint.ValueHint;
import mage.abilities.keyword.ProtectionAbility; import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.permanent.token.MasterOfWavesElementalToken; import mage.game.permanent.token.MasterOfWavesElementalToken;
import java.util.UUID; import java.util.UUID;
@ -25,13 +25,8 @@ import java.util.UUID;
*/ */
public final class MasterOfWaves extends CardImpl { public final class MasterOfWaves extends CardImpl {
private static final FilterCreaturePermanent filterBoost = new FilterCreaturePermanent("Elemental creatures"); private static final FilterCreaturePermanent filterBoost
= new FilterCreaturePermanent(SubType.ELEMENTAL, "Elemental creatures");
static {
filterBoost.add(new SubtypePredicate(SubType.ELEMENTAL));
}
private static final DynamicValue xValue = new DevotionCount(ColoredManaSymbol.U);
public MasterOfWaves(UUID ownerId, CardSetInfo setInfo) { public MasterOfWaves(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}");
@ -45,13 +40,15 @@ public final class MasterOfWaves extends CardImpl {
this.addAbility(ProtectionAbility.from(ObjectColor.RED)); this.addAbility(ProtectionAbility.from(ObjectColor.RED));
// Elemental creatures you control get +1/+1. // Elemental creatures you control get +1/+1.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filterBoost, false))); this.addAbility(new SimpleStaticAbility(new BoostControlledEffect(
1, 1, Duration.WhileOnBattlefield, filterBoost, false
)));
// When Master of Waves enters the battlefield, create a number of 1/0 blue Elemental creature tokens equal to your devotion to blue. // When Master of Waves enters the battlefield, create a number of 1/0 blue Elemental creature tokens equal to your devotion to blue.
// <i>(Each {U} in the mana costs of permanents you control counts toward your devotion to blue.)</i> // <i>(Each {U} in the mana costs of permanents you control counts toward your devotion to blue.)</i>
Effect effect = new CreateTokenEffect(new MasterOfWavesElementalToken(), xValue); Effect effect = new CreateTokenEffect(new MasterOfWavesElementalToken(), DevotionCount.U);
effect.setText("create a number of 1/0 blue Elemental creature tokens equal to your devotion to blue. <i>(Each {U} in the mana costs of permanents you control counts toward your devotion to blue.)</i>"); effect.setText("create a number of 1/0 blue Elemental creature tokens equal to your devotion to blue. <i>(Each {U} in the mana costs of permanents you control counts toward your devotion to blue.)</i>");
this.addAbility(new EntersBattlefieldTriggeredAbility(effect).addHint(new ValueHint("Devotion to blue", xValue))); this.addAbility(new EntersBattlefieldTriggeredAbility(effect).addHint(new ValueHint("Devotion to blue", DevotionCount.U)));
} }
public MasterOfWaves(final MasterOfWaves card) { public MasterOfWaves(final MasterOfWaves card) {

View file

@ -8,7 +8,6 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.Cost; import mage.abilities.costs.Cost;
import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.DevotionCount; import mage.abilities.dynamicvalue.common.DevotionCount;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
@ -34,8 +33,6 @@ import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT;
*/ */
public final class MogisGodOfSlaughter extends CardImpl { public final class MogisGodOfSlaughter extends CardImpl {
private static final DynamicValue xValue = new DevotionCount(ColoredManaSymbol.B, ColoredManaSymbol.R);
public MogisGodOfSlaughter(UUID ownerId, CardSetInfo setInfo) { public MogisGodOfSlaughter(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{2}{B}{R}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{2}{B}{R}");
addSuperType(SuperType.LEGENDARY); addSuperType(SuperType.LEGENDARY);
@ -48,9 +45,9 @@ public final class MogisGodOfSlaughter extends CardImpl {
this.addAbility(IndestructibleAbility.getInstance()); this.addAbility(IndestructibleAbility.getInstance());
// As long as your devotion to black and red is less than seven, Mogis isn't a creature. // As long as your devotion to black and red is less than seven, Mogis isn't a creature.
Effect effect = new LoseCreatureTypeSourceEffect(xValue, 7); Effect effect = new LoseCreatureTypeSourceEffect(DevotionCount.BR, 7);
effect.setText("As long as your devotion to black and red is less than seven, Mogis isn't a creature"); effect.setText("As long as your devotion to black and red is less than seven, {this} isn't a creature");
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect).addHint(new ValueHint("Devotion to black and red", xValue))); this.addAbility(new SimpleStaticAbility(effect).addHint(new ValueHint("Devotion to black and red", DevotionCount.BR)));
// At the beginning of each opponent's upkeep, Mogis deals 2 damage to that player unless they sacrifice a creature. // At the beginning of each opponent's upkeep, Mogis deals 2 damage to that player unless they sacrifice a creature.
effect = new DoUnlessTargetPaysCost(new DamageTargetEffect(2, true, "that player"), effect = new DoUnlessTargetPaysCost(new DamageTargetEffect(2, true, "that player"),
@ -61,7 +58,7 @@ public final class MogisGodOfSlaughter extends CardImpl {
this.addAbility(ability); this.addAbility(ability);
} }
public MogisGodOfSlaughter(final MogisGodOfSlaughter card) { private MogisGodOfSlaughter(final MogisGodOfSlaughter card) {
super(card); super(card);
} }

View file

@ -3,7 +3,6 @@ package mage.cards.m;
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.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.DevotionCount; import mage.abilities.dynamicvalue.common.DevotionCount;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.hint.ValueHint; import mage.abilities.hint.ValueHint;
@ -12,7 +11,6 @@ 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.ColoredManaSymbol;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType; import mage.constants.SubType;
import mage.game.Game; import mage.game.Game;
@ -36,16 +34,21 @@ public final class MogissMarauder extends CardImpl {
// When Mogis's Marauder enters the battlefield, up to X target creatures each gain intimidate and haste, where X is your devotion to black. // When Mogis's Marauder enters the battlefield, up to X target creatures each gain intimidate and haste, where X is your devotion to black.
Ability ability = new EntersBattlefieldTriggeredAbility( Ability ability = new EntersBattlefieldTriggeredAbility(
new GainAbilityTargetEffect(IntimidateAbility.getInstance(), Duration.EndOfTurn, new GainAbilityTargetEffect(
"up to X target creatures each gain intimidate"), false); IntimidateAbility.getInstance(), Duration.EndOfTurn,
ability.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn, "up to X target creatures each gain intimidate"
"and haste until end of turn, where X is your devotion to black")); ), false
);
ability.addEffect(new GainAbilityTargetEffect(
HasteAbility.getInstance(), Duration.EndOfTurn,
"and haste until end of turn, where X is your devotion to black"
));
ability.setTargetAdjuster(MogissMarauderAdjuster.instance); ability.setTargetAdjuster(MogissMarauderAdjuster.instance);
ability.addHint(new ValueHint("Devotion to black", MogissMarauderAdjuster.xValue)); ability.addHint(new ValueHint("Devotion to black", DevotionCount.B));
this.addAbility(ability); this.addAbility(ability);
} }
public MogissMarauder(final MogissMarauder card) { private MogissMarauder(final MogissMarauder card) {
super(card); super(card);
} }
@ -56,15 +59,12 @@ public final class MogissMarauder extends CardImpl {
} }
enum MogissMarauderAdjuster implements TargetAdjuster { enum MogissMarauderAdjuster implements TargetAdjuster {
instance; instance;
static final DynamicValue xValue = new DevotionCount(ColoredManaSymbol.B);
@Override @Override
public void adjustTargets(Ability ability, Game game) { public void adjustTargets(Ability ability, Game game) {
ability.getTargets().clear(); ability.getTargets().clear();
int numbTargets = xValue.calculate(game, ability, null); int numbTargets = DevotionCount.B.calculate(game, ability, null);
if (numbTargets > 0) { if (numbTargets > 0) {
ability.addTarget(new TargetCreaturePermanent(0, numbTargets)); ability.addTarget(new TargetCreaturePermanent(0, numbTargets));
} }

View file

@ -4,7 +4,6 @@ import mage.Mana;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.DevotionCount; import mage.abilities.dynamicvalue.common.DevotionCount;
import mage.abilities.effects.common.ManaEffect; import mage.abilities.effects.common.ManaEffect;
import mage.abilities.hint.ValueHint; import mage.abilities.hint.ValueHint;
@ -14,7 +13,6 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.choices.ChoiceColor; import mage.choices.ChoiceColor;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.ColoredManaSymbol;
import mage.constants.SuperType; import mage.constants.SuperType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
@ -23,6 +21,7 @@ import mage.players.Player;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import java.util.stream.Collectors;
/** /**
* @author LevelX2 * @author LevelX2
@ -37,15 +36,15 @@ public final class NykthosShrineToNyx extends CardImpl {
this.addAbility(new ColorlessManaAbility()); this.addAbility(new ColorlessManaAbility());
// {2}, {T}: Choose a color. Add an amount of mana of that color equal to your devotion to that color. // {2}, {T}: Choose a color. Add an amount of mana of that color equal to your devotion to that color.
Ability ability = new NykthosShrineToNyxManaAbility(); Ability ability = new NykthosShrineToNyxManaAbility();
ability.addHint(new ValueHint("Devotion to red", NykthosDynamicManaEffect.xValueR)); ability.addHint(new ValueHint("Devotion to white", DevotionCount.W));
ability.addHint(new ValueHint("Devotion to blue", NykthosDynamicManaEffect.xValueU)); ability.addHint(new ValueHint("Devotion to blue", DevotionCount.U));
ability.addHint(new ValueHint("Devotion to white", NykthosDynamicManaEffect.xValueW)); ability.addHint(new ValueHint("Devotion to black", DevotionCount.B));
ability.addHint(new ValueHint("Devotion to black", NykthosDynamicManaEffect.xValueB)); ability.addHint(new ValueHint("Devotion to red", DevotionCount.R));
ability.addHint(new ValueHint("Devotion to green", NykthosDynamicManaEffect.xValueG)); ability.addHint(new ValueHint("Devotion to green", DevotionCount.G));
this.addAbility(ability); this.addAbility(ability);
} }
public NykthosShrineToNyx(final NykthosShrineToNyx card) { private NykthosShrineToNyx(final NykthosShrineToNyx card) {
super(card); super(card);
} }
@ -57,12 +56,12 @@ public final class NykthosShrineToNyx extends CardImpl {
class NykthosShrineToNyxManaAbility extends ActivatedManaAbilityImpl { class NykthosShrineToNyxManaAbility extends ActivatedManaAbilityImpl {
public NykthosShrineToNyxManaAbility() { NykthosShrineToNyxManaAbility() {
super(Zone.BATTLEFIELD, new NykthosDynamicManaEffect(), new GenericManaCost(2)); super(Zone.BATTLEFIELD, new NykthosDynamicManaEffect(), new GenericManaCost(2));
this.addCost(new TapSourceCost()); this.addCost(new TapSourceCost());
} }
public NykthosShrineToNyxManaAbility(final NykthosShrineToNyxManaAbility ability) { private NykthosShrineToNyxManaAbility(final NykthosShrineToNyxManaAbility ability) {
super(ability); super(ability);
} }
@ -74,27 +73,22 @@ class NykthosShrineToNyxManaAbility extends ActivatedManaAbilityImpl {
@Override @Override
public List<Mana> getNetMana(Game game) { public List<Mana> getNetMana(Game game) {
ArrayList<Mana> netManaCopy = new ArrayList<>(); ArrayList<Mana> netManaCopy = new ArrayList<>();
if (game != null) { if (game == null) {
netManaCopy.addAll(((ManaEffect) this.getEffects().get(0)).getNetMana(game, this)); return netManaCopy;
} }
netManaCopy.addAll(((ManaEffect) this.getEffects().get(0)).getNetMana(game, this));
return netManaCopy; return netManaCopy;
} }
} }
class NykthosDynamicManaEffect extends ManaEffect { class NykthosDynamicManaEffect extends ManaEffect {
static final DynamicValue xValueR = new DevotionCount(ColoredManaSymbol.R); NykthosDynamicManaEffect() {
static final DynamicValue xValueU = new DevotionCount(ColoredManaSymbol.U);
static final DynamicValue xValueW = new DevotionCount(ColoredManaSymbol.W);
static final DynamicValue xValueB = new DevotionCount(ColoredManaSymbol.B);
static final DynamicValue xValueG = new DevotionCount(ColoredManaSymbol.G);
public NykthosDynamicManaEffect() {
super(); super();
this.staticText = "Choose a color. Add an amount of mana of that color equal to your devotion to that color. <i>(Your devotion to a color is the number of mana symbols of that color in the mana costs of permanents you control.)</i>"; this.staticText = "Choose a color. Add an amount of mana of that color equal to your devotion to that color. <i>(Your devotion to a color is the number of mana symbols of that color in the mana costs of permanents you control.)</i>";
} }
public NykthosDynamicManaEffect(final NykthosDynamicManaEffect effect) { private NykthosDynamicManaEffect(final NykthosDynamicManaEffect effect) {
super(effect); super(effect);
} }
@ -106,60 +100,59 @@ class NykthosDynamicManaEffect extends ManaEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) { if (controller == null) {
checkToFirePossibleEvents(getMana(game, source), game, source); return false;
controller.getManaPool().addMana(getMana(game, source), game, source);
return true;
} }
return false; checkToFirePossibleEvents(getMana(game, source), game, source);
controller.getManaPool().addMana(getMana(game, source), game, source);
return true;
} }
@Override @Override
public List<Mana> getNetMana(Game game, Ability source) { public List<Mana> getNetMana(Game game, Ability source) {
List<Mana> netMana = new ArrayList<>(); return ChoiceColor.getBaseColors()
for (String colorChoice : ChoiceColor.getBaseColors()) { .stream()
Mana mana = computeMana(colorChoice, game, source); .map(s -> computeMana(s, game, source))
if (mana.count() > 0) { .filter(mana -> mana.count() > 0)
netMana.add(mana); .collect(Collectors.toList());
}
}
return netMana;
} }
@Override @Override
public Mana produceMana(boolean netMana, Game game, Ability source) { public Mana produceMana(boolean netMana, Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) { if (controller == null) {
ChoiceColor choice = new ChoiceColor(); return null;
choice.setMessage("Choose a color for devotion of Nykthos");
if (controller.choose(outcome, choice, game)) {
return computeMana(choice.getChoice(), game, source);
}
} }
return null; ChoiceColor choice = new ChoiceColor();
choice.setMessage("Choose a color for devotion of Nykthos");
if (!controller.choose(outcome, choice, game)) {
return null;
}
return computeMana(choice.getChoice(), game, source);
} }
public Mana computeMana(String color, Game game, Ability source) { private Mana computeMana(String color, Game game, Ability source) {
Mana mana = new Mana(); Mana mana = new Mana();
if (color != null && !color.isEmpty()) { if (color == null || color.isEmpty()) {
switch (color) { return mana;
case "Red": }
mana.setRed(xValueR.calculate(game, source, this)); switch (color) {
break; case "White":
case "Blue": mana.setWhite(DevotionCount.W.calculate(game, source, this));
mana.setBlue(xValueU.calculate(game, source, this)); break;
break; case "Blue":
case "White": mana.setBlue(DevotionCount.U.calculate(game, source, this));
mana.setWhite(xValueW.calculate(game, source, this)); break;
break; case "Black":
case "Black": mana.setBlack(DevotionCount.B.calculate(game, source, this));
mana.setBlack(xValueB.calculate(game, source, this)); break;
break; case "Red":
case "Green": mana.setRed(DevotionCount.R.calculate(game, source, this));
mana.setGreen(xValueG.calculate(game, source, this)); break;
break; case "Green":
} mana.setGreen(DevotionCount.G.calculate(game, source, this));
break;
} }
return mana; return mana;
} }

View file

@ -5,7 +5,6 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.DevotionCount; import mage.abilities.dynamicvalue.common.DevotionCount;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
@ -16,7 +15,10 @@ import mage.abilities.keyword.IndestructibleAbility;
import mage.abilities.keyword.TrampleAbility; import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.filter.StaticFilters; import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -27,8 +29,6 @@ import java.util.UUID;
*/ */
public final class NyleaGodOfTheHunt extends CardImpl { public final class NyleaGodOfTheHunt extends CardImpl {
private static final DynamicValue xValue = new DevotionCount(ColoredManaSymbol.G);
public NyleaGodOfTheHunt(UUID ownerId, CardSetInfo setInfo) { public NyleaGodOfTheHunt(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{3}{G}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{3}{G}");
addSuperType(SuperType.LEGENDARY); addSuperType(SuperType.LEGENDARY);
@ -40,22 +40,27 @@ public final class NyleaGodOfTheHunt extends CardImpl {
// Indestructible // Indestructible
this.addAbility(IndestructibleAbility.getInstance()); this.addAbility(IndestructibleAbility.getInstance());
// As long as your devotion to white is less than five, Nylea isn't a creature.<i>(Each {G} in the mana costs of permanents you control counts towards your devotion to green.)</i> // As long as your devotion to green is less than five, Nylea isn't a creature.<i>(Each {G} in the mana costs of permanents you control counts towards your devotion to green.)</i>
Effect effect = new LoseCreatureTypeSourceEffect(xValue, 5); Effect effect = new LoseCreatureTypeSourceEffect(DevotionCount.G, 5);
effect.setText("As long as your devotion to green is less than five, Nylea isn't a creature.<i>(Each {G} in the mana costs of permanents you control counts towards your devotion to green.)</i>"); effect.setText("As long as your devotion to green is less than five, {this} isn't a creature.");
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect).addHint(new ValueHint("Devotion to green", xValue))); this.addAbility(new SimpleStaticAbility(effect).addHint(new ValueHint("Devotion to green", DevotionCount.G)));
// Other creatures you control have trample. // Other creatures you control have trample.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, true))); this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect(
TrampleAbility.getInstance(), Duration.WhileOnBattlefield,
StaticFilters.FILTER_PERMANENT_CREATURE, true
)));
// {3}{G}: Target creature gets +2/+2 until end of turn. // {3}{G}: Target creature gets +2/+2 until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(2, 2, Duration.EndOfTurn), new ManaCostsImpl("{3}{G}")); Ability ability = new SimpleActivatedAbility(
new BoostTargetEffect(2, 2, Duration.EndOfTurn), new ManaCostsImpl("{3}{G}")
);
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);
} }
public NyleaGodOfTheHunt(final NyleaGodOfTheHunt card) { private NyleaGodOfTheHunt(final NyleaGodOfTheHunt card) {
super(card); super(card);
} }

View file

@ -2,15 +2,12 @@ package mage.cards.n;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.DevotionCount; import mage.abilities.dynamicvalue.common.DevotionCount;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.hint.ValueHint; import mage.abilities.hint.ValueHint;
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.ColoredManaSymbol;
import mage.constants.SubType; import mage.constants.SubType;
import java.util.UUID; import java.util.UUID;
@ -20,8 +17,6 @@ import java.util.UUID;
*/ */
public final class NyleasDisciple extends CardImpl { public final class NyleasDisciple extends CardImpl {
private static final DynamicValue xValue = new DevotionCount(ColoredManaSymbol.G);
public NyleasDisciple(UUID ownerId, CardSetInfo setInfo) { public NyleasDisciple(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{G}");
this.subtype.add(SubType.CENTAUR); this.subtype.add(SubType.CENTAUR);
@ -31,12 +26,12 @@ public final class NyleasDisciple extends CardImpl {
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
// When Nylea's Disciple enters the battlefield, you gain life equal to your devotion to green. // When Nylea's Disciple enters the battlefield, you gain life equal to your devotion to green.
Effect effect = new GainLifeEffect(xValue); this.addAbility(new EntersBattlefieldTriggeredAbility(
effect.setText("you gain life equal to your devotion to green"); new GainLifeEffect(DevotionCount.G).setText("you gain life equal to your devotion to green")
this.addAbility(new EntersBattlefieldTriggeredAbility(effect).addHint(new ValueHint("Devotion to green", xValue))); ).addHint(new ValueHint("Devotion to green", DevotionCount.G)));
} }
public NyleasDisciple(final NyleasDisciple card) { private NyleasDisciple(final NyleasDisciple card) {
super(card); super(card);
} }