From e01a177a09225558de9158a1e9e38473faebd643 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 02:52:47 +0000 Subject: [PATCH] - Added Sygg, River Guide and Laquatus's Champion. - Wordly Tutor / Sylvan Tutor and Eladamri's Call will now show the which creature the AI picked. - Relentless Rats P/T are set correctly according to all others in play now. - Added in a hack which should prevent lifegain from Essence Warden and Soul Warden together with some of the creature lands. - Removed text from the creaturelands' abilities, and added them correctly as the ability's description. --- res/cards.txt | 58 +++++++---- res/main.properties | 2 +- src/forge/CardFactory.java | 23 +++-- src/forge/CardFactoryUtil.java | 10 ++ src/forge/CardFactory_Creatures.java | 145 ++++++++++++++++++++++++++- src/forge/CardFactory_Lands.java | 4 +- src/forge/GameActionUtil.java | 41 +++++--- 7 files changed, 238 insertions(+), 45 deletions(-) diff --git a/res/cards.txt b/res/cards.txt index 7dad20d092a..1724189e6ad 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,17 @@ +Laquatus's Champion +4 B B +Creature Nightmare Horror +When Laquatus's Champion enters the battlefield, target player loses 6 life. When Laquatus's Champion leaves the battlefield, that player gains 6 life. +6/3 +RegenerateMe:B + +Sygg, River Guide +W U +Legendary Creature Merfolk Wizard +no text +2/2 +Islandwalk + Boggart Birth Rite B Tribal Sorcery Goblin @@ -2343,7 +2357,7 @@ Flame Jet 1 R Sorcery no text -spDamageTgtP:3 +spDamageP:3 Cycling:2 Slippery Bogle @@ -4286,7 +4300,7 @@ Ember Shot 6 R Instant Draw a card. -spDamageTgtCP:3 +spDamageCP:3 Cantrip Noble Steeds @@ -4299,7 +4313,7 @@ Zap 2 R Instant Draw a card. -spDamageTgtCP:1 +spDamageCP:1 Cantrip Black Lotus @@ -5283,7 +5297,7 @@ Breath of Malfegor 3 B R Instant no text -spDamageTgtP:5 +spDamageP:5 Cerodon Yearling R W @@ -5970,7 +5984,7 @@ Flame Javelin 2/R 2/R 2/R Instant no text -spDamageTgtCP:4 +spDamageCP:4 Wilt-Leaf Cavaliers GW GW GW @@ -6855,7 +6869,7 @@ Lava Axe 4 R Sorcery no text -spDamageTgtP:5 +spDamageP:5 Norwood Archers 3 G @@ -6995,56 +7009,56 @@ Bee Sting 3 G Sorcery no text -spDamageTgtCP:2 +spDamageCP:2 Cinder Storm 6 R Sorcery no text -spDamageTgtCP:7 +spDamageCP:7 Fire Ambush 1 R Sorcery no text -spDamageTgtCP:3 +spDamageCP:3 Ghostfire 2 R Instant no text -spDamageTgtCP:3 +spDamageCP:3 Ghostfire is colorless. Lightning Blast 3 R Instant no text -spDamageTgtCP:4 +spDamageCP:4 Scorching Spear R Sorcery no text -spDamageTgtCP:1 +spDamageCP:1 Searing Wind 8 R Instant no text -spDamageTgtCP:10 +spDamageCP:10 Tarfire R Tribal Instant Goblin no text -spDamageTgtCP:2 +spDamageCP:2 Unyaro Bee Sting 3 G Sorcery no text -spDamageTgtCP:2 +spDamageCP:2 Blistering Firecat 1 R R R @@ -7059,7 +7073,7 @@ Lava Spike R Sorcery no text -spDamageTgtP:3 +spDamageP:3 Caldera Hellion 3 R R @@ -7143,19 +7157,19 @@ Lightning Bolt R Instant no text -spDamageTgtCP:3 +spDamageCP:3 Volcanic Hammer 1 R Sorcery no text -spDamageTgtCP:3 +spDamageCP:3 Shock R Instant no text -spDamageTgtCP:2 +spDamageCP:2 Imperial Hellkite 5 R R @@ -11639,19 +11653,19 @@ At the beginning of your upkeep, if you control 10 or more Elves, you win the ga Treetop Village G Land -Treetop Village comes into play tapped. 1G: Treetop Village becomes a 3/3 green Ape creature with trample until end of turn. It's still a land. +Treetop Village comes into play tapped. tap: add G Forbidding Watchtower W Land -Forbidding Watchtower comes into play tapped. 1W: Forbidding Watchtower becomes a 1/5 white Soldier creature until end of turn. It's still a land. +Forbidding Watchtower comes into play tapped. tap: add W Faerie Conclave no cost Land -Faerie Conclave comes into play tapped. 1U: Faerie Conclave becomes a 2/1 blue Faerie creature with flying until end of turn. It's still a land. +Faerie Conclave comes into play tapped. tap: add U Empty the Warrens diff --git a/res/main.properties b/res/main.properties index 4c48e47a8c6..9039f520252 100644 --- a/res/main.properties +++ b/res/main.properties @@ -1,6 +1,6 @@ program/mail=mtgerror@yahoo.com program/forum=http://www.slightlymagic.net/forum/viewforum.php?f=26 -program/version=MTG Forge -- official beta: 09/11/25, SVN revision: 107 +program/version=MTG Forge -- official beta: 09/11/25, SVN revision: 117 tokens--file=AllTokens.txt diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index 57da26a352f..cee349830a4 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -10059,6 +10059,10 @@ public class CardFactory implements NewConstants { //move to top of library AllZone.Computer_Library.remove(c); AllZone.Computer_Library.add(c, 0); + + CardList list = new CardList(); + list.add(c); + AllZone.Display.getChoiceOptional("Computer picked:", list.toArray()); } }//computerResolve() public void humanResolve() @@ -11675,13 +11679,18 @@ public class CardFactory implements NewConstants { CardList list = new CardList(library); list = list.getType("Creature"); - - //pick best creature - Card c = CardFactoryUtil.AI_getBestCreature(list); - if(c == null) - c = library[0]; - AllZone.Computer_Library.remove(c); - AllZone.Computer_Hand.add(c); + if (list.size() > 0) + { + //pick best creature + Card c = CardFactoryUtil.AI_getBestCreature(list); + if(c == null) + c = list.get(0); + AllZone.Computer_Library.remove(c); + AllZone.Computer_Hand.add(c); + CardList cl = new CardList(); + cl.add(c); + AllZone.Display.getChoiceOptional("Computer picked:", cl.toArray()); + } } public boolean canPlay() { diff --git a/src/forge/CardFactoryUtil.java b/src/forge/CardFactoryUtil.java index 2202f2f82e5..b6503488eb9 100644 --- a/src/forge/CardFactoryUtil.java +++ b/src/forge/CardFactoryUtil.java @@ -2504,6 +2504,16 @@ public class CardFactoryUtil return false; } + public static ArrayList getCreatureLandNames() + { + String[] creatureLands = {"Faerie Conclave","Forbidding Watchtower","Treetop Village","Ghitu Encampment","Blinkmoth Nexus", + "Mishra's Factory"}; + final ArrayList list = new ArrayList(); + for(int i = 0; i < creatureLands.length; i++) + list.add(creatureLands[i]); + return list; + } + //may return null static public Card getRandomCard(CardList list) { diff --git a/src/forge/CardFactory_Creatures.java b/src/forge/CardFactory_Creatures.java index d2a1b9880f1..ee0078b1073 100644 --- a/src/forge/CardFactory_Creatures.java +++ b/src/forge/CardFactory_Creatures.java @@ -1,7 +1,6 @@ package forge; import java.util.ArrayList; - - +import java.util.HashMap; public class CardFactory_Creatures { @@ -14406,6 +14405,14 @@ public class CardFactory_Creatures { } public boolean canPlay() { + SpellAbility sa; + for (int i=0; i creatureMap = new HashMap(); + + final Ability ability = new Ability(card, "1 W") + { + public void resolve() + { + Card c = getTargetCard(); + String color = new String(); + if (AllZone.GameAction.isCardInPlay(c) && CardFactoryUtil.canTarget(card,c)){ + + Object o = AllZone.Display.getChoice("Choose mana color",Constant.Color.Colors); + color = (String)o; + c.addExtrinsicKeyword("Protection from " +color); + if (creatureMap.containsKey(c)) { + int size = creatureMap.get(c).length; + String[] newString = new String[size+1]; + + for (int i=0;i list = CardFactoryUtil.getCreatureLandNames(); + + current = current.filter(new CardListFilter() + { + public boolean addCard(Card c) + { + return c.isCreature() && !list.contains(c.getName()); + } + }); + + // Holds Essence Warden's in play CardList wardenList = current.getName("Essence Warden"); @@ -7246,11 +7256,9 @@ public class GameActionUtil // Gain life for new Essence Wardens n[0] += newWarden.size(); - final PlayerLife life = AllZone.GameAction - .getPlayerLife(wardenList.get(outer).getController()); + final PlayerLife life = AllZone.GameAction.getPlayerLife(wardenList.get(outer).getController()); SpellAbility ability = new Ability(new Card(), "0") { - public void resolve() { life.addLife(n[0]); @@ -7285,7 +7293,17 @@ public class GameActionUtil CardList current = new CardList(); current.addAll(AllZone.Human_Play.getCards()); current.addAll(AllZone.Computer_Play.getCards()); - current = current.getType("Creature"); + //current = current.getType("Creature"); + + final ArrayList list = CardFactoryUtil.getCreatureLandNames(); + + current = current.filter(new CardListFilter() + { + public boolean addCard(Card c) + { + return c.isCreature() && !list.contains(c.getName()); + } + }); // Holds Soul Warden's in play CardList wardenList = current.getName("Soul Warden"); @@ -7325,8 +7343,7 @@ public class GameActionUtil // Gain life for new Soul Wardens n[0] += newWarden.size(); - final PlayerLife life = AllZone.GameAction - .getPlayerLife(wardenList.get(outer).getController()); + final PlayerLife life = AllZone.GameAction.getPlayerLife(wardenList.get(outer).getController()); SpellAbility ability = new Ability(new Card(), "0") { @@ -8442,12 +8459,12 @@ public class GameActionUtil private int countOtherRats(Card c) { - PlayerZone play = AllZone.getZone(Constant.Zone.Play, c - .getController()); - CardList rats = new CardList(play.getCards()); + PlayerZone hplay = AllZone.getZone(Constant.Zone.Play, Constant.Player.Human); + PlayerZone cplay = AllZone.getZone(Constant.Zone.Play, Constant.Player.Computer); + CardList rats = new CardList(hplay.getCards()); + rats.addAll(cplay.getCards()); rats = rats.getName("Relentless Rats"); return rats.size()-1; - } public void execute()