diff --git a/res/cards.txt b/res/cards.txt index 41dbedb1689..648d9dac5c0 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,90 @@ +Black Lotus +0 +Artifact +no text +tap, Sacrifice CARDNAME: Add W W W to your mana pool. +tap, Sacrifice CARDNAME: Add U U U to your mana pool. +tap, Sacrifice CARDNAME: Add B B B to your mana pool. +tap, Sacrifice CARDNAME: Add R R R to your mana pool. +tap, Sacrifice CARDNAME: Add G G G to your mana pool. + +Crystal Vein +no cost +Land +no text +tap: add 1 +tap, Sacrifice Crystal Vein: Add 2 to your mana pool. + +Horn of Ramos +3 +Artifact +no text +tap: add G +Sacrifice CARDNAME: Add G to your mana pool. + +Heart of Ramos +3 +Artifact +no text +tap: add R +Sacrifice CARDNAME: Add R to your mana pool. + +Eye of Ramos +3 +Artifact +no text +tap: add U +Sacrifice CARDNAME: Add U to your mana pool. + +Coal Golem +5 +Artifact Creature Golem +no text +3/3 +3, Sacrifice Coal Golem: Add R R R to your mana pool. + +Dromar's Attendant +5 +Artifact Creature Golem +no text +3/3 +1, Sacrifice Dromar's Attendant: Add W U B to your mana pool. + +Darigaaz's Attendant +5 +Artifact Creature Golem +no text +3/3 +1, Sacrifice Darigaaz's Attendant: Add B R G to your mana pool. + +Crosis's Attendant +5 +Artifact Creature Golem +no text +3/3 +1, Sacrifice Crosis's Attendant: Add U B R to your mana pool. + +Blood Vassal +2 B +Creature Thrull +no text +2/2 +Sacrifice CARDNAME: Add B B to your mana pool. + +Composite Golem +6 +Artifact Creature Golem +no text +4/4 +Sacrifice CARDNAME: Add W U B R G to your mana pool. + +Blood Pet +B +Creature Thrull +no text +1/1 +Sacrifice CARDNAME: Add B to your mana pool. + Entangling Vines 3 G Enchantment Aura @@ -7232,12 +7319,6 @@ Instant no text This card can't be countered. -Composite Golem -6 -Artifact Creature Golem -no text -4/4 - Madrush Cyclops 1 B R G Creature Cyclops Warrior @@ -9375,11 +9456,6 @@ no text spDamageTgtCP:1 Draw a card. -Black Lotus -0 -Artifact -no text - Kitchen Finks 1 GW GW Creature Ouphe diff --git a/src/forge/Ability_Mana.java b/src/forge/Ability_Mana.java index a60fa8dbccb..9e585b13359 100644 --- a/src/forge/Ability_Mana.java +++ b/src/forge/Ability_Mana.java @@ -3,6 +3,8 @@ package forge; import java.util.ArrayList; +import java.util.regex.Matcher; +import java.util.regex.Pattern; abstract public class Ability_Mana extends SpellAbility implements java.io.Serializable { private ArrayList runcommands = new ArrayList(); @@ -15,6 +17,11 @@ abstract public class Ability_Mana extends SpellAbility implements java.io.Seria return (orig.length() == 10 && orig.startsWith("tap: add ") && "1WBURG".contains("" + orig.charAt(9))); } + public boolean isSacrifice() + { + return orig.contains("Sacrifice CARDNAME: Add "); + } + public boolean isUndoableMana() { // isBasic, plus "2" so Sol Ring is counted return (orig.length() == 10 && orig.startsWith("tap: add ") && "21WBURG".contains("" + orig.charAt(9))); @@ -50,7 +57,7 @@ abstract public class Ability_Mana extends SpellAbility implements java.io.Seria public Ability_Mana(Card sourceCard, String orig) { super(isTapAbility(orig)? SpellAbility.Ability_Tap:SpellAbility.Ability, sourceCard); - + /* if (orig.contains("$")) { @@ -69,6 +76,9 @@ abstract public class Ability_Mana extends SpellAbility implements java.io.Seria this.orig = (sourceCard.getName().length() == 0? orig:orig.replaceAll(sourceCard.getName(), "CARDNAME")); setDescription(orig); + if (sourceCard.getName().equals("Black Lotus")) + System.out.println("BLACK LOTUS!"); + /* String parts[] = orig.split(":"); System.out.println("0:" +parts[0]); @@ -88,7 +98,20 @@ abstract public class Ability_Mana extends SpellAbility implements java.io.Seria setManaCost("0"); return; } - String[] parts = orig.split(":"); + else if (isSacrifice()) + { + String regex = "[0-9]+,"; + Pattern pattern = Pattern.compile(regex); + Matcher matcher = pattern.matcher(orig); + + if (orig.startsWith("Sacrifice ") || orig.startsWith("tap, Sacrifice ")) + setManaCost("0"); + else if(matcher.find()) + setManaCost(matcher.group().substring(0, matcher.group().length()-1)); + + return; + } + String[] parts = orig.split(":"); Mana = parts[1]; Mana = Mana.replaceAll(" add ", ""); Mana = Mana.replaceAll(" ", ""); @@ -199,6 +222,9 @@ abstract public class Ability_Mana extends SpellAbility implements java.io.Seria @Override public void resolve() { + if (isSacrifice()) + AllZone.GameAction.sacrifice(sourceCard); + AllZone.ManaPool.addMana(this); if(!runcommands.isEmpty()) for(Command c:runcommands) c.execute(); @@ -242,7 +268,14 @@ abstract public class Ability_Mana extends SpellAbility implements java.io.Seria sb.append(m); return sb.toString(); - } else { + } + else if ((orig.contains("Sacrifice this creature: Add ") || orig.contains("Sacrifice CARDNAME: Add ")) + && orig.contains(" to your mana pool.")) + { + String m = orig.split(": Add ")[1].split(" to ")[0]; + return m; + } + else { return Mana; } diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index b044b553cdd..f473b0446d6 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -170,7 +170,7 @@ public class CardFactory implements NewConstants { private final int shouldManaAbility(Card c) { ArrayList a = c.getIntrinsicKeyword(); for(int i = 0; i < a.size(); i++) - if(a.get(i).toString().contains(": add ")) return i; + if(a.get(i).toString().contains(": add ") || a.get(i).toString().contains(": Add ") ) return i; return -1; } @@ -13724,12 +13724,12 @@ public class CardFactory implements NewConstants { return card; }//*************** END ************ END ************************** + /* //*************** START *********** START ************************** else if(cardName.equals("Black Lotus")) { final Ability_Tap ability = new Ability_Tap(card, "0") { private static final long serialVersionUID = 8394047173115959008L; - @Override public boolean canPlayAI() { return false; @@ -13781,8 +13781,8 @@ public class CardFactory implements NewConstants { card.addSpellAbility(ability); }//*************** END ************ END ************************** - - + */ + //**************************Equipment***************************** diff --git a/src/forge/CardFactory_Creatures.java b/src/forge/CardFactory_Creatures.java index d25916730ed..bb83c2c9b0f 100644 --- a/src/forge/CardFactory_Creatures.java +++ b/src/forge/CardFactory_Creatures.java @@ -13809,47 +13809,6 @@ public class CardFactory_Creatures { card.addSpellAbility(ability2); }//*************** END ************ END ************************** - - //*************** START *********** START ************************** - if(cardName.equals("Composite Golem")) { - final Ability ability = new Ability(card, "0") { - - @Override - public boolean canPlay() { - SpellAbility sa; - for(int i = 0; i < AllZone.Stack.size(); i++) { - sa = AllZone.Stack.peek(i); - if(sa.getSourceCard().equals(card)) return false; - } - return AllZone.GameAction.isCardInPlay(card); - } - - @Override - public boolean canPlayAI() { - return false; - } - - @Override - public void resolve() { - if(card.getController().equals(Constant.Player.Human)) { - /*CardList list = new CardList(AllZone.getZone(Constant.Zone.Play, Constant.Player.Human).getCards()); - list = list.getName("Mana Pool");*/ - Card mp = AllZone.ManaPool;//list.getCard(0); - - mp.addExtrinsicKeyword("ManaPool:W"); - mp.addExtrinsicKeyword("ManaPool:U"); - mp.addExtrinsicKeyword("ManaPool:B"); - mp.addExtrinsicKeyword("ManaPool:R"); - mp.addExtrinsicKeyword("ManaPool:G"); - - AllZone.GameAction.sacrifice(card); - } - } - }; - ability.setDescription("Sacrifice Composite Golem: Add W U B R G to your mana pool."); - ability.setStackDescription("Add WUBRG your mana pool"); - card.addSpellAbility(ability); - }//*************** END ************ END ************************** //*************** START ************ START ************************** if(cardName.equals("Rats of Rath")) {