diff --git a/Mage.Sets/src/mage/sets/alarareborn/LightningReaver.java b/Mage.Sets/src/mage/sets/alarareborn/LightningReaver.java index 0b42b2019e..b5dd1f7c0f 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/LightningReaver.java +++ b/Mage.Sets/src/mage/sets/alarareborn/LightningReaver.java @@ -37,7 +37,7 @@ import mage.abilities.Ability; import mage.abilities.common.BeginningOfEndStepTriggeredAbility; import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; import mage.abilities.dynamicvalue.DynamicValue; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.FearAbility; @@ -98,7 +98,7 @@ class DamageOpponentsEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - DynamicValue amount = new CountersCount(CounterType.CHARGE); + DynamicValue amount = new CountersSourceCount(CounterType.CHARGE); for (UUID playerId : game.getOpponents(source.getControllerId())) { Player player = game.getPlayer(playerId); if (player != null) { diff --git a/Mage.Sets/src/mage/sets/alliances/Tornado.java b/Mage.Sets/src/mage/sets/alliances/Tornado.java index dbce00b1e0..967ca123a9 100644 --- a/Mage.Sets/src/mage/sets/alliances/Tornado.java +++ b/Mage.Sets/src/mage/sets/alliances/Tornado.java @@ -34,7 +34,7 @@ import mage.abilities.costs.common.PayLifeCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.MultipliedValue; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; @@ -61,7 +61,7 @@ public class Tornado extends CardImpl { this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{G}"))); // {2}{G}, Pay 3 life for each velocity counter on Tornado: Destroy target permanent and put a velocity counter on Tornado. Activate this ability only once each turn. Ability ability = new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{2}{G}")); - DynamicValue lifeToPayAmount = new MultipliedValue(new CountersCount(CounterType.VELOCITY), 3); + DynamicValue lifeToPayAmount = new MultipliedValue(new CountersSourceCount(CounterType.VELOCITY), 3); ability.addCost(new PayLifeCost(lifeToPayAmount, "3 life for each velocity counter on {source}")); ability.addTarget(new TargetPermanent()); Effect effect = new AddCountersSourceEffect(CounterType.VELOCITY.createInstance()); diff --git a/Mage.Sets/src/mage/sets/avacynrestored/FalkenrathExterminator.java b/Mage.Sets/src/mage/sets/avacynrestored/FalkenrathExterminator.java index 1fc407f4fd..beb2977644 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/FalkenrathExterminator.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/FalkenrathExterminator.java @@ -36,7 +36,7 @@ import mage.abilities.Ability; import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; @@ -62,7 +62,7 @@ public class FalkenrathExterminator extends CardImpl { // Whenever Falkenrath Exterminator deals combat damage to a player, put a +1/+1 counter on it. this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false)); // {2}{R}: Falkenrath Exterminator deals damage to target creature equal to the number of +1/+1 counters on Falkenrath Exterminator. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new CountersCount(CounterType.P1P1)), new ManaCostsImpl("{2}{R}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new CountersSourceCount(CounterType.P1P1)), new ManaCostsImpl("{2}{R}")); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/PetalmaneBaku.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/PetalmaneBaku.java index 30e824dc0d..f74e76c3c2 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/PetalmaneBaku.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/PetalmaneBaku.java @@ -34,7 +34,7 @@ import mage.abilities.Ability; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.costs.common.RemoveVariableCountersSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.mana.DynamicManaAbility; @@ -68,7 +68,7 @@ public class PetalmaneBaku extends CardImpl { new RemovedCountersForCostValue(), new ManaCostsImpl<>("{1}"), "Add X mana of any one color to your mana pool", - true, new CountersCount(CounterType.KI)); + true, new CountersSourceCount(CounterType.KI)); ability.addCost(new RemoveVariableCountersSourceCost(CounterType.KI.createInstance(), "Remove X ki counters from {this}")); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/BloodthirstyOgre.java b/Mage.Sets/src/mage/sets/championsofkamigawa/BloodthirstyOgre.java index d1a0b5dda3..1cff910f58 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/BloodthirstyOgre.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/BloodthirstyOgre.java @@ -35,7 +35,7 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.dynamicvalue.DynamicValue; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.dynamicvalue.common.SignInversionDynamicValue; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; @@ -75,7 +75,7 @@ public class BloodthirstyOgre extends CardImpl { this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.DEVOTION.createInstance()),new TapSourceCost())); // {T}: Target creature gets -X/-X until end of turn, where X is the number of devotion counters on Bloodthirsty Ogre. Activate this ability only if you control a Demon. - DynamicValue devotionCounters = new SignInversionDynamicValue(new CountersCount(CounterType.DEVOTION)); + DynamicValue devotionCounters = new SignInversionDynamicValue(new CountersSourceCount(CounterType.DEVOTION)); Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(devotionCounters,devotionCounters, Duration.EndOfTurn, true), new TapSourceCost(), diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/OrochiHatchery.java b/Mage.Sets/src/mage/sets/championsofkamigawa/OrochiHatchery.java index beb1e74ea9..b5c002c111 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/OrochiHatchery.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/OrochiHatchery.java @@ -33,7 +33,7 @@ import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.cards.CardImpl; @@ -56,7 +56,7 @@ public class OrochiHatchery extends CardImpl { this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.CHARGE.createInstance()))); // {5}, {T}: Put a 1/1 green Snake creature token onto the battlefield for each charge counter on Orochi Hatchery. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SnakeToken(), new CountersCount(CounterType.CHARGE)), new GenericManaCost(5)); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SnakeToken(), new CountersSourceCount(CounterType.CHARGE)), new GenericManaCost(5)); ability.addCost(new TapSourceCost()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/conflux/GoblinRazerunners.java b/Mage.Sets/src/mage/sets/conflux/GoblinRazerunners.java index 2338470700..821ec58e72 100644 --- a/Mage.Sets/src/mage/sets/conflux/GoblinRazerunners.java +++ b/Mage.Sets/src/mage/sets/conflux/GoblinRazerunners.java @@ -38,7 +38,7 @@ import mage.abilities.common.BeginningOfYourEndStepTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; @@ -71,7 +71,7 @@ public class GoblinRazerunners extends CardImpl { this.addAbility(ability); // At the beginning of your end step, you may have Goblin Razerunners deal damage equal to the number of +1/+1 counters on it to target player. - ability = new BeginningOfYourEndStepTriggeredAbility(new DamageTargetEffect(new CountersCount(CounterType.P1P1)), true); + ability = new BeginningOfYourEndStepTriggeredAbility(new DamageTargetEffect(new CountersSourceCount(CounterType.P1P1)), true); ability.addTarget(new TargetPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/dissension/EvolutionVat.java b/Mage.Sets/src/mage/sets/dissension/EvolutionVat.java index 5d696c45d4..e07101f688 100644 --- a/Mage.Sets/src/mage/sets/dissension/EvolutionVat.java +++ b/Mage.Sets/src/mage/sets/dissension/EvolutionVat.java @@ -32,7 +32,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.Effect; import mage.abilities.effects.common.TapTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; @@ -62,7 +62,7 @@ public class EvolutionVat extends CardImpl { Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance()); effect.setText("and put a +1/+1 counter on it"); ability.addEffect(effect); - effect = new AddCountersSourceEffect(CounterType.P1P1.createInstance(), new CountersCount(CounterType.P1P1), false); + effect = new AddCountersSourceEffect(CounterType.P1P1.createInstance(), new CountersSourceCount(CounterType.P1P1), false); effect.setText("Double the number of +1/+1 counters on this creature"); Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{2}{G}{U}")); ability.addEffect(new GainAbilityTargetEffect(gainedAbility, Duration.EndOfTurn, diff --git a/Mage.Sets/src/mage/sets/dissension/WalkingArchive.java b/Mage.Sets/src/mage/sets/dissension/WalkingArchive.java index 99157c353b..e98d11c696 100644 --- a/Mage.Sets/src/mage/sets/dissension/WalkingArchive.java +++ b/Mage.Sets/src/mage/sets/dissension/WalkingArchive.java @@ -36,7 +36,7 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.DrawCardTargetEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.DefenderAbility; @@ -66,7 +66,7 @@ public class WalkingArchive extends CardImpl { this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), "Walking Archive enters the battlefield with a +1/+1 counter on it")); // At the beginning of each player's upkeep, that player draws a card for each +1/+1 counter on Walking Archive. - this.addAbility(new BeginningOfUpkeepTriggeredAbility(new DrawCardTargetEffect(new CountersCount(CounterType.P1P1)), TargetController.ANY, false)); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new DrawCardTargetEffect(new CountersSourceCount(CounterType.P1P1)), TargetController.ANY, false)); // {2}{W}{U}: Put a +1/+1 counter on Walking Archive. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new ManaCostsImpl("{2}{W}{U}"))); diff --git a/Mage.Sets/src/mage/sets/fallenempires/BottomlessVault.java b/Mage.Sets/src/mage/sets/fallenempires/BottomlessVault.java index fc48a9218f..e833ae7cb8 100644 --- a/Mage.Sets/src/mage/sets/fallenempires/BottomlessVault.java +++ b/Mage.Sets/src/mage/sets/fallenempires/BottomlessVault.java @@ -37,7 +37,7 @@ import mage.abilities.condition.common.SourceTappedCondition; import mage.abilities.costs.common.RemoveVariableCountersSourceCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.decorator.ConditionalOneShotEffect; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; @@ -74,7 +74,7 @@ public class BottomlessVault extends CardImpl { new RemovedCountersForCostValue(), new TapSourceCost(), "Add {B} to your mana pool for each storage counter removed this way", - true, new CountersCount(CounterType.STORAGE)); + true, new CountersSourceCount(CounterType.STORAGE)); ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance(), "Remove any number of storage counters from {this}")); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/fallenempires/HollowTrees.java b/Mage.Sets/src/mage/sets/fallenempires/HollowTrees.java index 390760d261..25cb0c208e 100644 --- a/Mage.Sets/src/mage/sets/fallenempires/HollowTrees.java +++ b/Mage.Sets/src/mage/sets/fallenempires/HollowTrees.java @@ -37,7 +37,7 @@ import mage.abilities.condition.common.SourceTappedCondition; import mage.abilities.costs.common.RemoveVariableCountersSourceCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.decorator.ConditionalOneShotEffect; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; @@ -74,7 +74,7 @@ public class HollowTrees extends CardImpl { new RemovedCountersForCostValue(), new TapSourceCost(), "Add {G} to your mana pool for each storage counter removed this way", - true, new CountersCount(CounterType.STORAGE)); + true, new CountersSourceCount(CounterType.STORAGE)); ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance(), "Remove any number of storage counters from {this}")); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/fallenempires/Homarid1.java b/Mage.Sets/src/mage/sets/fallenempires/Homarid1.java index de26cfb3e9..18091e901c 100644 --- a/Mage.Sets/src/mage/sets/fallenempires/Homarid1.java +++ b/Mage.Sets/src/mage/sets/fallenempires/Homarid1.java @@ -35,7 +35,7 @@ import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.SourceHasCounterCondition; import mage.abilities.decorator.ConditionalContinuousEffect; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.Effect; import mage.abilities.effects.common.RemoveAllCountersSourceEffect; import mage.abilities.effects.common.continuous.BoostSourceEffect; @@ -108,7 +108,7 @@ class HomaridTriggeredAbility extends StateTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { - return new CountersCount(CounterType.TIDE).calculate(game, this, null) == 4; + return new CountersSourceCount(CounterType.TIDE).calculate(game, this, null) == 4; } @Override diff --git a/Mage.Sets/src/mage/sets/fallenempires/IcatianMoneychanger1.java b/Mage.Sets/src/mage/sets/fallenempires/IcatianMoneychanger1.java index f047aafece..88b7160e3b 100644 --- a/Mage.Sets/src/mage/sets/fallenempires/IcatianMoneychanger1.java +++ b/Mage.Sets/src/mage/sets/fallenempires/IcatianMoneychanger1.java @@ -35,7 +35,7 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.condition.common.IsStepCondition; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.decorator.ConditionalActivatedAbility; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageControllerEffect; import mage.abilities.effects.common.GainLifeEffect; @@ -76,7 +76,7 @@ public class IcatianMoneychanger1 extends CardImpl { // Sacrifice Icatian Moneychanger: You gain 1 life for each credit counter on Icatian Moneychanger. Activate this ability only during your upkeep. this.addAbility(new ConditionalActivatedAbility(Zone.BATTLEFIELD, - new GainLifeEffect(new CountersCount(CounterType.CREDIT)), new SacrificeSourceCost(), new IsStepCondition(PhaseStep.UPKEEP), null)); + new GainLifeEffect(new CountersSourceCount(CounterType.CREDIT)), new SacrificeSourceCost(), new IsStepCondition(PhaseStep.UPKEEP), null)); } public IcatianMoneychanger1(final IcatianMoneychanger1 card) { diff --git a/Mage.Sets/src/mage/sets/fallenempires/IcatianStore.java b/Mage.Sets/src/mage/sets/fallenempires/IcatianStore.java index 7c055985df..946b584908 100644 --- a/Mage.Sets/src/mage/sets/fallenempires/IcatianStore.java +++ b/Mage.Sets/src/mage/sets/fallenempires/IcatianStore.java @@ -37,7 +37,7 @@ import mage.abilities.condition.common.SourceTappedCondition; import mage.abilities.costs.common.RemoveVariableCountersSourceCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.decorator.ConditionalOneShotEffect; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; @@ -74,7 +74,7 @@ public class IcatianStore extends CardImpl { new RemovedCountersForCostValue(), new TapSourceCost(), "Add {W} to your mana pool for each storage counter removed this way", - true, new CountersCount(CounterType.STORAGE)); + true, new CountersSourceCount(CounterType.STORAGE)); ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance(), "Remove any number of storage counters from {this}")); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/fallenempires/TidalInfluence.java b/Mage.Sets/src/mage/sets/fallenempires/TidalInfluence.java index 5f92d4ced1..57ae2d23a6 100644 --- a/Mage.Sets/src/mage/sets/fallenempires/TidalInfluence.java +++ b/Mage.Sets/src/mage/sets/fallenempires/TidalInfluence.java @@ -38,7 +38,7 @@ import mage.abilities.condition.common.SourceHasCounterCondition; import mage.abilities.costs.Cost; import mage.abilities.costs.CostImpl; import mage.abilities.decorator.ConditionalContinuousEffect; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.Effect; import mage.abilities.effects.common.RemoveAllCountersSourceEffect; import mage.abilities.effects.common.continuous.BoostAllEffect; @@ -157,7 +157,7 @@ class TidalInfluenceTriggeredAbility extends StateTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { - return new CountersCount(CounterType.TIDE).calculate(game, this, null) == 4; + return new CountersSourceCount(CounterType.TIDE).calculate(game, this, null) == 4; } @Override diff --git a/Mage.Sets/src/mage/sets/fatereforged/ScrollOfTheMasters.java b/Mage.Sets/src/mage/sets/fatereforged/ScrollOfTheMasters.java index d4aca222bf..dfc2a8d139 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/ScrollOfTheMasters.java +++ b/Mage.Sets/src/mage/sets/fatereforged/ScrollOfTheMasters.java @@ -34,7 +34,7 @@ import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.DynamicValue; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; @@ -69,7 +69,7 @@ public class ScrollOfTheMasters extends CardImpl { this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.LORE.createInstance()), filterNonCreature, false)); // {3}, {T}: Target creature you control gets +1/+1 until end of turn for each lore counter on Scroll of the Masters. - DynamicValue xValue = new CountersCount(CounterType.LORE); + DynamicValue xValue = new CountersSourceCount(CounterType.LORE); Effect effect = new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn); effect.setText("Target creature you control gets +1/+1 until end of turn for each lore counter on {this}"); Ability ability = new SimpleActivatedAbility( diff --git a/Mage.Sets/src/mage/sets/fifthdawn/ClearwaterGoblet.java b/Mage.Sets/src/mage/sets/fifthdawn/ClearwaterGoblet.java index 8872cc832b..5fea9f94e9 100644 --- a/Mage.Sets/src/mage/sets/fifthdawn/ClearwaterGoblet.java +++ b/Mage.Sets/src/mage/sets/fifthdawn/ClearwaterGoblet.java @@ -32,7 +32,7 @@ import java.util.UUID; import mage.constants.CardType; import mage.constants.Rarity; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.keyword.SunburstAbility; import mage.cards.CardImpl; @@ -53,7 +53,7 @@ public class ClearwaterGoblet extends CardImpl { // Sunburst this.addAbility(new SunburstAbility(this)); // At the beginning of your upkeep, you may gain life equal to the number of charge counters on Clearwater Goblet. - this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new GainLifeEffect(new CountersCount(CounterType.CHARGE)), TargetController.YOU, true)); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new GainLifeEffect(new CountersSourceCount(CounterType.CHARGE)), TargetController.YOU, true)); } public ClearwaterGoblet(final ClearwaterGoblet card) { diff --git a/Mage.Sets/src/mage/sets/fifthdawn/Heliophial.java b/Mage.Sets/src/mage/sets/fifthdawn/Heliophial.java index af470f8467..343c12848c 100644 --- a/Mage.Sets/src/mage/sets/fifthdawn/Heliophial.java +++ b/Mage.Sets/src/mage/sets/fifthdawn/Heliophial.java @@ -32,7 +32,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.keyword.SunburstAbility; @@ -56,7 +56,7 @@ public class Heliophial extends CardImpl { // Sunburst this.addAbility(new SunburstAbility(this)); // {2}, Sacrifice Heliophial: Heliophial deals damage equal to the number of charge counters on it to target creature or player. - Effect effect = new DamageTargetEffect(new CountersCount(CounterType.CHARGE)); + Effect effect = new DamageTargetEffect(new CountersSourceCount(CounterType.CHARGE)); effect.setText("{this} deals damage equal to the number of charge counters on it to target creature or player"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{2}")); ability.addCost(new SacrificeSourceCost()); diff --git a/Mage.Sets/src/mage/sets/fifthdawn/OpalineBracers.java b/Mage.Sets/src/mage/sets/fifthdawn/OpalineBracers.java index bed42238c5..b5c4318ef5 100644 --- a/Mage.Sets/src/mage/sets/fifthdawn/OpalineBracers.java +++ b/Mage.Sets/src/mage/sets/fifthdawn/OpalineBracers.java @@ -30,7 +30,7 @@ package mage.sets.fifthdawn; import java.util.UUID; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.continuous.BoostEquippedEffect; import mage.abilities.keyword.EquipAbility; import mage.abilities.keyword.SunburstAbility; @@ -55,7 +55,7 @@ public class OpalineBracers extends CardImpl { // Sunburst this.addAbility(new SunburstAbility(this)); // Equipped creature gets +X/+X, where X is the number of charge counters on Opaline Bracers. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(new CountersCount(CounterType.CHARGE), new CountersCount(CounterType.CHARGE)))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(new CountersSourceCount(CounterType.CHARGE), new CountersSourceCount(CounterType.CHARGE)))); // Equip {2} this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(2))); } diff --git a/Mage.Sets/src/mage/sets/fifthdawn/Solarion.java b/Mage.Sets/src/mage/sets/fifthdawn/Solarion.java index 7290ecd6ef..ce69a4b975 100644 --- a/Mage.Sets/src/mage/sets/fifthdawn/Solarion.java +++ b/Mage.Sets/src/mage/sets/fifthdawn/Solarion.java @@ -31,7 +31,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.Effect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.SunburstAbility; @@ -57,7 +57,7 @@ public class Solarion extends CardImpl { // Sunburst this.addAbility(new SunburstAbility(this)); // {tap}: Double the number of +1/+1 counters on Solarion. - Effect effect = new AddCountersSourceEffect(CounterType.P1P1.createInstance(1), new CountersCount(CounterType.P1P1), true); + Effect effect = new AddCountersSourceEffect(CounterType.P1P1.createInstance(1), new CountersSourceCount(CounterType.P1P1), true); effect.setText("Double the number of +1/+1 counters on {this}"); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost())); } diff --git a/Mage.Sets/src/mage/sets/fifthedition/DwarvenHold.java b/Mage.Sets/src/mage/sets/fifthedition/DwarvenHold.java index 60ca440967..69c3277117 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/DwarvenHold.java +++ b/Mage.Sets/src/mage/sets/fifthedition/DwarvenHold.java @@ -37,7 +37,7 @@ import mage.abilities.condition.common.SourceTappedCondition; import mage.abilities.costs.common.RemoveVariableCountersSourceCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.decorator.ConditionalOneShotEffect; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; @@ -74,7 +74,7 @@ public class DwarvenHold extends CardImpl { new RemovedCountersForCostValue(), new TapSourceCost(), "Add {R} to your mana pool for each storage counter removed this way", - true, new CountersCount(CounterType.STORAGE)); + true, new CountersSourceCount(CounterType.STORAGE)); ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance(), "Remove any number of storage counters from {this}")); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/fifthedition/SandSilos.java b/Mage.Sets/src/mage/sets/fifthedition/SandSilos.java index 63700f3f9a..2d86fbb628 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/SandSilos.java +++ b/Mage.Sets/src/mage/sets/fifthedition/SandSilos.java @@ -37,7 +37,7 @@ import mage.abilities.condition.common.SourceTappedCondition; import mage.abilities.costs.common.RemoveVariableCountersSourceCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.decorator.ConditionalOneShotEffect; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; @@ -74,7 +74,7 @@ public class SandSilos extends CardImpl { new RemovedCountersForCostValue(), new TapSourceCost(), "Add {U} to your mana pool for each storage counter removed this way", - true, new CountersCount(CounterType.STORAGE)); + true, new CountersSourceCount(CounterType.STORAGE)); ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance(), "Remove any number of storage counters from {this}")); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/gatecrash/AssembleTheLegion.java b/Mage.Sets/src/mage/sets/gatecrash/AssembleTheLegion.java index 3184f889ca..73dc4861d9 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/AssembleTheLegion.java +++ b/Mage.Sets/src/mage/sets/gatecrash/AssembleTheLegion.java @@ -30,7 +30,7 @@ package mage.sets.gatecrash; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; @@ -52,7 +52,7 @@ public class AssembleTheLegion extends CardImpl { // At the beginning of your upkeep, put a muster counter on Assemble the Legion. Then put a 1/1 red and white Soldier creature token with haste onto the battlefield for each muster counter on Assemble the Legion. Ability ability = new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.MUSTER.createInstance()), TargetController.YOU, false); - ability.addEffect(new CreateTokenEffect(new SoldierTokenWithHaste(), new CountersCount(CounterType.MUSTER))); + ability.addEffect(new CreateTokenEffect(new SoldierTokenWithHaste(), new CountersSourceCount(CounterType.MUSTER))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/gatecrash/GideonChampionOfJustice.java b/Mage.Sets/src/mage/sets/gatecrash/GideonChampionOfJustice.java index ca21e65092..4194da7f2f 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/GideonChampionOfJustice.java +++ b/Mage.Sets/src/mage/sets/gatecrash/GideonChampionOfJustice.java @@ -33,7 +33,7 @@ import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.dynamicvalue.LockedInDynamicValue; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.dynamicvalue.common.PermanentsTargetOpponentControlsCount; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.PreventAllDamageToSourceEffect; @@ -72,7 +72,7 @@ public class GideonChampionOfJustice extends CardImpl { this.addAbility(ability1); // 0: Until end of turn, Gideon becomes an indestructible Human Soldier creature with power and toughness each equal to the number of loyalty counters on him. He's still a planeswalker. Prevent all damage that would be dealt to him this turn. - LockedInDynamicValue loyaltyCount = new LockedInDynamicValue(new CountersCount(CounterType.LOYALTY)); + LockedInDynamicValue loyaltyCount = new LockedInDynamicValue(new CountersSourceCount(CounterType.LOYALTY)); LoyaltyAbility ability2 = new LoyaltyAbility(new BecomesCreatureSourceEffect( new GideonChampionOfJusticeToken(), "planeswalker", Duration.EndOfTurn, false, false, loyaltyCount, loyaltyCount), 0); ability2.addEffect(new PreventAllDamageToSourceEffect(Duration.EndOfTurn)); diff --git a/Mage.Sets/src/mage/sets/gatecrash/GyreSage.java b/Mage.Sets/src/mage/sets/gatecrash/GyreSage.java index 514c46a159..66277f4c54 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/GyreSage.java +++ b/Mage.Sets/src/mage/sets/gatecrash/GyreSage.java @@ -33,7 +33,7 @@ import mage.constants.CardType; import mage.constants.Rarity; import mage.MageInt; import mage.Mana; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.keyword.EvolveAbility; import mage.abilities.mana.DynamicManaAbility; import mage.cards.CardImpl; @@ -59,7 +59,7 @@ public class GyreSage extends CardImpl { this.addAbility(new EvolveAbility()); //{T} : Add {G} to your mana pool for each +1/+1 counter on Gyre Sage. - this.addAbility(new DynamicManaAbility(Mana.GreenMana(1), new CountersCount(CounterType.P1P1))); + this.addAbility(new DynamicManaAbility(Mana.GreenMana(1), new CountersSourceCount(CounterType.P1P1))); } public GyreSage(final GyreSage card) { diff --git a/Mage.Sets/src/mage/sets/invasion/KangeeAerieKeeper.java b/Mage.Sets/src/mage/sets/invasion/KangeeAerieKeeper.java index 7022870199..ccb6dda72f 100644 --- a/Mage.Sets/src/mage/sets/invasion/KangeeAerieKeeper.java +++ b/Mage.Sets/src/mage/sets/invasion/KangeeAerieKeeper.java @@ -36,7 +36,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.KickedCondition; import mage.abilities.decorator.ConditionalTriggeredAbility; import mage.abilities.dynamicvalue.DynamicValue; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.BoostAllEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; @@ -88,7 +88,7 @@ public class KangeeAerieKeeper extends CardImpl { this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), "When {this} enters the battlefield, if it was kicked, put X feather counters on it.")); // Other Bird creatures get +1/+1 for each feather counter on Kangee, Aerie Keeper. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(new CountersCount(CounterType.FEATHER), new CountersCount(CounterType.FEATHER), Duration.WhileOnBattlefield, filter, true, "Other Bird creatures get +1/+1 for each feather counter on {this}."))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(new CountersSourceCount(CounterType.FEATHER), new CountersSourceCount(CounterType.FEATHER), Duration.WhileOnBattlefield, filter, true, "Other Bird creatures get +1/+1 for each feather counter on {this}."))); } public KangeeAerieKeeper(final KangeeAerieKeeper card) { diff --git a/Mage.Sets/src/mage/sets/judgment/SoulcatchersAerie.java b/Mage.Sets/src/mage/sets/judgment/SoulcatchersAerie.java index 6640eb8fc4..4c7e0f8b2c 100644 --- a/Mage.Sets/src/mage/sets/judgment/SoulcatchersAerie.java +++ b/Mage.Sets/src/mage/sets/judgment/SoulcatchersAerie.java @@ -30,7 +30,7 @@ package mage.sets.judgment; import java.util.UUID; import mage.abilities.common.PutIntoGraveFromBattlefieldAllTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.continuous.BoostAllEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; @@ -65,8 +65,8 @@ public class SoulcatchersAerie extends CardImpl { this.addAbility(new PutIntoGraveFromBattlefieldAllTriggeredAbility(new AddCountersSourceEffect(CounterType.FEATHER.createInstance()), false, filter, false, true)); // Bird creatures get +1/+1 for each feather counter on Soulcatchers' Aerie. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(new CountersCount(CounterType.FEATHER), - new CountersCount(CounterType.FEATHER), Duration.WhileOnBattlefield, filter2, false, + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(new CountersSourceCount(CounterType.FEATHER), + new CountersSourceCount(CounterType.FEATHER), Duration.WhileOnBattlefield, filter2, false, "Bird creatures get +1/+1 for each feather counter on {this}."))); } diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/HoodedHydra.java b/Mage.Sets/src/mage/sets/khansoftarkir/HoodedHydra.java index c44f476180..de1c3a19e4 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/HoodedHydra.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/HoodedHydra.java @@ -34,7 +34,7 @@ import mage.abilities.common.DiesTriggeredAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.AsTurnedFaceUpEffect; import mage.abilities.effects.Effect; import mage.abilities.effects.common.CreateTokenEffect; @@ -67,7 +67,7 @@ public class HoodedHydra extends CardImpl { this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); // When Hooded Hydra dies, put a 1/1 green Snake creature token onto the battlefield for each +1/+1 counter on it. - this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new SnakeToken("KTK"), new CountersCount(CounterType.P1P1)), false)); + this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new SnakeToken("KTK"), new CountersSourceCount(CounterType.P1P1)), false)); // Morph {3}{G}{G} this.addAbility(new MorphAbility(this, new ManaCostsImpl("{3}{G}{G}"))); diff --git a/Mage.Sets/src/mage/sets/knightsvsdragons/KilnmouthDragon.java b/Mage.Sets/src/mage/sets/knightsvsdragons/KilnmouthDragon.java index e5f54a40dd..417f8ff095 100644 --- a/Mage.Sets/src/mage/sets/knightsvsdragons/KilnmouthDragon.java +++ b/Mage.Sets/src/mage/sets/knightsvsdragons/KilnmouthDragon.java @@ -32,7 +32,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.AmplifyEffect; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.keyword.AmplifyAbility; @@ -65,7 +65,7 @@ public class KilnmouthDragon extends CardImpl { // {tap}: Kilnmouth Dragon deals damage equal to the number of +1/+1 counters on it to target creature or player. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new DamageTargetEffect(new CountersCount(CounterType.P1P1)), new TapSourceCost()); + new DamageTargetEffect(new CountersSourceCount(CounterType.P1P1)), new TapSourceCost()); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/legions/CanopyCrawler.java b/Mage.Sets/src/mage/sets/legions/CanopyCrawler.java index a4a7c2fc1d..2704321bfc 100644 --- a/Mage.Sets/src/mage/sets/legions/CanopyCrawler.java +++ b/Mage.Sets/src/mage/sets/legions/CanopyCrawler.java @@ -32,7 +32,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.AmplifyEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.keyword.AmplifyAbility; @@ -60,7 +60,7 @@ public class CanopyCrawler extends CardImpl { // Amplify 1 this.addAbility(new AmplifyAbility(AmplifyEffect.AmplifyFactor.Amplify1)); // {tap}: Target creature gets +1/+1 until end of turn for each +1/+1 counter on Canopy Crawler. - CountersCount count = new CountersCount(CounterType.P1P1); + CountersSourceCount count = new CountersSourceCount(CounterType.P1P1); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(count, count, Duration.EndOfTurn, true), new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/legions/DaruStinger.java b/Mage.Sets/src/mage/sets/legions/DaruStinger.java index 323dbc9732..8e02e0245c 100644 --- a/Mage.Sets/src/mage/sets/legions/DaruStinger.java +++ b/Mage.Sets/src/mage/sets/legions/DaruStinger.java @@ -32,7 +32,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.AmplifyEffect; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.keyword.AmplifyAbility; @@ -59,7 +59,7 @@ public class DaruStinger extends CardImpl { // Amplify 1 this.addAbility(new AmplifyAbility(AmplifyEffect.AmplifyFactor.Amplify1)); // {tap}: Daru Stinger deals damage equal to the number of +1/+1 counters on it to target attacking or blocking creature. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new CountersCount(CounterType.P1P1)), new TapSourceCost()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new CountersSourceCount(CounterType.P1P1)), new TapSourceCost()); ability.addTarget(new TargetAttackingOrBlockingCreature()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/legions/EmbalmedBrawler.java b/Mage.Sets/src/mage/sets/legions/EmbalmedBrawler.java index 4038cfe0b1..1088d65f20 100644 --- a/Mage.Sets/src/mage/sets/legions/EmbalmedBrawler.java +++ b/Mage.Sets/src/mage/sets/legions/EmbalmedBrawler.java @@ -30,7 +30,7 @@ package mage.sets.legions; import java.util.UUID; import mage.MageInt; import mage.abilities.common.AttacksOrBlocksTriggeredAbility; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.AmplifyEffect; import mage.abilities.effects.common.LoseLifeSourceControllerEffect; import mage.abilities.keyword.AmplifyAbility; @@ -55,7 +55,7 @@ public class EmbalmedBrawler extends CardImpl { // Amplify 1 this.addAbility(new AmplifyAbility(AmplifyEffect.AmplifyFactor.Amplify1)); // Whenever Embalmed Brawler attacks or blocks, you lose 1 life for each +1/+1 counter on it. - this.addAbility(new AttacksOrBlocksTriggeredAbility(new LoseLifeSourceControllerEffect(new CountersCount(CounterType.P1P1)), false)); + this.addAbility(new AttacksOrBlocksTriggeredAbility(new LoseLifeSourceControllerEffect(new CountersSourceCount(CounterType.P1P1)), false)); } public EmbalmedBrawler(final EmbalmedBrawler card) { diff --git a/Mage.Sets/src/mage/sets/magic2012/MindUnbound.java b/Mage.Sets/src/mage/sets/magic2012/MindUnbound.java index f56cb2941a..417e266af5 100644 --- a/Mage.Sets/src/mage/sets/magic2012/MindUnbound.java +++ b/Mage.Sets/src/mage/sets/magic2012/MindUnbound.java @@ -33,7 +33,7 @@ import mage.constants.CardType; import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; @@ -53,7 +53,7 @@ public class MindUnbound extends CardImpl { // At the beginning of your upkeep, put a lore counter on Mind Unbound, then draw a card for each lore counter on Mind Unbound. Ability ability = new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.LORE.createInstance()), TargetController.YOU, false); - ability.addEffect(new DrawCardSourceControllerEffect(new CountersCount(CounterType.LORE))); + ability.addEffect(new DrawCardSourceControllerEffect(new CountersSourceCount(CounterType.LORE))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/magic2014/VastwoodHydra.java b/Mage.Sets/src/mage/sets/magic2014/VastwoodHydra.java index 980669dc6f..993da9e720 100644 --- a/Mage.Sets/src/mage/sets/magic2014/VastwoodHydra.java +++ b/Mage.Sets/src/mage/sets/magic2014/VastwoodHydra.java @@ -32,7 +32,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.DiesTriggeredAbility; import mage.abilities.common.EntersBattlefieldAbility; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.cards.CardImpl; @@ -73,7 +73,7 @@ public class VastwoodHydra extends CardImpl { // When Vastwood Hydra dies, you may distribute a number of +1/+1 counters equal to the number of +1/+1 counters on Vastwood Hydra among any number of creatures you control. Ability ability = new DiesTriggeredAbility(new VastwoodHydraDistributeEffect(), true); - ability.addTarget(new TargetCreaturePermanentAmount(new CountersCount(CounterType.P1P1), filter)); + ability.addTarget(new TargetCreaturePermanentAmount(new CountersSourceCount(CounterType.P1P1), filter)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/magicorigins/HangarbackWalker.java b/Mage.Sets/src/mage/sets/magicorigins/HangarbackWalker.java index 652cbf4a8c..b82c6a5788 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/HangarbackWalker.java +++ b/Mage.Sets/src/mage/sets/magicorigins/HangarbackWalker.java @@ -35,7 +35,7 @@ import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; @@ -63,7 +63,7 @@ public class HangarbackWalker extends CardImpl { this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); // When Hangarback Walker dies, put a 1/1 colorless Thopter artifact creature token with flying onto the battlefield for each +1/+1 counter on Hangarback Walker. - this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new ThopterColorlessToken(), new CountersCount(CounterType.P1P1)), false)); + this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new ThopterColorlessToken(), new CountersSourceCount(CounterType.P1P1)), false)); // {1}, {t}: Put a +1/+1 counter on Hangarback Walker. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new GenericManaCost(1)); diff --git a/Mage.Sets/src/mage/sets/magicorigins/MageRingNetwork.java b/Mage.Sets/src/mage/sets/magicorigins/MageRingNetwork.java index f901d201cd..0c9ebd06b8 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/MageRingNetwork.java +++ b/Mage.Sets/src/mage/sets/magicorigins/MageRingNetwork.java @@ -34,7 +34,7 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.RemoveVariableCountersSourceCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.mana.ColorlessManaAbility; @@ -69,7 +69,7 @@ public class MageRingNetwork extends CardImpl { new RemovedCountersForCostValue(), new TapSourceCost(), "Add {C} to your mana pool for each storage counter removed this way", - true, new CountersCount(CounterType.STORAGE)); + true, new CountersSourceCount(CounterType.STORAGE)); ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance(), "Remove X storage counters from {this}")); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/masterseditionii/TimeBomb.java b/Mage.Sets/src/mage/sets/masterseditionii/TimeBomb.java index 1777a4ad54..23c5a0267d 100644 --- a/Mage.Sets/src/mage/sets/masterseditionii/TimeBomb.java +++ b/Mage.Sets/src/mage/sets/masterseditionii/TimeBomb.java @@ -34,7 +34,7 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageEverythingEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; @@ -60,7 +60,7 @@ public class TimeBomb extends CardImpl { this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(), true), TargetController.YOU, false)); // {1}, {tap}, Sacrifice Time Bomb: Time Bomb deals damage equal to the number of time counters on it to each creature and each player. - Effect effect = new DamageEverythingEffect(new CountersCount(CounterType.TIME), new FilterCreaturePermanent()); + Effect effect = new DamageEverythingEffect(new CountersSourceCount(CounterType.TIME), new FilterCreaturePermanent()); effect.setText("{this} deals damage equal to the number of time counters on it to each creature and each player"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(1)); ability.addCost(new TapSourceCost()); diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/ArmageddonClock.java b/Mage.Sets/src/mage/sets/masterseditioniv/ArmageddonClock.java index 66aecc516c..4f19c3c08a 100644 --- a/Mage.Sets/src/mage/sets/masterseditioniv/ArmageddonClock.java +++ b/Mage.Sets/src/mage/sets/masterseditioniv/ArmageddonClock.java @@ -34,7 +34,7 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.condition.common.IsStepCondition; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.decorator.ConditionalActivatedAbility; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.common.DamagePlayersEffect; import mage.cards.CardImpl; @@ -62,7 +62,7 @@ public class ArmageddonClock extends CardImpl { // At the beginning of your upkeep, put a doom counter on Armageddon Clock. this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.DOOM.createInstance(), new StaticValue(1), true, true), TargetController.YOU, false)); // At the beginning of your draw step, Armageddon Clock deals damage equal to the number of doom counters on it to each player. - this.addAbility(new BeginningOfDrawTriggeredAbility(new DamagePlayersEffect(Outcome.Damage, new CountersCount(CounterType.DOOM)), TargetController.YOU, false)); + this.addAbility(new BeginningOfDrawTriggeredAbility(new DamagePlayersEffect(Outcome.Damage, new CountersSourceCount(CounterType.DOOM)), TargetController.YOU, false)); // {4}: Remove a doom counter from Armageddon Clock. Any player may activate this ability but only during any upkeep step. ActivatedAbilityImpl ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new RemoveCounterSourceEffect(CounterType.DOOM.createInstance()), new ManaCostsImpl("{4}"), new IsStepCondition(PhaseStep.UPKEEP, false), null); diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/FountainOfCho.java b/Mage.Sets/src/mage/sets/mercadianmasques/FountainOfCho.java index 9af8db5aa5..7d03197daf 100644 --- a/Mage.Sets/src/mage/sets/mercadianmasques/FountainOfCho.java +++ b/Mage.Sets/src/mage/sets/mercadianmasques/FountainOfCho.java @@ -34,7 +34,7 @@ import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.RemoveVariableCountersSourceCost; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.mana.DynamicManaAbility; @@ -64,7 +64,7 @@ public class FountainOfCho extends CardImpl { new RemovedCountersForCostValue(), new TapSourceCost(), "Add {W} to your mana pool for each storage counter removed this way", - true, new CountersCount(CounterType.STORAGE)); + true, new CountersSourceCount(CounterType.STORAGE)); ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance(), "Remove any number of storage counters from {this}")); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/MercadianBazaar.java b/Mage.Sets/src/mage/sets/mercadianmasques/MercadianBazaar.java index 78689e23c9..3e63c4a195 100644 --- a/Mage.Sets/src/mage/sets/mercadianmasques/MercadianBazaar.java +++ b/Mage.Sets/src/mage/sets/mercadianmasques/MercadianBazaar.java @@ -34,7 +34,7 @@ import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.RemoveVariableCountersSourceCost; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.mana.DynamicManaAbility; @@ -64,7 +64,7 @@ public class MercadianBazaar extends CardImpl { new RemovedCountersForCostValue(), new TapSourceCost(), "Add {R} to your mana pool for each storage counter removed this way", - true, new CountersCount(CounterType.STORAGE)); + true, new CountersSourceCount(CounterType.STORAGE)); ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance(), "Remove any number of storage counters from {this}")); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/RushwoodGrove.java b/Mage.Sets/src/mage/sets/mercadianmasques/RushwoodGrove.java index 8465cb3378..5da740d525 100644 --- a/Mage.Sets/src/mage/sets/mercadianmasques/RushwoodGrove.java +++ b/Mage.Sets/src/mage/sets/mercadianmasques/RushwoodGrove.java @@ -34,7 +34,7 @@ import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.RemoveVariableCountersSourceCost; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.mana.DynamicManaAbility; @@ -64,7 +64,7 @@ public class RushwoodGrove extends CardImpl { new RemovedCountersForCostValue(), new TapSourceCost(), "Add {G} to your mana pool for each storage counter removed this way", - true, new CountersCount(CounterType.STORAGE)); + true, new CountersSourceCount(CounterType.STORAGE)); ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance(), "Remove any number of storage counters from {this}")); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/SaprazzanCove.java b/Mage.Sets/src/mage/sets/mercadianmasques/SaprazzanCove.java index 97da1092ab..f2fc04b29a 100644 --- a/Mage.Sets/src/mage/sets/mercadianmasques/SaprazzanCove.java +++ b/Mage.Sets/src/mage/sets/mercadianmasques/SaprazzanCove.java @@ -34,7 +34,7 @@ import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.RemoveVariableCountersSourceCost; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.mana.DynamicManaAbility; @@ -64,7 +64,7 @@ public class SaprazzanCove extends CardImpl { new RemovedCountersForCostValue(), new TapSourceCost(), "Add {U} to your mana pool for each storage counter removed this way", - true, new CountersCount(CounterType.STORAGE)); + true, new CountersSourceCount(CounterType.STORAGE)); ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance(), "Remove any number of storage counters from {this}")); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/SubterraneanHangar.java b/Mage.Sets/src/mage/sets/mercadianmasques/SubterraneanHangar.java index 3beaec2710..2668cc2746 100644 --- a/Mage.Sets/src/mage/sets/mercadianmasques/SubterraneanHangar.java +++ b/Mage.Sets/src/mage/sets/mercadianmasques/SubterraneanHangar.java @@ -34,7 +34,7 @@ import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.RemoveVariableCountersSourceCost; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.mana.DynamicManaAbility; @@ -64,7 +64,7 @@ public class SubterraneanHangar extends CardImpl { new RemovedCountersForCostValue(), new TapSourceCost(), "Add {B} to your mana pool for each storage counter removed this way", - true, new CountersCount(CounterType.STORAGE)); + true, new CountersSourceCount(CounterType.STORAGE)); ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance(), "Remove any number of storage counters from {this}")); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/mirrodin/BansheesBlade.java b/Mage.Sets/src/mage/sets/mirrodin/BansheesBlade.java index 284ef1c979..59b46dce8f 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/BansheesBlade.java +++ b/Mage.Sets/src/mage/sets/mirrodin/BansheesBlade.java @@ -31,7 +31,7 @@ import java.util.UUID; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.continuous.BoostEquippedEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.EquipAbility; @@ -59,7 +59,7 @@ public class BansheesBlade extends CardImpl { this.subtype.add("Equipment"); // Equipped creature gets +1/+1 for each charge counter on Banshee's Blade. - CountersCount chargeCountersCount = new CountersCount(CounterType.CHARGE); + CountersSourceCount chargeCountersCount = new CountersSourceCount(CounterType.CHARGE); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(chargeCountersCount, chargeCountersCount))); // Whenever equipped creature deals combat damage, put a charge counter on Banshee's Blade. this.addAbility(new BansheesBladeAbility()); diff --git a/Mage.Sets/src/mage/sets/nemesis/RustingGolem.java b/Mage.Sets/src/mage/sets/nemesis/RustingGolem.java index e2dfb525d6..46ff1d7269 100644 --- a/Mage.Sets/src/mage/sets/nemesis/RustingGolem.java +++ b/Mage.Sets/src/mage/sets/nemesis/RustingGolem.java @@ -30,7 +30,7 @@ package mage.sets.nemesis; import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; import mage.abilities.keyword.FadingAbility; import mage.cards.CardImpl; @@ -57,7 +57,7 @@ public class RustingGolem extends CardImpl { this.addAbility(new FadingAbility(5, this)); // Rusting Golem's power and toughness are each equal to the number of fade counters on it. this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect( - new CountersCount(CounterType.FADE), Duration.EndOfGame))); + new CountersSourceCount(CounterType.FADE), Duration.EndOfGame))); } public RustingGolem(final RustingGolem card) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfBoundlessGrowth.java b/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfBoundlessGrowth.java index a8a5d7cb79..6bef468ea1 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfBoundlessGrowth.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfBoundlessGrowth.java @@ -39,7 +39,7 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.mana.DynamicManaAbility; import mage.cards.CardImpl; @@ -68,7 +68,7 @@ public class ShrineOfBoundlessGrowth extends CardImpl { this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), filter, false)); // {T}, Sacrifice Shrine of Boundless Growth: Add {C} to your mana pool for each charge counter on Shrine of Boundless Growth. - Ability ability = new DynamicManaAbility(Mana.ColorlessMana(1), new CountersCount(CounterType.CHARGE), new TapSourceCost()); + Ability ability = new DynamicManaAbility(Mana.ColorlessMana(1), new CountersSourceCount(CounterType.CHARGE), new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfBurningRage.java b/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfBurningRage.java index f56bf199a9..acebc38c4e 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfBurningRage.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfBurningRage.java @@ -40,7 +40,7 @@ import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; @@ -67,7 +67,7 @@ public class ShrineOfBurningRage extends CardImpl { this.expansionSetCode = "NPH"; this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), TargetController.YOU, false)); this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), filter, false)); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new CountersCount(CounterType.CHARGE)), new GenericManaCost(3)); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new CountersSourceCount(CounterType.CHARGE)), new GenericManaCost(3)); ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); ability.addTarget(new TargetCreatureOrPlayer()); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfLimitlessPower.java b/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfLimitlessPower.java index 5406c7c93d..919cd5fae1 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfLimitlessPower.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfLimitlessPower.java @@ -40,7 +40,7 @@ import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.discard.DiscardTargetEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; @@ -68,7 +68,7 @@ public class ShrineOfLimitlessPower extends CardImpl { this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), TargetController.YOU, false)); this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), filter, false)); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DiscardTargetEffect(new CountersCount(CounterType.CHARGE)), new GenericManaCost(4)); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DiscardTargetEffect(new CountersSourceCount(CounterType.CHARGE)), new GenericManaCost(4)); ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); ability.addTarget(new TargetPlayer()); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfLoyalLegions.java b/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfLoyalLegions.java index a4f732fa0a..11b2d39e5f 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfLoyalLegions.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfLoyalLegions.java @@ -40,7 +40,7 @@ import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; @@ -69,7 +69,7 @@ public class ShrineOfLoyalLegions extends CardImpl { this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), filter, false)); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new CreateTokenEffect(new MyrToken("NPH"), new CountersCount(CounterType.CHARGE)), + new CreateTokenEffect(new MyrToken("NPH"), new CountersSourceCount(CounterType.CHARGE)), new GenericManaCost(3)); ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); diff --git a/Mage.Sets/src/mage/sets/planarchaos/Tidewalker.java b/Mage.Sets/src/mage/sets/planarchaos/Tidewalker.java index 3c55beed82..b0178dea79 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/Tidewalker.java +++ b/Mage.Sets/src/mage/sets/planarchaos/Tidewalker.java @@ -31,7 +31,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; @@ -71,7 +71,7 @@ public class Tidewalker extends CardImpl { this.addAbility(new VanishingUpkeepAbility(0)); this.addAbility(new VanishingSacrificeAbility()); // Tidewalker's power and toughness are each equal to the number of time counters on it. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new CountersCount(CounterType.TIME), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new CountersSourceCount(CounterType.TIME), Duration.EndOfGame))); } public Tidewalker(final Tidewalker card) { diff --git a/Mage.Sets/src/mage/sets/planechase2012/PreyseizerDragon.java b/Mage.Sets/src/mage/sets/planechase2012/PreyseizerDragon.java index d3934a8b61..7926ad91bf 100644 --- a/Mage.Sets/src/mage/sets/planechase2012/PreyseizerDragon.java +++ b/Mage.Sets/src/mage/sets/planechase2012/PreyseizerDragon.java @@ -33,7 +33,7 @@ import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.AttacksTriggeredAbility; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.DevourEffect.DevourFactor; import mage.abilities.keyword.DevourAbility; @@ -63,7 +63,7 @@ public class PreyseizerDragon extends CardImpl { this.addAbility(new DevourAbility(DevourFactor.Devour2)); // Whenever Preyseizer Dragon attacks, it deals damage to target creature or player equal to the number of +1/+1 counters on Preyseizer Dragon. - Ability ability = new AttacksTriggeredAbility(new DamageTargetEffect(new CountersCount(CounterType.P1P1)), false); + Ability ability = new AttacksTriggeredAbility(new DamageTargetEffect(new CountersSourceCount(CounterType.P1P1)), false); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SurrakarSpellblade.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SurrakarSpellblade.java index a7aec7dfa6..a4208a1ba1 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SurrakarSpellblade.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SurrakarSpellblade.java @@ -33,7 +33,7 @@ import mage.constants.Rarity; import mage.MageInt; import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; @@ -68,7 +68,7 @@ public class SurrakarSpellblade extends CardImpl { this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), filter, true)); // Whenever Surrakar Spellblade deals combat damage to a player, you may draw X cards, where X is the number of charge counters on it. - this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new DrawCardSourceControllerEffect(new CountersCount(CounterType.CHARGE)), true)); + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new DrawCardSourceControllerEffect(new CountersSourceCount(CounterType.CHARGE)), true)); } public SurrakarSpellblade(final SurrakarSpellblade card) { diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/MagaTraitorToMortals.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/MagaTraitorToMortals.java index 53bda1d2e3..2cbf2014a5 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/MagaTraitorToMortals.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/MagaTraitorToMortals.java @@ -32,7 +32,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.cards.CardImpl; @@ -62,7 +62,7 @@ public class MagaTraitorToMortals extends CardImpl { // When Maga enters the battlefield, target player loses life equal to the number of +1/+1 counters on it. Ability ability = new EntersBattlefieldTriggeredAbility( - new LoseLifeTargetEffect(new CountersCount(CounterType.P1P1)), false); + new LoseLifeTargetEffect(new CountersSourceCount(CounterType.P1P1)), false); ability.addTarget(new TargetPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/ChimericMass.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/ChimericMass.java index 6fef0b8fcd..a3db567c13 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/ChimericMass.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/ChimericMass.java @@ -33,7 +33,7 @@ import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; @@ -81,6 +81,6 @@ class ChimericMassToken extends Token { subtype.add("Construct"); power = new MageInt(0); toughness = new MageInt(0); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetPowerToughnessSourceEffect(new CountersCount(CounterType.CHARGE), Duration.WhileOnBattlefield))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetPowerToughnessSourceEffect(new CountersSourceCount(CounterType.CHARGE), Duration.WhileOnBattlefield))); } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GoldenUrn.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GoldenUrn.java index 49c1a2257c..ae6446a468 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GoldenUrn.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GoldenUrn.java @@ -35,7 +35,7 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; @@ -55,7 +55,7 @@ public class GoldenUrn extends CardImpl { super(ownerId, 158, "Golden Urn", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{1}"); this.expansionSetCode = "SOM"; this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), TargetController.YOU, true)); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(new CountersCount(CounterType.CHARGE)), new TapSourceCost()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(new CountersSourceCount(CounterType.CHARGE)), new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/shadowmoor/DuskUrchins.java b/Mage.Sets/src/mage/sets/shadowmoor/DuskUrchins.java index 559b62cc89..93552d1720 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/DuskUrchins.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/DuskUrchins.java @@ -31,7 +31,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.AttacksOrBlocksTriggeredAbility; import mage.abilities.common.DiesTriggeredAbility; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; @@ -57,7 +57,7 @@ public class DuskUrchins extends CardImpl { this.addAbility(new AttacksOrBlocksTriggeredAbility(new AddCountersSourceEffect(CounterType.M1M1.createInstance()), false)); // When Dusk Urchins dies, draw a card for each -1/-1 counter on it. - this.addAbility(new DiesTriggeredAbility(new DrawCardSourceControllerEffect(new CountersCount(CounterType.M1M1)))); + this.addAbility(new DiesTriggeredAbility(new DrawCardSourceControllerEffect(new CountersSourceCount(CounterType.M1M1)))); } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Mycoloth.java b/Mage.Sets/src/mage/sets/shardsofalara/Mycoloth.java index a3a280dcee..bda4a95831 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Mycoloth.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Mycoloth.java @@ -33,7 +33,7 @@ import mage.constants.Rarity; import mage.constants.TargetController; import mage.MageInt; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.DevourEffect.DevourFactor; import mage.abilities.keyword.DevourAbility; @@ -60,7 +60,7 @@ public class Mycoloth extends CardImpl { // At the beginning of your upkeep, put a 1/1 green Saproling creature token onto the battlefield for each +1/+1 counter on Mycoloth. this.addAbility(new BeginningOfUpkeepTriggeredAbility( - new CreateTokenEffect(new SaprolingToken(),new CountersCount(CounterType.P1P1)), + new CreateTokenEffect(new SaprolingToken(),new CountersSourceCount(CounterType.P1P1)), TargetController.YOU, false )); diff --git a/Mage.Sets/src/mage/sets/shardsofalara/SigilOfDistinction.java b/Mage.Sets/src/mage/sets/shardsofalara/SigilOfDistinction.java index c3f9fbb88e..aa75086b14 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/SigilOfDistinction.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/SigilOfDistinction.java @@ -31,7 +31,7 @@ import java.util.UUID; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.common.RemoveCountersSourceCost; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.abilities.effects.common.continuous.BoostEquippedEffect; import mage.abilities.keyword.EquipAbility; @@ -56,7 +56,7 @@ public class SigilOfDistinction extends CardImpl { this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.CHARGE.createInstance()))); // Equipped creature gets +1/+1 for each charge counter on Sigil of Distinction. - BoostEquippedEffect effect = new BoostEquippedEffect(new CountersCount(CounterType.CHARGE), new CountersCount(CounterType.CHARGE)); + BoostEquippedEffect effect = new BoostEquippedEffect(new CountersSourceCount(CounterType.CHARGE), new CountersSourceCount(CounterType.CHARGE)); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); // Equip—Remove a charge counter from Sigil of Distinction. diff --git a/Mage.Sets/src/mage/sets/tempest/EndlessScream.java b/Mage.Sets/src/mage/sets/tempest/EndlessScream.java index 58c3755d0f..cacdf670df 100644 --- a/Mage.Sets/src/mage/sets/tempest/EndlessScream.java +++ b/Mage.Sets/src/mage/sets/tempest/EndlessScream.java @@ -31,7 +31,7 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; @@ -67,7 +67,7 @@ public class EndlessScream extends CardImpl { // Endless Scream enters the battlefield with X scream counters on it. this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.SCREAM.createInstance()))); // Enchanted creature gets +1/+0 for each scream counter on Endless Scream. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(new CountersCount(CounterType.SCREAM), new StaticValue(0), Duration.WhileOnBattlefield))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(new CountersSourceCount(CounterType.SCREAM), new StaticValue(0), Duration.WhileOnBattlefield))); } public EndlessScream(final EndlessScream card) { diff --git a/Mage.Sets/src/mage/sets/thedark/CityOfShadows.java b/Mage.Sets/src/mage/sets/thedark/CityOfShadows.java index 66e4b455d5..1bdc21a93f 100644 --- a/Mage.Sets/src/mage/sets/thedark/CityOfShadows.java +++ b/Mage.Sets/src/mage/sets/thedark/CityOfShadows.java @@ -33,7 +33,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.ExileTargetCost; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.mana.DynamicManaAbility; import mage.cards.CardImpl; @@ -59,7 +59,7 @@ public class CityOfShadows extends CardImpl { this.addAbility(ability); // {T}: Add X mana of {C} to your mana pool, where X is the number of storage counters on City of Shadows. - ability = new DynamicManaAbility(Mana.ColorlessMana(1), new CountersCount(CounterType.STORAGE), + ability = new DynamicManaAbility(Mana.ColorlessMana(1), new CountersSourceCount(CounterType.STORAGE), "Add X mana of {C} to your mana pool, where X is the number of storage counters on {this}"); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/urzassaga/BarrinsCodex.java b/Mage.Sets/src/mage/sets/urzassaga/BarrinsCodex.java index 1407efba1c..165be605d1 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/BarrinsCodex.java +++ b/Mage.Sets/src/mage/sets/urzassaga/BarrinsCodex.java @@ -40,7 +40,7 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.cards.CardImpl; import mage.constants.TargetController; import mage.counters.CounterType; @@ -59,7 +59,7 @@ public class BarrinsCodex extends CardImpl { this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.PAGE.createInstance()), TargetController.YOU, true)); //{4}, {T}, Sacrifice Barrin's Codex: Draw X cards, where X is the number of page counters on Barrin's Codex. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(new CountersCount(CounterType.PAGE)), new ManaCostsImpl("{4}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(new CountersSourceCount(CounterType.PAGE)), new ManaCostsImpl("{4}")); ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/urzassaga/LiltingRefrain.java b/Mage.Sets/src/mage/sets/urzassaga/LiltingRefrain.java index e4cfe2d382..e3041826f0 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/LiltingRefrain.java +++ b/Mage.Sets/src/mage/sets/urzassaga/LiltingRefrain.java @@ -32,7 +32,7 @@ import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.CounterUnlessPaysEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; @@ -57,7 +57,7 @@ public class LiltingRefrain extends CardImpl { this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.VERSE.createInstance()), TargetController.YOU, true)); // Sacrifice Lilting Refrain: Counter target spell unless its controller pays {X}, where X is the number of verse counters on Lilting Refrain. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(new CountersCount(CounterType.VERSE)), new SacrificeSourceCost()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(new CountersSourceCount(CounterType.VERSE)), new SacrificeSourceCost()); ability.addTarget(new TargetSpell()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/urzassaga/MidsummerRevel.java b/Mage.Sets/src/mage/sets/urzassaga/MidsummerRevel.java index 4197bea226..741bce973c 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/MidsummerRevel.java +++ b/Mage.Sets/src/mage/sets/urzassaga/MidsummerRevel.java @@ -33,7 +33,7 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; @@ -59,7 +59,7 @@ public class MidsummerRevel extends CardImpl { new AddCountersSourceEffect(CounterType.VERSE.createInstance(), true), TargetController.YOU, true)); // {G}, Sacrifice Midsummer Revel: Put X 3/3 green Beast creature tokens onto the battlefield, where X is the number of verse counters on Midsummer Revel. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new BeastToken(), - new CountersCount(CounterType.VERSE)), new ManaCostsImpl("{G}")); + new CountersSourceCount(CounterType.VERSE)), new ManaCostsImpl("{G}")); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/urzassaga/TorchSong.java b/Mage.Sets/src/mage/sets/urzassaga/TorchSong.java index edd10ecd56..1ca643773f 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/TorchSong.java +++ b/Mage.Sets/src/mage/sets/urzassaga/TorchSong.java @@ -33,7 +33,7 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; @@ -58,7 +58,7 @@ public class TorchSong extends CardImpl { this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.VERSE.createInstance(), true), TargetController.YOU, true)); // {2}{R}, Sacrifice Torch Song: Torch Song deals X damage to target creature or player, where X is the number of verse counters on Torch Song. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new CountersCount(CounterType.VERSE)), new ManaCostsImpl("{2}{R}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new CountersSourceCount(CounterType.VERSE)), new ManaCostsImpl("{2}{R}")); ability.addCost(new SacrificeSourceCost()); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/vintagemasters/CrescendoOfWar.java b/Mage.Sets/src/mage/sets/vintagemasters/CrescendoOfWar.java index 45773d8f0a..03474c83f3 100644 --- a/Mage.Sets/src/mage/sets/vintagemasters/CrescendoOfWar.java +++ b/Mage.Sets/src/mage/sets/vintagemasters/CrescendoOfWar.java @@ -30,7 +30,7 @@ package mage.sets.vintagemasters; import java.util.UUID; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.common.continuous.BoostAllEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; @@ -58,11 +58,11 @@ public class CrescendoOfWar extends CardImpl { this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.STRIFE.createInstance(1), true), TargetController.ANY, false)); // Attacking creatures get +1/+0 for each strife counter on Crescendo of War. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(new CountersCount(CounterType.STRIFE), new StaticValue(0), + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(new CountersSourceCount(CounterType.STRIFE), new StaticValue(0), Duration.WhileOnBattlefield, new FilterAttackingCreature(), false))); // Blocking creatures you control get +1/+0 for each strife counter on Crescendo of War. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(new CountersCount(CounterType.STRIFE), new StaticValue(0), + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(new CountersSourceCount(CounterType.STRIFE), new StaticValue(0), Duration.WhileOnBattlefield, new FilterBlockingCreature(), false))); } diff --git a/Mage.Sets/src/mage/sets/visions/MagmaMine.java b/Mage.Sets/src/mage/sets/visions/MagmaMine.java index aac5b04b73..e9bed6541d 100644 --- a/Mage.Sets/src/mage/sets/visions/MagmaMine.java +++ b/Mage.Sets/src/mage/sets/visions/MagmaMine.java @@ -33,7 +33,7 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; @@ -59,7 +59,7 @@ public class MagmaMine extends CardImpl { new GenericManaCost(4))); // {tap}, Sacrifice Magma Mine: Magma Mine deals damage equal to the number of pressure counters on it to target creature or player. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new CountersCount(CounterType.PRESSURE)), new TapSourceCost()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new CountersSourceCount(CounterType.PRESSURE)), new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/weatherlight/MwonvuliOoze.java b/Mage.Sets/src/mage/sets/weatherlight/MwonvuliOoze.java index e9ff59f123..4de794792b 100644 --- a/Mage.Sets/src/mage/sets/weatherlight/MwonvuliOoze.java +++ b/Mage.Sets/src/mage/sets/weatherlight/MwonvuliOoze.java @@ -32,7 +32,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; import mage.abilities.keyword.CumulativeUpkeepAbility; @@ -74,7 +74,7 @@ public class MwonvuliOoze extends CardImpl { } -class MwonvuliOozePTValue extends CountersCount { +class MwonvuliOozePTValue extends CountersSourceCount { public MwonvuliOozePTValue() { super(CounterType.AGE); diff --git a/Mage.Sets/src/mage/sets/weatherlight/ReveredUnicorn.java b/Mage.Sets/src/mage/sets/weatherlight/ReveredUnicorn.java index 2897ba0ec6..d4ee8c7e52 100644 --- a/Mage.Sets/src/mage/sets/weatherlight/ReveredUnicorn.java +++ b/Mage.Sets/src/mage/sets/weatherlight/ReveredUnicorn.java @@ -31,7 +31,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.LeavesBattlefieldTriggeredAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.keyword.CumulativeUpkeepAbility; import mage.cards.CardImpl; @@ -55,7 +55,7 @@ public class ReveredUnicorn extends CardImpl { // Cumulative upkeep {1} this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{1}"))); // When Revered Unicorn leaves the battlefield, you gain life equal to the number of age counters on it. - this.addAbility(new LeavesBattlefieldTriggeredAbility(new GainLifeEffect(new CountersCount(CounterType.AGE)), false)); + this.addAbility(new LeavesBattlefieldTriggeredAbility(new GainLifeEffect(new CountersSourceCount(CounterType.AGE)), false)); } public ReveredUnicorn(final ReveredUnicorn card) { diff --git a/Mage.Sets/src/mage/sets/worldwake/EverflowingChalice.java b/Mage.Sets/src/mage/sets/worldwake/EverflowingChalice.java index ec35340333..5c3cb7942c 100644 --- a/Mage.Sets/src/mage/sets/worldwake/EverflowingChalice.java +++ b/Mage.Sets/src/mage/sets/worldwake/EverflowingChalice.java @@ -33,7 +33,7 @@ import mage.constants.CardType; import mage.constants.Rarity; import mage.Mana; import mage.abilities.common.EntersBattlefieldAbility; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.dynamicvalue.common.MultikickerCount; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.MultikickerAbility; @@ -64,7 +64,7 @@ public class EverflowingChalice extends CardImpl { "with a charge counter on it for each time it was kicked")); // {T}: Add {C} to your mana pool for each charge counter on Everflowing Chalice. - this.addAbility(new DynamicManaAbility(Mana.ColorlessMana(1), new CountersCount(CounterType.CHARGE))); + this.addAbility(new DynamicManaAbility(Mana.ColorlessMana(1), new CountersSourceCount(CounterType.CHARGE))); } public EverflowingChalice(final EverflowingChalice card) { diff --git a/Mage.Sets/src/mage/sets/worldwake/JoragaWarcaller.java b/Mage.Sets/src/mage/sets/worldwake/JoragaWarcaller.java index 5d2bf1eeac..4827b669dd 100644 --- a/Mage.Sets/src/mage/sets/worldwake/JoragaWarcaller.java +++ b/Mage.Sets/src/mage/sets/worldwake/JoragaWarcaller.java @@ -33,7 +33,7 @@ import mage.constants.*; import mage.MageInt; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.dynamicvalue.common.MultikickerCount; import mage.abilities.effects.common.continuous.BoostAllEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; @@ -81,7 +81,7 @@ public class JoragaWarcaller extends CardImpl { // Other Elf creatures you control get +1/+1 for each +1/+1 counter on Joraga Warcaller. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, - new BoostAllEffect( new CountersCount(CounterType.P1P1), new CountersCount(CounterType.P1P1), Duration.WhileOnBattlefield, filter, true, rule))); + new BoostAllEffect( new CountersSourceCount(CounterType.P1P1), new CountersSourceCount(CounterType.P1P1), Duration.WhileOnBattlefield, filter, true, rule))); } diff --git a/Mage/src/main/java/mage/abilities/common/BecomesMonstrousTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/BecomesMonstrousTriggeredAbility.java new file mode 100644 index 0000000000..452adbba58 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/common/BecomesMonstrousTriggeredAbility.java @@ -0,0 +1,60 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.common; + +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author Styxo + */ +public class BecomesMonstrousTriggeredAbility extends TriggeredAbilityImpl { + + protected FilterCreaturePermanent filter = new FilterCreaturePermanent(); + + public BecomesMonstrousTriggeredAbility(Effect effect) { + super(Zone.BATTLEFIELD, effect, false); + } + + public BecomesMonstrousTriggeredAbility(final BecomesMonstrousTriggeredAbility ability) { + super(ability); + } + + @Override + public BecomesMonstrousTriggeredAbility copy() { + return new BecomesMonstrousTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.BECOMES_MONSTROUS; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (filter.match(permanent, sourceId, controllerId, game) + && (permanent.getControllerId().equals(this.controllerId))) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getTargetId())); + } + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever " + filter.getMessage() + " becomes monstrous, " + super.getRule(); + } +} diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/CountersCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/CountersSourceCount.java similarity index 76% rename from Mage/src/main/java/mage/abilities/dynamicvalue/common/CountersCount.java rename to Mage/src/main/java/mage/abilities/dynamicvalue/common/CountersSourceCount.java index 7bad2ad6af..d132ed29a6 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/CountersCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/CountersSourceCount.java @@ -7,15 +7,15 @@ import mage.counters.CounterType; import mage.game.Game; import mage.game.permanent.Permanent; -public class CountersCount implements DynamicValue { +public class CountersSourceCount implements DynamicValue { private final CounterType counter; - public CountersCount(CounterType counter) { + public CountersSourceCount(CounterType counter) { this.counter = counter; } - public CountersCount(final CountersCount countersCount) { + public CountersSourceCount(final CountersSourceCount countersCount) { this.counter = countersCount.counter; } @@ -29,8 +29,8 @@ public class CountersCount implements DynamicValue { } @Override - public CountersCount copy() { - return new CountersCount(this); + public CountersSourceCount copy() { + return new CountersSourceCount(this); } @Override diff --git a/Mage/src/main/java/mage/abilities/effects/common/FightTargetsEffect.java b/Mage/src/main/java/mage/abilities/effects/common/FightTargetsEffect.java index ba94bdd73f..b955cb2eba 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/FightTargetsEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/FightTargetsEffect.java @@ -46,6 +46,11 @@ public class FightTargetsEffect extends OneShotEffect { super(Outcome.Damage); } + public FightTargetsEffect(String effectText) { + this(); + this.staticText = effectText; + } + public FightTargetsEffect(final FightTargetsEffect effect) { super(effect); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersTargetEffect.java index f8efacad7e..a19cd3cd21 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersTargetEffect.java @@ -41,6 +41,7 @@ import mage.counters.CounterType; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import mage.target.Target; import mage.util.CardUtil; /** @@ -144,17 +145,21 @@ public class AddCountersTargetEffect extends OneShotEffect { sb.append("s"); } sb.append(" on "); + + Target target = mode.getTargets().get(0); + if (target.getNumberOfTargets() == 0) { + sb.append("up to "); + } - // TODO: add normal text infrastructure for target pointers - if (mode.getTargets().size() > 0) { - String targetName = mode.getTargets().get(0).getTargetName(); - if (!targetName.startsWith("another")) { + if (target.getMaxNumberOfTargets() > 1 || target.getNumberOfTargets() == 0) { + sb.append(target.getMaxNumberOfTargets()).append(" target ").append(target.getTargetName()); + } else { + if (!target.getTargetName().startsWith("another")) { sb.append("target "); } - sb.append(targetName); - } else { - sb.append("it"); + sb.append(target.getTargetName()); } + if (amount.getMessage().length() > 0) { sb.append(" for each ").append(amount.getMessage()); } diff --git a/Mage/src/main/java/mage/filter/common/FilterOpponentsCreaturePermanent.java b/Mage/src/main/java/mage/filter/common/FilterOpponentsCreaturePermanent.java new file mode 100644 index 0000000000..c3de7cc215 --- /dev/null +++ b/Mage/src/main/java/mage/filter/common/FilterOpponentsCreaturePermanent.java @@ -0,0 +1,40 @@ +package mage.filter.common; + +import mage.constants.TargetController; +import mage.filter.predicate.permanent.ControllerPredicate; + +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +/** + * + * @author Styxo + */ +public class FilterOpponentsCreaturePermanent extends FilterCreaturePermanent { + + public FilterOpponentsCreaturePermanent() { + this("creature an opponent controls"); + } + + public FilterOpponentsCreaturePermanent(String name) { + super(name); + this.add(new ControllerPredicate(TargetController.OPPONENT)); + + } + + public FilterOpponentsCreaturePermanent(String subtype, String name) { + super(subtype, name); + this.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public FilterOpponentsCreaturePermanent(final FilterOpponentsCreaturePermanent filter) { + super(filter); + } + + @Override + public FilterOpponentsCreaturePermanent copy() { + return new FilterOpponentsCreaturePermanent(this); + } +} diff --git a/Mage/src/main/java/mage/target/common/TargetCreatureOrPlayer.java b/Mage/src/main/java/mage/target/common/TargetCreatureOrPlayer.java index 3b55514126..8d0aa4f767 100644 --- a/Mage/src/main/java/mage/target/common/TargetCreatureOrPlayer.java +++ b/Mage/src/main/java/mage/target/common/TargetCreatureOrPlayer.java @@ -24,8 +24,7 @@ * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. -*/ - + */ package mage.target.common; import mage.constants.Zone; @@ -57,7 +56,11 @@ public class TargetCreatureOrPlayer extends TargetImpl { public TargetCreatureOrPlayer(int numTargets) { this(numTargets, numTargets, new FilterCreatureOrPlayer()); } - + + public TargetCreatureOrPlayer(FilterCreatureOrPlayer filter) { + this(1, 1, filter); + } + public TargetCreatureOrPlayer(int numTargets, int maxNumTargets) { this(numTargets, maxNumTargets, new FilterCreatureOrPlayer()); } @@ -123,8 +126,9 @@ public class TargetCreatureOrPlayer extends TargetImpl { } /** - * Checks if there are enough {@link Permanent} or {@link Player} that can be chosen. Should only be used - * for Ability targets since this checks for protection, shroud etc. + * Checks if there are enough {@link Permanent} or {@link Player} that can + * be chosen. Should only be used for Ability targets since this checks for + * protection, shroud etc. * * @param sourceId - the target event source * @param sourceControllerId - controller of the target event source @@ -135,7 +139,7 @@ public class TargetCreatureOrPlayer extends TargetImpl { public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { int count = 0; MageObject targetSource = game.getObject(sourceId); - for (UUID playerId: game.getState().getPlayersInRange(sourceControllerId, game)) { + for (UUID playerId : game.getState().getPlayersInRange(sourceControllerId, game)) { Player player = game.getPlayer(playerId); if (player != null && player.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(player, game)) { count++; @@ -144,7 +148,7 @@ public class TargetCreatureOrPlayer extends TargetImpl { } } } - for (Permanent permanent: game.getBattlefield().getActivePermanents(filter.getCreatureFilter(), sourceControllerId, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter.getCreatureFilter(), sourceControllerId, game)) { if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) { count++; if (count >= this.minNumberOfTargets) { @@ -156,8 +160,9 @@ public class TargetCreatureOrPlayer extends TargetImpl { } /** - * Checks if there are enough {@link Permanent} or {@link Player} that can be selected. Should not be used - * for Ability targets since this does not check for protection, shroud etc. + * Checks if there are enough {@link Permanent} or {@link Player} that can + * be selected. Should not be used for Ability targets since this does not + * check for protection, shroud etc. * * @param sourceControllerId - controller of the select event * @param game @@ -166,7 +171,7 @@ public class TargetCreatureOrPlayer extends TargetImpl { @Override public boolean canChoose(UUID sourceControllerId, Game game) { int count = 0; - for (UUID playerId: game.getState().getPlayersInRange(sourceControllerId, game)) { + for (UUID playerId : game.getState().getPlayersInRange(sourceControllerId, game)) { Player player = game.getPlayer(playerId); if (player != null && filter.match(player, game)) { count++; @@ -175,7 +180,7 @@ public class TargetCreatureOrPlayer extends TargetImpl { } } } - for (Permanent permanent: game.getBattlefield().getActivePermanents(filter.getCreatureFilter(), sourceControllerId, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter.getCreatureFilter(), sourceControllerId, game)) { if (filter.match(permanent, null, sourceControllerId, game)) { count++; if (count >= this.minNumberOfTargets) { @@ -190,7 +195,7 @@ public class TargetCreatureOrPlayer extends TargetImpl { public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { Set possibleTargets = new HashSet<>(); MageObject targetSource = game.getObject(sourceId); - for (UUID playerId: game.getState().getPlayersInRange(sourceControllerId, game)) { + for (UUID playerId : game.getState().getPlayersInRange(sourceControllerId, game)) { Player player = game.getPlayer(playerId); if (player != null && player.canBeTargetedBy(targetSource, sourceControllerId, game) @@ -198,7 +203,7 @@ public class TargetCreatureOrPlayer extends TargetImpl { possibleTargets.add(playerId); } } - for (Permanent permanent: game.getBattlefield().getActivePermanents(filter.getCreatureFilter(), sourceControllerId, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter.getCreatureFilter(), sourceControllerId, game)) { if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.getCreatureFilter().match(permanent, sourceId, sourceControllerId, game)) { possibleTargets.add(permanent.getId()); @@ -210,13 +215,13 @@ public class TargetCreatureOrPlayer extends TargetImpl { @Override public Set possibleTargets(UUID sourceControllerId, Game game) { Set possibleTargets = new HashSet<>(); - for (UUID playerId: game.getState().getPlayersInRange(sourceControllerId, game)) { + for (UUID playerId : game.getState().getPlayersInRange(sourceControllerId, game)) { Player player = game.getPlayer(playerId); if (player != null && filter.getPlayerFilter().match(player, game)) { possibleTargets.add(playerId); } } - for (Permanent permanent: game.getBattlefield().getActivePermanents(filter.getCreatureFilter(), sourceControllerId, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter.getCreatureFilter(), sourceControllerId, game)) { if (filter.getCreatureFilter().match(permanent, null, sourceControllerId, game)) { possibleTargets.add(permanent.getId()); } @@ -227,12 +232,11 @@ public class TargetCreatureOrPlayer extends TargetImpl { @Override public String getTargetedName(Game game) { StringBuilder sb = new StringBuilder(); - for (UUID targetId: getTargets()) { + for (UUID targetId : getTargets()) { Permanent permanent = game.getPermanent(targetId); if (permanent != null) { sb.append(permanent.getLogName()).append(" "); - } - else { + } else { Player player = game.getPlayer(targetId); if (player != null) { sb.append(player.getLogName()).append(" "); diff --git a/Mage/src/main/java/mage/target/common/TargetOpponentsCreaturePermanent.java b/Mage/src/main/java/mage/target/common/TargetOpponentsCreaturePermanent.java new file mode 100644 index 0000000000..9a17a690a3 --- /dev/null +++ b/Mage/src/main/java/mage/target/common/TargetOpponentsCreaturePermanent.java @@ -0,0 +1,45 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.target.common; + +import mage.filter.common.FilterOpponentsCreaturePermanent; + +/** + * + * @author Styxo + */ +public class TargetOpponentsCreaturePermanent extends TargetCreaturePermanent { + + public TargetOpponentsCreaturePermanent() { + this(1, 1, new FilterOpponentsCreaturePermanent(), false); + } + + public TargetOpponentsCreaturePermanent(int numTargets) { + this(numTargets, numTargets, new FilterOpponentsCreaturePermanent(), false); + } + + public TargetOpponentsCreaturePermanent(int minNumTargets, int maxNumTargets) { + this(minNumTargets, maxNumTargets, new FilterOpponentsCreaturePermanent(), false); + } + + public TargetOpponentsCreaturePermanent(FilterOpponentsCreaturePermanent filter) { + super(1, 1, filter, false); + } + + public TargetOpponentsCreaturePermanent(int minNumTargets, int maxNumTargets, FilterOpponentsCreaturePermanent filter, boolean notTarget) { + super(minNumTargets, maxNumTargets, filter, notTarget); + this.targetName = filter.getMessage(); + } + + public TargetOpponentsCreaturePermanent(final TargetOpponentsCreaturePermanent target) { + super(target); + } + + @Override + public TargetOpponentsCreaturePermanent copy() { + return new TargetOpponentsCreaturePermanent(this); + } +}