mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Prevent the AI from relying on the ability to play a spell with an optional cost when deciding to do an assault attack with possible non-combat damage (prevents certain silly suicidal chump-attacks)
This commit is contained in:
@@ -26,10 +26,7 @@ import forge.card.CardType;
|
|||||||
import forge.card.ColorSet;
|
import forge.card.ColorSet;
|
||||||
import forge.card.MagicColor;
|
import forge.card.MagicColor;
|
||||||
import forge.card.mana.ManaCostShard;
|
import forge.card.mana.ManaCostShard;
|
||||||
import forge.game.CardTraitPredicates;
|
import forge.game.*;
|
||||||
import forge.game.Game;
|
|
||||||
import forge.game.GameObject;
|
|
||||||
import forge.game.GameType;
|
|
||||||
import forge.game.ability.AbilityFactory;
|
import forge.game.ability.AbilityFactory;
|
||||||
import forge.game.ability.AbilityUtils;
|
import forge.game.ability.AbilityUtils;
|
||||||
import forge.game.ability.ApiType;
|
import forge.game.ability.ApiType;
|
||||||
@@ -1454,6 +1451,9 @@ public class ComputerUtil {
|
|||||||
if (!ComputerUtilCost.canPayCost(sa, ai)) {
|
if (!ComputerUtilCost.canPayCost(sa, ai)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!GameActionUtil.getOptionalCostValues(sa).isEmpty()) {
|
||||||
|
continue; // we can't rely on the AI being always willing and able to pay the optional cost to deal extra damage
|
||||||
|
}
|
||||||
damage = dmg;
|
damage = dmg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -466,6 +466,7 @@ public final class GameActionUtil {
|
|||||||
newSA.setPayCosts(new Cost(jumpstartCost, false).add(newSA.getPayCosts()));
|
newSA.setPayCosts(new Cost(jumpstartCost, false).add(newSA.getPayCosts()));
|
||||||
newSA.getRestrictions().setZone(ZoneType.Graveyard);
|
newSA.getRestrictions().setZone(ZoneType.Graveyard);
|
||||||
newSA.setDescription(newSA.getDescription() + " (Jump-start)");
|
newSA.setDescription(newSA.getDescription() + " (Jump-start)");
|
||||||
|
newSA.addOptionalCost(OptionalCost.Jumpstart);
|
||||||
if (newSA.canPlay()) {
|
if (newSA.canPlay()) {
|
||||||
abilities.add(i, newSA);
|
abilities.add(i, newSA);
|
||||||
i++;
|
i++;
|
||||||
|
|||||||
Reference in New Issue
Block a user