mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
- AI should not regenerate creatures affected by burn spells with "can't be regenerated"
This commit is contained in:
@@ -1355,6 +1355,17 @@ public class ComputerUtil {
|
|||||||
// If PredictDamage is >= Lethal Damage
|
// If PredictDamage is >= Lethal Damage
|
||||||
final int dmg = AbilityUtils.calculateAmount(topStack.getHostCard(),
|
final int dmg = AbilityUtils.calculateAmount(topStack.getHostCard(),
|
||||||
topStack.getParam("NumDmg"), topStack);
|
topStack.getParam("NumDmg"), topStack);
|
||||||
|
final SpellAbility sub = topStack.getSubAbility();
|
||||||
|
boolean noRegen = false;
|
||||||
|
if (sub.getApi() == ApiType.Pump) {
|
||||||
|
final List<String> keywords = sub.hasParam("KW") ? Arrays.asList(sub.getParam("KW").split(" & ")) : new ArrayList<String>();
|
||||||
|
for (String kw : keywords) {
|
||||||
|
if (kw.contains("can't be regenerated")) {
|
||||||
|
noRegen = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
for (final Object o : objects) {
|
for (final Object o : objects) {
|
||||||
if (o instanceof Card) {
|
if (o instanceof Card) {
|
||||||
final Card c = (Card) o;
|
final Card c = (Card) o;
|
||||||
@@ -1370,7 +1381,8 @@ public class ComputerUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// don't use it on creatures that can't be regenerated
|
// don't use it on creatures that can't be regenerated
|
||||||
if ((saviourApi == ApiType.Regenerate || saviourApi == ApiType.RegenerateAll) && !c.canBeShielded()) {
|
if ((saviourApi == ApiType.Regenerate || saviourApi == ApiType.RegenerateAll) &&
|
||||||
|
(!c.canBeShielded() || noRegen)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user