Add XChoice to CostDiscard

Convert Firestorm and Vengeful Dreams to Script
This commit is contained in:
Sol
2011-08-24 01:33:21 +00:00
parent 8d29f7b3ce
commit 633b69ec82
4 changed files with 16 additions and 5 deletions

View File

@@ -1,7 +1,10 @@
Name:Firestorm Name:Firestorm
ManaCost:R ManaCost:R
Types:Instant Types:Instant
Text:As an additional cost to cast CARDNAME, discard X cards.\r\n\r\nCARDNAME deals X damage to each of X target creatures and/or players. Text:no text
A:SP$ DealDamage | Cost$ R Discard<X/Card> | Tgt$ TgtCP | TargetMin$ 0 | TargetMax$ MaxTgts | NumDmg$ X | SpellDescription$ CARDNAME deals X damage to each of X target creatures and/or players.
SVar:X:Targeted$Amount
SVar:MaxTgts:Count$Valid Creature/Plus.2
SVar:RemAIDeck:True SVar:RemAIDeck:True
SVar:Rarity:Rare SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/firestorm.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/firestorm.jpg

View File

@@ -1,7 +1,10 @@
Name:Vengeful Dreams Name:Vengeful Dreams
ManaCost:W W ManaCost:W W
Types:Instant Types:Instant
Text:As an additional cost to cast Vengeful Dreams, discard X cards.\r\n\r\nExile X target attacking creatures. Text:no text
A:SP$ ChangeZone | Cost$ W W Discard<X/Card> | Origin$ Battlefield | Destination$ Exile | TargetMin$ 0 | TargetMax$ MaxTgts | ValidTgts$ Creature.attacking | TgtPrompt$ Select target attacking creature | SpellDescription$ Exile X target attacking creatures.
SVar:X:Targeted$Amount
SVar:MaxTgts:Count$Valid Creature.attacking
SVar:RemAIDeck:True SVar:RemAIDeck:True
SVar:Rarity:Rare SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/vengeful_dreams.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/vengeful_dreams.jpg

View File

@@ -1017,6 +1017,7 @@ public class CardFactory_Instants {
//*************** START *********** START ************************** //*************** START *********** START **************************
/*
else if (cardName.equals("Vengeful Dreams")) { else if (cardName.equals("Vengeful Dreams")) {
final CardList targets = new CardList(); final CardList targets = new CardList();
final SpellAbility spell = new Spell(card) { final SpellAbility spell = new Spell(card) {
@@ -1094,8 +1095,8 @@ public class CardFactory_Instants {
card.addSpellAbility(spell); card.addSpellAbility(spell);
}//*************** END ************ END ************************** }//*************** END ************ END **************************
*/
/*
//*************** START *********** START ************************** //*************** START *********** START **************************
else if (cardName.equals("Firestorm")) { else if (cardName.equals("Firestorm")) {
final ArrayList<Object> targets = new ArrayList<Object>(); final ArrayList<Object> targets = new ArrayList<Object>();
@@ -1187,7 +1188,7 @@ public class CardFactory_Instants {
card.addSpellAbility(spell); card.addSpellAbility(spell);
}//*************** END ************ END ************************** }//*************** END ************ END **************************
*/
//*************** START *********** START ************************** //*************** START *********** START **************************
else if (cardName.equals("Cryptic Command")) { else if (cardName.equals("Cryptic Command")) {

View File

@@ -175,6 +175,10 @@ public class CostDiscard extends CostPartWithList {
else{ else{
Integer c = convertAmount(); Integer c = convertAmount();
if (c == null){ if (c == null){
String sVar = source.getSVar(amount);
if (sVar.equals("XChoice")){
return false;
}
c = AbilityFactory.calculateAmount(source, amount, ability); c = AbilityFactory.calculateAmount(source, amount, ability);
} }