mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
- Added a new AI SVar: MustBeBlocked.
- Added it to Phage the Untouchable.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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