Page 2 of 2

Re: spDrawCards

PostPosted: 23 Aug 2009, 10:19
by Sloth
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

Re: spDrawCards

PostPosted: 15 Sep 2009, 04:00
by Rob Cashwalker
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.

Re: spDrawCards

PostPosted: 15 Sep 2009, 05:46
by zerker2000
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.

Re: spDrawCards

PostPosted: 15 Sep 2009, 11:59
by Rob Cashwalker
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.

Re: spDrawCards

PostPosted: 16 Sep 2009, 05:55
by zerker2000
Oh... could {X} mana costs be inserted somewhere in there? :?

Re: spDrawCards

PostPosted: 16 Sep 2009, 17:27
by Rob Cashwalker
No, of course not.

It may be workable somewhere along the way to use it for X in P/T, though.