diff --git a/Mage.Sets/src/mage/cards/a/AbzanCharm.java b/Mage.Sets/src/mage/cards/a/AbzanCharm.java
index 0de055f435a..288f3e1c380 100644
--- a/Mage.Sets/src/mage/cards/a/AbzanCharm.java
+++ b/Mage.Sets/src/mage/cards/a/AbzanCharm.java
@@ -11,7 +11,6 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.ComparisonType;
-import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.PowerPredicate;
import mage.target.common.TargetCreaturePermanent;
@@ -43,7 +42,7 @@ public final class AbzanCharm extends CardImpl {
this.getSpellAbility().addMode(mode);
// *Distribute two +1/+1 counters among one or two target creatures.
- mode = new Mode(new DistributeCountersEffect(2, "one or two target creatures"));
+ mode = new Mode(new DistributeCountersEffect());
mode.addTarget(new TargetCreaturePermanentAmount(2));
this.getSpellAbility().addMode(mode);
diff --git a/Mage.Sets/src/mage/cards/a/AerialVolley.java b/Mage.Sets/src/mage/cards/a/AerialVolley.java
index 2f44c92fbef..557da14e0f2 100644
--- a/Mage.Sets/src/mage/cards/a/AerialVolley.java
+++ b/Mage.Sets/src/mage/cards/a/AerialVolley.java
@@ -26,7 +26,7 @@ public final class AerialVolley extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{G}");
// Aerial Volley deals 3 damage divided as you choose among one, two, or three target creatures with flying.
- this.getSpellAbility().addEffect(new DamageMultiEffect(3));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(3, filter));
}
diff --git a/Mage.Sets/src/mage/cards/a/AjaniMentorOfHeroes.java b/Mage.Sets/src/mage/cards/a/AjaniMentorOfHeroes.java
index 02796fb08c5..ce244b2c975 100644
--- a/Mage.Sets/src/mage/cards/a/AjaniMentorOfHeroes.java
+++ b/Mage.Sets/src/mage/cards/a/AjaniMentorOfHeroes.java
@@ -9,7 +9,6 @@ import mage.abilities.effects.common.counter.DistributeCountersEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
-import mage.counters.CounterType;
import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.filter.predicate.Predicates;
@@ -38,7 +37,7 @@ public final class AjaniMentorOfHeroes extends CardImpl {
this.setStartingLoyalty(4);
// +1: Distribute three +1/+1 counters among one, two, or three target creatures you control
- Ability ability = new LoyaltyAbility(new DistributeCountersEffect(3, "one, two, or three target creatures you control"), 1);
+ Ability ability = new LoyaltyAbility(new DistributeCountersEffect(), 1);
ability.addTarget(new TargetCreaturePermanentAmount(3, StaticFilters.FILTER_CONTROLLED_CREATURES));
this.addAbility(ability);
diff --git a/Mage.Sets/src/mage/cards/a/AjaniSleeperAgent.java b/Mage.Sets/src/mage/cards/a/AjaniSleeperAgent.java
index 091d653edea..0ac62db118b 100644
--- a/Mage.Sets/src/mage/cards/a/AjaniSleeperAgent.java
+++ b/Mage.Sets/src/mage/cards/a/AjaniSleeperAgent.java
@@ -15,11 +15,9 @@ import mage.constants.*;
import mage.abilities.keyword.CompleatedAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
-import mage.counters.CounterType;
import mage.game.Game;
import mage.game.command.emblems.AjaniSleeperAgentEmblem;
import mage.players.Player;
-import mage.target.Target;
import mage.target.common.TargetCreaturePermanentAmount;
/**
@@ -42,12 +40,10 @@ public final class AjaniSleeperAgent extends CardImpl {
this.addAbility(new LoyaltyAbility(new AjaniSleeperAgentEffect(), 1));
// −3: Distribute three +1/+1 counters among up to three target creatures. They gain vigilance until end of turn.
- Ability ability = new LoyaltyAbility(new DistributeCountersEffect(3, "up to three target creatures"), -3);
+ Ability ability = new LoyaltyAbility(new DistributeCountersEffect()
+ .setText("distribute three +1/+1 counters among up to three target creatures"), -3);
ability.addEffect(new GainAbilityTargetEffect(VigilanceAbility.getInstance()).setText("They gain vigilance until end of turn"));
- Target target = new TargetCreaturePermanentAmount(3);
- target.setMinNumberOfTargets(0);
- target.setMaxNumberOfTargets(3);
- ability.addTarget(target);
+ ability.addTarget(new TargetCreaturePermanentAmount(3, 0, 3));
this.addAbility(ability);
// −6: You get an emblem with "Whenever you cast a creature or planeswalker spell, target opponent gets two poison counters."
diff --git a/Mage.Sets/src/mage/cards/a/AmethystDragon.java b/Mage.Sets/src/mage/cards/a/AmethystDragon.java
index 426a3878ac4..fcb9ceedb6a 100644
--- a/Mage.Sets/src/mage/cards/a/AmethystDragon.java
+++ b/Mage.Sets/src/mage/cards/a/AmethystDragon.java
@@ -32,7 +32,7 @@ public final class AmethystDragon extends AdventureCard {
// Explosive Crystal
// Explosive Crystal deals 4 damage divided as you choose among any number of targets.
- this.getSpellCard().getSpellAbility().addEffect(new DamageMultiEffect(4));
+ this.getSpellCard().getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellCard().getSpellAbility().addTarget(new TargetAnyTargetAmount(4));
this.finalizeAdventure();
diff --git a/Mage.Sets/src/mage/cards/a/AngelOfSalvation.java b/Mage.Sets/src/mage/cards/a/AngelOfSalvation.java
index 2eeb1a5a056..c43ac853406 100644
--- a/Mage.Sets/src/mage/cards/a/AngelOfSalvation.java
+++ b/Mage.Sets/src/mage/cards/a/AngelOfSalvation.java
@@ -34,7 +34,7 @@ public final class AngelOfSalvation extends CardImpl {
this.addAbility(new ConvokeAbility());
// Flying
this.addAbility(FlyingAbility.getInstance());
- // When Angel of Salvation enters the battlefield, prevent the next 5 damage that would be dealt this turn to any number of target creatures and/or players, divided as you choose.
+ // When Angel of Salvation enters, prevent the next 5 damage that would be dealt this turn to any number of targets, divided as you choose.
Ability ability = new EntersBattlefieldTriggeredAbility(new PreventDamageToTargetMultiAmountEffect(Duration.EndOfTurn, 5));
ability.addTarget(new TargetAnyTargetAmount(5));
this.addAbility(ability);
diff --git a/Mage.Sets/src/mage/cards/a/ArcLightning.java b/Mage.Sets/src/mage/cards/a/ArcLightning.java
index d27a09fd71d..8e79e37bb07 100644
--- a/Mage.Sets/src/mage/cards/a/ArcLightning.java
+++ b/Mage.Sets/src/mage/cards/a/ArcLightning.java
@@ -17,7 +17,7 @@ public final class ArcLightning extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{R}");
// Arc Lightning deals 3 damage divided as you choose among one, two, or three targets.
- this.getSpellAbility().addEffect(new DamageMultiEffect(3));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetAnyTargetAmount(3));
}
diff --git a/Mage.Sets/src/mage/cards/a/ArcMage.java b/Mage.Sets/src/mage/cards/a/ArcMage.java
index e4f001a97f5..5087bdc013c 100644
--- a/Mage.Sets/src/mage/cards/a/ArcMage.java
+++ b/Mage.Sets/src/mage/cards/a/ArcMage.java
@@ -12,7 +12,6 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
import mage.target.common.TargetAnyTargetAmount;
/**
@@ -29,7 +28,7 @@ public final class ArcMage extends CardImpl {
this.toughness = new MageInt(2);
// {2}{R}, {tap}, Discard a card: Arc Mage deals 2 damage divided as you choose among one or two targets.
- Ability ability = new SimpleActivatedAbility(new DamageMultiEffect(2), new ManaCostsImpl<>("{2}{R}"));
+ Ability ability = new SimpleActivatedAbility(new DamageMultiEffect(), new ManaCostsImpl<>("{2}{R}"));
ability.addCost(new TapSourceCost());
ability.addCost(new DiscardCardCost());
ability.addTarget(new TargetAnyTargetAmount(2));
diff --git a/Mage.Sets/src/mage/cards/a/ArmamentCorps.java b/Mage.Sets/src/mage/cards/a/ArmamentCorps.java
index 454359f62e7..3a1ca243565 100644
--- a/Mage.Sets/src/mage/cards/a/ArmamentCorps.java
+++ b/Mage.Sets/src/mage/cards/a/ArmamentCorps.java
@@ -9,7 +9,6 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanentAmount;
@@ -28,7 +27,7 @@ public final class ArmamentCorps extends CardImpl {
this.toughness = new MageInt(4);
// When Armament Corps enters the battlefield, distribute two +1/+1 counters among one or two target creatures you control.
- Ability ability = new EntersBattlefieldTriggeredAbility(new DistributeCountersEffect(2, "one or two target creatures you control"), false);
+ Ability ability = new EntersBattlefieldTriggeredAbility(new DistributeCountersEffect(), false);
ability.addTarget(new TargetCreaturePermanentAmount(2, StaticFilters.FILTER_CONTROLLED_CREATURES));
this.addAbility(ability);
}
diff --git a/Mage.Sets/src/mage/cards/a/ArrowVolleyTrap.java b/Mage.Sets/src/mage/cards/a/ArrowVolleyTrap.java
index a846575e5d5..4dca2f81887 100644
--- a/Mage.Sets/src/mage/cards/a/ArrowVolleyTrap.java
+++ b/Mage.Sets/src/mage/cards/a/ArrowVolleyTrap.java
@@ -27,7 +27,7 @@ public final class ArrowVolleyTrap extends CardImpl {
this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl<>("{1}{W}"), ArrowVolleyTrapCondition.instance));
// Arrow Volley Trap deals 5 damage divided as you choose among any number of target attacking creatures.
- this.getSpellAbility().addEffect(new DamageMultiEffect(5));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(5, StaticFilters.FILTER_ATTACKING_CREATURES));
}
diff --git a/Mage.Sets/src/mage/cards/a/AureliasFury.java b/Mage.Sets/src/mage/cards/a/AureliasFury.java
index 1febd70e70c..9f84a9c4aa8 100644
--- a/Mage.Sets/src/mage/cards/a/AureliasFury.java
+++ b/Mage.Sets/src/mage/cards/a/AureliasFury.java
@@ -59,10 +59,10 @@ public final class AureliasFury extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{R}{W}");
- // Aurelia's Fury deals X damage divided as you choose among any number of target creatures and/or players.
+ // Aurelia's Fury deals X damage divided as you choose among any number of targets.
// Tap each creature dealt damage this way. Players dealt damage this way can't cast noncreature spells this turn.
DynamicValue xValue = GetXValue.instance;
- this.getSpellAbility().addEffect(new DamageMultiEffect(xValue));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addEffect(new AureliasFuryEffect());
this.getSpellAbility().addTarget(new TargetAnyTargetAmount(xValue));
this.getSpellAbility().addWatcher(new AureliasFuryDamagedByWatcher());
diff --git a/Mage.Sets/src/mage/cards/a/AvacynsJudgment.java b/Mage.Sets/src/mage/cards/a/AvacynsJudgment.java
index 5d6601dfba0..4e9ddc806b9 100644
--- a/Mage.Sets/src/mage/cards/a/AvacynsJudgment.java
+++ b/Mage.Sets/src/mage/cards/a/AvacynsJudgment.java
@@ -31,9 +31,9 @@ public final class AvacynsJudgment extends CardImpl {
ability.setRuleAtTheTop(true);
this.addAbility(ability);
- // Avacyn's Judgment deals 2 damage divided as you choose among any number of target creatures and/or players. If Avacyn's Judgment's madness cost was paid, it deals X damage divided as you choose among those creatures and/or players instead.
+ // Avacyn's Judgment deals 2 damage divided as you choose among any number of targets. If this spell's madness cost was paid, it deals X damage divided as you choose among those creatures and/or players instead.
DynamicValue xValue = new AvacynsJudgmentManacostVariableValue();
- Effect effect = new DamageMultiEffect(xValue);
+ Effect effect = new DamageMultiEffect();
effect.setText("{this} deals 2 damage divided as you choose among any number of targets. If this spell's madness cost was paid, it deals X damage divided as you choose among those permanents and/or players instead.");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetAnyTargetAmount(xValue));
diff --git a/Mage.Sets/src/mage/cards/a/AwakenTheMaelstrom.java b/Mage.Sets/src/mage/cards/a/AwakenTheMaelstrom.java
index 79b45c6a0c0..ff4ba76a560 100644
--- a/Mage.Sets/src/mage/cards/a/AwakenTheMaelstrom.java
+++ b/Mage.Sets/src/mage/cards/a/AwakenTheMaelstrom.java
@@ -115,8 +115,6 @@ class AwakenTheMaelstromEffect extends OneShotEffect {
return;
}
TargetPermanentAmount target = new TargetCreaturePermanentAmount(3, StaticFilters.FILTER_CONTROLLED_CREATURE);
- target.setMinNumberOfTargets(1);
- target.setMaxNumberOfTargets(3);
target.withNotTarget(true);
target.withChooseHint("to distribute counters");
target.chooseTarget(outcome, player.getId(), source, game);
diff --git a/Mage.Sets/src/mage/cards/b/BiogenicUpgrade.java b/Mage.Sets/src/mage/cards/b/BiogenicUpgrade.java
index af5253deaee..8543e1101c4 100644
--- a/Mage.Sets/src/mage/cards/b/BiogenicUpgrade.java
+++ b/Mage.Sets/src/mage/cards/b/BiogenicUpgrade.java
@@ -26,10 +26,7 @@ public final class BiogenicUpgrade extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{G}{G}");
// Distribute three +1/+1 counters among one, two, or three target creatures, then double the number of +1/+1 counters on each of those creatures.
- this.getSpellAbility().addEffect(new DistributeCountersEffect(
- 3,
- "one, two, or three target creatures"
- ));
+ this.getSpellAbility().addEffect(new DistributeCountersEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(3));
this.getSpellAbility().addEffect(new BiogenicUpgradeEffect());
}
diff --git a/Mage.Sets/src/mage/cards/b/BlasterHulk.java b/Mage.Sets/src/mage/cards/b/BlasterHulk.java
index 057abb8c510..5c76d07c028 100644
--- a/Mage.Sets/src/mage/cards/b/BlasterHulk.java
+++ b/Mage.Sets/src/mage/cards/b/BlasterHulk.java
@@ -46,7 +46,7 @@ public final class BlasterHulk extends CardImpl {
// Whenever Blaster Hulk attacks, you get {E}{E}, then you may pay eight {E}. When you do, Blaster Hulk deals 8 damage divided as you choose among up to eight targets.
Ability ability = new AttacksTriggeredAbility(new GetEnergyCountersControllerEffect(2));
- ReflexiveTriggeredAbility reflexiveAbility = new ReflexiveTriggeredAbility(new DamageMultiEffect(8)
+ ReflexiveTriggeredAbility reflexiveAbility = new ReflexiveTriggeredAbility(new DamageMultiEffect()
.setText("{this} deals 8 damage divided as you choose among up to eight targets"), false);
reflexiveAbility.addTarget(new TargetAnyTargetAmount(8));
ability.addEffect(new DoWhenCostPaid(reflexiveAbility, new PayEnergyCost(8),
diff --git a/Mage.Sets/src/mage/cards/b/BlessingOfFrost.java b/Mage.Sets/src/mage/cards/b/BlessingOfFrost.java
index e1b11556cae..c20d9a720d1 100644
--- a/Mage.Sets/src/mage/cards/b/BlessingOfFrost.java
+++ b/Mage.Sets/src/mage/cards/b/BlessingOfFrost.java
@@ -79,8 +79,7 @@ class BlessingOfFrostEffect extends OneShotEffect {
int snow = ManaPaidSourceWatcher.getSnowPaid(source.getId(), game);
int potentialTarget = game.getBattlefield().count(StaticFilters.FILTER_CONTROLLED_CREATURE, player.getId(), source, game);
if (snow > 0 && potentialTarget > 0) {
- TargetAmount target = new TargetCreaturePermanentAmount(snow, StaticFilters.FILTER_CONTROLLED_CREATURE);
- target.setMinNumberOfTargets(1);
+ TargetAmount target = new TargetCreaturePermanentAmount(snow, 0, snow, StaticFilters.FILTER_CONTROLLED_CREATURE);
target.withNotTarget(true);
target.chooseTarget(outcome, player.getId(), source, game);
for (UUID targetId : target.getTargets()) {
diff --git a/Mage.Sets/src/mage/cards/b/BlessingsOfNature.java b/Mage.Sets/src/mage/cards/b/BlessingsOfNature.java
index b6f13ca0c49..20dbef1ef91 100644
--- a/Mage.Sets/src/mage/cards/b/BlessingsOfNature.java
+++ b/Mage.Sets/src/mage/cards/b/BlessingsOfNature.java
@@ -5,7 +5,6 @@ import mage.abilities.keyword.MiracleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.counters.CounterType;
import mage.target.common.TargetCreaturePermanentAmount;
import java.util.UUID;
@@ -19,7 +18,7 @@ public final class BlessingsOfNature extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{G}");
// Distribute four +1/+1 counters among any number of target creatures.
- this.getSpellAbility().addEffect(new DistributeCountersEffect(4, "any number of target creatures"));
+ this.getSpellAbility().addEffect(new DistributeCountersEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(4));
this.addAbility(new MiracleAbility("{G}"));
diff --git a/Mage.Sets/src/mage/cards/b/BogardanHellkite.java b/Mage.Sets/src/mage/cards/b/BogardanHellkite.java
index 2ea935eafa8..7d3443dabbc 100644
--- a/Mage.Sets/src/mage/cards/b/BogardanHellkite.java
+++ b/Mage.Sets/src/mage/cards/b/BogardanHellkite.java
@@ -28,9 +28,14 @@ public final class BogardanHellkite extends CardImpl {
this.power = new MageInt(5);
this.toughness = new MageInt(5);
+ // Flash
this.addAbility(FlashAbility.getInstance());
+
+ // Flying
this.addAbility(FlyingAbility.getInstance());
- Ability ability = new EntersBattlefieldTriggeredAbility(new DamageMultiEffect(5, "it"), false);
+
+ // When Bogardan Hellkite enters, it deals 5 damage divided as you choose among any number of targets.
+ Ability ability = new EntersBattlefieldTriggeredAbility(new DamageMultiEffect("it"), false);
ability.addTarget(new TargetAnyTargetAmount(5));
this.addAbility(ability);
}
diff --git a/Mage.Sets/src/mage/cards/b/Boulderfall.java b/Mage.Sets/src/mage/cards/b/Boulderfall.java
index aa052a79005..48835dbc38e 100644
--- a/Mage.Sets/src/mage/cards/b/Boulderfall.java
+++ b/Mage.Sets/src/mage/cards/b/Boulderfall.java
@@ -17,7 +17,7 @@ public final class Boulderfall extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{6}{R}{R}");
// Boulderfall deals 5 damage divided as you choose among any number of targets.
- this.getSpellAbility().addEffect(new DamageMultiEffect(5));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetAnyTargetAmount(5));
}
diff --git a/Mage.Sets/src/mage/cards/b/BountyOfTheHunt.java b/Mage.Sets/src/mage/cards/b/BountyOfTheHunt.java
index 082ba4df231..77e146b7e18 100644
--- a/Mage.Sets/src/mage/cards/b/BountyOfTheHunt.java
+++ b/Mage.Sets/src/mage/cards/b/BountyOfTheHunt.java
@@ -7,7 +7,6 @@ import mage.abilities.effects.common.counter.DistributeCountersEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.counters.CounterType;
import mage.filter.common.FilterOwnedCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.target.common.TargetCardInHand;
@@ -34,10 +33,7 @@ public final class BountyOfTheHunt extends CardImpl {
this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter))));
// Distribute three +1/+1 counters among one, two, or three target creatures. For each +1/+1 counter you put on a creature this way, remove a +1/+1 counter from that creature at the beginning of the next cleanup step.
- this.getSpellAbility().addEffect(new DistributeCountersEffect(
- 3,
- "one, two, or three target creatures"
- ).withRemoveAtEndOfTurn());
+ this.getSpellAbility().addEffect(new DistributeCountersEffect().withRemoveAtEndOfTurn());
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(3));
}
diff --git a/Mage.Sets/src/mage/cards/b/Broodlord.java b/Mage.Sets/src/mage/cards/b/Broodlord.java
index 1119984f9b4..734099c31fb 100644
--- a/Mage.Sets/src/mage/cards/b/Broodlord.java
+++ b/Mage.Sets/src/mage/cards/b/Broodlord.java
@@ -16,7 +16,7 @@ import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.Target;
-import mage.target.common.TargetPermanentAmount;
+import mage.target.common.TargetCreaturePermanentAmount;
import java.util.UUID;
@@ -37,7 +37,7 @@ public final class Broodlord extends CardImpl {
// Brood Telepathy -- When Broodlord enters the battlefield, distribute X +1/+1 counters among any number of other target creatures you control.
Ability ability = new EntersBattlefieldTriggeredAbility(new BroodlordEffect());
- ability.addTarget(new TargetPermanentAmount(GetXValue.instance, StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE));
+ ability.addTarget(new TargetCreaturePermanentAmount(GetXValue.instance, StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE));
this.addAbility(ability.withFlavorWord("Brood Telepathy"));
}
diff --git a/Mage.Sets/src/mage/cards/c/CaptainAmericaFirstAvenger.java b/Mage.Sets/src/mage/cards/c/CaptainAmericaFirstAvenger.java
index 9b8da42a407..34ecb776194 100644
--- a/Mage.Sets/src/mage/cards/c/CaptainAmericaFirstAvenger.java
+++ b/Mage.Sets/src/mage/cards/c/CaptainAmericaFirstAvenger.java
@@ -53,11 +53,11 @@ public final class CaptainAmericaFirstAvenger extends CardImpl {
// Throw ... — {3}, Unattach an Equipment from Captain America: He deals damage equal to that Equipment’s mana value divided as you choose among one, two, or three targets.
Ability ability = new SimpleActivatedAbility(
- new DamageMultiEffect(CaptainAmericaFirstAvengerValue.instance).setText(
+ new DamageMultiEffect().setText(
"he deals damage equal to that Equipment's mana value divided as you choose among one, two, or three targets."),
new GenericManaCost(3));
ability.addCost(new CaptainAmericaFirstAvengerUnattachCost());
- ability.addTarget(new TargetAnyTargetAmount(CaptainAmericaFirstAvengerValue.instance, 3));
+ ability.addTarget(new TargetAnyTargetAmount(CaptainAmericaFirstAvengerValue.instance, 1, 3));
this.addAbility(ability.withFlavorWord("Throw ..."));
// ... Catch — At the beginning of combat on your turn, attach up to one target Equipment you control to Captain America.
diff --git a/Mage.Sets/src/mage/cards/c/CaseOfTheTrampledGarden.java b/Mage.Sets/src/mage/cards/c/CaseOfTheTrampledGarden.java
index bc7153a94ce..127b95a330e 100644
--- a/Mage.Sets/src/mage/cards/c/CaseOfTheTrampledGarden.java
+++ b/Mage.Sets/src/mage/cards/c/CaseOfTheTrampledGarden.java
@@ -26,7 +26,7 @@ import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetAttackingCreature;
-import mage.target.common.TargetPermanentAmount;
+import mage.target.common.TargetCreaturePermanentAmount;
/**
*
@@ -40,11 +40,8 @@ public final class CaseOfTheTrampledGarden extends CardImpl {
this.subtype.add(SubType.CASE);
// When this Case enters the battlefield, distribute two +1/+1 counters among one or two target creatures you control.
- Ability initialAbility = new EntersBattlefieldTriggeredAbility(new DistributeCountersEffect(2,
- "one or two target creatures you control"));
- TargetPermanentAmount target = new TargetPermanentAmount(2, StaticFilters.FILTER_CONTROLLED_CREATURES);
- target.setMinNumberOfTargets(1);
- initialAbility.addTarget(target);
+ Ability initialAbility = new EntersBattlefieldTriggeredAbility(new DistributeCountersEffect());
+ initialAbility.addTarget(new TargetCreaturePermanentAmount(2, StaticFilters.FILTER_CONTROLLED_CREATURES));
// To solve -- Creatures you control have total power 8 or greater.
// Solved -- Whenever you attack, put a +1/+1 counter on target attacking creature. It gains trample until end of turn.
Ability solvedAbility = new ConditionalTriggeredAbility(
diff --git a/Mage.Sets/src/mage/cards/c/ChandraFlameshaper.java b/Mage.Sets/src/mage/cards/c/ChandraFlameshaper.java
index 477a9432f55..0f5222ca23d 100644
--- a/Mage.Sets/src/mage/cards/c/ChandraFlameshaper.java
+++ b/Mage.Sets/src/mage/cards/c/ChandraFlameshaper.java
@@ -50,7 +50,7 @@ public final class ChandraFlameshaper extends CardImpl {
// -4: Chandra deals 8 damage divided as you choose among any number of target creatures and/or planeswalkers.
Ability minusFourAbility = new LoyaltyAbility(
- new DamageMultiEffect(8, "{this}"), -4
+ new DamageMultiEffect(), -4
);
minusFourAbility.addTarget(new TargetCreatureOrPlaneswalkerAmount(8));
this.addAbility(minusFourAbility);
diff --git a/Mage.Sets/src/mage/cards/c/ChandrasPyrohelix.java b/Mage.Sets/src/mage/cards/c/ChandrasPyrohelix.java
index e760da10870..04f08ae92f9 100644
--- a/Mage.Sets/src/mage/cards/c/ChandrasPyrohelix.java
+++ b/Mage.Sets/src/mage/cards/c/ChandrasPyrohelix.java
@@ -17,7 +17,7 @@ public final class ChandrasPyrohelix extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}");
// Chandra's Pyrohelix deals 2 damage divided as you choose among one or two targets.
- this.getSpellAbility().addEffect(new DamageMultiEffect(2));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetAnyTargetAmount(2));
}
diff --git a/Mage.Sets/src/mage/cards/c/Conflagrate.java b/Mage.Sets/src/mage/cards/c/Conflagrate.java
index 5b328705cb5..ca97bdb4e04 100644
--- a/Mage.Sets/src/mage/cards/c/Conflagrate.java
+++ b/Mage.Sets/src/mage/cards/c/Conflagrate.java
@@ -24,7 +24,7 @@ public final class Conflagrate extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{X}{R}");
// Conflagrate deals X damage divided as you choose among any number of targets.
- this.getSpellAbility().addEffect(new DamageMultiEffect(GetXValue.instance));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetAnyTargetAmount(GetXValue.instance));
// Flashback-{R}{R}, Discard X cards.
diff --git a/Mage.Sets/src/mage/cards/c/Contagion.java b/Mage.Sets/src/mage/cards/c/Contagion.java
index 0e27f3f1b90..1369f0f881a 100644
--- a/Mage.Sets/src/mage/cards/c/Contagion.java
+++ b/Mage.Sets/src/mage/cards/c/Contagion.java
@@ -38,10 +38,7 @@ public final class Contagion extends CardImpl {
// Distribute two -2/-1 counters among one or two target creatures.
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(2));
- this.getSpellAbility().addEffect(new DistributeCountersEffect(
- CounterType.M2M1, 2,
- "one or two target creatures"
- ));
+ this.getSpellAbility().addEffect(new DistributeCountersEffect(CounterType.M2M1));
}
private Contagion(final Contagion card) {
diff --git a/Mage.Sets/src/mage/cards/c/CourtOfGarenbrig.java b/Mage.Sets/src/mage/cards/c/CourtOfGarenbrig.java
index bb9072ea778..db12c9ee9a3 100644
--- a/Mage.Sets/src/mage/cards/c/CourtOfGarenbrig.java
+++ b/Mage.Sets/src/mage/cards/c/CourtOfGarenbrig.java
@@ -31,15 +31,9 @@ public final class CourtOfGarenbrig extends CardImpl {
this.addAbility(new EntersBattlefieldTriggeredAbility(new BecomesMonarchSourceEffect()).addHint(MonarchHint.instance));
// At the beginning of your upkeep, distribute two +1/+1 counters among up to two target creatures. Then if you're the monarch, double the number of +1/+1 counters on each creature you control.
- Ability ability = new BeginningOfUpkeepTriggeredAbility(
- new DistributeCountersEffect(
- 2, "up to two target creatures"
- )
- );
- TargetCreaturePermanentAmount target = new TargetCreaturePermanentAmount(2);
- target.setMinNumberOfTargets(0);
- target.setMaxNumberOfTargets(2);
- ability.addTarget(target);
+ Ability ability = new BeginningOfUpkeepTriggeredAbility(new DistributeCountersEffect()
+ .setText("distribute two +1/+1 counters among up to two target creatures"));
+ ability.addTarget(new TargetCreaturePermanentAmount(2, 0, 2));
ability.addEffect(new ConditionalOneShotEffect(
new DoubleCounterOnEachPermanentEffect(CounterType.P1P1, StaticFilters.FILTER_CONTROLLED_CREATURE),
MonarchIsSourceControllerCondition.instance
diff --git a/Mage.Sets/src/mage/cards/d/DefendTheCelestus.java b/Mage.Sets/src/mage/cards/d/DefendTheCelestus.java
index cf520b7eb23..ba11c5a1cb8 100644
--- a/Mage.Sets/src/mage/cards/d/DefendTheCelestus.java
+++ b/Mage.Sets/src/mage/cards/d/DefendTheCelestus.java
@@ -4,7 +4,6 @@ import mage.abilities.effects.common.counter.DistributeCountersEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanentAmount;
@@ -19,10 +18,7 @@ public final class DefendTheCelestus extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{G}{G}");
// Distribute three +1/+1 counters among one, two, or three target creatures you control.
- this.getSpellAbility().addEffect(new DistributeCountersEffect(
- 3,
- "one, two, or three target creatures you control"
- ));
+ this.getSpellAbility().addEffect(new DistributeCountersEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(
3, StaticFilters.FILTER_CONTROLLED_CREATURES
));
diff --git a/Mage.Sets/src/mage/cards/d/DeftDismissal.java b/Mage.Sets/src/mage/cards/d/DeftDismissal.java
index 53a76683cc4..03d5acbbc43 100644
--- a/Mage.Sets/src/mage/cards/d/DeftDismissal.java
+++ b/Mage.Sets/src/mage/cards/d/DeftDismissal.java
@@ -18,7 +18,7 @@ public final class DeftDismissal extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{W}");
// Deft Dismissal deals 3 damage divided as you choose among one, two, or three target attacking or blocking creatures.
- this.getSpellAbility().addEffect(new DamageMultiEffect(3));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(3, StaticFilters.FILTER_ATTACKING_OR_BLOCKING_CREATURES));
}
diff --git a/Mage.Sets/src/mage/cards/d/DragonlordAtarka.java b/Mage.Sets/src/mage/cards/d/DragonlordAtarka.java
index def1083412f..38878c22ff1 100644
--- a/Mage.Sets/src/mage/cards/d/DragonlordAtarka.java
+++ b/Mage.Sets/src/mage/cards/d/DragonlordAtarka.java
@@ -43,11 +43,8 @@ public final class DragonlordAtarka extends CardImpl {
this.addAbility(TrampleAbility.getInstance());
// When Dragonlord Atarka enters the battlefield, it deals 5 damage divided as you choose among any number of target creatures and/or planeswalkers your opponents control.
- Ability ability = new EntersBattlefieldTriggeredAbility(new DamageMultiEffect(5, "it"), false);
- TargetCreatureOrPlaneswalkerAmount target = new TargetCreatureOrPlaneswalkerAmount(5, filter);
- target.setMinNumberOfTargets(1);
- target.setMaxNumberOfTargets(5);
- ability.addTarget(target);
+ Ability ability = new EntersBattlefieldTriggeredAbility(new DamageMultiEffect("it"), false);
+ ability.addTarget(new TargetCreatureOrPlaneswalkerAmount(5, filter));
this.addAbility(ability);
}
diff --git a/Mage.Sets/src/mage/cards/e/Electrolyze.java b/Mage.Sets/src/mage/cards/e/Electrolyze.java
index 3590b7067c3..45b502d181f 100644
--- a/Mage.Sets/src/mage/cards/e/Electrolyze.java
+++ b/Mage.Sets/src/mage/cards/e/Electrolyze.java
@@ -18,7 +18,7 @@ public final class Electrolyze extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{U}{R}");
// Electrolyze deals 2 damage divided as you choose among one or two targets.
- this.getSpellAbility().addEffect(new DamageMultiEffect(2));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetAnyTargetAmount(2));
// Draw a card.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1).concatBy("
"));
diff --git a/Mage.Sets/src/mage/cards/e/ElusiveOtter.java b/Mage.Sets/src/mage/cards/e/ElusiveOtter.java
index fdc288de3bd..53c557f82a4 100644
--- a/Mage.Sets/src/mage/cards/e/ElusiveOtter.java
+++ b/Mage.Sets/src/mage/cards/e/ElusiveOtter.java
@@ -10,9 +10,7 @@ import mage.cards.AdventureCard;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.counters.CounterType;
import mage.filter.StaticFilters;
-import mage.target.Target;
import mage.target.common.TargetCreaturePermanentAmount;
import java.util.UUID;
@@ -37,14 +35,9 @@ public final class ElusiveOtter extends AdventureCard {
// Grove's Bounty
// Distribute X +1/+1 counters among any number of target creatures you control.
- this.getSpellCard().getSpellAbility().addEffect(new DistributeCountersEffect(
- CounterType.P1P1, GetXValue.instance,
- "any number of target creatures you control"
- ));
- Target target = new TargetCreaturePermanentAmount(GetXValue.instance, StaticFilters.FILTER_CONTROLLED_CREATURES);
- target.setMinNumberOfTargets(0);
- target.setMaxNumberOfTargets(Integer.MAX_VALUE);
- this.getSpellCard().getSpellAbility().addTarget(target);
+ this.getSpellCard().getSpellAbility().addEffect(new DistributeCountersEffect());
+ this.getSpellCard().getSpellAbility().addTarget(
+ new TargetCreaturePermanentAmount(GetXValue.instance, StaticFilters.FILTER_CONTROLLED_CREATURES));
this.finalizeAdventure();
}
diff --git a/Mage.Sets/src/mage/cards/e/ElvenRite.java b/Mage.Sets/src/mage/cards/e/ElvenRite.java
index 030277f47db..7dcb8db2700 100644
--- a/Mage.Sets/src/mage/cards/e/ElvenRite.java
+++ b/Mage.Sets/src/mage/cards/e/ElvenRite.java
@@ -6,7 +6,6 @@ import mage.abilities.effects.common.counter.DistributeCountersEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.counters.CounterType;
import mage.target.common.TargetCreaturePermanentAmount;
/**
@@ -19,7 +18,7 @@ public final class ElvenRite extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{G}");
// Distribute two +1/+1 counters among one or two target creatures.
- this.getSpellAbility().addEffect(new DistributeCountersEffect(2, "one or two target creatures"));
+ this.getSpellAbility().addEffect(new DistributeCountersEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(2));
}
diff --git a/Mage.Sets/src/mage/cards/e/Embolden.java b/Mage.Sets/src/mage/cards/e/Embolden.java
index 92fbf5a8b0d..0e1525d8358 100644
--- a/Mage.Sets/src/mage/cards/e/Embolden.java
+++ b/Mage.Sets/src/mage/cards/e/Embolden.java
@@ -9,7 +9,6 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
-import mage.constants.TimingRule;
import mage.target.common.TargetAnyTargetAmount;
/**
@@ -21,7 +20,7 @@ public final class Embolden extends CardImpl {
public Embolden(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{W}");
- // Prevent the next 4 damage that would be dealt this turn to any number of target creatures and/or players, divided as you choose.
+ // Prevent the next 4 damage that would be dealt this turn to any number of targets, divided as you choose.
this.getSpellAbility().addEffect(new PreventDamageToTargetMultiAmountEffect(Duration.EndOfTurn, 4));
this.getSpellAbility().addTarget(new TargetAnyTargetAmount(4));
diff --git a/Mage.Sets/src/mage/cards/f/FeastOfTheVictoriousDead.java b/Mage.Sets/src/mage/cards/f/FeastOfTheVictoriousDead.java
index 9529fdde0d0..cc289f7797b 100644
--- a/Mage.Sets/src/mage/cards/f/FeastOfTheVictoriousDead.java
+++ b/Mage.Sets/src/mage/cards/f/FeastOfTheVictoriousDead.java
@@ -77,8 +77,7 @@ class FeastOfTheVictoriousDeadEffect extends OneShotEffect {
if (player == null || game.getBattlefield().count(StaticFilters.FILTER_CONTROLLED_CREATURE, player.getId(), source, game) < 1) {
return false;
}
- TargetPermanentAmount target = new TargetCreaturePermanentAmount(amount, StaticFilters.FILTER_CONTROLLED_CREATURE);
- target.setMinNumberOfTargets(1);
+ TargetPermanentAmount target = new TargetCreaturePermanentAmount(amount, 1, amount, StaticFilters.FILTER_CONTROLLED_CREATURE);
target.withNotTarget(true);
target.withChooseHint("to distribute " + amount + " counters");
target.chooseTarget(outcome, player.getId(), source, game);
diff --git a/Mage.Sets/src/mage/cards/f/FieryJustice.java b/Mage.Sets/src/mage/cards/f/FieryJustice.java
index 252a927406f..9bea53b34c5 100644
--- a/Mage.Sets/src/mage/cards/f/FieryJustice.java
+++ b/Mage.Sets/src/mage/cards/f/FieryJustice.java
@@ -22,7 +22,7 @@ public final class FieryJustice extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{R}{G}{W}");
// Fiery Justice deals 5 damage divided as you choose among any number of targets. Target opponent gains 5 life.
- this.getSpellAbility().addEffect(new DamageMultiEffect(5));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetAnyTargetAmount(5));
Effect effect = new GainLifeTargetEffect(5);
effect.setTargetPointer(new SecondTargetPointer());
diff --git a/Mage.Sets/src/mage/cards/f/FightWithFire.java b/Mage.Sets/src/mage/cards/f/FightWithFire.java
index 91c66490787..3d09f8144de 100644
--- a/Mage.Sets/src/mage/cards/f/FightWithFire.java
+++ b/Mage.Sets/src/mage/cards/f/FightWithFire.java
@@ -29,7 +29,7 @@ public final class FightWithFire extends CardImpl {
// Fight with Fire deals 5 damage to target creature. If this spell was kicked, it deals 10 damage divided as you choose among any number of targets instead. (Those targets can include players and planeswalkers.)
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
- new DamageMultiEffect(10),
+ new DamageMultiEffect(),
new DamageTargetEffect(5),
KickedCondition.ONCE,
"{this} deals 5 damage to target creature. If this spell was kicked, "
diff --git a/Mage.Sets/src/mage/cards/f/FireAtWill.java b/Mage.Sets/src/mage/cards/f/FireAtWill.java
index e910437823f..77893d8ec34 100644
--- a/Mage.Sets/src/mage/cards/f/FireAtWill.java
+++ b/Mage.Sets/src/mage/cards/f/FireAtWill.java
@@ -19,7 +19,7 @@ public final class FireAtWill extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R/W}{R/W}{R/W}");
// Fire at Will deals 3 damage divided as you choose among one, two, or three target attacking or blocking creatures.
- this.getSpellAbility().addEffect(new DamageMultiEffect(3));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(3, StaticFilters.FILTER_ATTACKING_OR_BLOCKING_CREATURES));
}
diff --git a/Mage.Sets/src/mage/cards/f/FireCovenant.java b/Mage.Sets/src/mage/cards/f/FireCovenant.java
index 4ae64d84009..a485ae46cbf 100644
--- a/Mage.Sets/src/mage/cards/f/FireCovenant.java
+++ b/Mage.Sets/src/mage/cards/f/FireCovenant.java
@@ -26,7 +26,7 @@ public final class FireCovenant extends CardImpl {
// Fire Covenant deals X damage divided as you choose among any number of target creatures.
DynamicValue xValue = GetXValue.instance;
- this.getSpellAbility().addEffect(new DamageMultiEffect(xValue));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(xValue));
}
diff --git a/Mage.Sets/src/mage/cards/f/FireIce.java b/Mage.Sets/src/mage/cards/f/FireIce.java
index afe9d77b15f..19dc510f23a 100644
--- a/Mage.Sets/src/mage/cards/f/FireIce.java
+++ b/Mage.Sets/src/mage/cards/f/FireIce.java
@@ -18,7 +18,7 @@ public final class FireIce extends SplitCard {
// Fire
// Fire deals 2 damage divided as you choose among one or two targets.
- getLeftHalfCard().getSpellAbility().addEffect(new DamageMultiEffect(2, "Fire"));
+ getLeftHalfCard().getSpellAbility().addEffect(new DamageMultiEffect());
getLeftHalfCard().getSpellAbility().addTarget(new TargetAnyTargetAmount(2));
// Ice
diff --git a/Mage.Sets/src/mage/cards/f/FlamesOfTheFirebrand.java b/Mage.Sets/src/mage/cards/f/FlamesOfTheFirebrand.java
index 7100668c180..767540f7bd6 100644
--- a/Mage.Sets/src/mage/cards/f/FlamesOfTheFirebrand.java
+++ b/Mage.Sets/src/mage/cards/f/FlamesOfTheFirebrand.java
@@ -17,7 +17,7 @@ public final class FlamesOfTheFirebrand extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{R}");
// Flames of the Firebrand deals 3 damage divided as you choose among one, two, or three targets.
- this.getSpellAbility().addEffect(new DamageMultiEffect(3));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetAnyTargetAmount(3));
}
diff --git a/Mage.Sets/src/mage/cards/f/Flameshot.java b/Mage.Sets/src/mage/cards/f/Flameshot.java
index 15fde82d4ad..ee0f42e2c21 100644
--- a/Mage.Sets/src/mage/cards/f/Flameshot.java
+++ b/Mage.Sets/src/mage/cards/f/Flameshot.java
@@ -32,7 +32,7 @@ public final class Flameshot extends CardImpl {
this.addAbility(new AlternativeCostSourceAbility(new DiscardTargetCost(new TargetCardInHand(filter))));
// Flameshot deals 3 damage divided as you choose among one, two, or three target creatures.
- this.getSpellAbility().addEffect(new DamageMultiEffect(3));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(3));
}
diff --git a/Mage.Sets/src/mage/cards/f/ForkedBolt.java b/Mage.Sets/src/mage/cards/f/ForkedBolt.java
index 167d4999165..9ded9196f48 100644
--- a/Mage.Sets/src/mage/cards/f/ForkedBolt.java
+++ b/Mage.Sets/src/mage/cards/f/ForkedBolt.java
@@ -17,7 +17,7 @@ public final class ForkedBolt extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{R}");
// Forked Bolt deals 2 damage divided as you choose among one or two targets.
- this.getSpellAbility().addEffect(new DamageMultiEffect(2));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetAnyTargetAmount(2));
}
diff --git a/Mage.Sets/src/mage/cards/f/ForkedLightning.java b/Mage.Sets/src/mage/cards/f/ForkedLightning.java
index 0d14651ab6a..b08ce5a3c1f 100644
--- a/Mage.Sets/src/mage/cards/f/ForkedLightning.java
+++ b/Mage.Sets/src/mage/cards/f/ForkedLightning.java
@@ -6,7 +6,6 @@ import mage.abilities.effects.common.DamageMultiEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.target.Target;
import mage.target.common.TargetCreaturePermanentAmount;
/**
@@ -19,9 +18,8 @@ public final class ForkedLightning extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{R}");
// Forked Lightning deals 4 damage divided as you choose among one, two, or three target creatures.
- this.getSpellAbility().addEffect(new DamageMultiEffect(4)
- .setText("{this} deals 4 damage divided as you choose among one, two, or three target creatures"));
- Target target=new TargetCreaturePermanentAmount(4);target.setMaxNumberOfTargets(3);this.getSpellAbility().addTarget(target);
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
+ this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(4, 1, 3));
}
private ForkedLightning(final ForkedLightning card) {
diff --git a/Mage.Sets/src/mage/cards/f/Fury.java b/Mage.Sets/src/mage/cards/f/Fury.java
index 03c3ef9a723..edc969baa55 100644
--- a/Mage.Sets/src/mage/cards/f/Fury.java
+++ b/Mage.Sets/src/mage/cards/f/Fury.java
@@ -43,7 +43,7 @@ public final class Fury extends CardImpl {
// When Fury enters the battlefield, it deals 4 damage divided as you choose among any number of target creatures and/or planeswalkers.
Ability ability = new EntersBattlefieldTriggeredAbility(
- new DamageMultiEffect(4, "it")
+ new DamageMultiEffect("it")
);
ability.addTarget(new TargetCreatureOrPlaneswalkerAmount(4));
this.addAbility(ability);
diff --git a/Mage.Sets/src/mage/cards/g/GangOfDevils.java b/Mage.Sets/src/mage/cards/g/GangOfDevils.java
index a782b65ce5c..59a30a4613b 100644
--- a/Mage.Sets/src/mage/cards/g/GangOfDevils.java
+++ b/Mage.Sets/src/mage/cards/g/GangOfDevils.java
@@ -26,7 +26,7 @@ public final class GangOfDevils extends CardImpl {
this.toughness = new MageInt(3);
// When Gang of Devils dies, it deals 3 damage divided as you choose among one, two, or three targets.
- Ability ability = new DiesSourceTriggeredAbility(new DamageMultiEffect(3, "it"));
+ Ability ability = new DiesSourceTriggeredAbility(new DamageMultiEffect("it"));
ability.addTarget(new TargetAnyTargetAmount(3));
this.addAbility(ability);
}
diff --git a/Mage.Sets/src/mage/cards/g/GhiredsBelligerence.java b/Mage.Sets/src/mage/cards/g/GhiredsBelligerence.java
index 2d5cb7bfd5c..7b048c93cc1 100644
--- a/Mage.Sets/src/mage/cards/g/GhiredsBelligerence.java
+++ b/Mage.Sets/src/mage/cards/g/GhiredsBelligerence.java
@@ -46,7 +46,7 @@ public final class GhiredsBelligerence extends CardImpl {
class GhiredsBelligerenceEffect extends OneShotEffect {
- private static final DamageMultiEffect effect = new DamageMultiEffect(GetXValue.instance);
+ private static final DamageMultiEffect effect = new DamageMultiEffect();
GhiredsBelligerenceEffect() {
super(Outcome.Benefit);
diff --git a/Mage.Sets/src/mage/cards/g/GlintWeaver.java b/Mage.Sets/src/mage/cards/g/GlintWeaver.java
index 2d8f0e0d398..f99e13ef97a 100644
--- a/Mage.Sets/src/mage/cards/g/GlintWeaver.java
+++ b/Mage.Sets/src/mage/cards/g/GlintWeaver.java
@@ -11,7 +11,6 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.counters.CounterType;
import mage.target.common.TargetCreaturePermanentAmount;
import java.util.UUID;
@@ -32,9 +31,7 @@ public final class GlintWeaver extends CardImpl {
this.addAbility(ReachAbility.getInstance());
// When Glint Weaver enters the battlefield, distribute three +1/+1 counters among one, two, or three target creatures, then you gain life equal to the greatest toughness among creatures you control.
- Ability ability = new EntersBattlefieldTriggeredAbility(new DistributeCountersEffect(
- 3, "one, two, or three target creatures"
- ));
+ Ability ability = new EntersBattlefieldTriggeredAbility(new DistributeCountersEffect());
ability.addEffect(new GainLifeEffect(GreatestToughnessAmongControlledCreaturesValue.instance)
.setText(", then you gain life equal to the greatest toughness among creatures you control"));
ability.addTarget(new TargetCreaturePermanentAmount(3));
diff --git a/Mage.Sets/src/mage/cards/h/HailOfArrows.java b/Mage.Sets/src/mage/cards/h/HailOfArrows.java
index 939e29198a9..8495476ac79 100644
--- a/Mage.Sets/src/mage/cards/h/HailOfArrows.java
+++ b/Mage.Sets/src/mage/cards/h/HailOfArrows.java
@@ -19,7 +19,7 @@ public final class HailOfArrows extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{W}");
// Hail of Arrows deals X damage divided as you choose among any number of target attacking creatures.
- this.getSpellAbility().addEffect(new DamageMultiEffect(GetXValue.instance));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(GetXValue.instance, StaticFilters.FILTER_ATTACKING_CREATURES));
}
diff --git a/Mage.Sets/src/mage/cards/i/IgniteDisorder.java b/Mage.Sets/src/mage/cards/i/IgniteDisorder.java
index f28100eb6f9..c3f499e2eba 100644
--- a/Mage.Sets/src/mage/cards/i/IgniteDisorder.java
+++ b/Mage.Sets/src/mage/cards/i/IgniteDisorder.java
@@ -29,7 +29,7 @@ public final class IgniteDisorder extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{R}");
// Ignite Disorder deals 3 damage divided as you choose among one, two, or three target white and/or blue creatures.
- this.getSpellAbility().addEffect(new DamageMultiEffect(3));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(3, filter));
}
diff --git a/Mage.Sets/src/mage/cards/i/ImpactResonance.java b/Mage.Sets/src/mage/cards/i/ImpactResonance.java
index ab458592a25..294498ed54b 100644
--- a/Mage.Sets/src/mage/cards/i/ImpactResonance.java
+++ b/Mage.Sets/src/mage/cards/i/ImpactResonance.java
@@ -29,7 +29,7 @@ public final class ImpactResonance extends CardImpl {
// Impact Resonance deals X damage divided as you choose among any number of target creatures, where X is the greatest amount of damage dealt by a source to a permanent or player this turn.
DynamicValue xValue = GreatestAmountOfDamageDealtValue.instance;
- Effect effect = new DamageMultiEffect(xValue);
+ Effect effect = new DamageMultiEffect();
effect.setText("{this} deals X damage divided as you choose among any number of target creatures, where X is the greatest amount of damage dealt by a source to a permanent or player this turn");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(xValue));
diff --git a/Mage.Sets/src/mage/cards/i/InfernalHarvest.java b/Mage.Sets/src/mage/cards/i/InfernalHarvest.java
index 641cf103078..6188702c0b3 100644
--- a/Mage.Sets/src/mage/cards/i/InfernalHarvest.java
+++ b/Mage.Sets/src/mage/cards/i/InfernalHarvest.java
@@ -37,7 +37,7 @@ public final class InfernalHarvest extends CardImpl {
this.getSpellAbility().addCost(new InfernalHarvestAdditionalCost());
// Infernal Harvest deals X damage divided as you choose among any number of target creatures.
- this.getSpellAbility().addEffect(new DamageMultiEffect(GetXValue.instance));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(GetXValue.instance));
}
diff --git a/Mage.Sets/src/mage/cards/i/InfernoTitan.java b/Mage.Sets/src/mage/cards/i/InfernoTitan.java
index c26e2b72051..793e3a4614e 100644
--- a/Mage.Sets/src/mage/cards/i/InfernoTitan.java
+++ b/Mage.Sets/src/mage/cards/i/InfernoTitan.java
@@ -30,7 +30,7 @@ public final class InfernoTitan extends CardImpl {
this.addAbility(new SimpleActivatedAbility(new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ColoredManaCost(ColoredManaSymbol.R)));
// Whenever Inferno Titan enters the battlefield or attacks, it deals 3 damage divided as you choose among one, two, or three targets.
- Ability ability = new EntersBattlefieldOrAttacksSourceTriggeredAbility(new DamageMultiEffect(3, "it"));
+ Ability ability = new EntersBattlefieldOrAttacksSourceTriggeredAbility(new DamageMultiEffect("it"));
ability.addTarget(new TargetAnyTargetAmount(3));
this.addAbility(ability);
}
diff --git a/Mage.Sets/src/mage/cards/i/InvokeJustice.java b/Mage.Sets/src/mage/cards/i/InvokeJustice.java
index f2377b002a0..e4389f72ddd 100644
--- a/Mage.Sets/src/mage/cards/i/InvokeJustice.java
+++ b/Mage.Sets/src/mage/cards/i/InvokeJustice.java
@@ -85,7 +85,7 @@ class InvokeJusticeEffect extends OneShotEffect {
if (!game.getBattlefield().contains(filter, source, game, 1)) {
return false;
}
- TargetPermanentAmount target = new TargetPermanentAmount(4, filter);
+ TargetPermanentAmount target = new TargetPermanentAmount(4, 0, filter);
target.withNotTarget(true);
target.chooseTarget(outcome, player.getId(), source, game);
for (UUID targetId : target.getTargets()) {
diff --git a/Mage.Sets/src/mage/cards/j/JadeSeedstones.java b/Mage.Sets/src/mage/cards/j/JadeSeedstones.java
index 149827d2016..55cde970259 100644
--- a/Mage.Sets/src/mage/cards/j/JadeSeedstones.java
+++ b/Mage.Sets/src/mage/cards/j/JadeSeedstones.java
@@ -7,9 +7,8 @@ import mage.abilities.keyword.CraftAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.counters.CounterType;
import mage.filter.StaticFilters;
-import mage.target.common.TargetPermanentAmount;
+import mage.target.common.TargetCreaturePermanentAmount;
import java.util.UUID;
@@ -23,12 +22,8 @@ public final class JadeSeedstones extends CardImpl {
this.secondSideCardClazz = mage.cards.j.JadeheartAttendant.class;
// When Jade Seedstones enters the battlefield, distribute three +1/+1 counters among one, two, or three target creatures you control.
- Ability ability = new EntersBattlefieldTriggeredAbility(new DistributeCountersEffect(
- 3, "one, two, or three target creatures you control"
- ));
- TargetPermanentAmount target = new TargetPermanentAmount(3, StaticFilters.FILTER_CONTROLLED_CREATURES);
- target.setMinNumberOfTargets(1);
- ability.addTarget(target);
+ Ability ability = new EntersBattlefieldTriggeredAbility(new DistributeCountersEffect());
+ ability.addTarget(new TargetCreaturePermanentAmount(3, StaticFilters.FILTER_CONTROLLED_CREATURES));
this.addAbility(ability);
// Craft with creature {5}{G}{G}
diff --git a/Mage.Sets/src/mage/cards/j/JawsOfStone.java b/Mage.Sets/src/mage/cards/j/JawsOfStone.java
index c286b9a1adc..a06432dfb35 100644
--- a/Mage.Sets/src/mage/cards/j/JawsOfStone.java
+++ b/Mage.Sets/src/mage/cards/j/JawsOfStone.java
@@ -30,7 +30,7 @@ public final class JawsOfStone extends CardImpl {
// Jaws of Stone deals X damage divided as you choose among any number of targets, where X is the number of Mountains you control as you cast this spell.
PermanentsOnBattlefieldCount mountains = new PermanentsOnBattlefieldCount(filter, null);
- Effect effect = new DamageMultiEffect(mountains);
+ Effect effect = new DamageMultiEffect();
effect.setText(rule);
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetAnyTargetAmount(mountains));
diff --git a/Mage.Sets/src/mage/cards/j/JuganTheRisingStar.java b/Mage.Sets/src/mage/cards/j/JuganTheRisingStar.java
index effc7db6288..cc5d51ca700 100644
--- a/Mage.Sets/src/mage/cards/j/JuganTheRisingStar.java
+++ b/Mage.Sets/src/mage/cards/j/JuganTheRisingStar.java
@@ -13,7 +13,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
-import mage.counters.CounterType;
import mage.target.common.TargetCreaturePermanentAmount;
/**
@@ -33,7 +32,7 @@ public final class JuganTheRisingStar extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// When Jugan, the Rising Star dies, you may distribute five +1/+1 counters among any number of target creatures.
- Ability ability = new DiesSourceTriggeredAbility(new DistributeCountersEffect(5, "any number of target creatures"), true);
+ Ability ability = new DiesSourceTriggeredAbility(new DistributeCountersEffect(), true);
ability.addTarget(new TargetCreaturePermanentAmount(5));
this.addAbility(ability);
}
diff --git a/Mage.Sets/src/mage/cards/k/KuldothaFlamefiend.java b/Mage.Sets/src/mage/cards/k/KuldothaFlamefiend.java
index c844636eea9..cdc235bbb37 100644
--- a/Mage.Sets/src/mage/cards/k/KuldothaFlamefiend.java
+++ b/Mage.Sets/src/mage/cards/k/KuldothaFlamefiend.java
@@ -11,7 +11,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.StaticFilters;
-import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetAnyTargetAmount;
/**
@@ -29,7 +28,7 @@ public final class KuldothaFlamefiend extends CardImpl {
// When Kuldotha Flamefiend enters the battlefield, you may sacrifice an artifact. If you do, Kuldotha Flamefiend deals 4 damage divided as you choose among any number of targets.
EntersBattlefieldTriggeredAbility ability =
- new EntersBattlefieldTriggeredAbility(new DoIfCostPaid(new DamageMultiEffect(4), new SacrificeTargetCost(StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT_AN)), false);
+ new EntersBattlefieldTriggeredAbility(new DoIfCostPaid(new DamageMultiEffect(), new SacrificeTargetCost(StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT_AN)), false);
ability.addTarget(new TargetAnyTargetAmount(4));
this.addAbility(ability);
}
diff --git a/Mage.Sets/src/mage/cards/l/LathielTheBounteousDawn.java b/Mage.Sets/src/mage/cards/l/LathielTheBounteousDawn.java
index 47bf24fade8..20e73478ede 100644
--- a/Mage.Sets/src/mage/cards/l/LathielTheBounteousDawn.java
+++ b/Mage.Sets/src/mage/cards/l/LathielTheBounteousDawn.java
@@ -15,10 +15,8 @@ import mage.abilities.keyword.LifelinkAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
-import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.game.Game;
-import mage.target.TargetAmount;
import mage.target.common.TargetCreaturePermanentAmount;
import mage.watchers.common.PlayerGainedLifeWatcher;
@@ -44,18 +42,13 @@ public final class LathielTheBounteousDawn extends CardImpl {
// At the beginning of each end step, if you gained life this turn, distribute up to that many +1/+1 counters among any number of other target creatures.
Ability ability = new ConditionalInterveningIfTriggeredAbility(
- new BeginningOfEndStepTriggeredAbility(TargetController.ANY, new DistributeCountersEffect(
- 1, ""
- ), false),
+ new BeginningOfEndStepTriggeredAbility(TargetController.ANY, new DistributeCountersEffect(), false),
condition, "At the beginning of each end step, if you gained life this turn, " +
"distribute up to that many +1/+1 counters among any number of other target creatures."
);
- TargetAmount target = new TargetCreaturePermanentAmount(
+ ability.addTarget(new TargetCreaturePermanentAmount(
LathielTheBounteousDawnValue.instance,
- StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE
- );
- target.setMinNumberOfTargets(0);
- ability.addTarget(target);
+ StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE));
this.addAbility(ability.addHint(LathielTheBounteousDawnValue.getHint()), new PlayerGainedLifeWatcher());
}
diff --git a/Mage.Sets/src/mage/cards/l/LivingInferno.java b/Mage.Sets/src/mage/cards/l/LivingInferno.java
index 347f6af772f..163246c0dad 100644
--- a/Mage.Sets/src/mage/cards/l/LivingInferno.java
+++ b/Mage.Sets/src/mage/cards/l/LivingInferno.java
@@ -11,7 +11,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
-import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.Target;
@@ -57,7 +56,8 @@ enum LivingInfernoAdjuster implements TargetAdjuster {
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(ability.getSourceId());
if (sourcePermanent != null) {
ability.getTargets().clear();
- ability.addTarget(new TargetCreaturePermanentAmount(sourcePermanent.getPower().getValue()));
+ int power = sourcePermanent.getPower().getValue();
+ ability.addTarget(new TargetCreaturePermanentAmount(power, 0, power));
}
}
}
diff --git a/Mage.Sets/src/mage/cards/l/LukkaBoundToRuin.java b/Mage.Sets/src/mage/cards/l/LukkaBoundToRuin.java
index 2a76293cae0..09d0f88c46c 100644
--- a/Mage.Sets/src/mage/cards/l/LukkaBoundToRuin.java
+++ b/Mage.Sets/src/mage/cards/l/LukkaBoundToRuin.java
@@ -6,7 +6,6 @@ import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.condition.Condition;
-import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.GreatestPowerAmongControlledCreaturesValue;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
@@ -51,11 +50,10 @@ public class LukkaBoundToRuin extends CardImpl {
// −4: Lukka deals X damage divided as you choose among any number of target creatures and/or planeswalkers,
// where X is the greatest power among creatures you controlled as you activated this ability.
- DynamicValue xValue = GreatestPowerAmongControlledCreaturesValue.instance;
- DamageMultiEffect damageMultiEffect = new DamageMultiEffect(xValue);
+ DamageMultiEffect damageMultiEffect = new DamageMultiEffect();
damageMultiEffect.setText("Lukka deals X damage divided as you choose " +
"among any number of target creatures and/or planeswalkers, " +
- "where X is the greatest power among creatures you controlled as you activated this ability.");
+ "where X is the greatest power among creatures you control as you activate this ability.");
ability = new LoyaltyAbility(damageMultiEffect, -4);
ability.setTargetAdjuster(LukkaBoundToRuinAdjuster.instance);
this.addAbility(ability);
@@ -135,9 +133,6 @@ enum LukkaBoundToRuinAdjuster implements TargetAdjuster {
// Maximum targets is equal to the damage - as each target need to be assigned at least 1 damage
ability.getTargets().clear();
int xValue = GreatestPowerAmongControlledCreaturesValue.instance.calculate(game, ability, null);
- TargetCreatureOrPlaneswalkerAmount targetCreatureOrPlaneswalkerAmount = new TargetCreatureOrPlaneswalkerAmount(xValue);
- targetCreatureOrPlaneswalkerAmount.setMinNumberOfTargets(0);
- targetCreatureOrPlaneswalkerAmount.setMaxNumberOfTargets(xValue);
- ability.addTarget(targetCreatureOrPlaneswalkerAmount);
+ ability.addTarget(new TargetCreatureOrPlaneswalkerAmount(xValue, 0, xValue));
}
}
diff --git a/Mage.Sets/src/mage/cards/m/MagicMissile.java b/Mage.Sets/src/mage/cards/m/MagicMissile.java
index b64132d2951..2fce2dc2503 100644
--- a/Mage.Sets/src/mage/cards/m/MagicMissile.java
+++ b/Mage.Sets/src/mage/cards/m/MagicMissile.java
@@ -21,7 +21,7 @@ public final class MagicMissile extends CardImpl {
this.addAbility(new CantBeCounteredSourceAbility().setRuleAtTheTop(true));
// Magic Missile deals 3 damage divided as you choose among one, two, or three targets.
- this.getSpellAbility().addEffect(new DamageMultiEffect(3));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetAnyTargetAmount(3));
}
diff --git a/Mage.Sets/src/mage/cards/m/MagmaOpus.java b/Mage.Sets/src/mage/cards/m/MagmaOpus.java
index fc202b234d1..a7586a6fb28 100644
--- a/Mage.Sets/src/mage/cards/m/MagmaOpus.java
+++ b/Mage.Sets/src/mage/cards/m/MagmaOpus.java
@@ -30,7 +30,7 @@ public final class MagmaOpus extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{6}{U}{R}");
// Magma Opus deals 4 damage divided as you choose among any number of targets. Tap two target permanents. Create a 4/4 blue and red Elemental creature token. Draw two cards.
- this.getSpellAbility().addEffect(new DamageMultiEffect(4));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetAnyTargetAmount(4).withChooseHint("damage"));
this.getSpellAbility().addEffect(new TapTargetEffect("tap two target permanents").setTargetPointer(new SecondTargetPointer()));
this.getSpellAbility().addTarget(new TargetPermanent(2, StaticFilters.FILTER_PERMANENTS).withChooseHint("tap"));
diff --git a/Mage.Sets/src/mage/cards/m/MagmaticCore.java b/Mage.Sets/src/mage/cards/m/MagmaticCore.java
index b53cf52cfe3..d2ba2ad0773 100644
--- a/Mage.Sets/src/mage/cards/m/MagmaticCore.java
+++ b/Mage.Sets/src/mage/cards/m/MagmaticCore.java
@@ -30,7 +30,7 @@ public final class MagmaticCore extends CardImpl {
// At the beginning of your end step, Magmatic Core deals X damage divided as you choose among any number of target creatures, where X is the number of age counters on it.
DynamicValue value = new CountersSourceCount(CounterType.AGE);
Ability ability = new BeginningOfEndStepTriggeredAbility(
- new DamageMultiEffect(value)
+ new DamageMultiEffect()
.setText("{this} deals X damage divided as you choose "
+ "among any number of target creatures,"
+ " where X is the number of age counters on it.")
diff --git a/Mage.Sets/src/mage/cards/m/MeteorShower.java b/Mage.Sets/src/mage/cards/m/MeteorShower.java
index bef6bc4aaf1..1f30e90576f 100644
--- a/Mage.Sets/src/mage/cards/m/MeteorShower.java
+++ b/Mage.Sets/src/mage/cards/m/MeteorShower.java
@@ -22,7 +22,8 @@ public final class MeteorShower extends CardImpl {
// Meteor Shower deals X plus 1 damage divided as you choose among any number of targets.
DynamicValue xValue = new IntPlusDynamicValue(1, GetXValue.instance);
- this.getSpellAbility().addEffect(new DamageMultiEffect(xValue));
+ this.getSpellAbility().addEffect(new DamageMultiEffect()
+ .setText("{this} deals X plus 1 damage divided as you choose among any number of targets"));
this.getSpellAbility().addTarget(new TargetAnyTargetAmount(xValue));
}
diff --git a/Mage.Sets/src/mage/cards/m/MeteorSwarm.java b/Mage.Sets/src/mage/cards/m/MeteorSwarm.java
index 6b3c7bb7c35..fd64f60794a 100644
--- a/Mage.Sets/src/mage/cards/m/MeteorSwarm.java
+++ b/Mage.Sets/src/mage/cards/m/MeteorSwarm.java
@@ -19,10 +19,11 @@ public final class MeteorSwarm extends CardImpl {
// Meteor Swarm deals 8 damage divided as you choose among X target creatures and/or planeswalkers.
this.getSpellAbility().addEffect(
- new DamageMultiEffect(8).
+ new DamageMultiEffect().
setText("{this} deals 8 damage divided as you choose among X target creatures and/or planeswalkers.")
);
- this.getSpellAbility().addTarget(new TargetCreatureOrPlaneswalkerAmount(8));
+ // Minimum number of targets will be overridden to X by the adjuster
+ this.getSpellAbility().addTarget(new TargetCreatureOrPlaneswalkerAmount(8, 1, 8));
this.getSpellAbility().setTargetAdjuster(new XTargetsCountAdjuster());
}
diff --git a/Mage.Sets/src/mage/cards/m/MoggMob.java b/Mage.Sets/src/mage/cards/m/MoggMob.java
index 31fcc189b0f..132f92715f3 100644
--- a/Mage.Sets/src/mage/cards/m/MoggMob.java
+++ b/Mage.Sets/src/mage/cards/m/MoggMob.java
@@ -27,7 +27,7 @@ public final class MoggMob extends CardImpl {
// Sacrifice Mogg Mob: It deals 3 damage divided as you choose among one, two, or three targets.
Ability ability = new SimpleActivatedAbility(
- new DamageMultiEffect(3, "it"), new SacrificeSourceCost()
+ new DamageMultiEffect("it"), new SacrificeSourceCost()
);
ability.addTarget(new TargetAnyTargetAmount(3));
this.addAbility(ability);
diff --git a/Mage.Sets/src/mage/cards/m/MonstrousOnslaught.java b/Mage.Sets/src/mage/cards/m/MonstrousOnslaught.java
index d3ae6ca0562..2a5b2b02ee8 100644
--- a/Mage.Sets/src/mage/cards/m/MonstrousOnslaught.java
+++ b/Mage.Sets/src/mage/cards/m/MonstrousOnslaught.java
@@ -22,7 +22,7 @@ public final class MonstrousOnslaught extends CardImpl {
// Monstrous Onslaught deals X damage divided as you choose among any number of target creatures, where X is the greatest power among creatures you control as you cast Monstrous Onslaught.
DynamicValue xValue = GreatestPowerAmongControlledCreaturesValue.instance;
- Effect effect = new DamageMultiEffect(xValue);
+ Effect effect = new DamageMultiEffect();
effect.setText("{this} deals X damage divided as you choose among any number of target creatures, where X is the greatest power among creatures you control as you cast this spell");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(xValue));
diff --git a/Mage.Sets/src/mage/cards/m/MyojinOfToweringMight.java b/Mage.Sets/src/mage/cards/m/MyojinOfToweringMight.java
index 7191e76fad9..f4148079935 100644
--- a/Mage.Sets/src/mage/cards/m/MyojinOfToweringMight.java
+++ b/Mage.Sets/src/mage/cards/m/MyojinOfToweringMight.java
@@ -44,10 +44,8 @@ public final class MyojinOfToweringMight extends CardImpl {
), new CastFromHandWatcher());
// Remove an indestructible counter from Myojin of Towering Might: Distribute eight +1/+1 counters among any number of target creatures you control. They gain trample until end of turn.
- Ability ability = new SimpleActivatedAbility(new DistributeCountersEffect(
- 8,
- "any number of target creatures you control"
- ), new RemoveCountersSourceCost(CounterType.INDESTRUCTIBLE.createInstance()));
+ Ability ability = new SimpleActivatedAbility(new DistributeCountersEffect(),
+ new RemoveCountersSourceCost(CounterType.INDESTRUCTIBLE.createInstance()));
ability.addEffect(new GainAbilityTargetEffect(
TrampleAbility.getInstance(), Duration.EndOfTurn
).setText("They gain trample until end of turn"));
diff --git a/Mage.Sets/src/mage/cards/m/MythosOfVadrok.java b/Mage.Sets/src/mage/cards/m/MythosOfVadrok.java
index fe65693100a..8db5a31abe4 100644
--- a/Mage.Sets/src/mage/cards/m/MythosOfVadrok.java
+++ b/Mage.Sets/src/mage/cards/m/MythosOfVadrok.java
@@ -11,7 +11,6 @@ import mage.abilities.effects.common.DamageMultiEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.ColoredManaSymbol;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.game.Game;
@@ -34,7 +33,7 @@ public final class MythosOfVadrok extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}{R}");
// Mythos of Vadrok deals 5 damage divided as you choose among any number of target creatures and/or planeswalkers. If {W}{U} was spent to cast this spell, until your next turn, those permanents can't attack or block and their activated abilities can't be activated.
- this.getSpellAbility().addEffect(new DamageMultiEffect(5));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetCreatureOrPlaneswalkerAmount(5));
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new MythosOfVadrokEffect(), condition, "If {W}{U} was spent to cast this spell, " +
diff --git a/Mage.Sets/src/mage/cards/n/NahirisSacrifice.java b/Mage.Sets/src/mage/cards/n/NahirisSacrifice.java
index 24d17a718b1..9bb7df08c61 100644
--- a/Mage.Sets/src/mage/cards/n/NahirisSacrifice.java
+++ b/Mage.Sets/src/mage/cards/n/NahirisSacrifice.java
@@ -41,7 +41,7 @@ public final class NahirisSacrifice extends CardImpl {
this.getSpellAbility().addCost(new SacrificeXManaValueCost(filter,true));
// Nahiri’s Sacrifice deals X damage divided as you choose among any number of target creatures.
- Effect effect = new DamageMultiEffect(GetXValue.instance);
+ Effect effect = new DamageMultiEffect();
effect.setText("{this} deals X damage divided as you choose among any number of target creatures.");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(GetXValue.instance));
diff --git a/Mage.Sets/src/mage/cards/n/NumaJoragaChieftain.java b/Mage.Sets/src/mage/cards/n/NumaJoragaChieftain.java
index 16dc5790cdd..04c6abef386 100644
--- a/Mage.Sets/src/mage/cards/n/NumaJoragaChieftain.java
+++ b/Mage.Sets/src/mage/cards/n/NumaJoragaChieftain.java
@@ -13,11 +13,10 @@ import mage.abilities.keyword.PartnerAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
-import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.game.Game;
import mage.players.Player;
-import mage.target.common.TargetCreaturePermanentAmount;
+import mage.target.common.TargetPermanentAmount;
import java.util.UUID;
@@ -88,10 +87,10 @@ class NumaJoragaChieftainEffect extends OneShotEffect {
return false;
}
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(
- new DistributeCountersEffect(costX, ""),
+ new DistributeCountersEffect(),
false, "distribute " + costX + " +1/+1 counters among any number of target Elves"
);
- ability.addTarget(new TargetCreaturePermanentAmount(costX, filter));
+ ability.addTarget(new TargetPermanentAmount(costX, 0, filter));
game.fireReflexiveTriggeredAbility(ability, source);
return true;
}
diff --git a/Mage.Sets/src/mage/cards/o/OmnivorousFlytrap.java b/Mage.Sets/src/mage/cards/o/OmnivorousFlytrap.java
index 7a5c2f998f8..88422143946 100644
--- a/Mage.Sets/src/mage/cards/o/OmnivorousFlytrap.java
+++ b/Mage.Sets/src/mage/cards/o/OmnivorousFlytrap.java
@@ -35,7 +35,7 @@ public final class OmnivorousFlytrap extends CardImpl {
// Delirium -- Whenever Omnivorous Flytrap enters or attacks, if there are four or more card types among cards in your graveyard, distribute two +1/+1 counters among one or two target creatures. Then if there are six or more card types among cards in your graveyard, double the number of +1/+1 counters on those creatures.
Ability ability = new EntersBattlefieldOrAttacksSourceTriggeredAbility(
- new DistributeCountersEffect(CounterType.P1P1, 2, "one or two target creatures"))
+ new DistributeCountersEffect())
.withInterveningIf(DeliriumCondition.instance);
ability.addEffect(new ConditionalOneShotEffect(
new OmnivorousFlytrapEffect(),
diff --git a/Mage.Sets/src/mage/cards/o/OnduKnotmaster.java b/Mage.Sets/src/mage/cards/o/OnduKnotmaster.java
index 421ac8229eb..f6ef3b944e6 100644
--- a/Mage.Sets/src/mage/cards/o/OnduKnotmaster.java
+++ b/Mage.Sets/src/mage/cards/o/OnduKnotmaster.java
@@ -50,12 +50,7 @@ public final class OnduKnotmaster extends AdventureCard {
// Throw a Line
// Distribute two +1/+1 counters among one or two target creatures.
- this.getSpellCard().getSpellAbility().addEffect(
- new DistributeCountersEffect(
- 2,
- "one or two target creatures"
- )
- );
+ this.getSpellCard().getSpellAbility().addEffect(new DistributeCountersEffect());
this.getSpellCard().getSpellAbility().addTarget(new TargetCreaturePermanentAmount(2));
this.finalizeAdventure();
diff --git a/Mage.Sets/src/mage/cards/o/OrcaSiegeDemon.java b/Mage.Sets/src/mage/cards/o/OrcaSiegeDemon.java
index 7bdb7569ddf..1f66c6c921f 100644
--- a/Mage.Sets/src/mage/cards/o/OrcaSiegeDemon.java
+++ b/Mage.Sets/src/mage/cards/o/OrcaSiegeDemon.java
@@ -38,7 +38,7 @@ public final class OrcaSiegeDemon extends CardImpl {
this.addAbility(new DiesCreatureTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false, true));
// When Orca dies, it deals damage equal to its power divided as you choose among any number of targets.
- Ability ability = new DiesSourceTriggeredAbility(new DamageMultiEffect(SourcePermanentPowerValue.NOT_NEGATIVE)
+ Ability ability = new DiesSourceTriggeredAbility(new DamageMultiEffect()
.setText("it deals damage equal to its power divided as you choose among any number of targets."));
ability.addTarget(new TargetAnyTargetAmount(SourcePermanentPowerValue.NOT_NEGATIVE));
this.addAbility(ability);
diff --git a/Mage.Sets/src/mage/cards/p/PicnicRuiner.java b/Mage.Sets/src/mage/cards/p/PicnicRuiner.java
index e8ef4ec3cd9..a5c00fb58a7 100644
--- a/Mage.Sets/src/mage/cards/p/PicnicRuiner.java
+++ b/Mage.Sets/src/mage/cards/p/PicnicRuiner.java
@@ -12,7 +12,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
-import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanentAmount;
@@ -40,14 +39,9 @@ public final class PicnicRuiner extends AdventureCard {
// Stolen Goodies
// Distribute three +1/+1 counters among any number of target creatures you control.
- this.getSpellCard().getSpellAbility().addEffect(
- new DistributeCountersEffect(
- 3,
- "any number of target creatures you control"
- )
- );
+ this.getSpellCard().getSpellAbility().addEffect(new DistributeCountersEffect());
this.getSpellCard().getSpellAbility().addTarget(
- new TargetCreaturePermanentAmount(3, StaticFilters.FILTER_CONTROLLED_CREATURES)
+ new TargetCreaturePermanentAmount(3, 0, 3, StaticFilters.FILTER_CONTROLLED_CREATURES)
);
this.finalizeAdventure();
diff --git a/Mage.Sets/src/mage/cards/p/PollenRemedy.java b/Mage.Sets/src/mage/cards/p/PollenRemedy.java
index a1e3503b4de..628abc57020 100644
--- a/Mage.Sets/src/mage/cards/p/PollenRemedy.java
+++ b/Mage.Sets/src/mage/cards/p/PollenRemedy.java
@@ -27,13 +27,13 @@ public final class PollenRemedy extends CardImpl {
// Kicker-Sacrifice a land.
this.addAbility(new KickerAbility(new SacrificeTargetCost(StaticFilters.FILTER_LAND)));
- // Prevent the next 3 damage that would be dealt this turn to any number of target creatures and/or players, divided as you choose.
+ // Prevent the next 3 damage that would be dealt this turn to any number of targets, divided as you choose.
// If Pollen Remedy was kicked, prevent the next 6 damage this way instead.
Effect effect = new ConditionalReplacementEffect(new PreventDamageToTargetMultiAmountEffect(Duration.EndOfTurn, 6),
KickedCondition.ONCE, new PreventDamageToTargetMultiAmountEffect(Duration.EndOfTurn, 3));
effect.setText("Prevent the next 3 damage that would be dealt this turn to any number of targets, divided as you choose. If this spell was kicked, prevent the next 6 damage this way instead.");
this.getSpellAbility().addEffect(effect);
- this.getSpellAbility().addTarget(new TargetAnyTargetAmount(3));
+ this.getSpellAbility().addTarget(new TargetAnyTargetAmount(3, 0, 3));
this.getSpellAbility().setTargetAdjuster(new ConditionalTargetAdjuster(KickedCondition.ONCE,
new TargetAnyTargetAmount(6)));
}
diff --git a/Mage.Sets/src/mage/cards/p/PolukranosWorldEater.java b/Mage.Sets/src/mage/cards/p/PolukranosWorldEater.java
index 9739ad31699..99a6152f271 100644
--- a/Mage.Sets/src/mage/cards/p/PolukranosWorldEater.java
+++ b/Mage.Sets/src/mage/cards/p/PolukranosWorldEater.java
@@ -79,7 +79,7 @@ enum PolukranosWorldEaterAdjuster implements TargetAdjuster {
public void adjustTargets(Ability ability, Game game) {
int xValue = ((BecomesMonstrousSourceTriggeredAbility) ability).getMonstrosityValue();
ability.getTargets().clear();
- ability.addTarget(new TargetCreaturePermanentAmount(xValue, StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURE));
+ ability.addTarget(new TargetCreaturePermanentAmount(xValue, 0, xValue, StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURE));
}
}
diff --git a/Mage.Sets/src/mage/cards/p/Pyrokinesis.java b/Mage.Sets/src/mage/cards/p/Pyrokinesis.java
index b86e2277b50..47bcdb06697 100644
--- a/Mage.Sets/src/mage/cards/p/Pyrokinesis.java
+++ b/Mage.Sets/src/mage/cards/p/Pyrokinesis.java
@@ -33,7 +33,7 @@ public final class Pyrokinesis extends CardImpl {
this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter))));
// Pyrokinesis deals 4 damage divided as you choose among any number of target creatures.
- this.getSpellAbility().addEffect(new DamageMultiEffect(4));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(4));
}
diff --git a/Mage.Sets/src/mage/cards/p/Pyrotechnics.java b/Mage.Sets/src/mage/cards/p/Pyrotechnics.java
index 354c0e384b7..5e071a833d3 100644
--- a/Mage.Sets/src/mage/cards/p/Pyrotechnics.java
+++ b/Mage.Sets/src/mage/cards/p/Pyrotechnics.java
@@ -19,7 +19,7 @@ public final class Pyrotechnics extends CardImpl {
// Pyrotechnics deals 4 damage divided as you choose among any number of targets.
- this.getSpellAbility().addEffect(new DamageMultiEffect(4));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetAnyTargetAmount(4));
}
diff --git a/Mage.Sets/src/mage/cards/q/QuirionBeastcaller.java b/Mage.Sets/src/mage/cards/q/QuirionBeastcaller.java
index 3cb8f79460c..18d5aa5db0a 100644
--- a/Mage.Sets/src/mage/cards/q/QuirionBeastcaller.java
+++ b/Mage.Sets/src/mage/cards/q/QuirionBeastcaller.java
@@ -14,7 +14,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
-import mage.target.common.TargetPermanentAmount;
+import mage.target.common.TargetCreaturePermanentAmount;
/**
*
@@ -39,10 +39,8 @@ public final class QuirionBeastcaller extends CardImpl {
// When Quirion Beastcaller dies, distribute X +1/+1 counters among any number of target creatures you control, where X is the number of +1/+1 counters on Quirion Beastcaller.
Ability ability = new DiesSourceTriggeredAbility(new DistributeCountersEffect(
- // Amount here is only used for text generation. Real amount is set in target.
- 1, "any number of target creatures you control"
).setText("distribute X +1/+1 counters among any number of target creatures you control, where X is the number of +1/+1 counters on {this}"));
- ability.addTarget(new TargetPermanentAmount(new CountersSourceCount(CounterType.P1P1), StaticFilters.FILTER_CONTROLLED_CREATURES));
+ ability.addTarget(new TargetCreaturePermanentAmount(new CountersSourceCount(CounterType.P1P1), StaticFilters.FILTER_CONTROLLED_CREATURES));
this.addAbility(ability);
}
diff --git a/Mage.Sets/src/mage/cards/r/RalCallerOfStorms.java b/Mage.Sets/src/mage/cards/r/RalCallerOfStorms.java
index 97cf64715f1..1d050a8241e 100644
--- a/Mage.Sets/src/mage/cards/r/RalCallerOfStorms.java
+++ b/Mage.Sets/src/mage/cards/r/RalCallerOfStorms.java
@@ -40,7 +40,7 @@ public final class RalCallerOfStorms extends CardImpl {
));
// -2: Ral, Caller of Storms deals 3 damage divided as you choose among one, two, or three targets.
- Ability ability = new LoyaltyAbility(new DamageMultiEffect(3), -2);
+ Ability ability = new LoyaltyAbility(new DamageMultiEffect(), -2);
ability.addTarget(new TargetAnyTargetAmount(3));
this.addAbility(ability);
diff --git a/Mage.Sets/src/mage/cards/r/RalLeylineProdigy.java b/Mage.Sets/src/mage/cards/r/RalLeylineProdigy.java
index d0d24fb8de8..d5bd0c3d84c 100644
--- a/Mage.Sets/src/mage/cards/r/RalLeylineProdigy.java
+++ b/Mage.Sets/src/mage/cards/r/RalLeylineProdigy.java
@@ -75,7 +75,7 @@ public final class RalLeylineProdigy extends CardImpl {
this.addAbility(new LoyaltyAbility(new RalLeylineProdigyCostReductionEffect(), 1));
// -2: Ral deals 2 damage divided as you choose among one or two targets. Draw a card if you control a blue permanent other than Ral.
- Ability ability = new LoyaltyAbility(new DamageMultiEffect(2), -2);
+ Ability ability = new LoyaltyAbility(new DamageMultiEffect(), -2);
ability.addTarget(new TargetAnyTargetAmount(2));
ability.addEffect(new ConditionalOneShotEffect(
new DrawCardSourceControllerEffect(1),
diff --git a/Mage.Sets/src/mage/cards/r/RavenousGigantotherium.java b/Mage.Sets/src/mage/cards/r/RavenousGigantotherium.java
index 263d13b95db..eeaacab7a2b 100644
--- a/Mage.Sets/src/mage/cards/r/RavenousGigantotherium.java
+++ b/Mage.Sets/src/mage/cards/r/RavenousGigantotherium.java
@@ -73,13 +73,13 @@ class RavenousGigantotheriumAbility extends EntersBattlefieldTriggeredAbility {
}
int power = Math.max(permanent.getPower().getValue(), 0);
this.getEffects().clear();
- this.addEffect(new DamageMultiEffect(power));
+ this.addEffect(new DamageMultiEffect());
this.addEffect(new RavenousGigantotheriumEffect());
this.getTargets().clear();
if (power < 1) {
return true;
}
- this.addTarget(new TargetCreaturePermanentAmount(power));
+ this.addTarget(new TargetCreaturePermanentAmount(power, 0, power));
return true;
}
diff --git a/Mage.Sets/src/mage/cards/r/Remedy.java b/Mage.Sets/src/mage/cards/r/Remedy.java
index a8ac3d73ea9..ee2837a7ce7 100644
--- a/Mage.Sets/src/mage/cards/r/Remedy.java
+++ b/Mage.Sets/src/mage/cards/r/Remedy.java
@@ -19,7 +19,7 @@ public final class Remedy extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{W}");
- // Prevent the next 5 damage that would be dealt this turn to any number of target creatures and/or players, divided as you choose.
+ // Prevent the next 5 damage that would be dealt this turn to any number of targets, divided as you choose.
this.getSpellAbility().addEffect(new PreventDamageToTargetMultiAmountEffect(Duration.EndOfTurn, 5));
this.getSpellAbility().addTarget(new TargetAnyTargetAmount(5));
}
diff --git a/Mage.Sets/src/mage/cards/r/RockSlide.java b/Mage.Sets/src/mage/cards/r/RockSlide.java
index 72e8b3ddf5e..9ff56d7f9c1 100644
--- a/Mage.Sets/src/mage/cards/r/RockSlide.java
+++ b/Mage.Sets/src/mage/cards/r/RockSlide.java
@@ -30,7 +30,7 @@ public final class RockSlide extends CardImpl {
// Rock Slide deals X damage divided as you choose among any number of target attacking or blocking creatures without flying.
DynamicValue xValue = GetXValue.instance;
- this.getSpellAbility().addEffect(new DamageMultiEffect(xValue));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(xValue, filter));
}
diff --git a/Mage.Sets/src/mage/cards/r/RoilsRetribution.java b/Mage.Sets/src/mage/cards/r/RoilsRetribution.java
index d3ac9b51a63..dc0b863a96a 100644
--- a/Mage.Sets/src/mage/cards/r/RoilsRetribution.java
+++ b/Mage.Sets/src/mage/cards/r/RoilsRetribution.java
@@ -18,7 +18,7 @@ public final class RoilsRetribution extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{W}{W}");
// Roil's Retribution deals 5 damage divided as you choose among any number of target attacking or blocking creatures.
- this.getSpellAbility().addEffect(new DamageMultiEffect(5));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(5, StaticFilters.FILTER_ATTACKING_OR_BLOCKING_CREATURES));
}
diff --git a/Mage.Sets/src/mage/cards/r/RollingThunder.java b/Mage.Sets/src/mage/cards/r/RollingThunder.java
index c3fded58cdb..91e77c9cb19 100644
--- a/Mage.Sets/src/mage/cards/r/RollingThunder.java
+++ b/Mage.Sets/src/mage/cards/r/RollingThunder.java
@@ -20,7 +20,7 @@ public final class RollingThunder extends CardImpl {
// Rolling Thunder deals X damage divided as you choose among any number of targets.
DynamicValue xValue = GetXValue.instance;
- this.getSpellAbility().addEffect(new DamageMultiEffect(xValue));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetAnyTargetAmount(xValue));
}
diff --git a/Mage.Sets/src/mage/cards/s/SamutTheTested.java b/Mage.Sets/src/mage/cards/s/SamutTheTested.java
index 6d8a013c20d..118d7db9f74 100644
--- a/Mage.Sets/src/mage/cards/s/SamutTheTested.java
+++ b/Mage.Sets/src/mage/cards/s/SamutTheTested.java
@@ -45,7 +45,7 @@ public final class SamutTheTested extends CardImpl {
this.addAbility(ability);
// -2: Samut, the Tested deals 2 damage divided as you choose among one or two targets.
- effect = new DamageMultiEffect(2);
+ effect = new DamageMultiEffect();
ability = new LoyaltyAbility(effect, -2);
ability.addTarget(new TargetAnyTargetAmount(2));
this.addAbility(ability);
diff --git a/Mage.Sets/src/mage/cards/s/SerrasHymn.java b/Mage.Sets/src/mage/cards/s/SerrasHymn.java
index fc97f30a71b..2c3d583e6ed 100644
--- a/Mage.Sets/src/mage/cards/s/SerrasHymn.java
+++ b/Mage.Sets/src/mage/cards/s/SerrasHymn.java
@@ -12,7 +12,6 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
-import mage.constants.Zone;
import mage.counters.CounterType;
import mage.target.common.TargetAnyTargetAmount;
@@ -22,7 +21,7 @@ import mage.target.common.TargetAnyTargetAmount;
*/
public final class SerrasHymn extends CardImpl {
- private static final String rule = "Prevent the next X damage that would be dealt this turn to any number of target creatures and/or players, divided as you choose, where X is the number of verse counters on {this}.";
+ private static final String rule = "Prevent the next X damage that would be dealt this turn to any number of targets, divided as you choose, where X is the number of verse counters on {this}.";
public SerrasHymn(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{W}");
@@ -31,7 +30,7 @@ public final class SerrasHymn extends CardImpl {
this.addAbility(new BeginningOfUpkeepTriggeredAbility(
new AddCountersSourceEffect(CounterType.VERSE.createInstance(), true), true));
- // Sacrifice Serra's Hymn: Prevent the next X damage that would be dealt this turn to any number of target creatures and/or players, divided as you choose, where X is the number of verse counters on Serra's Hymn.
+ // Sacrifice Serra's Hymn: Prevent the next X damage that would be dealt this turn to any number of targets, divided as you choose, where X is the number of verse counters on Serra's Hymn.
Ability ability = new SimpleActivatedAbility(
new PreventDamageToTargetMultiAmountEffect(
Duration.EndOfTurn,
diff --git a/Mage.Sets/src/mage/cards/s/ShamblingSwarm.java b/Mage.Sets/src/mage/cards/s/ShamblingSwarm.java
index d3f9dc9c8f9..9aae9bfbf55 100644
--- a/Mage.Sets/src/mage/cards/s/ShamblingSwarm.java
+++ b/Mage.Sets/src/mage/cards/s/ShamblingSwarm.java
@@ -27,7 +27,7 @@ public final class ShamblingSwarm extends CardImpl {
// When Shambling Swarm dies, distribute three -1/-1 counters among one, two, or three target creatures. For each -1/-1 counter you put on a creature this way, remove a -1/-1 counter from that creature at the beginning of the next end step.
Ability ability = new DiesSourceTriggeredAbility(new DistributeCountersEffect(
- CounterType.M1M1, 3, "one, two, or three target creatures"
+ CounterType.M1M1
).withRemoveAtEndOfTurn(), false);
ability.addTarget(new TargetCreaturePermanentAmount(3));
this.addAbility(ability);
diff --git a/Mage.Sets/src/mage/cards/s/ShatterskullSmashing.java b/Mage.Sets/src/mage/cards/s/ShatterskullSmashing.java
index f7003404553..55e33b1e636 100644
--- a/Mage.Sets/src/mage/cards/s/ShatterskullSmashing.java
+++ b/Mage.Sets/src/mage/cards/s/ShatterskullSmashing.java
@@ -5,9 +5,6 @@ import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.condition.Condition;
import mage.abilities.costs.common.PayLifeCost;
import mage.abilities.decorator.ConditionalOneShotEffect;
-import mage.abilities.dynamicvalue.DynamicValue;
-import mage.abilities.dynamicvalue.MultipliedValue;
-import mage.abilities.dynamicvalue.common.GetXValue;
import mage.abilities.effects.common.DamageMultiEffect;
import mage.abilities.effects.common.TapSourceUnlessPaysEffect;
import mage.abilities.mana.RedManaAbility;
@@ -28,8 +25,6 @@ import java.util.UUID;
*/
public final class ShatterskullSmashing extends ModalDoubleFacedCard {
- private static final DynamicValue xValue = new MultipliedValue(GetXValue.instance, 2);
-
public ShatterskullSmashing(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo,
new CardType[]{CardType.SORCERY}, new SubType[]{}, "{X}{R}{R}",
@@ -42,7 +37,7 @@ public final class ShatterskullSmashing extends ModalDoubleFacedCard {
// Shatterskull Smashing deals X damage divided as you choose among up to two target creatures and/or planeswalkers. If X is 6 or more, Shatterskull Smashing deals twice X damage divided as you choose among them instead.
this.getLeftHalfCard().getSpellAbility().addEffect(new ConditionalOneShotEffect(
- new DamageMultiEffect(xValue), new DamageMultiEffect(GetXValue.instance),
+ new DamageMultiEffect(), new DamageMultiEffect(),
ShatterskullSmashingCondition.instance, "{this} deals X damage divided as you choose " +
"among up to two target creatures and/or planeswalkers. If X is 6 or more, " +
"{this} deals twice X damage divided as you choose among them instead."
@@ -90,12 +85,10 @@ enum ShatterskullSmashingAdjuster implements TargetAdjuster {
ability.getTargets().clear();
TargetAmount target;
if (CardUtil.getSourceCostsTag(game, ability, "X", 0) >= 6) {
- target = new TargetCreatureOrPlaneswalkerAmount(2 * CardUtil.getSourceCostsTag(game, ability, "X", 0));
+ target = new TargetCreatureOrPlaneswalkerAmount(2 * CardUtil.getSourceCostsTag(game, ability, "X", 0), 0, 2);
} else {
- target = new TargetCreatureOrPlaneswalkerAmount(CardUtil.getSourceCostsTag(game, ability, "X", 0));
+ target = new TargetCreatureOrPlaneswalkerAmount(CardUtil.getSourceCostsTag(game, ability, "X", 0), 0, 2);
}
- target.setMinNumberOfTargets(0);
- target.setMaxNumberOfTargets(2);
ability.addTarget(target);
}
}
diff --git a/Mage.Sets/src/mage/cards/s/SkarrganHellkite.java b/Mage.Sets/src/mage/cards/s/SkarrganHellkite.java
index 816e660ae3c..0e312aca483 100644
--- a/Mage.Sets/src/mage/cards/s/SkarrganHellkite.java
+++ b/Mage.Sets/src/mage/cards/s/SkarrganHellkite.java
@@ -38,7 +38,7 @@ public final class SkarrganHellkite extends CardImpl {
// {3}{R}: Skarrgan Hellkite deals 2 damage divided as you choose among one or two targets. Activate this ability only if Skarrgan Hellkite has a +1/+1 counter on it.
Ability ability = new ConditionalActivatedAbility(
- Zone.BATTLEFIELD, new DamageMultiEffect(2),
+ Zone.BATTLEFIELD, new DamageMultiEffect(),
new ManaCostsImpl<>("{3}{R}"), new SourceHasCounterCondition(CounterType.P1P1),
"{3}{R}: {this} deals 2 damage divided as you choose among one or two targets. " +
"Activate only if {this} has a +1/+1 counter on it."
diff --git a/Mage.Sets/src/mage/cards/s/SkirkVolcanist.java b/Mage.Sets/src/mage/cards/s/SkirkVolcanist.java
index 536733d44c2..c6a173a3eff 100644
--- a/Mage.Sets/src/mage/cards/s/SkirkVolcanist.java
+++ b/Mage.Sets/src/mage/cards/s/SkirkVolcanist.java
@@ -12,9 +12,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.common.FilterControlledLandPermanent;
-import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetCreaturePermanentAmount;
-import mage.target.common.TargetSacrifice;
/**
*
@@ -38,7 +36,7 @@ public final class SkirkVolcanist extends CardImpl {
this.addAbility(new MorphAbility(this, new SacrificeTargetCost(2, filter)));
// When Skirk Volcanist is turned face up, it deals 3 damage divided as you choose among one, two, or three target creatures.
- Ability ability = new TurnedFaceUpSourceTriggeredAbility(new DamageMultiEffect(3, "it"));
+ Ability ability = new TurnedFaceUpSourceTriggeredAbility(new DamageMultiEffect("it"));
ability.addTarget(new TargetCreaturePermanentAmount(3));
this.addAbility(ability);
}
diff --git a/Mage.Sets/src/mage/cards/s/SplendidAgony.java b/Mage.Sets/src/mage/cards/s/SplendidAgony.java
index b553a39d4a7..4db2104cf7d 100644
--- a/Mage.Sets/src/mage/cards/s/SplendidAgony.java
+++ b/Mage.Sets/src/mage/cards/s/SplendidAgony.java
@@ -19,7 +19,7 @@ public final class SplendidAgony extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{B}");
// Distribute two -1/-1 counters among one or two target creatures.
- getSpellAbility().addEffect(new DistributeCountersEffect(CounterType.M1M1, 2, "one or two target creatures"));
+ getSpellAbility().addEffect(new DistributeCountersEffect(CounterType.M1M1));
getSpellAbility().addTarget(new TargetCreaturePermanentAmount(2));
}
diff --git a/Mage.Sets/src/mage/cards/s/SpreadingFlames.java b/Mage.Sets/src/mage/cards/s/SpreadingFlames.java
index 133249d54d1..eb3243c635a 100644
--- a/Mage.Sets/src/mage/cards/s/SpreadingFlames.java
+++ b/Mage.Sets/src/mage/cards/s/SpreadingFlames.java
@@ -18,7 +18,7 @@ public final class SpreadingFlames extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{6}{R}");
// Spreading Flames deals 6 damage divided as you choose among any number of target creatures.
- this.getSpellAbility().addEffect(new DamageMultiEffect(6));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(6));
}
diff --git a/Mage.Sets/src/mage/cards/s/StormTheSeedcore.java b/Mage.Sets/src/mage/cards/s/StormTheSeedcore.java
index 39433a1b5d7..85c34246101 100644
--- a/Mage.Sets/src/mage/cards/s/StormTheSeedcore.java
+++ b/Mage.Sets/src/mage/cards/s/StormTheSeedcore.java
@@ -8,10 +8,8 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
-import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanentAmount;
-import mage.target.common.TargetPermanentAmount;
import java.util.UUID;
@@ -23,15 +21,10 @@ public final class StormTheSeedcore extends CardImpl {
public StormTheSeedcore(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{G}{G}");
- // Distribute four +1/+1 counter among up to four target creatures you control. Creatures you control gain vigilance and trample until end of turn.
- this.getSpellAbility().addEffect(new DistributeCountersEffect(
- 4,
- "up to four target creatures you control"
- ));
- TargetPermanentAmount target = new TargetCreaturePermanentAmount(4, StaticFilters.FILTER_CONTROLLED_CREATURES);
- target.setMinNumberOfTargets(0);
- target.setMaxNumberOfTargets(4);
- this.getSpellAbility().addTarget(target);
+ // Distribute four +1/+1 counters among up to four target creatures you control. Creatures you control gain vigilance and trample until end of turn.
+ this.getSpellAbility().addEffect(new DistributeCountersEffect()
+ .setText("distribute four +1/+1 counters among up to four target creatures you control"));
+ this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(4, StaticFilters.FILTER_CONTROLLED_CREATURES));
this.getSpellAbility().addEffect(new GainAbilityControlledEffect(
VigilanceAbility.getInstance(), Duration.EndOfTurn,
StaticFilters.FILTER_CONTROLLED_CREATURES
diff --git a/Mage.Sets/src/mage/cards/s/StumpsquallHydra.java b/Mage.Sets/src/mage/cards/s/StumpsquallHydra.java
index fa390531622..810734314ec 100644
--- a/Mage.Sets/src/mage/cards/s/StumpsquallHydra.java
+++ b/Mage.Sets/src/mage/cards/s/StumpsquallHydra.java
@@ -20,7 +20,7 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetAmount;
-import mage.target.common.TargetCreatureOrPlaneswalkerAmount;
+import mage.target.common.TargetPermanentAmount;
import java.util.UUID;
@@ -96,8 +96,7 @@ class StumpsquallHydraEffect extends OneShotEffect {
return false;
}
- TargetAmount targetAmount = new TargetCreatureOrPlaneswalkerAmount(xValue, filter);
- targetAmount.setMinNumberOfTargets(1);
+ TargetAmount targetAmount = new TargetPermanentAmount(xValue, 1, filter);
targetAmount.withNotTarget(true);
targetAmount.chooseTarget(outcome, player.getId(), source, game);
for (UUID targetId : targetAmount.getTargets()) {
diff --git a/Mage.Sets/src/mage/cards/s/SunderingStroke.java b/Mage.Sets/src/mage/cards/s/SunderingStroke.java
index 17fde8221a9..d4744fb24da 100644
--- a/Mage.Sets/src/mage/cards/s/SunderingStroke.java
+++ b/Mage.Sets/src/mage/cards/s/SunderingStroke.java
@@ -25,12 +25,12 @@ public final class SunderingStroke extends CardImpl {
// Sundering Stroke deals 7 damage divided as you choose among one, two, or three targets. If at least seven red mana was spent to cast this spell, instead Sundering Stroke deals 7 damage to each of those permanents and/or players.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
- new DamageTargetEffect(7), new DamageMultiEffect(7), SunderingStrokeCondtition.instance,
+ new DamageTargetEffect(7), new DamageMultiEffect(), SunderingStrokeCondtition.instance,
"{this} deals 7 damage divided as you choose among one, two, or three targets. " +
"If at least seven red mana was spent to cast this spell, " +
"instead {this} deals 7 damage to each of those permanents and/or players"
));
- this.getSpellAbility().addTarget(new TargetAnyTargetAmount(7, 3));
+ this.getSpellAbility().addTarget(new TargetAnyTargetAmount(7, 1, 3));
this.getSpellAbility().addHint(new StaticHint(
"(You have to choose how 7 damage is divided even if you spend seven red mana.)"
));
diff --git a/Mage.Sets/src/mage/cards/t/TheGrandEvolution.java b/Mage.Sets/src/mage/cards/t/TheGrandEvolution.java
index 49ae80faade..cfcde708afd 100644
--- a/Mage.Sets/src/mage/cards/t/TheGrandEvolution.java
+++ b/Mage.Sets/src/mage/cards/t/TheGrandEvolution.java
@@ -14,13 +14,12 @@ import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.*;
-import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetCard;
import mage.target.TargetPermanent;
-import mage.target.common.TargetPermanentAmount;
+import mage.target.common.TargetCreaturePermanentAmount;
import java.util.UUID;
@@ -45,10 +44,8 @@ public final class TheGrandEvolution extends CardImpl {
// II -- Distribute seven +1/+1 counters among any number of target creatures you control.
sagaAbility.addChapterEffect(
this, SagaChapter.CHAPTER_II, SagaChapter.CHAPTER_II,
- new DistributeCountersEffect(
- 7,
- "any number of target creatures you control"
- ), new TargetPermanentAmount(7, StaticFilters.FILTER_CONTROLLED_CREATURES)
+ new DistributeCountersEffect(),
+ new TargetCreaturePermanentAmount(7, StaticFilters.FILTER_CONTROLLED_CREATURES)
);
// III -- Until end of turn, creatures you control gain "{1}: This creature fights target creature you don't control." Exile The Grand Evolution, then return it to the battlefield.
diff --git a/Mage.Sets/src/mage/cards/t/TwinBolt.java b/Mage.Sets/src/mage/cards/t/TwinBolt.java
index bc9f455a484..6291a51a68d 100644
--- a/Mage.Sets/src/mage/cards/t/TwinBolt.java
+++ b/Mage.Sets/src/mage/cards/t/TwinBolt.java
@@ -17,7 +17,7 @@ public final class TwinBolt extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}");
// Twin Bolt deals 2 damage divided as you choose among one or two targets.
- this.getSpellAbility().addEffect(new DamageMultiEffect(2));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetAnyTargetAmount(2));
}
diff --git a/Mage.Sets/src/mage/cards/u/UndercityUpheaval.java b/Mage.Sets/src/mage/cards/u/UndercityUpheaval.java
index ea27f64da27..3fff4a7c64e 100644
--- a/Mage.Sets/src/mage/cards/u/UndercityUpheaval.java
+++ b/Mage.Sets/src/mage/cards/u/UndercityUpheaval.java
@@ -12,7 +12,6 @@ import mage.cards.CardSetInfo;
import mage.constants.AbilityWord;
import mage.constants.CardType;
import mage.constants.Duration;
-import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanentAmount;
@@ -30,7 +29,7 @@ public final class UndercityUpheaval extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{G}{G}");
// Undergrowth -- Distribute X +1/+1 counters among any number of target creatures you control, where X is the number of creature cards in your graveyard as you cast this spell. Creatures you control gain vigilance until end of turn.
- this.getSpellAbility().addEffect(new DistributeCountersEffect(1, "")
+ this.getSpellAbility().addEffect(new DistributeCountersEffect()
.setText("distribute X +1/+1 counters among any number of target creatures you control, " +
"where X is the number of creature cards in your graveyard as you cast this spell"));
this.getSpellAbility().addEffect(new GainAbilityControlledEffect(
diff --git a/Mage.Sets/src/mage/cards/u/UrzaAcademyHeadmaster.java b/Mage.Sets/src/mage/cards/u/UrzaAcademyHeadmaster.java
index 6032b4ee8c1..0b091865b6b 100644
--- a/Mage.Sets/src/mage/cards/u/UrzaAcademyHeadmaster.java
+++ b/Mage.Sets/src/mage/cards/u/UrzaAcademyHeadmaster.java
@@ -144,7 +144,7 @@ class UrzaAcademyHeadmasterRandomEffect extends OneShotEffect {
break;
case 2: // AJANI MENTOR OF HEROES 1
sb.append("Distribute three +1/+1 counters among one, two, or three target creatures you control.");
- effects.add(new DistributeCountersEffect(3, "one, two, or three target creatures you control"));
+ effects.add(new DistributeCountersEffect());
target = new TargetCreaturePermanentAmount(3, filter1);
break;
case 3: // NICOL BOLAS PLANESWALKER 1
diff --git a/Mage.Sets/src/mage/cards/v/VastwoodHydra.java b/Mage.Sets/src/mage/cards/v/VastwoodHydra.java
index 47057fdc8f3..e59fc7a16ee 100644
--- a/Mage.Sets/src/mage/cards/v/VastwoodHydra.java
+++ b/Mage.Sets/src/mage/cards/v/VastwoodHydra.java
@@ -88,8 +88,7 @@ class VastwoodHydraDistributeEffect extends OneShotEffect {
return false;
}
- TargetPermanentAmount target = new TargetCreaturePermanentAmount(amount, StaticFilters.FILTER_CONTROLLED_CREATURE);
- target.setMinNumberOfTargets(1);
+ TargetPermanentAmount target = new TargetCreaturePermanentAmount(amount, 0, amount, StaticFilters.FILTER_CONTROLLED_CREATURE);
target.withNotTarget(true);
target.withChooseHint("to distribute " + amount + " counters");
target.chooseTarget(outcome, player.getId(), source, game);
diff --git a/Mage.Sets/src/mage/cards/v/VerdurousGearhulk.java b/Mage.Sets/src/mage/cards/v/VerdurousGearhulk.java
index b17752c6191..d1dc069424b 100644
--- a/Mage.Sets/src/mage/cards/v/VerdurousGearhulk.java
+++ b/Mage.Sets/src/mage/cards/v/VerdurousGearhulk.java
@@ -10,7 +10,6 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanentAmount;
@@ -31,7 +30,7 @@ public final class VerdurousGearhulk extends CardImpl {
this.addAbility(TrampleAbility.getInstance());
// When Verdurous Gearhulk enters the battlefield, distribute four +1/+1 counters among any number of target creatures you control.
- Ability ability = new EntersBattlefieldTriggeredAbility(new DistributeCountersEffect(4, "any number of target creatures you control"), false);
+ Ability ability = new EntersBattlefieldTriggeredAbility(new DistributeCountersEffect(), false);
ability.addTarget(new TargetCreaturePermanentAmount(4, StaticFilters.FILTER_CONTROLLED_CREATURES));
this.addAbility(ability);
}
diff --git a/Mage.Sets/src/mage/cards/v/ViolentEruption.java b/Mage.Sets/src/mage/cards/v/ViolentEruption.java
index d5aac94e74e..4bbe8162cda 100644
--- a/Mage.Sets/src/mage/cards/v/ViolentEruption.java
+++ b/Mage.Sets/src/mage/cards/v/ViolentEruption.java
@@ -19,7 +19,7 @@ public final class ViolentEruption extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{R}{R}{R}");
// Violent Eruption deals 4 damage divided as you choose among any number of targets.
- this.getSpellAbility().addEffect(new DamageMultiEffect(4));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetAnyTargetAmount(4));
// Madness {1}{R}{R}
diff --git a/Mage.Sets/src/mage/cards/v/VivienArkbowRanger.java b/Mage.Sets/src/mage/cards/v/VivienArkbowRanger.java
index 44b54206a5a..27dcad1bf4b 100644
--- a/Mage.Sets/src/mage/cards/v/VivienArkbowRanger.java
+++ b/Mage.Sets/src/mage/cards/v/VivienArkbowRanger.java
@@ -14,7 +14,6 @@ import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.SuperType;
-import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreatureOrPlaneswalker;
@@ -35,16 +34,13 @@ public final class VivienArkbowRanger extends CardImpl {
this.setStartingLoyalty(4);
// +1: Distribute two +1/+1 counters among up to two target creatures. They gain trample until end of turn.
- Ability ability = new LoyaltyAbility(new DistributeCountersEffect(
- 2, "up to two target creatures"), 1);
+ Ability ability = new LoyaltyAbility(new DistributeCountersEffect()
+ .setText("distribute two +1/+1 counters among up to two target creatures"), 1);
ability.addEffect(new GainAbilityTargetEffect(
TrampleAbility.getInstance(), Duration.EndOfTurn,
"They gain trample until end of turn"
));
- TargetCreaturePermanentAmount target = new TargetCreaturePermanentAmount(2);
- target.setMinNumberOfTargets(0);
- target.setMaxNumberOfTargets(2);
- ability.addTarget(target);
+ ability.addTarget(new TargetCreaturePermanentAmount(2, 0, 2));
this.addAbility(ability);
// −3: Target creature you control deals damage equal to its power to target creature or planeswalker.
diff --git a/Mage.Sets/src/mage/cards/v/VolcanicWind.java b/Mage.Sets/src/mage/cards/v/VolcanicWind.java
index 495b083e130..6eea593fff4 100644
--- a/Mage.Sets/src/mage/cards/v/VolcanicWind.java
+++ b/Mage.Sets/src/mage/cards/v/VolcanicWind.java
@@ -25,7 +25,7 @@ public final class VolcanicWind extends CardImpl {
// Volcanic Wind deals X damage divided as you choose among any number of target creatures, where X is the number of creatures as you cast Volcanic Wind.
PermanentsOnBattlefieldCount creatures = new PermanentsOnBattlefieldCount(filter, null);
- Effect effect = new DamageMultiEffect(creatures);
+ Effect effect = new DamageMultiEffect();
effect.setText(rule);
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(creatures));
diff --git a/Mage.Sets/src/mage/cards/v/VolleyOfBoulders.java b/Mage.Sets/src/mage/cards/v/VolleyOfBoulders.java
index a5d545f66f1..ae3faa99e8a 100644
--- a/Mage.Sets/src/mage/cards/v/VolleyOfBoulders.java
+++ b/Mage.Sets/src/mage/cards/v/VolleyOfBoulders.java
@@ -7,7 +7,6 @@ import mage.abilities.keyword.FlashbackAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.TimingRule;
import mage.target.common.TargetAnyTargetAmount;
/**
@@ -20,7 +19,7 @@ public final class VolleyOfBoulders extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{8}{R}");
// Volley of Boulders deals 6 damage divided as you choose among any number of targets.
- this.getSpellAbility().addEffect(new DamageMultiEffect(6));
+ this.getSpellAbility().addEffect(new DamageMultiEffect());
this.getSpellAbility().addTarget(new TargetAnyTargetAmount(6));
// Flashback {R}{R}{R}{R}{R}{R}
this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{R}{R}{R}{R}{R}{R}")));
diff --git a/Mage.Sets/src/mage/cards/w/WurmskinForger.java b/Mage.Sets/src/mage/cards/w/WurmskinForger.java
index 88a1b282c0d..67689ee8c74 100644
--- a/Mage.Sets/src/mage/cards/w/WurmskinForger.java
+++ b/Mage.Sets/src/mage/cards/w/WurmskinForger.java
@@ -10,7 +10,6 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.counters.CounterType;
import mage.target.common.TargetCreaturePermanentAmount;
/**
@@ -27,7 +26,7 @@ public final class WurmskinForger extends CardImpl {
this.toughness = new MageInt(2);
// When Wurmskin Forger enters the battlefield, distribute three +1/+1 counters among one, two, or three target creatures.
- Ability ability = new EntersBattlefieldTriggeredAbility(new DistributeCountersEffect(3, "one, two, or three target creatures"), false);
+ Ability ability = new EntersBattlefieldTriggeredAbility(new DistributeCountersEffect(), false);
ability.addTarget(new TargetCreaturePermanentAmount(3));
this.addAbility(ability);
}
diff --git a/Mage.Sets/src/mage/cards/y/YannikScavengingSentinel.java b/Mage.Sets/src/mage/cards/y/YannikScavengingSentinel.java
index 648aa7cecc1..9c4997e3944 100644
--- a/Mage.Sets/src/mage/cards/y/YannikScavengingSentinel.java
+++ b/Mage.Sets/src/mage/cards/y/YannikScavengingSentinel.java
@@ -13,7 +13,6 @@ import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
-import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
@@ -99,11 +98,11 @@ class YannikScavengingSentinelEffect extends OneShotEffect {
game.addDelayedTriggeredAbility(new OnLeaveReturnExiledAbility(), source);
if (game.getState().getZone(permanent.getId()) != Zone.BATTLEFIELD) {
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(
- new DistributeCountersEffect(power, ""), false,
+ new DistributeCountersEffect(), false,
"distribute X +1/+1 counters among any number of target creatures, " +
"where X is the exiled creature's power"
);
- ability.addTarget(new TargetCreaturePermanentAmount(power));
+ ability.addTarget(new TargetCreaturePermanentAmount(power, 0, power));
game.fireReflexiveTriggeredAbility(ability, source);
}
return true;
diff --git a/Mage.Tests/src/test/java/org/mage/test/AI/basic/TargetPriorityTest.java b/Mage.Tests/src/test/java/org/mage/test/AI/basic/TargetPriorityTest.java
index d84216dc63c..17dc5e580e3 100644
--- a/Mage.Tests/src/test/java/org/mage/test/AI/basic/TargetPriorityTest.java
+++ b/Mage.Tests/src/test/java/org/mage/test/AI/basic/TargetPriorityTest.java
@@ -223,8 +223,8 @@ public class TargetPriorityTest extends CardTestPlayerBaseAI {
@Test
public void test_targetAmount_NormalCase() {
- Ability ability = new SimpleActivatedAbility(Zone.ALL, new DamageMultiEffect(3), new ManaCostsImpl<>("{R}"));
- ability.addTarget(new TargetCreaturePermanentAmount(3));
+ Ability ability = new SimpleActivatedAbility(Zone.ALL, new DamageMultiEffect(), new ManaCostsImpl<>("{R}"));
+ ability.addTarget(new TargetCreaturePermanentAmount(3, 0, 3));
addCustomCardWithAbility("damage 3", playerA, ability);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
//
@@ -250,8 +250,8 @@ public class TargetPriorityTest extends CardTestPlayerBaseAI {
public void test_targetAmount_BadCase() {
// choose targets as enters battlefield (e.g. can't be canceled)
SpellAbility spell = new SpellAbility(new ManaCostsImpl<>("{R}"), "damage 3", Zone.HAND);
- Ability ability = new EntersBattlefieldTriggeredAbility(new DamageMultiEffect(3));
- ability.addTarget(new TargetCreaturePermanentAmount(3));
+ Ability ability = new EntersBattlefieldTriggeredAbility(new DamageMultiEffect());
+ ability.addTarget(new TargetCreaturePermanentAmount(3, 0, 3));
addCustomCardWithSpell(playerA, spell, ability, CardType.ENCHANTMENT);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
//
@@ -283,8 +283,8 @@ public class TargetPriorityTest extends CardTestPlayerBaseAI {
public void test_targetAmount_Performance() {
int cardsMultiplier = 3;
- Ability ability = new SimpleActivatedAbility(Zone.ALL, new DamageMultiEffect(3), new ManaCostsImpl<>("{R}"));
- ability.addTarget(new TargetCreaturePermanentAmount(3));
+ Ability ability = new SimpleActivatedAbility(Zone.ALL, new DamageMultiEffect(), new ManaCostsImpl<>("{R}"));
+ ability.addTarget(new TargetCreaturePermanentAmount(3, 0, 3));
addCustomCardWithAbility("damage 3", playerA, ability);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
//
diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/AnimateDeadTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/AnimateDeadTest.java
index 3aaa6ead773..b5dcb5310e1 100644
--- a/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/AnimateDeadTest.java
+++ b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/AnimateDeadTest.java
@@ -3,6 +3,7 @@ package org.mage.test.cards.enchantments;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
+import org.mage.test.player.TestPlayer;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
@@ -192,6 +193,7 @@ public class AnimateDeadTest extends CardTestPlayerBase {
addCard(Zone.GRAVEYARD, playerB, "Dragonlord Atarka", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Animate Dead", "Dragonlord Atarka");
+ addTarget(playerA, TestPlayer.TARGET_SKIP);
setStopAt(2, PhaseStep.BEGIN_COMBAT);
execute();
diff --git a/Mage/src/main/java/mage/abilities/effects/common/DamageMultiEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DamageMultiEffect.java
index 653be78f3e7..c6d78cee01b 100644
--- a/Mage/src/main/java/mage/abilities/effects/common/DamageMultiEffect.java
+++ b/Mage/src/main/java/mage/abilities/effects/common/DamageMultiEffect.java
@@ -4,13 +4,13 @@ import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.dynamicvalue.DynamicValue;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.Target;
+import mage.target.TargetAmount;
import java.util.*;
@@ -19,32 +19,21 @@ import java.util.*;
*/
public class DamageMultiEffect extends OneShotEffect {
- protected DynamicValue amount;
private String sourceName = "{this}";
private final Set damagedSet = new HashSet<>();
- public DamageMultiEffect(int amount) {
- this(StaticValue.get(amount));
- }
-
- public DamageMultiEffect(int amount, String whoDealDamageName) {
- this(StaticValue.get(amount), whoDealDamageName);
- }
-
- public DamageMultiEffect(DynamicValue amount, String whoDealDamageName) {
- this(amount);
- this.sourceName = whoDealDamageName;
- }
-
- public DamageMultiEffect(DynamicValue amount) {
+ public DamageMultiEffect() {
super(Outcome.Damage);
- this.amount = amount;
+ }
+
+ public DamageMultiEffect(String whoDealDamageName) {
+ super(Outcome.Damage);
+ this.sourceName = whoDealDamageName;
}
protected DamageMultiEffect(final DamageMultiEffect effect) {
super(effect);
this.damagedSet.addAll(effect.damagedSet);
- this.amount = effect.amount;
this.sourceName = effect.sourceName;
}
@@ -84,16 +73,16 @@ public class DamageMultiEffect extends OneShotEffect {
StringBuilder sb = new StringBuilder(sourceName);
sb.append(" deals ");
- String amountString = amount.toString();
- sb.append(amountString);
- sb.append(" damage divided as you choose among ");
- sb.append(amountString.equals("2") ? "one or two " : amountString.equals("3") ? "one, two, or three " : "any number of ");
-
- String targetName = mode.getTargets().get(0).getTargetName();
- if (!targetName.contains("target")) {
- sb.append("target ");
+ Target target = mode.getTargets().get(0);
+ if (!(target instanceof TargetAmount)) {
+ throw new IllegalStateException("Must use TargetAmount");
}
- sb.append(targetName);
+ TargetAmount targetAmount = (TargetAmount) target;
+
+ DynamicValue amount = targetAmount.getAmount();
+ sb.append(amount.toString());
+ sb.append(" damage divided as you choose among ");
+ sb.append(targetAmount.getDescription());
return sb.toString();
}
diff --git a/Mage/src/main/java/mage/abilities/effects/common/counter/DistributeCountersEffect.java b/Mage/src/main/java/mage/abilities/effects/common/counter/DistributeCountersEffect.java
index d1ee03ce613..30620d8c69d 100644
--- a/Mage/src/main/java/mage/abilities/effects/common/counter/DistributeCountersEffect.java
+++ b/Mage/src/main/java/mage/abilities/effects/common/counter/DistributeCountersEffect.java
@@ -12,6 +12,7 @@ import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.Target;
+import mage.target.TargetAmount;
import mage.util.CardUtil;
import java.util.UUID;
@@ -22,34 +23,24 @@ import java.util.UUID;
public class DistributeCountersEffect extends OneShotEffect {
private final CounterType counterType;
- private final DynamicValue amount;
private boolean removeAtEndOfTurn = false;
- private final String targetDescription;
/**
* Distribute +1/+1 counters among targets
*/
- public DistributeCountersEffect(int amount, String targetDescription) {
- this(CounterType.P1P1, StaticValue.get(amount), targetDescription);
+ public DistributeCountersEffect() {
+ this(CounterType.P1P1);
}
- public DistributeCountersEffect(CounterType counterType, int amount, String targetDescription) {
- this(counterType, StaticValue.get(amount), targetDescription);
- }
-
- public DistributeCountersEffect(CounterType counterType, DynamicValue amount, String targetDescription) {
+ public DistributeCountersEffect(CounterType counterType) {
super(Outcome.BoostCreature);
this.counterType = counterType;
- this.amount = amount;
- this.targetDescription = targetDescription;
}
protected DistributeCountersEffect(final DistributeCountersEffect effect) {
super(effect);
this.counterType = effect.counterType;
- this.amount = effect.amount;
this.removeAtEndOfTurn = effect.removeAtEndOfTurn;
- this.targetDescription = effect.targetDescription;
}
@Override
@@ -90,9 +81,16 @@ public class DistributeCountersEffect extends OneShotEffect {
if (staticText != null && !staticText.isEmpty()) {
return staticText;
}
+ Target target = mode.getTargets().get(0);
+ if (!(target instanceof TargetAmount)) {
+ throw new IllegalStateException("Must use TargetAmount");
+ }
+ TargetAmount targetAmount = (TargetAmount) target;
+ DynamicValue amount = targetAmount.getAmount();
+
String name = counterType.getName();
String number = (amount instanceof StaticValue) ? CardUtil.numberToText(((StaticValue) amount).getValue()) : amount.toString();
- String text = "distribute " + number + ' ' + name + " counters among " + targetDescription;
+ String text = "distribute " + number + ' ' + name + " counters among " + targetAmount.getDescription();
if (removeAtEndOfTurn) {
text += ". For each " + name + " counter you put on a creature this way, remove a "
+ name + " counter from that creature at the beginning of the next cleanup step.";
diff --git a/Mage/src/main/java/mage/target/TargetAmount.java b/Mage/src/main/java/mage/target/TargetAmount.java
index 6bd1e51c510..68107f825a8 100644
--- a/Mage/src/main/java/mage/target/TargetAmount.java
+++ b/Mage/src/main/java/mage/target/TargetAmount.java
@@ -2,6 +2,7 @@ package mage.target;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
+import mage.abilities.dynamicvalue.common.StaticValue;
import mage.constants.Outcome;
import mage.game.Game;
import mage.players.Player;
@@ -18,8 +19,10 @@ public abstract class TargetAmount extends TargetImpl {
DynamicValue amount;
int remainingAmount;
- protected TargetAmount(DynamicValue amount) {
+ protected TargetAmount(DynamicValue amount, int minNumberOfTargets, int maxNumberOfTargets) {
this.amount = amount;
+ setMinNumberOfTargets(minNumberOfTargets);
+ setMaxNumberOfTargets(maxNumberOfTargets);
}
protected TargetAmount(final TargetAmount target) {
@@ -65,6 +68,10 @@ public abstract class TargetAmount extends TargetImpl {
amountWasSet = true;
}
+ public DynamicValue getAmount() {
+ return amount;
+ }
+
public int getAmountTotal(Game game, Ability source) {
return amount.calculate(game, source, null);
}
@@ -176,4 +183,24 @@ public abstract class TargetAmount extends TargetImpl {
remainingAmount -= (amount - this.getTargetAmount(targetId));
this.setTargetAmount(targetId, amount, game);
}
+
+ @Override
+ protected boolean getUseAnyNumber() {
+ int min = getMinNumberOfTargets();
+ int max = getMaxNumberOfTargets();
+ if (min != 0) {
+ return false;
+ }
+ if (max == Integer.MAX_VALUE) {
+ return true;
+ }
+ // For a TargetAmount with a min of 0:
+ // A max that equals the amount, when the amount is a StaticValue,
+ // usually represents "any number of target __s", since you can't target more than the amount.
+ //
+ // 601.2d. If the spell requires the player to divide or distribute an effect
+ // (such as damage or counters) among one or more targets, the player announces the division.
+ // Each of these targets must receive at least one of whatever is being divided.
+ return amount instanceof StaticValue && max == ((StaticValue) amount).getValue();
+ }
}
diff --git a/Mage/src/main/java/mage/target/TargetImpl.java b/Mage/src/main/java/mage/target/TargetImpl.java
index 12386ee5180..1a937a54ef4 100644
--- a/Mage/src/main/java/mage/target/TargetImpl.java
+++ b/Mage/src/main/java/mage/target/TargetImpl.java
@@ -109,17 +109,22 @@ public abstract class TargetImpl implements Target {
sb.append(" or more ");
} else if (!targetName.startsWith("X ") && (min != 1 || max != 1)) {
targetName = targetName.replace("another", "other"); //If non-singular, use "other" instead of "another"
- if (min < max && max != Integer.MAX_VALUE) {
- if (min == 1 && max == 2) {
- sb.append("one or ");
- } else if (min == 1 && max == 3) {
- sb.append("one, two, or ");
- } else {
- sb.append("up to ");
+
+ if (getUseAnyNumber()) {
+ sb.append(("any number of "));
+ } else {
+ if (min < max && max != Integer.MAX_VALUE) {
+ if (min == 1 && max == 2) {
+ sb.append("one or ");
+ } else if (min == 1 && max == 3) {
+ sb.append("one, two, or ");
+ } else {
+ sb.append("up to ");
+ }
}
+ sb.append(CardUtil.numberToText(max));
+ sb.append(' ');
}
- sb.append(CardUtil.numberToText(max));
- sb.append(' ');
}
boolean addTargetWord = false;
if (!isNotTarget()) {
@@ -127,7 +132,8 @@ public abstract class TargetImpl implements Target {
if (targetName.contains("target ")) {
addTargetWord = false;
} else if (targetName.endsWith("any target")
- || targetName.endsWith("any other target")) {
+ || targetName.endsWith("any other target")
+ || targetName.endsWith("targets")) {
addTargetWord = false;
}
// endsWith needs to be specific.
@@ -144,6 +150,15 @@ public abstract class TargetImpl implements Target {
return sb.toString();
}
+ /**
+ * Used for generating text description. Needed so that subclasses may override.
+ */
+ protected boolean getUseAnyNumber() {
+ int min = getMinNumberOfTargets();
+ int max = getMaxNumberOfTargets();
+ return min == 0 && max == Integer.MAX_VALUE;
+ }
+
@Override
public String getMessage(Game game) {
// UI choose message
diff --git a/Mage/src/main/java/mage/target/common/TargetAnyTargetAmount.java b/Mage/src/main/java/mage/target/common/TargetAnyTargetAmount.java
index 8132871fd93..0e7173c81c5 100644
--- a/Mage/src/main/java/mage/target/common/TargetAnyTargetAmount.java
+++ b/Mage/src/main/java/mage/target/common/TargetAnyTargetAmount.java
@@ -14,25 +14,45 @@ public class TargetAnyTargetAmount extends TargetPermanentOrPlayerAmount {
private static final FilterPermanentOrPlayer defaultFilter
= new FilterAnyTarget("targets");
+ /**
+ * IMPORTANT: Use more specific constructor if {@code amount} is not always the same number!
+ * {@code minNumberOfTargets} defaults to zero for {@code amount} > 3, otherwise to one, in line with typical templating.
+ * {@code maxNumberOfTargets} defaults to {@code amount}.
+ *
+ * @see TargetAnyTargetAmount#TargetAnyTargetAmount(int, int, int)
+ */
public TargetAnyTargetAmount(int amount) {
- this(amount, 0);
+ this(amount, amount > 3 ? 0 : 1, amount);
}
- public TargetAnyTargetAmount(int amount, int maxNumberOfTargets) {
- // 107.1c If a rule or ability instructs a player to choose “any number,” that player may choose
- // any positive number or zero, unless something (such as damage or counters) is being divided
- // or distributed among “any number” of players and/or objects. In that case, a nonzero number
- // of players and/or objects must be chosen if possible.
- this(StaticValue.get(amount), maxNumberOfTargets);
- this.minNumberOfTargets = 1;
+ /**
+ * @param amount Amount of stuff (e.g. damage) to distribute.
+ * @param minNumberOfTargets Minimum number of targets.
+ * @param maxNumberOfTargets Maximum number of targets. Should be set to {@code amount} if no lower max is needed.
+ */
+ public TargetAnyTargetAmount(int amount, int minNumberOfTargets, int maxNumberOfTargets) {
+ this(StaticValue.get(amount), minNumberOfTargets, maxNumberOfTargets);
}
+ /**
+ * {@code minNumberOfTargets} defaults to zero.
+ * {@code maxNumberOfTargets} defaults to Integer.MAX_VALUE.
+ *
+ * @see TargetAnyTargetAmount#TargetAnyTargetAmount(DynamicValue, int, int)
+ */
public TargetAnyTargetAmount(DynamicValue amount) {
- this(amount, 0);
+ this(amount, 0, Integer.MAX_VALUE);
}
- public TargetAnyTargetAmount(DynamicValue amount, int maxNumberOfTargets) {
- super(amount, maxNumberOfTargets);
+ /**
+ * @param amount Amount of stuff (e.g. damage) to distribute.
+ * @param minNumberOfTargets Minimum number of targets.
+ * @param maxNumberOfTargets Maximum number of targets. Since {@code amount} is dynamic,
+ * should be set to Integer.MAX_VALUE if no lower max is needed.
+ * (Game will always prevent choosing more than {@code amount} targets.)
+ */
+ public TargetAnyTargetAmount(DynamicValue amount, int minNumberOfTargets, int maxNumberOfTargets) {
+ super(amount, minNumberOfTargets, maxNumberOfTargets);
this.zone = Zone.ALL;
this.filter = defaultFilter;
this.targetName = filter.getMessage();
diff --git a/Mage/src/main/java/mage/target/common/TargetCreatureOrPlaneswalkerAmount.java b/Mage/src/main/java/mage/target/common/TargetCreatureOrPlaneswalkerAmount.java
index 4932e92cb47..a508ead9533 100644
--- a/Mage/src/main/java/mage/target/common/TargetCreatureOrPlaneswalkerAmount.java
+++ b/Mage/src/main/java/mage/target/common/TargetCreatureOrPlaneswalkerAmount.java
@@ -1,6 +1,6 @@
package mage.target.common;
-import mage.filter.FilterPermanent;
+import mage.filter.common.FilterControlledCreatureOrPlaneswalkerPermanent;
import mage.filter.common.FilterCreatureOrPlaneswalkerPermanent;
/**
@@ -11,12 +11,62 @@ public class TargetCreatureOrPlaneswalkerAmount extends TargetPermanentAmount {
private static final FilterCreatureOrPlaneswalkerPermanent defaultFilter
= new FilterCreatureOrPlaneswalkerPermanent("target creatures and/or planeswalkers");
+ /**
+ * IMPORTANT: Use more specific constructor if {@code amount} is not always the same number!
+ * {@code minNumberOfTargets} defaults to zero for {@code amount} > 3, otherwise to one, in line with typical templating.
+ * {@code maxNumberOfTargets} defaults to {@code amount}.
+ * {@code filter} defaults to all creature and planeswalker permanents. ("target creatures and/or planeswalkers")
+ *
+ * @see TargetCreatureOrPlaneswalkerAmount#TargetCreatureOrPlaneswalkerAmount(int, int, int, FilterCreatureOrPlaneswalkerPermanent)
+ */
public TargetCreatureOrPlaneswalkerAmount(int amount) {
- super(amount, defaultFilter);
+ this(amount, defaultFilter);
}
- public TargetCreatureOrPlaneswalkerAmount(int amount, FilterPermanent filter) {
- super(amount, filter);
+ /**
+ * IMPORTANT: Use more specific constructor if {@code amount} is not always the same number!
+ * {@code minNumberOfTargets} defaults to zero for {@code amount} > 3, otherwise to one, in line with typical templating.
+ * {@code maxNumberOfTargets} defaults to {@code amount}.
+ *
+ * @see TargetCreatureOrPlaneswalkerAmount#TargetCreatureOrPlaneswalkerAmount(int, int, int, FilterCreatureOrPlaneswalkerPermanent)
+ */
+ public TargetCreatureOrPlaneswalkerAmount(int amount, FilterCreatureOrPlaneswalkerPermanent filter) {
+ this(amount, amount > 3 ? 0 : 1, amount, filter);
+ }
+
+ /**
+ * {@code filter} defaults to all creature and planeswalker permanents. ("target creatures and/or planeswalkers")
+ *
+ * @see TargetCreatureOrPlaneswalkerAmount#TargetCreatureOrPlaneswalkerAmount(int, int, int, FilterCreatureOrPlaneswalkerPermanent)
+ */
+ public TargetCreatureOrPlaneswalkerAmount(int amount, int minNumberOfTargets, int maxNumberOfTargets) {
+ this(amount, minNumberOfTargets, maxNumberOfTargets, defaultFilter);
+ }
+
+ /**
+ * @param amount Amount of stuff (e.g. damage, counters) to distribute.
+ * @param minNumberOfTargets Minimum number of targets.
+ * @param maxNumberOfTargets Maximum number of targets. If no lower max is needed, set to {@code amount}.
+ * @param filter Filter for creatures and/or planeswalkers that something will be distributed amongst.
+ */
+ public TargetCreatureOrPlaneswalkerAmount(int amount, int minNumberOfTargets, int maxNumberOfTargets, FilterCreatureOrPlaneswalkerPermanent filter) {
+ super(amount, minNumberOfTargets, maxNumberOfTargets, filter);
+ }
+
+ /**
+ * IMPORTANT: Use more specific constructor if {@code amount} is not always the same number!
+ *
+ * @see TargetCreatureOrPlaneswalkerAmount#TargetCreatureOrPlaneswalkerAmount(int, FilterCreatureOrPlaneswalkerPermanent)
+ */
+ public TargetCreatureOrPlaneswalkerAmount(int amount, FilterControlledCreatureOrPlaneswalkerPermanent filter) {
+ this(amount, amount > 3 ? 0 : 1, amount, filter);
+ }
+
+ /**
+ * @see TargetCreatureOrPlaneswalkerAmount#TargetCreatureOrPlaneswalkerAmount(int, int, int, FilterCreatureOrPlaneswalkerPermanent)
+ */
+ public TargetCreatureOrPlaneswalkerAmount(int amount, int minNumberOfTargets, int maxNumberOfTargets, FilterControlledCreatureOrPlaneswalkerPermanent filter) {
+ super(amount, minNumberOfTargets, maxNumberOfTargets, filter);
}
private TargetCreatureOrPlaneswalkerAmount(final TargetCreatureOrPlaneswalkerAmount target) {
diff --git a/Mage/src/main/java/mage/target/common/TargetCreaturePermanentAmount.java b/Mage/src/main/java/mage/target/common/TargetCreaturePermanentAmount.java
index 3367668ccce..143d6f75b55 100644
--- a/Mage/src/main/java/mage/target/common/TargetCreaturePermanentAmount.java
+++ b/Mage/src/main/java/mage/target/common/TargetCreaturePermanentAmount.java
@@ -1,7 +1,7 @@
package mage.target.common;
import mage.abilities.dynamicvalue.DynamicValue;
-import mage.filter.FilterPermanent;
+import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent;
/**
@@ -11,20 +11,88 @@ public class TargetCreaturePermanentAmount extends TargetPermanentAmount {
private static final FilterCreaturePermanent defaultFilter = new FilterCreaturePermanent("target creatures");
+ /**
+ * IMPORTANT: Use more specific constructor if {@code amount} is not always the same number!
+ * {@code minNumberOfTargets} defaults to zero for {@code amount} > 3, otherwise to one, in line with typical templating.
+ * {@code maxNumberOfTargets} defaults to {@code amount}.
+ * {@code filter} defaults to all creature permanents. ("target creatures")
+ *
+ * @see TargetCreaturePermanentAmount#TargetCreaturePermanentAmount(int, int, int, FilterCreaturePermanent)
+ */
public TargetCreaturePermanentAmount(int amount) {
- super(amount, defaultFilter);
+ this(amount, defaultFilter);
}
+ /**
+ * IMPORTANT: Use more specific constructor if {@code amount} is not always the same number!
+ * {@code minNumberOfTargets} defaults to zero for {@code amount} > 3, otherwise to one, in line with typical templating.
+ * {@code maxNumberOfTargets} defaults to {@code amount}.
+ *
+ * @see TargetCreaturePermanentAmount#TargetCreaturePermanentAmount(int, int, int, FilterCreaturePermanent)
+ */
+ public TargetCreaturePermanentAmount(int amount, FilterCreaturePermanent filter) {
+ this(amount, amount > 3 ? 0 : 1, amount, filter);
+ }
+
+ /**
+ * {@code filter} defaults to all creature permanents. ("target creatures")
+ *
+ * @see TargetCreaturePermanentAmount#TargetCreaturePermanentAmount(int, int, int, FilterCreaturePermanent)
+ */
+ public TargetCreaturePermanentAmount(int amount, int minNumberOfTargets, int maxNumberOfTargets) {
+ this(amount, minNumberOfTargets, maxNumberOfTargets, defaultFilter);
+ }
+
+ /**
+ * @param amount Amount of stuff (e.g. damage, counters) to distribute.
+ * @param minNumberOfTargets Minimum number of targets.
+ * @param maxNumberOfTargets Maximum number of targets. If no lower max is needed, set to {@code amount}.
+ * @param filter Filter for creatures that something will be distributed amongst.
+ */
+ public TargetCreaturePermanentAmount(int amount, int minNumberOfTargets, int maxNumberOfTargets, FilterCreaturePermanent filter) {
+ super(amount, minNumberOfTargets, maxNumberOfTargets, filter);
+ }
+
+ /**
+ * {@code filter} defaults to all creature permanents. ("target creatures")
+ *
+ * @see TargetCreaturePermanentAmount#TargetCreaturePermanentAmount(DynamicValue, FilterCreaturePermanent)
+ */
public TargetCreaturePermanentAmount(DynamicValue amount) {
this(amount, defaultFilter);
}
- public TargetCreaturePermanentAmount(int amount, FilterPermanent filter) {
- super(amount, filter);
+ /**
+ * Minimum number of targets will be zero, and max will be set to Integer.MAX_VALUE.
+ *
+ * @param amount Amount of stuff (e.g. damage, counters) to distribute.
+ * @param filter Filter for creatures that something will be distributed amongst.
+ */
+ public TargetCreaturePermanentAmount(DynamicValue amount, FilterCreaturePermanent filter) {
+ super(amount, 0, filter);
}
- public TargetCreaturePermanentAmount(DynamicValue amount, FilterPermanent filter) {
- super(amount, filter);
+ /**
+ * IMPORTANT: Use more specific constructor if {@code amount} is not always the same number!
+ *
+ * @see TargetCreaturePermanentAmount#TargetCreaturePermanentAmount(int, FilterCreaturePermanent)
+ */
+ public TargetCreaturePermanentAmount(int amount, FilterControlledCreaturePermanent filter) {
+ this(amount, amount > 3 ? 0 : 1, amount, filter);
+ }
+
+ /**
+ * @see TargetCreaturePermanentAmount#TargetCreaturePermanentAmount(int, int, int, FilterCreaturePermanent)
+ */
+ public TargetCreaturePermanentAmount(int amount, int minNumberOfTargets, int maxNumberOfTargets, FilterControlledCreaturePermanent filter) {
+ super(amount, minNumberOfTargets, maxNumberOfTargets, filter);
+ }
+
+ /**
+ * @see TargetCreaturePermanentAmount#TargetCreaturePermanentAmount(DynamicValue, FilterCreaturePermanent)
+ */
+ public TargetCreaturePermanentAmount(DynamicValue amount, FilterControlledCreaturePermanent filter) {
+ super(amount, 0, filter);
}
private TargetCreaturePermanentAmount(final TargetCreaturePermanentAmount target) {
diff --git a/Mage/src/main/java/mage/target/common/TargetPermanentAmount.java b/Mage/src/main/java/mage/target/common/TargetPermanentAmount.java
index daac1cbc93b..9525f7b11cc 100644
--- a/Mage/src/main/java/mage/target/common/TargetPermanentAmount.java
+++ b/Mage/src/main/java/mage/target/common/TargetPermanentAmount.java
@@ -5,7 +5,6 @@ import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.constants.Zone;
-import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
@@ -23,16 +22,41 @@ public class TargetPermanentAmount extends TargetAmount {
protected final FilterPermanent filter;
- public TargetPermanentAmount(int amount, FilterPermanent filter) {
- // 107.1c If a rule or ability instructs a player to choose “any number,” that player may choose
- // any positive number or zero, unless something (such as damage or counters) is being divided
- // or distributed among “any number” of players and/or objects. In that case, a nonzero number
- // of players and/or objects must be chosen if possible.
- this(StaticValue.get(amount), filter);
+ /**
+ * {@code maxNumberOfTargets} defaults to {@code amount}.
+ *
+ * @see TargetPermanentAmount#TargetPermanentAmount(DynamicValue, int, int, FilterPermanent)
+ */
+ public TargetPermanentAmount(int amount, int minNumberOfTargets, FilterPermanent filter) {
+ this(amount, minNumberOfTargets, amount, filter);
}
- public TargetPermanentAmount(DynamicValue amount, FilterPermanent filter) {
- super(amount);
+ /**
+ * {@code maxNumberOfTargets} defaults to Integer.MAX_VALUE.
+ *
+ * @see TargetPermanentAmount#TargetPermanentAmount(DynamicValue, int, int, FilterPermanent)
+ */
+ public TargetPermanentAmount(DynamicValue amount, int minNumberOfTargets, FilterPermanent filter) {
+ this(amount, minNumberOfTargets, Integer.MAX_VALUE, filter);
+ }
+
+ /**
+ * @see TargetPermanentAmount#TargetPermanentAmount(DynamicValue, int, int, FilterPermanent)
+ */
+ public TargetPermanentAmount(int amount, int minNumberOfTargets, int maxNumberOfTargets, FilterPermanent filter) {
+ this(StaticValue.get(amount), minNumberOfTargets, maxNumberOfTargets, filter);
+ }
+
+ /**
+ * @param amount Amount of stuff (e.g. damage, counters) to distribute.
+ * @param minNumberOfTargets Minimum number of targets.
+ * @param maxNumberOfTargets Maximum number of targets. If no lower max is needed:
+ * set to {@code amount} if amount is static; otherwise, set to Integer.MAX_VALUE.
+ * (Game will always prevent distributing among more than {@code amount} permanents.)
+ * @param filter Filter for permanents that something will be distributed amongst.
+ */
+ public TargetPermanentAmount(DynamicValue amount, int minNumberOfTargets, int maxNumberOfTargets, FilterPermanent filter) {
+ super(amount, minNumberOfTargets, maxNumberOfTargets);
this.zone = Zone.ALL;
this.filter = filter;
this.targetName = filter.getMessage();
@@ -49,7 +73,7 @@ public class TargetPermanentAmount extends TargetAmount {
}
@Override
- public Filter getFilter() {
+ public FilterPermanent getFilter() {
return this.filter;
}
diff --git a/Mage/src/main/java/mage/target/common/TargetPermanentOrPlayerAmount.java b/Mage/src/main/java/mage/target/common/TargetPermanentOrPlayerAmount.java
index 9e42eb94fb6..a1e91b817cc 100644
--- a/Mage/src/main/java/mage/target/common/TargetPermanentOrPlayerAmount.java
+++ b/Mage/src/main/java/mage/target/common/TargetPermanentOrPlayerAmount.java
@@ -22,9 +22,8 @@ public abstract class TargetPermanentOrPlayerAmount extends TargetAmount {
protected FilterPermanentOrPlayer filter;
- TargetPermanentOrPlayerAmount(DynamicValue amount, int maxNumberOfTargets) {
- super(amount);
- this.maxNumberOfTargets = maxNumberOfTargets;
+ TargetPermanentOrPlayerAmount(DynamicValue amount, int minNumberOfTargets, int maxNumberOfTargets) {
+ super(amount, minNumberOfTargets, maxNumberOfTargets);
}
TargetPermanentOrPlayerAmount(final TargetPermanentOrPlayerAmount target) {