diff --git a/Mage.Sets/src/mage/cards/d/DragonsguardElite.java b/Mage.Sets/src/mage/cards/d/DragonsguardElite.java index 9b5e2d5d4f..4d830d18d0 100644 --- a/Mage.Sets/src/mage/cards/d/DragonsguardElite.java +++ b/Mage.Sets/src/mage/cards/d/DragonsguardElite.java @@ -4,7 +4,7 @@ import mage.MageInt; import mage.abilities.common.MagecraftAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.DoubleP1P1CountersSourceEffect; +import mage.abilities.effects.common.DoubleCountersSourceEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -31,7 +31,7 @@ public final class DragonsguardElite extends CardImpl { this.addAbility(new MagecraftAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()))); // {4}{G}{G}: Double the number of +1/+1 counters on Dragonsguard Elite. - this.addAbility(new SimpleActivatedAbility(new DoubleP1P1CountersSourceEffect(), new ManaCostsImpl<>("{4}{G}{G}"))); + this.addAbility(new SimpleActivatedAbility(new DoubleCountersSourceEffect(CounterType.P1P1), new ManaCostsImpl<>("{4}{G}{G}"))); } private DragonsguardElite(final DragonsguardElite card) { diff --git a/Mage.Sets/src/mage/cards/p/ParadoxZone.java b/Mage.Sets/src/mage/cards/p/ParadoxZone.java new file mode 100644 index 0000000000..f763ca33bc --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/ParadoxZone.java @@ -0,0 +1,55 @@ +package mage.cards.p; + +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.CountersSourceCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DoubleCountersSourceEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.TargetController; +import mage.counters.CounterType; +import mage.game.permanent.token.QuandrixToken; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class ParadoxZone extends CardImpl { + + private static final DynamicValue xValue = new CountersSourceCount(CounterType.GROWTH); + + public ParadoxZone(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{4}{G}"); + + // Paradox Zone enters the battlefield with a growth counter on it. + this.addAbility(new EntersBattlefieldAbility( + new AddCountersSourceEffect(CounterType.GROWTH.createInstance()), + "with a growth counter on it" + )); + + // At the beginning of your end step, double the number of growth counters on Paradox Zone. Then create a 0/0 blue and green Fractal creature token. Put X +1/+1 counters on it, where X is the number of growth counters on Paradox Zone. + Ability ability = new BeginningOfEndStepTriggeredAbility( + new DoubleCountersSourceEffect(CounterType.GROWTH), TargetController.YOU, false + ); + Effect effect = QuandrixToken.getEffect( + xValue, "Put X +1/+1 counters on it, where X is the number of growth counters on {this}" + ); + ability.addEffect(effect.concatBy("Then")); + this.addAbility(ability); + } + + private ParadoxZone(final ParadoxZone card) { + super(card); + } + + @Override + public ParadoxZone copy() { + return new ParadoxZone(this); + } +} diff --git a/Mage.Sets/src/mage/cards/p/PrimordialHydra.java b/Mage.Sets/src/mage/cards/p/PrimordialHydra.java index 0a3b070f73..2732b3c639 100644 --- a/Mage.Sets/src/mage/cards/p/PrimordialHydra.java +++ b/Mage.Sets/src/mage/cards/p/PrimordialHydra.java @@ -7,7 +7,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.Condition; import mage.abilities.condition.common.SourceHasCounterCondition; import mage.abilities.decorator.ConditionalContinuousEffect; -import mage.abilities.effects.common.DoubleP1P1CountersSourceEffect; +import mage.abilities.effects.common.DoubleCountersSourceEffect; import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; import mage.abilities.keyword.TrampleAbility; @@ -41,7 +41,7 @@ public final class PrimordialHydra extends CardImpl { // At the beginning of your upkeep, double the number of +1/+1 counters on Primordial Hydra. this.addAbility(new BeginningOfUpkeepTriggeredAbility( - new DoubleP1P1CountersSourceEffect(), TargetController.YOU, false + new DoubleCountersSourceEffect(CounterType.P1P1), TargetController.YOU, false )); // Primordial Hydra has trample as long as it has ten or more +1/+1 counters on it. diff --git a/Mage.Sets/src/mage/cards/s/Solarion.java b/Mage.Sets/src/mage/cards/s/Solarion.java index bb37de92fb..bfa4c87cd2 100644 --- a/Mage.Sets/src/mage/cards/s/Solarion.java +++ b/Mage.Sets/src/mage/cards/s/Solarion.java @@ -3,12 +3,13 @@ package mage.cards.s; import mage.MageInt; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.effects.common.DoubleP1P1CountersSourceEffect; +import mage.abilities.effects.common.DoubleCountersSourceEffect; import mage.abilities.keyword.SunburstAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; +import mage.counters.CounterType; import java.util.UUID; @@ -27,7 +28,7 @@ public final class Solarion extends CardImpl { this.addAbility(new SunburstAbility(this)); // {tap}: Double the number of +1/+1 counters on Solarion. - this.addAbility(new SimpleActivatedAbility(new DoubleP1P1CountersSourceEffect(), new TapSourceCost())); + this.addAbility(new SimpleActivatedAbility(new DoubleCountersSourceEffect(CounterType.P1P1), new TapSourceCost())); } private Solarion(final Solarion card) { diff --git a/Mage.Sets/src/mage/cards/v/VoraciousHydra.java b/Mage.Sets/src/mage/cards/v/VoraciousHydra.java index dcbc7e72d1..35e7a09775 100644 --- a/Mage.Sets/src/mage/cards/v/VoraciousHydra.java +++ b/Mage.Sets/src/mage/cards/v/VoraciousHydra.java @@ -5,7 +5,7 @@ import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.effects.common.DoubleP1P1CountersSourceEffect; +import mage.abilities.effects.common.DoubleCountersSourceEffect; import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.abilities.effects.common.FightTargetSourceEffect; import mage.abilities.keyword.TrampleAbility; @@ -41,7 +41,7 @@ public final class VoraciousHydra extends CardImpl { // When Voracious Hydra enters the battlefield, choose one — // • Double the number of +1/+1 counters on Voracious Hydra. - Ability ability = new EntersBattlefieldTriggeredAbility(new DoubleP1P1CountersSourceEffect(), false); + Ability ability = new EntersBattlefieldTriggeredAbility(new DoubleCountersSourceEffect(CounterType.P1P1), false); // • Voracious Hydra fights target creature you don't control. Mode mode = new Mode( diff --git a/Mage.Sets/src/mage/sets/Commander2021Edition.java b/Mage.Sets/src/mage/sets/Commander2021Edition.java index 7b10b302f8..efe9a98c18 100644 --- a/Mage.Sets/src/mage/sets/Commander2021Edition.java +++ b/Mage.Sets/src/mage/sets/Commander2021Edition.java @@ -60,6 +60,7 @@ public final class Commander2021Edition extends ExpansionSet { cards.add(new SetCardInfo("Mind Stone", 251, Rarity.COMMON, mage.cards.m.MindStone.class)); cards.add(new SetCardInfo("Monologue Tax", 19, Rarity.RARE, mage.cards.m.MonologueTax.class)); cards.add(new SetCardInfo("Myr Battlesphere", 253, Rarity.RARE, mage.cards.m.MyrBattlesphere.class)); + cards.add(new SetCardInfo("Paradox Zone", 64, Rarity.RARE, mage.cards.p.ParadoxZone.class)); cards.add(new SetCardInfo("Phyrexia's Core", 309, Rarity.UNCOMMON, mage.cards.p.PhyrexiasCore.class)); cards.add(new SetCardInfo("Pia Nalaar", 177, Rarity.RARE, mage.cards.p.PiaNalaar.class)); cards.add(new SetCardInfo("Pilgrim's Eye", 257, Rarity.COMMON, mage.cards.p.PilgrimsEye.class)); diff --git a/Mage/src/main/java/mage/abilities/effects/common/DoubleCountersSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DoubleCountersSourceEffect.java new file mode 100644 index 0000000000..2879e39716 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/effects/common/DoubleCountersSourceEffect.java @@ -0,0 +1,43 @@ +package mage.abilities.effects.common; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * @author TheElk801 + */ +public class DoubleCountersSourceEffect extends OneShotEffect { + + private final CounterType counterType; + + public DoubleCountersSourceEffect(CounterType counterType) { + super(Outcome.Benefit); + staticText = "double the number of " + counterType.getName() + " counters on {this}"; + this.counterType = counterType; + } + + private DoubleCountersSourceEffect(final DoubleCountersSourceEffect effect) { + super(effect); + this.counterType = effect.counterType; + } + + @Override + public DoubleCountersSourceEffect copy() { + return new DoubleCountersSourceEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = source.getSourcePermanentIfItStillExists(game); + if (permanent == null) { + return false; + } + return permanent.addCounters(counterType.createInstance( + permanent.getCounters(game).getCount(counterType) + ), source.getControllerId(), source, game); + } +} diff --git a/Mage/src/main/java/mage/abilities/effects/common/DoubleP1P1CountersSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DoubleP1P1CountersSourceEffect.java deleted file mode 100644 index 4216532bcd..0000000000 --- a/Mage/src/main/java/mage/abilities/effects/common/DoubleP1P1CountersSourceEffect.java +++ /dev/null @@ -1,39 +0,0 @@ -package mage.abilities.effects.common; - -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; -import mage.constants.Outcome; -import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; - -/** - * @author TheElk801 - */ -public class DoubleP1P1CountersSourceEffect extends OneShotEffect { - - public DoubleP1P1CountersSourceEffect() { - super(Outcome.Benefit); - staticText = "double the number of +1/+1 counters on {this}"; - } - - private DoubleP1P1CountersSourceEffect(final DoubleP1P1CountersSourceEffect effect) { - super(effect); - } - - @Override - public DoubleP1P1CountersSourceEffect copy() { - return new DoubleP1P1CountersSourceEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = source.getSourcePermanentIfItStillExists(game); - if (permanent == null) { - return false; - } - return permanent.addCounters(CounterType.P1P1.createInstance( - permanent.getCounters(game).getCount(CounterType.P1P1) - ), source.getControllerId(), source, game); - } -}