diff --git a/Mage.Sets/src/mage/cards/a/AjaniWiseCounselor.java b/Mage.Sets/src/mage/cards/a/AjaniWiseCounselor.java index 02198d974d..b264f97b35 100644 --- a/Mage.Sets/src/mage/cards/a/AjaniWiseCounselor.java +++ b/Mage.Sets/src/mage/cards/a/AjaniWiseCounselor.java @@ -1,25 +1,24 @@ package mage.cards.a; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.dynamicvalue.common.ControllerLifeCount; -import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.continuous.BoostControlledEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; -import mage.constants.SubType; -import mage.constants.SuperType; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.SubType; +import mage.constants.SuperType; import mage.counters.CounterType; -import mage.filter.StaticFilters; + +import java.util.UUID; /** - * * @author TheElk801 */ public final class AjaniWiseCounselor extends CardImpl { @@ -32,9 +31,8 @@ public final class AjaniWiseCounselor extends CardImpl { this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +2: You gain 1 life for each creature you control. - this.addAbility(new LoyaltyAbility(new GainLifeEffect( - new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURE) - ).setText("you gain 1 life for each creature you control"), 2)); + this.addAbility(new LoyaltyAbility(new GainLifeEffect(CreaturesYouControlCount.instance) + .setText("you gain 1 life for each creature you control"), 2)); // −3: Creatures you control get +2/+2 until end of turn. this.addAbility(new LoyaltyAbility( diff --git a/Mage.Sets/src/mage/cards/a/AngelOfRenewal.java b/Mage.Sets/src/mage/cards/a/AngelOfRenewal.java index 85b19cabf8..09c42722ee 100644 --- a/Mage.Sets/src/mage/cards/a/AngelOfRenewal.java +++ b/Mage.Sets/src/mage/cards/a/AngelOfRenewal.java @@ -1,20 +1,18 @@ - package mage.cards.a; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; -import mage.filter.StaticFilters; + +import java.util.UUID; /** - * * @author LevelX2 */ public final class AngelOfRenewal extends CardImpl { @@ -29,9 +27,7 @@ public final class AngelOfRenewal extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); // When Angel of Renewal enters the battlefield, you gain 1 life for each creature you control. - this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect( - new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURE) - ))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(CreaturesYouControlCount.instance))); } public AngelOfRenewal(final AngelOfRenewal card) { diff --git a/Mage.Sets/src/mage/cards/a/AngelicExaltation.java b/Mage.Sets/src/mage/cards/a/AngelicExaltation.java index a85f1acfe4..59284503ed 100644 --- a/Mage.Sets/src/mage/cards/a/AngelicExaltation.java +++ b/Mage.Sets/src/mage/cards/a/AngelicExaltation.java @@ -1,8 +1,7 @@ package mage.cards.a; import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.dynamicvalue.DynamicValue; -import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.cards.CardImpl; @@ -10,7 +9,6 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Zone; -import mage.filter.StaticFilters; import mage.game.Game; import mage.game.events.GameEvent; import mage.target.targetpointer.FixedTarget; @@ -41,10 +39,8 @@ public final class AngelicExaltation extends CardImpl { class AngelicExaltationAbility extends TriggeredAbilityImpl { - private static final DynamicValue xValue = new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURE); - public AngelicExaltationAbility() { - super(Zone.BATTLEFIELD, new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn, true), false); + super(Zone.BATTLEFIELD, new BoostTargetEffect(CreaturesYouControlCount.instance, CreaturesYouControlCount.instance, Duration.EndOfTurn, true), false); } public AngelicExaltationAbility(final AngelicExaltationAbility ability) { diff --git a/Mage.Sets/src/mage/cards/b/BattleHymn.java b/Mage.Sets/src/mage/cards/b/BattleHymn.java index acb098f955..d1693a5748 100644 --- a/Mage.Sets/src/mage/cards/b/BattleHymn.java +++ b/Mage.Sets/src/mage/cards/b/BattleHymn.java @@ -1,17 +1,15 @@ - package mage.cards.b; -import java.util.UUID; import mage.Mana; -import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; import mage.abilities.effects.mana.DynamicManaEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.StaticFilters; + +import java.util.UUID; /** - * * @author North */ public final class BattleHymn extends CardImpl { @@ -20,7 +18,7 @@ public final class BattleHymn extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}"); // Add {R} for each creature you control. - this.getSpellAbility().addEffect(new DynamicManaEffect(Mana.RedMana(1), new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURE))); + this.getSpellAbility().addEffect(new DynamicManaEffect(Mana.RedMana(1), CreaturesYouControlCount.instance)); } public BattleHymn(final BattleHymn card) { diff --git a/Mage.Sets/src/mage/cards/b/BattleSquadron.java b/Mage.Sets/src/mage/cards/b/BattleSquadron.java index 92964174fa..43ff8d9d8c 100644 --- a/Mage.Sets/src/mage/cards/b/BattleSquadron.java +++ b/Mage.Sets/src/mage/cards/b/BattleSquadron.java @@ -1,10 +1,8 @@ - package mage.cards.b; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; @@ -13,26 +11,25 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; + +import java.util.UUID; /** - * * @author fireshoes */ public final class BattleSquadron extends CardImpl { public BattleSquadron(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); this.subtype.add(SubType.GOBLIN); this.power = new MageInt(0); this.toughness = new MageInt(0); // Flying this.addAbility(FlyingAbility.getInstance()); - + // Battle Squadron's power and toughness are each equal to the number of creatures you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect( - new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(CreaturesYouControlCount.instance, Duration.EndOfGame))); } public BattleSquadron(final BattleSquadron card) { diff --git a/Mage.Sets/src/mage/cards/c/ChorusOfMight.java b/Mage.Sets/src/mage/cards/c/ChorusOfMight.java index 4480ae2717..04a33b7f04 100644 --- a/Mage.Sets/src/mage/cards/c/ChorusOfMight.java +++ b/Mage.Sets/src/mage/cards/c/ChorusOfMight.java @@ -1,8 +1,5 @@ - - package mage.cards.c; -import java.util.UUID; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; @@ -11,21 +8,22 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; -import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.StaticFilters; import mage.target.common.TargetCreaturePermanent; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class ChorusOfMight extends CardImpl { public ChorusOfMight(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{G}"); + - // Until end of turn, target creature gets +1/+1 for each creature you control and gains trample. - PermanentsOnBattlefieldCount value = new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()); + PermanentsOnBattlefieldCount value = new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURE); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new BoostTargetEffect(value, value, Duration.EndOfTurn, true)); this.getSpellAbility().addEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn)); diff --git a/Mage.Sets/src/mage/cards/c/CollectiveUnconscious.java b/Mage.Sets/src/mage/cards/c/CollectiveUnconscious.java index 9e9df9e93a..e3de225ee5 100644 --- a/Mage.Sets/src/mage/cards/c/CollectiveUnconscious.java +++ b/Mage.Sets/src/mage/cards/c/CollectiveUnconscious.java @@ -1,26 +1,25 @@ - package mage.cards.c; -import java.util.UUID; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.StaticFilters; + +import java.util.UUID; /** - * * @author Plopman */ public final class CollectiveUnconscious extends CardImpl { public CollectiveUnconscious(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{4}{G}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{G}{G}"); // Draw a card for each creature you control. - this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()))); + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURE))); } public CollectiveUnconscious(final CollectiveUnconscious card) { diff --git a/Mage.Sets/src/mage/cards/c/ConclavePhalanx.java b/Mage.Sets/src/mage/cards/c/ConclavePhalanx.java index b8efd50953..41257a501d 100644 --- a/Mage.Sets/src/mage/cards/c/ConclavePhalanx.java +++ b/Mage.Sets/src/mage/cards/c/ConclavePhalanx.java @@ -1,7 +1,5 @@ - package mage.cards.c; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; @@ -11,16 +9,17 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; -import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.StaticFilters; + +import java.util.UUID; /** - * * @author jonubuu */ public final class ConclavePhalanx extends CardImpl { public ConclavePhalanx(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.SOLDIER); @@ -31,7 +30,7 @@ public final class ConclavePhalanx extends CardImpl { this.addAbility(new ConvokeAbility()); // When Conclave Phalanx enters the battlefield, you gain 1 life for each creature you control. this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect( - new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent())))); + new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURE)))); } public ConclavePhalanx(final ConclavePhalanx card) { diff --git a/Mage.Sets/src/mage/cards/c/CrusaderOfOdric.java b/Mage.Sets/src/mage/cards/c/CrusaderOfOdric.java index 50aa3f3735..a14ae816bf 100644 --- a/Mage.Sets/src/mage/cards/c/CrusaderOfOdric.java +++ b/Mage.Sets/src/mage/cards/c/CrusaderOfOdric.java @@ -1,27 +1,25 @@ - package mage.cards.c; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; +import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; + +import java.util.UUID; /** - * * @author Loki */ public final class CrusaderOfOdric extends CardImpl { public CrusaderOfOdric(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.SOLDIER); @@ -29,7 +27,7 @@ public final class CrusaderOfOdric extends CardImpl { this.toughness = new MageInt(0); // Crusader of Odric's power and toughness are each equal to the number of creatures you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(CreaturesYouControlCount.instance, Duration.EndOfGame))); } public CrusaderOfOdric(final CrusaderOfOdric card) { diff --git a/Mage.Sets/src/mage/cards/d/DwarvenPriest.java b/Mage.Sets/src/mage/cards/d/DwarvenPriest.java index 3078944ff1..edf1d6dece 100644 --- a/Mage.Sets/src/mage/cards/d/DwarvenPriest.java +++ b/Mage.Sets/src/mage/cards/d/DwarvenPriest.java @@ -1,19 +1,17 @@ - package mage.cards.d; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; import mage.abilities.effects.common.GainLifeEffect; -import mage.constants.SubType; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.StaticFilters; +import mage.constants.SubType; + +import java.util.UUID; /** - * * @author TheElk801 */ public final class DwarvenPriest extends CardImpl { @@ -27,9 +25,7 @@ public final class DwarvenPriest extends CardImpl { this.toughness = new MageInt(4); // When Dwarven Priest enters the battlefield, you gain 1 life for each creature you control. - this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect( - new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURE) - ))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(CreaturesYouControlCount.instance))); } public DwarvenPriest(final DwarvenPriest card) { diff --git a/Mage.Sets/src/mage/cards/e/ElderOfLaurels.java b/Mage.Sets/src/mage/cards/e/ElderOfLaurels.java index 06414d035e..0114e1f558 100644 --- a/Mage.Sets/src/mage/cards/e/ElderOfLaurels.java +++ b/Mage.Sets/src/mage/cards/e/ElderOfLaurels.java @@ -1,29 +1,27 @@ - package mage.cards.e; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; +import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; +import java.util.UUID; + /** - * * @author North */ public final class ElderOfLaurels extends CardImpl { public ElderOfLaurels(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.ADVISOR); @@ -31,9 +29,8 @@ public final class ElderOfLaurels extends CardImpl { this.toughness = new MageInt(3); // {3}{G}: Target creature gets +X/+X until end of turn, where X is the number of creatures you control. - PermanentsOnBattlefieldCount amount = new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()); SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new BoostTargetEffect(amount, amount, Duration.EndOfTurn, true), + new BoostTargetEffect(CreaturesYouControlCount.instance, CreaturesYouControlCount.instance, Duration.EndOfTurn, true), new ManaCostsImpl("{3}{G}")); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/f/FolkMedicine.java b/Mage.Sets/src/mage/cards/f/FolkMedicine.java index f89a831614..ec8785eb2e 100644 --- a/Mage.Sets/src/mage/cards/f/FolkMedicine.java +++ b/Mage.Sets/src/mage/cards/f/FolkMedicine.java @@ -1,7 +1,5 @@ - package mage.cards.f; -import java.util.UUID; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; @@ -11,19 +9,20 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.TimingRule; -import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.StaticFilters; + +import java.util.UUID; /** - * * @author fireshoes */ public final class FolkMedicine extends CardImpl { public FolkMedicine(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{G}"); // You gain 1 life for each creature you control. - DynamicValue amount = new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()); + DynamicValue amount = new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURE); this.getSpellAbility().addEffect(new GainLifeEffect(amount)); // Flashback {1}{W} this.addAbility(new FlashbackAbility(new ManaCostsImpl("{1}{W}"), TimingRule.INSTANT)); diff --git a/Mage.Sets/src/mage/cards/f/FoundryChampion.java b/Mage.Sets/src/mage/cards/f/FoundryChampion.java index 235f269014..20fe37f3b7 100644 --- a/Mage.Sets/src/mage/cards/f/FoundryChampion.java +++ b/Mage.Sets/src/mage/cards/f/FoundryChampion.java @@ -1,12 +1,11 @@ package mage.cards.f; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.cards.CardImpl; @@ -15,11 +14,11 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; import mage.target.common.TargetAnyTarget; +import java.util.UUID; + /** - * * @author Plopman */ public final class FoundryChampion extends CardImpl { @@ -33,7 +32,7 @@ public final class FoundryChampion extends CardImpl { this.toughness = new MageInt(4); //When Foundry Champion enters the battlefield, it deals damage to any target equal to the number of creatures you control. - Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()), "it")); + Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(CreaturesYouControlCount.instance, "it")); ability.addTarget(new TargetAnyTarget()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/g/GeistHonoredMonk.java b/Mage.Sets/src/mage/cards/g/GeistHonoredMonk.java index 7b11a00be5..d06740974f 100644 --- a/Mage.Sets/src/mage/cards/g/GeistHonoredMonk.java +++ b/Mage.Sets/src/mage/cards/g/GeistHonoredMonk.java @@ -1,30 +1,29 @@ - package mage.cards.g; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; +import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; import mage.game.permanent.token.SpiritWhiteToken; +import java.util.UUID; + /** * @author nantuko */ public final class GeistHonoredMonk extends CardImpl { public GeistHonoredMonk(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.MONK); @@ -34,7 +33,7 @@ public final class GeistHonoredMonk extends CardImpl { this.addAbility(VigilanceAbility.getInstance()); // Geist-Honored Monk's power and toughness are each equal to the number of creatures you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(CreaturesYouControlCount.instance, Duration.EndOfGame))); // When Geist-Honored Monk enters the battlefield, create two 1/1 white Spirit creature tokens with flying. this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new SpiritWhiteToken("ISD"), 2))); diff --git a/Mage.Sets/src/mage/cards/g/GoblinLyre.java b/Mage.Sets/src/mage/cards/g/GoblinLyre.java index 1626668511..822f0633d1 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinLyre.java +++ b/Mage.Sets/src/mage/cards/g/GoblinLyre.java @@ -1,25 +1,23 @@ - package mage.cards.g; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; -import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetOpponentOrPlaneswalker; +import java.util.UUID; + /** - * * @author L_J */ public final class GoblinLyre extends CardImpl { @@ -66,7 +64,7 @@ class GoblinLyreEffect extends OneShotEffect { Player opponent = game.getPlayerOrPlaneswalkerController(getTargetPointer().getFirst(game, source)); if (controller != null) { if (controller.flipCoin(source, game, true)) { - int damage = new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()).calculate(game, source, this); + int damage = CreaturesYouControlCount.instance.calculate(game, source, this); if (opponent != null) { return game.damagePlayerOrPlaneswalker(source.getFirstTarget(), damage, source.getSourceId(), game, false, true) > 0; } diff --git a/Mage.Sets/src/mage/cards/h/HarshSustenance.java b/Mage.Sets/src/mage/cards/h/HarshSustenance.java index 45fee5cd27..b7ed392d41 100644 --- a/Mage.Sets/src/mage/cards/h/HarshSustenance.java +++ b/Mage.Sets/src/mage/cards/h/HarshSustenance.java @@ -1,34 +1,30 @@ - package mage.cards.h; -import java.util.UUID; -import mage.abilities.dynamicvalue.DynamicValue; -import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterControlledCreaturePermanent; import mage.target.common.TargetAnyTarget; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class HarshSustenance extends CardImpl { public HarshSustenance(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{W}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W}{B}"); // Harsh Sustenance deals X damage to any target and you gain X life, where X is the number of creatures you control. - DynamicValue xValue = new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()); - Effect effect = new DamageTargetEffect(xValue); + Effect effect = new DamageTargetEffect(CreaturesYouControlCount.instance); effect.setText("{this} deals X damage to any target"); getSpellAbility().addEffect(effect); getSpellAbility().addTarget(new TargetAnyTarget()); - effect = new GainLifeEffect(xValue); + effect = new GainLifeEffect(CreaturesYouControlCount.instance); effect.setText("and you gain X life, where X is the number of creatures you control"); getSpellAbility().addEffect(effect); } diff --git a/Mage.Sets/src/mage/cards/j/JunkyoBell.java b/Mage.Sets/src/mage/cards/j/JunkyoBell.java index 8b0cc736cb..af47e08373 100644 --- a/Mage.Sets/src/mage/cards/j/JunkyoBell.java +++ b/Mage.Sets/src/mage/cards/j/JunkyoBell.java @@ -1,12 +1,10 @@ - package mage.cards.j; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; -import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.SacrificeTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; @@ -16,12 +14,13 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.TargetController; -import mage.filter.common.FilterControlledCreaturePermanent; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.targetpointer.FixedTarget; +import java.util.UUID; + /** * @author LevelX */ @@ -32,8 +31,10 @@ public final class JunkyoBell extends CardImpl { // At the beginning of your upkeep, you may have target creature you control get +X/+X until end of turn, // where X is the number of creatures you control. If you do, sacrifice that creature at the beginning of the next end step. - PermanentsOnBattlefieldCount amount = new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()); - Ability ability = new BeginningOfUpkeepTriggeredAbility(new BoostTargetEffect(amount, amount, Duration.EndOfTurn, true), TargetController.YOU, true); + Ability ability = new BeginningOfUpkeepTriggeredAbility( + new BoostTargetEffect(CreaturesYouControlCount.instance, CreaturesYouControlCount.instance, Duration.EndOfTurn, true), + TargetController.YOU, + true); ability.addTarget(new TargetControlledCreaturePermanent()); ability.addEffect(new JunkyoBellSacrificeEffect()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/m/MajesticMyriarch.java b/Mage.Sets/src/mage/cards/m/MajesticMyriarch.java index 7224e608d1..6bf725d945 100644 --- a/Mage.Sets/src/mage/cards/m/MajesticMyriarch.java +++ b/Mage.Sets/src/mage/cards/m/MajesticMyriarch.java @@ -1,7 +1,5 @@ - package mage.cards.m; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.BeginningOfCombatTriggeredAbility; @@ -13,32 +11,17 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; -import mage.abilities.keyword.DeathtouchAbility; -import mage.abilities.keyword.DoubleStrikeAbility; -import mage.abilities.keyword.FirstStrikeAbility; -import mage.abilities.keyword.FlyingAbility; -import mage.abilities.keyword.HasteAbility; -import mage.abilities.keyword.HexproofAbility; -import mage.abilities.keyword.IndestructibleAbility; -import mage.abilities.keyword.LifelinkAbility; -import mage.abilities.keyword.MenaceAbility; -import mage.abilities.keyword.ReachAbility; -import mage.abilities.keyword.TrampleAbility; -import mage.abilities.keyword.VigilanceAbility; +import mage.abilities.keyword.*; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.TargetController; -import mage.constants.Zone; +import mage.constants.*; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.mageobject.AbilityPredicate; import mage.game.Game; +import java.util.UUID; + /** - * * @author fireshoes */ public final class MajesticMyriarch extends CardImpl { @@ -51,7 +34,7 @@ public final class MajesticMyriarch extends CardImpl { this.toughness = new MageInt(0); // Majestic Myriarch's power and toughness are each equal to twice the number of creatures you control. - DynamicValue xValue= new MultipliedValue(new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()), 2); + DynamicValue xValue = new MultipliedValue(new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()), 2); Effect effect = new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame); effect.setText("{this}'s power and toughness are each equal to twice the number of creatures you control"); this.addAbility(new SimpleStaticAbility(Zone.ALL, effect)); @@ -104,7 +87,7 @@ class MajesticMyriarchEffect extends OneShotEffect { MajesticMyriarchEffect() { super(Outcome.BoostCreature); this.staticText = "if you control a creature with flying, Majestic Myriarch gains flying until end of turn. " + - "The same is true for first strike, double strike, deathtouch, haste, hexproof, indestructible, lifelink, menace, reach, trample, and vigilance."; + "The same is true for first strike, double strike, deathtouch, haste, hexproof, indestructible, lifelink, menace, reach, trample, and vigilance."; } MajesticMyriarchEffect(final MajesticMyriarchEffect effect) { diff --git a/Mage.Sets/src/mage/cards/m/MassiveRaid.java b/Mage.Sets/src/mage/cards/m/MassiveRaid.java index 02504c5141..6247bbdc85 100644 --- a/Mage.Sets/src/mage/cards/m/MassiveRaid.java +++ b/Mage.Sets/src/mage/cards/m/MassiveRaid.java @@ -1,27 +1,24 @@ - package mage.cards.m; -import java.util.UUID; -import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterControlledCreaturePermanent; import mage.target.common.TargetAnyTarget; +import java.util.UUID; + /** - * * @author jeffwadsworth */ public final class MassiveRaid extends CardImpl { public MassiveRaid(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{R}{R}"); - + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}{R}"); // Massive Raid deals damage to any target equal to the number of creatures you control. - this.getSpellAbility().addEffect(new DamageTargetEffect(new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()))); + this.getSpellAbility().addEffect(new DamageTargetEffect(CreaturesYouControlCount.instance)); this.getSpellAbility().addTarget(new TargetAnyTarget()); } diff --git a/Mage.Sets/src/mage/cards/m/MasteryOfTheUnseen.java b/Mage.Sets/src/mage/cards/m/MasteryOfTheUnseen.java index 998060e9eb..fd31f8c868 100644 --- a/Mage.Sets/src/mage/cards/m/MasteryOfTheUnseen.java +++ b/Mage.Sets/src/mage/cards/m/MasteryOfTheUnseen.java @@ -1,7 +1,5 @@ - package mage.cards.m; -import java.util.UUID; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.TurnedFaceUpAllTriggeredAbility; import mage.abilities.costs.mana.ManaCostsImpl; @@ -12,23 +10,24 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.StaticFilters; import mage.filter.common.FilterControlledPermanent; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class MasteryOfTheUnseen extends CardImpl { public MasteryOfTheUnseen(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); // Whenever a permanent you control is turned face up, you gain 1 life for each creature you control. this.addAbility(new TurnedFaceUpAllTriggeredAbility( - new GainLifeEffect(new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent())), + new GainLifeEffect(new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURE)), new FilterControlledPermanent("a permanent you control"))); - + // {3}{W}: Manifest the top card of your library. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ManifestEffect(1), new ManaCostsImpl("{3}{W}"))); } diff --git a/Mage.Sets/src/mage/cards/m/MightOfTheMasses.java b/Mage.Sets/src/mage/cards/m/MightOfTheMasses.java index cfce861ea9..4a2fb1a42f 100644 --- a/Mage.Sets/src/mage/cards/m/MightOfTheMasses.java +++ b/Mage.Sets/src/mage/cards/m/MightOfTheMasses.java @@ -1,27 +1,26 @@ - package mage.cards.m; -import java.util.UUID; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; -import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.StaticFilters; import mage.target.common.TargetCreaturePermanent; +import java.util.UUID; + /** - * * @author North */ public final class MightOfTheMasses extends CardImpl { public MightOfTheMasses(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{G}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}"); - - PermanentsOnBattlefieldCount value = new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()); + // Target creature gets +1/+1 until end of turn for each creature you control. + PermanentsOnBattlefieldCount value = new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURE); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new BoostTargetEffect(value, value, Duration.EndOfTurn, true)); } diff --git a/Mage.Sets/src/mage/cards/m/MobJustice.java b/Mage.Sets/src/mage/cards/m/MobJustice.java index 8bc8519c22..a01faf04fb 100644 --- a/Mage.Sets/src/mage/cards/m/MobJustice.java +++ b/Mage.Sets/src/mage/cards/m/MobJustice.java @@ -1,18 +1,16 @@ - package mage.cards.m; -import java.util.UUID; -import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterControlledCreaturePermanent; import mage.target.common.TargetPlayerOrPlaneswalker; +import java.util.UUID; + /** - * * @author LoneFox */ public final class MobJustice extends CardImpl { @@ -21,7 +19,7 @@ public final class MobJustice extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}"); // Mob Justice deals damage to target player equal to the number of creatures you control. - Effect effect = new DamageTargetEffect(new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent())); + Effect effect = new DamageTargetEffect(CreaturesYouControlCount.instance); effect.setText("{this} deals damage to target player or planeswalker equal to the number of creatures you control"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetPlayerOrPlaneswalker()); diff --git a/Mage.Sets/src/mage/cards/p/PennonBlade.java b/Mage.Sets/src/mage/cards/p/PennonBlade.java index d4ba43508b..7dc4018141 100644 --- a/Mage.Sets/src/mage/cards/p/PennonBlade.java +++ b/Mage.Sets/src/mage/cards/p/PennonBlade.java @@ -1,7 +1,5 @@ - package mage.cards.p; -import java.util.UUID; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; @@ -10,23 +8,27 @@ import mage.abilities.keyword.EquipAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Outcome; +import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.StaticFilters; + +import java.util.UUID; /** - * * @author North */ public final class PennonBlade extends CardImpl { public PennonBlade(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); this.subtype.add(SubType.EQUIPMENT); - PermanentsOnBattlefieldCount value = new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()); + // Equipped creature gets +1/+1 for each creature you control. + PermanentsOnBattlefieldCount value = new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURE); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(value, value))); + + // Equip {4} this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(4))); } diff --git a/Mage.Sets/src/mage/cards/s/SaprolingSymbiosis.java b/Mage.Sets/src/mage/cards/s/SaprolingSymbiosis.java index 865ef2088c..f13de832cd 100644 --- a/Mage.Sets/src/mage/cards/s/SaprolingSymbiosis.java +++ b/Mage.Sets/src/mage/cards/s/SaprolingSymbiosis.java @@ -1,7 +1,5 @@ - package mage.cards.s; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.PayMoreToCastAsThoughtItHadFlashAbility; import mage.abilities.costs.mana.ManaCostsImpl; @@ -11,25 +9,27 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.StaticFilters; import mage.game.permanent.token.SaprolingToken; +import java.util.UUID; + /** - * * @author LoneFox - * */ public final class SaprolingSymbiosis extends CardImpl { public SaprolingSymbiosis(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}"); - Effect effect = new CreateTokenEffect(new SaprolingToken(), new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent())); - // You may cast Saproling Symbiosis as though it had flash if you pay {2} more to cast it. + Effect effect = new CreateTokenEffect(new SaprolingToken(), new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURE)); + + // You may cast Saproling Symbiosis as though it had flash if you pay {2} more to cast it. (You may cast it any time you could cast an instant.) Ability ability = new PayMoreToCastAsThoughtItHadFlashAbility(this, new ManaCostsImpl("{2}")); ability.addEffect(effect); ability.setRuleAtTheTop(true); this.addAbility(ability); + // Create a 1/1 green Saproling creature token for each creature you control. this.getSpellAbility().addEffect(effect); } diff --git a/Mage.Sets/src/mage/cards/s/ShamanicRevelation.java b/Mage.Sets/src/mage/cards/s/ShamanicRevelation.java index 2b3916e3f6..2acd43e060 100644 --- a/Mage.Sets/src/mage/cards/s/ShamanicRevelation.java +++ b/Mage.Sets/src/mage/cards/s/ShamanicRevelation.java @@ -1,7 +1,5 @@ - package mage.cards.s; -import java.util.UUID; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.Effect; @@ -11,11 +9,13 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.ComparisonType; +import mage.filter.StaticFilters; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.mageobject.PowerPredicate; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class ShamanicRevelation extends CardImpl { @@ -27,17 +27,16 @@ public final class ShamanicRevelation extends CardImpl { } public ShamanicRevelation(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{G}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}{G}"); // Draw a card for each creature you control. - this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()))); + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURE))); // Ferocious — You gain 4 life for each creature you control with power 4 or greater. DynamicValue amount = new PermanentsOnBattlefieldCount(filter, 4); Effect effect = new GainLifeEffect(amount); effect.setText("
Ferocious — You gain 4 life for each creature you control with power 4 or greater."); this.getSpellAbility().addEffect(effect); - } public ShamanicRevelation(final ShamanicRevelation card) { diff --git a/Mage.Sets/src/mage/cards/t/TishanaVoiceOfThunder.java b/Mage.Sets/src/mage/cards/t/TishanaVoiceOfThunder.java index 2a83a5105e..dc58159593 100644 --- a/Mage.Sets/src/mage/cards/t/TishanaVoiceOfThunder.java +++ b/Mage.Sets/src/mage/cards/t/TishanaVoiceOfThunder.java @@ -1,7 +1,5 @@ - package mage.cards.t; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; @@ -14,15 +12,12 @@ import mage.abilities.effects.common.continuous.MaximumHandSizeControllerEffect; import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.Duration; -import mage.constants.SuperType; -import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import mage.constants.*; +import mage.filter.StaticFilters; + +import java.util.UUID; /** - * * @author spjspj */ public final class TishanaVoiceOfThunder extends CardImpl { @@ -45,7 +40,7 @@ public final class TishanaVoiceOfThunder extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); // When Tishana enters the battlefield, draw a card for each creature you control. - this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent())))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURE)))); } public TishanaVoiceOfThunder(final TishanaVoiceOfThunder card) { diff --git a/Mage.Sets/src/mage/cards/v/VeteranWarleader.java b/Mage.Sets/src/mage/cards/v/VeteranWarleader.java index 829f2ff652..8d3b38361c 100644 --- a/Mage.Sets/src/mage/cards/v/VeteranWarleader.java +++ b/Mage.Sets/src/mage/cards/v/VeteranWarleader.java @@ -1,16 +1,12 @@ - package mage.cards.v; -import java.util.HashSet; -import java.util.Set; -import java.util.UUID; import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.common.TapTargetCost; -import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; @@ -23,7 +19,6 @@ import mage.cards.CardSetInfo; import mage.choices.Choice; import mage.choices.ChoiceImpl; import mage.constants.*; -import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; @@ -33,8 +28,11 @@ import mage.game.Game; import mage.players.Player; import mage.target.common.TargetControlledPermanent; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** - * * @author fireshoes */ public final class VeteranWarleader extends CardImpl { @@ -57,7 +55,7 @@ public final class VeteranWarleader extends CardImpl { // Veteran Warleader's power and toughness are each equal to the number of creatures you control. this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect( - new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()), Duration.EndOfGame))); + CreaturesYouControlCount.instance, Duration.EndOfGame))); // Tap another untapped Ally you control: Veteran Warleader gains your choice of first strike, vigilance, or trample until end of turn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, diff --git a/Mage.Sets/src/mage/cards/w/WayfaringTemple.java b/Mage.Sets/src/mage/cards/w/WayfaringTemple.java index 77fc984065..13085d5f77 100644 --- a/Mage.Sets/src/mage/cards/w/WayfaringTemple.java +++ b/Mage.Sets/src/mage/cards/w/WayfaringTemple.java @@ -1,37 +1,34 @@ - - package mage.cards.w; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; import mage.abilities.effects.common.PopulateEffect; import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; +import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; + +import java.util.UUID; /** - * * @author LevelX2 */ public final class WayfaringTemple extends CardImpl { public WayfaringTemple(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}{W}"); this.subtype.add(SubType.ELEMENTAL); this.power = new MageInt(0); this.toughness = new MageInt(0); // Wayfaring Temple's power and toughness are each equal to the number of creatures you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(CreaturesYouControlCount.instance, Duration.EndOfGame))); // Whenever Wayfaring Temple deals combat damage to a player, populate. (Create a token that's a copy of a creature token you control.) this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new PopulateEffect(), false)); diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/CreaturesYouControlCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/CreaturesYouControlCount.java new file mode 100644 index 0000000000..16ae508e8f --- /dev/null +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/CreaturesYouControlCount.java @@ -0,0 +1,35 @@ +package mage.abilities.dynamicvalue.common; + +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.filter.StaticFilters; +import mage.game.Game; + +/** + * @author JayDi85 + */ +public enum CreaturesYouControlCount implements DynamicValue { + + instance; + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + return game.getBattlefield().count(StaticFilters.FILTER_CONTROLLED_CREATURES, sourceAbility.getSourceId(), sourceAbility.getControllerId(), game); + } + + @Override + public CreaturesYouControlCount copy() { + return instance; + } + + @Override + public String toString() { + return "X"; + } + + @Override + public String getMessage() { + return "creatures you control"; + } +} diff --git a/Mage/src/main/java/mage/game/permanent/token/VoiceOfResurgenceToken.java b/Mage/src/main/java/mage/game/permanent/token/VoiceOfResurgenceToken.java index 94fa0a262b..cf5134219e 100644 --- a/Mage/src/main/java/mage/game/permanent/token/VoiceOfResurgenceToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/VoiceOfResurgenceToken.java @@ -1,18 +1,15 @@ - package mage.game.permanent.token; -import mage.constants.CardType; -import mage.constants.SubType; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; /** - * * @author spjspj */ public final class VoiceOfResurgenceToken extends TokenImpl { @@ -28,8 +25,9 @@ public final class VoiceOfResurgenceToken extends TokenImpl { power = new MageInt(0); toughness = new MageInt(0); + // This creature's power and toughness are each equal to the number of creatures you control. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetPowerToughnessSourceEffect( - new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()), Duration.EndOfGame))); + CreaturesYouControlCount.instance, Duration.EndOfGame))); } public VoiceOfResurgenceToken(final VoiceOfResurgenceToken token) {