mirror of
https://github.com/correl/mage.git
synced 2025-01-11 11:05:23 +00:00
- Blocking by the AI should no longer freeze. Please post any errors. Small attack AI adjustments.
This commit is contained in:
parent
14a4a786e8
commit
ad035f1e47
2 changed files with 13 additions and 8 deletions
|
@ -1094,14 +1094,18 @@ public class ComputerPlayer6 extends ComputerPlayer<ComputerPlayer6> implements
|
|||
|
||||
if (attacker.getToughness().getValue() == blocker.getPower().getValue()
|
||||
&& attacker.getPower().getValue() == blocker.getToughness().getValue()) {
|
||||
if (attackerValue < blockerValue
|
||||
if (attackerValue > blockerValue
|
||||
|| blocker.getAbilities().containsKey(FirstStrikeAbility.getInstance().getId())
|
||||
|| blocker.getAbilities().containsKey(DoubleStrikeAbility.getInstance().getId())) {
|
||||
|| blocker.getAbilities().containsKey(DoubleStrikeAbility.getInstance().getId())
|
||||
|| blocker.getAbilities().contains(new ExaltedAbility())
|
||||
|| blocker.getAbilities().containsKey(DeathtouchAbility.getInstance().getId())
|
||||
|| blocker.getAbilities().contains(new IndestructibleAbility())) {
|
||||
safeToAttack = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (attacker.getAbilities().containsKey(DeathtouchAbility.getInstance().getId())) {
|
||||
if (attacker.getAbilities().containsKey(DeathtouchAbility.getInstance().getId())
|
||||
|| attacker.getAbilities().contains(new IndestructibleAbility())) {
|
||||
safeToAttack = true;
|
||||
}
|
||||
if (safeToAttack) {
|
||||
|
|
|
@ -222,8 +222,8 @@ public class CombatUtil {
|
|||
simulateStep(sim, new FirstCombatDamageStep());
|
||||
simulateStep(sim, new CombatDamageStep());
|
||||
simulateStep(sim, new EndOfCombatStep());
|
||||
|
||||
sim.checkStateAndTriggered();
|
||||
// The following commented out call produces random freezes.
|
||||
//sim.checkStateAndTriggered();
|
||||
while (!sim.getStack().isEmpty()) {
|
||||
sim.getStack().resolve(sim);
|
||||
sim.applyEffects();
|
||||
|
@ -255,8 +255,8 @@ public class CombatUtil {
|
|||
simulateStep(sim, new FirstCombatDamageStep());
|
||||
simulateStep(sim, new CombatDamageStep());
|
||||
simulateStep(sim, new EndOfCombatStep());
|
||||
|
||||
sim.checkStateAndTriggered();
|
||||
// The following commented out call produces random freezes.
|
||||
//sim.checkStateAndTriggered();
|
||||
while (!sim.getStack().isEmpty()) {
|
||||
triggered = true;
|
||||
sim.getStack().resolve(sim);
|
||||
|
@ -270,7 +270,8 @@ public class CombatUtil {
|
|||
game.getPhase().setStep(step);
|
||||
if (!step.skipStep(game, game.getActivePlayerId())) {
|
||||
step.beginStep(game, game.getActivePlayerId());
|
||||
game.checkStateAndTriggered();
|
||||
// The following commented out call produces random freezes.
|
||||
//game.checkStateAndTriggered();
|
||||
while (!game.getStack().isEmpty()) {
|
||||
game.getStack().resolve(game);
|
||||
game.applyEffects();
|
||||
|
|
Loading…
Reference in a new issue