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

Remove lockedIn parameter from BoostTargetEffect. Fixes ()

This commit is contained in:
Alex W. Jackson 2022-08-02 02:40:59 -04:00 committed by GitHub
parent 1a3d5923de
commit 7233061ae3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
133 changed files with 590 additions and 676 deletions
Mage.Sets/src/mage/cards
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t

View file

@ -35,7 +35,7 @@ public final class AbhorrentOverlord extends CardImpl {
// When Abhorrent Overlord enters the battlefield, create a number of 1/1 black Harpy creature tokens with flying equal to your devotion to black. // When Abhorrent Overlord enters the battlefield, create a number of 1/1 black Harpy creature tokens with flying equal to your devotion to black.
Effect effect = new CreateTokenEffect(new HarpyToken(), DevotionCount.B); Effect effect = new CreateTokenEffect(new HarpyToken(), DevotionCount.B);
effect.setText("create a number of 1/1 black Harpy creature tokens with flying equal to your devotion to black. <i>(Each {B} in the mana costs of permanents you control counts toward your devotion to black.)</i>"); effect.setText("create a number of 1/1 black Harpy creature tokens with flying equal to your devotion to black. " + DevotionCount.B.getReminder());
this.addAbility(new EntersBattlefieldTriggeredAbility(effect).addHint(DevotionCount.B.getHint())); this.addAbility(new EntersBattlefieldTriggeredAbility(effect).addHint(DevotionCount.B.getHint()));
// At the beginning of your upkeep, sacrifice a creature. // At the beginning of your upkeep, sacrifice a creature.

View file

@ -1,4 +1,3 @@
package mage.cards.a; package mage.cards.a;
import java.util.UUID; import java.util.UUID;
@ -17,12 +16,13 @@ import mage.target.common.TargetCreaturePermanent;
*/ */
public final class AcceleratedMutation extends CardImpl { public final class AcceleratedMutation extends CardImpl {
private static final DynamicValue xValue = new HighestManaValueCount();
public AcceleratedMutation(UUID ownerId, CardSetInfo setInfo) { public AcceleratedMutation(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{G}{G}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{G}{G}");
// Target creature gets +X/+X until end of turn, where X is the highest converted mana cost among permanents you control. // Target creature gets +X/+X until end of turn, where X is the highest converted mana cost among permanents you control.
DynamicValue amount = new HighestManaValueCount(); this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn));
this.getSpellAbility().addEffect(new BoostTargetEffect(amount, amount, Duration.EndOfTurn, true));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
} }

View file

@ -43,7 +43,7 @@ public final class AllSeeingArbiter extends CardImpl {
// Whenever you discard a card, target creature an opponent controls gets -X/-0 until your next turn, where X is the number of different mana values among cards in your graveyard. // Whenever you discard a card, target creature an opponent controls gets -X/-0 until your next turn, where X is the number of different mana values among cards in your graveyard.
Ability ability = new DiscardCardControllerTriggeredAbility(new BoostTargetEffect( Ability ability = new DiscardCardControllerTriggeredAbility(new BoostTargetEffect(
AllSeeingArbiterValue.instance, StaticValue.get(0), Duration.UntilYourNextTurn, true AllSeeingArbiterValue.instance, StaticValue.get(0), Duration.UntilYourNextTurn
), false); ), false);
ability.addTarget(new TargetOpponentsCreaturePermanent()); ability.addTarget(new TargetOpponentsCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);
@ -92,4 +92,9 @@ enum AllSeeingArbiterValue implements DynamicValue {
public String getMessage() { public String getMessage() {
return "the number of different mana values among cards in your graveyard"; return "the number of different mana values among cards in your graveyard";
} }
@Override
public int getSign() {
return -1;
}
} }

View file

@ -21,7 +21,7 @@ public final class AlliedAssault extends CardImpl {
// Up to two target creatures each get +X/+X until end of turn, where X is the number of creatures in your party. // Up to two target creatures each get +X/+X until end of turn, where X is the number of creatures in your party.
this.getSpellAbility().addEffect(new BoostTargetEffect( this.getSpellAbility().addEffect(new BoostTargetEffect(
PartyCount.instance, PartyCount.instance, Duration.EndOfTurn, true PartyCount.instance, PartyCount.instance, Duration.EndOfTurn
).setText("up to two target creatures each get +X/+X until end of turn, " + ).setText("up to two target creatures each get +X/+X until end of turn, " +
"where X is the number of creatures in your party. " + PartyCount.getReminder() "where X is the number of creatures in your party. " + PartyCount.getReminder()
)); ));

View file

@ -30,13 +30,10 @@ public final class AltarOfTheGoyf extends CardImpl {
this.subtype.add(SubType.LHURGOYF); this.subtype.add(SubType.LHURGOYF);
// Whenever a creature you control attacks alone, it gets +X/+X until end of turn, where X is the number of card types among cards in all graveyard. // Whenever a creature you control attacks alone, it gets +X/+X until end of turn, where X is the number of card types among cards in all graveyards.
this.addAbility(new AttacksAloneControlledTriggeredAbility(new BoostTargetEffect( this.addAbility(new AttacksAloneControlledTriggeredAbility(
CardTypesInGraveyardCount.ALL, new BoostTargetEffect(CardTypesInGraveyardCount.ALL, CardTypesInGraveyardCount.ALL, Duration.EndOfTurn),
CardTypesInGraveyardCount.ALL, true, false).addHint(CardTypesInGraveyardHint.ALL));
Duration.EndOfTurn, true
).setText("it gets +X/+X until end of turn, where X is " +
"the number of card types among cards in all graveyards."), true, false).addHint(CardTypesInGraveyardHint.ALL));
// Lhurgoyf creatures you control have trample. // Lhurgoyf creatures you control have trample.
this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect( this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect(

View file

@ -20,11 +20,9 @@ public final class AngelicExaltation extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}");
// Whenever a creature you control attacks alone, it gets +X/+X until end of turn, where X is the number of creatures you control. // Whenever a creature you control attacks alone, it gets +X/+X until end of turn, where X is the number of creatures you control.
this.addAbility(new AttacksAloneControlledTriggeredAbility(new BoostTargetEffect( this.addAbility(new AttacksAloneControlledTriggeredAbility(
CreaturesYouControlCount.instance, new BoostTargetEffect(CreaturesYouControlCount.instance, CreaturesYouControlCount.instance, Duration.EndOfTurn),
CreaturesYouControlCount.instance, true, false).addHint(CreaturesYouControlHint.instance));
Duration.EndOfTurn, true
).setText("it gets +X/+X until end of turn, where X is the number of creatures you control"), true, false).addHint(CreaturesYouControlHint.instance));
} }
private AngelicExaltation(final AngelicExaltation card) { private AngelicExaltation(final AngelicExaltation card) {

View file

@ -32,7 +32,7 @@ public final class AppealAuthority extends SplitCard {
// Until end of turn, target creature gains trample and gets +X/+X, where X is the number of creatures you control. // Until end of turn, target creature gains trample and gets +X/+X, where X is the number of creatures you control.
getLeftHalfCard().getSpellAbility().addEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn) getLeftHalfCard().getSpellAbility().addEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn)
.setText("Until end of turn, target creature gains trample")); .setText("Until end of turn, target creature gains trample"));
getLeftHalfCard().getSpellAbility().addEffect(new BoostTargetEffect(CreaturesYouControlCount.instance, CreaturesYouControlCount.instance, Duration.EndOfTurn, true) getLeftHalfCard().getSpellAbility().addEffect(new BoostTargetEffect(CreaturesYouControlCount.instance, CreaturesYouControlCount.instance, Duration.EndOfTurn)
.setText("and gets +X/+X, where X is the number of creatures you control")); .setText("and gets +X/+X, where X is the number of creatures you control"));
getLeftHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent()); getLeftHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent());
getLeftHalfCard().getSpellAbility().addHint(CreaturesYouControlHint.instance); getLeftHalfCard().getSpellAbility().addHint(CreaturesYouControlHint.instance);

View file

@ -51,7 +51,7 @@ public final class ArmixFiligreeThrasher extends CardImpl {
// Whenever Armix, Filigree Thrasher attacks, you may discard a card. When you do, target creature defending player controls gets -X/-X until end of turn, where X is the number of artifacts you control plus the number of artifact cards in your graveyard. // Whenever Armix, Filigree Thrasher attacks, you may discard a card. When you do, target creature defending player controls gets -X/-X until end of turn, where X is the number of artifacts you control plus the number of artifact cards in your graveyard.
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility( ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(
new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn, true), false, new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn), false,
"target creature defending player controls gets -X/-X until end of turn, " + "target creature defending player controls gets -X/-X until end of turn, " +
"where X is the number of artifacts you control plus the number of artifact cards in your graveyard" "where X is the number of artifacts you control plus the number of artifact cards in your graveyard"
); );

View file

@ -40,8 +40,7 @@ public final class AsariCaptain extends CardImpl {
// Whenever a Samurai or Warrior you control attacks alone, it gets +1/+0 until end of turn for each Samurai or Warrior you control. // Whenever a Samurai or Warrior you control attacks alone, it gets +1/+0 until end of turn for each Samurai or Warrior you control.
this.addAbility(new AttacksAloneControlledTriggeredAbility( this.addAbility(new AttacksAloneControlledTriggeredAbility(
new BoostTargetEffect(xValue, StaticValue.get(0), Duration.EndOfTurn, true) new BoostTargetEffect(xValue, StaticValue.get(0), Duration.EndOfTurn),
.setText("it gets +1/+0 until end of turn for each Samurai or Warrior you control"),
StaticFilters.FILTER_CONTROLLED_SAMURAI_OR_WARRIOR, true, false StaticFilters.FILTER_CONTROLLED_SAMURAI_OR_WARRIOR, true, false
).addHint(hint)); ).addHint(hint));
} }

View file

@ -1,7 +1,7 @@
package mage.cards.a; package mage.cards.a;
import mage.abilities.dynamicvalue.common.DevotionCount; import mage.abilities.dynamicvalue.common.DevotionCount;
import mage.abilities.effects.Effect; import mage.abilities.effects.common.InfoEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
@ -20,9 +20,8 @@ public final class AspectOfHydra extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}");
// Target creature gets +X/+X until end of turn, where X is your devotion to green. // Target creature gets +X/+X until end of turn, where X is your devotion to green.
Effect effect = new BoostTargetEffect(DevotionCount.G, DevotionCount.G, Duration.EndOfTurn, true); this.getSpellAbility().addEffect(new BoostTargetEffect(DevotionCount.G, DevotionCount.G, Duration.EndOfTurn));
effect.setText("Target creature gets +X/+X until end of turn, where X is your devotion to green"); this.getSpellAbility().addEffect(new InfoEffect(DevotionCount.G.getReminder()));
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addHint(DevotionCount.G.getHint()); this.getSpellAbility().addHint(DevotionCount.G.getHint());
} }

View file

@ -31,7 +31,7 @@ public final class AuriokBladewarden extends CardImpl {
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
// {tap}: Target creature gets +X/+X until end of turn, where X is Auriok Bladewarden's power. // {tap}: Target creature gets +X/+X until end of turn, where X is Auriok Bladewarden's power.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(new SourcePermanentPowerCount(), new SourcePermanentPowerCount(), Duration.EndOfTurn, true), new TapSourceCost()); Ability ability = new SimpleActivatedAbility(new BoostTargetEffect(new SourcePermanentPowerCount(), new SourcePermanentPowerCount(), Duration.EndOfTurn), new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -1,4 +1,3 @@
package mage.cards.b; package mage.cards.b;
import java.util.UUID; import java.util.UUID;
@ -19,14 +18,17 @@ import mage.target.common.TargetCreaturePermanent;
*/ */
public final class BarrelDownSokenzan extends CardImpl { public final class BarrelDownSokenzan extends CardImpl {
private static final DynamicValue xValue = new MultipliedValue(SweepNumber.MOUNTAIN, 2);
public BarrelDownSokenzan(UUID ownerId, CardSetInfo setInfo) { public BarrelDownSokenzan(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{R}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{R}");
this.subtype.add(SubType.ARCANE); this.subtype.add(SubType.ARCANE);
// Sweep - Return any number of Mountains you control to their owner's hand. Barrel Down Sokenzan deals damage to target creature equal to twice the number of Mountains returned this way. // Sweep - Return any number of Mountains you control to their owner's hand. Barrel Down Sokenzan deals damage to target creature equal to twice the number of Mountains returned this way.
this.getSpellAbility().addEffect(new SweepEffect(SubType.MOUNTAIN)); this.getSpellAbility().addEffect(new SweepEffect(SubType.MOUNTAIN));
DynamicValue sweepValue = new MultipliedValue(new SweepNumber("Mountain"), 2); this.getSpellAbility().addEffect(new DamageTargetEffect(xValue)
this.getSpellAbility().addEffect(new DamageTargetEffect(sweepValue)); .setText("{this} deals damage to target creature equal to twice the number of Mountains returned this way")
);
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
} }

View file

@ -39,12 +39,14 @@ public final class BasiliskGate extends CardImpl {
this.addAbility(new ColorlessManaAbility()); this.addAbility(new ColorlessManaAbility());
// {2}, {T}: Target creature gets +X/+X until end of turn, where X is the number of Gates you control. Activate only as a sorcery. // {2}, {T}: Target creature gets +X/+X until end of turn, where X is the number of Gates you control. Activate only as a sorcery.
Ability ability = new ActivateAsSorceryActivatedAbility(new BoostTargetEffect( Ability ability = new ActivateAsSorceryActivatedAbility(
xValue, xValue, Duration.EndOfTurn, true new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn),
), new GenericManaCost(2)); new GenericManaCost(2)
);
ability.addCost(new TapSourceCost()); ability.addCost(new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability.addHint(hint)); ability.addHint(hint);
this.addAbility(ability);
} }
private BasiliskGate(final BasiliskGate card) { private BasiliskGate(final BasiliskGate card) {

View file

@ -20,6 +20,8 @@ import mage.target.common.TargetCreaturePermanent;
*/ */
public final class BattleAtTheBridge extends CardImpl { public final class BattleAtTheBridge extends CardImpl {
private static final DynamicValue xValue = new SignInversionDynamicValue(ManacostVariableValue.REGULAR);
public BattleAtTheBridge(UUID ownerId, CardSetInfo setInfo) { public BattleAtTheBridge(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{B}"); super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{B}");
@ -27,8 +29,8 @@ public final class BattleAtTheBridge extends CardImpl {
addAbility(new ImproviseAbility()); addAbility(new ImproviseAbility());
// Target creature gets -X/-X until end of turn. You gain X life. // Target creature gets -X/-X until end of turn. You gain X life.
DynamicValue x = new SignInversionDynamicValue(ManacostVariableValue.REGULAR);
this.getSpellAbility().addEffect(new BoostTargetEffect(x, x, Duration.EndOfTurn, true)); this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new GainLifeEffect(ManacostVariableValue.REGULAR)); this.getSpellAbility().addEffect(new GainLifeEffect(ManacostVariableValue.REGULAR));
} }

View file

@ -42,7 +42,7 @@ public final class Berserk extends CardImpl {
Effect effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn); Effect effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn);
effect.setText("Target creature gains trample"); effect.setText("Target creature gains trample");
this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(effect);
effect = new BoostTargetEffect(TargetPermanentPowerCount.instance, StaticValue.get(0), Duration.EndOfTurn, true); effect = new BoostTargetEffect(TargetPermanentPowerCount.instance, StaticValue.get(0), Duration.EndOfTurn);
effect.setText("and gets +X/+0 until end of turn, where X is its power"); effect.setText("and gets +X/+0 until end of turn, where X is its power");
this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addEffect(new BerserkDestroyEffect()); this.getSpellAbility().addEffect(new BerserkDestroyEffect());

View file

@ -1,4 +1,3 @@
package mage.cards.b; package mage.cards.b;
import java.util.UUID; import java.util.UUID;
@ -34,11 +33,11 @@ import mage.util.CardUtil;
*/ */
public final class BishopOfBinding extends CardImpl { public final class BishopOfBinding extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(SubType.VAMPIRE, "Vampire");
public BishopOfBinding(UUID ownerId, CardSetInfo setInfo) { public BishopOfBinding(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}");
this.subtype.add(SubType.VAMPIRE, SubType.CLERIC);
this.subtype.add(SubType.VAMPIRE);
this.subtype.add(SubType.CLERIC);
this.power = new MageInt(1); this.power = new MageInt(1);
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
@ -49,10 +48,8 @@ public final class BishopOfBinding extends CardImpl {
this.addAbility(ability); this.addAbility(ability);
// Whenever Bishop of Binding attacks, target Vampire gets +X/+X until end of turn, where X is the power of the exiled card. // Whenever Bishop of Binding attacks, target Vampire gets +X/+X until end of turn, where X is the power of the exiled card.
DynamicValue xVale = new BishopOfBindingExiledCardsPowerCount(); ability = new AttacksTriggeredAbility(new BoostTargetEffect(BishopOfBindingValue.instance, BishopOfBindingValue.instance, Duration.EndOfTurn));
ability = new AttacksTriggeredAbility(new BoostTargetEffect(xVale, xVale, Duration.EndOfTurn, true) ability.addTarget(new TargetCreaturePermanent(filter));
.setText("target Vampire gets +X/+X until end of turn, where X is the power of the exiled card"), false);
ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent(SubType.VAMPIRE, "Vampire")));
this.addAbility(ability); this.addAbility(ability);
} }
@ -69,7 +66,7 @@ public final class BishopOfBinding extends CardImpl {
class BishopOfBindingExileEffect extends OneShotEffect { class BishopOfBindingExileEffect extends OneShotEffect {
public BishopOfBindingExileEffect() { public BishopOfBindingExileEffect() {
super(Outcome.Benefit); super(Outcome.Exile);
this.staticText = "exile target creature an opponent controls until {this} leaves the battlefield"; this.staticText = "exile target creature an opponent controls until {this} leaves the battlefield";
} }
@ -94,7 +91,8 @@ class BishopOfBindingExileEffect extends OneShotEffect {
} }
} }
class BishopOfBindingExiledCardsPowerCount implements DynamicValue { enum BishopOfBindingValue implements DynamicValue {
instance;
@Override @Override
public int calculate(Game game, Ability sourceAbility, Effect effect) { public int calculate(Game game, Ability sourceAbility, Effect effect) {
@ -109,13 +107,17 @@ class BishopOfBindingExiledCardsPowerCount implements DynamicValue {
} }
@Override @Override
public BishopOfBindingExiledCardsPowerCount copy() { public BishopOfBindingValue copy() {
return new BishopOfBindingExiledCardsPowerCount(); return instance;
}
@Override
public String toString() {
return "X";
} }
@Override @Override
public String getMessage() { public String getMessage() {
return "power of the exiled card"; return "the power of the exiled card";
} }
} }

View file

@ -1,4 +1,3 @@
package mage.cards.b; package mage.cards.b;
import java.util.UUID; import java.util.UUID;
@ -29,11 +28,8 @@ import mage.target.common.TargetCreaturePermanent;
*/ */
public final class BloodthirstyOgre extends CardImpl { public final class BloodthirstyOgre extends CardImpl {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("you control a Demon"); private static final FilterControlledPermanent filter = new FilterControlledPermanent(SubType.DEMON, "you control a Demon");
private static final DynamicValue xValue = new SignInversionDynamicValue(new CountersSourceCount(CounterType.DEVOTION));
static {
filter.add(SubType.DEMON.getPredicate());
}
public BloodthirstyOgre(UUID ownerId, CardSetInfo setInfo) { public BloodthirstyOgre(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}"); super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}");
@ -46,9 +42,10 @@ public final class BloodthirstyOgre extends CardImpl {
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.DEVOTION.createInstance()),new TapSourceCost())); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.DEVOTION.createInstance()),new TapSourceCost()));
// {T}: Target creature gets -X/-X until end of turn, where X is the number of devotion counters on Bloodthirsty Ogre. Activate this ability only if you control a Demon. // {T}: Target creature gets -X/-X until end of turn, where X is the number of devotion counters on Bloodthirsty Ogre. Activate this ability only if you control a Demon.
DynamicValue devotionCounters = new SignInversionDynamicValue(new CountersSourceCount(CounterType.DEVOTION));
Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD,
new BoostTargetEffect(devotionCounters,devotionCounters, Duration.EndOfTurn, true), new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn)
.setText("target creature gets -X/-X until end of turn, where X is the number of devotion counters on {this}"),
new TapSourceCost(), new TapSourceCost(),
new PermanentsOnTheBattlefieldCondition(filter)); new PermanentsOnTheBattlefieldCondition(filter));
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
@ -63,5 +60,4 @@ public final class BloodthirstyOgre extends CardImpl {
public BloodthirstyOgre copy() { public BloodthirstyOgre copy() {
return new BloodthirstyOgre(this); return new BloodthirstyOgre(this);
} }
}
}

View file

@ -30,9 +30,8 @@ public final class CallForBlood extends CardImpl {
// As an additional cost to cast this spell, sacrifice a creature. // As an additional cost to cast this spell, sacrifice a creature.
this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)));
// Target creature gets -X/-X until end of turn, where X is the sacrificed creature's power. // Target creature gets -X/-X until end of turn, where X is the sacrificed creature's power.
this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn, true)); this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
} }
private CallForBlood(final CallForBlood card) { private CallForBlood(final CallForBlood card) {

View file

@ -1,4 +1,3 @@
package mage.cards.c; package mage.cards.c;
import java.util.UUID; import java.util.UUID;
@ -6,6 +5,7 @@ import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.dynamicvalue.common.CountersSourceCount;
import mage.abilities.effects.common.AmplifyEffect; import mage.abilities.effects.common.AmplifyEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
@ -25,6 +25,8 @@ import mage.target.common.TargetCreaturePermanent;
*/ */
public final class CanopyCrawler extends CardImpl { public final class CanopyCrawler extends CardImpl {
private static final DynamicValue xValue = new CountersSourceCount(CounterType.P1P1);
public CanopyCrawler(UUID ownerId, CardSetInfo setInfo) { public CanopyCrawler(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.BEAST); this.subtype.add(SubType.BEAST);
@ -33,9 +35,9 @@ public final class CanopyCrawler extends CardImpl {
// Amplify 1 // Amplify 1
this.addAbility(new AmplifyAbility(AmplifyEffect.AmplifyFactor.Amplify1)); this.addAbility(new AmplifyAbility(AmplifyEffect.AmplifyFactor.Amplify1));
// {tap}: Target creature gets +1/+1 until end of turn for each +1/+1 counter on Canopy Crawler. // {tap}: Target creature gets +1/+1 until end of turn for each +1/+1 counter on Canopy Crawler.
CountersSourceCount count = new CountersSourceCount(CounterType.P1P1); Ability ability = new SimpleActivatedAbility(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn), new TapSourceCost());
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(count, count, Duration.EndOfTurn, true), new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -28,7 +28,7 @@ public final class CapitalOffense extends CardImpl {
// target creature gets -x/-x until end of turn, where x is the number of times a capital letter appears in its rules text. (ignore reminder text and flavor text.) // target creature gets -x/-x until end of turn, where x is the number of times a capital letter appears in its rules text. (ignore reminder text and flavor text.)
this.getSpellAbility().addEffect(new BoostTargetEffect( this.getSpellAbility().addEffect(new BoostTargetEffect(
capitaloffensecount.instance, capitaloffensecount.instance, Duration.EndOfTurn, true capitaloffensecount.instance, capitaloffensecount.instance, Duration.EndOfTurn
).setText("target creature gets -x/-x until end of turn, where x is the number of times " + ).setText("target creature gets -x/-x until end of turn, where x is the number of times " +
"a capital letter appears in its rules text. <i>(ignore reminder text and flavor text.)</i>" "a capital letter appears in its rules text. <i>(ignore reminder text and flavor text.)</i>"
)); ));

View file

@ -1,8 +1,6 @@
package mage.cards.c; package mage.cards.c;
import java.util.UUID; import java.util.UUID;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.SweepNumber; import mage.abilities.dynamicvalue.common.SweepNumber;
import mage.abilities.effects.common.continuous.BoostControlledEffect; import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.abilities.effects.keyword.SweepEffect; import mage.abilities.effects.keyword.SweepEffect;
@ -24,9 +22,7 @@ public final class ChargeAcrossTheAraba extends CardImpl {
// Sweep - Return any number of Plains you control to their owner's hand. Creatures you control get +1/+1 until end of turn for each Plains returned this way. // Sweep - Return any number of Plains you control to their owner's hand. Creatures you control get +1/+1 until end of turn for each Plains returned this way.
this.getSpellAbility().addEffect(new SweepEffect(SubType.PLAINS)); this.getSpellAbility().addEffect(new SweepEffect(SubType.PLAINS));
DynamicValue sweepValue = new SweepNumber("Plains"); this.getSpellAbility().addEffect(new BoostControlledEffect(SweepNumber.PLAINS, SweepNumber.PLAINS, Duration.EndOfTurn, null, false, true));
this.getSpellAbility().addEffect(new BoostControlledEffect(sweepValue, sweepValue, Duration.EndOfTurn, null, false, true));
} }
private ChargeAcrossTheAraba(final ChargeAcrossTheAraba card) { private ChargeAcrossTheAraba(final ChargeAcrossTheAraba card) {

View file

@ -1,14 +1,14 @@
package mage.cards.c; package mage.cards.c;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.dynamicvalue.common.CreaturesYouControlCount;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.hint.common.CreaturesYouControlHint;
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.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID; import java.util.UUID;
@ -21,12 +21,15 @@ public final class ChorusOfMight extends CardImpl {
public ChorusOfMight(UUID ownerId, CardSetInfo setInfo) { public ChorusOfMight(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{G}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{G}");
// Until end of turn, target creature gets +1/+1 for each creature you control and gains trample. // Until end of turn, target creature gets +1/+1 for each creature you control and gains trample.
PermanentsOnBattlefieldCount value = new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURE);
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new BoostTargetEffect(value, value, Duration.EndOfTurn, true)); this.getSpellAbility().addEffect(new BoostTargetEffect(CreaturesYouControlCount.instance, CreaturesYouControlCount.instance, Duration.EndOfTurn)
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn)); .setText("until end of turn, target creature gets +1/+1 for each creature you control")
);
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn)
.setText("and gains trample")
);
this.getSpellAbility().addHint(CreaturesYouControlHint.instance);
} }
private ChorusOfMight(final ChorusOfMight card) { private ChorusOfMight(final ChorusOfMight card) {
@ -38,4 +41,3 @@ public final class ChorusOfMight extends CardImpl {
return new ChorusOfMight(this); return new ChorusOfMight(this);
} }
} }

View file

@ -1,7 +1,7 @@
package mage.cards.c; package mage.cards.c;
import java.util.UUID; import java.util.UUID;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
@ -20,11 +20,7 @@ import mage.target.common.TargetCreaturePermanent;
*/ */
public final class ConfrontTheUnknown extends CardImpl { public final class ConfrontTheUnknown extends CardImpl {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("each Clue you control"); private static final DynamicValue xValue = new PermanentsOnBattlefieldCount(new FilterControlledPermanent(SubType.CLUE, "Clue you control"));
static {
filter.add(SubType.CLUE.getPredicate());
}
public ConfrontTheUnknown(UUID ownerId, CardSetInfo setInfo) { public ConfrontTheUnknown(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{G}"); super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{G}");
@ -33,7 +29,7 @@ public final class ConfrontTheUnknown extends CardImpl {
Effect effect = new InvestigateEffect(); Effect effect = new InvestigateEffect();
effect.setText("Investigate"); effect.setText("Investigate");
getSpellAbility().addEffect(effect); getSpellAbility().addEffect(effect);
effect = new BoostTargetEffect(new PermanentsOnBattlefieldCount(filter), new PermanentsOnBattlefieldCount(filter), Duration.EndOfTurn, true); effect = new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn);
effect.setText(", then target creature gets +1/+1 until end of turn for each Clue you control. <i>(To investigate, " effect.setText(", then target creature gets +1/+1 until end of turn for each Clue you control. <i>(To investigate, "
+ "create a colorless Clue artifact token with \"{2}, Sacrifice this artifact: Draw a card.\")</i>"); + "create a colorless Clue artifact token with \"{2}, Sacrifice this artifact: Draw a card.\")</i>");
getSpellAbility().addEffect(effect); getSpellAbility().addEffect(effect);

View file

@ -1,4 +1,3 @@
package mage.cards.d; package mage.cards.d;
import java.util.UUID; import java.util.UUID;
@ -13,8 +12,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType; import mage.constants.SubType;
import mage.filter.StaticFilters; import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.token.ZombieToken; import mage.game.permanent.token.ZombieToken;
import mage.players.Player; import mage.players.Player;
@ -33,13 +31,14 @@ public final class DarkSalvation extends CardImpl {
// Target player creates X 2/2 black Zombie creature tokens, then up to one target creature gets -1/-1 until end of turn for each Zombie that player controls. // Target player creates X 2/2 black Zombie creature tokens, then up to one target creature gets -1/-1 until end of turn for each Zombie that player controls.
this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addTarget(new TargetPlayer());
Effect effect = new CreateTokenTargetEffect(new ZombieToken(), ManacostVariableValue.REGULAR); this.getSpellAbility().addEffect(new CreateTokenTargetEffect(new ZombieToken(), ManacostVariableValue.REGULAR));
effect.setText("Target player creates X 2/2 black Zombie creature tokens");
this.getSpellAbility().addEffect(effect);
DynamicValue value = new ZombiesControlledByTargetPlayerCount();
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1, StaticFilters.FILTER_PERMANENT_CREATURE, false)); this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1));
effect = new BoostTargetEffect(value, value, Duration.EndOfTurn, true); Effect effect = new BoostTargetEffect(
ZombiesControlledByTargetPlayerCount.instance,
ZombiesControlledByTargetPlayerCount.instance,
Duration.EndOfTurn
);
effect.setTargetPointer(new SecondTargetPointer()); effect.setTargetPointer(new SecondTargetPointer());
effect.setText(", then up to one target creature gets -1/-1 until end of turn for each Zombie that player controls"); effect.setText(", then up to one target creature gets -1/-1 until end of turn for each Zombie that player controls");
this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(effect);
@ -55,18 +54,10 @@ public final class DarkSalvation extends CardImpl {
} }
} }
class ZombiesControlledByTargetPlayerCount implements DynamicValue { enum ZombiesControlledByTargetPlayerCount implements DynamicValue {
instance;
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Zombies"); private static final FilterPermanent filter = new FilterPermanent(SubType.ZOMBIE, "Zombie");
static {
filter.add(SubType.ZOMBIE.getPredicate());
}
@Override
public ZombiesControlledByTargetPlayerCount copy() {
return new ZombiesControlledByTargetPlayerCount();
}
@Override @Override
public int calculate(Game game, Ability sourceAbility, Effect effect) { public int calculate(Game game, Ability sourceAbility, Effect effect) {
@ -79,8 +70,23 @@ class ZombiesControlledByTargetPlayerCount implements DynamicValue {
} }
} }
@Override
public ZombiesControlledByTargetPlayerCount copy() {
return instance;
}
@Override
public String toString() {
return "-1";
}
@Override @Override
public String getMessage() { public String getMessage() {
return filter.getMessage() + " that player controls"; return "Zombie that player controls";
}
@Override
public int getSign() {
return -1;
} }
} }

View file

@ -1,4 +1,3 @@
package mage.cards.d; package mage.cards.d;
import java.util.UUID; import java.util.UUID;
@ -17,13 +16,13 @@ import mage.target.common.TargetCreaturePermanent;
*/ */
public final class DeathWind extends CardImpl { public final class DeathWind extends CardImpl {
private static final DynamicValue xValue = new SignInversionDynamicValue(ManacostVariableValue.REGULAR);
public DeathWind(UUID ownerId, CardSetInfo setInfo) { public DeathWind(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{B}"); super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{B}");
// Target creature gets -X/-X until end of turn. // Target creature gets -X/-X until end of turn.
DynamicValue x = new SignInversionDynamicValue(ManacostVariableValue.REGULAR); this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn));
this.getSpellAbility().addEffect(new BoostTargetEffect(x, x, Duration.EndOfTurn, true));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
} }

View file

@ -3,6 +3,8 @@ package mage.cards.d;
import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.hint.Hint;
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;
@ -19,22 +21,17 @@ import java.util.UUID;
*/ */
public final class Defile extends CardImpl { public final class Defile extends CardImpl {
private static final FilterPermanent filter = new FilterControlledPermanent(); private static final FilterPermanent filter = new FilterControlledPermanent(SubType.SWAMP, "Swamp you control");
static {
filter.add(SubType.SWAMP.getPredicate());
}
private static final DynamicValue xValue = new PermanentsOnBattlefieldCount(filter, -1); private static final DynamicValue xValue = new PermanentsOnBattlefieldCount(filter, -1);
private static final Hint hint = new ValueHint("Swamps you control", new PermanentsOnBattlefieldCount(filter));
public Defile(UUID ownerId, CardSetInfo setInfo) { public Defile(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}");
// Target creature gets -1/-1 until end of turn for each Swamp you control. // Target creature gets -1/-1 until end of turn for each Swamp you control.
this.getSpellAbility().addEffect(new BoostTargetEffect( this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn));
xValue, xValue, Duration.EndOfTurn, true
).setText("Target creature gets -1/-1 until end of turn for each Swamp you control."));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addHint(hint);
} }
private Defile(final Defile card) { private Defile(final Defile card) {

View file

@ -1,9 +1,9 @@
package mage.cards.d; package mage.cards.d;
import java.util.UUID; import java.util.UUID;
import mage.abilities.costs.AlternativeCostSourceAbility; import mage.abilities.costs.AlternativeCostSourceAbility;
import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
@ -23,21 +23,19 @@ import mage.target.common.TargetCreaturePermanent;
*/ */
public final class DownhillCharge extends CardImpl { public final class DownhillCharge extends CardImpl {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("a Mountain"); private static final FilterControlledPermanent filter = new FilterControlledPermanent(SubType.MOUNTAIN, "a Mountain");
private static final DynamicValue xValue = new PermanentsOnBattlefieldCount(
static { new FilterControlledPermanent(SubType.MOUNTAIN, "Mountains you control"), null
filter.add(SubType.MOUNTAIN.getPredicate()); );
}
public DownhillCharge(UUID ownerId, CardSetInfo setInfo) { public DownhillCharge(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{R}"); super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{R}");
// You may sacrifice a Mountain rather than pay Downhill Charge's mana cost. // You may sacrifice a Mountain rather than pay Downhill Charge's mana cost.
this.addAbility(new AlternativeCostSourceAbility(new SacrificeTargetCost(new TargetControlledPermanent(filter)))); this.addAbility(new AlternativeCostSourceAbility(new SacrificeTargetCost(new TargetControlledPermanent(filter))));
// Target creature gets +X/+0 until end of turn, where X is the number of Mountains you control. // Target creature gets +X/+0 until end of turn, where X is the number of Mountains you control.
Effect effect = new BoostTargetEffect(new PermanentsOnBattlefieldCount(filter), StaticValue.get(0), Duration.EndOfTurn, true); this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, StaticValue.get(0), Duration.EndOfTurn));
effect.setText("Target creature gets +X/+0 until end of turn, where X is the number of Mountains you control.");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
} }

View file

@ -1,8 +1,8 @@
package mage.cards.d; package mage.cards.d;
import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.MultipliedValue;
import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.dynamicvalue.common.DomainValue;
import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.hint.common.DomainHint; import mage.abilities.hint.common.DomainHint;
import mage.cards.CardImpl; import mage.cards.CardImpl;
@ -19,14 +19,13 @@ import java.util.UUID;
*/ */
public final class DragDown extends CardImpl { public final class DragDown extends CardImpl {
private static final DynamicValue xValue = new MultipliedValue(DomainValue.REGULAR, -1); private static final DynamicValue xValue = new SignInversionDynamicValue(DomainValue.REGULAR);
public DragDown(UUID ownerId, CardSetInfo setInfo) { public DragDown(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{B}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{B}");
// Domain - Target creature gets -1/-1 until end of turn for each basic land type among lands you control. // Domain - Target creature gets -1/-1 until end of turn for each basic land type among lands you control.
this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn, true) this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn));
.setText("target creature gets -1/-1 until end of turn for each basic land type among lands you control"));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addHint(DomainHint.instance); this.getSpellAbility().addHint(DomainHint.instance);
this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN); this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN);

View file

@ -26,15 +26,13 @@ public final class DranasSilencer extends CardImpl {
public DranasSilencer(UUID ownerId, CardSetInfo setInfo) { public DranasSilencer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{B}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{B}");
this.subtype.add(SubType.VAMPIRE, SubType.ROGUE);
this.subtype.add(SubType.VAMPIRE);
this.subtype.add(SubType.ROGUE);
this.power = new MageInt(3); this.power = new MageInt(3);
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// When Drana's Silencer enters the battlefield, target creature an opponent controls gets -X/-X until end of turn, where X is the number of creatures in your party. // When Drana's Silencer enters the battlefield, target creature an opponent controls gets -X/-X until end of turn, where X is the number of creatures in your party.
Ability ability = new EntersBattlefieldTriggeredAbility(new BoostTargetEffect( Ability ability = new EntersBattlefieldTriggeredAbility(new BoostTargetEffect(
xValue, xValue, Duration.EndOfTurn, true xValue, xValue, Duration.EndOfTurn
).setText("target creature an opponent controls gets -X/-X until end of turn, " + ).setText("target creature an opponent controls gets -X/-X until end of turn, " +
"where X is the number of creatures in your party. " + PartyCount.getReminder())); "where X is the number of creatures in your party. " + PartyCount.getReminder()));
ability.addTarget(new TargetOpponentsCreaturePermanent()); ability.addTarget(new TargetOpponentsCreaturePermanent());

View file

@ -26,7 +26,7 @@ public final class EiganjoExemplar extends CardImpl {
// Whenever a Samurai or Warrior you control attacks alone, it gets +1/+1 until end of turn. // Whenever a Samurai or Warrior you control attacks alone, it gets +1/+1 until end of turn.
this.addAbility(new AttacksAloneControlledTriggeredAbility( this.addAbility(new AttacksAloneControlledTriggeredAbility(
new BoostTargetEffect(1, 1).setText("it gets +1/+1 until end of turn"), new BoostTargetEffect(1, 1),
StaticFilters.FILTER_CONTROLLED_SAMURAI_OR_WARRIOR, true, false StaticFilters.FILTER_CONTROLLED_SAMURAI_OR_WARRIOR, true, false
)); ));
} }

View file

@ -11,7 +11,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType; import mage.constants.SubType;
import mage.constants.Zone;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID; import java.util.UUID;
@ -30,8 +29,8 @@ public final class ElderOfLaurels extends CardImpl {
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
// {3}{G}: Target creature gets +X/+X until end of turn, where X is the number of creatures you control. // {3}{G}: Target creature gets +X/+X until end of turn, where X is the number of creatures you control.
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, SimpleActivatedAbility ability = new SimpleActivatedAbility(
new BoostTargetEffect(CreaturesYouControlCount.instance, CreaturesYouControlCount.instance, Duration.EndOfTurn, true), new BoostTargetEffect(CreaturesYouControlCount.instance, CreaturesYouControlCount.instance, Duration.EndOfTurn),
new ManaCostsImpl<>("{3}{G}")); new ManaCostsImpl<>("{3}{G}"));
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
ability.addHint(CreaturesYouControlHint.instance); ability.addHint(CreaturesYouControlHint.instance);

View file

@ -1,24 +1,24 @@
package mage.cards.e; package mage.cards.e;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.ControllerGotLifeCount; import mage.abilities.dynamicvalue.common.ControllerGotLifeCount;
import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.continuous.BoostAllEffect; import mage.abilities.effects.common.continuous.BoostAllEffect;
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.watchers.common.PlayerGainedLifeWatcher;
import java.util.UUID; import java.util.UUID;
import mage.abilities.dynamicvalue.LockedInDynamicValue;
import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
/** /**
* @author TheElk801 * @author TheElk801
*/ */
public final class EssencePulse extends CardImpl { public final class EssencePulse extends CardImpl {
// rule 608.2h private static final DynamicValue xValue = new SignInversionDynamicValue(ControllerGotLifeCount.instance);
private static final LockedInDynamicValue xValue = new LockedInDynamicValue(new SignInversionDynamicValue(ControllerGotLifeCount.instance));
public EssencePulse(UUID ownerId, CardSetInfo setInfo) { public EssencePulse(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{B}"); super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{B}");
@ -28,6 +28,7 @@ public final class EssencePulse extends CardImpl {
this.getSpellAbility().addEffect(new BoostAllEffect( this.getSpellAbility().addEffect(new BoostAllEffect(
xValue, xValue, Duration.EndOfTurn xValue, xValue, Duration.EndOfTurn
).setText("Each creature gets -X/-X until end of turn, where X is the amount of life you gained this turn")); ).setText("Each creature gets -X/-X until end of turn, where X is the amount of life you gained this turn"));
this.getSpellAbility().addWatcher(new PlayerGainedLifeWatcher());
this.getSpellAbility().addHint(ControllerGotLifeCount.getHint()); this.getSpellAbility().addHint(ControllerGotLifeCount.getHint());
} }

View file

@ -35,7 +35,7 @@ public final class FatalFrenzy extends CardImpl {
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn) this.getSpellAbility().addEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn)
.setText("Until end of turn, target creature you control gains trample") .setText("Until end of turn, target creature you control gains trample")
); );
this.getSpellAbility().addEffect(new BoostTargetEffect(TargetPermanentPowerCount.instance, StaticValue.get(0), Duration.EndOfTurn, true) this.getSpellAbility().addEffect(new BoostTargetEffect(TargetPermanentPowerCount.instance, StaticValue.get(0), Duration.EndOfTurn)
.setText("and gets +X/+0, where X is its power") .setText("and gets +X/+0, where X is its power")
); );
this.getSpellAbility().addEffect(new FatalFrenzyEffect()); this.getSpellAbility().addEffect(new FatalFrenzyEffect());

View file

@ -5,29 +5,32 @@ import java.util.UUID;
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.DynamicValue;
import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount;
import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.MillCardsControllerEffect; import mage.abilities.effects.common.MillCardsControllerEffect;
import mage.abilities.effects.common.continuous.BoostEnchantedEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
import mage.constants.SubType;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import mage.abilities.Ability;
import mage.abilities.effects.common.AttachEffect;
import mage.constants.Outcome;
import mage.target.TargetPermanent;
import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.filter.StaticFilters;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
/** /**
* *
* @author weirddan455 * @author awjackson
*/ */
public final class FearOfDeath extends CardImpl { public final class FearOfDeath extends CardImpl {
private static final DynamicValue xValue = new SignInversionDynamicValue(
new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CARDS, null)
);
public FearOfDeath(UUID ownerId, CardSetInfo setInfo) { public FearOfDeath(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}");
@ -37,14 +40,13 @@ public final class FearOfDeath extends CardImpl {
TargetPermanent auraTarget = new TargetCreaturePermanent(); TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.UnboostCreature)); this.getSpellAbility().addEffect(new AttachEffect(Outcome.UnboostCreature));
Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(new EnchantAbility(auraTarget.getTargetName()));
this.addAbility(ability);
// When Fear of Death enters the battlefield, mill two cards. // When Fear of Death enters the battlefield, mill two cards.
this.addAbility(new EntersBattlefieldTriggeredAbility(new MillCardsControllerEffect(2))); this.addAbility(new EntersBattlefieldTriggeredAbility(new MillCardsControllerEffect(2)));
// Enchanted creature gets -X/-0, where X is the number of cards in your graveyard. // Enchanted creature gets -X/-0, where X is the number of cards in your graveyard.
this.addAbility(new SimpleStaticAbility(new BoostEnchantedEffect(FearOfDeathValue.instance, StaticValue.get(0)))); this.addAbility(new SimpleStaticAbility(new BoostEnchantedEffect(xValue, StaticValue.get(0))));
} }
private FearOfDeath(final FearOfDeath card) { private FearOfDeath(final FearOfDeath card) {
@ -56,31 +58,3 @@ public final class FearOfDeath extends CardImpl {
return new FearOfDeath(this); return new FearOfDeath(this);
} }
} }
enum FearOfDeathValue implements DynamicValue {
instance;
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
Player controller = game.getPlayer(sourceAbility.getControllerId());
if (controller == null) {
return 0;
}
return -controller.getGraveyard().size();
}
@Override
public FearOfDeathValue copy() {
return instance;
}
@Override
public String toString() {
return "-X";
}
@Override
public String getMessage() {
return "the number of cards in your graveyard";
}
}

View file

@ -1,10 +1,9 @@
package mage.cards.f; package mage.cards.f;
import java.util.UUID; import java.util.UUID;
import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.Effect; import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
@ -20,20 +19,15 @@ import mage.target.common.TargetCreaturePermanent;
*/ */
public final class FeedingFrenzy extends CardImpl { public final class FeedingFrenzy extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent(); private static final DynamicValue xValue = new SignInversionDynamicValue(
new PermanentsOnBattlefieldCount(new FilterPermanent(SubType.ZOMBIE, "Zombies on the battlefield"), null)
static { );
filter.add(SubType.ZOMBIE.getPredicate());
}
public FeedingFrenzy(UUID ownerId, CardSetInfo setInfo) { public FeedingFrenzy(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{B}"); super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{B}");
// Target creature gets -X/-X until end of turn, where X is the number of Zombies on the battlefield. // Target creature gets -X/-X until end of turn, where X is the number of Zombies on the battlefield.
DynamicValue x = new PermanentsOnBattlefieldCount(filter, -1); this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn));
Effect effect = new BoostTargetEffect(x, x, Duration.EndOfTurn, true);
effect.setText("Target creature gets -X/-X until end of turn, where X is the number of Zombies on the battlefield");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
} }

View file

@ -2,7 +2,10 @@ package mage.cards.f;
import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount;
import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.hint.Hint;
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;
@ -17,16 +20,17 @@ import java.util.UUID;
*/ */
public final class FestiveFuneral extends CardImpl { public final class FestiveFuneral extends CardImpl {
private static final DynamicValue xValue = new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD, -1); private static final DynamicValue cardsInGraveyard = new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CARDS, null);
private static final DynamicValue xValue = new SignInversionDynamicValue(cardsInGraveyard);
private static final Hint hint = new ValueHint("Cards in your graveyard", cardsInGraveyard);
public FestiveFuneral(UUID ownerId, CardSetInfo setInfo) { public FestiveFuneral(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{B}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{B}");
// Target creature gets -X/-X until end of turn, where X is the number of cards in your graveyard. // Target creature gets -X/-X until end of turn, where X is the number of cards in your graveyard.
this.getSpellAbility().addEffect(new BoostTargetEffect( this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn));
xValue, xValue, Duration.EndOfTurn, true
).setText("target creature gets -X/-X until end of turn, where X is the number of cards in your graveyard"));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addHint(hint);
} }
private FestiveFuneral(final FestiveFuneral card) { private FestiveFuneral(final FestiveFuneral card) {

View file

@ -25,8 +25,7 @@ public final class FortifyingDraught extends CardImpl {
this.getSpellAbility().addEffect(new BoostTargetEffect( this.getSpellAbility().addEffect(new BoostTargetEffect(
ControllerGotLifeCount.instance, ControllerGotLifeCount.instance,
ControllerGotLifeCount.instance, ControllerGotLifeCount.instance,
Duration.EndOfTurn, true Duration.EndOfTurn));
).setText("Target creature gets +X/+X until end of turn, where X is the amount of life you gained this turn."));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addWatcher(new PlayerGainedLifeWatcher()); this.getSpellAbility().addWatcher(new PlayerGainedLifeWatcher());
this.getSpellAbility().addHint(ControllerGotLifeCount.getHint()); this.getSpellAbility().addHint(ControllerGotLifeCount.getHint());

View file

@ -10,7 +10,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.filter.common.FilterCreatureCard; import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
/** /**
@ -19,12 +19,13 @@ import mage.target.common.TargetCreaturePermanent;
*/ */
public final class GhoulsFeast extends CardImpl { public final class GhoulsFeast extends CardImpl {
private static final DynamicValue xValue = new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURES, null);
public GhoulsFeast(UUID ownerId, CardSetInfo setInfo) { public GhoulsFeast(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{B}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{B}");
// Target creature gets +X/+0 until end of turn, where X is the number of creature cards in your graveyard. // Target creature gets +X/+0 until end of turn, where X is the number of creature cards in your graveyard.
DynamicValue xValue = new CardsInControllerGraveyardCount(new FilterCreatureCard("creature card")); this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, StaticValue.get(0), Duration.EndOfTurn));
this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, StaticValue.get(0), Duration.EndOfTurn, true));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
} }

View file

@ -50,8 +50,7 @@ class GrayMerchantOfAsphodelEffect extends OneShotEffect {
super(Outcome.GainLife); super(Outcome.GainLife);
this.staticText = "each opponent loses X life, where X is your devotion to black. " this.staticText = "each opponent loses X life, where X is your devotion to black. "
+ "You gain life equal to the life lost this way. " + "You gain life equal to the life lost this way. "
+ "<i>(Each {B} in the mana costs of permanents you control " + DevotionCount.B.getReminder();
+ "counts towards your devotion to black.)</i>";
} }
private GrayMerchantOfAsphodelEffect(final GrayMerchantOfAsphodelEffect effect) { private GrayMerchantOfAsphodelEffect(final GrayMerchantOfAsphodelEffect effect) {

View file

@ -22,7 +22,7 @@ public final class GreatDefender extends CardImpl {
// Target creature gets +0/+X until end of turn, where X is its converted mana cost. // Target creature gets +0/+X until end of turn, where X is its converted mana cost.
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new BoostTargetEffect(StaticValue.get(0), TargetManaValue.instance, Duration.EndOfTurn, true) this.getSpellAbility().addEffect(new BoostTargetEffect(StaticValue.get(0), TargetManaValue.instance, Duration.EndOfTurn)
.setText("Target creature gets +0/+X until end of turn, where X is its mana value.") .setText("Target creature gets +0/+X until end of turn, where X is its mana value.")
); );
} }

View file

@ -1,35 +1,37 @@
package mage.cards.g; package mage.cards.g;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect; import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
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.game.Game; import mage.filter.FilterCard;
import mage.players.Player; import mage.filter.predicate.mageobject.NamePredicate;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID; import java.util.UUID;
/** /**
* @author TheElk801 * @author awjackson
*/ */
public final class GrowthCycle extends CardImpl { public final class GrowthCycle extends CardImpl {
private static final FilterCard filter = new FilterCard("card named Growth Cycle");
static {
filter.add(new NamePredicate("Growth Cycle"));
}
private static final DynamicValue xValue = new CardsInControllerGraveyardCount(filter, 2);
private static final String rule = "it gets an additional +2/+2 until end of turn for each " + xValue.getMessage();
public GrowthCycle(UUID ownerId, CardSetInfo setInfo) { public GrowthCycle(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}");
// Target creature gets +3/+3 until end of turn. It gets an additional +2/+2 until end of turn for each card named Growth Cycle in your graveyard. // Target creature gets +3/+3 until end of turn.
this.getSpellAbility().addEffect(new BoostTargetEffect( this.getSpellAbility().addEffect(new BoostTargetEffect(3, 3, Duration.EndOfTurn));
GrowthCycleValue.instance, GrowthCycleValue.instance, // It gets an additional +2/+2 until end of turn for each card named Growth Cycle in your graveyard.
Duration.EndOfTurn, true this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn).setText(rule));
).setText("Target creature gets +3/+3 until end of turn. " +
"It gets an additional +2/+2 until end of turn " +
"for each card named Growth Cycle in your graveyard.")
);
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
} }
@ -42,31 +44,3 @@ public final class GrowthCycle extends CardImpl {
return new GrowthCycle(this); return new GrowthCycle(this);
} }
} }
enum GrowthCycleValue implements DynamicValue {
instance;
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
Player player = game.getPlayer(sourceAbility.getControllerId());
if (player == null) {
return 3;
}
return 3 + player
.getGraveyard()
.getCards(game)
.stream()
.mapToInt(card -> "Growth Cycle".equals(card.getName()) ? 2 : 0)
.sum();
}
@Override
public GrowthCycleValue copy() {
return instance;
}
@Override
public String getMessage() {
return "";
}
}

View file

@ -36,9 +36,7 @@ public final class GruulBeastmaster extends CardImpl {
public GruulBeastmaster(UUID ownerId, CardSetInfo setInfo) { public GruulBeastmaster(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, SubType.SHAMAN);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.SHAMAN);
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
@ -47,8 +45,7 @@ public final class GruulBeastmaster extends CardImpl {
// Whenever Gruul Beastmaster attacks, another target creature you control gets +X/+0 until end of turn, where X is Gruul Beastmaster's power. // Whenever Gruul Beastmaster attacks, another target creature you control gets +X/+0 until end of turn, where X is Gruul Beastmaster's power.
Ability ability = new AttacksTriggeredAbility(new BoostTargetEffect( Ability ability = new AttacksTriggeredAbility(new BoostTargetEffect(
xValue, StaticValue.get(0), Duration.EndOfTurn, true xValue, StaticValue.get(0), Duration.EndOfTurn), false);
), false);
ability.addTarget(new TargetPermanent(filter)); ability.addTarget(new TargetPermanent(filter));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -33,7 +33,7 @@ public final class HardyOutlander extends CardImpl {
// Commander creatures you own have "Whenever this creature attacks a player, if no opponent has more life than that player, another target creature you control gets +X/+X until end of turn, where X is this creature's power." // Commander creatures you own have "Whenever this creature attacks a player, if no opponent has more life than that player, another target creature you control gets +X/+X until end of turn, where X is this creature's power."
Ability ability = new AttacksOpponentWithMostLifeTriggeredAbility(new BoostTargetEffect( Ability ability = new AttacksOpponentWithMostLifeTriggeredAbility(new BoostTargetEffect(
xValue, xValue, Duration.EndOfTurn, true xValue, xValue, Duration.EndOfTurn
).setText("another target creature you control gets +X/+X until end of turn, where X is this creature's power"), false); ).setText("another target creature you control gets +X/+X until end of turn, where X is this creature's power"), false);
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE)); ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE));
this.addAbility(new SimpleStaticAbility(new GainAbilityAllEffect( this.addAbility(new SimpleStaticAbility(new GainAbilityAllEffect(

View file

@ -37,7 +37,7 @@ public final class HuatliRadiantChampion extends CardImpl {
// -1: Target creature gets +X/+X until end of turn, where X is the number of creatures you control. // -1: Target creature gets +X/+X until end of turn, where X is the number of creatures you control.
PermanentsOnBattlefieldCount amount = new PermanentsOnBattlefieldCount(StaticFilters.FILTER_PERMANENT_CREATURE_CONTROLLED); PermanentsOnBattlefieldCount amount = new PermanentsOnBattlefieldCount(StaticFilters.FILTER_PERMANENT_CREATURE_CONTROLLED);
LoyaltyAbility ability2 = new LoyaltyAbility(new BoostTargetEffect(amount, amount, Duration.EndOfTurn, true) LoyaltyAbility ability2 = new LoyaltyAbility(new BoostTargetEffect(amount, amount, Duration.EndOfTurn)
.setText("Target creature gets +X/+X until end of turn, where X is the number of creatures you control"), -1); .setText("Target creature gets +X/+X until end of turn, where X is the number of creatures you control"), -1);
ability2.addTarget(new TargetCreaturePermanent()); ability2.addTarget(new TargetCreaturePermanent());
ability2.addHint(CreaturesYouControlHint.instance); ability2.addHint(CreaturesYouControlHint.instance);

View file

@ -2,7 +2,6 @@ package mage.cards.h;
import mage.abilities.dynamicvalue.common.ArtifactYouControlCount; import mage.abilities.dynamicvalue.common.ArtifactYouControlCount;
import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.hint.common.ArtifactYouControlHint; import mage.abilities.hint.common.ArtifactYouControlHint;
import mage.cards.CardImpl; import mage.cards.CardImpl;
@ -22,8 +21,7 @@ public final class HungerOfTheNim extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}"); super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}");
// Target creature gets +1/+0 until end of turn for each artifact you control. // Target creature gets +1/+0 until end of turn for each artifact you control.
Effect effect = new BoostTargetEffect(ArtifactYouControlCount.instance, StaticValue.get(0), Duration.EndOfTurn, true); getSpellAbility().addEffect(new BoostTargetEffect(ArtifactYouControlCount.instance, StaticValue.get(0), Duration.EndOfTurn));
getSpellAbility().addEffect(effect);
getSpellAbility().addTarget(new TargetCreaturePermanent()); getSpellAbility().addTarget(new TargetCreaturePermanent());
getSpellAbility().addHint(ArtifactYouControlHint.instance); getSpellAbility().addHint(ArtifactYouControlHint.instance);
} }

View file

@ -1,39 +1,34 @@
package mage.cards.i; package mage.cards.i;
import java.util.UUID; import java.util.UUID;
import mage.abilities.Ability;
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.DynamicValue;
import mage.abilities.effects.Effect; import mage.abilities.dynamicvalue.common.SacrificeCostCreaturesPower;
import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
import mage.abilities.effects.common.continuous.BoostAllEffect; import mage.abilities.effects.common.continuous.BoostAllEffect;
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.Duration; import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.StaticFilters; import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetControlledPermanent;
/** /**
* *
* @author Loki * @author awjackson
*/ */
public final class IchorExplosion extends CardImpl { public final class IchorExplosion extends CardImpl {
private static final DynamicValue xValue = new SignInversionDynamicValue(SacrificeCostCreaturesPower.instance, false);
public IchorExplosion(UUID ownerId, CardSetInfo setInfo) { public IchorExplosion(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{5}{B}{B}"); super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{5}{B}{B}");
// As an additional cost to cast Ichor Explosion, sacrifice a creature. // As an additional cost to cast Ichor Explosion, sacrifice a creature.
this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT)));
// All creatures get -X/-X until end of turn, where X is the sacrificed creature's power.
DynamicValue xValue = new IchorExplosionDynamicValue();
this.getSpellAbility().addEffect(new BoostAllEffect(xValue, xValue, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_ALL_CREATURES, false, null));
// All creatures get -X/-X until end of turn, where X is the sacrificed creature's power.
this.getSpellAbility().addEffect(new BoostAllEffect(xValue, xValue, Duration.EndOfTurn));
} }
private IchorExplosion(final IchorExplosion card) { private IchorExplosion(final IchorExplosion card) {
@ -45,35 +40,3 @@ public final class IchorExplosion extends CardImpl {
return new IchorExplosion(this); return new IchorExplosion(this);
} }
} }
class IchorExplosionDynamicValue implements DynamicValue {
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
Card sourceCard = game.getCard(sourceAbility.getSourceId());
if (sourceCard != null) {
for (Cost cost : sourceAbility.getCosts()) {
if (cost instanceof SacrificeTargetCost) {
Permanent p = (Permanent) game.getLastKnownInformation(((SacrificeTargetCost) cost).getPermanents().get(0).getId(), Zone.BATTLEFIELD);
return -1 * p.getPower().getValue();
}
}
}
return 0;
}
@Override
public DynamicValue copy() {
return this;
}
@Override
public String getMessage() {
return "the sacrificed creature's power";
}
@Override
public String toString() {
return "-X";
}
}

View file

@ -1,4 +1,3 @@
package mage.cards.i; package mage.cards.i;
import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.DynamicValue;
@ -26,7 +25,7 @@ public final class InnerCalmOuterStrength extends CardImpl {
// Target creature gets +X/+X until end of turn, where X is the number of cards in your hand. // Target creature gets +X/+X until end of turn, where X is the number of cards in your hand.
DynamicValue xValue= CardsInControllerHandCount.instance; DynamicValue xValue= CardsInControllerHandCount.instance;
Effect effect = new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn, true); Effect effect = new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn);
effect.setText("Target creature gets +X/+X until end of turn, where X is the number of cards in your hand"); effect.setText("Target creature gets +X/+X until end of turn, where X is the number of cards in your hand");
this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());

View file

@ -1,5 +1,6 @@
package mage.cards.i; package mage.cards.i;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.hint.common.ArtifactYouControlHint; import mage.abilities.hint.common.ArtifactYouControlHint;
@ -17,12 +18,13 @@ import java.util.UUID;
*/ */
public final class Irradiate extends CardImpl { public final class Irradiate extends CardImpl {
private static final DynamicValue xValue = new PermanentsOnBattlefieldCount(new FilterControlledArtifactPermanent(), -1);
public Irradiate(UUID ownerId, CardSetInfo setInfo) { public Irradiate(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{B}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{B}");
// Target creature gets -1/-1 until end of turn for each artifact you control. // Target creature gets -1/-1 until end of turn for each artifact you control.
PermanentsOnBattlefieldCount count = new PermanentsOnBattlefieldCount(new FilterControlledArtifactPermanent(), -1); this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn));
this.getSpellAbility().addEffect(new BoostTargetEffect(count, count, Duration.EndOfTurn, true));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addHint(ArtifactYouControlHint.instance); this.getSpellAbility().addHint(ArtifactYouControlHint.instance);
} }

View file

@ -49,12 +49,12 @@ public final class JiangYanggu extends CardImpl {
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);
// -1: If you don't control a creature named Mowu, creature a legendary 3/3 green Hound creature token named Mowu. // -1: If you don't control a creature named Mowu, create Mowu, a legendary 3/3 green Dog creature token.
this.addAbility(new LoyaltyAbility(new ConditionalOneShotEffect( this.addAbility(new LoyaltyAbility(new ConditionalOneShotEffect(
new CreateTokenEffect(new MowuToken()), new CreateTokenEffect(new MowuToken()),
new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter)), new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter)),
"If you don't control a creature named Mowu, " "If you don't control a creature named Mowu, "
+ "creature Mowu, a legendary 3/3 green Dog creature token." + "create Mowu, a legendary 3/3 green Dog creature token."
), -1)); ), -1));
// -5: Until end of turn, target creature gains trample and gets +X/+X, where X is the number of lands you control. // -5: Until end of turn, target creature gains trample and gets +X/+X, where X is the number of lands you control.
@ -65,7 +65,7 @@ public final class JiangYanggu extends CardImpl {
"Until end of turn, target creature gains trample" "Until end of turn, target creature gains trample"
), -5); ), -5);
ability.addEffect( ability.addEffect(
new BoostTargetEffect(controlledLands, controlledLands, Duration.EndOfTurn, true) new BoostTargetEffect(controlledLands, controlledLands, Duration.EndOfTurn)
.setText("and gets +X/+X, where X is the number of lands you control") .setText("and gets +X/+X, where X is the number of lands you control")
); );
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());

View file

@ -33,7 +33,7 @@ public final class JunkyoBell extends CardImpl {
// At the beginning of your upkeep, you may have target creature you control get +X/+X until end of turn, // At the beginning of your upkeep, you may have target creature you control get +X/+X until end of turn,
// where X is the number of creatures you control. If you do, sacrifice that creature at the beginning of the next end step. // where X is the number of creatures you control. If you do, sacrifice that creature at the beginning of the next end step.
Ability ability = new BeginningOfUpkeepTriggeredAbility( Ability ability = new BeginningOfUpkeepTriggeredAbility(
new BoostTargetEffect(CreaturesYouControlCount.instance, CreaturesYouControlCount.instance, Duration.EndOfTurn, true), new BoostTargetEffect(CreaturesYouControlCount.instance, CreaturesYouControlCount.instance, Duration.EndOfTurn),
TargetController.YOU, TargetController.YOU,
true); true);
ability.addTarget(new TargetControlledCreaturePermanent()); ability.addTarget(new TargetControlledCreaturePermanent());

View file

@ -30,8 +30,7 @@ public final class KabiraOutrider extends CardImpl {
// When Kabria Outrider enters the battlefield, target creature gets +1/+1 until end of turn for each creature in your party. // When Kabria Outrider enters the battlefield, target creature gets +1/+1 until end of turn for each creature in your party.
Ability ability = new EntersBattlefieldTriggeredAbility(new BoostTargetEffect( Ability ability = new EntersBattlefieldTriggeredAbility(new BoostTargetEffect(
PartyCount.instance, PartyCount.instance, Duration.EndOfTurn, true PartyCount.instance, PartyCount.instance, Duration.EndOfTurn));
));
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability.addHint(PartyCountHint.instance)); this.addAbility(ability.addHint(PartyCountHint.instance));
} }

View file

@ -26,8 +26,7 @@ public final class KarametrasAcolyte extends CardImpl {
// {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( this.addAbility(new DynamicManaAbility(
Mana.GreenMana(1), DevotionCount.G, "Add an amount of {G} equal to your devotion to green. " + Mana.GreenMana(1), DevotionCount.G, "Add an amount of {G} equal to your devotion to green. " + DevotionCount.G.getReminder()
"(Each {G} in the mana costs of permanents you control counts towards your devotion to green.)"
).addHint(DevotionCount.G.getHint())); ).addHint(DevotionCount.G.getHint()));
} }

View file

@ -1,7 +1,6 @@
package mage.cards.k; package mage.cards.k;
import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CreaturesYouControlCount;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.combat.MustBeBlockedByAtLeastOneTargetEffect; import mage.abilities.effects.common.combat.MustBeBlockedByAtLeastOneTargetEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
@ -10,7 +9,6 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID; import java.util.UUID;
@ -20,15 +18,12 @@ import java.util.UUID;
*/ */
public final class KingHaraldsRevenge extends CardImpl { public final class KingHaraldsRevenge extends CardImpl {
private static final DynamicValue xValue
= new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURE);
public KingHaraldsRevenge(UUID ownerId, CardSetInfo setInfo) { public KingHaraldsRevenge(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{G}"); super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{G}");
// Until end of turn, target creature gets +1/+1 for each creature you control and gains trample. It must be blocked this turn if able. // Until end of turn, target creature gets +1/+1 for each creature you control and gains trample. It must be blocked this turn if able.
this.getSpellAbility().addEffect(new BoostTargetEffect( this.getSpellAbility().addEffect(new BoostTargetEffect(
xValue, xValue, Duration.EndOfTurn, true CreaturesYouControlCount.instance, CreaturesYouControlCount.instance, Duration.EndOfTurn
).setText("until end of turn, target creature gets +1/+1 for each creature you control")); ).setText("until end of turn, target creature gets +1/+1 for each creature you control"));
this.getSpellAbility().addEffect(new GainAbilityTargetEffect( this.getSpellAbility().addEffect(new GainAbilityTargetEffect(
TrampleAbility.getInstance(), Duration.EndOfTurn TrampleAbility.getInstance(), Duration.EndOfTurn

View file

@ -31,7 +31,7 @@ public final class KryShield extends CardImpl {
Effect effect = new PreventDamageByTargetEffect(Duration.EndOfTurn); Effect effect = new PreventDamageByTargetEffect(Duration.EndOfTurn);
effect.setText("Prevent all damage that would be dealt this turn by target creature you control"); effect.setText("Prevent all damage that would be dealt this turn by target creature you control");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(2)); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(2));
ability.addEffect(new BoostTargetEffect(StaticValue.get(0), TargetManaValue.instance, Duration.EndOfTurn, true) ability.addEffect(new BoostTargetEffect(StaticValue.get(0), TargetManaValue.instance, Duration.EndOfTurn)
.setText("That creature gets +0/+X until end of turn, where X is its mana value")); .setText("That creature gets +0/+X until end of turn, where X is its mana value"));
ability.addCost(new TapSourceCost()); ability.addCost(new TapSourceCost());
ability.addTarget(new TargetControlledCreaturePermanent()); ability.addTarget(new TargetControlledCreaturePermanent());

View file

@ -4,6 +4,7 @@ import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility; import mage.abilities.LoyaltyAbility;
import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
import mage.abilities.effects.AsThoughEffectImpl; import mage.abilities.effects.AsThoughEffectImpl;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.LoseLifeOpponentsEffect; import mage.abilities.effects.common.LoseLifeOpponentsEffect;
@ -12,7 +13,7 @@ import mage.cards.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.*;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledPermanent;
import mage.game.Game; import mage.game.Game;
import mage.players.Player; import mage.players.Player;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -24,8 +25,9 @@ import java.util.UUID;
*/ */
public final class LilianaUntouchedByDeath extends CardImpl { public final class LilianaUntouchedByDeath extends CardImpl {
private static final FilterControlledCreaturePermanent filter private static final DynamicValue xValue = new SignInversionDynamicValue(
= new FilterControlledCreaturePermanent(SubType.ZOMBIE, "Zombies you control"); new PermanentsOnBattlefieldCount(new FilterControlledPermanent(SubType.ZOMBIE, "Zombies you control"), null)
);
public LilianaUntouchedByDeath(UUID ownerId, CardSetInfo setInfo) { public LilianaUntouchedByDeath(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{2}{B}{B}"); super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{2}{B}{B}");
@ -38,12 +40,7 @@ public final class LilianaUntouchedByDeath extends CardImpl {
this.addAbility(new LoyaltyAbility(new LilianaUntouchedByDeathEffect(), 1)); this.addAbility(new LoyaltyAbility(new LilianaUntouchedByDeathEffect(), 1));
// -2: Target creature gets -X/-X until end of turn, where X is the number of Zombies you control. // -2: Target creature gets -X/-X until end of turn, where X is the number of Zombies you control.
DynamicValue xValue = new PermanentsOnBattlefieldCount(filter, -1); Ability ability = new LoyaltyAbility(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn), -2);
Ability ability = new LoyaltyAbility(
new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn, true)
.setText("target creature gets -X/-X until end of turn, "
+ "where X is the number of Zombies you control"), -2
);
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);

View file

@ -4,9 +4,11 @@ import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility; import mage.abilities.LoyaltyAbility;
import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount;
import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.GetEmblemEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.hint.Hint;
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;
@ -31,8 +33,9 @@ import java.util.UUID;
*/ */
public final class LilianaWakerOfTheDead extends CardImpl { public final class LilianaWakerOfTheDead extends CardImpl {
private static final DynamicValue xValue = new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD, -1); private static final DynamicValue cardsInGraveyard = new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CARDS, null);
private static final DynamicValue xValue_hint = new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD); private static final DynamicValue xValue = new SignInversionDynamicValue(cardsInGraveyard);
private static final Hint hint = new ValueHint("Cards in your graveyard", cardsInGraveyard);
public LilianaWakerOfTheDead(UUID ownerId, CardSetInfo setInfo) { public LilianaWakerOfTheDead(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{2}{B}{B}"); super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{2}{B}{B}");
@ -45,10 +48,8 @@ public final class LilianaWakerOfTheDead extends CardImpl {
this.addAbility(new LoyaltyAbility(new LilianaWakerOfTheDeadDiscardEffect(), 1)); this.addAbility(new LoyaltyAbility(new LilianaWakerOfTheDeadDiscardEffect(), 1));
// 3: Target creature gets -X/-X until end of turn, where X is the number of cards in your graveyard. // 3: Target creature gets -X/-X until end of turn, where X is the number of cards in your graveyard.
Ability ability = new LoyaltyAbility(new BoostTargetEffect( Ability ability = new LoyaltyAbility(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn), -3);
xValue, xValue, Duration.EndOfTurn, true ability.addHint(hint);
).setText("target creature gets -X/-X until end of turn, where X is the number of cards in your graveyard"), -3)
.addHint(new ValueHint("Cards in your graveyard", xValue_hint));
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);
@ -115,4 +116,4 @@ class LilianaWakerOfTheDeadDiscardEffect extends OneShotEffect {
} }
return true; return true;
} }
} }

View file

@ -38,7 +38,7 @@ public final class LivaanCultistOfTiamat extends CardImpl {
// Whenever you cast a noncreature spell, target creature gets +X/+0 until end of turn, where X is that spell's mana value. // Whenever you cast a noncreature spell, target creature gets +X/+0 until end of turn, where X is that spell's mana value.
Ability ability = new SpellCastControllerTriggeredAbility(new BoostTargetEffect( Ability ability = new SpellCastControllerTriggeredAbility(new BoostTargetEffect(
LivaanCultistOfTiamatValue.instance, StaticValue.get(0), Duration.EndOfTurn, true LivaanCultistOfTiamatValue.instance, StaticValue.get(0), Duration.EndOfTurn
), StaticFilters.FILTER_SPELL_A_NON_CREATURE, false); ), StaticFilters.FILTER_SPELL_A_NON_CREATURE, false);
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);

View file

@ -1,4 +1,3 @@
package mage.cards.l; package mage.cards.l;
import java.util.UUID; import java.util.UUID;
@ -7,6 +6,7 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.DiscardCardCost; import mage.abilities.costs.common.DiscardCardCost;
import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.dynamicvalue.common.SignInversionDynamicValue; import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
@ -16,7 +16,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType; import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterControlledPermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -27,27 +26,26 @@ import mage.target.common.TargetCreaturePermanent;
*/ */
public final class LysAlanaScarblade extends CardImpl { public final class LysAlanaScarblade extends CardImpl {
private static final FilterControlledPermanent filter1 = new FilterControlledPermanent(); private static final FilterCard filter = new FilterCard("an Elf card");
private static final FilterCard filter2 = new FilterCard("an Elf card");
static { static {
filter1.add(SubType.ELF.getPredicate()); filter.add(SubType.ELF.getPredicate());
filter2.add(SubType.ELF.getPredicate());
} }
private static final DynamicValue xValue = new SignInversionDynamicValue(
new PermanentsOnBattlefieldCount(new FilterControlledPermanent(SubType.ELF, "Elves you control"), null)
);
public LysAlanaScarblade(UUID ownerId, CardSetInfo setInfo) { public LysAlanaScarblade(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.ELF); this.subtype.add(SubType.ELF, SubType.ASSASSIN);
this.subtype.add(SubType.ASSASSIN);
this.power = new MageInt(1); this.power = new MageInt(1);
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
// {tap}, Discard an Elf card: Target creature gets -X/-X until end of turn, where X is the number of Elves you control. // {tap}, Discard an Elf card: Target creature gets -X/-X until end of turn, where X is the number of Elves you control.
SignInversionDynamicValue count = new SignInversionDynamicValue(new PermanentsOnBattlefieldCount(filter1)); Ability ability = new SimpleActivatedAbility(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn), new TapSourceCost());
Effect effect = new BoostTargetEffect(count, count, Duration.EndOfTurn, true); ability.addCost(new DiscardCardCost(filter));
effect.setText("target creature gets -X/-X until end of turn, where X is the number of Elves you control");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost());
ability.addCost(new DiscardCardCost(filter2));
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -40,7 +40,7 @@ public final class MagmaSliver extends CardImpl {
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new BoostTargetEffect(new PermanentsOnBattlefieldCount( new BoostTargetEffect(new PermanentsOnBattlefieldCount(
StaticFilters.FILTER_PERMANENT_ALL_SLIVERS), StaticFilters.FILTER_PERMANENT_ALL_SLIVERS),
StaticValue.get(0), Duration.EndOfTurn, true), StaticValue.get(0), Duration.EndOfTurn),
new TapSourceCost()); new TapSourceCost());
Target target = new TargetCreaturePermanent( Target target = new TargetCreaturePermanent(
new FilterCreaturePermanent(SubType.SLIVER, "Sliver creature")); new FilterCreaturePermanent(SubType.SLIVER, "Sliver creature"));

View file

@ -1,4 +1,3 @@
package mage.cards.m; package mage.cards.m;
import java.util.UUID; import java.util.UUID;
@ -28,7 +27,7 @@ import mage.target.common.TargetCreaturePermanent;
* @author emerald000 * @author emerald000
*/ */
public final class MartyrOfSpores extends CardImpl { public final class MartyrOfSpores extends CardImpl {
private static final FilterCard filter = new FilterCard("X green cards from your hand"); private static final FilterCard filter = new FilterCard("X green cards from your hand");
static { static {
filter.add(new ColorPredicate(ObjectColor.GREEN)); filter.add(new ColorPredicate(ObjectColor.GREEN));
@ -36,16 +35,16 @@ public final class MartyrOfSpores extends CardImpl {
public MartyrOfSpores(UUID ownerId, CardSetInfo setInfo) { public MartyrOfSpores(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{G}"); super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{G}");
this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.HUMAN, SubType.SHAMAN);
this.subtype.add(SubType.SHAMAN);
this.power = new MageInt(1); this.power = new MageInt(1);
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
// {1}, Reveal X green cards from your hand, Sacrifice Martyr of Spores: Target creature gets +X/+X until end of turn. // {1}, Reveal X green cards from your hand, Sacrifice Martyr of Spores: Target creature gets +X/+X until end of turn.
Effect effect = new BoostTargetEffect(RevealTargetFromHandCostCount.instance, RevealTargetFromHandCostCount.instance, Duration.EndOfTurn, true); Ability ability = new SimpleActivatedAbility(
effect.setText("Target creature gets +X/+X until end of turn."); new BoostTargetEffect(RevealTargetFromHandCostCount.instance, RevealTargetFromHandCostCount.instance, Duration.EndOfTurn),
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(1)); new GenericManaCost(1)
);
ability.addCost(new RevealTargetFromHandCost(new TargetCardInHand(0, Integer.MAX_VALUE, filter))); ability.addCost(new RevealTargetFromHandCost(new TargetCardInHand(0, Integer.MAX_VALUE, filter)));
ability.addCost(new SacrificeSourceCost()); ability.addCost(new SacrificeSourceCost());
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());

View file

@ -46,7 +46,7 @@ public final class MasterOfWaves extends CardImpl {
// 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(), DevotionCount.U); 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. " + DevotionCount.U.getReminder());
this.addAbility(new EntersBattlefieldTriggeredAbility(effect).addHint(DevotionCount.U.getHint())); this.addAbility(new EntersBattlefieldTriggeredAbility(effect).addHint(DevotionCount.U.getHint()));
} }

View file

@ -38,7 +38,7 @@ public final class MichikosReignOfTruth extends CardImpl {
// I, II Target creature gets +1/+1 until end of turn for each artifact and/or enchantment you control. // I, II Target creature gets +1/+1 until end of turn for each artifact and/or enchantment you control.
sagaAbility.addChapterEffect( sagaAbility.addChapterEffect(
this, SagaChapter.CHAPTER_I, SagaChapter.CHAPTER_II, this, SagaChapter.CHAPTER_I, SagaChapter.CHAPTER_II,
new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn, true) new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn)
.setText("target creature gets +1/+1 until end of turn " + .setText("target creature gets +1/+1 until end of turn " +
"for each artifact and/or enchantment you control"), "for each artifact and/or enchantment you control"),
new TargetCreaturePermanent() new TargetCreaturePermanent()

View file

@ -17,14 +17,11 @@ import java.util.UUID;
*/ */
public final class MightOfAlara extends CardImpl { public final class MightOfAlara extends CardImpl {
public MightOfAlara(UUID ownerId, CardSetInfo setInfo) { public MightOfAlara(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}");
// Domain - Target creature gets +1/+1 until end of turn for each basic land type among lands you control. // Domain - Target creature gets +1/+1 until end of turn for each basic land type among lands you control.
this.getSpellAbility().addEffect(new BoostTargetEffect( this.getSpellAbility().addEffect(new BoostTargetEffect(DomainValue.REGULAR, DomainValue.REGULAR, Duration.EndOfTurn));
DomainValue.REGULAR, DomainValue.REGULAR, Duration.EndOfTurn, true
));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addHint(DomainHint.instance); this.getSpellAbility().addHint(DomainHint.instance);
this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN); this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN);

View file

@ -1,5 +1,6 @@
package mage.cards.m; package mage.cards.m;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
@ -16,13 +17,14 @@ import java.util.UUID;
*/ */
public final class MightOfTheMasses extends CardImpl { public final class MightOfTheMasses extends CardImpl {
private static final DynamicValue xValue = new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURE);
public MightOfTheMasses(UUID ownerId, CardSetInfo setInfo) { public MightOfTheMasses(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}");
// Target creature gets +1/+1 until end of turn for each creature you control. // Target creature gets +1/+1 until end of turn for each creature you control.
PermanentsOnBattlefieldCount value = new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURE);
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new BoostTargetEffect(value, value, Duration.EndOfTurn, true)); this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn));
} }
private MightOfTheMasses(final MightOfTheMasses card) { private MightOfTheMasses(final MightOfTheMasses card) {

View file

@ -24,9 +24,9 @@ public final class MightOfTheNephilim extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{G}"); super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{G}");
// Target creature gets +2/+2 until end of turn for each of its colors. // Target creature gets +2/+2 until end of turn for each of its colors.
DynamicValue boostValue = MightOfTheNephilimValue.instance; this.getSpellAbility().addEffect(new BoostTargetEffect(
Effect effect = new BoostTargetEffect(boostValue, boostValue, Duration.EndOfTurn, true); MightOfTheNephilimValue.instance, MightOfTheNephilimValue.instance, Duration.EndOfTurn
this.getSpellAbility().addEffect(effect); ));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
} }

View file

@ -59,7 +59,7 @@ public final class MobMentality extends CardImpl {
class MobMentalityTriggeredAbility extends TriggeredAbilityImpl { class MobMentalityTriggeredAbility extends TriggeredAbilityImpl {
MobMentalityTriggeredAbility() { MobMentalityTriggeredAbility() {
super(Zone.BATTLEFIELD, new BoostTargetEffect(new AttackingCreatureCount(), StaticValue.get(0), Duration.EndOfTurn, true)); super(Zone.BATTLEFIELD, new BoostTargetEffect(new AttackingCreatureCount(), StaticValue.get(0), Duration.EndOfTurn));
} }
private MobMentalityTriggeredAbility(final MobMentalityTriggeredAbility ability) { private MobMentalityTriggeredAbility(final MobMentalityTriggeredAbility ability) {
@ -108,4 +108,4 @@ class MobMentalityTriggeredAbility extends TriggeredAbilityImpl {
"enchanted creature gets +X/+0 until end of turn, " + "enchanted creature gets +X/+0 until end of turn, " +
"where X is the number of attacking creatures."; "where X is the number of attacking creatures.";
} }
} }

View file

@ -25,11 +25,12 @@ import mage.target.common.TargetCreaturePermanent;
*/ */
public final class MoodmarkPainter extends CardImpl { public final class MoodmarkPainter extends CardImpl {
private static final DynamicValue xValue = new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURES, null);
public MoodmarkPainter(UUID ownerId, CardSetInfo setInfo) { public MoodmarkPainter(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{B}");
this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.HUMAN, SubType.SHAMAN);
this.subtype.add(SubType.SHAMAN);
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
@ -42,10 +43,9 @@ public final class MoodmarkPainter extends CardImpl {
false); false);
// target creature gains menace and gets +X/+0 until end of turn, // target creature gains menace and gets +X/+0 until end of turn,
// where X is the number of creature cards in your graveyard. // where X is the number of creature cards in your graveyard.
DynamicValue xValue = new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURE);
ability.addEffect(new BoostTargetEffect( ability.addEffect(new BoostTargetEffect(
xValue, StaticValue.get(0), xValue, StaticValue.get(0),
Duration.EndOfTurn, true Duration.EndOfTurn
).setText("and gets +X/+0 until end of turn, " ).setText("and gets +X/+0 until end of turn, "
+ "where X is the number of creature cards in your graveyard. " + + "where X is the number of creature cards in your graveyard. " +
"<i>(It can't be blocked except by two or more creatures.)</i>")); // Must be here to match Oracle text "<i>(It can't be blocked except by two or more creatures.)</i>")); // Must be here to match Oracle text

View file

@ -45,7 +45,7 @@ public final class MuscleBurst extends CardImpl {
// Target creature gets +X/+X until end of turn, where X is 3 plus the number of cards named Muscle Burst in all graveyards. // Target creature gets +X/+X until end of turn, where X is 3 plus the number of cards named Muscle Burst in all graveyards.
this.getSpellAbility().addEffect(new BoostTargetEffect( this.getSpellAbility().addEffect(new BoostTargetEffect(
xValue, xValue, Duration.EndOfTurn, true xValue, xValue, Duration.EndOfTurn
).setText("Target creature gets +X/+X until end of turn, where X is 3 plus the number of cards named Muscle Burst in all graveyards.")); ).setText("Target creature gets +X/+X until end of turn, where X is 3 plus the number of cards named Muscle Burst in all graveyards."));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
} }

View file

@ -3,6 +3,7 @@ package mage.cards.n;
import java.util.UUID; import java.util.UUID;
import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount;
import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
import mage.abilities.effects.common.ExileTargetIfDiesEffect; import mage.abilities.effects.common.ExileTargetIfDiesEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
@ -19,19 +20,14 @@ import mage.target.common.TargetCreaturePermanent;
*/ */
public final class NecroticWound extends CardImpl { public final class NecroticWound extends CardImpl {
private static final DynamicValue xValue = new SignInversionDynamicValue(new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURES, null));
public NecroticWound(UUID ownerId, CardSetInfo setInfo) { public NecroticWound(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}");
// Undergrowth Target creature gets -X/-X until end of turn, where X is the number of creature cards in your graveyard. If that creature would die this turn, exile it instead. // Undergrowth Target creature gets -X/-X until end of turn, where X is the number of creature cards in your graveyard.
DynamicValue xValue = new CardsInControllerGraveyardCount( // If that creature would die this turn, exile it instead.
StaticFilters.FILTER_CARD_CREATURE, -1 this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn));
);
this.getSpellAbility().addEffect(
new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn, true)
.setText("Target creature gets -X/-X until end of turn, "
+ "where X is the number "
+ "of creature cards in your graveyard.")
);
this.getSpellAbility().addEffect(new ExileTargetIfDiesEffect()); this.getSpellAbility().addEffect(new ExileTargetIfDiesEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().setAbilityWord(AbilityWord.UNDERGROWTH); this.getSpellAbility().setAbilityWord(AbilityWord.UNDERGROWTH);

View file

@ -1,8 +1,8 @@
package mage.cards.n; package mage.cards.n;
import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.MultipliedValue;
import mage.abilities.dynamicvalue.common.ControllerGotLifeCount; import mage.abilities.dynamicvalue.common.ControllerGotLifeCount;
import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
@ -19,16 +19,14 @@ import java.util.UUID;
*/ */
public final class NightmaresThirst extends CardImpl { public final class NightmaresThirst extends CardImpl {
private static final DynamicValue xValue = new MultipliedValue(ControllerGotLifeCount.instance, -1); private static final DynamicValue xValue = new SignInversionDynamicValue(ControllerGotLifeCount.instance);
public NightmaresThirst(UUID ownerId, CardSetInfo setInfo) { public NightmaresThirst(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}");
// You gain 1 life. Target creature gets -X/-X until end of turn, where X is the amount of life you gained this turn. // You gain 1 life. Target creature gets -X/-X until end of turn, where X is the amount of life you gained this turn.
this.getSpellAbility().addEffect(new GainLifeEffect(1)); this.getSpellAbility().addEffect(new GainLifeEffect(1));
this.getSpellAbility().addEffect(new BoostTargetEffect( this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn));
xValue, xValue, Duration.EndOfTurn, true
).setText("Target creature gets -X/-X until end of turn, where X is the amount of life you gained this turn."));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addWatcher(new PlayerGainedLifeWatcher()); this.getSpellAbility().addWatcher(new PlayerGainedLifeWatcher());
this.getSpellAbility().addHint(ControllerGotLifeCount.getHint()); this.getSpellAbility().addHint(ControllerGotLifeCount.getHint());

View file

@ -1,4 +1,3 @@
package mage.cards.n; package mage.cards.n;
import java.util.UUID; import java.util.UUID;
@ -19,13 +18,13 @@ import mage.target.common.TargetCreaturePermanent;
*/ */
public final class NightmarishEnd extends CardImpl { public final class NightmarishEnd extends CardImpl {
private static final DynamicValue xValue = new SignInversionDynamicValue(CardsInControllerHandCount.instance);
public NightmarishEnd(UUID ownerId, CardSetInfo setInfo) { public NightmarishEnd(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{B}"); super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{B}");
// Target creature gets -X/-X until end of turn, where X is the number of cards in your hand. // Target creature gets -X/-X until end of turn, where X is the number of cards in your hand.
DynamicValue xValue = new SignInversionDynamicValue(CardsInControllerHandCount.instance); Effect effect = new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn);
Effect effect = new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn, true);
effect.setText("Target creature gets -X/-X until end of turn, where X is the number of cards in your hand"); effect.setText("Target creature gets -X/-X until end of turn, where X is the number of cards in your hand");
this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());

View file

@ -21,7 +21,7 @@ import java.util.UUID;
public final class NourishingShoal extends CardImpl { public final class NourishingShoal extends CardImpl {
private static final FilterOwnedCard filter private static final FilterOwnedCard filter
= new FilterOwnedCard("a red card with mana value X from your hand"); = new FilterOwnedCard("a green card with mana value X from your hand");
static { static {
filter.add(new ColorPredicate(ObjectColor.GREEN)); filter.add(new ColorPredicate(ObjectColor.GREEN));

View file

@ -5,6 +5,7 @@ import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.dynamicvalue.common.DevotionCount; import mage.abilities.dynamicvalue.common.DevotionCount;
import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.InfoEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
@ -22,17 +23,20 @@ public final class NyleasHuntmaster extends CardImpl {
public NyleasHuntmaster(UUID ownerId, CardSetInfo setInfo) { public NyleasHuntmaster(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.CENTAUR, SubType.SHAMAN);
this.subtype.add(SubType.CENTAUR);
this.subtype.add(SubType.SHAMAN);
this.power = new MageInt(4); this.power = new MageInt(4);
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
// When Nylea's Huntmaster enters the battlefield, target creature you control gets +X/+0 until end of turn, where X is your devotion to green. // When Nylea's Huntmaster enters the battlefield,
// target creature you control gets +X/+0 until end of turn,
// where X is your devotion to green.
Ability ability = new EntersBattlefieldTriggeredAbility(new BoostTargetEffect( Ability ability = new EntersBattlefieldTriggeredAbility(new BoostTargetEffect(
DevotionCount.G, StaticValue.get(0), Duration.EndOfTurn DevotionCount.G, StaticValue.get(0), Duration.EndOfTurn
)); ));
ability.addEffect(new InfoEffect(DevotionCount.G.getReminder()));
ability.addTarget(new TargetControlledCreaturePermanent()); ability.addTarget(new TargetControlledCreaturePermanent());
ability.addHint(DevotionCount.G.getHint());
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -1,4 +1,3 @@
package mage.cards.o; package mage.cards.o;
import java.util.UUID; import java.util.UUID;
@ -7,6 +6,7 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; import mage.abilities.dynamicvalue.common.CardsInControllerHandCount;
import mage.abilities.dynamicvalue.common.SignInversionDynamicValue; import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.dynamicvalue.common.StaticValue;
@ -18,8 +18,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType; import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledLandPermanent;
import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -29,20 +28,23 @@ import mage.target.common.TargetCreaturePermanent;
*/ */
public final class OboroEnvoy extends CardImpl { public final class OboroEnvoy extends CardImpl {
private static final DynamicValue xValue = new SignInversionDynamicValue(CardsInControllerHandCount.instance);
public OboroEnvoy(UUID ownerId, CardSetInfo setInfo) { public OboroEnvoy(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}");
this.subtype.add(SubType.MOONFOLK); this.subtype.add(SubType.MOONFOLK, SubType.WIZARD);
this.subtype.add(SubType.WIZARD);
this.power = new MageInt(1); this.power = new MageInt(1);
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
// Flying // Flying
this.addAbility(FlyingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance());
// {2}, Return a land you control to its owner's hand: Target creature gets -X/-0 until end of turn, where X is the number of cards in your hand. // {2}, Return a land you control to its owner's hand: Target creature gets -X/-0 until end of turn, where X is the number of cards in your hand.
Effect effect = new BoostTargetEffect(new SignInversionDynamicValue(CardsInControllerHandCount.instance), StaticValue.get(-0), Duration.EndOfTurn, true); Effect effect = new BoostTargetEffect(xValue, StaticValue.get(0), Duration.EndOfTurn);
effect.setText("Target creature gets -X/-0 until end of turn, where X is the number of cards in your hand"); effect.setText("Target creature gets -X/-0 until end of turn, where X is the number of cards in your hand");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(2)); Ability ability = new SimpleActivatedAbility(effect, new GenericManaCost(2));
ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(new FilterControlledLandPermanent("a land")))); ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_LAND_SHORT_TEXT)));
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -24,7 +24,7 @@ public final class OnwardVictory extends SplitCard {
// Onward // Onward
// Target creature gets +X/+0 until end of turn where X is its power. // Target creature gets +X/+0 until end of turn where X is its power.
getLeftHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent()); getLeftHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent());
getLeftHalfCard().getSpellAbility().addEffect(new BoostTargetEffect(TargetPermanentPowerCount.instance, StaticValue.get(0), Duration.EndOfTurn, true)); getLeftHalfCard().getSpellAbility().addEffect(new BoostTargetEffect(TargetPermanentPowerCount.instance, StaticValue.get(0), Duration.EndOfTurn));
// to // to
// Victory // Victory

View file

@ -14,7 +14,7 @@ import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.SubType; import mage.constants.SubType;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledPermanent;
import mage.game.Game; import mage.game.Game;
import mage.players.Player; import mage.players.Player;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -67,10 +67,9 @@ class PacksDisdainEffect extends OneShotEffect {
Choice typeChoice = new ChoiceCreatureType(game.getObject(source)); Choice typeChoice = new ChoiceCreatureType(game.getObject(source));
if (player != null if (player != null
&& player.choose(Outcome.UnboostCreature, typeChoice, game)) { && player.choose(Outcome.UnboostCreature, typeChoice, game)) {
FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); FilterControlledPermanent filter = new FilterControlledPermanent(SubType.byDescription(typeChoice.getChoice()));
filter.add(SubType.byDescription(typeChoice.getChoice()).getPredicate());
DynamicValue negativePermanentsCount = new PermanentsOnBattlefieldCount(filter, -1); DynamicValue negativePermanentsCount = new PermanentsOnBattlefieldCount(filter, -1);
ContinuousEffect effect = new BoostTargetEffect(negativePermanentsCount, negativePermanentsCount, Duration.EndOfTurn, true); ContinuousEffect effect = new BoostTargetEffect(negativePermanentsCount, negativePermanentsCount, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(source.getFirstTarget(), game)); effect.setTargetPointer(new FixedTarget(source.getFirstTarget(), game));
game.addEffect(effect, source); game.addEffect(effect, source);
return true; return true;

View file

@ -65,7 +65,7 @@ public final class PaladinClass extends CardImpl {
// Whenever you attack, until end of turn, target attacking creature gets +1/+1 for each other attacking creature and gains double strike. // Whenever you attack, until end of turn, target attacking creature gets +1/+1 for each other attacking creature and gains double strike.
Ability ability = new AttacksWithCreaturesTriggeredAbility( Ability ability = new AttacksWithCreaturesTriggeredAbility(
new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn, true) new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn)
.setText("until end of turn, target attacking creature " + .setText("until end of turn, target attacking creature " +
"gets +1/+1 for each other attacking creature"), "gets +1/+1 for each other attacking creature"),
1 1

View file

@ -1,14 +1,14 @@
package mage.cards.p; package mage.cards.p;
import java.util.UUID; import java.util.UUID;
import mage.abilities.dynamicvalue.LockedInDynamicValue; import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.dynamicvalue.common.DomainValue;
import mage.abilities.dynamicvalue.common.SignInversionDynamicValue; import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostAllEffect; import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.abilities.hint.common.DomainHint; import mage.abilities.hint.common.DomainHint;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.AbilityWord;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
@ -19,17 +19,15 @@ import mage.constants.Duration;
*/ */
public final class PlanarDespair extends CardImpl { public final class PlanarDespair extends CardImpl {
// rule 608.2h private static final DynamicValue xValue = new SignInversionDynamicValue(DomainValue.REGULAR);
private static final LockedInDynamicValue dv = new LockedInDynamicValue(new SignInversionDynamicValue(DomainValue.REGULAR));
public PlanarDespair(UUID ownerId, CardSetInfo setInfo) { public PlanarDespair(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{B}{B}"); super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{B}{B}");
// Domain - All creatures get -1/-1 until end of turn for each basic land type among lands you control. // Domain - All creatures get -1/-1 until end of turn for each basic land type among lands you control.
Effect effect = new BoostAllEffect(dv, dv, Duration.EndOfTurn); this.getSpellAbility().addEffect(new BoostAllEffect(xValue, xValue, Duration.EndOfTurn));
effect.setText("<i>Domain</i> &mdash; All creatures get -1/-1 until end of turn for each basic land type among lands you control.");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addHint(DomainHint.instance); this.getSpellAbility().addHint(DomainHint.instance);
this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN);
} }
private PlanarDespair(final PlanarDespair card) { private PlanarDespair(final PlanarDespair card) {

View file

@ -1,8 +1,6 @@
package mage.cards.p; package mage.cards.p;
import java.util.UUID; import java.util.UUID;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.SweepNumber; import mage.abilities.dynamicvalue.common.SweepNumber;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.keyword.SweepEffect; import mage.abilities.effects.keyword.SweepEffect;
@ -25,8 +23,7 @@ public final class PlowThroughReito extends CardImpl {
// Sweep - Return any number of Plains you control to their owner's hand. Target creature gets +1/+1 until end of turn for each Plains returned this way. // Sweep - Return any number of Plains you control to their owner's hand. Target creature gets +1/+1 until end of turn for each Plains returned this way.
this.getSpellAbility().addEffect(new SweepEffect(SubType.PLAINS)); this.getSpellAbility().addEffect(new SweepEffect(SubType.PLAINS));
DynamicValue sweepValue = new SweepNumber("Plains"); this.getSpellAbility().addEffect(new BoostTargetEffect(SweepNumber.PLAINS, SweepNumber.PLAINS, Duration.EndOfTurn));
this.getSpellAbility().addEffect(new BoostTargetEffect(sweepValue, sweepValue, Duration.EndOfTurn, true));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
} }

View file

@ -6,8 +6,8 @@ import mage.abilities.common.ActivateAsSorceryActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.MultipliedValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
@ -29,22 +29,22 @@ public final class PriestOfTheHauntedEdge extends CardImpl {
filter.add(SuperType.SNOW.getPredicate()); filter.add(SuperType.SNOW.getPredicate());
} }
private static final DynamicValue xValue = new MultipliedValue(new PermanentsOnBattlefieldCount(filter), -1); private static final DynamicValue xValue = new SignInversionDynamicValue(new PermanentsOnBattlefieldCount(filter, null));
public PriestOfTheHauntedEdge(UUID ownerId, CardSetInfo setInfo) { public PriestOfTheHauntedEdge(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}");
this.addSuperType(SuperType.SNOW); this.addSuperType(SuperType.SNOW);
this.subtype.add(SubType.ZOMBIE); this.subtype.add(SubType.ZOMBIE, SubType.CLERIC);
this.subtype.add(SubType.CLERIC);
this.power = new MageInt(0); this.power = new MageInt(0);
this.toughness = new MageInt(4); this.toughness = new MageInt(4);
// {T}, Sacrifice Priest of the Haunted Edge: Target creature gets -X/-X until end of turn, where X is the number of snow lands you control. Activate this ability only any time you could cast a sorcery. // {T}, Sacrifice Priest of the Haunted Edge: Target creature gets -X/-X until end of turn,
// where X is the number of snow lands you control. Activate only as a sorcery.
Ability ability = new ActivateAsSorceryActivatedAbility( Ability ability = new ActivateAsSorceryActivatedAbility(
Zone.BATTLEFIELD, new BoostTargetEffect( new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn),
xValue, xValue, Duration.EndOfTurn, true new TapSourceCost()
).setText("target creature gets -X/-X until end of turn, where X is the number of snow lands you control"), new TapSourceCost()); );
ability.addCost(new SacrificeSourceCost()); ability.addCost(new SacrificeSourceCost());
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);

View file

@ -37,7 +37,7 @@ public final class RaffinesSilencer extends CardImpl {
// When Raffine's Silencer dies, target creature an opponent controls gets -X/-X until end of turn, where X is Raffine's Silencer's power. // When Raffine's Silencer dies, target creature an opponent controls gets -X/-X until end of turn, where X is Raffine's Silencer's power.
Ability ability = new DiesSourceTriggeredAbility( Ability ability = new DiesSourceTriggeredAbility(
new BoostTargetEffect(RaffinesSilencerValue.instance, RaffinesSilencerValue.instance, Duration.EndOfTurn, true), new BoostTargetEffect(RaffinesSilencerValue.instance, RaffinesSilencerValue.instance, Duration.EndOfTurn),
false false
); );
ability.addTarget(new TargetOpponentsCreaturePermanent()); ability.addTarget(new TargetOpponentsCreaturePermanent());
@ -80,4 +80,9 @@ enum RaffinesSilencerValue implements DynamicValue {
public String getMessage() { public String getMessage() {
return "{this}'s power"; return "{this}'s power";
} }
@Override
public int getSign() {
return -1;
}
} }

View file

@ -1,4 +1,3 @@
package mage.cards.r; package mage.cards.r;
import java.util.UUID; import java.util.UUID;
@ -26,14 +25,13 @@ public final class ResilientKhenra extends CardImpl {
public ResilientKhenra(UUID ownerId, CardSetInfo setInfo) { public ResilientKhenra(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}");
this.subtype.add(SubType.JACKAL); this.subtype.add(SubType.JACKAL, SubType.WIZARD);
this.subtype.add(SubType.WIZARD);
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// When Resilient Khenra enters the battlefield, you may have target creature get +X/+X until end of turn, where X is Resilient Khenra's power. // When Resilient Khenra enters the battlefield, you may have target creature get +X/+X until end of turn, where X is Resilient Khenra's power.
DynamicValue xValue = new SourcePermanentPowerCount(); DynamicValue xValue = new SourcePermanentPowerCount(false);
Ability ability = new EntersBattlefieldTriggeredAbility(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn, true), true); Ability ability = new EntersBattlefieldTriggeredAbility(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn), true);
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);

View file

@ -3,7 +3,7 @@ package mage.cards.r;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.RemoveVariableCountersTargetCost; import mage.abilities.costs.common.RemoveVariableCountersTargetCost;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ColoredManaCost;
import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.GetXValue; import mage.abilities.dynamicvalue.common.GetXValue;
import mage.abilities.dynamicvalue.common.SignInversionDynamicValue; import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
@ -11,8 +11,8 @@ import mage.abilities.effects.common.continuous.BoostTargetEffect;
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.Zone;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.StaticFilters; import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -24,13 +24,14 @@ import java.util.UUID;
*/ */
public final class RetributionOfTheAncients extends CardImpl { public final class RetributionOfTheAncients extends CardImpl {
private static final DynamicValue xValue = new SignInversionDynamicValue(GetXValue.instance);
public RetributionOfTheAncients(UUID ownerId, CardSetInfo setInfo) { public RetributionOfTheAncients(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{B}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{B}");
// {B}, Remove X +1/+1 counters from among creatures you control: Target creature gets -X/-X until end of turn. // {B}, Remove X +1/+1 counters from among creatures you control: Target creature gets -X/-X until end of turn.
DynamicValue xValue = new SignInversionDynamicValue(GetXValue.instance); Ability ability = new SimpleActivatedAbility(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn), new ColoredManaCost(ColoredManaSymbol.B));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn, true), new ManaCostsImpl<>("{B}")); ability.addCost(new RemoveVariableCountersTargetCost(StaticFilters.FILTER_CONTROLLED_CREATURES, CounterType.P1P1));
ability.addCost(new RemoveVariableCountersTargetCost(StaticFilters.FILTER_CONTROLLED_CREATURES, CounterType.P1P1, "X", 0));
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);
} }
@ -44,4 +45,3 @@ public final class RetributionOfTheAncients extends CardImpl {
return new RetributionOfTheAncients(this); return new RetributionOfTheAncients(this);
} }
} }

View file

@ -36,7 +36,7 @@ public final class Rubblehulk extends CardImpl {
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(controlledLands, Duration.EndOfGame))); this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(controlledLands, Duration.EndOfGame)));
// Bloodrush - 1{R}{G}, Discard Rubblehulk: Target attacking creature gets +X/+X until end of turn, where X is the number of lands you control. // Bloodrush - 1{R}{G}, Discard Rubblehulk: Target attacking creature gets +X/+X until end of turn, where X is the number of lands you control.
this.addAbility(new BloodrushAbility("{1}{R}{G}", new BoostTargetEffect(controlledLands, controlledLands, Duration.EndOfTurn, true))); this.addAbility(new BloodrushAbility("{1}{R}{G}", new BoostTargetEffect(controlledLands, controlledLands, Duration.EndOfTurn)));
} }
private Rubblehulk(final Rubblehulk card) { private Rubblehulk(final Rubblehulk card) {

View file

@ -1,4 +1,3 @@
package mage.cards.r; package mage.cards.r;
import java.util.UUID; import java.util.UUID;
@ -20,9 +19,8 @@ public final class RushOfBlood extends CardImpl {
public RushOfBlood(UUID ownerId, CardSetInfo setInfo) { public RushOfBlood(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{R}"); super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{R}");
// Target creature gets +X/+0 until end of turn, where X is its power. // Target creature gets +X/+0 until end of turn, where X is its power.
this.getSpellAbility().addEffect(new BoostTargetEffect(TargetPermanentPowerCount.instance, StaticValue.get(0), Duration.EndOfTurn, true)); this.getSpellAbility().addEffect(new BoostTargetEffect(TargetPermanentPowerCount.instance, StaticValue.get(0), Duration.EndOfTurn));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
} }

View file

@ -42,7 +42,7 @@ public final class SickeningShoal extends CardImpl {
))); )));
// Target creature gets -X/-X until end of turn. // Target creature gets -X/-X until end of turn.
this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn, true)); this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
} }

View file

@ -1,4 +1,3 @@
package mage.cards.s; package mage.cards.s;
import java.util.UUID; import java.util.UUID;
@ -8,6 +7,7 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
@ -15,14 +15,13 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType; import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.Predicates; import mage.filter.predicate.Predicates;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
/** /**
* *
* @author Styxo * @author awjackson
*/ */
public final class SilvergillDouser extends CardImpl { public final class SilvergillDouser extends CardImpl {
@ -32,16 +31,17 @@ public final class SilvergillDouser extends CardImpl {
filter.add(Predicates.or(SubType.MERFOLK.getPredicate(), SubType.FAERIE.getPredicate())); filter.add(Predicates.or(SubType.MERFOLK.getPredicate(), SubType.FAERIE.getPredicate()));
} }
private static final DynamicValue xValue = new SignInversionDynamicValue(new PermanentsOnBattlefieldCount(filter, null));
public SilvergillDouser(UUID ownerId, CardSetInfo setInfo) { public SilvergillDouser(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}"); super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}");
this.subtype.add(SubType.MERFOLK); this.subtype.add(SubType.MERFOLK, SubType.WIZARD);
this.subtype.add(SubType.WIZARD);
this.power = new MageInt(1); this.power = new MageInt(1);
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
// {tap}: Target creature gets -X/-0 until end of turn, where X is the number of Merfolk and/or Faeries you control. // {tap}: Target creature gets -X/-0 until end of turn, where X is the number of Merfolk and/or Faeries you control.
DynamicValue number = new PermanentsOnBattlefieldCount(new FilterControlledPermanent(filter), -1); Ability ability = new SimpleActivatedAbility(new BoostTargetEffect(xValue, StaticValue.get(0), Duration.EndOfTurn), new TapSourceCost());
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(number, StaticValue.get(0), Duration.EndOfTurn, true), new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -1,8 +1,6 @@
package mage.cards.s; package mage.cards.s;
import java.util.UUID; import java.util.UUID;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.SweepNumber; import mage.abilities.dynamicvalue.common.SweepNumber;
import mage.abilities.effects.common.discard.DiscardTargetEffect; import mage.abilities.effects.common.discard.DiscardTargetEffect;
import mage.abilities.effects.keyword.SweepEffect; import mage.abilities.effects.keyword.SweepEffect;
@ -24,8 +22,7 @@ public final class SinkIntoTakenuma extends CardImpl {
// Sweep - Return any number of Swamps you control to their owner's hand. Target player discards a card for each Swamp returned this way. // Sweep - Return any number of Swamps you control to their owner's hand. Target player discards a card for each Swamp returned this way.
this.getSpellAbility().addEffect(new SweepEffect(SubType.SWAMP)); this.getSpellAbility().addEffect(new SweepEffect(SubType.SWAMP));
DynamicValue sweepValue = new SweepNumber("Swamp"); this.getSpellAbility().addEffect(new DiscardTargetEffect(SweepNumber.SWAMP));
this.getSpellAbility().addEffect(new DiscardTargetEffect(sweepValue));
this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addTarget(new TargetPlayer());
} }

View file

@ -28,7 +28,7 @@ public final class Skyreaping extends CardImpl {
// Skyreaping deals damage to each creature with flying equal to your devotion to green. // Skyreaping deals damage to each creature with flying equal to your devotion to green.
Effect effect = new DamageAllEffect(DevotionCount.G, filter); Effect effect = new DamageAllEffect(DevotionCount.G, filter);
effect.setText("{this} deals damage to each creature with flying equal to your devotion to green <i>(Each {G} in the mana costs of permanents you control counts toward your devotion to green.)</i>"); effect.setText("{this} deals damage to each creature with flying equal to your devotion to green. " + DevotionCount.G.getReminder());
this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addHint(DevotionCount.G.getHint()); this.getSpellAbility().addHint(DevotionCount.G.getHint());
} }

View file

@ -4,6 +4,7 @@ import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount;
import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
@ -27,15 +28,14 @@ import mage.target.targetpointer.FixedTarget;
*/ */
public class Soulshriek extends CardImpl { public class Soulshriek extends CardImpl {
private static final DynamicValue xValue = new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURES, null);
public Soulshriek(UUID ownerId, CardSetInfo setInfo) { public Soulshriek(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}");
// Target creature you control gets +X/+0 until end of turn, where X is the number // Target creature you control gets +X/+0 until end of turn, where X is the number
// of creature cards in your graveyard. Sacrifice that creature at the beginning of the next end step. // of creature cards in your graveyard. Sacrifice that creature at the beginning of the next end step.
CardsInControllerGraveyardCount count = new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURES_YOUR_GRAVEYARD); this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, StaticValue.get(0), Duration.EndOfTurn));
Effect effect = new BoostTargetEffect(count, StaticValue.get(0), Duration.EndOfTurn, true);
effect.setText("Target creature you control gets +X/+0 until end of turn, where X is the number of creature cards in your graveyard.");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addEffect(new SoulshriekEffect()); this.getSpellAbility().addEffect(new SoulshriekEffect());
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
} }

View file

@ -11,7 +11,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType; import mage.constants.SubType;
import mage.filter.StaticFilters; import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game; import mage.game.Game;
import mage.game.combat.CombatGroup; import mage.game.combat.CombatGroup;
@ -22,6 +22,8 @@ import java.util.UUID;
*/ */
public final class SpinedSliver extends CardImpl { public final class SpinedSliver extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(SubType.SLIVER, "a Sliver");
public SpinedSliver(UUID ownerId, CardSetInfo setInfo) { public SpinedSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}{G}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}{G}");
this.subtype.add(SubType.SLIVER); this.subtype.add(SubType.SLIVER);
@ -31,10 +33,10 @@ public final class SpinedSliver extends CardImpl {
// Whenever a Sliver becomes blocked, that Sliver gets +1/+1 until end of turn for each creature blocking it. // Whenever a Sliver becomes blocked, that Sliver gets +1/+1 until end of turn for each creature blocking it.
this.addAbility(new BecomesBlockedAllTriggeredAbility( this.addAbility(new BecomesBlockedAllTriggeredAbility(
new BoostTargetEffect(BlockersCount.instance, BlockersCount.instance, Duration.EndOfTurn, true) new BoostTargetEffect(BlockersCount.instance, BlockersCount.instance, Duration.EndOfTurn)
.setText("that Sliver gets +1/+1 until end of turn for each creature blocking it"), .setText("that Sliver gets +1/+1 until end of turn for each creature blocking it"),
false, StaticFilters.FILTER_PERMANENT_ALL_SLIVERS, true false, filter, true
).setTriggerPhrase("Whenever a Sliver becomes blocked, ")); ));
} }
private SpinedSliver(final SpinedSliver card) { private SpinedSliver(final SpinedSliver card) {
@ -68,11 +70,11 @@ enum BlockersCount implements DynamicValue {
@Override @Override
public String getMessage() { public String getMessage() {
return "each creature blocking it"; return "creature blocking it";
} }
@Override @Override
public String toString() { public String toString() {
return "X"; return "1";
} }
} }

View file

@ -1,4 +1,3 @@
package mage.cards.s; package mage.cards.s;
import java.util.UUID; import java.util.UUID;
@ -11,7 +10,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.filter.common.FilterCreatureCard; import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
/** /**
@ -20,16 +19,16 @@ import mage.target.common.TargetCreaturePermanent;
*/ */
public final class StrengthFromTheFallen extends CardImpl { public final class StrengthFromTheFallen extends CardImpl {
private static final DynamicValue xValue = new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURES, null);
public StrengthFromTheFallen(UUID ownerId, CardSetInfo setInfo) { public StrengthFromTheFallen(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{G}"); super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{G}");
// Constellation - Whenever Strength from the Fallen or another entchantment enters the battlefield under your control,
// Constellation - Whenever Strength from the Fallen or another entchantment enters the battlefield under your control, target creature gets +X/+X until end of turn, where X is the number of creature cards in your graveyard. // target creature gets +X/+X until end of turn, where X is the number of creature cards in your graveyard.
DynamicValue xValue = new CardsInControllerGraveyardCount(new FilterCreatureCard("creature cards")); Ability ability = new ConstellationAbility(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn));
Ability ability = new ConstellationAbility(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn, true));
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);
} }
private StrengthFromTheFallen(final StrengthFromTheFallen card) { private StrengthFromTheFallen(final StrengthFromTheFallen card) {

View file

@ -28,7 +28,7 @@ public final class StrengthInNumbers extends CardImpl {
TrampleAbility.getInstance(), Duration.EndOfTurn TrampleAbility.getInstance(), Duration.EndOfTurn
).setText("Until end of turn, target creature gains trample")); ).setText("Until end of turn, target creature gains trample"));
this.getSpellAbility().addEffect(new BoostTargetEffect( this.getSpellAbility().addEffect(new BoostTargetEffect(
xValue, xValue, Duration.EndOfTurn, true xValue, xValue, Duration.EndOfTurn
).setText("and gets +X/+X, where X is the number of attacking creatures")); ).setText("and gets +X/+X, where X is the number of attacking creatures"));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
} }

View file

@ -1,5 +1,3 @@
package mage.cards.s; package mage.cards.s;
import java.util.UUID; import java.util.UUID;
@ -11,7 +9,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType; import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.filter.common.FilterControlledLandPermanent; import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
/** /**
@ -20,16 +18,14 @@ import mage.target.common.TargetCreaturePermanent;
*/ */
public final class StrengthOfCedars extends CardImpl { public final class StrengthOfCedars extends CardImpl {
private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("lands you control"); private static final DynamicValue xValue = new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_PERMANENT_LANDS, null);
private static final DynamicValue xValue = new PermanentsOnBattlefieldCount(filter, null);
public StrengthOfCedars (UUID ownerId, CardSetInfo setInfo) { public StrengthOfCedars (UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{4}{G}"); super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{4}{G}");
this.subtype.add(SubType.ARCANE); this.subtype.add(SubType.ARCANE);
// Target creature gets +X/+X until end of turn, where X is the number of lands you control. // Target creature gets +X/+X until end of turn, where X is the number of lands you control.
this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn, true)); this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
} }

View file

@ -1,4 +1,3 @@
package mage.cards.s; package mage.cards.s;
import java.util.UUID; import java.util.UUID;
@ -24,7 +23,7 @@ public final class Subdue extends CardImpl {
// Prevent all combat damage that would be dealt by target creature this turn. That creature gets +0/+X until end of turn, where X is its converted mana cost. // Prevent all combat damage that would be dealt by target creature this turn. That creature gets +0/+X until end of turn, where X is its converted mana cost.
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new PreventDamageByTargetEffect(Duration.EndOfTurn, true)); this.getSpellAbility().addEffect(new PreventDamageByTargetEffect(Duration.EndOfTurn, true));
this.getSpellAbility().addEffect(new BoostTargetEffect(StaticValue.get(0), TargetManaValue.instance, Duration.EndOfTurn, true) this.getSpellAbility().addEffect(new BoostTargetEffect(StaticValue.get(0), TargetManaValue.instance, Duration.EndOfTurn)
.setText("That creature gets +0/+X until end of turn, where X is its mana value")); .setText("That creature gets +0/+X until end of turn, where X is its mana value"));
} }

View file

@ -1,4 +1,3 @@
package mage.cards.s; package mage.cards.s;
import java.util.UUID; import java.util.UUID;
@ -41,7 +40,7 @@ public final class SurgeOfStrength extends CardImpl {
Effect effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn); Effect effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn);
effect.setText("Target creature gains trample"); effect.setText("Target creature gains trample");
this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(effect);
effect = new BoostTargetEffect(TargetManaValue.instance, StaticValue.get(0), Duration.EndOfTurn, true); effect = new BoostTargetEffect(TargetManaValue.instance, StaticValue.get(0), Duration.EndOfTurn);
effect.setText("and gets +X/+0 until end of turn, where X is that creature's mana value"); effect.setText("and gets +X/+0 until end of turn, where X is that creature's mana value");
this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());

View file

@ -36,14 +36,14 @@ public final class SyrFarenTheHengehammer extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}{G}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}{G}");
this.addSuperType(SuperType.LEGENDARY); this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.HUMAN, SubType.KNIGHT);
this.subtype.add(SubType.KNIGHT);
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// Whenever Syr Faren, the Hengehammer attacks, another target attacking creature gets +X/+X until end of turn, where X is Syr Faren's power. // Whenever Syr Faren, the Hengehammer attacks, another target attacking creature gets +X/+X until end of turn, where X is Syr Faren's power.
Ability ability = new AttacksTriggeredAbility( Ability ability = new AttacksTriggeredAbility(
new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn, true), false new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn), false
); );
ability.addTarget(new TargetPermanent(filter)); ability.addTarget(new TargetPermanent(filter));
this.addAbility(ability); this.addAbility(ability);

View file

@ -1,4 +1,3 @@
package mage.cards.t; package mage.cards.t;
import java.util.UUID; import java.util.UUID;
@ -7,7 +6,6 @@ import mage.abilities.LoyaltyAbility;
import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.dynamicvalue.common.SignInversionDynamicValue; import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.GetEmblemEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
@ -26,6 +24,9 @@ import mage.target.common.TargetCreaturePermanent;
*/ */
public final class TezzeretTheSchemer extends CardImpl { public final class TezzeretTheSchemer extends CardImpl {
private static final DynamicValue xValue = new PermanentsOnBattlefieldCount(new FilterControlledArtifactPermanent("artifacts you control"), null);
private static final DynamicValue xValue2 = new SignInversionDynamicValue(xValue);
public TezzeretTheSchemer(UUID ownerId, CardSetInfo setInfo) { public TezzeretTheSchemer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{2}{U}{B}"); super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{2}{U}{B}");
this.addSuperType(SuperType.LEGENDARY); this.addSuperType(SuperType.LEGENDARY);
@ -38,10 +39,7 @@ public final class TezzeretTheSchemer extends CardImpl {
this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new EtheriumCellToken()), 1)); this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new EtheriumCellToken()), 1));
// -2: Target creature gets +X/-X until end of turn, where X is the number of artifacts you control. // -2: Target creature gets +X/-X until end of turn, where X is the number of artifacts you control.
DynamicValue count = new PermanentsOnBattlefieldCount(new FilterControlledArtifactPermanent("artifacts you control")); Ability ability = new LoyaltyAbility(new BoostTargetEffect(xValue, xValue2, Duration.EndOfTurn), -2);
Effect effect = new BoostTargetEffect(count, new SignInversionDynamicValue(count), Duration.EndOfTurn, true);
effect.setText("Target creature gets +X/-X until end of turn, where X is the number of artifacts you control");
Ability ability = new LoyaltyAbility(effect, -2);
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);
@ -58,4 +56,3 @@ public final class TezzeretTheSchemer extends CardImpl {
return new TezzeretTheSchemer(this); return new TezzeretTheSchemer(this);
} }
} }

View file

@ -46,7 +46,7 @@ public final class TheTriumphOfAnax extends CardImpl {
TrampleAbility.getInstance(), Duration.EndOfTurn, TrampleAbility.getInstance(), Duration.EndOfTurn,
"Until end of turn, target creature gains trample" "Until end of turn, target creature gains trample"
), new BoostTargetEffect( ), new BoostTargetEffect(
xValue, StaticValue.get(0), Duration.EndOfTurn, true xValue, StaticValue.get(0), Duration.EndOfTurn
).setText("and gets +X/+0, where X is the number of lore counters on {this}")), ).setText("and gets +X/+0, where X is the number of lore counters on {this}")),
new TargetCreaturePermanent() new TargetCreaturePermanent()
); );

View file

@ -33,15 +33,15 @@ import mage.target.common.TargetOpponentsCreaturePermanent;
public final class ThornmantleStriker extends CardImpl { public final class ThornmantleStriker extends CardImpl {
private static final PermanentsOnBattlefieldCount elfCount private static final PermanentsOnBattlefieldCount elfCount
= new PermanentsOnBattlefieldCount(new FilterControlledPermanent(SubType.ELF)); = new PermanentsOnBattlefieldCount(new FilterControlledPermanent(SubType.ELF, "Elves you control"), null);
private static final SignInversionDynamicValue negativeElfCount private static final SignInversionDynamicValue negativeElfCount
= new SignInversionDynamicValue(elfCount); = new SignInversionDynamicValue(elfCount);
public ThornmantleStriker(UUID ownerId, CardSetInfo setInfo) { public ThornmantleStriker(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}");
this.subtype.add(SubType.ELF); this.subtype.add(SubType.ELF, SubType.ROGUE);
this.subtype.add(SubType.ROGUE);
this.power = new MageInt(4); this.power = new MageInt(4);
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
@ -51,8 +51,7 @@ public final class ThornmantleStriker extends CardImpl {
ability.addTarget(new TargetPermanent()); ability.addTarget(new TargetPermanent());
// Target creature an opponent controls gets -X/-X until end of turn, where X is the number of Elves you control. // Target creature an opponent controls gets -X/-X until end of turn, where X is the number of Elves you control.
Mode mode = new Mode(new BoostTargetEffect(negativeElfCount, negativeElfCount, Duration.EndOfTurn, true Mode mode = new Mode(new BoostTargetEffect(negativeElfCount, negativeElfCount, Duration.EndOfTurn));
).setText("Target creature an opponent controls gets -X/-X until end of turn, where X is the number of Elves you control"));
mode.addTarget(new TargetOpponentsCreaturePermanent()); mode.addTarget(new TargetOpponentsCreaturePermanent());
ability.addMode(mode); ability.addMode(mode);

Some files were not shown because too many files have changed in this diff Show more