diff --git a/Mage.Sets/src/mage/cards/a/Aetherspouts.java b/Mage.Sets/src/mage/cards/a/Aetherspouts.java index 717f20e6292..e2bfdb27cfc 100644 --- a/Mage.Sets/src/mage/cards/a/Aetherspouts.java +++ b/Mage.Sets/src/mage/cards/a/Aetherspouts.java @@ -83,7 +83,7 @@ class AetherspoutsEffect extends OneShotEffect { do { List permanentsToTop = new ArrayList<>(); List permanentsToBottom = new ArrayList<>(); - for (Permanent permanent : game.getState().getBattlefield().getActivePermanents(new FilterAttackingCreature(), player.getId(), source, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterAttackingCreature(), player.getId(), source, game)) { if (permanent.isOwnedBy(player.getId())) { if (player.chooseUse(outcome, "Put " + permanent.getLogName() + " to the top? (else it goes to bottom)", source, game)) { permanentsToTop.add(permanent); diff --git a/Mage.Sets/src/mage/cards/b/BlinkmothUrn.java b/Mage.Sets/src/mage/cards/b/BlinkmothUrn.java index b0309f72c06..167922f8419 100644 --- a/Mage.Sets/src/mage/cards/b/BlinkmothUrn.java +++ b/Mage.Sets/src/mage/cards/b/BlinkmothUrn.java @@ -69,7 +69,7 @@ class BlinkmothUrnEffect extends OneShotEffect { Permanent sourcePermanent = game.getPermanent(source.getSourceId()); if (player != null && sourcePermanent != null) { player.getManaPool().addMana(Mana.ColorlessMana( - game.getState().getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game). + game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game). size()), game, source, false); return true; } diff --git a/Mage.Sets/src/mage/cards/b/BloodSun.java b/Mage.Sets/src/mage/cards/b/BloodSun.java index 7ad86159545..aabd79a4215 100644 --- a/Mage.Sets/src/mage/cards/b/BloodSun.java +++ b/Mage.Sets/src/mage/cards/b/BloodSun.java @@ -63,7 +63,7 @@ class BloodSunEffect extends ContinuousEffectImpl { public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - for (Permanent permanent : game.getState().getBattlefield().getActivePermanents(StaticFilters.FILTER_LANDS, player.getId(), source, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_LANDS, player.getId(), source, game)) { switch (layer) { case AbilityAddingRemovingEffects_6: List toRemove = new ArrayList<>(); diff --git a/Mage.Sets/src/mage/cards/c/CalmingVerse.java b/Mage.Sets/src/mage/cards/c/CalmingVerse.java index 43df7631ab8..8e9389e9e4b 100644 --- a/Mage.Sets/src/mage/cards/c/CalmingVerse.java +++ b/Mage.Sets/src/mage/cards/c/CalmingVerse.java @@ -83,7 +83,7 @@ class CalmingVerseEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - if (game.getState().getBattlefield().countAll(untappedLandFilter, controller.getId(), game) > 0) { + if (game.getBattlefield().countAll(untappedLandFilter, controller.getId(), game) > 0) { for (Permanent permanent : game.getBattlefield().getActivePermanents(controlledEnchantmentsFilter, source.getControllerId(), source, game)) { permanent.destroy(source, game, false); } diff --git a/Mage.Sets/src/mage/cards/c/ChandrasIgnition.java b/Mage.Sets/src/mage/cards/c/ChandrasIgnition.java index 609c7e07c5f..44ace3fa3f5 100644 --- a/Mage.Sets/src/mage/cards/c/ChandrasIgnition.java +++ b/Mage.Sets/src/mage/cards/c/ChandrasIgnition.java @@ -57,7 +57,7 @@ class ChandrasIgnitionEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source)); if (targetCreature != null && targetCreature.getPower().getValue() > 0) { - for (Permanent creature : game.getState().getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source, game)) { + for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source, game)) { if (!creature.getId().equals(targetCreature.getId())) { creature.damage(targetCreature.getPower().getValue(), targetCreature.getId(), source, game, false, true); } diff --git a/Mage.Sets/src/mage/cards/c/ChoiceOfDamnations.java b/Mage.Sets/src/mage/cards/c/ChoiceOfDamnations.java index 80a0c602bff..f313f08d145 100644 --- a/Mage.Sets/src/mage/cards/c/ChoiceOfDamnations.java +++ b/Mage.Sets/src/mage/cards/c/ChoiceOfDamnations.java @@ -64,7 +64,7 @@ class ChoiceOfDamnationsEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); if (targetPlayer != null) { - int numberPermanents = game.getState().getBattlefield().countAll(new FilterPermanent(), targetPlayer.getId(), game); + int numberPermanents = game.getBattlefield().countAll(new FilterPermanent(), targetPlayer.getId(), game); // AI hint int amount; diff --git a/Mage.Sets/src/mage/cards/c/CompellingDeterrence.java b/Mage.Sets/src/mage/cards/c/CompellingDeterrence.java index 9c5e7d4adbb..a76627edb2e 100644 --- a/Mage.Sets/src/mage/cards/c/CompellingDeterrence.java +++ b/Mage.Sets/src/mage/cards/c/CompellingDeterrence.java @@ -66,7 +66,7 @@ class CompellingDeterrenceEffect extends OneShotEffect { game.getState().processAction(game); FilterPermanent zombieFilter = new FilterPermanent(); zombieFilter.add(SubType.ZOMBIE.getPredicate()); - if (game.getState().getBattlefield().countAll(zombieFilter, controller.getId(), game) > 0) { + if (game.getBattlefield().countAll(zombieFilter, controller.getId(), game) > 0) { player.discard(1, false, false, source, game); } return true; diff --git a/Mage.Sets/src/mage/cards/c/Conspiracy.java b/Mage.Sets/src/mage/cards/c/Conspiracy.java index 8833f223fe9..1c186a3bc90 100644 --- a/Mage.Sets/src/mage/cards/c/Conspiracy.java +++ b/Mage.Sets/src/mage/cards/c/Conspiracy.java @@ -123,7 +123,7 @@ public final class Conspiracy extends CardImpl { } } // creatures you control - List permanents = game.getState().getBattlefield().getAllActivePermanents(controller.getId()); + List permanents = game.getBattlefield().getAllActivePermanents(controller.getId()); for (Permanent permanent : permanents) { if (permanent.isCreature(game)) { permanent.removeAllCreatureTypes(game); diff --git a/Mage.Sets/src/mage/cards/d/DauntlessDismantler.java b/Mage.Sets/src/mage/cards/d/DauntlessDismantler.java index 7b706bbef1e..8213842b69e 100644 --- a/Mage.Sets/src/mage/cards/d/DauntlessDismantler.java +++ b/Mage.Sets/src/mage/cards/d/DauntlessDismantler.java @@ -84,9 +84,9 @@ class DauntlessDismantlerEffect extends OneShotEffect { filter.add(new ManaValuePredicate(ComparisonType.EQUAL_TO, source.getManaCostsToPay().getX())); boolean destroyed = false; - for (Permanent permanent : game.getState().getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { destroyed |= permanent.destroy(source, game); } return destroyed; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/d/DecreeOfPain.java b/Mage.Sets/src/mage/cards/d/DecreeOfPain.java index 5eee39d0be1..13c8b0082b5 100644 --- a/Mage.Sets/src/mage/cards/d/DecreeOfPain.java +++ b/Mage.Sets/src/mage/cards/d/DecreeOfPain.java @@ -66,7 +66,7 @@ class DecreeOfPainEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { int destroyedCreature = 0; - for (Permanent creature : game.getState().getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), game)) { + for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), game)) { if (creature.destroy(source, game, true)) { destroyedCreature++; } diff --git a/Mage.Sets/src/mage/cards/d/DralnusCrusade.java b/Mage.Sets/src/mage/cards/d/DralnusCrusade.java index d484bb72d30..2f3a59c1e92 100755 --- a/Mage.Sets/src/mage/cards/d/DralnusCrusade.java +++ b/Mage.Sets/src/mage/cards/d/DralnusCrusade.java @@ -49,7 +49,7 @@ class DralnusCrusadeEffect extends ContinuousEffectImpl { @Override public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - for (Permanent permanent : game.getState().getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE_GOBLINS, source.getControllerId(), source, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE_GOBLINS, source.getControllerId(), source, game)) { switch (layer) { case TypeChangingEffects_4: permanent.addSubType(game, SubType.ZOMBIE); diff --git a/Mage.Sets/src/mage/cards/e/ExperimentKraj.java b/Mage.Sets/src/mage/cards/e/ExperimentKraj.java index 8a950c8f2c7..f25835e285d 100644 --- a/Mage.Sets/src/mage/cards/e/ExperimentKraj.java +++ b/Mage.Sets/src/mage/cards/e/ExperimentKraj.java @@ -75,7 +75,7 @@ class ExperimentKrajEffect extends ContinuousEffectImpl { public boolean apply(Game game, Ability source) { Permanent perm = game.getPermanent(source.getSourceId()); if (perm != null) { - for (Permanent creature : game.getState().getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) { + for (Permanent creature : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) { for (Ability ability : creature.getAbilities()) { if (ability.isActivatedAbility()) { perm.addAbility(ability, source.getSourceId(), game, true); diff --git a/Mage.Sets/src/mage/cards/f/FracturingGust.java b/Mage.Sets/src/mage/cards/f/FracturingGust.java index 0681ea57edc..572b054d489 100644 --- a/Mage.Sets/src/mage/cards/f/FracturingGust.java +++ b/Mage.Sets/src/mage/cards/f/FracturingGust.java @@ -62,7 +62,7 @@ class FracturingGustDestroyEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { int destroyedPermanents = 0; - for (Permanent permanent: game.getState().getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) { + for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) { if (permanent.destroy(source, game, false)) { ++destroyedPermanents; } diff --git a/Mage.Sets/src/mage/cards/f/Fumigate.java b/Mage.Sets/src/mage/cards/f/Fumigate.java index ad559c05030..bee925a0e1a 100644 --- a/Mage.Sets/src/mage/cards/f/Fumigate.java +++ b/Mage.Sets/src/mage/cards/f/Fumigate.java @@ -57,7 +57,7 @@ class FumigateEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { int destroyedCreature = 0; - for (Permanent creature : game.getState().getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), game)) { + for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), game)) { if (creature.destroy(source, game, false)) { destroyedCreature++; } diff --git a/Mage.Sets/src/mage/cards/h/Hellfire.java b/Mage.Sets/src/mage/cards/h/Hellfire.java index 6d56d909457..45ac442928f 100644 --- a/Mage.Sets/src/mage/cards/h/Hellfire.java +++ b/Mage.Sets/src/mage/cards/h/Hellfire.java @@ -58,7 +58,7 @@ class HellfireEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { int destroyedCreature = 0; - for (Permanent creature : game.getState().getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURES_NON_BLACK, controller.getId(), game)) { + for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURES_NON_BLACK, controller.getId(), game)) { if (creature.destroy(source, game, false) && game.getState().getZone(creature.getId()) == Zone.GRAVEYARD) { // If a commander is replaced to command zone, the creature does not die) { destroyedCreature++; diff --git a/Mage.Sets/src/mage/cards/h/Heroism.java b/Mage.Sets/src/mage/cards/h/Heroism.java index eddba891288..a37ac200096 100644 --- a/Mage.Sets/src/mage/cards/h/Heroism.java +++ b/Mage.Sets/src/mage/cards/h/Heroism.java @@ -84,7 +84,7 @@ class HeroismEffect extends OneShotEffect { Player player = game.getPlayer(game.getActivePlayerId()); Cost cost = new ManaCostsImpl<>("{2}{R}"); List permanentsToPrevent = new ArrayList<>(); - for (Permanent permanent : game.getState().getBattlefield().getAllActivePermanents(filter, game.getActivePlayerId(), game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, game.getActivePlayerId(), game)) { cost.clearPaid(); String message = "Pay " + cost.getText() + "? If you don't, " + permanent.getLogName() + "'s combat damage will be prevented this turn."; if (player != null) { diff --git a/Mage.Sets/src/mage/cards/k/KarnsSylex.java b/Mage.Sets/src/mage/cards/k/KarnsSylex.java index 4391f08ddff..005096e9fed 100644 --- a/Mage.Sets/src/mage/cards/k/KarnsSylex.java +++ b/Mage.Sets/src/mage/cards/k/KarnsSylex.java @@ -100,7 +100,7 @@ class KarnsSylexDestroyEffect extends OneShotEffect { filter.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, source.getManaCostsToPay().getX() + 1)); boolean destroyed = false; - for (Permanent permanent : game.getState().getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { destroyed |= permanent.destroy(source, game); } return destroyed; diff --git a/Mage.Sets/src/mage/cards/k/KasminaEnigmaSage.java b/Mage.Sets/src/mage/cards/k/KasminaEnigmaSage.java index 0b359926d35..74cfccc14ae 100644 --- a/Mage.Sets/src/mage/cards/k/KasminaEnigmaSage.java +++ b/Mage.Sets/src/mage/cards/k/KasminaEnigmaSage.java @@ -85,7 +85,7 @@ class KasminaEnigmaSageGainAbilitiesEffect extends ContinuousEffectImpl { .stream() .filter(LoyaltyAbility.class::isInstance) .collect(Collectors.toList()); - for (Permanent permanent : game.getState().getBattlefield().getActivePermanents( + for (Permanent permanent : game.getBattlefield().getActivePermanents( StaticFilters.FILTER_CONTROLLED_PERMANENT_PLANESWALKER, source.getControllerId(), source, game )) { diff --git a/Mage.Sets/src/mage/cards/l/LifeAndLimb.java b/Mage.Sets/src/mage/cards/l/LifeAndLimb.java index 5cbf43ac73e..28217daaffa 100644 --- a/Mage.Sets/src/mage/cards/l/LifeAndLimb.java +++ b/Mage.Sets/src/mage/cards/l/LifeAndLimb.java @@ -69,7 +69,7 @@ class LifeAndLimbEffect extends ContinuousEffectImpl { if (player == null) { return false; } - for (Permanent permanent : game.getState().getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) { switch (layer) { case TypeChangingEffects_4: permanent.addCardType(game, CardType.CREATURE); diff --git a/Mage.Sets/src/mage/cards/m/ManascapeRefractor.java b/Mage.Sets/src/mage/cards/m/ManascapeRefractor.java index f3dcb00a812..64fed8ca9ca 100644 --- a/Mage.Sets/src/mage/cards/m/ManascapeRefractor.java +++ b/Mage.Sets/src/mage/cards/m/ManascapeRefractor.java @@ -75,8 +75,7 @@ class ManascapeRefractorGainAbilitiesEffect extends ContinuousEffectImpl { if (perm == null) { return false; } - for (Ability ability : game.getState() - .getBattlefield() + for (Ability ability : game.getBattlefield() .getActivePermanents(filter, source.getControllerId(), source, game) .stream() .map(permanent -> permanent.getAbilities(game)) diff --git a/Mage.Sets/src/mage/cards/m/MayaelsAria.java b/Mage.Sets/src/mage/cards/m/MayaelsAria.java index 61ec1418f6c..75395af64bf 100644 --- a/Mage.Sets/src/mage/cards/m/MayaelsAria.java +++ b/Mage.Sets/src/mage/cards/m/MayaelsAria.java @@ -70,7 +70,7 @@ class MayaelsAriaEffect extends OneShotEffect { // put a +1/+1 counter on each creature you control if you control a creature with power 5 or greater. FilterCreaturePermanent filter = new FilterCreaturePermanent(); filter.add(new PowerPredicate(ComparisonType.MORE_THAN, 4)); - if (game.getState().getBattlefield().countAll(filter, controller.getId(), game) > 0) { + if (game.getBattlefield().countAll(filter, controller.getId(), game) > 0) { for (Permanent creature : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) { creature.addCounters(CounterType.P1P1.createInstance(), source.getControllerId(), source, game); } @@ -80,14 +80,14 @@ class MayaelsAriaEffect extends OneShotEffect { // Then you gain 10 life if you control a creature with power 10 or greater. filter = new FilterCreaturePermanent(); filter.add(new PowerPredicate(ComparisonType.MORE_THAN, 9)); - if (game.getState().getBattlefield().countAll(filter, controller.getId(), game) > 0) { + if (game.getBattlefield().countAll(filter, controller.getId(), game) > 0) { controller.gainLife(10, game, source); } // Then you win the game if you control a creature with power 20 or greater. filter = new FilterCreaturePermanent(); filter.add(new PowerPredicate(ComparisonType.MORE_THAN, 19)); - if (game.getState().getBattlefield().countAll(filter, controller.getId(), game) > 0) { + if (game.getBattlefield().countAll(filter, controller.getId(), game) > 0) { controller.won(game); } return true; diff --git a/Mage.Sets/src/mage/cards/m/MoggInfestation.java b/Mage.Sets/src/mage/cards/m/MoggInfestation.java index 89599024ecf..a24950ce64a 100644 --- a/Mage.Sets/src/mage/cards/m/MoggInfestation.java +++ b/Mage.Sets/src/mage/cards/m/MoggInfestation.java @@ -71,7 +71,7 @@ class MoggInfestationEffect extends OneShotEffect { if (permanent.destroy(source, game, false)) { if (game.getState().getZone(permanent.getId()) == Zone.GRAVEYARD || (permanent instanceof PermanentToken - && !game.getState().getBattlefield().containsPermanent(permanent.getId()))) { // If a commander is replaced to command zone, the creature does not die + && !game.getBattlefield().containsPermanent(permanent.getId()))) { // If a commander is replaced to command zone, the creature does not die creaturesDied.add(permanent.getId()); } } diff --git a/Mage.Sets/src/mage/cards/m/MultanisDecree.java b/Mage.Sets/src/mage/cards/m/MultanisDecree.java index 7264892df0e..5b38c7f1d33 100644 --- a/Mage.Sets/src/mage/cards/m/MultanisDecree.java +++ b/Mage.Sets/src/mage/cards/m/MultanisDecree.java @@ -57,7 +57,7 @@ class MultanisDecreeDestroyEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); int enchantmentsDestoyed = 0; - for (Permanent permanent: game.getState().getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_ENCHANTMENT, source.getControllerId(), source, game)) { + for (Permanent permanent: game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_ENCHANTMENT, source.getControllerId(), source, game)) { if (permanent.destroy(source, game, false)) { enchantmentsDestoyed++; } diff --git a/Mage.Sets/src/mage/cards/n/NicolBolasDragonGod.java b/Mage.Sets/src/mage/cards/n/NicolBolasDragonGod.java index 342a3d916cb..b14942908a4 100644 --- a/Mage.Sets/src/mage/cards/n/NicolBolasDragonGod.java +++ b/Mage.Sets/src/mage/cards/n/NicolBolasDragonGod.java @@ -86,7 +86,7 @@ class NicolBolasDragonGodGainAbilitiesEffect extends ContinuousEffectImpl { if (perm == null) { return true; } - for (Permanent permanent : game.getState().getBattlefield().getActivePermanents( + for (Permanent permanent : game.getBattlefield().getActivePermanents( filter, source.getControllerId(), source, game )) { for (Ability ability : permanent.getAbilities()) { diff --git a/Mage.Sets/src/mage/cards/n/NulltreadGargantuan.java b/Mage.Sets/src/mage/cards/n/NulltreadGargantuan.java index 717b2e2f4a1..9507332a9a4 100644 --- a/Mage.Sets/src/mage/cards/n/NulltreadGargantuan.java +++ b/Mage.Sets/src/mage/cards/n/NulltreadGargantuan.java @@ -62,7 +62,7 @@ class NulltreadGargantuanEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - if (player == null || !game.getState().getBattlefield().contains( + if (player == null || !game.getBattlefield().contains( StaticFilters.FILTER_CONTROLLED_CREATURE, source, game, 1 )) { return false; diff --git a/Mage.Sets/src/mage/cards/o/OddlyUneven.java b/Mage.Sets/src/mage/cards/o/OddlyUneven.java index 1b3818fd196..e64c054b6b2 100644 --- a/Mage.Sets/src/mage/cards/o/OddlyUneven.java +++ b/Mage.Sets/src/mage/cards/o/OddlyUneven.java @@ -65,7 +65,7 @@ class OddOrEvenEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - for (Permanent creature : game.getState().getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), game)) { + for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), game)) { // Check the number of words in the name (based on number of spaces) if (creature != null) { String name = creature.getName(); diff --git a/Mage.Sets/src/mage/cards/o/OverwhelmingSplendor.java b/Mage.Sets/src/mage/cards/o/OverwhelmingSplendor.java index 7a90974f549..5db8c104d1b 100644 --- a/Mage.Sets/src/mage/cards/o/OverwhelmingSplendor.java +++ b/Mage.Sets/src/mage/cards/o/OverwhelmingSplendor.java @@ -81,7 +81,7 @@ class OverwhelmingSplendorLoseAbilitiesEffect extends ContinuousEffectImpl { if (player == null) { return false; } - for (Permanent permanent : game.getState().getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game)) { switch (layer) { case AbilityAddingRemovingEffects_6: permanent.removeAllAbilities(source.getSourceId(), game); diff --git a/Mage.Sets/src/mage/cards/p/PatronOfTheVein.java b/Mage.Sets/src/mage/cards/p/PatronOfTheVein.java index f2b8b1bf455..b4b8c86adb4 100644 --- a/Mage.Sets/src/mage/cards/p/PatronOfTheVein.java +++ b/Mage.Sets/src/mage/cards/p/PatronOfTheVein.java @@ -146,7 +146,7 @@ class PatronOfTheVeinExileCreatureEffect extends OneShotEffect { effect.apply(game, source); } - for (Permanent permanent : game.getState().getBattlefield().getAllActivePermanents(filter, controller.getId(), game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, controller.getId(), game)) { permanent.addCounters(CounterType.P1P1.createInstance(), source.getControllerId(), source, game); game.informPlayers(sourceObject.getName() + ": Put a +1/+1 counter on " + permanent.getLogName()); } diff --git a/Mage.Sets/src/mage/cards/r/RighteousFury.java b/Mage.Sets/src/mage/cards/r/RighteousFury.java index cd37db6565e..9dc9c45f145 100644 --- a/Mage.Sets/src/mage/cards/r/RighteousFury.java +++ b/Mage.Sets/src/mage/cards/r/RighteousFury.java @@ -61,7 +61,7 @@ class RighteousFuryEffect extends OneShotEffect { int destroyedCreature = 0; FilterCreaturePermanent filter = new FilterCreaturePermanent("all tapped creatures"); filter.add(TappedPredicate.TAPPED); - for(Permanent creature: game.getState().getBattlefield().getActivePermanents(filter, controller.getId(), game)) { + for(Permanent creature: game.getBattlefield().getActivePermanents(filter, controller.getId(), game)) { if (creature.destroy(source, game, false)) { destroyedCreature++; } diff --git a/Mage.Sets/src/mage/cards/r/RobaranMercenaries.java b/Mage.Sets/src/mage/cards/r/RobaranMercenaries.java index b9ce387bdb7..5ed55dc31d9 100644 --- a/Mage.Sets/src/mage/cards/r/RobaranMercenaries.java +++ b/Mage.Sets/src/mage/cards/r/RobaranMercenaries.java @@ -72,8 +72,7 @@ class RobaranMercenariesEffect extends ContinuousEffectImpl { if (perm == null) { return false; } - for (Ability ability : game.getState() - .getBattlefield() + for (Ability ability : game.getBattlefield() .getActivePermanents(filter, source.getControllerId(), source, game) .stream() .map(permanent -> permanent.getAbilities(game)) diff --git a/Mage.Sets/src/mage/cards/s/SeedsOfInnocence.java b/Mage.Sets/src/mage/cards/s/SeedsOfInnocence.java index aefe2eb3dab..72795a9c5a2 100644 --- a/Mage.Sets/src/mage/cards/s/SeedsOfInnocence.java +++ b/Mage.Sets/src/mage/cards/s/SeedsOfInnocence.java @@ -57,7 +57,7 @@ class SeedsOfInnocenceEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - for (Permanent artifact : game.getState().getBattlefield().getActivePermanents(new FilterArtifactPermanent(), controller.getId(), game)) { + for (Permanent artifact : game.getBattlefield().getActivePermanents(new FilterArtifactPermanent(), controller.getId(), game)) { Player artifactController = game.getPlayer(artifact.getControllerId()); int cmc = artifact.getManaValue(); if (artifact.destroy(source, game, true)) { diff --git a/Mage.Sets/src/mage/cards/s/SharkeyTyrantOfTheShire.java b/Mage.Sets/src/mage/cards/s/SharkeyTyrantOfTheShire.java index 0e4442b333d..df7752b38be 100644 --- a/Mage.Sets/src/mage/cards/s/SharkeyTyrantOfTheShire.java +++ b/Mage.Sets/src/mage/cards/s/SharkeyTyrantOfTheShire.java @@ -135,8 +135,7 @@ class SharkeyTyrantOfTheShireContinousEffect extends ContinuousEffectImpl { if (perm == null) { return false; } - for (Ability ability : game.getState() - .getBattlefield() + for (Ability ability : game.getBattlefield() .getActivePermanents(filter, source.getControllerId(), source, game) .stream() .map(permanent -> permanent.getAbilities(game)) diff --git a/Mage.Sets/src/mage/cards/s/SuddenSpoiling.java b/Mage.Sets/src/mage/cards/s/SuddenSpoiling.java index 1c16578e68b..1e718abd4b2 100644 --- a/Mage.Sets/src/mage/cards/s/SuddenSpoiling.java +++ b/Mage.Sets/src/mage/cards/s/SuddenSpoiling.java @@ -69,7 +69,7 @@ class SuddenSpoilingEffect extends ContinuousEffectImpl { if (player == null) { return; } - for (Permanent perm : game.getState().getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game)) { + for (Permanent perm : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game)) { affectedObjectList.add(new MageObjectReference(perm, game)); } } @@ -80,7 +80,7 @@ class SuddenSpoilingEffect extends ContinuousEffectImpl { if (player == null) { return false; } - for (Permanent permanent : game.getState().getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game)) { if (affectedObjectList.contains(new MageObjectReference(permanent, game))) { switch (layer) { case AbilityAddingRemovingEffects_6: diff --git a/Mage.Sets/src/mage/cards/t/ThoughtsOfRuin.java b/Mage.Sets/src/mage/cards/t/ThoughtsOfRuin.java index ed56db83b1a..8a5b23ab5fd 100644 --- a/Mage.Sets/src/mage/cards/t/ThoughtsOfRuin.java +++ b/Mage.Sets/src/mage/cards/t/ThoughtsOfRuin.java @@ -72,9 +72,9 @@ class ThoughtsOfRuinEffect extends OneShotEffect { for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - int lands = game.getState().getBattlefield().countAll(filter, playerId, game); + int lands = game.getBattlefield().countAll(filter, playerId, game); if (amount >= lands) { - permanentsToSacrifice.addAll(game.getState().getBattlefield().getAllActivePermanents(filter, playerId, game)); + permanentsToSacrifice.addAll(game.getBattlefield().getAllActivePermanents(filter, playerId, game)); } else { FilterLandPermanent playerFilter = filter.copy(); playerFilter.add(new ControllerIdPredicate(playerId)); diff --git a/Mage.Sets/src/mage/cards/t/TidalFlats.java b/Mage.Sets/src/mage/cards/t/TidalFlats.java index a1cee774900..03d9bcb9c78 100644 --- a/Mage.Sets/src/mage/cards/t/TidalFlats.java +++ b/Mage.Sets/src/mage/cards/t/TidalFlats.java @@ -85,7 +85,7 @@ class TidalFlatsEffect extends OneShotEffect { } Cost cost = new ManaCostsImpl<>("{1}"); List affectedPermanents = new ArrayList<>(); - for (Permanent permanent : game.getState().getBattlefield().getAllActivePermanents(filter, player.getId(), game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, player.getId(), game)) { cost.clearPaid(); String message = "Pay " + cost.getText() + " for " + permanent.getLogName() + "? If you don't, creatures " + controller.getLogName() + " controls blocking it gain first strike until end of turn."; if (player.chooseUse(Outcome.Benefit, message, source, game)) { diff --git a/Mage.Sets/src/mage/cards/t/TooGreedilyTooDeep.java b/Mage.Sets/src/mage/cards/t/TooGreedilyTooDeep.java index c26f333a848..1d941f546e4 100644 --- a/Mage.Sets/src/mage/cards/t/TooGreedilyTooDeep.java +++ b/Mage.Sets/src/mage/cards/t/TooGreedilyTooDeep.java @@ -68,7 +68,7 @@ class TooGreedilyTooDeepEffect extends OneShotEffect { game.getState().processAction(game); Permanent returnedCreature = game.getPermanent(card.getId()); if (returnedCreature != null && returnedCreature.getPower().getValue() > 0) { - for (Permanent creature : game.getState().getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source, game)) { + for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source, game)) { if (!creature.getId().equals(returnedCreature.getId())) { creature.damage(returnedCreature.getPower().getValue(), returnedCreature.getId(), source, game, false, true); } diff --git a/Mage.Sets/src/mage/cards/w/WhimsOfTheFates.java b/Mage.Sets/src/mage/cards/w/WhimsOfTheFates.java index cc25e7a3703..0cf0c74c72e 100644 --- a/Mage.Sets/src/mage/cards/w/WhimsOfTheFates.java +++ b/Mage.Sets/src/mage/cards/w/WhimsOfTheFates.java @@ -122,7 +122,7 @@ class WhimsOfTheFateEffect extends OneShotEffect { // add all permanents not targeted yet to the third pile StringBuilder message = new StringBuilder(currentPlayer.getLogName()).append(" pile 3: "); - for (Permanent permanent : game.getState().getBattlefield().getAllActivePermanents(currentPlayer.getId())) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(currentPlayer.getId())) { if (!playerPiles.get(1).contains(permanent.getId()) && !playerPiles.get(2).contains(permanent.getId())) { playerPiles.get(3).add(permanent.getId()); message.append(permanent.getName()).append(' '); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/KikiJikiMirrorBreakerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/KikiJikiMirrorBreakerTest.java index 24251879ec8..08b4dccde0f 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/KikiJikiMirrorBreakerTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/KikiJikiMirrorBreakerTest.java @@ -147,7 +147,7 @@ public class KikiJikiMirrorBreakerTest extends CardTestPlayerBase { assertPermanentCount(playerB, "Silvercoat Lion", 2); // one from Body Double and one from Kiki Permanent kikiCopy = null; - for (Permanent permanent : currentGame.getState().getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, currentGame)) { + for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, currentGame)) { if (permanent.getName().equals("Silvercoat Lion") && (permanent instanceof PermanentToken)) { kikiCopy = permanent; break; diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/cost/modaldoublefaced/ModalDoubleFacedCardsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/cost/modaldoublefaced/ModalDoubleFacedCardsTest.java index e356561a03d..360bdfad8cc 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/cost/modaldoublefaced/ModalDoubleFacedCardsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/cost/modaldoublefaced/ModalDoubleFacedCardsTest.java @@ -347,7 +347,7 @@ public class ModalDoubleFacedCardsTest extends CardTestPlayerBase { setStopAt(1, PhaseStep.END_TURN); execute(); - Card card = currentGame.getState().getBattlefield().getAllPermanents() + Card card = currentGame.getBattlefield().getAllPermanents() .stream() .filter(p -> CardUtil.haveSameNames(p, "Akoum Warrior", currentGame)) .findFirst() @@ -380,7 +380,7 @@ public class ModalDoubleFacedCardsTest extends CardTestPlayerBase { execute(); assertHandCount(playerA, 0); - Card card = currentGame.getState().getBattlefield().getAllPermanents() + Card card = currentGame.getBattlefield().getAllPermanents() .stream() .filter(p -> CardUtil.haveSameNames(p, "Ondu Skyruins", currentGame)) .findFirst() diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessAllEffect.java index 0b5c9f8fdb6..665d192beae 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessAllEffect.java @@ -42,7 +42,7 @@ public class SwitchPowerToughnessAllEffect extends ContinuousEffectImpl { public void init(Ability source, Game game) { super.init(source, game); if (getAffectedObjectsSet() && game.getPlayer(source.getControllerId()) != null) { - for (Permanent perm : game.getState().getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) { + for (Permanent perm : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) { affectedObjectList.add(new MageObjectReference(perm, game)); } } @@ -56,7 +56,7 @@ public class SwitchPowerToughnessAllEffect extends ContinuousEffectImpl { } if (!getAffectedObjectsSet()) { - game.getState().getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game).forEach(Permanent::switchPowerToughness); + game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game).forEach(Permanent::switchPowerToughness); } else { for (Iterator it = affectedObjectList.iterator(); it.hasNext(); ) { // filter may not be used again, because object can have changed filter relevant attributes but still gets boost Permanent creature = it.next().getPermanent(game);