From 35846ff8eb8c13d062c62684e9447b35a32bb570 Mon Sep 17 00:00:00 2001 From: jendave Date: Sun, 7 Aug 2011 01:18:40 +0000 Subject: [PATCH] add Lyzolda, the Blood Witch (from Dissension) --- .gitattributes | 1 + res/cardsfolder/lyzolda_the_blood_witch.txt | 14 ++++++++++ .../card/cardFactory/CardFactoryUtil.java | 28 +++++++++---------- 3 files changed, 28 insertions(+), 15 deletions(-) create mode 100644 res/cardsfolder/lyzolda_the_blood_witch.txt diff --git a/.gitattributes b/.gitattributes index 12bad06f3f3..10a2c077d37 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4240,6 +4240,7 @@ res/cardsfolder/lymph_sliver.txt -text svneol=native#text/plain res/cardsfolder/lynx.txt -text svneol=native#text/plain res/cardsfolder/lys_alana_bowmaster.txt -text svneol=native#text/plain res/cardsfolder/lys_alana_huntmaster.txt -text svneol=native#text/plain +res/cardsfolder/lyzolda_the_blood_witch.txt svneol=native#text/plain res/cardsfolder/ma_chao_western_warrior.txt -text svneol=native#text/plain res/cardsfolder/macabre_waltz.txt -text svneol=native#text/plain res/cardsfolder/macetail_hystrodon.txt -text svneol=native#text/plain diff --git a/res/cardsfolder/lyzolda_the_blood_witch.txt b/res/cardsfolder/lyzolda_the_blood_witch.txt new file mode 100644 index 00000000000..448a8bae084 --- /dev/null +++ b/res/cardsfolder/lyzolda_the_blood_witch.txt @@ -0,0 +1,14 @@ +Name:Lyzolda, the Blood Witch +ManaCost:1 B R +Types:Legendary Creature Human Cleric +Text:no text +PT:3/1 +A:AB$DealDamage | Cost$ 2 Sac<1/Creature> | Tgt$TgtCP | NumDmg$ X | SubAbility$ SVar=DBDraw | SpellDescription$ CARDNAME deals 2 damage to target creature or player if the sacrificed creature was red. Draw a card if the sacrificed creature was black. +SVar:DBDraw:DB$Draw | NumCards$ Y | Defined$ You +SVar:X:Sacrificed$Valid Creature.Red/Times.2 +SVar:Y:Sacrificed$Valid Creature.Black +SVar:RemAIDeck:True +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/lyzolda_the_blood_witch.jpg +SetInfo:DIS|Rare|http://magiccards.info/scans/en/di/117.jpg +End \ No newline at end of file diff --git a/src/forge/card/cardFactory/CardFactoryUtil.java b/src/forge/card/cardFactory/CardFactoryUtil.java index d84827da983..3b4003b546f 100644 --- a/src/forge/card/cardFactory/CardFactoryUtil.java +++ b/src/forge/card/cardFactory/CardFactoryUtil.java @@ -66,7 +66,7 @@ public class CardFactoryUtil { } - //for Sarkhan the Mad + //for Sarkhan the Mad public static Card AI_getCheapestCreature(CardList list, final Card spell, boolean targeted) { list = list.filter(new CardListFilter() { public boolean addCard(Card c) { @@ -2363,7 +2363,7 @@ public class CardFactoryUtil { n = cardsonbattlefield.size(); - return doXMath(n, m,source); + return doXMath(n, m, source); } final String[] sq; @@ -2795,7 +2795,7 @@ public class CardFactoryUtil { return doXMath(n, m, c); } - private static int doXMath(int num, String m,Card c){ + private static int doXMath(int num, String m, Card c){ if(m.equals("none")) return num; String[] s = m.split("\\."); @@ -2840,15 +2840,22 @@ public class CardFactoryUtil { if (string.startsWith("Amount")){ if (string.contains(".")){ String[] splitString = string.split("\\.", 2); - return doXMath(paidList.size(), splitString[1],source); + return doXMath(paidList.size(), splitString[1], source); } else return paidList.size(); } if( string.contains("Valid") ) { + final String m[] = {"none"}; + String valid = string.replace("Valid ", ""); - return paidList.getValidCards(valid, source.getController(), source).size(); + final String[] l; + l = valid.split("/"); // separate the specification from any math + valid = l[0]; + if(l.length > 1) m[0] = l[1]; + CardList list = paidList.getValidCards(valid, source.getController(), source); + return doXMath(list.size(), m, source); } int tot = 0; @@ -3517,16 +3524,7 @@ public class CardFactoryUtil { public static boolean isNegativeCounter(Counters c) - { - - /* - AGE(), - BLAZE(), - BRIBERY(), - ICE(), - M1M1("-1/-1"), - TIME(), - */ + { return c == Counters.AGE || c == Counters.BLAZE || c == Counters.BRIBERY || c == Counters.DOOM || c == Counters.ICE || c == Counters.M1M1 || c == Counters.M0M2 || c == Counters.M0M1|| c == Counters.TIME; }