From 6c924edd7a2f7688c05a5bdf528ee31c34782816 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 23 Mar 2014 19:49:11 +0100 Subject: [PATCH] * Variable loyality payment - Fixed a bug that the -X payment of loyality counters was added insted subtracted. Prevented the possibility to announce x loyality counter payment, if already one planeswalker ability was used this turn. --- .../src/mage/sets/theros/AshiokNightmareWeaver.java | 7 ++++--- .../mage/abilities/costs/common/PayLoyaltyCost.java | 10 +++++----- .../abilities/costs/common/PayVariableLoyaltyCost.java | 9 ++++++++- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Mage.Sets/src/mage/sets/theros/AshiokNightmareWeaver.java b/Mage.Sets/src/mage/sets/theros/AshiokNightmareWeaver.java index 4d66891eea..46984f0458 100644 --- a/Mage.Sets/src/mage/sets/theros/AshiokNightmareWeaver.java +++ b/Mage.Sets/src/mage/sets/theros/AshiokNightmareWeaver.java @@ -120,11 +120,12 @@ class AshiokNightmareWeaverExileEffect extends OneShotEffect { - private int amount; + private final int amount; public PayLoyaltyCost(int amount) { this.amount = amount; this.text = Integer.toString(amount); - if (amount >= 0) this.text = "+" + this.text; + if (amount >= 0) { + this.text = "+" + this.text; + } } public PayLoyaltyCost(PayLoyaltyCost cost) { @@ -58,9 +60,7 @@ public class PayLoyaltyCost extends CostImpl { @Override public boolean canPay(UUID sourceId, UUID controllerId, Game game) { Permanent planeswalker = game.getPermanent(sourceId); - if (planeswalker.getCounters().getCount(CounterType.LOYALTY) + amount >= 0 && !planeswalker.isLoyaltyUsed()) - return true; - return false; + return planeswalker.getCounters().getCount(CounterType.LOYALTY) + amount >= 0 && !planeswalker.isLoyaltyUsed(); } @Override diff --git a/Mage/src/mage/abilities/costs/common/PayVariableLoyaltyCost.java b/Mage/src/mage/abilities/costs/common/PayVariableLoyaltyCost.java index c74f3cc703..ac2ae09072 100644 --- a/Mage/src/mage/abilities/costs/common/PayVariableLoyaltyCost.java +++ b/Mage/src/mage/abilities/costs/common/PayVariableLoyaltyCost.java @@ -28,6 +28,7 @@ package mage.abilities.costs.common; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.costs.Cost; import mage.abilities.costs.VariableCostImpl; @@ -55,9 +56,15 @@ public class PayVariableLoyaltyCost extends VariableCostImpl