- 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

@@ -9,6 +9,8 @@ T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Creature | CombatDama
SVar:TrigDestroy:AB$Destroy | Cost$ 0 | Defined$ TriggeredTarget | NoRegen$ True
T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Player | CombatDamage$ True | Execute$ TrigTheyLose | TriggerDescription$ Whenever Phage deals combat damage to a player, that player loses the game.
SVar:TrigTheyLose:AB$LosesGame | Cost$ 0 | Defined$ TriggeredTarget
SVar:MustBeBlocked:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/phage_the_untouchable.jpg
SetInfo:LGN|Rare|http://magiccards.info/scans/en/le/78.jpg
SetInfo:10E|Rare|http://magiccards.info/scans/en/10e/166.jpg

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;
}