From 672e380af9a94bd2edc6d36443fffa248f278bb2 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 05:19:30 +0000 Subject: [PATCH] Turns out the spells Evacuation and Rebuild did not have a canPlayAI() method. I borrowed the canPlayAI() method from wrath of God and made a couple of minor adjustments. It may or may not need additional adjustments. --- src/forge/CardFactory.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index 59bc7231d91..39f21c7b986 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -11887,6 +11887,24 @@ public class CardFactory implements NewConstants { SpellAbility spell = new Spell(card) { private static final long serialVersionUID = -6305494177352031326L; + @Override + public boolean canPlayAI() { + CardList human = new CardList(AllZone.Human_Play.getCards()); + CardList computer = new CardList(AllZone.Computer_Play.getCards()); + + String bounceType; + if (cardName.equals("Rebuild")) bounceType = "Artifact"; + else bounceType = "Creature"; + + human = human.getType(bounceType); + computer = computer.getType(bounceType); + + // the computer will at least bounce 2 more human creatures/artifacts + return AllZone.Phase.getPhase().equals(Constant.Phase.Main2) && + (computer.size() < human.size() - 1 + || (AllZone.Computer_Life.getLife() < 7 && !human.isEmpty())); + } + @Override public void resolve() { CardList all = new CardList();