From 199f14749ea3eb218b6a74a76bc758abfbedf7d9 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 08:20:31 +0000 Subject: [PATCH] 1) implement X in Drawback$MakeToken 2) add AEther Mutation (from Apocalypse) using Drawback$MakeToken X functionality --- .gitattributes | 1 + res/cardsfolder/aether_mutation.txt | 10 ++++++++++ src/forge/CardFactoryUtil.java | 15 ++++++--------- 3 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 res/cardsfolder/aether_mutation.txt diff --git a/.gitattributes b/.gitattributes index c926d761318..29345cb38e8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -57,6 +57,7 @@ res/cardsfolder/aesthir_glider.txt -text svneol=native#text/plain res/cardsfolder/aether_adept.txt -text svneol=native#text/plain res/cardsfolder/aether_flash.txt -text svneol=native#text/plain res/cardsfolder/aether_membrane.txt -text svneol=native#text/plain +res/cardsfolder/aether_mutation.txt -text svneol=native#text/plain res/cardsfolder/aether_spellbomb.txt -text svneol=native#text/plain res/cardsfolder/aether_vial.txt -text svneol=native#text/plain res/cardsfolder/aether_web.txt -text svneol=native#text/plain diff --git a/res/cardsfolder/aether_mutation.txt b/res/cardsfolder/aether_mutation.txt new file mode 100644 index 00000000000..09dc1961fb8 --- /dev/null +++ b/res/cardsfolder/aether_mutation.txt @@ -0,0 +1,10 @@ +Name:AEther Mutation +ManaCost:3 G U +Types:Sorcery +Text:Return target creature to its owner's hand. Put X 1/1 green Saproling creature tokens onto the battlefield, where X is that creature's converted mana cost. +K:spBounceTgt:Creature:Hand:Drawback$MakeToken<>X<>Saproling<>G 1 1 Saproling<>Controller<>G<>Creature;Saproling<>1<>1<>None +#X will be the Converted Mana Cost of the target of AEther Mutation +SVar:X:Count$CardManaCost +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/aether_mutation.jpg +End \ No newline at end of file diff --git a/src/forge/CardFactoryUtil.java b/src/forge/CardFactoryUtil.java index 38b52e3642a..740e89043fd 100644 --- a/src/forge/CardFactoryUtil.java +++ b/src/forge/CardFactoryUtil.java @@ -3933,9 +3933,9 @@ public class CardFactoryUtil { if(d[0].contains("MakeToken")) { final String[] k = d[0].split("<>"); - //final String numString = k[1].equals("X") ? Src.getSVar("X") : k[1]; - final String numString = k[1]; - //final boolean xString = k[1].equals("X") ? true : false; + final String numString = k[1].equals("X") ? Src.getSVar("X") : k[1]; + //final String numString = k[1]; + final boolean xString = k[1].equals("X") ? true : false; final String name = k[2]; final String imageName = k[3]; final String controllerString = k[4]; @@ -3945,17 +3945,14 @@ public class CardFactoryUtil { final int defense = Integer.valueOf(k[8]); final String[] keywords = k[9].split(";"); - //String controller = (controllerString.equals("Controller") ? Src.getController() : AllZone.GameAction.getOpponent(card.getController())); String controller = controllerString.equals("Controller") ? cardController : Opp; + if(keywords[0].equals("None")) keywords[0] = ""; - if(keywords[0].equals("None")) keywords[0] = ""; - - //int num = xString ? CardFactoryUtil.xCount(card, numString) : Integer.valueOf(numString); - int num = Integer.valueOf(numString); + int num = xString ? CardFactoryUtil.xCount(TgtC, numString) : Integer.valueOf(numString); for(int i = 0; i < num; i ++ ){ CardFactoryUtil.makeToken(name, imageName, controller, manaCost, types, attack, defense, keywords); } - } + }//end MakeToken drawback if(d[0].contains("ReturnFromYard")) // placeholder for effect