- Converted Martial Coup to script

This commit is contained in:
moomarc
2012-10-02 11:12:32 +00:00
parent 7e86e8d751
commit 65f3d3935a
2 changed files with 25 additions and 59 deletions

View File

@@ -1,10 +1,16 @@
Name:Martial Coup
ManaCost:X W W
Types:Sorcery
Text:Put X 1/1 white Soldier creature tokens onto the battlefield. If X is 5 or more, destroy all other creatures.
Text:no text
A:SP$ Token | Cost$ X W W | TokenAmount$ X | References$ X | TokenName$ Soldier | TokenTypes$ Creature,Soldier | RememberTokens$ True | TokenOwner$ You | TokenColors$ White | TokenPower$ 1 | TokenToughness$ 1 | SubAbility$ CoupDestroy | SpellDescription$ Put X 1/1 white Soldier creature tokens onto the battlefield. If X is 5 or more, destroy all other creatures.
SVar:CoupDestroy:DB$ DestroyAll | ValidCards$ Creature.IsNotRemembered | ConditionCheckSVar$ CoupCount | ConditionSVarCompare$ GE5 | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:X:Count$xPaid
SVar:CoupCount:Remembered$Amount
SVar:PayX:5
# Should have the References param added when converted to script.
SVar:NeedsToPlayVar:OwnCreats LEOppCreats
SVar:OwnCreats:Count$SumPower_Creature.YouCtrl
SVar:OppCreats:Count$SumPower_Creature.YouDontCtrl
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/martial_coup.jpg
SetInfo:CFX|Rare|http://magiccards.info/scans/en/cfx/11.jpg

View File

@@ -69,7 +69,6 @@ import forge.view.ButtonUtil;
*/
public class CardFactorySorceries {
private static final SpellAbility getBrilliantUltimatum(final Card card) {
return new Spell(card) {
private static final long serialVersionUID = 1481112451519L;
@@ -254,43 +253,6 @@ public class CardFactorySorceries {
}
private final static SpellAbility getMartialCoup(final Card card) {
final Cost cost = new Cost(card, card.getManaCost(), false);
return new Spell(card, cost, null) {
private static final long serialVersionUID = -29101524966207L;
@Override
public void resolve() {
final List<Card> all = AllZoneUtil.getCardsIn(ZoneType.Battlefield);
final int soldiers = card.getXManaCostPaid();
for (int i = 0; i < soldiers; i++) {
CardFactoryUtil.makeToken("Soldier", "W 1 1 Soldier", card.getController(), "W", new String[] {
"Creature", "Soldier" }, 1, 1, new String[] { "" });
}
if (soldiers >= 5) {
for (int i = 0; i < all.size(); i++) {
final Card c = all.get(i);
if (c.isCreature()) {
Singletons.getModel().getGameAction().destroy(c);
}
}
}
} // resolve()
@Override
public boolean canPlayAI() {
final List<Card> human = AllZoneUtil.getCreaturesInPlay(AllZone.getHumanPlayer());
final List<Card> computer = AllZoneUtil.getCreaturesInPlay(AllZone.getComputerPlayer());
// the computer will at least destroy 2 more human creatures
return ((computer.size() < (human.size() - 1)) || ((AllZone.getComputerPlayer().getLife() < 7) && !human
.isEmpty())) && (ComputerUtil.getAvailableMana(true).size() >= 7);
}
}; // SpellAbility
}
private final static SpellAbility getParralelEvolution(final Card card) {
final Spell result = new Spell(card) {
private static final long serialVersionUID = 3456160935845779623L;
@@ -740,7 +702,6 @@ public class CardFactorySorceries {
thePlayer.drawCard();
}
};
}
private final static SpellAbility getWindfall( final Card card ) {
@@ -1248,7 +1209,7 @@ public class CardFactorySorceries {
}
} else {
final int max = card.getController().getLife();
final Integer[] choices = new Integer[max+1];
final Integer[] choices = new Integer[max + 1];
for (int i = 0; i <= max; i++) {
choices[i] = Integer.valueOf(i);
}
@@ -1443,7 +1404,6 @@ public class CardFactorySorceries {
public static void buildCard(final Card card, final String cardName) {
if (cardName.equals("Brilliant Ultimatum")) { card.addSpellAbility(getBrilliantUltimatum(card));
} else if (cardName.equals("Martial Coup")) { card.addSpellAbility(getMartialCoup(card));
} else if (cardName.equals("Parallel Evolution")) { card.addSpellAbility(getParralelEvolution(card));
} else if (cardName.equals("Global Ruin")) { card.addSpellAbility(getGlobalRuin(card));
} else if (cardName.equals("Haunting Echoes")) { card.addSpellAbility(getHauntingEchoes(card));