PlayMain1 cards
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
3 posts
• Page 1 of 1
PlayMain1 cards
by Rob Cashwalker » 31 May 2010, 04:16
Recent discussion on how best to make sure that my pump spells were actually considered by the AI, revealed that there was a hard-coded list of cards the AI would choose to play during Main1.
My suggestion was to modify the bit of AI code that utilized the list, having it search for cards with a property to be played during Main1.
ComputerAI_General:
The list was certainly incomplete, so add the following wherever necessary:
My suggestion was to modify the bit of AI code that utilized the list, having it search for cards with a property to be played during Main1.
ComputerAI_General:
- Code: Select all
private SpellAbility[] getMain1() {
//Card list of all cards to consider
CardList hand = new CardList(AllZone.Computer_Hand.getCards());
hand = hand.filter(new CardListFilter() {
// Beached As Start
public boolean addCard(Card c) {
//Collection<Card> play = playMain1Cards;
if (c.getSVar("PlayMain1").equals("TRUE"))
return true;
if(c.isLand()) return false;
if(c.isCreature() && c.getKeyword().contains("Haste")) return true;
CardList Vengevines = new CardList();
......
The list was certainly incomplete, so add the following wherever necessary:
- Code: Select all
card.setSVar("PlayMain1", "TRUE");
- Code: Select all
SVar:PlayMain1:TRUE
- Code: Select all
//*************** START ********** START *************************
if (cardName.equals("Finest Hour") || cardName.equals("Gaea's Anthem") ||
cardName.equals("Glorious Anthem"))
// no card factory code, cards handled elsewhere,
{
card.setSVar("PlayMain1", "TRUE");
}//*************** END ************ END **************************
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: PlayMain1 cards
by Chris H. » 31 May 2010, 10:24
Nice work Rob. I have not yet had a chance to really think about it … but I guess that we will likely want to add this SVar to the spPump, spDestroy, and the enPump, eqPump cards.
-
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: PlayMain1 cards
by Rob Cashwalker » 31 May 2010, 12:13
Already done. There were already a few cards from all those keywords on the list. Now ALL cards from those keywords will benefit.
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
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 47 guests