From 8f2c08efd36c6dd9934e19e860e22a3736167615 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 30 Jul 2020 10:29:13 +0200 Subject: [PATCH] * Highcliff Felidar - Fixed a problem that not always all players were handled (fixes #6826). --- .../src/mage/cards/h/HighcliffFelidar.java | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/Mage.Sets/src/mage/cards/h/HighcliffFelidar.java b/Mage.Sets/src/mage/cards/h/HighcliffFelidar.java index 38a85db364..f637e82547 100644 --- a/Mage.Sets/src/mage/cards/h/HighcliffFelidar.java +++ b/Mage.Sets/src/mage/cards/h/HighcliffFelidar.java @@ -60,8 +60,8 @@ class HighcliffFelidarEffect extends OneShotEffect { HighcliffFelidarEffect() { super(Outcome.Benefit); - staticText = "for each opponent, choose a creature with the greatest power " + - "among creatures that player controls. Destroy those creatures."; + staticText = "for each opponent, choose a creature with the greatest power " + + "among creatures that player controls. Destroy those creatures."; } private HighcliffFelidarEffect(final HighcliffFelidarEffect effect) { @@ -75,8 +75,8 @@ class HighcliffFelidarEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player == null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { return false; } Set toDestroy = new HashSet(); @@ -93,18 +93,17 @@ class HighcliffFelidarEffect extends OneShotEffect { .mapToInt(MageInt::getValue) .max() .orElse(Integer.MIN_VALUE); - if (maxPower == Integer.MIN_VALUE) { - return; - } - FilterPermanent filter = new FilterCreaturePermanent( - "creature with the greatest power controlled by " + opponent.getName() - ); - filter.add(new ControllerIdPredicate(opponent.getId())); - filter.add(new PowerPredicate(ComparisonType.EQUAL_TO, maxPower)); - TargetPermanent target = new TargetPermanent(filter); - target.setNotTarget(true); - if (player.choose(outcome, target, source.getSourceId(), game)) { - toDestroy.add(target.getFirstTarget()); + if (maxPower > Integer.MIN_VALUE) { + FilterPermanent filter = new FilterCreaturePermanent( + "creature with the greatest power controlled by " + opponent.getName() + ); + filter.add(new ControllerIdPredicate(opponent.getId())); + filter.add(new PowerPredicate(ComparisonType.EQUAL_TO, maxPower)); + TargetPermanent target = new TargetPermanent(filter); + target.setNotTarget(true); + if (controller.choose(outcome, target, source.getSourceId(), game)) { + toDestroy.add(target.getFirstTarget()); + } } }); toDestroy.stream() @@ -116,7 +115,6 @@ class HighcliffFelidarEffect extends OneShotEffect { } // I realized after writing all this that the ability doesn't target but I like this code too much to erase it - //enum HighcliffFelidarAdjuster implements TargetAdjuster { // instance; //