From b1a51ce7cf21810a1a6edfb3c1adb210df95f09e Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 21 Jan 2017 01:10:37 +0100 Subject: [PATCH] * Lightning Runner - Fixed a bug of the optional untap and add combat phase effect. --- .../src/mage/cards/l/LightningRunner.java | 18 +++++++++++------- .../GetEnergyCountersControllerEffect.java | 8 ++++---- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Mage.Sets/src/mage/cards/l/LightningRunner.java b/Mage.Sets/src/mage/cards/l/LightningRunner.java index 4bb0e1dd23..3c992aee57 100644 --- a/Mage.Sets/src/mage/cards/l/LightningRunner.java +++ b/Mage.Sets/src/mage/cards/l/LightningRunner.java @@ -87,8 +87,8 @@ class LightningRunnerEffect extends OneShotEffect { LightningRunnerEffect() { super(Outcome.Benefit); - staticText = "you get {E}{E}, then you may pay {E}{E}{E}{E}{E}{E}{E}{E}. If you do, " + - "untap all creatures you control and after this phase, there is an additional combat phase"; + staticText = "you get {E}{E}, then you may pay {E}{E}{E}{E}{E}{E}{E}{E}. If you do, " + + "untap all creatures you control and after this phase, there is an additional combat phase"; } LightningRunnerEffect(final LightningRunnerEffect effect) { @@ -100,11 +100,15 @@ class LightningRunnerEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { new GetEnergyCountersControllerEffect(2).apply(game, source); - if (controller.getCounters().getCount(CounterType.ENERGY) > 5) { - Cost cost = new PayEnergyCost(6); - if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) { - new UntapAllControllerEffect(new FilterControlledCreaturePermanent(), "untap all creatures you control").apply(game, source); - new AdditionalCombatPhaseEffect("and after this phase, there is an additional combat phase").apply(game, source); + if (controller.getCounters().getCount(CounterType.ENERGY) > 7) { + Cost cost = new PayEnergyCost(8); + if (controller.chooseUse(outcome, + "Pay {E}{E}{E}{E}{E}{E}{E}{E} to use this? ", + "Untap all creatures you control and after this phase, there is an additional combat phase.", + "Yes", "No", source, game) + && cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) { + new UntapAllControllerEffect(new FilterControlledCreaturePermanent()).apply(game, source); + new AdditionalCombatPhaseEffect().apply(game, source); } } return true; diff --git a/Mage/src/main/java/mage/abilities/effects/common/counter/GetEnergyCountersControllerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/counter/GetEnergyCountersControllerEffect.java index 3cf03ea452..b255546221 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/counter/GetEnergyCountersControllerEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/counter/GetEnergyCountersControllerEffect.java @@ -61,9 +61,9 @@ public class GetEnergyCountersControllerEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - return player.addCounters(CounterType.ENERGY.createInstance(value.calculate(game, source, this)), game); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + return controller.addCounters(CounterType.ENERGY.createInstance(value.calculate(game, source, this)), game); } return false; } @@ -72,7 +72,7 @@ public class GetEnergyCountersControllerEffect extends OneShotEffect { if (!staticText.isEmpty()) { return; } - + StringBuilder sb = new StringBuilder(); sb.append("you get "); int val = 1;