diff --git a/forge-ai/src/main/java/forge/ai/AiAttackController.java b/forge-ai/src/main/java/forge/ai/AiAttackController.java index 3e88146d9bd..23e47dc733a 100644 --- a/forge-ai/src/main/java/forge/ai/AiAttackController.java +++ b/forge-ai/src/main/java/forge/ai/AiAttackController.java @@ -42,7 +42,6 @@ import forge.util.collect.FCollectionView; import java.util.ArrayList; import java.util.List; -import java.util.Random; //doesHumanAttackAndWin() uses the global variable AllZone.getComputerPlayer() @@ -60,9 +59,6 @@ public class AiAttackController { private final List attackers; private final List blockers; - private final static Random random = new Random(); - private final static int randomInt = random.nextInt(); - private List oppList; // holds human player creatures private List myList; // holds computer creatures @@ -105,7 +101,7 @@ public class AiAttackController { } // overloaded constructor to evaluate single specified attacker public static List getOpponentCreatures(final Player defender) { - List defenders = Lists.newArrayList(); + List defenders = new ArrayList(); defenders.addAll(defender.getCreaturesInPlay()); Predicate canAnimate = new Predicate() { @Override @@ -586,13 +582,6 @@ public class AiAttackController { * @return a {@link forge.game.combat.Combat} object. */ public final void declareAttackers(final Combat combat) { - // if this method is called multiple times during a turn, - // it will always return the same value - // randomInt is used so that the computer doesn't always - // do the same thing on turn 3 if he had the same creatures in play - // I know this is a little confusing - - random.setSeed(ai.getGame().getPhaseHandler().getTurn() + AiAttackController.randomInt); if (this.attackers.isEmpty()) { return; @@ -1334,7 +1323,7 @@ public class AiAttackController { } } - if (!shouldExert && random.nextBoolean()) { + if (!shouldExert && MyRandom.getRandom().nextBoolean()) { // TODO Improve when the AI wants to use Exert powers shouldExert = true; }