This commit is contained in:
tool4ever
2023-04-12 22:48:12 +02:00
committed by GitHub
parent e970033b59
commit 76a2023745
31 changed files with 66 additions and 93 deletions

View File

@@ -1211,7 +1211,7 @@ public class ComputerUtil {
creatures2.add(creatures.get(i));
}
}
if (((creatures2.size() + CardUtil.getThisTurnCast("Creature.YouCtrl", vengevines.get(0), null).size()) > 1)
if (((creatures2.size() + CardUtil.getThisTurnCast("Creature.YouCtrl", vengevines.get(0), null, ai).size()) > 1)
&& card.isCreature() && card.getManaCost().getCMC() <= 3) {
return true;
}

View File

@@ -198,13 +198,6 @@ public class ChooseCardAi extends SpellAbilityAi {
} else if ("RandomNonLand".equals(logic)) {
options = CardLists.getValidCards(options, "Card.nonLand", host.getController(), host, sa);
choice = Aggregates.random(options);
} else if (logic.equals("Untap")) {
final String filter = "Permanent.YouCtrl,Permanent.tapped";
CardCollection newOptions = CardLists.getValidCards(options, filter, ctrl, host, sa);
if (!newOptions.isEmpty()) {
options = newOptions;
}
choice = ComputerUtilCard.getBestAI(options);
} else if (logic.equals("NeedsPrevention")) {
final Game game = ai.getGame();
final Combat combat = game.getCombat();

View File

@@ -3,11 +3,14 @@ package forge.ai.ability;
import forge.ai.*;
import forge.game.ability.AbilityUtils;
import forge.game.card.Card;
import forge.game.card.CardCollection;
import forge.game.card.CardLists;
import forge.game.cost.Cost;
import forge.game.phase.PhaseHandler;
import forge.game.phase.PhaseType;
import forge.game.player.Player;
import forge.game.spellability.SpellAbility;
import forge.game.zone.ZoneType;
public class TapAi extends TapAiBase {
@Override
@@ -52,8 +55,15 @@ public class TapAi extends TapAiBase {
}
if (!sa.usesTargeting()) {
CardCollection untap;
if (sa.hasParam("CardChoices")) {
untap = CardLists.getValidCards(source.getGame().getCardsIn(ZoneType.Battlefield), sa.getParam("CardChoices"), ai, source, sa);
} else {
untap = AbilityUtils.getDefinedCards(source, sa.getParam("Defined"), sa);
}
boolean bFlag = false;
for (final Card c : AbilityUtils.getDefinedCards(source, sa.getParam("Defined"), sa)) {
for (final Card c : untap) {
bFlag |= c.isUntapped();
}