diff --git a/res/card-pictures.txt b/res/card-pictures.txt index 3c6ec7d12c0..3a135675949 100644 --- a/res/card-pictures.txt +++ b/res/card-pictures.txt @@ -18,6 +18,19 @@ forest.jpg http://resources.wizards.com/magic/cards/unh/en-us/card73946.jpg forest1.jpg http://gatherer.wizards.com/handlers/image.ashx?type=card&multiverseid=2748 forest2.jpg http://gatherer.wizards.com/handlers/image.ashx?type=card&multiverseid=587 forest3.jpg http://gatherer.wizards.com/handlers/image.ashx?type=card&multiverseid=586 +promised_kannushi.jpg http://www.wizards.com/global/images/magic/general/promised_kannushi.jpg +body_of_jukai.jpg http://www.wizards.com/global/images/magic/general/body_of_jukai.jpg +crawling_filth.jpg http://www.wizards.com/global/images/magic/general/crawling_filth.jpg +forked_branch_garami.jpg http://www.wizards.com/global/images/magic/general/forked_branch_garami.jpg +gibbering_kami.jpg http://www.wizards.com/global/images/magic/general/gibbering_kami.jpg +kami_of_empty_graves.jpg http://www.wizards.com/global/images/magic/general/kami_of_empty_graves.jpg +kami_of_lunacy.jpg http://www.wizards.com/global/images/magic/general/kami_of_lunacy.jpg +kami_of_the_palace_fields.jpg http://www.wizards.com/global/images/magic/general/kami_of_the_palace_fields.jpg +nightsoil_kami.jpg http://www.wizards.com/global/images/magic/general/nightsoil_kami.jpg +thousand_legged_kami.jpg http://www.wizards.com/global/images/magic/general/thousand_legged_kami.jpg +venerable_kumo.jpg http://www.wizards.com/global/images/magic/general/venerable_kumo.jpg +thief_of_hope.jpg http://www.wizards.com/global/images/magic/general/thief_of_hope.jpg +waning_wurm.jpg http://www.wizards.com/global/images/magic/general/waning_wurm.jpg time_stretch.jpg http://www.wizards.com/global/images/magic/general/time_stretch.jpg veteran_armorsmith.jpg http://www.wizards.com/global/images/magic/general/veteran_armorsmith.jpg veteran_swordsmith.jpg http://www.wizards.com/global/images/magic/general/veteran_swordsmith.jpg diff --git a/res/cards.txt b/res/cards.txt index 4256bae38f0..b0708eeba68 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,110 @@ +Thief of Hope +2 B +Creature Spirit +Whenever you play a Spirit or Arcane spell, target opponent loses 1 life and you gain 1 life. +2/2 +Soulshift:2 + +Venerable Kumo +4 G +Creature Spirit +no text +2/3 +Reach +Soulshift:4 + +Thousand-legged Kami +6 G G +Creature Spirit +no text +6/6 +Soulshift:7 + +Nightsoil Kami +4 G G +Creature Spirit +no text +6/4 +Soulshift:5 + +Kami of the Palace Fields +5 W +Creature Spirit +no text +3/2 +Flying +First Strike +Soulshift:5 + +Kami of Lunacy +4 B B +Creature Spirit +no text +4/1 +Flying +Soulshift:5 + +Kami of Empty Graves +3 B +Creature Spirit +no text +4/1 +Soulshift:3 + +Gibbering Kami +3 B +Creature Spirit +no text +2/2 +Flying +Soulshift:3 + +Forked-Branch Garami +3 G G +Creature Spirit +no text +4/4 +Soulshift:4 +Soulshift:4 + +Crawling Filth +5 B +Creature Spirit +no text +2/2 +Fear +Soulshift:5 + +Body of Jukai +7 G G +Creature Spirit +no text +8/5 +Trample +Soulshift:8 + +Promised Kannushi +G +Creature Human Druid +no text +1/1 +Soulshift:7 + +Torii Watchward +4 W +Creature Spirit +no text +3/3 +Vigilance +Soulshift:4 + +Waning Wurm +3 B +Creature Zombie Wurm +no text +7/6 +Vanishing:2 + Time Stretch 8 U U Sorcery @@ -13744,13 +13851,6 @@ Radiant, Archangel gets +1/+1 for each creature with flying in play. Flying Vigilance -Torii Watchward -4 W -Creature Spirit -(NOTE: "Soulshift" not implemented.) -3/3 -Vigilance - Veteran Armorer 1 W Creature Human Soldier diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index fd8524b1879..b494b5ee883 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -17777,6 +17777,41 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase(); } }//transmute + while (hasKeyword(card,"Soulshift") != -1) + { + int n = hasKeyword(card,"Soulshift"); + if (n != -1) + { + String parse = card.getKeyword().get(n).toString(); + card.removeIntrinsicKeyword(parse); + + String k[] = parse.split(":"); + final String manacost = k[1]; + + + card.addSpellAbility(CardFactoryUtil.soul_desc(card, manacost)); + card.addDestroyCommand(CardFactoryUtil.ability_Soulshift(card, manacost)); + } + }//Soulshift + + if (hasKeyword(card,"Vanishing") != -1) + { + int n = hasKeyword(card,"Vanishing"); + if (n != -1) + { + String parse = card.getKeyword().get(n).toString(); + card.removeIntrinsicKeyword(parse); + + String k[] = parse.split(":"); + final int power = Integer.parseInt(k[1]); + + + card.addComesIntoPlayCommand(CardFactoryUtil.vanishing(card, power)); + card.addSpellAbility(CardFactoryUtil.vanish_desc(card, power)); + } + }//Vanishing + + return card; }//getCard2 diff --git a/src/forge/CardFactoryUtil.java b/src/forge/CardFactoryUtil.java index 00b3470559e..97a0cf2d537 100644 --- a/src/forge/CardFactoryUtil.java +++ b/src/forge/CardFactoryUtil.java @@ -1449,6 +1449,119 @@ public class CardFactoryUtil return onUnEquip; }//vanila_unequip() + public static Command vanishing(final Card sourceCard, final int Power) + { + Command age = new Command() + { + private static final long serialVersionUID = 431920157968451817L; + public boolean firstTime = true; + public void execute() + { + + //testAndSet - only needed when comes into play. + if(firstTime){ + sourceCard.setCounter(Counters.AGE, Power); + } + firstTime = false; + } + }; + return age; + } // vanishing + + public static SpellAbility vanish_desc(final Card sourceCard, final int power) + { + final SpellAbility desc = new Ability_Hand(sourceCard, "0") + { + private static final long serialVersionUID = -4960704261761785512L; + + public boolean canPlay() {return false;} + + public void resolve() + { + } + }; + // Be carefull changing this description cause it's crucial for ability to work (see GameActionUtil - vanishing for it) + desc.setDescription("Vanishing " + power + " (This permanent enters the battlefield with " +power+ " time counters on it. At the beginning of your upkeep, remove a time counter from it. When the last is removed, sacrifice it.)"); + return desc; + }//vanish_desc() + + public static Command ability_Soulshift(final Card sourceCard, final String Manacost) + { + final Command Soulshift = new Command() + { + private static final long serialVersionUID = -4960704261761785512L; + + public void execute() + { + PlayerZone lib = AllZone.getZone(Constant.Zone.Graveyard, sourceCard.getController()); + PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, sourceCard.getController()); + + + CardList cards = new CardList(lib.getCards()); + CardList sameCost = new CardList(); + int Cost = CardUtil.getConvertedManaCost(Manacost); + for (int i=0;i a = c.getKeyword(); + for (int i = 0; i < a.size(); i++) + if (a.get(i).toString().startsWith("Vanishing")) + return i; + + return -1; + } public static Card getCard(final Card card, String cardName, String owner) { + //*************** START *********** START ************************** if(cardName.equals("Epic Proportions")) { @@ -5771,7 +5784,23 @@ class CardFactory_Auras { spell.setBeforePayMana(CardFactoryUtil.input_targetCreature(spell)); }//*************** END ************ END ************************** - - return card; + + if (shouldVanish(card) != -1) + { + int n = shouldVanish(card); + if (n != -1) + { + String parse = card.getKeyword().get(n).toString(); + card.removeIntrinsicKeyword(parse); + + String k[] = parse.split(":"); + final int power = Integer.parseInt(k[1]); + + card.addComesIntoPlayCommand(CardFactoryUtil.vanishing(card, power)); + card.addSpellAbility(CardFactoryUtil.vanish_desc(card, power)); + } + }//Vanishing + + return card; } } \ No newline at end of file diff --git a/src/forge/CardFactory_Creatures.java b/src/forge/CardFactory_Creatures.java index d10e6c43390..5e9f6fba303 100644 --- a/src/forge/CardFactory_Creatures.java +++ b/src/forge/CardFactory_Creatures.java @@ -33,6 +33,25 @@ public class CardFactory_Creatures { return -1; } + public static int shouldSoulshift(Card c) { + ArrayList a = c.getKeyword(); + for (int i = 0; i < a.size(); i++) + if (a.get(i).toString().startsWith("Soulshift")) + return i; + + return -1; + } + + public static int shouldVanish(Card c) { + ArrayList a = c.getKeyword(); + for (int i = 0; i < a.size(); i++) + if (a.get(i).toString().startsWith("Vanishing")) + return i; + + return -1; + } + + public static Card getCard(final Card card, String cardName, String owner, CardFactory cf) { @@ -18701,6 +18720,37 @@ public class CardFactory_Creatures { card.addSpellAbility(CardFactoryUtil.ability_transmute(card, manacost)); } }//Transmute + + while (shouldSoulshift(card) != -1) + { + int n = shouldSoulshift(card); + if (n != -1) + { + String parse = card.getKeyword().get(n).toString(); + card.removeIntrinsicKeyword(parse); + + String k[] = parse.split(":"); + final String manacost = k[1]; + card.addSpellAbility(CardFactoryUtil.soul_desc(card, manacost)); + card.addDestroyCommand(CardFactoryUtil.ability_Soulshift(card, manacost)); + } + }//Soulshift + + if (shouldVanish(card) != -1) + { + int n = shouldVanish(card); + if (n != -1) + { + String parse = card.getKeyword().get(n).toString(); + card.removeIntrinsicKeyword(parse); + + String k[] = parse.split(":"); + final int power = Integer.parseInt(k[1]); + + card.addComesIntoPlayCommand(CardFactoryUtil.vanishing(card, power)); + card.addSpellAbility(CardFactoryUtil.vanish_desc(card, power)); + } + }//Vanishing return card; } diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index 9884cd7177e..42a44cd34ca 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -64,6 +64,7 @@ public class GameActionUtil upkeep_Defense_of_the_Heart(); upkeep_Mycoloth(); upkeep_Spore_Counters(); + upkeep_Vanishing(); upkeep_Aven_Riftwatcher(); upkeep_Calciderm(); upkeep_Blastoderm(); @@ -93,6 +94,7 @@ public class GameActionUtil playCard_Dovescape(c); //keep this one top playCard_Demigod_of_Revenge(c); playCard_Halcyon_Glaze(c); + playCard_Thief_of_Hope(c); playCard_Infernal_Kirin(c); playCard_Cloudhoof_Kirin(c); playCard_Bounteous_Kirin(c); @@ -663,6 +665,59 @@ public class GameActionUtil }//Halcyon Glaze + public static void playCard_Thief_of_Hope(Card c) + { + final String controller = c.getController(); + + final PlayerZone play = AllZone.getZone(Constant.Zone.Play, + controller); + + CardList list = new CardList(); + list.addAll(play.getCards()); + + list = list.getName("Thief of Hope"); + + if (list.size() > 0){ + if (c.getType().contains("Spirit") || c.getType().contains("Arcane") || c.getIntrinsicKeyword().contains("Changeling")) + { + for (int i=0;i 0) + { + for (int i = 0; i < list.size(); i++) + { + Card card = list.get(i); + card.setCounter(Counters.AGE, + card.getCounters(Counters.AGE) - 1); + if (card.getCounters(Counters.AGE) <= 0) + { + AllZone.GameAction.sacrifice(card); + } + } + } + } + private static void upkeep_Aven_Riftwatcher() { // get all Aven Riftwatcher in play under the control of this player