diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index c97f64d36b5..99527a5a78a 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -7610,8 +7610,13 @@ public class CardFactory implements NewConstants { } Card c = getFlying(); - if((c == null) || (!check.equals(c))) throw new RuntimeException(card - + " error in chooseTargetAI() - Card c is " + c + ", Card check is " + check); + if((c == null) || (!check.equals(c))) { + c = getAnyCreature(); + if (c == null) { + setTargetPlayer(Constant.Player.Human); + return; + } + } setTargetCard(c); }//chooseTargetAI() @@ -7625,6 +7630,14 @@ public class CardFactory implements NewConstants { return null; } + Card getAnyCreature() { + CardList creatures = CardFactoryUtil.AI_getHumanCreature(card, true); + for(int i = 0; i < creatures.size(); i++) + if(creatures.get(i).getNetDefense() <= damage) return creatures.get(i); + + return null; + } + @Override public void resolve() { if(getTargetCard() != null) {