mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Clean up
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user