- CheckStyle.

This commit is contained in:
Chris
2012-11-12 01:58:08 +00:00
parent 287d7652ee
commit c1f9094840

View File

@@ -12,7 +12,7 @@ import forge.game.player.Player;
import forge.util.MyRandom; import forge.util.MyRandom;
public class CharmAi extends SpellAiLogic { public class CharmAi extends SpellAiLogic {
@Override @Override
protected boolean canPlayAI(Player ai, SpellAbility sa) { protected boolean canPlayAI(Player ai, SpellAbility sa) {
final Random r = MyRandom.getRandom(); final Random r = MyRandom.getRandom();
@@ -23,10 +23,10 @@ public class CharmAi extends SpellAiLogic {
List<AbilitySub> chooseFrom = CharmEffect.makePossibleOptions(sa); List<AbilitySub> chooseFrom = CharmEffect.makePossibleOptions(sa);
List<AbilitySub> chosenList = chooseOptionsAi(ai, timingRight, chooseFrom, num, min); List<AbilitySub> chosenList = chooseOptionsAi(ai, timingRight, chooseFrom, num, min);
if (chosenList == null || chosenList.isEmpty()) { if (chosenList == null || chosenList.isEmpty()) {
return false; return false;
} }
// prevent run-away activations - first time will always return true // prevent run-away activations - first time will always return true
return r.nextFloat() <= Math.pow(.6667, sa.getActivationsThisTurn()); return r.nextFloat() <= Math.pow(.6667, sa.getActivationsThisTurn());
@@ -51,9 +51,10 @@ public class CharmAi extends SpellAiLogic {
break; break;
} }
} }
if (thisPick != null) if (thisPick != null) {
chosenList.add(thisPick); chosenList.add(thisPick);
}
} }
return chosenList.size() >= min ? chosenList : null; return chosenList.size() >= min ? chosenList : null;
} }
} }