From 3ef3469016d7cda0cf4893066259502dcad1bb46 Mon Sep 17 00:00:00 2001 From: Sloth Date: Mon, 25 Jun 2012 19:46:34 +0000 Subject: [PATCH] - Fixed Martyr of Sands. --- res/cardsfolder/m/martyr_of_sands.txt | 2 +- src/main/java/forge/card/cost/CostReveal.java | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/res/cardsfolder/m/martyr_of_sands.txt b/res/cardsfolder/m/martyr_of_sands.txt index f8865001167..cb73c250df1 100644 --- a/res/cardsfolder/m/martyr_of_sands.txt +++ b/res/cardsfolder/m/martyr_of_sands.txt @@ -5,7 +5,7 @@ Text:no text PT:1/1 A:AB$ GainLife | Cost$ 1 Reveal Sac<1/CARDNAME> | CostDesc$ 1, Reveal X white cards from your hand, Sacrifice Martyr of Sands: | LifeAmount$ Y | References$ X,Y | SpellDescription$ You gain three times X life. SVar:X:XChoice -SVar:Y:Number$3/Times.ChosenX +SVar:Y:SVar$ChosenX/Times.3 SVar:RemAIDeck:True SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/martyr_of_sands.jpg diff --git a/src/main/java/forge/card/cost/CostReveal.java b/src/main/java/forge/card/cost/CostReveal.java index 4172710e72c..d4f13ee63b0 100644 --- a/src/main/java/forge/card/cost/CostReveal.java +++ b/src/main/java/forge/card/cost/CostReveal.java @@ -144,22 +144,25 @@ public class CostReveal extends CostPartWithList { this.addToList(source); payment.setPaidManaPart(this, true); } else { - Integer c = this.convertAmount(); + Integer num = this.convertAmount(); CardList handList = activator.getCardsIn(ZoneType.Hand); handList = handList.getValidCards(this.getType().split(";"), activator, ability.getSourceCard()); - if (c == null) { + if (num == null) { final String sVar = ability.getSVar(amount); if (sVar.equals("XChoice")) { - c = CostUtil.chooseXValue(source, ability, handList.size()); + num = CostUtil.chooseXValue(source, ability, handList.size()); } else { - c = AbilityFactory.calculateAmount(source, amount, ability); + num = AbilityFactory.calculateAmount(source, amount, ability); } } - - CostUtil.setInput(CostReveal.inputRevealCost(this.getType(), handList, payment, this, ability, c)); - return false; + if (num > 0) { + CostUtil.setInput(CostReveal.inputRevealCost(this.getType(), handList, payment, this, ability, num)); + return false; + } else { + payment.setPaidManaPart(this, true); + } } this.addListToHash(ability, "Revealed"); return true; @@ -240,7 +243,7 @@ public class CostReveal extends CostPartWithList { this.done(); } - if (AllZone.getHumanPlayer().getZone(ZoneType.Hand).size() < nNeeded) { + if (handList.size() + this.nReveal < nNeeded) { this.stop(); } final StringBuilder type = new StringBuilder("");