From 731b3913064395550da9cf7de7093448afbe579a Mon Sep 17 00:00:00 2001 From: Steven Knipe Date: Sun, 1 Oct 2023 22:25:37 -0700 Subject: [PATCH] return guard Style change --- .../src/mage/cards/a/ActOfAuthority.java | 12 +++++-- Mage.Sets/src/mage/cards/a/Aetherspouts.java | 4 ++- Mage.Sets/src/mage/cards/a/AkoumHellkite.java | 20 ++++++++--- .../mage/cards/a/AlhammarretHighArbiter.java | 8 +++-- Mage.Sets/src/mage/cards/a/AliFromCairo.java | 12 +++++-- .../mage/cards/a/AlignedHedronNetwork.java | 12 +++++-- Mage.Sets/src/mage/cards/a/AllHallowsEve.java | 12 +++++-- .../src/mage/cards/a/AnHavvaConstable.java | 8 +++-- .../src/mage/cards/a/AshioksErasure.java | 4 ++- Mage.Sets/src/mage/cards/a/AuraFinesse.java | 4 ++- Mage.Sets/src/mage/cards/a/AutumnWillow.java | 4 ++- Mage.Sets/src/mage/cards/a/AzorsGateway.java | 8 +++-- Mage.Sets/src/mage/cards/b/Banefire.java | 12 +++++-- Mage.Sets/src/mage/cards/b/BanthaHerd.java | 4 ++- Mage.Sets/src/mage/cards/b/BatheInLight.java | 16 ++++++--- Mage.Sets/src/mage/cards/b/BendOrBreak.java | 4 ++- .../src/mage/cards/b/BenevolentOffering.java | 16 ++++++--- Mage.Sets/src/mage/cards/b/Berserk.java | 16 ++++++--- .../src/mage/cards/b/BiomanticMastery.java | 4 ++- Mage.Sets/src/mage/cards/b/BitterFeud.java | 36 ++++++++++++++----- .../src/mage/cards/b/BlinkmothInfusion.java | 4 ++- .../src/mage/cards/b/BloodBaronOfVizkopa.java | 24 +++++++++---- .../src/mage/cards/b/BloodlineShaman.java | 12 +++++-- .../src/mage/cards/b/BoneyardScourge.java | 4 ++- .../src/mage/cards/b/BoonweaverGiant.java | 4 ++- Mage.Sets/src/mage/cards/b/BosiumStrip.java | 20 ++++++++--- .../src/mage/cards/b/BountyOfTheLuxa.java | 4 ++- .../src/mage/cards/b/BraceForImpact.java | 4 ++- .../src/mage/cards/b/BridgeFromBelow.java | 8 +++-- Mage.Sets/src/mage/cards/b/Brightflame.java | 4 ++- .../src/mage/cards/b/BrimazKingOfOreskos.java | 4 ++- .../mage/cards/b/BrunaLightOfAlabaster.java | 8 +++-- .../src/mage/cards/b/BudokaGardener.java | 4 ++- .../src/mage/cards/b/BurnFromWithin.java | 4 ++- .../src/mage/cards/c/CorneredMarket.java | 4 ++- .../src/mage/cards/c/CryOfTheCarnarium.java | 4 ++- .../src/mage/cards/e/ExclusionRitual.java | 8 +++-- .../src/mage/cards/g/GideonsIntervention.java | 4 ++- .../src/mage/cards/i/IxalansBinding.java | 4 ++- .../src/mage/cards/k/KjeldoranEliteGuard.java | 4 ++- Mage.Sets/src/mage/cards/k/KnowledgePool.java | 28 +++++++++++---- Mage.Sets/src/mage/cards/m/ManaMaze.java | 4 ++- Mage.Sets/src/mage/cards/m/MeddlingMage.java | 8 +++-- Mage.Sets/src/mage/cards/m/MiragePhalanx.java | 4 ++- .../mage/cards/m/MyojinOfGrimBetrayal.java | 4 ++- .../src/mage/cards/p/PossibilityStorm.java | 20 ++++++++--- Mage.Sets/src/mage/cards/p/PredatorsHour.java | 24 +++++++++---- Mage.Sets/src/mage/cards/r/ReflectorMage.java | 8 +++-- .../mage/cards/s/ShadowgrangeArchfiend.java | 4 ++- .../mage/cards/s/StrefanMaurerProgenitor.java | 16 ++++++--- .../src/mage/cards/t/ThievesAuction.java | 4 ++- .../src/mage/cards/t/ThrillingEncore.java | 4 ++- .../src/mage/cards/t/TimotharBaronOfBats.java | 28 +++++++++++---- ...entsCantCastChosenUntilNextTurnEffect.java | 12 +++++-- 54 files changed, 390 insertions(+), 130 deletions(-) diff --git a/Mage.Sets/src/mage/cards/a/ActOfAuthority.java b/Mage.Sets/src/mage/cards/a/ActOfAuthority.java index ece46dd7974..4bb24e7c8ff 100644 --- a/Mage.Sets/src/mage/cards/a/ActOfAuthority.java +++ b/Mage.Sets/src/mage/cards/a/ActOfAuthority.java @@ -66,10 +66,14 @@ class ActOfAuthorityEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Permanent targetPermanent = game.getPermanent(getTargetPointer().getFirst(game, source)); - if (targetPermanent == null) { return false; } + if (targetPermanent == null) { + return false; + } ExileTargetEffect exileTargetEffect = new ExileTargetEffect(); - if (!exileTargetEffect.apply(game, source)) { return false; } + if (!exileTargetEffect.apply(game, source)) { + return false; + } Permanent sourcePermanent = source.getSourcePermanentIfItStillExists(game); if (sourcePermanent == null) { return true; } @@ -111,7 +115,9 @@ class ActOfAuthorityGainControlEffect extends ContinuousEffectImpl { permanent = game.getPermanent(targetPointer.getFirst(game, source)); } - if (permanent == null) { return false; } + if (permanent == null) { + return false; + } return permanent.changeControllerId(controller, game, source); } diff --git a/Mage.Sets/src/mage/cards/a/Aetherspouts.java b/Mage.Sets/src/mage/cards/a/Aetherspouts.java index 3b1ff006ad2..cb7324fd9b8 100644 --- a/Mage.Sets/src/mage/cards/a/Aetherspouts.java +++ b/Mage.Sets/src/mage/cards/a/Aetherspouts.java @@ -72,7 +72,9 @@ class AetherspoutsEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { game.getPlayerList(); Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } PlayerList playerList = game.getState().getPlayersInRange(controller.getId(), game); playerList.setCurrent(game.getActivePlayerId()); diff --git a/Mage.Sets/src/mage/cards/a/AkoumHellkite.java b/Mage.Sets/src/mage/cards/a/AkoumHellkite.java index 7acbb125b48..3a79eb856ab 100644 --- a/Mage.Sets/src/mage/cards/a/AkoumHellkite.java +++ b/Mage.Sets/src/mage/cards/a/AkoumHellkite.java @@ -75,12 +75,18 @@ class AkoumHellkiteTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent == null) { return false; } + if (permanent == null) { + return false; + } - if (!permanent.isLand(game) || !permanent.isControlledBy(getControllerId())) { return false; } + if (!permanent.isLand(game) || !permanent.isControlledBy(getControllerId())) { + return false; + } Permanent sourcePermanent = game.getPermanent(getSourceId()); - if (sourcePermanent == null) { return false; } + if (sourcePermanent == null) { + return false; + } for (Effect effect : getEffects()) { if (effect instanceof AkoumHellkiteDamageEffect) { @@ -118,14 +124,18 @@ class AkoumHellkiteDamageEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Permanent land = getTargetPointer().getFirstTargetPermanentOrLKI(game, source); - if (land == null) { return false; } + if (land == null) { + return false; + } int damage = land.hasSubtype(SubType.MOUNTAIN, game) ? 2 : 1; // Get target for damange Player player = game.getPlayer(source.getFirstTarget()); Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (player == null && permanent == null) { return false; } + if (player == null && permanent == null) { + return false; + } if (player != null) { // Target is a player diff --git a/Mage.Sets/src/mage/cards/a/AlhammarretHighArbiter.java b/Mage.Sets/src/mage/cards/a/AlhammarretHighArbiter.java index 60ff82a4a2f..f9aa62b2269 100644 --- a/Mage.Sets/src/mage/cards/a/AlhammarretHighArbiter.java +++ b/Mage.Sets/src/mage/cards/a/AlhammarretHighArbiter.java @@ -155,9 +155,13 @@ class AlhammarretHighArbiterCantCastEffect extends ContinuousRuleModifyingEffect public boolean applies(GameEvent event, Ability source, Game game) { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { SpellAbility spellAbility = SpellAbility.getSpellAbilityFromEvent(event, game); - if (spellAbility == null) { return false;} + if (spellAbility == null) { + return false; + } Card card = spellAbility.getCharacteristics(game); - if (card == null) { return false;} + if (card == null) { + return false; + } return CardUtil.haveSameNames(card, cardName, game); } return false; diff --git a/Mage.Sets/src/mage/cards/a/AliFromCairo.java b/Mage.Sets/src/mage/cards/a/AliFromCairo.java index c3f369db71d..02bd9b5f22f 100644 --- a/Mage.Sets/src/mage/cards/a/AliFromCairo.java +++ b/Mage.Sets/src/mage/cards/a/AliFromCairo.java @@ -65,10 +65,14 @@ class AliFromCairoReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent == null) { return false; } + if (permanent == null) { + return false; + } Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } return (controller.getLife() > 0) && (controller.getLife() - event.getAmount()) < 1 && event.getPlayerId().equals(controller.getId()); @@ -77,7 +81,9 @@ class AliFromCairoReplacementEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } // 10/1/2008: The ability doesn't change how much damage is dealt; // it just changes how much life that damage makes you lose. diff --git a/Mage.Sets/src/mage/cards/a/AlignedHedronNetwork.java b/Mage.Sets/src/mage/cards/a/AlignedHedronNetwork.java index 29fda7b4c4a..36d5674c6c6 100644 --- a/Mage.Sets/src/mage/cards/a/AlignedHedronNetwork.java +++ b/Mage.Sets/src/mage/cards/a/AlignedHedronNetwork.java @@ -69,13 +69,19 @@ class AlignedHedronNetworkExileEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false;} + if (controller == null) { + return false; + } Permanent permanent = source.getSourcePermanentIfItStillExists(game); - if (permanent == null) { return false; } + if (permanent == null) { + return false; + } Set toExile = new LinkedHashSet<>(game.getBattlefield().getActivePermanents(filter, controller.getId(), source, game)); - if (toExile.isEmpty()) { return false; } + if (toExile.isEmpty()) { + return false; + } controller.moveCardsToExile(toExile, source, game, true, CardUtil.getCardExileZoneId(game, source), permanent.getIdName()); game.addDelayedTriggeredAbility(new OnLeaveReturnExiledAbility(), source); diff --git a/Mage.Sets/src/mage/cards/a/AllHallowsEve.java b/Mage.Sets/src/mage/cards/a/AllHallowsEve.java index 1b6e2b12496..0cc79d29177 100644 --- a/Mage.Sets/src/mage/cards/a/AllHallowsEve.java +++ b/Mage.Sets/src/mage/cards/a/AllHallowsEve.java @@ -79,11 +79,17 @@ class AllHallowsEveEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Card allHallowsEveCard = (Card) source.getSourceObject(game); - if (allHallowsEveCard == null) { return false; } + if (allHallowsEveCard == null) { + return false; + } Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } - if (allHallowsEveCard.getCounters(game).getCount(CounterType.SCREAM) > 0) { return false; } + if (allHallowsEveCard.getCounters(game).getCount(CounterType.SCREAM) > 0) { + return false; + } controller.moveCards(allHallowsEveCard, Zone.GRAVEYARD, source, game); Cards allCreatureCardsInGraveyards = new CardsImpl(); diff --git a/Mage.Sets/src/mage/cards/a/AnHavvaConstable.java b/Mage.Sets/src/mage/cards/a/AnHavvaConstable.java index 8687a4cbce9..2d8df1c4b73 100644 --- a/Mage.Sets/src/mage/cards/a/AnHavvaConstable.java +++ b/Mage.Sets/src/mage/cards/a/AnHavvaConstable.java @@ -61,10 +61,14 @@ class AnHavvaConstableEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } MageObject mageObject = game.getObject(source.getSourceId()); - if (mageObject == null) { return false; } + if (mageObject == null) { + return false; + } FilterCreaturePermanent filter = new FilterCreaturePermanent("green creatures"); filter.add(new ColorPredicate(ObjectColor.GREEN)); diff --git a/Mage.Sets/src/mage/cards/a/AshioksErasure.java b/Mage.Sets/src/mage/cards/a/AshioksErasure.java index d5fabcf4189..e12a1acceb3 100644 --- a/Mage.Sets/src/mage/cards/a/AshioksErasure.java +++ b/Mage.Sets/src/mage/cards/a/AshioksErasure.java @@ -118,7 +118,9 @@ class AshioksErasureReplacementEffect extends ContinuousRuleModifyingEffectImpl return false; } SpellAbility spellAbility = SpellAbility.getSpellAbilityFromEvent(event, game); - if (spellAbility == null) { return false;} + if (spellAbility == null) { + return false; + } Card card = spellAbility.getCharacteristics(game); if (sourcePermanent == null || card == null) { diff --git a/Mage.Sets/src/mage/cards/a/AuraFinesse.java b/Mage.Sets/src/mage/cards/a/AuraFinesse.java index 8718fe85403..8a3a4413d32 100644 --- a/Mage.Sets/src/mage/cards/a/AuraFinesse.java +++ b/Mage.Sets/src/mage/cards/a/AuraFinesse.java @@ -76,7 +76,9 @@ class AuraFinesseEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } Permanent aura = game.getPermanent(source.getFirstTarget()); Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget()); diff --git a/Mage.Sets/src/mage/cards/a/AutumnWillow.java b/Mage.Sets/src/mage/cards/a/AutumnWillow.java index 5a6173644ac..34f9d8a3530 100644 --- a/Mage.Sets/src/mage/cards/a/AutumnWillow.java +++ b/Mage.Sets/src/mage/cards/a/AutumnWillow.java @@ -70,7 +70,9 @@ class AutumnWillowEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { - if (!affectedControllerId.equals(source.getFirstTarget())) { return false; } + if (!affectedControllerId.equals(source.getFirstTarget())) { + return false; + } Permanent creature = game.getPermanent(sourceId); return creature != null &&sourceId.equals(source.getSourceId()); diff --git a/Mage.Sets/src/mage/cards/a/AzorsGateway.java b/Mage.Sets/src/mage/cards/a/AzorsGateway.java index a50a20827db..08dacfb1d47 100644 --- a/Mage.Sets/src/mage/cards/a/AzorsGateway.java +++ b/Mage.Sets/src/mage/cards/a/AzorsGateway.java @@ -78,10 +78,14 @@ class AzorsGatewayEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } MageObject sourceObject = source.getSourceObject(game); - if (sourceObject == null) { return false; } + if (sourceObject == null) { + return false; + } UUID exileId = CardUtil.getCardExileZoneId(game, source); diff --git a/Mage.Sets/src/mage/cards/b/Banefire.java b/Mage.Sets/src/mage/cards/b/Banefire.java index e79b0d260b9..c4455c32cbe 100644 --- a/Mage.Sets/src/mage/cards/b/Banefire.java +++ b/Mage.Sets/src/mage/cards/b/Banefire.java @@ -130,13 +130,19 @@ class BanefireCantCounterEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() != GameEvent.EventType.COUNTER) { return false; } + if (event.getType() != GameEvent.EventType.COUNTER) { + return false; + } Card card = game.getCard(source.getSourceId()); - if (card == null) { return false; } + if (card == null) { + return false; + } UUID spellId = card.getSpellAbility().getId(); - if (!event.getTargetId().equals(spellId)) { return false; } + if (!event.getTargetId().equals(spellId)) { + return false; + } return condition.apply(game, source); } diff --git a/Mage.Sets/src/mage/cards/b/BanthaHerd.java b/Mage.Sets/src/mage/cards/b/BanthaHerd.java index 6c2411c9868..84a9c99ef79 100644 --- a/Mage.Sets/src/mage/cards/b/BanthaHerd.java +++ b/Mage.Sets/src/mage/cards/b/BanthaHerd.java @@ -65,7 +65,9 @@ class BathaHerdEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } int xValue = ((BecomesMonstrousSourceTriggeredAbility) source).getMonstrosityValue(); diff --git a/Mage.Sets/src/mage/cards/b/BatheInLight.java b/Mage.Sets/src/mage/cards/b/BatheInLight.java index e6fcafbb495..5a9bc5a2822 100644 --- a/Mage.Sets/src/mage/cards/b/BatheInLight.java +++ b/Mage.Sets/src/mage/cards/b/BatheInLight.java @@ -70,13 +70,19 @@ class BatheInLightEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } Permanent target = game.getPermanent(getTargetPointer().getFirst(game, source)); - if (target == null) { return false; } + if (target == null) { + return false; + } ChoiceColor colorChoice = new ChoiceColor(); - if (!controller.choose(Outcome.Benefit, colorChoice, game)) { return false; } + if (!controller.choose(Outcome.Benefit, colorChoice, game)) { + return false; + } game.informPlayers(target.getName() + ": " + controller.getLogName() + " has chosen " + colorChoice.getChoice()); game.getState().setValue(target.getId() + "_color", colorChoice.getColor()); @@ -126,7 +132,9 @@ class ProtectionChosenColorTargetEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); - if (permanent == null) { return false; } + if (permanent == null) { + return false; + } ObjectColor color = (ObjectColor) game.getState().getValue(permanent.getId() + "_color"); if (color != null && (protectionAbility == null || !color.equals(chosenColor))) { diff --git a/Mage.Sets/src/mage/cards/b/BendOrBreak.java b/Mage.Sets/src/mage/cards/b/BendOrBreak.java index 3eb86922f38..7d5a2527d8b 100644 --- a/Mage.Sets/src/mage/cards/b/BendOrBreak.java +++ b/Mage.Sets/src/mage/cards/b/BendOrBreak.java @@ -64,7 +64,9 @@ class BendOrBreakEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } // Map of players and their piles Map>> playerPermanents = new LinkedHashMap<>(); diff --git a/Mage.Sets/src/mage/cards/b/BenevolentOffering.java b/Mage.Sets/src/mage/cards/b/BenevolentOffering.java index ba3d3199418..61dc75ff803 100644 --- a/Mage.Sets/src/mage/cards/b/BenevolentOffering.java +++ b/Mage.Sets/src/mage/cards/b/BenevolentOffering.java @@ -63,12 +63,16 @@ class BenevolentOfferingEffect1 extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } Target target = new TargetOpponent(true); target.choose(Outcome.Sacrifice, source.getControllerId(), source.getSourceId(), source, game); Player opponent = game.getPlayer(target.getFirstTarget()); - if (opponent == null) { return false; } + if (opponent == null) { + return false; + } Effect effect = new CreateTokenTargetEffect(new SpiritWhiteToken(), 3); effect.setTargetPointer(new FixedTarget(opponent.getId())); @@ -97,12 +101,16 @@ class BenevolentOfferingEffect2 extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } Target target = new TargetOpponent(true); target.choose(Outcome.Sacrifice, source.getControllerId(), source.getSourceId(), source, game); Player opponent = game.getPlayer(target.getFirstTarget()); - if (opponent == null) { return false; } + if (opponent == null) { + return false; + } int count = game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), game) * 2; controller.gainLife(count, game, source); diff --git a/Mage.Sets/src/mage/cards/b/Berserk.java b/Mage.Sets/src/mage/cards/b/Berserk.java index bec5e5c48fc..69f3b196a34 100644 --- a/Mage.Sets/src/mage/cards/b/Berserk.java +++ b/Mage.Sets/src/mage/cards/b/Berserk.java @@ -127,7 +127,9 @@ class BerserkDestroyEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } //create delayed triggered ability Effect effect = new BerserkDelayedDestroyEffect(); @@ -158,13 +160,19 @@ class BerserkDelayedDestroyEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } Permanent permanent = game.getPermanent(this.getTargetPointer().getFirst(game, source)); - if (permanent == null) { return false; } + if (permanent == null) { + return false; + } AttackedThisTurnWatcher watcher = game.getState().getWatcher(AttackedThisTurnWatcher.class); - if (watcher == null) { return false; } + if (watcher == null) { + return false; + } return watcher.getAttackedThisTurnCreatures().contains(new MageObjectReference(permanent, game)) && permanent.destroy(source, game, false); diff --git a/Mage.Sets/src/mage/cards/b/BiomanticMastery.java b/Mage.Sets/src/mage/cards/b/BiomanticMastery.java index 882fd7e8d7e..1b53e893da6 100644 --- a/Mage.Sets/src/mage/cards/b/BiomanticMastery.java +++ b/Mage.Sets/src/mage/cards/b/BiomanticMastery.java @@ -57,7 +57,9 @@ class BiomanticMasteryEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } for (UUID playerId : getTargetPointer().getTargets(game, source)) { Player player = game.getPlayer(playerId); diff --git a/Mage.Sets/src/mage/cards/b/BitterFeud.java b/Mage.Sets/src/mage/cards/b/BitterFeud.java index f6d768010f0..6474c0ef091 100644 --- a/Mage.Sets/src/mage/cards/b/BitterFeud.java +++ b/Mage.Sets/src/mage/cards/b/BitterFeud.java @@ -63,20 +63,30 @@ class BitterFeudEntersBattlefieldEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } Permanent permanent = game.getPermanentEntering(source.getSourceId()); - if (permanent == null) { return false; } + if (permanent == null) { + return false; + } TargetPlayer target = new TargetPlayer(2, 2, true); controller.chooseTarget(outcome, target, source, game); Player player1 = game.getPlayer(target.getFirstTarget()); - if (player1 == null) { return false; } + if (player1 == null) { + return false; + } - if (target.getTargets().size() <= 1) { return false; } + if (target.getTargets().size() <= 1) { + return false; + } Player player2 = game.getPlayer(target.getTargets().get(1)); - if (player2 == null) { return false; } + if (player2 == null) { + return false; + } game.getState().setValue(source.getSourceId() + "_player1", player1); game.getState().setValue(source.getSourceId() + "_player2", player2); @@ -122,10 +132,14 @@ class BitterFeudEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { player1 = (Player) game.getState().getValue(source.getSourceId() + "_player1"); - if (player1 == null) { return false; } + if (player1 == null) { + return false; + } player2 = (Player) game.getState().getValue(source.getSourceId() + "_player2"); - if (player2 == null) { return false; } + if (player2 == null) { + return false; + } UUID targetPlayerId; switch (event.getType()) { @@ -134,7 +148,9 @@ class BitterFeudEffect extends ReplacementEffectImpl { break; case DAMAGE_PERMANENT: Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent == null) { return false; } + if (permanent == null) { + return false; + } targetPlayerId = permanent.getControllerId(); break; @@ -142,7 +158,9 @@ class BitterFeudEffect extends ReplacementEffectImpl { return false; } - if (!player1.getId().equals(targetPlayerId) && !player2.getId().equals(targetPlayerId)) { return false; } + if (!player1.getId().equals(targetPlayerId) && !player2.getId().equals(targetPlayerId)) { + return false; + } UUID sourcePlayerId; MageObject damageSource = game.getObject(event.getSourceId()); diff --git a/Mage.Sets/src/mage/cards/b/BlinkmothInfusion.java b/Mage.Sets/src/mage/cards/b/BlinkmothInfusion.java index 90291071c08..22dc499105b 100644 --- a/Mage.Sets/src/mage/cards/b/BlinkmothInfusion.java +++ b/Mage.Sets/src/mage/cards/b/BlinkmothInfusion.java @@ -54,7 +54,9 @@ class UntapAllArtifactsEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - if (player == null) { return false; } + if (player == null) { + return false; + } for (Permanent artifact: game.getBattlefield().getAllActivePermanents(new FilterArtifactPermanent(), game)) { artifact.untap(game); diff --git a/Mage.Sets/src/mage/cards/b/BloodBaronOfVizkopa.java b/Mage.Sets/src/mage/cards/b/BloodBaronOfVizkopa.java index 0137ca84c6b..800dce00207 100644 --- a/Mage.Sets/src/mage/cards/b/BloodBaronOfVizkopa.java +++ b/Mage.Sets/src/mage/cards/b/BloodBaronOfVizkopa.java @@ -63,10 +63,14 @@ class BloodBaronOfVizkopaEffect extends ContinuousEffectImpl { @Override public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - if (!conditionState(source, game)) { return false; } + if (!conditionState(source, game)) { + return false; + } Permanent creature = game.getPermanent(source.getSourceId()); - if (creature == null) { return false; } + if (creature == null) { + return false; + } switch (layer) { case PTChangingEffects_7: @@ -89,15 +93,23 @@ class BloodBaronOfVizkopaEffect extends ContinuousEffectImpl { private boolean conditionState(Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } - if (controller.getLife() < 30) { return false; } + if (controller.getLife() < 30) { + return false; + } for (UUID opponentId : game.getState().getPlayersInRange(controller.getId(), game)) { - if (!controller.hasOpponent(opponentId, game)) { return false; } + if (!controller.hasOpponent(opponentId, game)) { + return false; + } Player opponent = game.getPlayer(opponentId); - if (opponent == null) { return false; } + if (opponent == null) { + return false; + } return opponent.getLife() < 11; } diff --git a/Mage.Sets/src/mage/cards/b/BloodlineShaman.java b/Mage.Sets/src/mage/cards/b/BloodlineShaman.java index b2d2b8d41f4..afca519fbc8 100644 --- a/Mage.Sets/src/mage/cards/b/BloodlineShaman.java +++ b/Mage.Sets/src/mage/cards/b/BloodlineShaman.java @@ -67,13 +67,19 @@ class BloodlineShamanEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } MageObject sourceObject = game.getObject(source.getSourceId()); - if (sourceObject == null) { return false; } + if (sourceObject == null) { + return false; + } Choice typeChoice = new ChoiceCreatureType(sourceObject); - if (!controller.choose(outcome, typeChoice, game)) { return false; } + if (!controller.choose(outcome, typeChoice, game)) { + return false; + } game.informPlayers(sourceObject.getLogName() + " chosen type: " + typeChoice.getChoice()); FilterCard filterSubtype = new FilterCard(); diff --git a/Mage.Sets/src/mage/cards/b/BoneyardScourge.java b/Mage.Sets/src/mage/cards/b/BoneyardScourge.java index 482c8f968f1..a7386bf56af 100644 --- a/Mage.Sets/src/mage/cards/b/BoneyardScourge.java +++ b/Mage.Sets/src/mage/cards/b/BoneyardScourge.java @@ -90,7 +90,9 @@ class DiesWhileInGraveyardTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (!zEvent.isDiesEvent()) { return false; } + if (!zEvent.isDiesEvent()) { + return false; + } for (Zone z : Zone.values()) { if (game.getShortLivingLKI(sourceId, z) && z != Zone.GRAVEYARD) { diff --git a/Mage.Sets/src/mage/cards/b/BoonweaverGiant.java b/Mage.Sets/src/mage/cards/b/BoonweaverGiant.java index 2edfe6f90b4..0e42b40b395 100644 --- a/Mage.Sets/src/mage/cards/b/BoonweaverGiant.java +++ b/Mage.Sets/src/mage/cards/b/BoonweaverGiant.java @@ -71,7 +71,9 @@ class BoonweaverGiantEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } Permanent sourcePermanent = source.getSourcePermanentIfItStillExists(game); UUID sourcePermanentId = sourcePermanent == null ? null : sourcePermanent.getId(); diff --git a/Mage.Sets/src/mage/cards/b/BosiumStrip.java b/Mage.Sets/src/mage/cards/b/BosiumStrip.java index 37323949c4b..1994017d7cc 100644 --- a/Mage.Sets/src/mage/cards/b/BosiumStrip.java +++ b/Mage.Sets/src/mage/cards/b/BosiumStrip.java @@ -109,10 +109,14 @@ class BosiumStripReplacementEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } Card card = (Card) game.getState().getValue("BosiumStrip"); - if (card == null) { return false; } + if (card == null) { + return false; + } ((ZoneChangeEvent) event).setToZone(Zone.EXILED); return true; @@ -126,12 +130,18 @@ class BosiumStripReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.getToZone() != Zone.GRAVEYARD) { return false; } + if (zEvent.getToZone() != Zone.GRAVEYARD) { + return false; + } Card card = game.getCard(event.getSourceId()); - if (card == null) { return false; } + if (card == null) { + return false; + } - if (!StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY.match(card, game)) { return false; } + if (!StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY.match(card, game)) { + return false; + } CastFromGraveyardWatcher watcher = game.getState().getWatcher(CastFromGraveyardWatcher.class); return watcher != null diff --git a/Mage.Sets/src/mage/cards/b/BountyOfTheLuxa.java b/Mage.Sets/src/mage/cards/b/BountyOfTheLuxa.java index 0981b8ebe27..3e62a36fd02 100644 --- a/Mage.Sets/src/mage/cards/b/BountyOfTheLuxa.java +++ b/Mage.Sets/src/mage/cards/b/BountyOfTheLuxa.java @@ -68,7 +68,9 @@ class BountyOfTheLuxaEffect extends OneShotEffect { if (bountyOfLuxa != null && bountyOfLuxa.getZoneChangeCounter(game) != source.getSourceObjectZoneChangeCounter()) { bountyOfLuxa = null; } - if (controller == null) { return false; } + if (controller == null) { + return false; + } if (bountyOfLuxa != null && bountyOfLuxa.getCounters(game).getCount(CounterType.FLOOD) > 0) { diff --git a/Mage.Sets/src/mage/cards/b/BraceForImpact.java b/Mage.Sets/src/mage/cards/b/BraceForImpact.java index 1f7727374aa..c2e8024d2ac 100644 --- a/Mage.Sets/src/mage/cards/b/BraceForImpact.java +++ b/Mage.Sets/src/mage/cards/b/BraceForImpact.java @@ -72,7 +72,9 @@ class BraceForImpactPreventDamageTargetEffect extends PreventionEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { GameEvent preventEvent = new PreventDamageEvent(event.getTargetId(), source.getSourceId(), source, source.getControllerId(), event.getAmount(), ((DamageEvent) event).isCombatDamage()); - if (game.replaceEvent(preventEvent)) { return false; } + if (game.replaceEvent(preventEvent)) { + return false; + } int prevented; int damage = event.getAmount(); event.setAmount(0); diff --git a/Mage.Sets/src/mage/cards/b/BridgeFromBelow.java b/Mage.Sets/src/mage/cards/b/BridgeFromBelow.java index feda01b40de..dedb23d9374 100644 --- a/Mage.Sets/src/mage/cards/b/BridgeFromBelow.java +++ b/Mage.Sets/src/mage/cards/b/BridgeFromBelow.java @@ -83,10 +83,14 @@ class BridgeFromBelowAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (!zEvent.isDiesEvent()) { return false; } + if (!zEvent.isDiesEvent()) { + return false; + } Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (permanent == null) { return false; } + if (permanent == null) { + return false; + } return filter.match(permanent, controllerId, this, game); } diff --git a/Mage.Sets/src/mage/cards/b/Brightflame.java b/Mage.Sets/src/mage/cards/b/Brightflame.java index c9e29c28290..4dfbe521dcf 100644 --- a/Mage.Sets/src/mage/cards/b/Brightflame.java +++ b/Mage.Sets/src/mage/cards/b/Brightflame.java @@ -67,7 +67,9 @@ class BrightflameEffect extends OneShotEffect { int damageDealt = 0; Permanent target = game.getPermanent(targetPointer.getFirst(game, source)); - if (target == null) { return false; } + if (target == null) { + return false; + } ObjectColor color = target.getColor(game); damageDealt += target.damage(amount.calculate(game, source, this), source.getSourceId(), source, game); diff --git a/Mage.Sets/src/mage/cards/b/BrimazKingOfOreskos.java b/Mage.Sets/src/mage/cards/b/BrimazKingOfOreskos.java index 63a18263cf3..2e9bc76f106 100644 --- a/Mage.Sets/src/mage/cards/b/BrimazKingOfOreskos.java +++ b/Mage.Sets/src/mage/cards/b/BrimazKingOfOreskos.java @@ -75,7 +75,9 @@ class BrimazKingOfOreskosEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } Token token = new CatSoldierCreatureToken(); token.putOntoBattlefield(1, game, source, source.getControllerId()); diff --git a/Mage.Sets/src/mage/cards/b/BrunaLightOfAlabaster.java b/Mage.Sets/src/mage/cards/b/BrunaLightOfAlabaster.java index 0989a34e3bd..75b8a624ed1 100644 --- a/Mage.Sets/src/mage/cards/b/BrunaLightOfAlabaster.java +++ b/Mage.Sets/src/mage/cards/b/BrunaLightOfAlabaster.java @@ -76,7 +76,9 @@ class BrunaLightOfAlabasterEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } UUID bruna = source.getSourceId(); @@ -91,7 +93,9 @@ class BrunaLightOfAlabasterEffect extends OneShotEffect { filterAuraCard.add(new AuraCardCanAttachToPermanentId(bruna)); Permanent sourcePermanent = game.getPermanent(source.getSourceId()); - if (sourcePermanent == null) { return false; } + if (sourcePermanent == null) { + return false; + } List fromBattlefield = new ArrayList<>(); List fromHandGraveyard = new ArrayList<>(); diff --git a/Mage.Sets/src/mage/cards/b/BudokaGardener.java b/Mage.Sets/src/mage/cards/b/BudokaGardener.java index 58880e0e258..f16b53069e7 100644 --- a/Mage.Sets/src/mage/cards/b/BudokaGardener.java +++ b/Mage.Sets/src/mage/cards/b/BudokaGardener.java @@ -72,7 +72,9 @@ class BudokaGardenerEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } if (game.getBattlefield().count(filterLands, source.getControllerId(), source, game) < 10) { return false; } diff --git a/Mage.Sets/src/mage/cards/b/BurnFromWithin.java b/Mage.Sets/src/mage/cards/b/BurnFromWithin.java index fdb36a0c625..12e3befcda8 100644 --- a/Mage.Sets/src/mage/cards/b/BurnFromWithin.java +++ b/Mage.Sets/src/mage/cards/b/BurnFromWithin.java @@ -65,7 +65,9 @@ class BurnFromWithinEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } int amount = source.getManaCostsToPay().getX(); diff --git a/Mage.Sets/src/mage/cards/c/CorneredMarket.java b/Mage.Sets/src/mage/cards/c/CorneredMarket.java index e7d600cbcc4..0306a8d7b17 100644 --- a/Mage.Sets/src/mage/cards/c/CorneredMarket.java +++ b/Mage.Sets/src/mage/cards/c/CorneredMarket.java @@ -73,7 +73,9 @@ class CorneredMarketReplacementEffect extends ContinuousRuleModifyingEffectImpl @Override public boolean applies(GameEvent event, Ability source, Game game) { SpellAbility spellAbility = SpellAbility.getSpellAbilityFromEvent(event, game); - if (spellAbility == null) { return false;} + if (spellAbility == null) { + return false; + } Card card = spellAbility.getCharacteristics(game); if (card != null) { Spell spell = game.getState().getStack().getSpell(event.getSourceId()); diff --git a/Mage.Sets/src/mage/cards/c/CryOfTheCarnarium.java b/Mage.Sets/src/mage/cards/c/CryOfTheCarnarium.java index 0079b741b7d..340ef2ed3b5 100644 --- a/Mage.Sets/src/mage/cards/c/CryOfTheCarnarium.java +++ b/Mage.Sets/src/mage/cards/c/CryOfTheCarnarium.java @@ -66,7 +66,9 @@ class CryOfTheCarnariumExileEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); CardsPutIntoGraveyardWatcher watcher = game.getState().getWatcher(CardsPutIntoGraveyardWatcher.class); - if (controller == null || watcher == null) { return false; } + if (controller == null || watcher == null) { + return false; + } Cards cards = new CardsImpl(watcher.getCardsPutIntoGraveyardFromBattlefield(game)); cards.removeIf(uuid -> !game.getCard(uuid).isCreature(game)); diff --git a/Mage.Sets/src/mage/cards/e/ExclusionRitual.java b/Mage.Sets/src/mage/cards/e/ExclusionRitual.java index 80ae97f97f2..15a64c24267 100644 --- a/Mage.Sets/src/mage/cards/e/ExclusionRitual.java +++ b/Mage.Sets/src/mage/cards/e/ExclusionRitual.java @@ -102,9 +102,13 @@ class ExclusionRitualReplacementEffect extends ContinuousRuleModifyingEffectImpl public boolean applies(GameEvent event, Ability source, Game game) { Permanent sourcePermanent = game.getPermanent(source.getSourceId()); SpellAbility spellAbility = SpellAbility.getSpellAbilityFromEvent(event, game); - if (spellAbility == null) { return false;} + if (spellAbility == null) { + return false; + } Card card = spellAbility.getCharacteristics(game); - if (card == null) { return false;} + if (card == null) { + return false; + } if (sourcePermanent != null && !sourcePermanent.getImprinted().isEmpty()) { Card imprintedCard = game.getCard(sourcePermanent.getImprinted().get(0)); if (imprintedCard != null) { diff --git a/Mage.Sets/src/mage/cards/g/GideonsIntervention.java b/Mage.Sets/src/mage/cards/g/GideonsIntervention.java index 234d34e835c..8095ffcdc83 100644 --- a/Mage.Sets/src/mage/cards/g/GideonsIntervention.java +++ b/Mage.Sets/src/mage/cards/g/GideonsIntervention.java @@ -93,7 +93,9 @@ class GideonsInterventionCantCastEffect extends ContinuousRuleModifyingEffectImp String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { SpellAbility spellAbility = SpellAbility.getSpellAbilityFromEvent(event, game); - if (spellAbility == null) { return false;} + if (spellAbility == null) { + return false; + } Card card = spellAbility.getCharacteristics(game); return card != null && CardUtil.haveSameNames(card, cardName, game); } diff --git a/Mage.Sets/src/mage/cards/i/IxalansBinding.java b/Mage.Sets/src/mage/cards/i/IxalansBinding.java index c5bad08a050..3fb7615eb17 100644 --- a/Mage.Sets/src/mage/cards/i/IxalansBinding.java +++ b/Mage.Sets/src/mage/cards/i/IxalansBinding.java @@ -73,7 +73,9 @@ class IxalansBindingReplacementEffect extends ContinuousRuleModifyingEffectImpl return false; } SpellAbility spellAbility = SpellAbility.getSpellAbilityFromEvent(event, game); - if (spellAbility == null) { return false;} + if (spellAbility == null) { + return false; + } Card card = spellAbility.getCharacteristics(game); if (sourcePermanent != null && card != null) { UUID exileZone = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()); diff --git a/Mage.Sets/src/mage/cards/k/KjeldoranEliteGuard.java b/Mage.Sets/src/mage/cards/k/KjeldoranEliteGuard.java index 3cb23d87240..4620d62c95f 100644 --- a/Mage.Sets/src/mage/cards/k/KjeldoranEliteGuard.java +++ b/Mage.Sets/src/mage/cards/k/KjeldoranEliteGuard.java @@ -63,7 +63,9 @@ class KjeldoranEliteGuardEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - if (game.getPermanent(source.getFirstTarget()) == null) { return false; } + if (game.getPermanent(source.getFirstTarget()) == null) { + return false; + } // Target creature gets +2/+2 until end of turn. BoostTargetEffect buffEffect = new BoostTargetEffect(2, 2, Duration.EndOfTurn); diff --git a/Mage.Sets/src/mage/cards/k/KnowledgePool.java b/Mage.Sets/src/mage/cards/k/KnowledgePool.java index e2977299e4c..fd9fa6ce7cd 100644 --- a/Mage.Sets/src/mage/cards/k/KnowledgePool.java +++ b/Mage.Sets/src/mage/cards/k/KnowledgePool.java @@ -68,10 +68,14 @@ class KnowledgePoolExileThreeCardsEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } MageObject sourceObject = game.getObject(source.getSourceId()); - if (sourceObject == null) { return false; } + if (sourceObject == null) { + return false; + } for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); @@ -117,10 +121,14 @@ class KnowledgePoolWhenCastFromHandAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getZone() != Zone.HAND) { return false; } + if (event.getZone() != Zone.HAND) { + return false; + } Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell == null) { return false; } + if (spell == null) { + return false; + } for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); @@ -143,13 +151,19 @@ class KnowledgePoolExileAndPlayEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source)); - if (spell == null) { return false; } + if (spell == null) { + return false; + } Permanent sourceObject = game.getPermanentOrLKIBattlefield(source.getSourceId()); - if (sourceObject == null ) { return false; } + if (sourceObject == null ) { + return false; + } Player spellController = game.getPlayer(spell.getControllerId()); - if (spellController == null) { return false; } + if (spellController == null) { + return false; + } UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), sourceObject.getZoneChangeCounter(game)); diff --git a/Mage.Sets/src/mage/cards/m/ManaMaze.java b/Mage.Sets/src/mage/cards/m/ManaMaze.java index 923cffae7d5..f98310f1e09 100644 --- a/Mage.Sets/src/mage/cards/m/ManaMaze.java +++ b/Mage.Sets/src/mage/cards/m/ManaMaze.java @@ -59,7 +59,9 @@ class ManaMazeEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { SpellAbility spellAbility = SpellAbility.getSpellAbilityFromEvent(event, game); - if (spellAbility == null) { return false;} + if (spellAbility == null) { + return false; + } Card card = spellAbility.getCharacteristics(game); if (card != null) { LastSpellCastWatcher watcher = game.getState().getWatcher(LastSpellCastWatcher.class); diff --git a/Mage.Sets/src/mage/cards/m/MeddlingMage.java b/Mage.Sets/src/mage/cards/m/MeddlingMage.java index b7d6af8141a..02e66b49421 100644 --- a/Mage.Sets/src/mage/cards/m/MeddlingMage.java +++ b/Mage.Sets/src/mage/cards/m/MeddlingMage.java @@ -86,9 +86,13 @@ class MeddlingMageReplacementEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { SpellAbility spellAbility = SpellAbility.getSpellAbilityFromEvent(event, game); - if (spellAbility == null) { return false;} + if (spellAbility == null) { + return false; + } Card card = spellAbility.getCharacteristics(game); - if (card == null) { return false;} + if (card == null) { + return false; + } String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); return CardUtil.haveSameNames(card, cardName, game); } diff --git a/Mage.Sets/src/mage/cards/m/MiragePhalanx.java b/Mage.Sets/src/mage/cards/m/MiragePhalanx.java index d8f889bd9e1..d56ec8d7cbb 100644 --- a/Mage.Sets/src/mage/cards/m/MiragePhalanx.java +++ b/Mage.Sets/src/mage/cards/m/MiragePhalanx.java @@ -70,7 +70,9 @@ class MiragePhalanxEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Permanent permanent = source.getSourcePermanentOrLKI(game); - if (permanent == null) { return false; } + if (permanent == null) { + return false; + } // It has haste CreateTokenCopyTargetEffect tokenCopyEffect = new CreateTokenCopyTargetEffect(source.getControllerId(), null, true); diff --git a/Mage.Sets/src/mage/cards/m/MyojinOfGrimBetrayal.java b/Mage.Sets/src/mage/cards/m/MyojinOfGrimBetrayal.java index 8c57b1d4424..b250f75505e 100644 --- a/Mage.Sets/src/mage/cards/m/MyojinOfGrimBetrayal.java +++ b/Mage.Sets/src/mage/cards/m/MyojinOfGrimBetrayal.java @@ -88,7 +88,9 @@ class MyojinOfGrimBetrayalEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); CardsPutIntoGraveyardWatcher watcher = game.getState().getWatcher(CardsPutIntoGraveyardWatcher.class); - if (controller == null || watcher == null) { return false; } + if (controller == null || watcher == null) { + return false; + } Cards cards = new CardsImpl(watcher.getCardsPutIntoGraveyardFromBattlefield(game)); cards.removeIf(uuid -> !game.getCard(uuid).isCreature(game)); diff --git a/Mage.Sets/src/mage/cards/p/PossibilityStorm.java b/Mage.Sets/src/mage/cards/p/PossibilityStorm.java index 2fbe2f50e5d..9aae7f00496 100644 --- a/Mage.Sets/src/mage/cards/p/PossibilityStorm.java +++ b/Mage.Sets/src/mage/cards/p/PossibilityStorm.java @@ -71,10 +71,14 @@ class PossibilityStormTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getZone() != Zone.HAND) { return false; } + if (event.getZone() != Zone.HAND) { + return false; + } Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell == null) { return false; } + if (spell == null) { + return false; + } for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); @@ -102,13 +106,19 @@ class PossibilityStormEffect extends OneShotEffect { spell = ((Spell) game.getLastKnownInformation(targetPointer.getFirst(game, source), Zone.STACK)); noLongerOnStack = true; } - if (spell == null) { return false; } + if (spell == null) { + return false; + } Player spellController = game.getPlayer(spell.getControllerId()); - if (spellController == null) { return false; } + if (spellController == null) { + return false; + } MageObject sourceObject = source.getSourceObject(game); - if (sourceObject == null) { return false; } + if (sourceObject == null) { + return false; + } if (!noLongerOnStack) { spellController.moveCardsToExile(spell, source, game, true, source.getSourceId(), sourceObject.getIdName()); diff --git a/Mage.Sets/src/mage/cards/p/PredatorsHour.java b/Mage.Sets/src/mage/cards/p/PredatorsHour.java index af1878ddabb..9fd17a67bd4 100644 --- a/Mage.Sets/src/mage/cards/p/PredatorsHour.java +++ b/Mage.Sets/src/mage/cards/p/PredatorsHour.java @@ -84,16 +84,24 @@ class PredatorsHourEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } Player opponent = game.getPlayer(targetPointer.getFirst(game, source)); - if (opponent == null) { return false; } + if (opponent == null) { + return false; + } MageObject sourceObject = source.getSourceObject(game); - if (sourceObject == null) { return false; } + if (sourceObject == null) { + return false; + } Card topCard = opponent.getLibrary().getFromTop(game); - if (topCard == null) { return false; } + if (topCard == null) { + return false; + } UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()); topCard.setFaceDown(true, game); @@ -154,7 +162,9 @@ class PredatorsHourPlayFromExileEffect extends AsThoughEffectImpl { return false; } Card theCard = game.getCard(objectId); - if (theCard == null ) { return false; } + if (theCard == null ) { + return false; + } // for split cards objectId = theCard.getMainCard().getId(); @@ -185,7 +195,9 @@ class PredatorsHourSpendAnyManaEffect extends AsThoughEffectImpl implements AsTh @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { Card theCard = game.getCard(objectId); - if (theCard == null) { return false; } + if (theCard == null) { + return false; + } // for split cards objectId = theCard.getMainCard().getId(); diff --git a/Mage.Sets/src/mage/cards/r/ReflectorMage.java b/Mage.Sets/src/mage/cards/r/ReflectorMage.java index 1e5074f0be6..ba263f21c68 100644 --- a/Mage.Sets/src/mage/cards/r/ReflectorMage.java +++ b/Mage.Sets/src/mage/cards/r/ReflectorMage.java @@ -114,9 +114,13 @@ class ExclusionRitualReplacementEffect extends ContinuousRuleModifyingEffectImpl @Override public boolean applies(GameEvent event, Ability source, Game game) { SpellAbility spellAbility = SpellAbility.getSpellAbilityFromEvent(event, game); - if (spellAbility == null) { return false;} + if (spellAbility == null) { + return false; + } Card card = spellAbility.getCharacteristics(game); - if (card == null) { return false;} + if (card == null) { + return false; + } return CardUtil.haveSameNames(card, creatureName, game) && Objects.equals(ownerId, card.getOwnerId()); } diff --git a/Mage.Sets/src/mage/cards/s/ShadowgrangeArchfiend.java b/Mage.Sets/src/mage/cards/s/ShadowgrangeArchfiend.java index 74faa038b0c..80e1941932a 100644 --- a/Mage.Sets/src/mage/cards/s/ShadowgrangeArchfiend.java +++ b/Mage.Sets/src/mage/cards/s/ShadowgrangeArchfiend.java @@ -69,7 +69,9 @@ class ShadowgrangeArchfiendEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) {return false; } + if (controller == null) { + return false; + } List toSacrifice = new ArrayList<>(); diff --git a/Mage.Sets/src/mage/cards/s/StrefanMaurerProgenitor.java b/Mage.Sets/src/mage/cards/s/StrefanMaurerProgenitor.java index 4e8a566bfca..9c2c08faf3d 100644 --- a/Mage.Sets/src/mage/cards/s/StrefanMaurerProgenitor.java +++ b/Mage.Sets/src/mage/cards/s/StrefanMaurerProgenitor.java @@ -113,18 +113,26 @@ class StrefanMaurerProgenitorPlayVampireEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - if (player == null) { return false; } + if (player == null) { + return false; + } TargetCard target = new TargetCardInHand(0, 1, vampireCardFilter); - if (!player.choose(outcome, player.getHand(), target, source, game)) { return false; } + if (!player.choose(outcome, player.getHand(), target, source, game)) { + return false; + } Card card = game.getCard(target.getFirstTarget()); - if (card == null) { return false; } + if (card == null) { + return false; + } player.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, true, null); Permanent permanent = game.getPermanent(card.getId()); - if (permanent == null) { return false; } + if (permanent == null) { + return false; + } game.getCombat().addAttackingCreature(permanent.getId(), game); diff --git a/Mage.Sets/src/mage/cards/t/ThievesAuction.java b/Mage.Sets/src/mage/cards/t/ThievesAuction.java index 2019f0c22e0..4e4ec0794c6 100644 --- a/Mage.Sets/src/mage/cards/t/ThievesAuction.java +++ b/Mage.Sets/src/mage/cards/t/ThievesAuction.java @@ -68,7 +68,9 @@ class ThievesAuctionEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } // Exile all nontoken permanents. Cards exiledCards = new CardsImpl(); diff --git a/Mage.Sets/src/mage/cards/t/ThrillingEncore.java b/Mage.Sets/src/mage/cards/t/ThrillingEncore.java index 81e837ea137..e03513c498c 100644 --- a/Mage.Sets/src/mage/cards/t/ThrillingEncore.java +++ b/Mage.Sets/src/mage/cards/t/ThrillingEncore.java @@ -68,7 +68,9 @@ class ThrillingEncoreEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); CardsPutIntoGraveyardWatcher watcher = game.getState().getWatcher(CardsPutIntoGraveyardWatcher.class); - if (controller == null || watcher == null) { return false; } + if (controller == null || watcher == null) { + return false; + } Cards cards = new CardsImpl(watcher.getCardsPutIntoGraveyardFromBattlefield(game)); cards.removeIf(uuid -> !game.getCard(uuid).isCreature(game)); diff --git a/Mage.Sets/src/mage/cards/t/TimotharBaronOfBats.java b/Mage.Sets/src/mage/cards/t/TimotharBaronOfBats.java index 84e255aa46a..c981650054d 100644 --- a/Mage.Sets/src/mage/cards/t/TimotharBaronOfBats.java +++ b/Mage.Sets/src/mage/cards/t/TimotharBaronOfBats.java @@ -84,11 +84,15 @@ class TimotharBaronOfBatsCreateBatEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } // Check vampire card still exists and is still in the graveyard Card vampireCard = game.getCard(targetPointer.getFirst(game, source)); - if (vampireCard == null) { return false; } + if (vampireCard == null) { + return false; + } // Create costs ManaCosts costs = new ManaCostsImpl<>("{1}"); @@ -99,9 +103,15 @@ class TimotharBaronOfBatsCreateBatEffect extends OneShotEffect { "sacrifice it and return the exiled card to the battlefield tapped\"."; // Ask player if they wanna pay cost - if (!costs.canPay(source, source, controller.getId(), game)) { return false; } - if (!controller.chooseUse(Outcome.Benefit, costPromptMessage, source, game)) { return false; } - if (!costs.pay(source, game, source, controller.getId(),false)) { return false; } + if (!costs.canPay(source, source, controller.getId(), game)) { + return false; + } + if (!controller.chooseUse(Outcome.Benefit, costPromptMessage, source, game)) { + return false; + } + if (!costs.pay(source, game, source, controller.getId(),false)) { + return false; + } // Exile the card as part of the cost. // Handled this way so that the player doesn't have to dig through their graveyard for the card. controller.moveCards(vampireCard, Zone.EXILED, source, game); @@ -144,10 +154,14 @@ class TimotharBaronOfBatsReturnEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - if (player == null) { return false; } + if (player == null) { + return false; + } Card card = morOfCardToReturn.getCard(game); - if (card == null) { return false; } + if (card == null) { + return false; + } return player.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, true, null); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/OpponentsCantCastChosenUntilNextTurnEffect.java b/Mage/src/main/java/mage/abilities/effects/common/OpponentsCantCastChosenUntilNextTurnEffect.java index 304fbd5c24f..bc0d906f593 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/OpponentsCantCastChosenUntilNextTurnEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/OpponentsCantCastChosenUntilNextTurnEffect.java @@ -47,11 +47,17 @@ public class OpponentsCantCastChosenUntilNextTurnEffect extends ContinuousRuleMo @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (!game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { return false; } + if (!game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { + return false; + } SpellAbility spellAbility = SpellAbility.getSpellAbilityFromEvent(event, game); - if (spellAbility == null) { return false; } + if (spellAbility == null) { + return false; + } Card card = spellAbility.getCharacteristics(game); - if (card == null) { return false; } + if (card == null) { + return false; + } String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); return CardUtil.haveSameNames(card, cardName, game); }