X costs?
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
58 posts
• Page 3 of 4 • 1, 2, 3, 4
Re: X costs?
by zerker2000 » 03 Mar 2010, 04:14
I still think
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.

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: X costs?
by Mr.Chaos » 03 Mar 2010, 07:01
Thanks for Hurricane!DennisBergkamp wrote:I just added Hurricane by the way... I guess I'll put in Earthquake and Rolling Earthquake next

So hurry up with that next beta already.


](./images/smilies/eusa_wall.gif)

- Mr.Chaos
- Tester
- Posts: 625
- Joined: 06 Sep 2008, 08:15
- Has thanked: 0 time
- Been thanked: 0 time
Re: X costs?
by Chris H. » 03 Mar 2010, 13:30
`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.
-
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: X costs?
by apthaven » 03 Mar 2010, 15:44
Welcome. We are after all just being too excited for seeing this X costed cards after allDennisBergkamp wrote:Thanks for the list, apthaven![]()

"I am a man and real men do not consume pink beverages. Get thee gone woman, and bring me something brown." - Jace Wayland
Re: X costs?
by DennisBergkamp » 03 Mar 2010, 17:24
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)
Right now I'm trying to fix incompatibilities between Cascade / Isochron Scepter and X cost cards...

Right now I'm trying to fix incompatibilities between Cascade / Isochron Scepter and X cost cards...
-
DennisBergkamp - AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: X costs?
by zerker2000 » 04 Mar 2010, 02:53
That should be easy: setXPaid(0).
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: X costs?
by DennisBergkamp » 04 Mar 2010, 04:43
-
DennisBergkamp - AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: X costs?
by Chris H. » 10 Mar 2010, 23:05
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 **************************
Last edited by Chris H. on 06 Jun 2010, 10:57, edited 1 time in total.
-
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: X costs?
by DennisBergkamp » 11 Mar 2010, 05:08
Strange, not sure why that doesn't work.... I'll debug it, and see if I can find out what's going on.
-
DennisBergkamp - AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: X costs?
by DennisBergkamp » 12 Mar 2010, 03:22
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");
....
-
DennisBergkamp - AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: X costs?
by Chris H. » 12 Mar 2010, 12:06
`DennisBergkamp wrote:I still don't know why this doesn't work, if I add this to the beginning of the code block: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.
- Code: Select all
else if(cardName.equals("Ivy Elemental"))
{
SpellAbility sa = card.getSpellAbility()[0];
sa.setIsXCost(true);
sa.setManaCost("G");
....
At least we tried.

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.

-
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: X costs?
by Rob Cashwalker » 12 Mar 2010, 12:29
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.
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: X costs?
by slapshot5 » 01 May 2010, 03:58
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
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
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: X costs?
by Chris H. » 01 May 2010, 11:17
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. 

-
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: X costs?
by slapshot5 » 06 May 2010, 04:53
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
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
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
58 posts
• Page 3 of 4 • 1, 2, 3, 4
Who is online
Users browsing this forum: No registered users and 52 guests