mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Clean up (#2907)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user