diff --git a/res/cards.txt b/res/cards.txt index 15558dc1d17..bf85fe5bc14 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -2172,11 +2172,13 @@ Magus of the Coffers Creature Human Wizard no text 4/4 +2,tap: add B to your mana pool for each Swamp you control. Cabal Coffers no cost Land no text +2,tap: add B to your mana pool for each Swamp you control. Xiahou Dun, the One-Eyed 2 B B @@ -5821,6 +5823,7 @@ Elvish Archdruid Creature Elf Druid Other Elf creatures you control get +1/+1. 2/2 +tap: add G to your mana pool for each Elf you control. Warren-Scourge Elf 1 G @@ -6488,21 +6491,25 @@ Priest of Titania Creature Elf Druid no text 1/1 +tap: add G to your mana pool for each Elf on the battlefield. Serra's Sanctum no cost Legendary Land no text +tap: add W to your mana pool for each Enchantment you control. Tolarian Academy no cost Legendary Land no text +tap: add U to your mana pool for each Artifact you control. Gaea's Cradle no cost Legendary Land no text +tap: add G to your mana pool for each Creature you control. Sol Ring 1 diff --git a/res/main.properties b/res/main.properties index b6e195cc400..bdb14fc558e 100644 --- a/res/main.properties +++ b/res/main.properties @@ -1,6 +1,6 @@ program/mail=mtgerror@yahoo.com program/forum=http://www.slightlymagic.net/forum/viewforum.php?f=26 -program/version=Forge -- official beta: 10/01/17, SVN revision: 302 +program/version=Forge -- official beta: 10/01/17, SVN revision: 304 tokens--file=AllTokens.txt diff --git a/src/forge/Ability_Mana.java b/src/forge/Ability_Mana.java index 3e31cc3230d..66e7e5bf7f0 100644 --- a/src/forge/Ability_Mana.java +++ b/src/forge/Ability_Mana.java @@ -6,6 +6,7 @@ abstract public class Ability_Mana extends SpellAbility implements java.io.Seria private ArrayList runcommands = new ArrayList(); public String orig; private String Mana; + private Card sourceCard; public boolean isBasic() { @@ -42,8 +43,23 @@ abstract public class Ability_Mana extends SpellAbility implements java.io.Seria } */ + this.sourceCard = sourceCard; this.orig=orig; setDescription(orig); + + /* + String parts[] = orig.split(":"); + System.out.println("0:" +parts[0]); + System.out.println("1:" +parts[1]); + StringBuilder sb = new StringBuilder(); + + sb.append(parts[0]); + sb.append(parts[1]); + sb.append(" to your mana pool for each "); + + setDescription(sb.toString()); + */ + if(isBasic())//lowers memory usage drastically { Mana = "" + orig.charAt(9); @@ -76,9 +92,6 @@ abstract public class Ability_Mana extends SpellAbility implements java.io.Seria if(pain.contains(sourceCard.getName()) && !Mana.equals("1")) runcommands.add(new Command() { - /** - * - */ private static final long serialVersionUID = -5904507275105961979L; public void execute(){ @@ -155,7 +168,43 @@ abstract public class Ability_Mana extends SpellAbility implements java.io.Seria } public int getX(){return getSourceCard().getX();}//override these when not defined by card, public void setX(int X){getSourceCard().setX(X);}//i.e. "T, remove X charge counters from {name}: add X+1 mana to your mana pool" - public String Mana(){return Mana;}//override for all non-X variable mana, + public String Mana(){ + if(!orig.contains("for each")) + return Mana; + else + { + String[] manaPart = orig.split(":"); + String m = manaPart[1]; + m = m.replaceAll(" add ", ""); + //TODO: make this handle "multiple-mana symbol" cases, if they are ever needed + m = m.substring(0, 2); + + String[] parts = orig.split(" for each "); + int index = parts[1].indexOf(' '); + String s1 = parts[1].substring(0, index); + String s2 = parts[1].substring(index); + + if (s2.equals(" on the battlefield.")) + s2 = "TypeOnBattlefield"; + else if (s2.equals(" you control.")) + s2 = "TypeYouCtrl"; + + StringBuilder countSB = new StringBuilder(); + countSB.append("Count$"); + countSB.append(s2); + countSB.append("."); + countSB.append(s1); + + int count = CardFactoryUtil.xCount(sourceCard, countSB.toString()); + + StringBuilder sb = new StringBuilder(); + for (int i=0;i