From 8cfed25c29f93aa23b46103f4f79c76ac79e911c Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 15:20:19 +0000 Subject: [PATCH] - Fix for non-AF mana producers properly accounting for their set Amount - Fix for City of Shadows and Everflowing Chalice not using Amount$ X --- res/cardsfolder/city_of_shadows.txt | 2 +- res/cardsfolder/everflowing_chalice.txt | 2 +- src/forge/Ability_Mana.java | 19 ++++++++++++++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/res/cardsfolder/city_of_shadows.txt b/res/cardsfolder/city_of_shadows.txt index 44caeeb7d94..af785decb56 100644 --- a/res/cardsfolder/city_of_shadows.txt +++ b/res/cardsfolder/city_of_shadows.txt @@ -3,7 +3,7 @@ ManaCost:no cost Types:Land Text:X is the number of storage counters on City of Shadows. A:AB$PutCounter | Cost$ Exile<1/Creature> | CounterType$ STORAGE | CounterNum$ 1 | SpellDescription$ Put a storage counter on CARDNAME. -A:AB$Mana|Cost$T|Produced$X|SpellDescription$Add X to your mana pool, where X is the number of storage counters on City of Shadows. +A:AB$Mana|Cost$T|Produced$1|Amount$X|SpellDescription$Add X to your mana pool, where X is the number of storage counters on City of Shadows. SVar:X:Count$CardCounters.STORAGE SVar:RemAIDeck:True SVar:Rarity:Rare diff --git a/res/cardsfolder/everflowing_chalice.txt b/res/cardsfolder/everflowing_chalice.txt index 7d2f64d0137..2e1a57bd879 100644 --- a/res/cardsfolder/everflowing_chalice.txt +++ b/res/cardsfolder/everflowing_chalice.txt @@ -3,7 +3,7 @@ ManaCost:0 Types:Artifact Text:Everflowing Chalice enters the battlefield with a charge counter on it for each time it was kicked. K:Multikicker 2 -A:AB$Mana|Cost$T|Produced$X|SpellDescription$Add 1 to your mana pool for each charge counter on CARDNAME. +A:AB$Mana|Cost$T|Produced$1|Amount$X|SpellDescription$Add 1 to your mana pool for each charge counter on CARDNAME. SVar:X:Count$CardCounters.CHARGE SVar:RemAIDeck:True SVar:Rarity:Uncommon diff --git a/src/forge/Ability_Mana.java b/src/forge/Ability_Mana.java index 3960d042c36..37f79be6648 100644 --- a/src/forge/Ability_Mana.java +++ b/src/forge/Ability_Mana.java @@ -41,7 +41,24 @@ abstract public class Ability_Mana extends Ability_Activated implements java.io. } public void produceMana(){ - produceMana(origProduced); + StringBuilder sb = new StringBuilder(); + if (amount == 0) + sb.append("0"); + else{ + try{ + // if baseMana is an integer(colorless), just multiply amount and baseMana + int base = Integer.parseInt(origProduced); + sb.append(base*amount); + } + catch(NumberFormatException e){ + for(int i = 0; i < amount; i++){ + if (i != 0) + sb.append(" "); + sb.append(origProduced); + } + } + } + produceMana(sb.toString()); } public void produceMana(String produced){