diff --git a/res/card-pictures.txt b/res/card-pictures.txt index dcb5fd79251..a678dc20913 100644 --- a/res/card-pictures.txt +++ b/res/card-pictures.txt @@ -18,6 +18,7 @@ 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 +phantom_centaur.jpg http://www.wizards.com/global/images/magic/general/phantom_centaur.jpg phantom_nishoba.jpg http://www.wizards.com/global/images/magic/general/phantom_nishoba.jpg iona_shield_of_emeria.jpg http://www.wizards.com/global/images/magic/general/iona_shield_of_emeria.jpg gaddock_teeg.jpg http://www.wizards.com/global/images/magic/general/gaddock_teeg.jpg diff --git a/res/cards.txt b/res/cards.txt index f4836a1ecb7..94f275d1c40 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,10 @@ +Phantom Centaur +2 G G +Creature Centaur Spirit +Phantom Centaur enters the battlefield with three +1/+1 counters on it. If damage would be dealt to Phantom Centaur, prevent that damage. Remove a +1/+1 counter from Phantom Centaur. +2/0 +Protection from black + Phantom Nishoba 5 G W Creature Cat Beast Spirit diff --git a/res/main.properties b/res/main.properties index b5f890ce204..fdc9b817364 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: 141 +program/version=Forge -- official beta: 09/11/25, SVN revision: 142 tokens--file=AllTokens.txt diff --git a/src/forge/CardFactoryUtil.java b/src/forge/CardFactoryUtil.java index b6503488eb9..90df1799c47 100644 --- a/src/forge/CardFactoryUtil.java +++ b/src/forge/CardFactoryUtil.java @@ -2374,6 +2374,52 @@ public class CardFactoryUtil return s; } + public static String getMostProminentColor(CardList list) + { + + Map map = new HashMap(); + String s = ""; + + for (int i=0;i colorList = CardUtil.getColors(c); + + for (String color : colorList) + { + if (color.equals("colorless")) + ; + else if (!map.containsKey(color)) + map.put(color, 1); + else + { + map.put(color, map.get(color)+1); + } + } + }//for + + int max = 0; + String maxColor = ""; + + for (int i=0;i iter = map.keySet().iterator(); + while(iter.hasNext()) { + String color = iter.next(); + System.out.println(color + " - " + map.get(color)); + + if (max < map.get(color)) + { + max = map.get(color); + maxColor = color; + } + } + } + s = maxColor; + return s; + } + + public static String chooseCreatureTypeAI(Card c) { diff --git a/src/forge/CardFactory_Creatures.java b/src/forge/CardFactory_Creatures.java index 7ba7a5e1eed..5d1b91c099f 100644 --- a/src/forge/CardFactory_Creatures.java +++ b/src/forge/CardFactory_Creatures.java @@ -17718,7 +17718,7 @@ public class CardFactory_Creatures { String color = new String(); String[] colors = Constant.Color.Colors; - colors[colors.length-1] = ""; + colors[colors.length-1] = null; Object o = AllZone.Display.getChoice("Choose color", colors); color = (String)o; @@ -17726,7 +17726,24 @@ public class CardFactory_Creatures { } else { + PlayerZone lib = AllZone.getZone(Constant.Zone.Library, Constant.Player.Human); + PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, Constant.Player.Human); + CardList list = new CardList(); + list.addAll(lib.getCards()); + list.addAll(hand.getCards()); + if (list.size() > 0) + { + String color = CardFactoryUtil.getMostProminentColor(list); + if (!color.equals("")) + card.setChosenColor(color); + else + card.setChosenColor("black"); + } + else + { + card.setChosenColor("black"); + } } } }; @@ -17743,6 +17760,7 @@ public class CardFactory_Creatures { card.addComesIntoPlayCommand(comesIntoPlay); }//*************** END ************ END ************************** + //*************** START *********** START ************************** else if (cardName.equals("Phantom Nishoba")) { final Card newCard = new Card() @@ -17786,6 +17804,48 @@ public class CardFactory_Creatures { return newCard; } + //*************** START *********** START ************************** + else if (cardName.equals("Phantom Centaur")) + { + final Card newCard = new Card() + { + public void addDamage(final int n) + { + this.subtractCounter(Counters.P1P1, 1); + } + }; + newCard.setOwner(card.getOwner()); + newCard.setController(card.getController()); + + newCard.setManaCost(card.getManaCost()); + newCard.setName(card.getName()); + newCard.addType("Creature"); + newCard.addType("Centaur"); + newCard.addType("Spirit"); + newCard.setText(card.getSpellText()); + newCard.setBaseAttack(card.getBaseAttack()); + newCard.setBaseDefense(card.getBaseDefense()); + + newCard.addIntrinsicKeyword("Protection from black"); + + newCard.addSpellAbility(new Spell_Permanent(newCard)); + + Command comesIntoPlay = new Command() + { + + private static final long serialVersionUID = 4217898403350036317L; + + public void execute() + { + newCard.addCounter(Counters.P1P1, 3); + } + };//Command + + newCard.addComesIntoPlayCommand(comesIntoPlay); + + return newCard; + }//*************** END ************ END ************************** + // Cards with Cycling abilities // -1 means keyword "Cycling" not found diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index ac87ec660d8..050f464e6f2 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -9506,7 +9506,13 @@ public class GameActionUtil PlayerZone play = AllZone.getZone(Constant.Zone.Play, c .getController()); CardList cenns = new CardList(play.getCards()); - cenns = cenns.getName("Wizened Cenn"); + cenns = cenns.filter(new CardListFilter() + { + public boolean addCard(Card c) + { + return c.getName().equals("Wizened Cenn") && (c.getType().contains("Kithkin") ||c.getKeyword().contains("Changeling")); + } + }); return cenns.size()-1; } @@ -9514,7 +9520,6 @@ public class GameActionUtil public void execute() { - CardList creature = new CardList(); creature.addAll(AllZone.Human_Play.getCards()); creature.addAll(AllZone.Computer_Play.getCards());