diff --git a/src/forge/CardFactoryUtil.java b/src/forge/CardFactoryUtil.java index b7a32280f64..e9fcf71a258 100644 --- a/src/forge/CardFactoryUtil.java +++ b/src/forge/CardFactoryUtil.java @@ -748,7 +748,6 @@ public class CardFactoryUtil { PlayerLife compLife = AllZone.GameAction.getPlayerLife("Computer"); int life = compLife.getLife(); - return (life > (loss + 2)); } @@ -758,7 +757,10 @@ public class CardFactoryUtil { String phase = AllZone.Phase.getPhase(); String activePlayer = AllZone.Phase.getActivePlayer(); - return AllZone.GameAction.isCardInZone(sourceCard, grave) + ArrayList spellsOnStack = AllZone.Stack.getSourceCards(); + Card sourceCard = this.getSourceCard(); + + return AllZone.GameAction.isCardInZone(sourceCard, grave) && !spellsOnStack.contains(sourceCard) && (sourceCard.isInstant() || (phase.equals(Constant.Phase.Main1) || phase.equals(Constant.Phase.Main2)) && sourceCard.getController().equals(activePlayer) && AllZone.Stack.size() == 0); diff --git a/src/forge/ComputerUtil_Attack2.java b/src/forge/ComputerUtil_Attack2.java index 01111af0d26..f4b4b0b3cd4 100644 --- a/src/forge/ComputerUtil_Attack2.java +++ b/src/forge/ComputerUtil_Attack2.java @@ -82,14 +82,16 @@ import java.util.*; CardListUtil.sortAttack(humanList); int blockersNeeded = computerList.size(); - for(int i = 0; i < computerList.size(); i++) { + CardList list = computerList; + + for(int i = 0; i < list.size(); i++) { if(!doesHumanAttackAndWin(i)) { blockersNeeded= i; break; } } - if (blockersNeeded == computerList.size()) { + if (blockersNeeded == list.size()) { // Human will win unless everything is kept back to block return blockersNeeded; } @@ -124,8 +126,8 @@ import java.util.*; } } - if (blockersNeeded > computerList.size()) - blockersNeeded = computerList.size(); + if (blockersNeeded > list.size()) + blockersNeeded = list.size(); return blockersNeeded; } @@ -225,6 +227,14 @@ import java.util.*; CardListUtil.sortNonFlyingFirst(attackers); CardListUtil.sortAttackLowFirst(attackers); + for (Card c:attackers) + { + if (c.getKeyword().contains("Vigilance")) + i--; + } + if (i < 0) + i = 0; + for(; i < attackers.size(); i++) {