diff --git a/Mage.Sets/src/mage/cards/o/OathOfMages.java b/Mage.Sets/src/mage/cards/o/OathOfMages.java index 36534dd70e..73ce58c6f3 100644 --- a/Mage.Sets/src/mage/cards/o/OathOfMages.java +++ b/Mage.Sets/src/mage/cards/o/OathOfMages.java @@ -1,4 +1,3 @@ - package mage.cards.o; import mage.MageObject; @@ -29,12 +28,14 @@ public final class OathOfMages extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); // At the beginning of each player's upkeep, that player chooses target player who has more life than they do and is their opponent. The first player may have Oath of Mages deal 1 damage to the second player. - Ability ability = new BeginningOfUpkeepTriggeredAbility(new OathOfMagesEffect(), TargetController.ANY, false); + Ability ability = new BeginningOfUpkeepTriggeredAbility( + new OathOfMagesEffect(), TargetController.ANY, false + ); ability.setTargetAdjuster(OathOfMagesAdjuster.instance); this.addAbility(ability); } - public OathOfMages(final OathOfMages card) { + private OathOfMages(final OathOfMages card) { super(card); } @@ -49,22 +50,24 @@ enum OathOfMagesAdjuster implements TargetAdjuster { private static final FilterPlayer filter = new FilterPlayer(); static { - filter.add(new OathOfMagesPredicate()); + filter.add(OathOfMagesPredicate.instance); } @Override public void adjustTargets(Ability ability, Game game) { Player activePlayer = game.getPlayer(game.getActivePlayerId()); - if (activePlayer != null) { - ability.getTargets().clear(); - TargetPlayer target = new TargetPlayer(1, 1, false, filter); - target.setTargetController(activePlayer.getId()); - ability.getTargets().add(target); + if (activePlayer == null) { + return; } + ability.getTargets().clear(); + TargetPlayer target = new TargetPlayer(1, 1, false, filter); + target.setTargetController(activePlayer.getId()); + ability.getTargets().add(target); } } -class OathOfMagesPredicate implements ObjectSourcePlayerPredicate> { +enum OathOfMagesPredicate implements ObjectSourcePlayerPredicate> { + instance; @Override public boolean apply(ObjectSourcePlayer input, Game game) { @@ -89,12 +92,13 @@ class OathOfMagesPredicate implements ObjectSourcePlayerPredicate