This commit is contained in:
tool4EvEr
2022-05-09 22:24:41 +02:00
parent 6b13169fd5
commit e5f3488d5d
5 changed files with 11 additions and 18 deletions

View File

@@ -88,6 +88,13 @@ public class AiController {
private SpellAbilityPicker simPicker;
private int lastAttackAggression;
public AiController(final Player computerPlayer, final Game game0) {
player = computerPlayer;
game = game0;
memory = new AiCardMemory();
simPicker = new SpellAbilityPicker(game, player);
}
public boolean canCheatShuffle() {
return cheatShuffle;
}
@@ -141,13 +148,6 @@ public class AiController {
return predictedCombatNextTurn;
}
public AiController(final Player computerPlayer, final Game game0) {
player = computerPlayer;
game = game0;
memory = new AiCardMemory();
simPicker = new SpellAbilityPicker(game, player);
}
private List<SpellAbility> getPossibleETBCounters() {
CardCollection all = new CardCollection(player.getCardsIn(ZoneType.Hand));
CardCollectionView ccvPlayerLibrary = player.getCardsIn(ZoneType.Library);

View File

@@ -341,7 +341,7 @@ public class CountersPutAi extends CountersAi {
if (sa.hasParam("Bolster")) {
CardCollection creatsYouCtrl = ai.getCreaturesInPlay();
CardCollection leastToughness = new CardCollection(Aggregates.listWithMin(creatsYouCtrl, CardPredicates.Accessors.fnGetDefense));
CardCollection leastToughness = new CardCollection(Aggregates.listWithMin(creatsYouCtrl, CardPredicates.Accessors.fnGetNetToughness));
if (leastToughness.isEmpty()) {
return false;
}

View File

@@ -183,7 +183,7 @@ public class CountersPutEffect extends SpellAbilityEffect {
if (sa.hasParam("Bolster")) {
CardCollection creatsYouCtrl = activator.getCreaturesInPlay();
CardCollection leastToughness = new CardCollection(
Aggregates.listWithMin(creatsYouCtrl, CardPredicates.Accessors.fnGetDefense));
Aggregates.listWithMin(creatsYouCtrl, CardPredicates.Accessors.fnGetNetToughness));
Map<String, Object> params = Maps.newHashMap();
params.put("CounterType", counterType);

View File

@@ -733,13 +733,6 @@ public final class CardPredicates {
}
public static class Accessors {
public static final Function<Card, Integer> fnGetDefense = new Function<Card, Integer>() {
@Override
public Integer apply(Card a) {
return a.getNetToughness();
}
};
public static final Function<Card, Integer> fnGetNetPower = new Function<Card, Integer>() {
@Override
public Integer apply(Card a) {

View File

@@ -268,7 +268,7 @@ public class CombatUtil {
}
return true;
} // canAttack(Card, GameEntity)
}
public static boolean isAttackerSick(final Card attacker, final GameEntity defender) {
final Game game = attacker.getGame();
@@ -1158,7 +1158,7 @@ public class CombatUtil {
}
return true;
} // canBlock()
}
public static boolean canAttackerBeBlockedWithAmount(Card attacker, int amount, Combat combat) {
return canAttackerBeBlockedWithAmount(attacker, amount, combat != null ? combat.getDefenderPlayerByAttacker(attacker) : null);