- Added a new AI SVar: MustBeBlocked.

- Added it to Phage the Untouchable.
This commit is contained in:
Sloth
2012-01-25 11:20:59 +00:00
parent 805aa7112b
commit 1ff5420145
2 changed files with 45 additions and 15 deletions

View File

@@ -1130,6 +1130,20 @@ public class CombatUtil {
return false;
}
//check for creatures that must be blocked
final CardList attackers = combat.sortAttackerByDefender()[0];
for (final Card attacker : attackers) {
final CardList blockers = combat.getBlockers(attacker);
if (blockers.size() == 0) {
if (attacker.getSVar("MustBeBlocked") != null) {
return true;
}
}
}
if ((CombatUtil.lifeThatWouldRemain(combat) < Math.min(4, AllZone.getComputerPlayer().getLife()))
&& !AllZone.getComputerPlayer().cantLoseForZeroOrLessLife()) {
return true;
@@ -1170,6 +1184,20 @@ public class CombatUtil {
return false;
}
//check for creatures that must be blocked
final CardList attackers = combat.sortAttackerByDefender()[0];
for (final Card attacker : attackers) {
final CardList blockers = combat.getBlockers(attacker);
if (blockers.size() == 0) {
if (attacker.getSVar("MustBeBlocked") != null) {
return true;
}
}
}
if ((CombatUtil.lifeThatWouldRemain(combat) < 1) && !AllZone.getComputerPlayer().cantLoseForZeroOrLessLife()) {
return true;
}