- Tweaks for AI passing priority in between land plays.

This commit is contained in:
jendave
2011-08-06 16:14:19 +00:00
parent 1be51809c1
commit 47d8c2c0c8
2 changed files with 10 additions and 7 deletions

View File

@@ -13,18 +13,18 @@ public class ComputerAI_General implements Computer {
}
public void main1() {
ComputerUtil.chooseLandsToPlay();
if(AllZone.Stack.size() != 0)
{
if (!ComputerUtil.chooseLandsToPlay()){
if (AllZone.Phase.getPriorityPlayer().isComputer())
stackResponse();
return;
}
playCards(Constant.Phase.Main1);
}//main1()
public void main2() {
ComputerUtil.chooseLandsToPlay(); // in case we can play more lands now, or drew cards since first main phase
if(AllZone.Stack.size() != 0)
{
if (!ComputerUtil.chooseLandsToPlay()){ // in case we can play more lands now, or drew cards since first main phase
if (AllZone.Phase.getPriorityPlayer().isComputer())
stackResponse();
return;
}
playCards(Constant.Phase.Main2);

View File

@@ -528,7 +528,7 @@ public class ComputerUtil
}//getAvailableMana()
//plays a land if one is available
static public void chooseLandsToPlay()
static public boolean chooseLandsToPlay()
{
Player computer = AllZone.ComputerPlayer;
ArrayList<Card> landList = PlayerZoneUtil.getCardType(AllZone.Computer_Hand, "Land");
@@ -553,7 +553,10 @@ public class ComputerUtil
computer.playLand(land);
AllZone.GameAction.checkStateEffects();
if (AllZone.Stack.size() != 0)
return false;
}
return true;
}
static public Card getCardPreference(Card activate, String pref, CardList typeList){