It is currently 11 Sep 2025, 06:24
   
Text Size

Cantrips

Post MTG Forge Related Programming Questions Here

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

Re: Cantrips

Postby 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.
User avatar
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

Postby DennisBergkamp » 21 Jan 2010, 02:11

Dennis - 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.
Ah, wasn't thinking clearly I suppose :rolleyes: I was happy I got the AI to counter stuff in the first place!
Looking at the code, I'm not even sure why I added the cantrip code there...
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Cantrips

Postby 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.
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: Cantrips

Postby 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.
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Previous

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 28 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 28 users online :: 0 registered, 0 hidden and 28 guests (based on users active over the past 10 minutes)
Most users ever online was 7967 on 09 Sep 2025, 23:08

Users browsing this forum: No registered users and 28 guests

Login Form