- Converted the upkeep ability of Mana Vortex to script.

This commit is contained in:
Sloth
2011-09-17 16:27:53 +00:00
parent c11ffe7b50
commit d6ae2dd29e
2 changed files with 4 additions and 43 deletions

View File

@@ -1,7 +1,9 @@
Name:Mana Vortex
ManaCost:1 U U
Types:Enchantment
Text:When you cast Mana Vortex, counter it unless you sacrifice a land.\r\nAt the beginning of each player's upkeep, that player sacrifices a land.
Text:When you cast Mana Vortex, counter it unless you sacrifice a land.
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ Player | TriggerZones$ Battlefield | Execute$ TrigSac | TriggerDescription$ At the beginning of each player's upkeep, that player sacrifices a land.
SVar:TrigSac:AB$ Sacrifice | Cost$ 0 | SacValid$ Land | Defined$ TriggeredPlayer | SacMessage$ land
T:Mode$ Always | TriggerZones$ Battlefield | IsPresent$ Land | PresentCompare$ EQ0 | Execute$ TrigSac | TriggerDescription$ When there are no lands on the battlefield, sacrifice CARDNAME.
SVar:TrigSac:AB$Sacrifice | Cost$ 0 | Defined$ Self
SVar:RemRandomDeck:True

View File

@@ -83,7 +83,6 @@ public class Upkeep implements java.io.Serializable {
upkeep_Echo();
upkeep_The_Abyss();
upkeep_Mana_Vortex();
upkeep_Yawgmoth_Demon();
upkeep_Lord_of_the_Pit();
upkeep_Drop_of_Honey();
@@ -555,46 +554,6 @@ public class Upkeep implements java.io.Serializable {
return creats;
}
/**
* <p>upkeep_Mana_Vortex.</p>
*/
private static void upkeep_Mana_Vortex() {
/*
* At the beginning of each player's upkeep, that player
* sacrifices a land.
*/
final Player player = AllZone.getPhase().getPlayerTurn();
final CardList vortices = AllZoneUtil.getCardsInPlay("Mana Vortex");
for (Card c : vortices) {
final Card vortex = c;
final Ability sacrificeLand = new Ability(vortex, "") {
@Override
public void resolve() {
CardList choices = AllZoneUtil.getPlayerLandsInPlay(player);
player.sacrificePermanent(vortex.getName() + " - select a land to sacrifice.", choices);
//if no lands in play, sacrifice all "Mana Vortex"s
if (AllZoneUtil.getLandsInPlay().size() == 0) {
for (Card d : vortices) {
AllZone.getGameAction().sacrifice(d);
}
return;
}
} //resolve
}; //sacrificeCreature
StringBuilder sb = new StringBuilder();
sb.append(vortex.getName()).append(" - " + player + " sacrifices a land.");
sacrificeLand.setStackDescription(sb.toString());
AllZone.getStack().addSimultaneousStackEntry(sacrificeLand);
} //end for
} //Mana_Vortex
/**
* <p>upkeep_Yawgmoth_Demon.</p>
*/