Added code for Explore.

This commit is contained in:
jendave
2011-08-06 03:55:57 +00:00
parent 76e0afc93b
commit 93f2c923b7
2 changed files with 53 additions and 1 deletions

View File

@@ -17557,6 +17557,55 @@ public class CardFactory implements NewConstants {
}//*************** END ************ END **************************
//*************** START *********** START **************************
if(cardName.equals("Explore"))
{
final SpellAbility spell = new Spell(card) {
private static final long serialVersionUID = 8377957584738695517L;
public boolean canPlayAI() {
// The computer should only play this card if it has at least
// one land in its hand. Because of the way the computer turn
// is structured, it will already have played its first land.
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand,
Constant.Player.Computer);
CardList list = new CardList(hand.getCards());
list = list.getType("Land");
if (list.size() > 0)
return true;
else
return false;
}
public void resolve() {
final String thePlayer = card.getController();
if (thePlayer.equals(Constant.Player.Human))
AllZone.GameInfo.addHumanCanPlayNumberOfLands(1);
else
AllZone.GameInfo.addComputerCanPlayNumberOfLands(1);
Command untilEOT = new Command()
{
private static final long serialVersionUID = -2618916698575607634L;
public void execute()
{
if (thePlayer.equals(Constant.Player.Human))
AllZone.GameInfo.addHumanCanPlayNumberOfLands(-1);
// There's no corresponding 'if' for the computer
// The computer's land total gets reset to the right value
// every turn
}
};
AllZone.EndOfTurn.addUntil(untilEOT);
}
};
card.clearSpellAbility();
card.addSpellAbility(spell);
} //*************** END ************ END **************************
// Cards with Cycling abilities
// -1 means keyword "Cycling" not found

View File

@@ -21,6 +21,7 @@ public class ComputerAI_General implements Computer {
public void main1() {
if(AllZone.GameInfo.getComputerCanPlayNumberOfLands() > 0) {
AllZone.GameInfo.addComputerCanPlayNumberOfLands(-1);
ComputerUtil.playLand();
for(String effect:AllZone.StaticEffects.getStateBasedMap().keySet()) {
@@ -52,7 +53,8 @@ public class ComputerAI_General implements Computer {
AllZone.GameInfo.setComputerCanPlayNumberOfLands(CardFactoryUtil.getCanPlayNumberOfLands(Constant.Player.Computer));
playCards(Constant.Phase.Main2);
}
}
private void playCards(final String phase) {
SpellAbility[] sp = phase.equals(Constant.Phase.Main1)? getMain1():getMain2();
@@ -100,6 +102,7 @@ public class ComputerAI_General implements Computer {
play.add("Epic Proportions");
play.add("Erratic Explosion");
play.add("Explore");
play.add("Expunge");
play.add("Faceless Butcher");
play.add("Feral Lightning");