Cycling keyword
Posted: 24 Sep 2008, 03:49
CardFactory :
Similar to how Forge checks for the pump abilities....
Cardname
Mana
Type
Text
{P/T}
Cycling:G
note - no space around the ":"
The mana cost is extracted directly, so it's formatted in the usual spaced format - "1 G"
This opens up a few more french vanilla creatures. I'll post those cards.txt and such another time.
103 cards have cycling according to Magiccards.info searches.
Similar to how Forge checks for the pump abilities....
- Code: Select all
//Check for Cycling ability
private final int shouldCycle(Card c)
{
ArrayList a = c.getKeyword();
for (int i = 0; i < a.size(); i++)
if (a.get(i).toString().startsWith("Cycling"))
return i;
return -1;
}
- Code: Select all
// Cards with Cycling abilities
// -1 means keyword "Cycling" not found
if (shouldCycle(card) != -1)
{
int n = shouldCycle(card);
if (n != -1)
{
String parse = card.getKeyword().get(n).toString();
card.removeKeyword(parse);
String k[] = parse.split(":");
final String manacost = k[1];
card.addSpellAbility(CardFactoryUtil.ability_cycle(card, manacost));
}//Cycling
Cardname
Mana
Type
Text
{P/T}
Cycling:G
note - no space around the ":"
The mana cost is extracted directly, so it's formatted in the usual spaced format - "1 G"
This opens up a few more french vanilla creatures. I'll post those cards.txt and such another time.
103 cards have cycling according to Magiccards.info searches.