- 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

@@ -1,16 +1,18 @@
Name:Phage the Untouchable Name:Phage the Untouchable
ManaCost:3 B B B B ManaCost:3 B B B B
Types:Legendary Creature Zombie Minion Types:Legendary Creature Zombie Minion
Text:no text Text:no text
PT:4/4 PT:4/4
T:Mode$ ChangesZone | ValidCard$ Card.wasNotCastFromHand+Self | Destination$ Battlefield | Execute$ TrigYouLose | TriggerDescription$ When CARDNAME enters the battlefield, if you didn't cast it from your hand, you lose the game. T:Mode$ ChangesZone | ValidCard$ Card.wasNotCastFromHand+Self | Destination$ Battlefield | Execute$ TrigYouLose | TriggerDescription$ When CARDNAME enters the battlefield, if you didn't cast it from your hand, you lose the game.
SVar:TrigYouLose:AB$LosesGame | Cost$ 0 | Defined$ You SVar:TrigYouLose:AB$LosesGame | Cost$ 0 | Defined$ You
T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Creature | CombatDamage$ True | Execute$ TrigDestroy | TriggerDescription$ Whenever CARDNAME deals combat damage to a creature, destroy that creature. It can't be regenerated. T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Creature | CombatDamage$ True | Execute$ TrigDestroy | TriggerDescription$ Whenever CARDNAME deals combat damage to a creature, destroy that creature. It can't be regenerated.
SVar:TrigDestroy:AB$Destroy | Cost$ 0 | Defined$ TriggeredTarget | NoRegen$ True 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. 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:TrigTheyLose:AB$LosesGame | Cost$ 0 | Defined$ TriggeredTarget
SVar:Picture:http://www.wizards.com/global/images/magic/general/phage_the_untouchable.jpg SVar:MustBeBlocked:True
SetInfo:LGN|Rare|http://magiccards.info/scans/en/le/78.jpg SVar:Rarity:Rare
SetInfo:10E|Rare|http://magiccards.info/scans/en/10e/166.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/phage_the_untouchable.jpg
Oracle:When Phage the Untouchable enters the battlefield, if you didn't cast it from your hand, you lose the game.\nWhenever Phage deals combat damage to a creature, destroy that creature. It can't be regenerated.\nWhenever Phage deals combat damage to a player, that player loses the game. SetInfo:LGN|Rare|http://magiccards.info/scans/en/le/78.jpg
SetInfo:10E|Rare|http://magiccards.info/scans/en/10e/166.jpg
Oracle:When Phage the Untouchable enters the battlefield, if you didn't cast it from your hand, you lose the game.\nWhenever Phage deals combat damage to a creature, destroy that creature. It can't be regenerated.\nWhenever Phage deals combat damage to a player, that player loses the game.
End End

View File

@@ -1130,6 +1130,20 @@ public class CombatUtil {
return false; 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())) if ((CombatUtil.lifeThatWouldRemain(combat) < Math.min(4, AllZone.getComputerPlayer().getLife()))
&& !AllZone.getComputerPlayer().cantLoseForZeroOrLessLife()) { && !AllZone.getComputerPlayer().cantLoseForZeroOrLessLife()) {
return true; return true;
@@ -1170,6 +1184,20 @@ public class CombatUtil {
return false; 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()) { if ((CombatUtil.lifeThatWouldRemain(combat) < 1) && !AllZone.getComputerPlayer().cantLoseForZeroOrLessLife()) {
return true; return true;
} }