Page 3 of 4

Re: X costs?

PostPosted: 03 Mar 2010, 04:14
by zerker2000
I still think {X} should be implemented using the canonical "the controller of that spell or ability chooses and announces the value of X as part of ...(playing it)", e.g. Helix Pinnacle's input.

Re: X costs?

PostPosted: 03 Mar 2010, 07:01
by Mr.Chaos
DennisBergkamp wrote:I just added Hurricane by the way... I guess I'll put in Earthquake and Rolling Earthquake next :)
Thanks for Hurricane! =D> This means I can now finally make my elf/staff deck! ( the current version in Forge used Door to Domination. It works, but is crude when compared to the power of Hurricane, which wipes out all opponents at once.)
So hurry up with that next beta already. :wink: :lol:

Re: X costs?

PostPosted: 03 Mar 2010, 13:30
by Chris H.
DennisBergkamp wrote:Yeah, actually Drain Life should be possible to keyword with a Drawback$YouGainLife.
Fireball is a tricky card...
`
Drain Life wants us to pay only black mana on X. :(

Rob has done a great job on his scripted keywords and your X cost code opens a lot of doors. At some point we may be able to limit the X cost to a single color.

Re: X costs?

PostPosted: 03 Mar 2010, 15:44
by apthaven
DennisBergkamp wrote:Thanks for the list, apthaven :)
Welcome. We are after all just being too excited for seeing this X costed cards after all :)

Re: X costs?

PostPosted: 03 Mar 2010, 17:24
by DennisBergkamp
I'll probably release a new Beta this weekend, but the X stuff will undoubtedly have a bunch of bugs (just a warning in advance) :lol:
Right now I'm trying to fix incompatibilities between Cascade / Isochron Scepter and X cost cards...

Re: X costs?

PostPosted: 04 Mar 2010, 02:53
by zerker2000
That should be easy: setXPaid(0).

Re: X costs?

PostPosted: 04 Mar 2010, 04:43
by DennisBergkamp
?
But then the Pay X input controls would still pop up... anyway it's fixed already :mrgreen:

Re: X costs?

PostPosted: 10 Mar 2010, 23:05
by Chris H.
I guess that cards with non-MultiKicker X costs are limited to sorceries and instants at this time. I tried to code the following card and it did not ask for the X costs. When I changed the type in cards.txt to sorcery and then cast this card it asked me to input the X cost. I guess that MultiKicker is different in that there is code to allow us to pay for the kicks.

Code: Select all
Ivy Elemental
X G
Creature Elemental
Ivy Elemental enters the battlefield with X +1/+1 counters on it.
0/0
`
Code: Select all
        //*************** START *********** START **************************
        else if(cardName.equals("Ivy Elemental"))
        {
           final Ability ability = new Ability(card, "0") {
                @Override
                public void resolve() {
                    card.addCounter(Counters.P1P1, card.getXManaCostPaid());
                    card.setXManaCostPaid(0);
                }
            };
           
            StringBuilder sb = new StringBuilder();
            sb.append(cardName);
            sb.append(" - enters the battlefield with X +1/+1 counters on it.");
            ability.setStackDescription(sb.toString());
           
            final Command comesIntoPlay = new Command() {
            private static final long serialVersionUID = -6463000686862814506L;

            public void execute() {
                    AllZone.Stack.add(ability);
                }
            };
           
            card.addComesIntoPlayCommand(comesIntoPlay);
        }//*************** END ************ END **************************

Re: X costs?

PostPosted: 11 Mar 2010, 05:08
by DennisBergkamp
Strange, not sure why that doesn't work.... I'll debug it, and see if I can find out what's going on.

Re: X costs?

PostPosted: 12 Mar 2010, 03:22
by DennisBergkamp
I still don't know why this doesn't work, if I add this to the beginning of the code block:

Code: Select all
else if(cardName.equals("Ivy Elemental"))
        {
           SpellAbility sa = card.getSpellAbility()[0];
           sa.setIsXCost(true);
           sa.setManaCost("G");
           ....
Some other error happens (for some reason it tries to pay a blank manacost after tapping for "G"). I'll just comment out the card for now.

Re: X costs?

PostPosted: 12 Mar 2010, 12:06
by Chris H.
DennisBergkamp wrote:I still don't know why this doesn't work, if I add this to the beginning of the code block:

Code: Select all
else if(cardName.equals("Ivy Elemental"))
        {
           SpellAbility sa = card.getSpellAbility()[0];
           sa.setIsXCost(true);
           sa.setManaCost("G");
           ....
Some other error happens (for some reason it tries to pay a blank manacost after tapping for "G"). I'll just comment out the card for now.
`
At least we tried. :wink:

And as a note to Rob ... I also tried to add Invoke the Firemind via keywords and for some reason spDrawCards removes spDamageTgt.

Dennis and I were able to add about a dozen X cost cards. That should be enough to give the user base something to try out with the upcoming beta release. :D

Re: X costs?

PostPosted: 12 Mar 2010, 12:29
by Rob Cashwalker
This is because spells clear the ability list for the card. Besides, the AI would evaluate the first ability and probably play it, rather than evaluate both, choosing one. "Choose one" spells will need these kinds of considerations before being added.

Re: X costs?

PostPosted: 01 May 2010, 03:58
by slapshot5
I just checked in some code for Fireball. It is fully functional for the human. And has reasonable behavior for the AI too (can use improvement). I thought I'd check in at this point to get others' input.

SVN comment:

added Fireball from the original Limited base set. Everything seems to work for the Human. The AI doesn't do anything terribly clever - just finishes human off if it can. But this is a good start.

There are also some kinks with the flow of selecting a player or creature twice. But others can add tweaks.

Also, there is a lot of debug code there that I left in on purpose. Once we are confident the kinks are out (if any), or before an upcoming release, it can be commented/removed. Enjoy!

-slapshot5

Re: X costs?

PostPosted: 01 May 2010, 11:17
by Chris H.
There are still a few X cost spells that have not yet been coded. Fireball may be one of the more changeling to try to implement with a good AI. The computer can not use the cards which add a lot of mana to the mana pool which in turn can limit the amount of mana which can be realistically generated. :D

Re: X costs?

PostPosted: 06 May 2010, 04:53
by slapshot5
Didn't know if I should continue here, or start a new topic.

Does Forge currrently have the ability to accept "X X" mana costs? Like:

Recall
Orcish Settlers
Decree of Justice

When prompted for X currently, it says: "Pay X for Fireball (X=0) Pay Mana Cost: 1"

Seems like if there were a way to say: "Pay Mana Cost: 2" at the end, so that every 2 mana incremented X by 1, this would be doable. From what I could tell, this is currently not possible. Can someone confirm/comment?

Thanks,
-slapshot5