Re: X costs?
Hmm, I started out supporting this, but then I had enough trouble getting the simplest case of X costs to work, so I never really revisited this. But I'll look at the code again and see if I can get this to work.
High Quality Resources for Collectible Card Games and Home of the CCGHQ Team
https://www.slightlymagic.net/forum/
https://www.slightlymagic.net/forum/viewtopic.php?f=52&t=2312
if (card.getManaCost().contains("X"))
{
SpellAbility sa = card.getSpellAbility()[0];
sa.setIsXCost(true);
if (card.getManaCost().startsWith("X X"))
sa.setXManaCost("2");
else if (card.getManaCost().startsWith("X"))
sa.setXManaCost("1");
}//X...
Integer.parseInt(s);
ability.setManaCost(s);
...
`Chris H. wrote:I guess that cards with non-MultiKicker X costs are limited to sorceries and instants at this time. I tried to code the following card and it did not ask for the X costs. When I changed the type in cards.txt to sorcery and then cast this card it asked me to input the X cost. I guess that MultiKicker is different in that there is code to allow us to pay for the kicks.`
- Code: Select all
Ivy Elemental
X G
Creature Elemental
Ivy Elemental enters the battlefield with X +1/+1 counters on it.
0/0
- Code: Select all
//*************** START *********** START **************************
else if(cardName.equals("Ivy Elemental"))
{
final Ability ability = new Ability(card, "0") {
@Override
public void resolve() {
card.addCounter(Counters.P1P1, card.getXManaCostPaid());
card.setXManaCostPaid(0);
}
};
StringBuilder sb = new StringBuilder();
sb.append(cardName);
sb.append(" - enters the battlefield with X +1/+1 counters on it.");
ability.setStackDescription(sb.toString());
final Command comesIntoPlay = new Command() {
private static final long serialVersionUID = -6463000686862814506L;
public void execute() {
AllZone.Stack.add(ability);
}
};
card.addComesIntoPlayCommand(comesIntoPlay);
}//*************** END ************ END **************************