mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- Removed some randomness from the AI (which doesn't work well with charms).
This commit is contained in:
@@ -18,13 +18,9 @@ public class DigAi extends SpellAbilityAi {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected boolean canPlayAI(AIPlayer ai, SpellAbility sa) {
|
protected boolean canPlayAI(AIPlayer ai, SpellAbility sa) {
|
||||||
double chance = .4; // 40 percent chance with instant speed stuff
|
|
||||||
if (SpellAbilityAi.isSorcerySpeed(sa)) {
|
|
||||||
chance = .667; // 66.7% chance for sorcery speed (since it will
|
|
||||||
// never activate EOT)
|
|
||||||
}
|
|
||||||
final Random r = MyRandom.getRandom();
|
final Random r = MyRandom.getRandom();
|
||||||
boolean randomReturn = r.nextFloat() <= Math.pow(chance, sa.getActivationsThisTurn() + 1);
|
boolean randomReturn = r.nextFloat() <= Math.pow(0.9, sa.getActivationsThisTurn());
|
||||||
|
|
||||||
Player opp = ai.getOpponent();
|
Player opp = ai.getOpponent();
|
||||||
final Target tgt = sa.getTarget();
|
final Target tgt = sa.getTarget();
|
||||||
|
|||||||
Reference in New Issue
Block a user