mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Added a new AI SVar: MustBeBlocked.
- Added it to Phage the Untouchable.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user