Cantrips
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
19 posts
• Page 2 of 2 • 1, 2
Re: Cantrips
by Chris H. » 21 Jan 2010, 01:19
I want to thank everyone for helping out with this portion of the project. I used Rob's suggestion for the test. At one time I had a local version which was fairly close to his, and then I got swept up with reading up on String Builder in the javadoc.
I think that I found all of the cards that used the old cantrip keyword and the cards that were hard coded. They all should have been converted over.
I think that I found all of the cards that used the old cantrip keyword and the cards that were hard coded. They all should have been converted over.
-
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: Cantrips
by DennisBergkamp » 21 Jan 2010, 02:11
Ah, wasn't thinking clearly I supposeDennis - when you made this method for the counterspells,
why did you include a Cantrip check? The spellability is added to the stack in this code, but it hasn't been resolved yet. The Cantrip (and now the scry code I'm adding) should execute only after the spellability.resolve method is executed.

Looking at the code, I'm not even sure why I added the cantrip code there...
-
DennisBergkamp - AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: Cantrips
by Rob Cashwalker » 21 Jan 2010, 14:59
To be honest, I'm not happy that there are two locations where sa.resolve occurs. I know it's a difference due to ai player and human player, but it sucks as a concept...
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: Cantrips
by DennisBergkamp » 21 Jan 2010, 20:25
Hmm, agreed, it's a bit of a hack, and ideally it would be in one single place, but I don't really see any other way of doing it.
By the way, I did not add the playNoStack method, it's always been there, the only code that seems to have been using it is in SpellAbilityList.java.
I use playNoStack(sa) only for the AI to pay for optional costs: the invasion Legendary Dragons, paying for Propaganda, Upkeep/Echo and possibly responding to spells like Daze / Mana Leak.
By the way, I did not add the playNoStack method, it's always been there, the only code that seems to have been using it is in SpellAbilityList.java.
I use playNoStack(sa) only for the AI to pay for optional costs: the invasion Legendary Dragons, paying for Propaganda, Upkeep/Echo and possibly responding to spells like Daze / Mana Leak.
-
DennisBergkamp - AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
19 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 28 guests