mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
- Converted Martial Coup to script
This commit is contained in:
@@ -1,10 +1,16 @@
|
|||||||
Name:Martial Coup
|
Name:Martial Coup
|
||||||
ManaCost:X W W
|
ManaCost:X W W
|
||||||
Types:Sorcery
|
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:X:Count$xPaid
|
||||||
|
SVar:CoupCount:Remembered$Amount
|
||||||
SVar:PayX:5
|
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:Rarity:Rare
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/martial_coup.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/martial_coup.jpg
|
||||||
SetInfo:CFX|Rare|http://magiccards.info/scans/en/cfx/11.jpg
|
SetInfo:CFX|Rare|http://magiccards.info/scans/en/cfx/11.jpg
|
||||||
|
|||||||
@@ -69,7 +69,6 @@ import forge.view.ButtonUtil;
|
|||||||
*/
|
*/
|
||||||
public class CardFactorySorceries {
|
public class CardFactorySorceries {
|
||||||
|
|
||||||
|
|
||||||
private static final SpellAbility getBrilliantUltimatum(final Card card) {
|
private static final SpellAbility getBrilliantUltimatum(final Card card) {
|
||||||
return new Spell(card) {
|
return new Spell(card) {
|
||||||
private static final long serialVersionUID = 1481112451519L;
|
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) {
|
private final static SpellAbility getParralelEvolution(final Card card) {
|
||||||
final Spell result = new Spell(card) {
|
final Spell result = new Spell(card) {
|
||||||
private static final long serialVersionUID = 3456160935845779623L;
|
private static final long serialVersionUID = 3456160935845779623L;
|
||||||
@@ -740,7 +702,6 @@ public class CardFactorySorceries {
|
|||||||
thePlayer.drawCard();
|
thePlayer.drawCard();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private final static SpellAbility getWindfall( final Card card ) {
|
private final static SpellAbility getWindfall( final Card card ) {
|
||||||
@@ -1248,7 +1209,7 @@ public class CardFactorySorceries {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
final int max = card.getController().getLife();
|
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++) {
|
for (int i = 0; i <= max; i++) {
|
||||||
choices[i] = Integer.valueOf(i);
|
choices[i] = Integer.valueOf(i);
|
||||||
}
|
}
|
||||||
@@ -1443,7 +1404,6 @@ public class CardFactorySorceries {
|
|||||||
public static void buildCard(final Card card, final String cardName) {
|
public static void buildCard(final Card card, final String cardName) {
|
||||||
|
|
||||||
if (cardName.equals("Brilliant Ultimatum")) { card.addSpellAbility(getBrilliantUltimatum(card));
|
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("Parallel Evolution")) { card.addSpellAbility(getParralelEvolution(card));
|
||||||
} else if (cardName.equals("Global Ruin")) { card.addSpellAbility(getGlobalRuin(card));
|
} else if (cardName.equals("Global Ruin")) { card.addSpellAbility(getGlobalRuin(card));
|
||||||
} else if (cardName.equals("Haunting Echoes")) { card.addSpellAbility(getHauntingEchoes(card));
|
} else if (cardName.equals("Haunting Echoes")) { card.addSpellAbility(getHauntingEchoes(card));
|
||||||
|
|||||||
Reference in New Issue
Block a user