- Removed some randomness relics from CanPlayAI functions.

This commit is contained in:
Sloth
2012-07-15 14:41:36 +00:00
parent a88edded34
commit 725436f7c2
2 changed files with 5 additions and 5 deletions

View File

@@ -470,7 +470,7 @@ public class AbilityFactoryAttach {
// TODO If Not Mandatory, make sure the card is "good enough"
if (c.isCreature()) {
final int eval = CardFactoryUtil.evaluateCreature(c);
if ((eval < 160) && ((eval < 130) || (AllZone.getComputerPlayer().getLife() > 5))) {
if (eval < 130) {
return null;
}
}

View File

@@ -340,15 +340,15 @@ public class AbilityFactoryZoneAffecting {
double chance = .4; // 40 percent chance of drawing with instant speed
// stuff
final Random r = MyRandom.getRandom();
boolean randomReturn = r.nextFloat() <= Math.pow(chance, sa.getActivationsThisTurn() + 1);
if (AbilityFactory.isSorcerySpeed(sa)) {
chance = .667; // 66.7% chance for sorcery speed
randomReturn = true;
}
if ((Singletons.getModel().getGameState().getPhaseHandler().is(PhaseType.END_OF_TURN)
&& Singletons.getModel().getGameState().getPhaseHandler().isNextTurn(AllZone.getComputerPlayer()))) {
chance = .9; // 90% for end of opponents turn
randomReturn = true;
}
final Random r = MyRandom.getRandom();
boolean randomReturn = r.nextFloat() <= Math.pow(chance, sa.getActivationsThisTurn() + 1);
if (AbilityFactory.playReusable(sa)) {
randomReturn = true;