From d2a7014f479c20b9de652c2707d4cf5abe0b8f44 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 03:52:07 +0000 Subject: [PATCH] 1) Added these cards and their LQ pic urls: Immolation; Maggot Therapy; Riot Spikes; Sangrite Backlash; Twisted Experiment. 2) Improved the canPlayAI() method located in SpellAbility enPump_Enchant. --- res/card-pictures.txt | 5 +++++ res/cards.txt | 36 ++++++++++++++++++++++++++++++ src/forge/CardFactoryUtil.java | 40 ++++++++++++++++++---------------- 3 files changed, 62 insertions(+), 19 deletions(-) diff --git a/res/card-pictures.txt b/res/card-pictures.txt index b32ded3ee04..9e044dc30d2 100644 --- a/res/card-pictures.txt +++ b/res/card-pictures.txt @@ -38,6 +38,11 @@ snow_covered_mountain.jpg http://www.wizards.com/global/images/magic/gene snow_covered_mountain1.jpg http://www.wizards.com/global/images/magic/general/snow_covered_mountain.jpg snow_covered_mountain2.jpg http://www.magickartenmarkt.de/img/cards/Ice_Age/snow_covered_mountain.jpg snow_covered_mountain3.jpg http://www.magickartenmarkt.de/img/cards/Ice_Age/snow_covered_mountain.jpg +immolation.jpg http://www.wizards.com/global/images/magic/general/immolation.jpg +maggot_therapy.jpg http://www.wizards.com/global/images/magic/general/maggot_therapy.jpg +riot_spikes.jpg http://www.wizards.com/global/images/magic/general/riot_spikes.jpg +sangrite_backlash.jpg http://www.wizards.com/global/images/magic/general/sangrite_backlash.jpg +twisted_experiment.jpg http://www.wizards.com/global/images/magic/general/twisted_experiment.jpg the_rack.jpg http://www.wizards.com/global/images/magic/general/the_rack.jpg crumble.jpg http://www.wizards.com/global/images/magic/general/crumble.jpg flashfires.jpg http://www.wizards.com/global/images/magic/general/flashfires.jpg diff --git a/res/cards.txt b/res/cards.txt index 8ecf14220fc..32cc1ffba59 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,39 @@ +Immolation +R +Enchantment Aura +Enchanted creature gets +2/-2. +Enchant creature +enPump:+2/-2 + +Maggot Therapy +2 B +Enchantment Aura +Enchanted creature gets +2/-2. +Flash +Enchant creature +enPump:+2/-2 + +Riot Spikes +BR +Enchantment Aura +Enchanted creature gets +2/-1. +Enchant creature +enPump:+2/-1 + +Sangrite Backlash +BG R +Enchantment Aura +Enchanted creature gets +3/-3. +Enchant creature +enPump:+3/-3 + +Twisted Experiment +1 B +Enchantment Aura +Enchanted creature gets +3/-1. +Enchant creature +enPump:+3/-1 + The Rack 1 Artifact diff --git a/src/forge/CardFactoryUtil.java b/src/forge/CardFactoryUtil.java index 7fb7f830fed..56d15382d4b 100644 --- a/src/forge/CardFactoryUtil.java +++ b/src/forge/CardFactoryUtil.java @@ -1414,22 +1414,23 @@ public class CardFactoryUtil { //else (is there a Rabid Wombat or a Uril, the Miststalker to target?) - CardList auraMagnetList = new CardList(AllZone.Computer_Play.getCards()); - auraMagnetList = auraMagnetList.filter(new CardListFilter() { - public boolean addCard(Card c) { - return c.isCreature() && (c.getName().equals("Rabid Wombat") || c.getName().equals("Uril, the Miststalker")); - } - }); - if (! auraMagnetList.isEmpty()) { // AI has a special target creature(s) to enchant - auraMagnetList.shuffle(); - for (int i = 0; i < auraMagnetList.size(); i++) { - if (CardFactoryUtil.canTarget(sourceCard, auraMagnetList.get(i))) { - setTargetCard(auraMagnetList.get(i)); // Target only Rabid Wombat or Uril, the Miststalker - return true; - } - } + if (Tough >= -1) { // we want Rabid Wombat or a Uril, the Miststalker to gain at least +1 toughness + CardList auraMagnetList = new CardList(AllZone.Computer_Play.getCards()); + auraMagnetList = auraMagnetList.filter(new CardListFilter() { + public boolean addCard(Card c) { + return c.isCreature() && (c.getName().equals("Rabid Wombat") || c.getName().equals("Uril, the Miststalker")); + } + }); + if (! auraMagnetList.isEmpty()) { // AI has a special target creature(s) to enchant + auraMagnetList.shuffle(); + for (int i = 0; i < auraMagnetList.size(); i++) { + if (CardFactoryUtil.canTarget(sourceCard, auraMagnetList.get(i))) { + setTargetCard(auraMagnetList.get(i)); // Target only Rabid Wombat or Uril, the Miststalker + return true; + } + } + } } - //else (if aura is keyword only) if (Power == 0 && Tough == 0) { // This aura is keyword only @@ -1438,7 +1439,7 @@ public class CardFactoryUtil { ArrayList extKeywords = new ArrayList(Arrays.asList(extrinsicKeywords)); for (String s:extKeywords) { if (!c.getKeyword().contains(s)) - return true; + return true; // Do not duplicate keyword and do not kill by reducing toughness to <= zero } //no new keywords: return false; @@ -1452,9 +1453,10 @@ public class CardFactoryUtil { CardListUtil.sortFlying(list); for (int i = 0; i < list.size(); i++) { - if (CardFactoryUtil.canTarget(sourceCard, list.get(i))) { - setTargetCard(list.get(i)); - return true; + if (CardFactoryUtil.canTarget(sourceCard, list.get(i)) && + list.get(i).getNetAttack() + Power > 0 && list.get(i).getNetDefense() + Tough > 0) { + setTargetCard(list.get(i)); // Do not reduce power to <= zero + return true; // Do not kill by reducing toughness to <= zero } } return false;