diff --git a/Mage.Sets/src/mage/cards/a/AladdinsLamp.java b/Mage.Sets/src/mage/cards/a/AladdinsLamp.java index e020079b68..5fb6e9b43c 100644 --- a/Mage.Sets/src/mage/cards/a/AladdinsLamp.java +++ b/Mage.Sets/src/mage/cards/a/AladdinsLamp.java @@ -74,7 +74,7 @@ class AladdinsLampEffect extends ReplacementEffectImpl { cards.remove(target.getFirstTarget()); } controller.putCardsOnBottomOfLibrary(cards, game, source, false); - game.applyEffects(); + game.getState().processAction(game); controller.drawCards(1, event.getSourceId(), game, event.getAppliedEffects()); discard(); return true; diff --git a/Mage.Sets/src/mage/cards/a/AngrathMinotaurPirate.java b/Mage.Sets/src/mage/cards/a/AngrathMinotaurPirate.java index 2c5a6aef46..d9eff6ea19 100644 --- a/Mage.Sets/src/mage/cards/a/AngrathMinotaurPirate.java +++ b/Mage.Sets/src/mage/cards/a/AngrathMinotaurPirate.java @@ -98,7 +98,7 @@ class AngrathMinotaurPirateThirdAbilityEffect extends OneShotEffect { permanent.destroy(source.getSourceId(), game, false); powerSum += permanent.getPower().getValue(); } - game.applyEffects(); + game.getState().processAction(game); targetOpponent.damage(powerSum, source.getSourceId(), game); } return true; diff --git a/Mage.Sets/src/mage/cards/b/BlessedReincarnation.java b/Mage.Sets/src/mage/cards/b/BlessedReincarnation.java index ac0276b9c5..5f4770a104 100644 --- a/Mage.Sets/src/mage/cards/b/BlessedReincarnation.java +++ b/Mage.Sets/src/mage/cards/b/BlessedReincarnation.java @@ -74,7 +74,7 @@ class BlessedReincarnationEffect extends OneShotEffect { Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); if (permanent != null && controller != null) { controller.moveCards(permanent, Zone.EXILED, source, game); - game.applyEffects(); + game.getState().processAction(game); Player permanentController = game.getPlayer(permanent.getControllerId()); if (permanentController != null) { diff --git a/Mage.Sets/src/mage/cards/b/BoundDetermined.java b/Mage.Sets/src/mage/cards/b/BoundDetermined.java index cfb16ba517..86d2018d82 100644 --- a/Mage.Sets/src/mage/cards/b/BoundDetermined.java +++ b/Mage.Sets/src/mage/cards/b/BoundDetermined.java @@ -86,7 +86,7 @@ class BoundEffect extends OneShotEffect { Permanent toSacrifice = game.getPermanent(target.getFirstTarget()); if (toSacrifice != null) { toSacrifice.sacrifice(source.getSourceId(), game); - game.applyEffects(); + game.getState().processAction(game); int colors = toSacrifice.getColor(game).getColorCount(); if (colors > 0) { TargetCardInYourGraveyard targetCard = new TargetCardInYourGraveyard(0, colors, diff --git a/Mage.Sets/src/mage/cards/b/BuildersBane.java b/Mage.Sets/src/mage/cards/b/BuildersBane.java index 98b8621a8d..d29d7db605 100644 --- a/Mage.Sets/src/mage/cards/b/BuildersBane.java +++ b/Mage.Sets/src/mage/cards/b/BuildersBane.java @@ -77,7 +77,7 @@ class BuildersBaneEffect extends OneShotEffect { Permanent permanent = game.getPermanent(targetID); if (permanent != null) { if (permanent.destroy(source.getSourceId(), game, false)) { - game.applyEffects(); + game.getState().processAction(game); if (permanent.getZoneChangeCounter(game) + 1 == game.getState().getZoneChangeCounter(permanent.getId()) && game.getState().getZone(permanent.getId()) != Zone.GRAVEYARD) { // A replacement effect has moved the card to another zone as grvayard diff --git a/Mage.Sets/src/mage/cards/c/CinderCloud.java b/Mage.Sets/src/mage/cards/c/CinderCloud.java index 95a401befd..a2208fc8ad 100644 --- a/Mage.Sets/src/mage/cards/c/CinderCloud.java +++ b/Mage.Sets/src/mage/cards/c/CinderCloud.java @@ -59,7 +59,7 @@ class CinderCloudEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); if (permanent != null && permanent.destroy(source.getSourceId(), game, false) && permanent.getColor(game).equals(ObjectColor.WHITE)) { - game.applyEffects(); + game.getState().processAction(game); if (permanent.getZoneChangeCounter(game) + 1 == game.getState().getZoneChangeCounter(permanent.getId()) && game.getState().getZone(permanent.getId()) != Zone.GRAVEYARD) { // A replacement effect has moved the card to another zone as grvayard diff --git a/Mage.Sets/src/mage/cards/c/CompellingDeterrence.java b/Mage.Sets/src/mage/cards/c/CompellingDeterrence.java index 4fb628199e..246c434497 100644 --- a/Mage.Sets/src/mage/cards/c/CompellingDeterrence.java +++ b/Mage.Sets/src/mage/cards/c/CompellingDeterrence.java @@ -63,7 +63,7 @@ class CompellingDeterrenceEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null && player != null) { player.moveCards(target, Zone.HAND, source, game); - game.applyEffects(); + game.getState().processAction(game); FilterPermanent zombieFilter = new FilterPermanent(); zombieFilter.add(SubType.ZOMBIE.getPredicate()); if (game.getState().getBattlefield().countAll(zombieFilter, controller.getId(), game) > 0) { diff --git a/Mage.Sets/src/mage/cards/d/DeclarationInStone.java b/Mage.Sets/src/mage/cards/d/DeclarationInStone.java index 45cfb5b117..c7edeb0cca 100644 --- a/Mage.Sets/src/mage/cards/d/DeclarationInStone.java +++ b/Mage.Sets/src/mage/cards/d/DeclarationInStone.java @@ -88,7 +88,7 @@ class DeclarationInStoneEffect extends OneShotEffect { } } controller.moveCards(cardsToExile, Zone.EXILED, source, game); - game.applyEffects(); + game.getState().processAction(game); if (nonTokenCount > 0) { new ClueArtifactToken().putOntoBattlefield(nonTokenCount, game, source.getSourceId(), targetPermanent.getControllerId(), false, false); } diff --git a/Mage.Sets/src/mage/cards/d/DevourFlesh.java b/Mage.Sets/src/mage/cards/d/DevourFlesh.java index 985f35f554..c8b64b6004 100644 --- a/Mage.Sets/src/mage/cards/d/DevourFlesh.java +++ b/Mage.Sets/src/mage/cards/d/DevourFlesh.java @@ -73,7 +73,7 @@ class DevourFleshSacrificeEffect extends OneShotEffect { if (permanent != null) { int gainLife = permanent.getToughness().getValue(); permanent.sacrifice(source.getSourceId(), game); - game.applyEffects(); + game.getState().processAction(game); player.gainLife(gainLife, game, source); } else { return false; diff --git a/Mage.Sets/src/mage/cards/d/DomrisAmbush.java b/Mage.Sets/src/mage/cards/d/DomrisAmbush.java index f1c177cb97..b598f9442e 100644 --- a/Mage.Sets/src/mage/cards/d/DomrisAmbush.java +++ b/Mage.Sets/src/mage/cards/d/DomrisAmbush.java @@ -78,7 +78,7 @@ class DomrisAmbushEffect extends OneShotEffect { return false; } permanent.addCounters(CounterType.P1P1.createInstance(), source, game); - game.applyEffects(); + game.getState().processAction(game); return new DamageWithPowerFromOneToAnotherTargetEffect().apply(game, source); } } diff --git a/Mage.Sets/src/mage/cards/e/EmpoweredAutogenerator.java b/Mage.Sets/src/mage/cards/e/EmpoweredAutogenerator.java index e8560d4270..a53fb3e2ca 100644 --- a/Mage.Sets/src/mage/cards/e/EmpoweredAutogenerator.java +++ b/Mage.Sets/src/mage/cards/e/EmpoweredAutogenerator.java @@ -88,7 +88,7 @@ class EmpoweredAutogeneratorManaEffect extends ManaEffect { if (game == null) { return mana; } - game.applyEffects(); + game.getState().processAction(game); Permanent sourcePermanent = game.getState().getPermanent(source.getSourceId()); if (sourcePermanent == null) { return mana; diff --git a/Mage.Sets/src/mage/cards/f/FiligreeFracture.java b/Mage.Sets/src/mage/cards/f/FiligreeFracture.java index efcf412747..98eb2eb6ed 100644 --- a/Mage.Sets/src/mage/cards/f/FiligreeFracture.java +++ b/Mage.Sets/src/mage/cards/f/FiligreeFracture.java @@ -61,7 +61,7 @@ class FiligreeFractureEffect extends OneShotEffect { Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); if (player != null && permanent != null) { permanent.destroy(source.getSourceId(), game, true); - game.applyEffects(); + game.getState().processAction(game); if (permanent.getColor(game).isBlack() || permanent.getColor(game).isBlue()) { player.drawCards(1, source.getSourceId(), game); } diff --git a/Mage.Sets/src/mage/cards/f/FracturingGust.java b/Mage.Sets/src/mage/cards/f/FracturingGust.java index c54bb8b1f1..4da56870ae 100644 --- a/Mage.Sets/src/mage/cards/f/FracturingGust.java +++ b/Mage.Sets/src/mage/cards/f/FracturingGust.java @@ -67,7 +67,7 @@ class FracturingGustDestroyEffect extends OneShotEffect { ++destroyedPermanents; } } - game.applyEffects(); // needed in case a destroyed permanent did prevent life gain + game.getState().processAction(game); // needed in case a destroyed permanent did prevent life gain if (destroyedPermanents > 0) { controller.gainLife(2 * destroyedPermanents, game, source); } diff --git a/Mage.Sets/src/mage/cards/f/FromTheAshes.java b/Mage.Sets/src/mage/cards/f/FromTheAshes.java index 77d8390df9..8dd0b42910 100644 --- a/Mage.Sets/src/mage/cards/f/FromTheAshes.java +++ b/Mage.Sets/src/mage/cards/f/FromTheAshes.java @@ -76,7 +76,7 @@ class FromTheAshesEffect extends OneShotEffect { playerAmount.put(playerId, amount); } } - game.applyEffects(); + game.getState().processAction(game); for (Map.Entry entry : playerAmount.entrySet()) { Player player = game.getPlayer(entry.getKey()); if (player != null && player.chooseUse(outcome, "Search your library for up to " + entry.getValue() + " basic land card(s) to put it onto the battlefield?", source, game)) { @@ -90,7 +90,7 @@ class FromTheAshesEffect extends OneShotEffect { entry.setValue(0); // no search no shuffling } } - game.applyEffects(); + game.getState().processAction(game); for (Map.Entry entry : playerAmount.entrySet()) { Player player = game.getPlayer(entry.getKey()); if (player != null && entry.getValue() > 0) { diff --git a/Mage.Sets/src/mage/cards/f/Fumigate.java b/Mage.Sets/src/mage/cards/f/Fumigate.java index 54a1d5cfee..b74ef2339e 100644 --- a/Mage.Sets/src/mage/cards/f/Fumigate.java +++ b/Mage.Sets/src/mage/cards/f/Fumigate.java @@ -62,7 +62,7 @@ class FumigateEffect extends OneShotEffect { destroyedCreature++; } } - game.applyEffects(); + game.getState().processAction(game); if (destroyedCreature > 0) { controller.gainLife(destroyedCreature, game, source); } diff --git a/Mage.Sets/src/mage/cards/g/GhostlyFlicker.java b/Mage.Sets/src/mage/cards/g/GhostlyFlicker.java index e69fb17a01..cf35f53a13 100644 --- a/Mage.Sets/src/mage/cards/g/GhostlyFlicker.java +++ b/Mage.Sets/src/mage/cards/g/GhostlyFlicker.java @@ -81,7 +81,7 @@ class GhostlyFlickerEffect extends OneShotEffect { } } controller.moveCards(toExile, Zone.EXILED, source, game); - game.applyEffects(); + game.getState().processAction(game); Set toBattlefield = new HashSet<>(); for (Card card : toExile) { Zone currentZone = game.getState().getZone(card.getId()); diff --git a/Mage.Sets/src/mage/cards/g/GideonsDefeat.java b/Mage.Sets/src/mage/cards/g/GideonsDefeat.java index b73f9f2dec..de6db2d921 100644 --- a/Mage.Sets/src/mage/cards/g/GideonsDefeat.java +++ b/Mage.Sets/src/mage/cards/g/GideonsDefeat.java @@ -71,7 +71,7 @@ class GideonsDefeatEffect extends OneShotEffect { Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); if (controller != null && permanent != null) { controller.moveCards(permanent, Zone.EXILED, source, game); - game.applyEffects(); + game.getState().processAction(game); if (permanent.isPlaneswalker() && permanent.hasSubtype(SubType.GIDEON, game)) { controller.gainLife(5, game, source); } diff --git a/Mage.Sets/src/mage/cards/h/HeraldOfLeshrac.java b/Mage.Sets/src/mage/cards/h/HeraldOfLeshrac.java index 1ae97254ff..ec94e92c5e 100644 --- a/Mage.Sets/src/mage/cards/h/HeraldOfLeshrac.java +++ b/Mage.Sets/src/mage/cards/h/HeraldOfLeshrac.java @@ -97,7 +97,7 @@ class HeraldOfLeshracCumulativeCost extends CostImpl { ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfGame); effect.setTargetPointer(new FixedTarget(target.getFirstTarget())); game.addEffect(effect, ability); - game.applyEffects(); + game.getState().processAction(game); paid = true; } return paid; diff --git a/Mage.Sets/src/mage/cards/h/HourOfGlory.java b/Mage.Sets/src/mage/cards/h/HourOfGlory.java index 5be4f80dcb..4f4dfb2737 100644 --- a/Mage.Sets/src/mage/cards/h/HourOfGlory.java +++ b/Mage.Sets/src/mage/cards/h/HourOfGlory.java @@ -69,7 +69,7 @@ class HourOfGloryEffect extends OneShotEffect { if (targetCreature != null) { controller.moveCards(targetCreature, Zone.EXILED, source, game); if (targetCreature.hasSubtype(SubType.GOD, game)) { - game.applyEffects(); + game.getState().processAction(game); Player targetController = game.getPlayer(targetCreature.getControllerId()); if (targetController != null) { targetController.revealCards(sourceObject.getIdName(), targetController.getHand(), game); diff --git a/Mage.Sets/src/mage/cards/i/InducedAmnesia.java b/Mage.Sets/src/mage/cards/i/InducedAmnesia.java index dbdac63fb7..9f2e5d158b 100644 --- a/Mage.Sets/src/mage/cards/i/InducedAmnesia.java +++ b/Mage.Sets/src/mage/cards/i/InducedAmnesia.java @@ -76,7 +76,7 @@ class InducedAmnesiaExileEffect extends OneShotEffect { card.setFaceDown(true, game); } game.informPlayers(sourcePermanent.getLogName() + ": " + targetPlayer.getLogName() + " exiles their hand face down (" + numberOfCards + "card" + (numberOfCards > 1 ? "s" : "") + ')'); - game.applyEffects(); + game.getState().processAction(game); targetPlayer.drawCards(numberOfCards, source.getSourceId(), game); } return true; diff --git a/Mage.Sets/src/mage/cards/i/InfernalReckoning.java b/Mage.Sets/src/mage/cards/i/InfernalReckoning.java index 1d1cc6ded2..de48593fe5 100644 --- a/Mage.Sets/src/mage/cards/i/InfernalReckoning.java +++ b/Mage.Sets/src/mage/cards/i/InfernalReckoning.java @@ -69,7 +69,7 @@ class InfernalJudgmentEffect extends OneShotEffect { } int creaturePower = permanent.getPower().getValue(); permanent.moveToExile(null, null, source.getSourceId(), game); - game.applyEffects(); + game.getState().processAction(game); player.gainLife(creaturePower, game, source); return true; } diff --git a/Mage.Sets/src/mage/cards/j/Joust.java b/Mage.Sets/src/mage/cards/j/Joust.java index cddf0ea93a..77b8d33df2 100644 --- a/Mage.Sets/src/mage/cards/j/Joust.java +++ b/Mage.Sets/src/mage/cards/j/Joust.java @@ -76,7 +76,7 @@ class JoustEffect extends OneShotEffect { if (creature2 == null) { return true; } - game.applyEffects(); + game.getState().processAction(game); return creature1.fight(creature2, source, game); } } diff --git a/Mage.Sets/src/mage/cards/k/KaerveksPurge.java b/Mage.Sets/src/mage/cards/k/KaerveksPurge.java index 19b5c69c3e..4eabe29bd9 100644 --- a/Mage.Sets/src/mage/cards/k/KaerveksPurge.java +++ b/Mage.Sets/src/mage/cards/k/KaerveksPurge.java @@ -78,7 +78,7 @@ class KaerveksPurgeEffect extends OneShotEffect { // Destroy target creature with converted mana cost X. Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source)); if (targetCreature != null && targetCreature.destroy(source.getSourceId(), game, false)) { - game.applyEffects(); + game.getState().processAction(game); if (targetCreature.getZoneChangeCounter(game) + 1 == game.getState().getZoneChangeCounter(targetCreature.getId()) && game.getState().getZone(targetCreature.getId()) != Zone.GRAVEYARD) { // A replacement effect has moved the card to another zone as graveyard diff --git a/Mage.Sets/src/mage/cards/k/KraulHarpooner.java b/Mage.Sets/src/mage/cards/k/KraulHarpooner.java index 13c16e28cb..dbb43938a5 100644 --- a/Mage.Sets/src/mage/cards/k/KraulHarpooner.java +++ b/Mage.Sets/src/mage/cards/k/KraulHarpooner.java @@ -95,7 +95,7 @@ class KraulHarpoonerEffect extends OneShotEffect { } int xValue = player.getGraveyard().count(StaticFilters.FILTER_CARD_CREATURE, game); game.addEffect(new BoostSourceEffect(xValue, 0, Duration.EndOfTurn), source); - game.applyEffects(); + game.getState().processAction(game); Permanent creature = game.getPermanent(source.getFirstTarget()); if (creature == null || !player.chooseUse(outcome, "Have " + sourcePerm.getLogName() + " fight " + creature.getLogName() + "?", source, game)) { return true; diff --git a/Mage.Sets/src/mage/cards/k/KrenkoTinStreetKingpin.java b/Mage.Sets/src/mage/cards/k/KrenkoTinStreetKingpin.java index 7ba8079a32..10b4d902e5 100644 --- a/Mage.Sets/src/mage/cards/k/KrenkoTinStreetKingpin.java +++ b/Mage.Sets/src/mage/cards/k/KrenkoTinStreetKingpin.java @@ -70,7 +70,7 @@ class KrenkoTinStreetKingpinEffect extends OneShotEffect { return false; } new AddCountersSourceEffect(CounterType.P1P1.createInstance()).apply(game, source); - game.applyEffects(); + game.getState().processAction(game); int xValue = permanent.getPower().getValue(); return new CreateTokenEffect(new GoblinToken("WAR"), xValue).apply(game, source); } diff --git a/Mage.Sets/src/mage/cards/l/LilianasDefeat.java b/Mage.Sets/src/mage/cards/l/LilianasDefeat.java index c39d3aaf27..02bedc3b11 100644 --- a/Mage.Sets/src/mage/cards/l/LilianasDefeat.java +++ b/Mage.Sets/src/mage/cards/l/LilianasDefeat.java @@ -67,7 +67,7 @@ class LilianasDefeatEffect extends OneShotEffect { Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); if (player != null && permanent != null) { permanent.destroy(source.getSourceId(), game, true); - game.applyEffects(); + game.getState().processAction(game); if (permanent.isPlaneswalker() && permanent.hasSubtype(SubType.LILIANA, game)) { Player permanentController = game.getPlayer(permanent.getControllerId()); if (permanentController != null) { diff --git a/Mage.Sets/src/mage/cards/l/LivingDeath.java b/Mage.Sets/src/mage/cards/l/LivingDeath.java index 904c560c38..bfe880cbca 100644 --- a/Mage.Sets/src/mage/cards/l/LivingDeath.java +++ b/Mage.Sets/src/mage/cards/l/LivingDeath.java @@ -76,13 +76,13 @@ class LivingDeathEffect extends OneShotEffect { } } } - game.applyEffects(); + game.getState().processAction(game); // Sacrifice all creatures for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) { permanent.sacrifice(source.getSourceId(), game); } - game.applyEffects(); + game.getState().processAction(game); // Exiled cards are put onto the battlefield at the same time under their owner's control Set cardsToReturnFromExile = new HashSet<>(); diff --git a/Mage.Sets/src/mage/cards/m/MayaelsAria.java b/Mage.Sets/src/mage/cards/m/MayaelsAria.java index 027b039b67..2344735fc1 100644 --- a/Mage.Sets/src/mage/cards/m/MayaelsAria.java +++ b/Mage.Sets/src/mage/cards/m/MayaelsAria.java @@ -75,7 +75,7 @@ class MayaelsAriaEffect extends OneShotEffect { creature.addCounters(CounterType.P1P1.createInstance(), source, game); } } - game.applyEffects(); // needed because otehrwise the +1/+1 counters wouldn't be taken into account + game.getState().processAction(game); // needed because otehrwise the +1/+1 counters wouldn't be taken into account // Then you gain 10 life if you control a creature with power 10 or greater. filter = new FilterCreaturePermanent(); diff --git a/Mage.Sets/src/mage/cards/m/MoltenPsyche.java b/Mage.Sets/src/mage/cards/m/MoltenPsyche.java index 7d80268bf9..b3ef8785c6 100644 --- a/Mage.Sets/src/mage/cards/m/MoltenPsyche.java +++ b/Mage.Sets/src/mage/cards/m/MoltenPsyche.java @@ -73,7 +73,7 @@ class MoltenPsycheEffect extends OneShotEffect { } } - game.applyEffects(); // so effects from creatures that were on the battlefield won't trigger from draw action + game.getState().processAction(game); // so effects from creatures that were on the battlefield won't trigger from draw action for (UUID playerId : cardsToDraw.keySet()) { Player player = game.getPlayer(playerId); diff --git a/Mage.Sets/src/mage/cards/o/Oblation.java b/Mage.Sets/src/mage/cards/o/Oblation.java index 5e84b814d1..85af435e69 100644 --- a/Mage.Sets/src/mage/cards/o/Oblation.java +++ b/Mage.Sets/src/mage/cards/o/Oblation.java @@ -63,7 +63,7 @@ class OblationEffect extends OneShotEffect { player.moveCardToLibraryWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD, true, true); player.shuffleLibrary(source, game); - game.applyEffects(); // so effects from creatures that were on the battlefield won't trigger from draw + game.getState().processAction(game); // so effects from creatures that were on the battlefield won't trigger from draw player.drawCards(2, source.getSourceId(), game); return true; diff --git a/Mage.Sets/src/mage/cards/o/Outmuscle.java b/Mage.Sets/src/mage/cards/o/Outmuscle.java index d64ecb8b25..c35df58cd9 100644 --- a/Mage.Sets/src/mage/cards/o/Outmuscle.java +++ b/Mage.Sets/src/mage/cards/o/Outmuscle.java @@ -83,7 +83,7 @@ class OutmuscleEffect extends OneShotEffect { if (creature == null) { return true; } - game.applyEffects(); + game.getState().processAction(game); return creature.fight(permanent, source, game); } } diff --git a/Mage.Sets/src/mage/cards/p/ProfaneProcession.java b/Mage.Sets/src/mage/cards/p/ProfaneProcession.java index 67d0fa8434..8008c8eabb 100644 --- a/Mage.Sets/src/mage/cards/p/ProfaneProcession.java +++ b/Mage.Sets/src/mage/cards/p/ProfaneProcession.java @@ -76,7 +76,7 @@ class ProfaneProcessionEffect extends OneShotEffect { MageObject sourceObject = source.getSourceObject(game); if (controller != null && exileId != null && sourceObject != null) { new ExileTargetEffect(exileId, sourceObject.getIdName()).setTargetPointer(targetPointer).apply(game, source); - game.applyEffects(); + game.getState().processAction(game); ExileZone exileZone = game.getExile().getExileZone(exileId); if (exileZone != null && exileZone.size() > 2) { new TransformSourceEffect(true).apply(game, source); diff --git a/Mage.Sets/src/mage/cards/p/PureReflection.java b/Mage.Sets/src/mage/cards/p/PureReflection.java index cad8231b33..645bc1d895 100644 --- a/Mage.Sets/src/mage/cards/p/PureReflection.java +++ b/Mage.Sets/src/mage/cards/p/PureReflection.java @@ -71,7 +71,7 @@ public final class PureReflection extends CardImpl { game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game).forEach((permanent) -> { permanent.destroy(source.getSourceId(), game,false); }); - game.applyEffects(); + game.getState().processAction(game); // Then that player creates an X/X white Reflection creature token, where X is the converted mana cost of that spell. ReflectionPureToken token = new ReflectionPureToken(spell.getConvertedManaCost()); diff --git a/Mage.Sets/src/mage/cards/s/SavageSwipe.java b/Mage.Sets/src/mage/cards/s/SavageSwipe.java index 8c8140ad78..65caea0855 100644 --- a/Mage.Sets/src/mage/cards/s/SavageSwipe.java +++ b/Mage.Sets/src/mage/cards/s/SavageSwipe.java @@ -70,7 +70,7 @@ class SavageSwipeEffect extends OneShotEffect { ContinuousEffect effect = new BoostTargetEffect(2, 2, Duration.EndOfTurn); effect.setTargetPointer(new FixedTarget(permanent, game)); game.addEffect(effect, source); - game.applyEffects(); + game.getState().processAction(game); } return new FightTargetsEffect().apply(game, source); } diff --git a/Mage.Sets/src/mage/cards/s/SorinLordOfInnistrad.java b/Mage.Sets/src/mage/cards/s/SorinLordOfInnistrad.java index 7a89e3f455..d65929f660 100644 --- a/Mage.Sets/src/mage/cards/s/SorinLordOfInnistrad.java +++ b/Mage.Sets/src/mage/cards/s/SorinLordOfInnistrad.java @@ -101,7 +101,7 @@ class SorinLordOfInnistradEffect extends OneShotEffect { } } } - game.applyEffects(); + game.getState().processAction(game); Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { return controller.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game); diff --git a/Mage.Sets/src/mage/cards/t/TahngarthFirstMate.java b/Mage.Sets/src/mage/cards/t/TahngarthFirstMate.java index 693bf559f0..a8c700033e 100644 --- a/Mage.Sets/src/mage/cards/t/TahngarthFirstMate.java +++ b/Mage.Sets/src/mage/cards/t/TahngarthFirstMate.java @@ -133,7 +133,7 @@ class TahngarthFirstMateEffect extends OneShotEffect { ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfCombat, player.getId()); effect.setTargetPointer(new FixedTarget(permanent, game)); game.addEffect(effect, source); - game.applyEffects(); + game.getState().processAction(game); return game.getCombat().addAttackerToCombat(permanent.getId(), target.getFirstTarget(), game); } } diff --git a/Mage.Sets/src/mage/cards/t/TeleminPerformance.java b/Mage.Sets/src/mage/cards/t/TeleminPerformance.java index b1b7aca67a..b01048d173 100644 --- a/Mage.Sets/src/mage/cards/t/TeleminPerformance.java +++ b/Mage.Sets/src/mage/cards/t/TeleminPerformance.java @@ -77,7 +77,7 @@ class TeleminPerformanceEffect extends OneShotEffect { opponent.revealCards(source, reveal, game); opponent.moveCards(nonCreatures, Zone.GRAVEYARD, source, game); if (creature != null) { - game.applyEffects(); + game.getState().processAction(game); controller.moveCards(creature, Zone.BATTLEFIELD, source, game); } } diff --git a/Mage.Sets/src/mage/cards/t/Terastodon.java b/Mage.Sets/src/mage/cards/t/Terastodon.java index 4a73c47b75..3adf3d54bb 100644 --- a/Mage.Sets/src/mage/cards/t/Terastodon.java +++ b/Mage.Sets/src/mage/cards/t/Terastodon.java @@ -88,7 +88,7 @@ class TerastodonEffect extends OneShotEffect { } } } - game.applyEffects(); + game.getState().processAction(game); ElephantToken elephantToken = new ElephantToken(); for (Entry entry : destroyedPermanents.entrySet()) { elephantToken.putOntoBattlefield(entry.getValue(), game, source.getSourceId(), entry.getKey()); diff --git a/Mage.Sets/src/mage/cards/t/TheGreatAurora.java b/Mage.Sets/src/mage/cards/t/TheGreatAurora.java index ee5e5e07f9..063ae0af37 100644 --- a/Mage.Sets/src/mage/cards/t/TheGreatAurora.java +++ b/Mage.Sets/src/mage/cards/t/TheGreatAurora.java @@ -90,7 +90,7 @@ class TheGreatAuroraEffect extends OneShotEffect { } } - game.applyEffects(); // so effects from creatures that were on the battlefield won't trigger from draw or put into play + game.getState().processAction(game); // so effects from creatures that were on the battlefield won't trigger from draw or put into play // Draw cards for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { diff --git a/Mage.Sets/src/mage/cards/t/ThoughtDissector.java b/Mage.Sets/src/mage/cards/t/ThoughtDissector.java index f817054089..d57da0a9b6 100644 --- a/Mage.Sets/src/mage/cards/t/ThoughtDissector.java +++ b/Mage.Sets/src/mage/cards/t/ThoughtDissector.java @@ -90,7 +90,7 @@ class ThoughtDissectorEffect extends OneShotEffect { } targetOpponent.revealCards(source, reveal, game); if (artifact != null) { - game.applyEffects(); + game.getState().processAction(game); controller.moveCards(artifact, Zone.BATTLEFIELD, source, game); Permanent sourcePermanent = source.getSourcePermanentIfItStillExists(game); if (sourcePermanent != null) { diff --git a/Mage.Sets/src/mage/cards/t/TwilightProphet.java b/Mage.Sets/src/mage/cards/t/TwilightProphet.java index 1d09e42beb..bdc5347216 100644 --- a/Mage.Sets/src/mage/cards/t/TwilightProphet.java +++ b/Mage.Sets/src/mage/cards/t/TwilightProphet.java @@ -86,7 +86,7 @@ class TwilightProphetEffect extends OneShotEffect { if (card != null) { controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game); controller.moveCards(card, Zone.HAND, source, game); - game.applyEffects(); + game.getState().processAction(game); int amount = card.getConvertedManaCost(); if (amount > 0) { new LoseLifeOpponentsEffect(amount).apply(game, source); diff --git a/Mage.Sets/src/mage/cards/v/VesuvanShapeshifter.java b/Mage.Sets/src/mage/cards/v/VesuvanShapeshifter.java index 234266a6fa..3d8109bd95 100644 --- a/Mage.Sets/src/mage/cards/v/VesuvanShapeshifter.java +++ b/Mage.Sets/src/mage/cards/v/VesuvanShapeshifter.java @@ -120,7 +120,7 @@ class VesuvanShapeshifterEffect extends OneShotEffect { if (copyFromCreature != null) { game.copyPermanent(Duration.Custom, copyFromCreature, copyToCreature.getId(), source, new VesuvanShapeShifterFaceUpApplier()); source.getTargets().clear(); - game.applyEffects(); // needed to get effects ready if copy happens in replacment and the copied abilities react of the same event (e.g. turn face up) + game.getState().processAction(game); // needed to get effects ready if copy happens in replacment and the copied abilities react of the same event (e.g. turn face up) return true; } } diff --git a/Mage.Sets/src/mage/cards/v/Victimize.java b/Mage.Sets/src/mage/cards/v/Victimize.java index 89a75c8500..159bbf14b3 100644 --- a/Mage.Sets/src/mage/cards/v/Victimize.java +++ b/Mage.Sets/src/mage/cards/v/Victimize.java @@ -64,7 +64,7 @@ class VictimizeEffect extends OneShotEffect { if (controller != null) { SacrificeTargetCost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)); if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) { - game.applyEffects(); // To end effects of the sacrificed creature + game.getState().processAction(game); // To end effects of the sacrificed creature controller.moveCards(new CardsImpl(getTargetPointer().getTargets(game, source)).getCards(game), Zone.BATTLEFIELD, source, game, true, false, false, null); } diff --git a/Mage.Sets/src/mage/cards/w/WarpWorld.java b/Mage.Sets/src/mage/cards/w/WarpWorld.java index 08be3d7186..fa93b55655 100644 --- a/Mage.Sets/src/mage/cards/w/WarpWorld.java +++ b/Mage.Sets/src/mage/cards/w/WarpWorld.java @@ -97,7 +97,7 @@ class WarpWorldEffect extends OneShotEffect { } } - game.applyEffects(); // so effects from creatures that were on the battlefield won't trigger from draw or later put into play + game.getState().processAction(game); // so effects from creatures that were on the battlefield won't trigger from draw or later put into play Map cardsRevealed = new HashMap<>(); @@ -111,7 +111,7 @@ class WarpWorldEffect extends OneShotEffect { cardsRevealed.put(player.getId(), cards); } } - game.applyEffects(); + game.getState().processAction(game); // put artifacts, creaturs and lands onto the battlefield for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { Player player = game.getPlayer(playerId); @@ -129,7 +129,7 @@ class WarpWorldEffect extends OneShotEffect { player.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game); } } - game.applyEffects(); + game.getState().processAction(game); // put enchantments onto the battlefield for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { Player player = game.getPlayer(playerId); diff --git a/Mage.Sets/src/mage/cards/w/WaveOfVitriol.java b/Mage.Sets/src/mage/cards/w/WaveOfVitriol.java index 77496dc4f9..528d4f14ec 100644 --- a/Mage.Sets/src/mage/cards/w/WaveOfVitriol.java +++ b/Mage.Sets/src/mage/cards/w/WaveOfVitriol.java @@ -92,7 +92,7 @@ class WaveOfVitriolEffect extends OneShotEffect { } } } - game.applyEffects(); + game.getState().processAction(game); Cards toBattlefield = new CardsImpl(); Set playersToShuffle = new LinkedHashSet<>(); for (Map.Entry entry : sacrificedLands.entrySet()) { diff --git a/Mage.Sets/src/mage/cards/w/WidespreadBrutality.java b/Mage.Sets/src/mage/cards/w/WidespreadBrutality.java index bc301ae444..5cdb9dd9f1 100644 --- a/Mage.Sets/src/mage/cards/w/WidespreadBrutality.java +++ b/Mage.Sets/src/mage/cards/w/WidespreadBrutality.java @@ -61,7 +61,7 @@ class WidespreadBrutalityEffect extends OneShotEffect { if (amassedArmy == null) { return false; } - game.applyEffects(); + game.getState().processAction(game); int power = amassedArmy.getPower().getValue(); for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { if (permanent != null && permanent.isCreature() && !permanent.hasSubtype(SubType.ARMY, game)) { diff --git a/Mage.Sets/src/mage/cards/y/YorvoLordOfGarenbrig.java b/Mage.Sets/src/mage/cards/y/YorvoLordOfGarenbrig.java index 580cbdc595..2cfb09ad0e 100644 --- a/Mage.Sets/src/mage/cards/y/YorvoLordOfGarenbrig.java +++ b/Mage.Sets/src/mage/cards/y/YorvoLordOfGarenbrig.java @@ -93,7 +93,7 @@ class YorvoLordOfGarenbrigEffect extends OneShotEffect { if (permanent == null) { return true; } - game.applyEffects(); + game.getState().processAction(game); if (permanent.getPower().getValue() > sourcePerm.getPower().getValue()) { sourcePerm.addCounters(CounterType.P1P1.createInstance(), source, game); } diff --git a/Mage.Sets/src/mage/cards/z/ZombieApocalypse.java b/Mage.Sets/src/mage/cards/z/ZombieApocalypse.java index 530bd9e7a1..5c06588625 100644 --- a/Mage.Sets/src/mage/cards/z/ZombieApocalypse.java +++ b/Mage.Sets/src/mage/cards/z/ZombieApocalypse.java @@ -66,7 +66,7 @@ class ZombieApocalypseEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { controller.moveCards(controller.getGraveyard().getCards(filterZombie, game), Zone.BATTLEFIELD, source, game, true, false, false, null); - game.applyEffects(); + game.getState().processAction(game); for (Permanent permanent : game.getBattlefield().getActivePermanents( new FilterPermanent(SubType.HUMAN, "Humans"), source.getControllerId(), game)) { permanent.destroy(source.getSourceId(), game, false);