spDrawCards
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
21 posts
• Page 2 of 2 • 1, 2
Re: spDrawCards
by Sloth » 23 Aug 2009, 10:19
Because in MtG forge players can't have shroud at the moment, this card also works:
- Code: Select all
Biomantic Mastery
4 UG UG UG
Sorcery
Draw a card for each creature target player controls, then draw a card for each creature another target player controls.
spDrawCards:NumCardsType/Creature/InPlay
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: spDrawCards
by Rob Cashwalker » 15 Sep 2009, 04:00
So I'm transcribing some of the spDrawCards code into an enhanced spDamage keyword. Specifically, the way it handles "card counting". I come across the following lines:
I'm pretty sure
- Code: Select all
if (! NumCardsType[0].equals("none"))
{
if (NumCardsTypeInYourYard[0] == false)
AllCards.addAll(myYard.getCards());
if (NumCardsTypeInAllYards[0] == false)
{
AllCards.addAll(myYard.getCards());
AllCards.addAll(opYard.getCards());
}
if (NumCardsTypeYouCtrl[0] == true)
AllCards.addAll(myPlay.getCards());
if (NumCardsTypeInPlay[0] == true)
{
AllCards.addAll(myPlay.getCards());
AllCards.addAll(opPlay.getCards());
}
I'm pretty sure
- Code: Select all
if (NumCardsTypeInYourYard[0] == false)
AllCards.addAll(myYard.getCards());
if (NumCardsTypeInAllYards[0] == false)
{
AllCards.addAll(myYard.getCards());
AllCards.addAll(opYard.getCards());
}
- Code: Select all
if (NumCardsTypeInYourYard[0] == true)
AllCards.addAll(myYard.getCards());
if (NumCardsTypeInAllYards[0] == true)
{
AllCards.addAll(myYard.getCards());
AllCards.addAll(opYard.getCards());
}
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: spDrawCards
by zerker2000 » 15 Sep 2009, 05:46
Which will make it a lot easier to add cards that the AI can barely useRob Cashwalker wrote:Mind you, I'm now about to scrap a lot of this code from both keyword handlers to make a generic handler with more modularity.

O forest, hold thy wand'ring son
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
- zerker2000
- Programmer
- Posts: 569
- Joined: 09 May 2009, 21:40
- Location: South Pasadena, CA
- Has thanked: 0 time
- Been thanked: 0 time
Re: spDrawCards
by Rob Cashwalker » 15 Sep 2009, 11:59
I just mean a generic card counting function. So more keywords can be added which use "X", "where X is equal to the number of ___"
The AI and resolve code of new keywords can call this count function, passing the contents of the field that would normally contain the number, or the strings I defined for spDrawCards. (CardsInPlay, for example). Then count will return the appropriate value.
The AI and resolve code of new keywords can call this count function, passing the contents of the field that would normally contain the number, or the strings I defined for spDrawCards. (CardsInPlay, for example). Then count will return the appropriate value.
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: spDrawCards
by zerker2000 » 16 Sep 2009, 05:55
Oh... could
mana costs be inserted somewhere in there? 


O forest, hold thy wand'ring son
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
- zerker2000
- Programmer
- Posts: 569
- Joined: 09 May 2009, 21:40
- Location: South Pasadena, CA
- Has thanked: 0 time
- Been thanked: 0 time
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
21 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: Google Adsense [Bot] and 48 guests