mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
Added code for Explore.
This commit is contained in:
@@ -17557,6 +17557,55 @@ public class CardFactory implements NewConstants {
|
|||||||
}//*************** END ************ END **************************
|
}//*************** 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
|
// Cards with Cycling abilities
|
||||||
// -1 means keyword "Cycling" not found
|
// -1 means keyword "Cycling" not found
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ public class ComputerAI_General implements Computer {
|
|||||||
|
|
||||||
public void main1() {
|
public void main1() {
|
||||||
if(AllZone.GameInfo.getComputerCanPlayNumberOfLands() > 0) {
|
if(AllZone.GameInfo.getComputerCanPlayNumberOfLands() > 0) {
|
||||||
|
|
||||||
AllZone.GameInfo.addComputerCanPlayNumberOfLands(-1);
|
AllZone.GameInfo.addComputerCanPlayNumberOfLands(-1);
|
||||||
ComputerUtil.playLand();
|
ComputerUtil.playLand();
|
||||||
for(String effect:AllZone.StaticEffects.getStateBasedMap().keySet()) {
|
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));
|
AllZone.GameInfo.setComputerCanPlayNumberOfLands(CardFactoryUtil.getCanPlayNumberOfLands(Constant.Player.Computer));
|
||||||
|
|
||||||
playCards(Constant.Phase.Main2);
|
playCards(Constant.Phase.Main2);
|
||||||
}
|
|
||||||
|
}
|
||||||
|
|
||||||
private void playCards(final String phase) {
|
private void playCards(final String phase) {
|
||||||
SpellAbility[] sp = phase.equals(Constant.Phase.Main1)? getMain1():getMain2();
|
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("Epic Proportions");
|
||||||
|
|
||||||
play.add("Erratic Explosion");
|
play.add("Erratic Explosion");
|
||||||
|
play.add("Explore");
|
||||||
play.add("Expunge");
|
play.add("Expunge");
|
||||||
play.add("Faceless Butcher");
|
play.add("Faceless Butcher");
|
||||||
play.add("Feral Lightning");
|
play.add("Feral Lightning");
|
||||||
|
|||||||
Reference in New Issue
Block a user