New keyword: spMakeToken
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: New keyword: spMakeToken
by friarsol » 13 Oct 2010, 19:38
I couldn't find the abMakeToken thread but it looks like Llanowar Mentor's abMakeToken seems to be conflicting with shouldManaAbility that is processed before it. I'm not sure what the best approach to resolve the issue is. It could just be to move the mana ability blocks to last in this section, or at least move abMakeToken and spMakeToken before it.
A third solution is to convert the two MakeToken checks to use the new AbilityFactory.
A third solution is to convert the two MakeToken checks to use the new AbilityFactory.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: New keyword: spMakeToken
by Chris H. » 19 Oct 2010, 01:29
I realized the other day that we could add a few lines of code at the end of this keyword and with an SVar we could convert over the Flashback spells that make tokens. I tacked on this code:
I then commented out the code block for Call of the Herd and I modified it's record in the cardsfolder to look like this:
I ran a test deck and it works. I even activated the Flashback ability. The only problem was the stack description is missing the card's name. Dragon Fodder on the other hand includes the card name in the stack description and they both are keyworded.
Granted, this system can not be used with targeted spells at this time. I will commit this code and will work on converting the last of the make token spell cards.
- Code: Select all
String fb = card.getSVar("Flashback");
if (!fb.equals("")) {
String fbCost[] = fb.split("/");
// fbCost[0] = Flashback mana cost
// fbCost[1] = Flashback life cost
card.setFlashback(true);
card.addSpellAbility(CardFactoryUtil.ability_Flashback(card, fbCost[0], fbCost[1]));
}
}//end MakeToken
I then commented out the code block for Call of the Herd and I modified it's record in the cardsfolder to look like this:
- Code: Select all
Name:Call of the Herd
ManaCost:2 G
Types:Sorcery
Text:Put a 3/3 green Elephant creature token onto the battlefield.
K:spMakeToken<>1<>Elephant<>G 3 3 Elephant<>Controller<>G<>Creature;Elephant<>3<>3<>None
SVar:Flashback:3 G/0
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/call_of_the_herd.jpg
End
I ran a test deck and it works. I even activated the Flashback ability. The only problem was the stack description is missing the card's name. Dragon Fodder on the other hand includes the card name in the stack description and they both are keyworded.
Granted, this system can not be used with targeted spells at this time. I will commit this code and will work on converting the last of the make token spell cards.
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: New keyword: spMakeToken
by Chris H. » 20 Oct 2010, 01:57
`Chris H. wrote:I realized the other day that we could add a few lines of code at the end of this keyword and with an SVar we could convert over the Flashback spells that make tokens.
I figured out how to fix the Flashback keyword code and it now functional. I removed the now un-needed Flashback code from spMakeToken.
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
18 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 51 guests