mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Fix predictThreatenedObjects (using Regenerate against Curse)
This commit is contained in:
@@ -1748,7 +1748,7 @@ public class ComputerUtil {
|
|||||||
if (o instanceof Card) {
|
if (o instanceof Card) {
|
||||||
final Card c = (Card) o;
|
final Card c = (Card) o;
|
||||||
final boolean canRemove = (c.getNetToughness() <= dmg)
|
final boolean canRemove = (c.getNetToughness() <= dmg)
|
||||||
|| (!c.hasKeyword(Keyword.INDESTRUCTIBLE) && c.getShieldCount() == 0 && (dmg >= ComputerUtilCombat.getDamageToKill(c, false)));
|
|| (!c.hasKeyword(Keyword.INDESTRUCTIBLE) && c.getShieldCount() == 0 && dmg >= ComputerUtilCombat.getDamageToKill(c, false));
|
||||||
if (!canRemove) {
|
if (!canRemove) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1770,7 +1770,7 @@ public class ComputerUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (saviourApi == ApiType.Protection) {
|
if (saviourApi == ApiType.Protection) {
|
||||||
if (!topStack.usesTargeting() || (ProtectAi.toProtectFrom(source, saviour) == null)) {
|
if (!topStack.usesTargeting() || ProtectAi.toProtectFrom(source, saviour) == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1813,7 +1813,7 @@ public class ComputerUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (saviourApi == ApiType.Protection) {
|
if (saviourApi == ApiType.Protection) {
|
||||||
if (!topStack.usesTargeting() || (ProtectAi.toProtectFrom(source, saviour) == null)) {
|
if (!topStack.usesTargeting() || ProtectAi.toProtectFrom(source, saviour) == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1846,7 +1846,7 @@ public class ComputerUtil {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (saviourApi == ApiType.Protection) {
|
if (saviourApi == ApiType.Protection) {
|
||||||
if (!topStack.usesTargeting() || (ProtectAi.toProtectFrom(source, saviour) == null)) {
|
if (!topStack.usesTargeting() || ProtectAi.toProtectFrom(source, saviour) == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1870,11 +1870,11 @@ public class ComputerUtil {
|
|||||||
if (o instanceof Card) {
|
if (o instanceof Card) {
|
||||||
final Card c = (Card) o;
|
final Card c = (Card) o;
|
||||||
// give Shroud to targeted creatures
|
// give Shroud to targeted creatures
|
||||||
if ((saviourApi == ApiType.Pump || saviourApi == ApiType.PumpAll && !topStack.usesTargeting()) && !grantShroud) {
|
if ((saviourApi == ApiType.Pump || saviourApi == ApiType.PumpAll) && (!topStack.usesTargeting() || !grantShroud)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (saviourApi == ApiType.Protection) {
|
if (saviourApi == ApiType.Protection) {
|
||||||
if (!topStack.usesTargeting() || (ProtectAi.toProtectFrom(source, saviour) == null)) {
|
if (!topStack.usesTargeting() || ProtectAi.toProtectFrom(source, saviour) == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1883,7 +1883,9 @@ public class ComputerUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Generic curse auras
|
//Generic curse auras
|
||||||
else if ((threatApi == ApiType.Attach && (topStack.isCurse() || "Curse".equals(topStack.getParam("AILogic"))))) {
|
else if ((threatApi == ApiType.Attach && (topStack.isCurse() || "Curse".equals(topStack.getParam("AILogic"))))
|
||||||
|
&& (saviourApi == ApiType.Pump || saviourApi == ApiType.PumpAll
|
||||||
|
|| saviourApi == ApiType.Protection || saviourApi == null)) {
|
||||||
AiController aic = aiPlayer.isAI() ? ((PlayerControllerAi)aiPlayer.getController()).getAi() : null;
|
AiController aic = aiPlayer.isAI() ? ((PlayerControllerAi)aiPlayer.getController()).getAi() : null;
|
||||||
boolean enableCurseAuraRemoval = aic != null ? aic.getBooleanProperty(AiProps.ACTIVELY_DESTROY_IMMEDIATELY_UNBLOCKABLE) : false;
|
boolean enableCurseAuraRemoval = aic != null ? aic.getBooleanProperty(AiProps.ACTIVELY_DESTROY_IMMEDIATELY_UNBLOCKABLE) : false;
|
||||||
if (enableCurseAuraRemoval) {
|
if (enableCurseAuraRemoval) {
|
||||||
@@ -1891,7 +1893,7 @@ public class ComputerUtil {
|
|||||||
if (o instanceof Card) {
|
if (o instanceof Card) {
|
||||||
final Card c = (Card) o;
|
final Card c = (Card) o;
|
||||||
// give Shroud to targeted creatures
|
// give Shroud to targeted creatures
|
||||||
if ((saviourApi == ApiType.Pump || saviourApi == ApiType.PumpAll && !topStack.usesTargeting()) && !grantShroud) {
|
if ((saviourApi == ApiType.Pump || saviourApi == ApiType.PumpAll) && (!topStack.usesTargeting() || !grantShroud)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (saviourApi == ApiType.Protection) {
|
if (saviourApi == ApiType.Protection) {
|
||||||
|
|||||||
Reference in New Issue
Block a user