- Added Support for XChoice to CostRemoveCounter

- Converted Mana Batteries and FE Storage Lands to Script
This commit is contained in:
Sol
2011-08-23 04:25:00 +00:00
parent 2dbd141611
commit 943057865a
14 changed files with 60 additions and 29 deletions

View File

@@ -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
/**
* <p>upkeep_Fallen_Empires_Storage_Lands.</p>
*/
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

View File

@@ -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 **************************

View File

@@ -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...

View File

@@ -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())) {