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.

This commit is contained in:
jendave
2011-08-06 05:19:30 +00:00
parent 59998cc175
commit 672e380af9

View File

@@ -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();