mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Improved MillAi.
This commit is contained in:
@@ -48,10 +48,9 @@ public class MillAi extends SpellAbilityAi {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
final Random r = MyRandom.getRandom();
|
|
||||||
|
|
||||||
// Don't use draw abilities before main 2 if possible
|
// Don't use draw abilities before main 2 if possible
|
||||||
if (ai.getGame().getPhaseHandler().getPhase().isBefore(PhaseType.MAIN2) && !sa.hasParam("ActivationPhases")) {
|
if (ai.getGame().getPhaseHandler().getPhase().isBefore(PhaseType.MAIN2) && !sa.hasParam("ActivationPhases")
|
||||||
|
&& !ComputerUtil.castSpellInMain1(ai, sa)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,10 +66,11 @@ public class MillAi extends SpellAbilityAi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((ai.getGame().getPhaseHandler().is(PhaseType.END_OF_TURN) && ai.getGame().getPhaseHandler().getNextTurn().equals(ai))) {
|
if ((ai.getGame().getPhaseHandler().is(PhaseType.END_OF_TURN) && ai.getGame().getPhaseHandler().getNextTurn().equals(ai))) {
|
||||||
chance = .9; // 90% for end of opponents turn
|
chance = .95; // 90% for end of opponents turn
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean randomReturn = r.nextFloat() <= Math.pow(chance, sa.getActivationsThisTurn() + 1);
|
final Random r = MyRandom.getRandom();
|
||||||
|
boolean randomReturn = r.nextFloat() <= Math.pow(chance, sa.getActivationsThisTurn());
|
||||||
|
|
||||||
if ((sa.getParam("NumCards").equals("X") || sa.getParam("NumCards").equals("Z")) && source.getSVar("X").startsWith("Count$xPaid")) {
|
if ((sa.getParam("NumCards").equals("X") || sa.getParam("NumCards").equals("Z")) && source.getSVar("X").startsWith("Count$xPaid")) {
|
||||||
// Set PayX here to maximum value.
|
// Set PayX here to maximum value.
|
||||||
|
|||||||
@@ -1021,8 +1021,17 @@ public class ComputerUtil {
|
|||||||
final SpellAbility sub = sa.getSubAbility();
|
final SpellAbility sub = sa.getSubAbility();
|
||||||
|
|
||||||
// Cipher spells
|
// Cipher spells
|
||||||
if (sub != null && ApiType.Encode == sub.getApi() && !ai.getCreaturesInPlay().isEmpty()) {
|
if (sub != null) {
|
||||||
return true;
|
final ApiType api = sub.getApi();
|
||||||
|
if (ApiType.Encode == api && !ai.getCreaturesInPlay().isEmpty()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (ApiType.PumpAll == api && !ai.getCreaturesInPlay().isEmpty()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (ApiType.Pump == api) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
final List<Card> buffed = ai.getCardsIn(ZoneType.Battlefield);
|
final List<Card> buffed = ai.getCardsIn(ZoneType.Battlefield);
|
||||||
for (Card buffedcard : buffed) {
|
for (Card buffedcard : buffed) {
|
||||||
|
|||||||
Reference in New Issue
Block a user