From 9d0aff4cf43594c82495b887b50f3c734b2016ab Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 10:23:03 +0000 Subject: [PATCH] *Converted Galvanic Blast to keyword. *Added Metalcraft parameter to Count$ --- res/cardsfolder/galvanic_blast.txt | 7 +-- src/forge/CardFactoryUtil.java | 9 ++++ src/forge/CardFactory_Instants.java | 84 +---------------------------- 3 files changed, 14 insertions(+), 86 deletions(-) diff --git a/res/cardsfolder/galvanic_blast.txt b/res/cardsfolder/galvanic_blast.txt index 1c9047ec5f5..a693db401e5 100644 --- a/res/cardsfolder/galvanic_blast.txt +++ b/res/cardsfolder/galvanic_blast.txt @@ -1,8 +1,9 @@ Name:Galvanic Blast ManaCost:R Types:Instant -Text:Galvanic Blast deals 2 damage to target creature or player.\r\nMetalcraft - Galvanic Blast deals 4 damage to that creature or player instead if you control three or more artifacts. +Text:no text +K:spDamageTgtCP:X:Galvanic Blast deals 2 damage to target creature or player. Metalcraft - Galvanic Blast deals 4 damage to that creature or player instead if you control 3 or more artifacts.:Galvanic Blast - deals damage. +SVar:X:Count$MetalCraft.4.2 SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/galvanic_blast.jpg -End -#Uses Card-specific code! \ No newline at end of file +End \ No newline at end of file diff --git a/src/forge/CardFactoryUtil.java b/src/forge/CardFactoryUtil.java index 8fae62e1ca3..9e1a3618f48 100644 --- a/src/forge/CardFactoryUtil.java +++ b/src/forge/CardFactoryUtil.java @@ -3739,6 +3739,15 @@ public class CardFactoryUtil { return doXMath(Integer.parseInt(sq[2]), m); // not Hellbent } + //Count$Metalcraft.. + if(sq[0].contains("Metalcraft")) + { + if(cardController.hasMetalcraft()) + return doXMath(Integer.parseInt(sq[1]),m); + else + return doXMath(Integer.parseInt(sq[1]),m); + } + if (sq[0].contains("Threshold")) { if (myYard.size() >= 7) diff --git a/src/forge/CardFactory_Instants.java b/src/forge/CardFactory_Instants.java index 479b84bed70..23d1b161dcf 100644 --- a/src/forge/CardFactory_Instants.java +++ b/src/forge/CardFactory_Instants.java @@ -82,89 +82,7 @@ public class CardFactory_Instants { }//*************** END ************ END ************************** */ - //*************** START *********** START ************************** - else if(cardName.equals("Galvanic Blast")) { - SpellAbility spell = new Spell(card) { - /** - * - */ - private static final long serialVersionUID = 5792350922880305361L; - - @Override - public void resolve() { - int damageToDo = 2; - CardList artifacts = new CardList(AllZone.getZone(Constant.Zone.Play,card.getController()).getCards()); - - artifacts.filter(new CardListFilter() { - public boolean addCard(Card c) { - return c.getType().contains("Artifact"); - } - }); - - if(artifacts.size() > 3) { - damageToDo = 4; - } - - Card c = getTargetCard(); - if(c != null) - { - c.addDamage(damageToDo,card); - } - else - { - getTargetPlayer().addDamage(damageToDo,card); - } - } - - public boolean canPlay() { - return true;//super.canPlay(); - } - - public boolean canPlayAI() { - final Integer[] damageToDo = new Integer[1]; - damageToDo[0] = 2; - CardList artifacts = new CardList(AllZone.getZone(Constant.Zone.Play,AllZone.ComputerPlayer).getCards()); - CardList possibleTargets = new CardList(AllZone.getZone(Constant.Zone.Play,AllZone.HumanPlayer).getCards()); - - artifacts.filter(new CardListFilter() { - public boolean addCard(Card c) { - return c.getType().contains("Artifact"); - } - }); - - if(artifacts.size() > 3) { - damageToDo[0] = 4; - } - - possibleTargets.filter(new CardListFilter() { - public boolean addCard(Card c) { - if(!c.isCreature()) - { - return false; - } - - return c.getNetDefense() <= damageToDo[0]; - } - }); - if(possibleTargets.size() > 0) { - setTargetCard(possibleTargets.get(0)); - return true; - } - else - { - setTargetPlayer(AllZone.HumanPlayer); - return true; - } - } - }; - card.clearSpellAbility(); - card.addSpellAbility(spell); - - spell.setBeforePayMana(CardFactoryUtil.input_targetCreaturePlayer(spell,Command.Blank,true,false)); - - }//*************** END ************ END ************************** - - //*************** START *********** START ************************** + //*************** START *********** START ************************** else if (cardName.equals("Brave the Elements")) { /** * This card now works slightly better than it did before the spAllPump