- Implemented AI for Temur Sabertooth

This commit is contained in:
excessum
2015-03-07 03:54:12 +00:00
parent 2b4f900710
commit e1ad69e417
2 changed files with 19 additions and 2 deletions

View File

@@ -1051,7 +1051,9 @@ public class ComputerUtilCard {
} }
//1. save combatant //1. save combatant
if (ComputerUtilCombat.combatantWouldBeDestroyed(ai, c, combat) && !pumpedWillDie) { if (ComputerUtilCombat.combatantWouldBeDestroyed(ai, c, combat) && !pumpedWillDie
&& !c.hasKeyword("Indestructible")) { // hack because attackerWouldBeDestroyed() does not
// check for Indestructible when computing lethal damage
return true; return true;
} }

View File

@@ -31,6 +31,7 @@ import forge.game.spellability.TargetRestrictions;
import forge.game.zone.ZoneType; import forge.game.zone.ZoneType;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
public class ChangeZoneAi extends SpellAbilityAi { public class ChangeZoneAi extends SpellAbilityAi {
@@ -294,6 +295,20 @@ public class ChangeZoneAi extends SpellAbilityAi {
source.setSVar("PayX", Integer.toString(xPay)); source.setSVar("PayX", Integer.toString(xPay));
} }
} }
if (source.getName().equals("Temur Sabertooth")) {
// activated bounce + pump
if (ComputerUtilCard.shouldPumpCard(ai, sa.getSubAbility(), source, 0, 0, Arrays.asList("Indestructible")) ||
ComputerUtilCard.canPumpAgainstRemoval(ai, sa.getSubAbility())) {
for (Card c : list) {
if (ComputerUtilCard.evaluateCreature(c) < ComputerUtilCard.evaluateCreature(source)) {
return true;
}
}
}
return false;
}
} }
if (ComputerUtil.playImmediately(ai, sa)) { if (ComputerUtil.playImmediately(ai, sa)) {