It is currently 07 Sep 2025, 20:09
   
Text Size

spDrawCards

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Re: spDrawCards

Postby 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
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: spDrawCards

Postby 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:
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());
                 }
And I go "huh.. why the eff did I do that?
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());
                 }
Should be
Code: Select all
                 if (NumCardsTypeInYourYard[0] == true)
                    AllCards.addAll(myYard.getCards());

                 if (NumCardsTypeInAllYards[0] == true)
                 {
                    AllCards.addAll(myYard.getCards());
                    AllCards.addAll(opYard.getCards());
                 }
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.
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Re: spDrawCards

Postby zerker2000 » 15 Sep 2009, 05:46

Rob 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.
Which will make it a lot easier to add cards that the AI can barely use :P.
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
zerker2000
Programmer
 
Posts: 569
Joined: 09 May 2009, 21:40
Location: South Pasadena, CA
Has thanked: 0 time
Been thanked: 0 time

Re: spDrawCards

Postby 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 Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Re: spDrawCards

Postby zerker2000 » 16 Sep 2009, 05:55

Oh... could {X} 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
zerker2000
Programmer
 
Posts: 569
Joined: 09 May 2009, 21:40
Location: South Pasadena, CA
Has thanked: 0 time
Been thanked: 0 time

Re: spDrawCards

Postby Rob Cashwalker » 16 Sep 2009, 17:27

No, of course not.

It may be workable somewhere along the way to use it for X in P/T, though.
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Previous

Return to Developer's Corner

Who is online

Users browsing this forum: Google Adsense [Bot] and 48 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 49 users online :: 1 registered, 0 hidden and 48 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: Google Adsense [Bot] and 48 guests

Login Form