mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
- Improved AI for Cleansing
This commit is contained in:
@@ -2,7 +2,7 @@ Name:Cleansing
|
|||||||
ManaCost:W W W
|
ManaCost:W W W
|
||||||
Types:Sorcery
|
Types:Sorcery
|
||||||
A:SP$ RepeatEach | Cost$ W W W | RepeatSubAbility$ DBSac | RepeatCards$ Land | SpellDescription$ For each land, destroy that land unless any player pays 1 life.
|
A:SP$ RepeatEach | Cost$ W W W | RepeatSubAbility$ DBSac | RepeatCards$ Land | SpellDescription$ For each land, destroy that land unless any player pays 1 life.
|
||||||
SVar:DBSac:DB$ Destroy | UnlessCost$ PayLife<1> | UnlessPayer$ Player | Defined$ Remembered
|
SVar:DBSac:DB$ Destroy | UnlessCost$ PayLife<1> | UnlessPayer$ Player | UnlessAI$ DefinedRememberedController | Defined$ Remembered
|
||||||
SVar:RemAIDeck:True
|
SVar:RemAIDeck:True
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/cleansing.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/cleansing.jpg
|
||||||
Oracle:For each land, destroy that land unless any player pays 1 life.
|
Oracle:For each land, destroy that land unless any player pays 1 life.
|
||||||
|
|||||||
@@ -1181,11 +1181,19 @@ public class AbilityUtils {
|
|||||||
private static boolean willAIPayForAbility(SpellAbility sa, Player payer, SpellAbility ability, boolean paid, List<Player> payers) {
|
private static boolean willAIPayForAbility(SpellAbility sa, Player payer, SpellAbility ability, boolean paid, List<Player> payers) {
|
||||||
Card source = sa.getSourceCard();
|
Card source = sa.getSourceCard();
|
||||||
boolean payForOwnOnly = "OnlyOwn".equals(sa.getParam("UnlessAI"));
|
boolean payForOwnOnly = "OnlyOwn".equals(sa.getParam("UnlessAI"));
|
||||||
|
boolean payOwner = sa.getParam("UnlessAI").startsWith("Defined");
|
||||||
boolean payNever = "Never".equals(sa.getParam("UnlessAI"));
|
boolean payNever = "Never".equals(sa.getParam("UnlessAI"));
|
||||||
boolean isMine = sa.getActivatingPlayer().equals(payer);
|
boolean isMine = sa.getActivatingPlayer().equals(payer);
|
||||||
|
|
||||||
if (payNever) { return false; }
|
if (payNever) { return false; }
|
||||||
if (payForOwnOnly && !isMine) { return false; }
|
if (payForOwnOnly && !isMine) { return false; }
|
||||||
|
if (payOwner) {
|
||||||
|
final String defined = sa.getParam("UnlessAI").substring(7);
|
||||||
|
final Player player = AbilityUtils.getDefinedPlayers(source, defined, sa).get(0);
|
||||||
|
if (!payer.equals(player)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// AI will only pay when it's not already payed and only opponents abilities
|
// AI will only pay when it's not already payed and only opponents abilities
|
||||||
if (paid || (payers.size() > 1 && (isMine && !payForOwnOnly))) {
|
if (paid || (payers.size() > 1 && (isMine && !payForOwnOnly))) {
|
||||||
|
|||||||
Reference in New Issue
Block a user