Wall of Shadows + Thought Lash fix

This commit is contained in:
tool4EvEr
2023-01-15 10:03:28 +01:00
parent b0bc41f09c
commit 7db4624d92
6 changed files with 41 additions and 41 deletions

View File

@@ -1473,11 +1473,9 @@ public class AiController {
return singleSpellAbilityList(simPicker.chooseSpellAbilityToPlay(null));
}
CardCollection landsWannaPlay = ComputerUtilAbility.getAvailableLandsToPlay(game, player);
CardCollection playBeforeLand = CardLists.filter(
player.getCardsIn(ZoneType.Hand), CardPredicates.hasSVar("PlayBeforeLandDrop")
);
if (!playBeforeLand.isEmpty()) {
SpellAbility wantToPlayBeforeLand = chooseSpellAbilityToPlayFromList(
ComputerUtilAbility.getSpellAbilities(playBeforeLand, player), false
@@ -1486,7 +1484,8 @@ public class AiController {
return singleSpellAbilityList(wantToPlayBeforeLand);
}
}
CardCollection landsWannaPlay = ComputerUtilAbility.getAvailableLandsToPlay(game, player);
if (landsWannaPlay != null) {
landsWannaPlay = filterLandsToPlay(landsWannaPlay);
Log.debug("Computer " + game.getPhaseHandler().getPhase().nameForUi);

View File

@@ -43,8 +43,6 @@ import forge.game.card.CardView;
import forge.game.card.CounterType;
import forge.game.combat.Combat;
import forge.game.cost.Cost;
import forge.game.cost.CostAdjustment;
import forge.game.cost.CostExile;
import forge.game.cost.CostPart;
import forge.game.cost.CostPartMana;
import forge.game.keyword.KeywordInterface;
@@ -698,24 +696,6 @@ public class PlayerControllerAi extends PlayerController {
ability.setActivatingPlayer(c.getController(), true);
ability.setCardState(sa.getCardState());
// FIXME: This is a hack to check if the AI can play the "exile from library" pay costs (Cumulative Upkeep,
// e.g. Thought Lash). We have to do it and bail early if the AI can't pay, because otherwise the AI will
// pay the cost partially, which should not be possible
int nExileLib = 0;
List<CostPart> parts = CostAdjustment.adjust(cost, sa).getCostParts();
for (final CostPart part : parts) {
if (part instanceof CostExile) {
CostExile exile = (CostExile) part;
if (exile.from == ZoneType.Library) {
nExileLib += exile.convertAmount();
}
}
}
if (nExileLib > c.getController().getCardsIn(ZoneType.Library).size()) {
return false;
}
// - End of hack for Exile a card from library Cumulative Upkeep -
if (ComputerUtilCost.canPayCost(ability, c.getController(), true)) {
ComputerUtil.playNoStack(c.getController(), ability, getGame(), true);
// transfer this info for Balduvian Fallen