From 924ec55ee4faf4b0d4bbf537112aa2e98603abd6 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 03:52:35 +0000 Subject: [PATCH] - Added slapshot5's code for City of Brass, Channel the Suns and Wall of Tears. - Added Borderland Ranger. --- res/card-pictures.txt | 2 ++ res/cards.txt | 28 +++++++++++++++ src/forge/Card.java | 4 ++- src/forge/CardFactory.java | 30 ++++++++++++++++ src/forge/CardFactory_Creatures.java | 51 ++++++++++++++++++++++++++++ src/forge/CombatUtil.java | 2 +- src/forge/GameActionUtil.java | 21 ++++++++++++ 7 files changed, 136 insertions(+), 2 deletions(-) diff --git a/res/card-pictures.txt b/res/card-pictures.txt index 95d3a6e3698..6ef2e56f7af 100644 --- a/res/card-pictures.txt +++ b/res/card-pictures.txt @@ -38,6 +38,8 @@ 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 +channel_the_suns.jpg http://www.wizards.com/global/images/magic/general/channel_the_suns.jpg +wall_of_tears.jpg http://www.wizards.com/global/images/magic/general/wall_of_tears.jpg goblin_assault.jpg http://www.wizards.com/global/images/magic/general/goblin_assault.jpg cagemail.jpg http://www.wizards.com/global/images/magic/general/cagemail.jpg cursed_flesh.jpg http://www.wizards.com/global/images/magic/general/cursed_flesh.jpg diff --git a/res/cards.txt b/res/cards.txt index 0d5f9bc35ef..0b243095628 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,31 @@ +Borderland Ranger +2 G +Creature Human Scout +When Borderland Ranger enters the battlefield, you may search your library for a basic land card, reveal it, and put it into your hand. If you do, shuffle your library. +2/2 + +City of Brass +no cost +Land +Whenever City of Brass becomes tapped, it deals 1 damage to you. +tap: add W +tap: add B +tap: add U +tap: add R +tap: add G + +Channel the Suns +3 G +Sorcery +Add W U B R G to your mana pool. + +Wall of Tears +1 U +Creature Wall +Whenever Wall of Tears blocks a creature, return that creature to its owner's hand at end of combat. +0/4 +Defender + Goblin Assault 2 R Enchantment diff --git a/src/forge/Card.java b/src/forge/Card.java index 2c56f73406b..5251859a4cb 100644 --- a/src/forge/Card.java +++ b/src/forge/Card.java @@ -1281,7 +1281,9 @@ public class Card extends MyObservable { } public void tap() { - setTapped(true); + if (isUntapped()) + GameActionUtil.executeTapSideEffects(this); + setTapped(true); } public void untap() { diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index 8e455a68b23..e3722f92836 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -17328,6 +17328,36 @@ public class CardFactory implements NewConstants { card.clearSpellAbility(); card.addSpellAbility(spell); }//*************** END ************ END ************************** + + + //*************** START *********** START ************************** + else if(cardName.equals("Channel the Suns")) { + final SpellAbility spell = new Spell(card) { + + private static final long serialVersionUID = -8509187529151755266L; + + @Override + public void resolve() { + Card mp = AllZone.ManaPool; + mp.addExtrinsicKeyword("ManaPool:W"); + mp.addExtrinsicKeyword("ManaPool:U"); + mp.addExtrinsicKeyword("ManaPool:B"); + mp.addExtrinsicKeyword("ManaPool:R"); + mp.addExtrinsicKeyword("ManaPool:G"); + } + + @Override + public boolean canPlayAI() { + return false; + } + }; + + spell.setStackDescription(cardName + " adds W U B R G to your mana pool"); + card.clearSpellAbility(); + card.addSpellAbility(spell); + + return card; + }//*************** END ************ END ************************** // Cards with Cycling abilities diff --git a/src/forge/CardFactory_Creatures.java b/src/forge/CardFactory_Creatures.java index cf457329371..e543bf8e990 100644 --- a/src/forge/CardFactory_Creatures.java +++ b/src/forge/CardFactory_Creatures.java @@ -16966,6 +16966,57 @@ public class CardFactory_Creatures { } //**************END****************END*********************** + + //*************** START *********** START ************************** + else if(cardName.equals("Borderland Ranger")) { + + final Ability ability = new Ability(card, "0") { + @Override + public void resolve() { + PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController()); + PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController()); + + CardList basic = new CardList(lib.getCards()); + basic = basic.getType("Basic"); + + if(card.getController().equals(Constant.Player.Computer)) { + if(basic.size() > 0) { + Card c = basic.get(0); + lib.remove(c); + hand.add(c); + + } + } else // human + { + if(basic.size() > 0) { + Object o = AllZone.Display.getChoiceOptional( + "Select Basic Land card to put into your hand: ", basic.toArray()); + if(o != null) { + Card c = (Card) o; + lib.remove(c); + hand.add(c); + } + } + } + AllZone.GameAction.shuffle(card.getController()); + }//resolve() + };//Ability + + Command fetchBasicLand = new Command() { + + private static final long serialVersionUID = 7042012311958529153L; + + public void execute() { + ability.setStackDescription(card.getName() + + " - search library for a basic land card and put it into your hand."); + AllZone.Stack.add(ability); + } + }; + card.addComesIntoPlayCommand(fetchBasicLand); + + }//*************** END ************ END ************************** + + // Cards with Cycling abilities // -1 means keyword "Cycling" not found if(shouldCycle(card) != -1) { diff --git a/src/forge/CombatUtil.java b/src/forge/CombatUtil.java index 2167e628e52..fbc71ac8537 100644 --- a/src/forge/CombatUtil.java +++ b/src/forge/CombatUtil.java @@ -1727,7 +1727,7 @@ public class CombatUtil { AllZone.EndOfCombat.addAt(atEOC); } - else if(b.getName().equals("AEther Membrane") || b.getName().equals("Aether Membrane")) { + else if(b.getName().equals("AEther Membrane") || b.getName().equals("Aether Membrane") || b.getName().equals("Wall of Tears")) { final Card attacker = a; final Ability ability = new Ability(b, "0") { @Override diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index 76415f51305..415d9489e28 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -102,6 +102,27 @@ public class GameActionUtil { // creats in play when aluren is there } + public static void executeTapSideEffects(Card c) { + + /* cards with Tap side effects can be listed here, just like in + * the CardFactory classes + */ + if(c.getName().equals("City of Brass")) { + final String player = c.getController(); + final Card crd = c; + Ability ability = new Ability(c, "0") { + @Override + public void resolve() { + AllZone.GameAction.addDamage(player, 1, crd); + } + };// Ability + ability.setStackDescription("City of Brass deals 1 damage to " + player); + AllZone.Stack.add(ability); + }//end City of Brass + + } + + public static void executePlayCardEffects(SpellAbility sa) { // experimental: // this method check for cards that have triggered abilities whenever a