From 943057865aa60a5fcb8c91cd2b7330c7b9bf0ed9 Mon Sep 17 00:00:00 2001 From: Sol Date: Tue, 23 Aug 2011 04:25:00 +0000 Subject: [PATCH] - Added Support for XChoice to CostRemoveCounter - Converted Mana Batteries and FE Storage Lands to Script --- res/cardsfolder/b/black_mana_battery.txt | 4 ++++ res/cardsfolder/b/blue_mana_battery.txt | 4 ++++ res/cardsfolder/b/bottomless_vault.txt | 7 ++++++- res/cardsfolder/d/dwarven_hold.txt | 7 ++++++- res/cardsfolder/g/green_mana_battery.txt | 4 ++++ res/cardsfolder/h/hollow_trees.txt | 7 ++++++- res/cardsfolder/i/icatian_store.txt | 7 ++++++- res/cardsfolder/r/red_mana_battery.txt | 4 ++++ res/cardsfolder/s/sand_silos.txt | 7 ++++++- res/cardsfolder/w/white_mana_battery.txt | 4 ++++ src/main/java/forge/Upkeep.java | 21 +------------------ .../card/cardFactory/AbstractCardFactory.java | 3 ++- .../card/cardFactory/CardFactory_Lands.java | 4 ++-- .../forge/card/cost/CostRemoveCounter.java | 6 +++++- 14 files changed, 60 insertions(+), 29 deletions(-) diff --git a/res/cardsfolder/b/black_mana_battery.txt b/res/cardsfolder/b/black_mana_battery.txt index eb488939f6c..ec237d231ef 100644 --- a/res/cardsfolder/b/black_mana_battery.txt +++ b/res/cardsfolder/b/black_mana_battery.txt @@ -3,6 +3,10 @@ ManaCost:4 Types:Artifact Text:no text A:AB$ PutCounter | Cost$ 2 T | CounterType$ CHARGE | CounterNum$ 1 | SpellDescription$ Put a charge counter on CARDNAME. +A:AB$ Mana | Cost$ T SubCounter | Produced$ U | Amount$ Y | CostDesc$ Tap, Remove any number of charge counters from CARDNAME: | SpellDescription$ Add B to your mana pool, then add an additional B to your mana pool for each charge counter removed this way. +SVar:Y:Number$1/Plus.ChosenX +SVar:X:XChoice +#ChosenX SVar created by Cost payment SVar:RemRandomDeck:True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/black_mana_battery.jpg diff --git a/res/cardsfolder/b/blue_mana_battery.txt b/res/cardsfolder/b/blue_mana_battery.txt index 36a01be6a06..fe6a0920d37 100644 --- a/res/cardsfolder/b/blue_mana_battery.txt +++ b/res/cardsfolder/b/blue_mana_battery.txt @@ -3,6 +3,10 @@ ManaCost:4 Types:Artifact Text:no text A:AB$ PutCounter | Cost$ 2 T | CounterType$ CHARGE | CounterNum$ 1 | SpellDescription$ Put a charge counter on CARDNAME. +A:AB$ Mana | Cost$ T SubCounter | Produced$ U | Amount$ Y | CostDesc$ Tap, Remove any number of charge counters from CARDNAME: | SpellDescription$ Add U to your mana pool, then add an additional U to your mana pool for each charge counter removed this way. +SVar:Y:Number$1/Plus.ChosenX +SVar:X:XChoice +#ChosenX SVar created by Cost payment SVar:RemRandomDeck:True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/blue_mana_battery.jpg diff --git a/res/cardsfolder/b/bottomless_vault.txt b/res/cardsfolder/b/bottomless_vault.txt index 7337932994c..f8f50d387b5 100644 --- a/res/cardsfolder/b/bottomless_vault.txt +++ b/res/cardsfolder/b/bottomless_vault.txt @@ -1,9 +1,14 @@ Name:Bottomless Vault ManaCost:no cost Types:Land -Text:At the beginning of your upkeep, if CARDNAME is tapped, put a storage counter on it. +Text:no text K:CARDNAME enters the battlefield tapped. K:You may choose not to untap CARDNAME during your untap step. +T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | IsPresent$ Card.Self+tapped | Execute$ TrigStore | TriggerDescription$ At the beginning of your upkeep, if CARDNAME is tapped, put a storage counter on it. +SVar:TrigStore:DB$PutCounter | Defined$ Self | CounterType$ STORAGE | CounterNum$ 1 +A:AB$ Mana | Cost$ T SubCounter | Produced$ B | Amount$ ChosenX | CostDesc$ Tap, Remove any number of storage counters from CARDNAME: | SpellDescription$ Add B to your mana pool for each storage counter removed this way. +SVar:X:XChoice +#ChosenX SVar created by Cost payment SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/bottomless_vault.jpg diff --git a/res/cardsfolder/d/dwarven_hold.txt b/res/cardsfolder/d/dwarven_hold.txt index 7179a5c9c65..0d1450772b9 100644 --- a/res/cardsfolder/d/dwarven_hold.txt +++ b/res/cardsfolder/d/dwarven_hold.txt @@ -1,9 +1,14 @@ Name:Dwarven Hold ManaCost:no cost Types:Land -Text:At the beginning of your upkeep, if CARDNAME is tapped, put a storage counter on it. +Text:no text K:CARDNAME enters the battlefield tapped. K:You may choose not to untap CARDNAME during your untap step. +T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | IsPresent$ Card.Self+tapped | Execute$ TrigStore | TriggerDescription$ At the beginning of your upkeep, if CARDNAME is tapped, put a storage counter on it. +SVar:TrigStore:DB$PutCounter | Defined$ Self | CounterType$ STORAGE | CounterNum$ 1 +A:AB$ Mana | Cost$ T SubCounter | Produced$ R | Amount$ ChosenX | CostDesc$ Tap, Remove any number of storage counters from CARDNAME: | SpellDescription$ Add R to your mana pool for each storage counter removed this way. +SVar:X:XChoice +#ChosenX SVar created by Cost payment SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/dwarven_hold.jpg diff --git a/res/cardsfolder/g/green_mana_battery.txt b/res/cardsfolder/g/green_mana_battery.txt index 3f330352c24..4697fdd50e1 100644 --- a/res/cardsfolder/g/green_mana_battery.txt +++ b/res/cardsfolder/g/green_mana_battery.txt @@ -3,6 +3,10 @@ ManaCost:4 Types:Artifact Text:no text A:AB$ PutCounter | Cost$ 2 T | CounterType$ CHARGE | CounterNum$ 1 | SpellDescription$ Put a charge counter on CARDNAME. +A:AB$ Mana | Cost$ T SubCounter | Produced$ G | Amount$ Y | CostDesc$ Tap, Remove any number of charge counters from CARDNAME: | SpellDescription$ Add G to your mana pool, then add an additional G to your mana pool for each charge counter removed this way. +SVar:Y:Number$1/Plus.ChosenX +SVar:X:XChoice +#ChosenX SVar created by Cost payment SVar:RemRandomDeck:True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/green_mana_battery.jpg diff --git a/res/cardsfolder/h/hollow_trees.txt b/res/cardsfolder/h/hollow_trees.txt index 26ec5db806c..1644475c3a8 100644 --- a/res/cardsfolder/h/hollow_trees.txt +++ b/res/cardsfolder/h/hollow_trees.txt @@ -1,9 +1,14 @@ Name:Hollow Trees ManaCost:no cost Types:Land -Text:At the beginning of your upkeep, if CARDNAME is tapped, put a storage counter on it. +Text:no text K:CARDNAME enters the battlefield tapped. K:You may choose not to untap CARDNAME during your untap step. +T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | IsPresent$ Card.Self+tapped | Execute$ TrigStore | TriggerDescription$ At the beginning of your upkeep, if CARDNAME is tapped, put a storage counter on it. +SVar:TrigStore:DB$PutCounter | Defined$ Self | CounterType$ STORAGE | CounterNum$ 1 +A:AB$ Mana | Cost$ T SubCounter | Produced$ G | Amount$ ChosenX | CostDesc$ Tap, Remove any number of storage counters from CARDNAME: | SpellDescription$ Add G to your mana pool for each storage counter removed this way. +SVar:X:XChoice +#ChosenX SVar created by Cost payment SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/hollow_trees.jpg diff --git a/res/cardsfolder/i/icatian_store.txt b/res/cardsfolder/i/icatian_store.txt index 169c00797ee..17aeac32288 100644 --- a/res/cardsfolder/i/icatian_store.txt +++ b/res/cardsfolder/i/icatian_store.txt @@ -1,9 +1,14 @@ Name:Icatian Store ManaCost:no cost Types:Land -Text:At the beginning of your upkeep, if CARDNAME is tapped, put a storage counter on it. +Text:no text K:CARDNAME enters the battlefield tapped. K:You may choose not to untap CARDNAME during your untap step. +T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | IsPresent$ Card.Self+tapped | Execute$ TrigStore | TriggerDescription$ At the beginning of your upkeep, if CARDNAME is tapped, put a storage counter on it. +SVar:TrigStore:DB$PutCounter | Defined$ Self | CounterType$ STORAGE | CounterNum$ 1 +A:AB$ Mana | Cost$ T SubCounter | Produced$ W | Amount$ ChosenX | CostDesc$ Tap, Remove any number of storage counters from CARDNAME: | SpellDescription$ Add W to your mana pool for each storage counter removed this way. +SVar:X:XChoice +#ChosenX SVar created by Cost payment SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/icatian_store.jpg diff --git a/res/cardsfolder/r/red_mana_battery.txt b/res/cardsfolder/r/red_mana_battery.txt index b6fe072f2da..1b8616eac9d 100644 --- a/res/cardsfolder/r/red_mana_battery.txt +++ b/res/cardsfolder/r/red_mana_battery.txt @@ -3,6 +3,10 @@ ManaCost:4 Types:Artifact Text:no text A:AB$ PutCounter | Cost$ 2 T | CounterType$ CHARGE | CounterNum$ 1 | SpellDescription$ Put a charge counter on CARDNAME. +A:AB$ Mana | Cost$ T SubCounter | Produced$ R | Amount$ Y | CostDesc$ Tap, Remove any number of charge counters from CARDNAME: | SpellDescription$ Add R to your mana pool, then add an additional R to your mana pool for each charge counter removed this way. +SVar:Y:Number$1/Plus.ChosenX +SVar:X:XChoice +#ChosenX SVar created by Cost payment SVar:RemRandomDeck:True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/red_mana_battery.jpg diff --git a/res/cardsfolder/s/sand_silos.txt b/res/cardsfolder/s/sand_silos.txt index 3f1b7752691..85d70898b2f 100644 --- a/res/cardsfolder/s/sand_silos.txt +++ b/res/cardsfolder/s/sand_silos.txt @@ -1,9 +1,14 @@ Name:Sand Silos ManaCost:no cost Types:Land -Text:At the beginning of your upkeep, if CARDNAME is tapped, put a storage counter on it. +Text:no text K:CARDNAME enters the battlefield tapped. K:You may choose not to untap CARDNAME during your untap step. +T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | IsPresent$ Card.Self+tapped | Execute$ TrigStore | TriggerDescription$ At the beginning of your upkeep, if CARDNAME is tapped, put a storage counter on it. +SVar:TrigStore:DB$PutCounter | Defined$ Self | CounterType$ STORAGE | CounterNum$ 1 +A:AB$ Mana | Cost$ T SubCounter | Produced$ U | Amount$ ChosenX | CostDesc$ Tap, Remove any number of storage counters from CARDNAME: | SpellDescription$ Add U to your mana pool for each storage counter removed this way. +SVar:X:XChoice +#ChosenX SVar created by Cost payment SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/sand_silos.jpg diff --git a/res/cardsfolder/w/white_mana_battery.txt b/res/cardsfolder/w/white_mana_battery.txt index 261cfc86746..7565788af28 100644 --- a/res/cardsfolder/w/white_mana_battery.txt +++ b/res/cardsfolder/w/white_mana_battery.txt @@ -3,6 +3,10 @@ ManaCost:4 Types:Artifact Text:no text A:AB$ PutCounter | Cost$ 2 T | CounterType$ CHARGE | CounterNum$ 1 | SpellDescription$ Put a charge counter on CARDNAME. +A:AB$ Mana | Cost$ T SubCounter | Produced$ W | Amount$ Y | CostDesc$ Tap, Remove any number of charge counters from CARDNAME: | SpellDescription$ Add W to your mana pool, then add an additional W to your mana pool for each charge counter removed this way. +SVar:Y:Number$1/Plus.ChosenX +SVar:X:XChoice +#ChosenX SVar created by Cost payment SVar:RemRandomDeck:True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/white_mana_battery.jpg diff --git a/src/main/java/forge/Upkeep.java b/src/main/java/forge/Upkeep.java index 3cf9aa33e20..395bde10772 100644 --- a/src/main/java/forge/Upkeep.java +++ b/src/main/java/forge/Upkeep.java @@ -78,7 +78,6 @@ public class Upkeep implements java.io.Serializable { upkeep_Lord_of_the_Pit(); upkeep_Drop_of_Honey(); upkeep_Demonic_Hordes(); - upkeep_Fallen_Empires_Storage_Lands(); upkeep_Carnophage(); upkeep_Sangrophage(); upkeep_Dega_Sanctuary(); @@ -2915,23 +2914,5 @@ public class Upkeep implements java.io.Serializable { if (AllZone.getComputerPlayer().getLife() > 2) player.loseLife(2, c); else c.tap(); } - }// upkeep_Carnophage - - /** - *

upkeep_Fallen_Empires_Storage_Lands.

- */ - private static void upkeep_Fallen_Empires_Storage_Lands() { - final Player player = AllZone.getPhase().getPlayerTurn(); - - CardList all = AllZoneUtil.getPlayerCardsInPlay(player, "Bottomless Vault"); - all.addAll(AllZoneUtil.getPlayerCardsInPlay(player, "Dwarven Hold")); - all.addAll(AllZoneUtil.getPlayerCardsInPlay(player, "Hollow Trees")); - all.addAll(AllZoneUtil.getPlayerCardsInPlay(player, "Icatian Store")); - all.addAll(AllZoneUtil.getPlayerCardsInPlay(player, "Sand Silos")); - - for (Card land : all) { - if (land.isTapped()) land.addCounter(Counters.STORAGE, 1); - } - } //upkeep_Fallen_Empires_Storage_Lands - + }// upkeep_Carnophage }//end class Upkeep diff --git a/src/main/java/forge/card/cardFactory/AbstractCardFactory.java b/src/main/java/forge/card/cardFactory/AbstractCardFactory.java index 2fa153dc33e..c7502f3592c 100644 --- a/src/main/java/forge/card/cardFactory/AbstractCardFactory.java +++ b/src/main/java/forge/card/cardFactory/AbstractCardFactory.java @@ -31,7 +31,6 @@ import forge.game.GameLossReason; import forge.gui.GuiUtils; import forge.gui.input.Input; import forge.gui.input.Input_PayManaCost; -import forge.gui.input.Input_PayManaCostUtil; import forge.properties.ForgeProps; import forge.properties.NewConstants; @@ -1344,6 +1343,7 @@ public abstract class AbstractCardFactory implements NewConstants, CardFactoryIn //*************** START ************ START ************************** + /* else if (cardName.equals("Black Mana Battery") || cardName.equals("Blue Mana Battery") || cardName.equals("Green Mana Battery") || cardName.equals("Red Mana Battery") || cardName.equals("White Mana Battery")) @@ -1420,6 +1420,7 @@ public abstract class AbstractCardFactory implements NewConstants, CardFactoryIn addMana.setBeforePayMana(runtime); card.addSpellAbility(addMana); } + */ //*************** END ************ END ************************** diff --git a/src/main/java/forge/card/cardFactory/CardFactory_Lands.java b/src/main/java/forge/card/cardFactory/CardFactory_Lands.java index 9b88eea07ea..88fa965f5bf 100644 --- a/src/main/java/forge/card/cardFactory/CardFactory_Lands.java +++ b/src/main/java/forge/card/cardFactory/CardFactory_Lands.java @@ -545,7 +545,7 @@ class CardFactory_Lands { card.addComesIntoPlayCommand(comesIntoPlay); }//*************** END ************ END ************************** - +/* //*************** START ************ START ************************** else if (cardName.equals("Bottomless Vault") || cardName.equals("Dwarven Hold") || cardName.equals("Hollow Trees") || cardName.equals("Icatian Store") @@ -641,7 +641,7 @@ class CardFactory_Lands { card.addSpellAbility(addMana); card.addSpellAbility(abMana); }//*************** END ************ END ************************** - +*/ //*************** START *********** START ************************** //Lorwyn Dual Lands, and a couple Morningtide... diff --git a/src/main/java/forge/card/cost/CostRemoveCounter.java b/src/main/java/forge/card/cost/CostRemoveCounter.java index d0970404b62..739107d7daa 100644 --- a/src/main/java/forge/card/cost/CostRemoveCounter.java +++ b/src/main/java/forge/card/cost/CostRemoveCounter.java @@ -12,7 +12,6 @@ public class CostRemoveCounter extends CostPart { private Counters counter; private int lastPaidAmount = 0; - public Counters getCounter() { return counter; } @@ -115,6 +114,11 @@ public class CostRemoveCounter extends CostPart { public boolean decideAIPayment(SpellAbility ability, Card source, Cost_Payment payment) { Integer c = convertAmount(); if (c == null){ + String sVar = source.getSVar(amount); + if (sVar.equals("XChoice")){ + return false; + } + c = AbilityFactory.calculateAmount(source, amount, ability); } if (c > source.getCounters(getCounter())) {