From 13a2f48c0944d25c79454d32bb6f47722bf6efa7 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 12:52:45 +0000 Subject: [PATCH] - More cleanup. - Added Whimwader. --- .gitattributes | 1 + res/cardsfolder/imperial_edict.txt | 2 +- res/cardsfolder/slave_of_bolas.txt | 2 +- res/cardsfolder/whimwader.txt | 9 +++ src/forge/CardFactory_Sorceries.java | 99 +++------------------------- src/forge/CombatUtil.java | 8 ++- 6 files changed, 26 insertions(+), 95 deletions(-) create mode 100644 res/cardsfolder/whimwader.txt diff --git a/.gitattributes b/.gitattributes index af2b15c6326..139cc3ab1f4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5312,6 +5312,7 @@ res/cardsfolder/western_paladin.txt -text svneol=native#text/plain res/cardsfolder/wheel_and_deal.txt -text svneol=native#text/plain res/cardsfolder/wheel_of_fortune.txt -text svneol=native#text/plain res/cardsfolder/wheel_of_torture.txt -text svneol=native#text/plain +res/cardsfolder/whimwader.txt -text svneol=native#text/plain res/cardsfolder/whip_sergeant.txt -text svneol=native#text/plain res/cardsfolder/whip_spine_drake.txt -text svneol=native#text/plain res/cardsfolder/whipcorder.txt -text svneol=native#text/plain diff --git a/res/cardsfolder/imperial_edict.txt b/res/cardsfolder/imperial_edict.txt index 008dd488730..79e39654c72 100644 --- a/res/cardsfolder/imperial_edict.txt +++ b/res/cardsfolder/imperial_edict.txt @@ -2,7 +2,7 @@ Name:Imperial Edict ManaCost:1 B Types:Sorcery Text:no text -A:SP$Sacrifice | Cost$ 1 B | ValidTgts$ Opponent | SacValid$ Creature | SacMessage$ Creature | SpellDescription$ Target player sacrifices a creature. +A:SP$Sacrifice | Cost$ 1 B | ValidTgts$ Opponent | SacValid$ Creature | SacMessage$ Creature | SpellDescription$ Target opponent sacrifices a creature. SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/imperial_edict.jpg SetInfo:POR|Common|http://magiccards.info/scans/en/p3k/77.jpg diff --git a/res/cardsfolder/slave_of_bolas.txt b/res/cardsfolder/slave_of_bolas.txt index cf413fef480..450bd628631 100644 --- a/res/cardsfolder/slave_of_bolas.txt +++ b/res/cardsfolder/slave_of_bolas.txt @@ -2,7 +2,7 @@ Name:Slave of Bolas ManaCost:3 UR B Types:Sorcery Text:no text -A:SP$GainControl|Cost$3 UR B|Tgt$TgtC|Untap$True|AddKWs$Haste & At the beginning of the end step, sacrifice CARDNAME. |SpellDescription$Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn. +A:SP$GainControl | Cost$ 3 UR B | Tgt$ TgtC | Untap$ True | AddKWs$ Haste & HIDDEN At the beginning of the end step, sacrifice CARDNAME. |SpellDescription$ Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn. SVar:PlayMain1:TRUE SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/slave_of_bolas.jpg diff --git a/res/cardsfolder/whimwader.txt b/res/cardsfolder/whimwader.txt new file mode 100644 index 00000000000..b598c53d859 --- /dev/null +++ b/res/cardsfolder/whimwader.txt @@ -0,0 +1,9 @@ +Name:Whimwader +ManaCost:4 U +Types:Creature Elemental +Text:no text +PT:6/4 +K:CARDNAME can't attack unless defending player controls a blue permanent. +SVar:Rarity:Common +SVar:Picture:http://www.wizards.com/global/images/magic/general/whimwader.jpg +End \ No newline at end of file diff --git a/src/forge/CardFactory_Sorceries.java b/src/forge/CardFactory_Sorceries.java index be907f0452a..35abded75a2 100644 --- a/src/forge/CardFactory_Sorceries.java +++ b/src/forge/CardFactory_Sorceries.java @@ -6525,7 +6525,6 @@ public class CardFactory_Sorceries { card.addSpellAbility(spell); }//*************** END ************ END ************************** - //*************** START *********** START ************************** else if(cardName.equals("Stitch Together")) { @@ -6623,95 +6622,6 @@ public class CardFactory_Sorceries { spell.setBeforePayMana(target); }//*************** END ************ END ************************** - /* - //*************** START *********** START ************************** - else if (cardName.equals("Natural Order")){ - final SpellAbility spell = new Spell(card) { - - private static final long serialVersionUID = -6598323179507468746L; - - @Override - public void resolve() { - Player controller = card.getController(); - - PlayerZone battlezone = AllZone.getZone(Constant.Zone.Play, controller); - PlayerZone library = AllZone.getZone(Constant.Zone.Library, controller); - - CardList list = new CardList(library.getCards()); - list = list.getType("Creature").getColor("G"); - - if(list.size() == 0) return; - - if(controller.equals(AllZone.HumanPlayer)) { - - Card c = AllZone.Display.getChoiceOptional("Choose a green creature", list.toArray()); - if(c != null) { - list.remove(c); - library.remove(c); - battlezone.add(c); - - }//if - } else { - CardList greenlist = new CardList(library.getCards()); - greenlist = greenlist.getType("Creature").getColor("G"); - Card c = CardFactoryUtil.AI_getBestCreature(greenlist); - if(c != null) { - list.remove(c); - library.remove(c); - battlezone.add(c); - - }//if - } - } // resolve - - public void chooseTargetAI() { - Card target = null; - target = CardFactoryUtil.AI_getWorstCreature(new CardList(AllZone.getZone(Constant.Zone.Play, AllZone.ComputerPlayer).getCards())); - setTargetCard(target); - AllZone.GameAction.sacrifice(getTargetCard()); - }//chooseTargetAI() - - - public boolean canPlayAI() - { - PlayerZone library = AllZone.getZone(Constant.Zone.Library, AllZone.ComputerPlayer); - CardList list = new CardList(library.getCards()); - list = list.getType("Creature").getColor("G"); - PlayerZone inPlay = AllZone.getZone(Constant.Zone.Play, AllZone.ComputerPlayer); - CardList listInPlay = new CardList(inPlay.getCards()); - listInPlay = listInPlay.getType("Creature").getColor("G"); - Card inPlayCreature = CardFactoryUtil.AI_getWorstCreature(new CardList(AllZone.getZone(Constant.Zone.Play, AllZone.ComputerPlayer).getCards())); - Card inLibraryCreature = CardFactoryUtil.AI_getBestCreature(new CardList(AllZone.getZone(Constant.Zone.Library, AllZone.ComputerPlayer).getCards())); - return (list.size() > 0) && (listInPlay.size() > 0) && (inPlayCreature.getNetAttack() < inLibraryCreature.getNetAttack()); - } - };//SpellAbility - Input runtime = new Input() { - - private static final long serialVersionUID = -7551607354431165941L; - - @Override - public void showMessage() { - Player player = card.getController(); - PlayerZone play = AllZone.getZone(Constant.Zone.Play, player); - CardList choice = new CardList(play.getCards()); - choice = choice.getType("Creature").getColor("G"); - - boolean free = false; - if (this.isFree()) - free = true; - - if (player.equals(AllZone.HumanPlayer)) { - stopSetNext(CardFactoryUtil.input_sacrifice(spell, choice, "Select a green creature to sacrifice.", free)); - } - } - }; - - card.clearSpellAbility(); - card.addSpellAbility(spell); - spell.setBeforePayMana(runtime); - - } //*************** END ************ END ************************** - */ //*************** START ********** START ************************* else if (cardName.equals("Destructive Force") || cardName.equals("Wildfire")) @@ -6923,6 +6833,7 @@ public class CardFactory_Sorceries { spell.setStackDescription(sb.toString()); }//*************** END ************ END ************************** + //*************** START *********** START ************************** else if(cardName.equals("Ashes to Ashes")) { final Card[] target = new Card[2]; @@ -7020,7 +6931,6 @@ public class CardFactory_Sorceries { }//*************** END ************ END ************************** - //*************** START *********** START ************************** else if(cardName.equals("Take Possession")) { final SpellAbility spell = new Spell(card) { @@ -7209,6 +7119,7 @@ public class CardFactory_Sorceries { card.addSpellAbility(spell); }// *************** END ************ END ************************** + //*************** START *********** START ************************** else if(cardName.equals("Last Stand")) { /* @@ -7270,6 +7181,7 @@ public class CardFactory_Sorceries { spell.setBeforePayMana(CardFactoryUtil.input_targetCreature(spell)); }//*************** END ************ END ************************** + //*************** START *********** START ************************** else if(cardName.equals("Overwhelming Stampede")) { /* @@ -7332,6 +7244,7 @@ public class CardFactory_Sorceries { card.setSVar("PlayMain1", "TRUE"); }//*************** END ************ END ************************** + //*************** START *********** START ************************** else if(cardName.equals("Winds of Change")) { /* @@ -7378,6 +7291,7 @@ public class CardFactory_Sorceries { card.addSpellAbility(spell); }//*************** END ************ END ************************** + //*************** START *********** START ************************** else if(cardName.equals("Nature's Resurgence")) { /* @@ -7405,6 +7319,7 @@ public class CardFactory_Sorceries { card.addSpellAbility(spell); }//*************** END ************ END ************************** + //*************** START *********** START ************************** else if(cardName.equals("All Hallow's Eve")) { /* @@ -7505,6 +7420,7 @@ public class CardFactory_Sorceries { card.addSpellAbility(spell); }//*************** END ************ END ************************** + //*************** START *********** START ************************** else if(cardName.equals("Death Cloud")) { /* @@ -7551,6 +7467,7 @@ public class CardFactory_Sorceries { card.addSpellAbility(spell); }//*************** END ************ END ************************** + //*************** START *********** START ************************** else if(cardName.equals("Channel")) { /* diff --git a/src/forge/CombatUtil.java b/src/forge/CombatUtil.java index 3514ea9beb2..c8b53b9aaec 100644 --- a/src/forge/CombatUtil.java +++ b/src/forge/CombatUtil.java @@ -298,11 +298,10 @@ public class CombatUtil { if(AllZoneUtil.isCardInPlay("Peacekeeper")) return false; - if(AllZoneUtil.isCardInPlay("Moat") || AllZoneUtil.isCardInPlay("Magus of the Moat") + if((AllZoneUtil.isCardInPlay("Moat") || AllZoneUtil.isCardInPlay("Magus of the Moat")) && !c.getKeyword().contains("Flying")) return false; // CARDNAME can't attack if defending player controls an untapped creature with power ... - final int powerLimit[] = {0}; int keywordPosition = 0; boolean hasKeyword = false; @@ -355,6 +354,11 @@ public class CombatUtil { temp = list.getType("Forest"); if(temp.isEmpty()) return false; } + + if(c.getKeyword().contains("CARDNAME can't attack unless defending player controls a blue permanent.")) { + temp = list.getColor("Blue"); + if(temp.isEmpty()) return false; + } if(c.getName().equals("Harbor Serpent")) { CardList allislands = AllZoneUtil.getTypeInPlay("Island");