diff --git a/res/card-pictures.txt b/res/card-pictures.txt index 82f640990d2..841e89228c7 100644 --- a/res/card-pictures.txt +++ b/res/card-pictures.txt @@ -3778,3 +3778,22 @@ spinneret_sliver.jpg http://www.wizards.com/global/images/magic/general/spinner territorial_baloth.jpg http://www.wizards.com/global/images/magic/general/territorial_baloth.jpg necrogenesis.jpg http://www.wizards.com/global/images/magic/general/necrogenesis.jpg night_soil.jpg http://www.wizards.com/global/images/magic/general/night_soil.jpg +spike_feeder.jpg http://www.wizards.com/global/images/magic/general/spike_feeder.jpg +spike_weaver.jpg http://www.wizards.com/global/images/magic/general/spike_weaver.jpg +spike_worker.jpg http://www.wizards.com/global/images/magic/general/spike_worker.jpg +spike_colony.jpg http://www.wizards.com/global/images/magic/general/spike_colony.jpg +spike_drone.jpg http://www.wizards.com/global/images/magic/general/spike_drone.jpg +grizzled_wolverine.jpg http://www.wizards.com/global/images/magic/general/grizzled_wolverine.jpg +havoc.jpg http://www.wizards.com/global/images/magic/general/havoc.jpg +mogg_sentry.jpg http://www.wizards.com/global/images/magic/general/mogg_sentry.jpg +taurean_mauler.jpg http://www.wizards.com/global/images/magic/general/taurean_mauler.jpg +kavu_monarch.jpg http://www.wizards.com/global/images/magic/general/kavu_monarch.jpg +flowstone_surge.jpg http://www.wizards.com/global/images/magic/general/flowstone_surge.jpg +anaba_spirit_crafter.jpg http://www.wizards.com/global/images/magic/general/anaba_spirit_crafter.jpg +hissing_iguanar.jpg http://www.wizards.com/global/images/magic/general/hissing_iguanar.jpg +insight.jpg http://www.wizards.com/global/images/magic/general/insight.jpg +sunken_city.jpg http://www.wizards.com/global/images/magic/general/sunken_city.jpg +deepchannel_mentor.jpg http://www.wizards.com/global/images/magic/general/deepchannel_mentor.jpg +sibilant_spirit.jpg http://www.wizards.com/global/images/magic/general/sibilant_spirit.jpg +fountain_watch.jpg http://www.wizards.com/global/images/magic/general/fountain_watch.jpg +warmth.jpg http://www.wizards.com/global/images/magic/general/warmth.jpg diff --git a/res/cards.txt b/res/cards.txt index f7e3f58dd26..e1e00c8a72d 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,38 @@ +Spike Feeder +1 G G +Creature Spike +no text +0/0 +Spike 2 + +Spike Weaver +2 G G +Creature Spike +no text +0/0 +Spike 3 + +Spike Worker +2 G +Creature Spike +no text +0/0 +Spike 2 + +Spike Colony +4 G +Creature Spike +no text +0/0 +Spike 4 + +Spike Drone +G +Creature Spike +no text +0/0 +Spike 1 + Grizzled Wolverine 1 R R Creature Wolverine diff --git a/res/common.txt b/res/common.txt index a373c357773..8835923a18e 100644 --- a/res/common.txt +++ b/res/common.txt @@ -1697,3 +1697,10 @@ Spinneret Sliver Keldon Marauders Furious Assault Night Soil +Spike Worker +Spike Colony +Spike Drone +Grizzled Wolverine +Anaba Spirit Crafter +Hissing Iguanar +Sunken City diff --git a/res/quest/common.txt b/res/quest/common.txt index a373c357773..8835923a18e 100644 --- a/res/quest/common.txt +++ b/res/quest/common.txt @@ -1697,3 +1697,10 @@ Spinneret Sliver Keldon Marauders Furious Assault Night Soil +Spike Worker +Spike Colony +Spike Drone +Grizzled Wolverine +Anaba Spirit Crafter +Hissing Iguanar +Sunken City diff --git a/res/quest/rare.txt b/res/quest/rare.txt index 814b57daddf..7cd46775feb 100644 --- a/res/quest/rare.txt +++ b/res/quest/rare.txt @@ -988,3 +988,9 @@ Rage Reflection Boartusk Liege Aysen Highway Hidden Path +Spike Weaver +Mogg Sentry +Taurean Mauler +Kavu Monarch +Sibilant Spirit +Fountain Watch diff --git a/res/quest/uncommon.txt b/res/quest/uncommon.txt index 7f3a3d24411..e1dcc809987 100644 --- a/res/quest/uncommon.txt +++ b/res/quest/uncommon.txt @@ -1043,3 +1043,9 @@ Bloodmark Mentor Kobold Drill Sergeant Kobold Taskmaster Necrogenesis +Spike Feeder +Havoc +Flowstone Surge +Insight +Deepchannel Mentor +Warmth diff --git a/res/rare.txt b/res/rare.txt index 814b57daddf..7cd46775feb 100644 --- a/res/rare.txt +++ b/res/rare.txt @@ -988,3 +988,9 @@ Rage Reflection Boartusk Liege Aysen Highway Hidden Path +Spike Weaver +Mogg Sentry +Taurean Mauler +Kavu Monarch +Sibilant Spirit +Fountain Watch diff --git a/res/uncommon.txt b/res/uncommon.txt index 7f3a3d24411..e1dcc809987 100644 --- a/res/uncommon.txt +++ b/res/uncommon.txt @@ -1043,3 +1043,9 @@ Bloodmark Mentor Kobold Drill Sergeant Kobold Taskmaster Necrogenesis +Spike Feeder +Havoc +Flowstone Surge +Insight +Deepchannel Mentor +Warmth diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index 2c5bb8fb27a..8fbf1a68ce2 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -3639,6 +3639,92 @@ public class CardFactory implements NewConstants { }//while shouldModular + int spike = hasKeyword(card, "Spike"); + if(spike != -1) { + String parse = card.getKeyword().get(spike).toString(); + card.removeIntrinsicKeyword(parse); + + final int m = Integer.parseInt(parse.substring(6)); + String t = card.getSpellText(); + if(!t.equals("")) t += "\r\n"; + card.setText(t + + parse + + " (This enters the battlefield with " + + m + + " +1/+1 counters on it.)"); + card.addComesIntoPlayCommand(new Command() { + private static final long serialVersionUID = -2292898970576123040L; + + public void execute() { + card.addCounter(Counters.P1P1, m); + } + }); + + final SpellAbility ability = new Ability(card, "2") { + @Override + public void resolve() { + if(card.getController().equals(Constant.Player.Computer)) { + CardList choices = new CardList(AllZone.Computer_Play.getCards()).filter(new CardListFilter() { + public boolean addCard(Card c) { + return c.isCreature(); + } + }); + if(choices.size() != 0) CardFactoryUtil.AI_getBestCreature(choices).addCounter( + Counters.P1P1, 1); + } else { + Card c = getTargetCard(); + c.addCounter(Counters.P1P1, 1); + } + }//resolve() + + @Override + public boolean canPlay() { + // stack peek is needed to prevent Spike Feeder from trying to double activate + SpellAbility sa; + for(int i = 0; i < AllZone.Stack.size(); i++) { + sa = AllZone.Stack.peek(i); + if(sa.getSourceCard().equals(card)) return false; + } + return (card.getCounters(Counters.P1P1) > 0); + } + + }; + Input target = new Input() { + private static final long serialVersionUID = 903928778649052032L; + + @Override + public void showMessage() { + AllZone.Display.showMessage("Select target creature for " + card.getName()); + ButtonUtil.enableOnlyCancel(); + } + + @Override + public void selectButtonCancel() { + stop(); + } + + @Override + public void selectCard(Card target, PlayerZone zone) { + // Choose a legal target, then sacrifice a creature + if(!CardFactoryUtil.canTarget(ability, target)) { + AllZone.Display.showMessage("Cannot target this card (Shroud? Protection?)."); + } else if(target.isCreature() && zone.is(Constant.Zone.Play)) { + card.subtractCounter(Counters.P1P1, 1); + ability.setTargetCard(target); + AllZone.Stack.add(ability); + AllZone.GameAction.checkStateEffects(); + stop(); + } + } + };//Input + + ability.setAfterPayMana(target); + ability.setStackDescription("Put a +1/+1 counter from " + card + " on target creature."); + ability.setDescription("2, Remove a +1/+1 counter: Add a +1/+1 counter to target creature"); + card.addSpellAbility(ability); + } // if Spike + + if(hasKeyword(card, "1, Sacrifice CARDNAME: Draw a card.") != -1) { int n = hasKeyword(card, "1, Sacrifice CARDNAME: Draw a card."); if(n != -1) { diff --git a/src/forge/CardFactory_Creatures.java b/src/forge/CardFactory_Creatures.java index e8a5269e549..d5a35afa4d3 100644 --- a/src/forge/CardFactory_Creatures.java +++ b/src/forge/CardFactory_Creatures.java @@ -20725,6 +20725,85 @@ public class CardFactory_Creatures { card.addDestroyCommand(destroy); }//*************** END ************ END ************************** + //*************** START *********** START ************************** + else if(cardName.equals("Spike Weaver")) { + final SpellAbility fog = new Ability(card, "1") { + @Override + public void resolve() { + AllZone.GameInfo.setPreventCombatDamageThisTurn(true); + }//resolve + + @Override + public boolean canPlay() { + // false until AI can activate things during human combat + return card.getCounters(Counters.P1P1) > 0; + } + + @Override + public boolean canPlayAI() { + // false until AI can activate things outside of main phases + return false; + } + };//SpellAbility + + Input runtime = new Input() { + private static final long serialVersionUID = -8190396950879103322L; + private boolean paid = false; + @Override + public void showMessage() { + if (!paid) + { + card.subtractCounter(Counters.P1P1, 1); + paid = true; + AllZone.Stack.add(fog); + stop(); + } + } + }; + + fog.setAfterPayMana(runtime); + fog.setDescription("1, Remove a +1/+1 counter: Prevent all combat damage that would be dealt this turn."); + fog.setStackDescription("Prevent all combat damage that would be dealt this turn."); + card.addSpellAbility(fog); + }//*************** END ************ END ************************** + + //*************** START *********** START ************************** + else if(cardName.equals("Spike Feeder")) { + final SpellAbility heal = new Ability(card, "0") { + // removing of a +1/+1 should be in the activation, but it doesn't work properly right now. + + @Override + public void resolve() { + if (card.getCounters(Counters.P1P1) > 0){ + card.subtractCounter(Counters.P1P1, 1); + PlayerLife life = AllZone.GameAction.getPlayerLife(getActivatingPlayer()); + life.addLife(2); + } + }//resolve + + @Override + public boolean canPlay() { + // stack peek is needed to prevent Spike Feeder from trying to double activate + SpellAbility sa; + for(int i = 0; i < AllZone.Stack.size(); i++) { + sa = AllZone.Stack.peek(i); + if(sa.getSourceCard().equals(card)) return false; + } + return card.getCounters(Counters.P1P1) > 0 && super.canPlay(); + } + + @Override + public boolean canPlayAI() { + // when should the AI sacrifice his feeder for health? + return card.getCounters(Counters.P1P1) > 0 && AllZone.Computer_Life.getLife() < 5; + } + };//SpellAbility + + heal.setDescription("Remove a +1/+1 counter: Gain 2 life."); + heal.setStackDescription("Gain 2 life"); + card.addSpellAbility(heal); + }//*************** END ************ END ************************** + //*************** START *********** START ************************** else if (cardName.equals("Yavimaya Elder")) {