removed another ai hook

This commit is contained in:
Maxmtg
2014-02-09 20:25:47 +00:00
parent 14a0e6e3ac
commit 0f37de9627
2 changed files with 14 additions and 8 deletions

View File

@@ -480,9 +480,21 @@ public class AiCostDecision extends CostDecisionMakerBase implements ICostVisito
return false; return false;
} }
}); });
if(hperms.isEmpty())
return null;
PaymentDecision result = PaymentDecision.card(hperms);
Card valid = hperms.get(0);
for (CounterType c1 : valid.getCounters().keySet()) {
if (valid.getCounters(c1) >= c && ComputerUtil.isNegativeCounter(c1, valid)) {
result.ct = c1;
break;
}
}
// Only find cards with enough negative counters // Only find cards with enough negative counters
// TODO: add ai for Chisei, Heart of Oceans // TODO: add ai for Chisei, Heart of Oceans
return hperms.isEmpty() ? null : PaymentDecision.card(hperms); return result;
} }
@Override @Override

View File

@@ -19,7 +19,6 @@ package forge.game.cost;
import com.google.common.base.Predicate; import com.google.common.base.Predicate;
import forge.ai.ComputerUtil;
import forge.game.ability.AbilityUtils; import forge.game.ability.AbilityUtils;
import forge.game.card.Card; import forge.game.card.Card;
import forge.game.card.CardLists; import forge.game.card.CardLists;
@@ -138,12 +137,7 @@ public class CostRemoveAnyCounter extends CostPartWithList {
c = AbilityUtils.calculateAmount(source, amount, ability); c = AbilityUtils.calculateAmount(source, amount, ability);
} }
Card valid = decision.cards.get(0); Card valid = decision.cards.get(0);
for (CounterType c1 : valid.getCounters().keySet()) { counterType = decision.ct;
if (valid.getCounters(c1) >= c && ComputerUtil.isNegativeCounter(c1, valid)) {
counterType = c1;
break;
}
}
for (int i = 0; i < c; i++) { for (int i = 0; i < c; i++) {
executePayment(ability, valid); executePayment(ability, valid);
} }