diff --git a/res/cardsfolder/auriok_glaivemaster.txt b/res/cardsfolder/auriok_glaivemaster.txt index 826b2292927..f405b1cacd1 100644 --- a/res/cardsfolder/auriok_glaivemaster.txt +++ b/res/cardsfolder/auriok_glaivemaster.txt @@ -4,6 +4,7 @@ Types:Creature Human Soldier Text:no text PT:1/1 K:stPumpSelf:Permanent.equipped:1/1/First Strike:No Condition:As long as Auriok Glaivemaster is equipped, it gets +1/+1 and has first strike. +SVar:EquipMe:Once SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/auriok_glaivemaster.jpg End diff --git a/res/cardsfolder/gate_hound.txt b/res/cardsfolder/gate_hound.txt index 55791e4ec49..056d84ad889 100644 --- a/res/cardsfolder/gate_hound.txt +++ b/res/cardsfolder/gate_hound.txt @@ -4,6 +4,7 @@ Types:Creature Hound Text:no text PT:1/1 K:stPumpAll:Creature.YouCtrl:0/0/Vigilance:isEnchanted:Creatures you control have vigilance as long as Gate Hound is enchanted. +SVar:EnchantMe:Once SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/gate_hound.jpg End diff --git a/res/cardsfolder/goblin_gaveleer.txt b/res/cardsfolder/goblin_gaveleer.txt index 432f9cc2652..a02a037797e 100644 --- a/res/cardsfolder/goblin_gaveleer.txt +++ b/res/cardsfolder/goblin_gaveleer.txt @@ -3,7 +3,8 @@ ManaCost:R Types:Creature Goblin Warrior Text:Goblin Gaveleer gets +2/+0 for each Equipment attached to it. PT:1/1 -K:Trample +K:Trample +SVar:EquipMe:Multiple SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/goblin_gaveleer.jpg End diff --git a/res/cardsfolder/kitesail_apprentice.txt b/res/cardsfolder/kitesail_apprentice.txt index 72debc39de3..c8b888dda49 100644 --- a/res/cardsfolder/kitesail_apprentice.txt +++ b/res/cardsfolder/kitesail_apprentice.txt @@ -4,6 +4,7 @@ Types:Creature Kor Soldier Text:no text PT:1/1 K:stPumpSelf:Permanent.equipped:1/1/Flying:No Condition:As long as Kitesail Apprentice is equipped, it gets +1/+1 and has flying. +SVar:EquipMe:Once SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/kitesail_apprentice.jpg End diff --git a/res/cardsfolder/kor_duelist.txt b/res/cardsfolder/kor_duelist.txt index f1593672cd8..ea450bc20da 100644 --- a/res/cardsfolder/kor_duelist.txt +++ b/res/cardsfolder/kor_duelist.txt @@ -3,6 +3,7 @@ ManaCost:W Types:Creature Kor Soldier Text:As long as Kor Duelist is equipped, it has double strike. PT:1/1 +SVar:EquipMe:Once SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/kor_duelist.jpg End diff --git a/res/cardsfolder/leonin_den_guard.txt b/res/cardsfolder/leonin_den_guard.txt index f633a2a070e..c4682368505 100644 --- a/res/cardsfolder/leonin_den_guard.txt +++ b/res/cardsfolder/leonin_den_guard.txt @@ -4,6 +4,7 @@ Types:Creature Cat Soldier Text:no text PT:1/3 K:stPumpSelf:Permanent.equipped:1/1/Vigilance:No Condition:As long as Leonin Den-Guard is equipped, it gets +1/+1 and has vigilance. +SVar:EquipMe:Once SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/leonin_den_guard.jpg End diff --git a/res/cardsfolder/loxodon_punisher.txt b/res/cardsfolder/loxodon_punisher.txt index fefa3ce9d82..a68beb392ec 100644 --- a/res/cardsfolder/loxodon_punisher.txt +++ b/res/cardsfolder/loxodon_punisher.txt @@ -3,6 +3,7 @@ ManaCost:3 W Types:Creature Elephant Soldier Text:Loxodon Punisher gets +2/+2 for each Equipment attached to it. PT:2/2 +SVar:EquipMe:Multiple SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/loxodon_punisher.jpg End diff --git a/res/cardsfolder/metathran_elite.txt b/res/cardsfolder/metathran_elite.txt index c0880f7f11d..4af74f186bc 100644 --- a/res/cardsfolder/metathran_elite.txt +++ b/res/cardsfolder/metathran_elite.txt @@ -3,7 +3,8 @@ ManaCost:1 U U Types:Creature Metathran Soldier Text:no text PT:2/3 -K:StaticEffect:Play:Self:Keyword/Unblockable:enchanted:Metathran Elite is unblockable as long as it's enchanted. +K:stPumpSelf:Creature:0/0/Unblockable:isEnchanted:Metathran Elite is unblockable as long as it's enchanted. +SVar:EnchantMe:Once SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/metathran_elite.jpg End diff --git a/res/cardsfolder/rabid_wombat.txt b/res/cardsfolder/rabid_wombat.txt index 950909e24dd..586bc539630 100644 --- a/res/cardsfolder/rabid_wombat.txt +++ b/res/cardsfolder/rabid_wombat.txt @@ -4,6 +4,7 @@ Types:Creature Wombat Text:Rabid Wombat gets +2/+2 for each Aura attached to it. PT:0/1 K:Vigilance +SVar:EnchantMe:Multiple SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/rabid_wombat.jpg End diff --git a/res/cardsfolder/raksha_golden_cub.txt b/res/cardsfolder/raksha_golden_cub.txt index 841ee83e2a3..2855fe7646f 100644 --- a/res/cardsfolder/raksha_golden_cub.txt +++ b/res/cardsfolder/raksha_golden_cub.txt @@ -5,6 +5,7 @@ Text:no text PT:3/4 K:Vigilance K:stPumpAll:Creature.Cat+YouCtrl:2/2/Double Strike:isEquipped:As long as Raksha Golden Cub is equipped, Cat creatures you control get +2/+2 and have double strike. +SVar:EquipMe:Once SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/raksha_golden_cub.jpg End diff --git a/res/cardsfolder/skyhunter_cub.txt b/res/cardsfolder/skyhunter_cub.txt index c0818a114ae..3acb94b6145 100644 --- a/res/cardsfolder/skyhunter_cub.txt +++ b/res/cardsfolder/skyhunter_cub.txt @@ -4,6 +4,7 @@ Types:Creature Cat Knight Text:no text PT:2/2 K:stPumpSelf:Permanent.equipped:1/1/Flying:No Condition:As long as Skyhunter Cub is equipped, it gets +1/+1 and has flying. +SVar:EquipMe:Once SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/skyhunter_cub.jpg End diff --git a/res/cardsfolder/sunspear_shikari.txt b/res/cardsfolder/sunspear_shikari.txt index bb423a61bfc..de13b2320ea 100644 --- a/res/cardsfolder/sunspear_shikari.txt +++ b/res/cardsfolder/sunspear_shikari.txt @@ -4,6 +4,7 @@ Types:Creature Cat Soldier Text:no text PT:2/2 K:stPumpSelf:Permanent.equipped:0/0/First Strike & Lifelink:No Condition:As long as Sunspear Shikari is equipped, it has first strike and lifelink. +SVar:EquipMe:Once SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/sunspear_shikari.jpg End diff --git a/res/cardsfolder/thran_golem.txt b/res/cardsfolder/thran_golem.txt index 1f2a44d129e..9565c8da0ee 100644 --- a/res/cardsfolder/thran_golem.txt +++ b/res/cardsfolder/thran_golem.txt @@ -4,6 +4,7 @@ Types:Artifact Creature Golem Text:no text PT:3/3 K:stPumpSelf:Creature:2/2/Flying & First Strike & Trample:isEnchanted:As long as Thran Golem is enchanted, it gets +2/+2 and has flying, first strike, and trample. +SVar:EnchantMe:Once SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/thran_golem.jpg End diff --git a/res/cardsfolder/uril_the_miststalker.txt b/res/cardsfolder/uril_the_miststalker.txt index 1ec32898da1..f46cdd7fb8b 100644 --- a/res/cardsfolder/uril_the_miststalker.txt +++ b/res/cardsfolder/uril_the_miststalker.txt @@ -4,6 +4,7 @@ Types:Legendary Creature Beast Text:Uril gets +2/+2 for each Aura attached to it. PT:5/5 K:CARDNAME can't be the target of spells or abilities your opponents control. +SVar:EnchantMe:Multiple SVar:Rarity:Mythic SVar:Picture:http://www.wizards.com/global/images/magic/general/uril_the_miststalker.jpg End diff --git a/src/forge/CardFactoryUtil.java b/src/forge/CardFactoryUtil.java index 536fbbb3237..e7d84394c65 100644 --- a/src/forge/CardFactoryUtil.java +++ b/src/forge/CardFactoryUtil.java @@ -1791,12 +1791,7 @@ public class CardFactoryUtil { // Is there at least 1 Loxodon Punisher and/or Goblin Gaveleer to target CardList equipMagnetList = list; - equipMagnetList = equipMagnetList.filter(new CardListFilter() { - public boolean addCard(Card c) { - return c.getName().equals("Loxodon Punisher") - || c.getName().equals("Goblin Gaveleer"); - } - }); + equipMagnetList = equipMagnetList.getEquipMagnets(); if (!equipMagnetList.isEmpty() && Tough >= 0) { return equipMagnetList; @@ -1926,11 +1921,8 @@ public class CardFactoryUtil { 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")); - } - }); + auraMagnetList = auraMagnetList.getEnchantMagnets(); + if (! auraMagnetList.isEmpty()) { // AI has a special target creature(s) to enchant auraMagnetList.shuffle(); for (int i = 0; i < auraMagnetList.size(); i++) { diff --git a/src/forge/CardFactory_Auras.java b/src/forge/CardFactory_Auras.java index 94ef85962fe..4149b997987 100644 --- a/src/forge/CardFactory_Auras.java +++ b/src/forge/CardFactory_Auras.java @@ -1264,11 +1264,8 @@ class CardFactory_Auras { //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")); - } - }); + auraMagnetList = auraMagnetList.getEnchantMagnets(); + if (! auraMagnetList.isEmpty()) { // AI has a special target creature(s) to enchant auraMagnetList.shuffle(); for (int i = 0; i < auraMagnetList.size(); i++) { @@ -1374,11 +1371,8 @@ class CardFactory_Auras { //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")); - } - }); + auraMagnetList = auraMagnetList.getEnchantMagnets(); + if (! auraMagnetList.isEmpty()) { // AI has a special target creature(s) to enchant auraMagnetList.shuffle(); for (int i = 0; i < auraMagnetList.size(); i++) { @@ -1483,11 +1477,8 @@ class CardFactory_Auras { //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")); - } - }); + auraMagnetList = auraMagnetList.getEnchantMagnets(); + if (! auraMagnetList.isEmpty()) { // AI has a special target creature(s) to enchant auraMagnetList.shuffle(); for (int i = 0; i < auraMagnetList.size(); i++) { @@ -1746,11 +1737,8 @@ class CardFactory_Auras { //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")); - } - }); + auraMagnetList = auraMagnetList.getEnchantMagnets(); + if (! auraMagnetList.isEmpty()) { // AI has a special target creature(s) to enchant auraMagnetList.shuffle(); for (int i = 0; i < auraMagnetList.size(); i++) { diff --git a/src/forge/CardFactory_Equipment.java b/src/forge/CardFactory_Equipment.java index f9f12e0f2b8..dfd82672878 100644 --- a/src/forge/CardFactory_Equipment.java +++ b/src/forge/CardFactory_Equipment.java @@ -16,6 +16,7 @@ class CardFactory_Equipment { return -1; } + public static Card getCard(final Card card, String cardName, String owner) { @@ -71,12 +72,7 @@ class CardFactory_Equipment { // Is there at least 1 Loxodon Punisher and/or Goblin Gaveleer to target CardList equipMagnetList = list; - equipMagnetList = equipMagnetList.filter(new CardListFilter() { - public boolean addCard(Card c) { - return c.getName().equals("Loxodon Punisher") - || c.getName().equals("Goblin Gaveleer"); - } - }); + equipMagnetList = equipMagnetList.getEquipMagnets(); if (equipMagnetList.size() != 0) { return equipMagnetList; @@ -277,12 +273,7 @@ class CardFactory_Equipment { // Is there at least 1 Loxodon Punisher and/or Goblin Gaveleer to target CardList equipMagnetList = list; - equipMagnetList = equipMagnetList.filter(new CardListFilter() { - public boolean addCard(Card c) { - return c.getName().equals("Loxodon Punisher") - || c.getName().equals("Goblin Gaveleer"); - } - }); + equipMagnetList = equipMagnetList.getEquipMagnets(); if (equipMagnetList.size() != 0) { return equipMagnetList; @@ -358,12 +349,7 @@ class CardFactory_Equipment { // Is there at least 1 Loxodon Punisher and/or Goblin Gaveleer to target CardList equipMagnetList = list; - equipMagnetList = equipMagnetList.filter(new CardListFilter() { - public boolean addCard(Card c) { - return c.getName().equals("Loxodon Punisher") - || c.getName().equals("Goblin Gaveleer"); - } - }); + equipMagnetList = equipMagnetList.getEquipMagnets(); if (equipMagnetList.size() != 0) { return equipMagnetList; @@ -552,12 +538,7 @@ class CardFactory_Equipment { // Is there at least 1 Loxodon Punisher and/or Goblin Gaveleer to target CardList equipMagnetList = list; - equipMagnetList = equipMagnetList.filter(new CardListFilter() { - public boolean addCard(Card c) { - return c.getName().equals("Loxodon Punisher") - || c.getName().equals("Goblin Gaveleer"); - } - }); + equipMagnetList = equipMagnetList.getEquipMagnets(); if (equipMagnetList.size() != 0) { return equipMagnetList; @@ -659,12 +640,7 @@ class CardFactory_Equipment { // Is there at least 1 Loxodon Punisher and/or Goblin Gaveleer to target CardList equipMagnetList = list; - equipMagnetList = equipMagnetList.filter(new CardListFilter() { - public boolean addCard(Card c) { - return c.getName().equals("Loxodon Punisher") - || c.getName().equals("Goblin Gaveleer"); - } - }); + equipMagnetList = equipMagnetList.getEquipMagnets(); if (equipMagnetList.size() != 0) { return equipMagnetList; @@ -766,12 +742,7 @@ class CardFactory_Equipment { // Is there at least 1 Loxodon Punisher and/or Goblin Gaveleer to target CardList equipMagnetList = list; - equipMagnetList = equipMagnetList.filter(new CardListFilter() { - public boolean addCard(Card c) { - return c.getName().equals("Loxodon Punisher") - || c.getName().equals("Goblin Gaveleer"); - } - }); + equipMagnetList = equipMagnetList.getEquipMagnets(); if (equipMagnetList.size() != 0) { return equipMagnetList; diff --git a/src/forge/CardList.java b/src/forge/CardList.java index 35f2f5a28a7..ea3d34327e5 100644 --- a/src/forge/CardList.java +++ b/src/forge/CardList.java @@ -383,4 +383,22 @@ public class CardList implements Iterable { return retList; }//getValidCards */ + + public CardList getEquipMagnets() { + return this.filter(new CardListFilter() { + public boolean addCard(Card c) { + return (c.isCreature() && (c.getSVar("EquipMe").equals("Multiple") + || (c.getSVar("EquipMe").equals("Once") && !c.isEnchanted()))); + } + }); + } + + public CardList getEnchantMagnets() { + return this.filter(new CardListFilter() { + public boolean addCard(Card c) { + return (c.isCreature() && (c.getSVar("EnchantMe").equals("Multiple") + || (c.getSVar("EnchantMe").equals("Once") && !c.isEnchanted()))); + } + }); + } }