Update direct references to RemAIDeck/RemRandomDeck to use the new format

This commit is contained in:
Michael Kamensky
2018-10-19 12:13:31 +00:00
committed by Sol
parent 0f118da920
commit 4b52ff05d5
14 changed files with 29 additions and 19 deletions

View File

@@ -528,7 +528,7 @@ public class AiCostDecision extends CostDecisionMakerBase {
// are currently conventionally flagged with AILogic$ DoSacrifice.
c = AbilityUtils.calculateAmount(source, source.getSVar("ChosenX"), null);
} else {
// Other cards are assumed to be flagged RemAIDeck for now
// Other cards are assumed to be flagged AI:RemoveDeck:All for now
return null;
}
} else {

View File

@@ -342,7 +342,7 @@ public class AnimateAi extends SpellAbilityAi {
// This is reasonable for now. Kamahl, Fist of Krosa and a sorcery or
// two are the only things
// that animate a target. Those can just use SVar:RemAIDeck:True until
// that animate a target. Those can just use AI:RemoveDeck:All until
// this can do a reasonably
// good job of picking a good target
return false;

View File

@@ -1459,7 +1459,7 @@ public class ChangeZoneAi extends SpellAbilityAi {
fetchList = CardLists.filter(fetchList, new Predicate<Card>() {
@Override
public boolean apply(final Card c) {
if (c.hasSVar("RemAIDeck") || c.hasSVar("RemRandomDeck")) {
if (c.getRules().getAiHints().getRemAIDecks() || c.getRules().getAiHints().getRemRandomDecks()) {
return false;
}
return true;

View File

@@ -114,7 +114,7 @@ public class ChangeZoneAllAi extends SpellAbilityAi {
// spBounceAll has some AI we can compare to.
if (origin.equals(ZoneType.Hand) || origin.equals(ZoneType.Library)) {
if (!sa.usesTargeting()) {
// TODO: improve logic for non-targeted SAs of this type (most are currently RemAIDeck, e.g. Memory Jar)
// TODO: improve logic for non-targeted SAs of this type (most are currently AI:RemoveDeck:All, e.g. Memory Jar)
return true;
} else {
// search targetable Opponents
@@ -344,8 +344,8 @@ public class ChangeZoneAllAi extends SpellAbilityAi {
if (ComputerUtilAbility.getAbilitySourceName(sa).equals("Profaner of the Dead")) {
// TODO: this is a stub to prevent the AI from crashing the game when, for instance, playing the opponent's
// Profaner from exile without paying its mana cost. Otherwise the card is marked RemAIDeck and there is no
// specific AI to support playing it in a smarter way. Feel free to expand.
// Profaner from exile without paying its mana cost. Otherwise the card is marked AI:RemoveDeck:All and
// there is no specific AI to support playing it in a smarter way. Feel free to expand.
return !CardLists.filter(ai.getOpponents().getCardsIn(origin), CardPredicates.Presets.CREATURES).isEmpty();
}

View File

@@ -146,10 +146,9 @@ public class CloneAi extends SpellAbilityAi {
// Default:
// This is reasonable for now. Kamahl, Fist of Krosa and a sorcery or
// two are the only things
// that clone a target. Those can just use SVar:RemAIDeck:True until
// this can do a reasonably
// good job of picking a good target
// two are the only things that clone a target. Those can just use
// AI:RemoveDeck:All until this can do a reasonably good job of picking
// a good target
return false;
}

View File

@@ -36,7 +36,7 @@ public class ControlExchangeAi extends SpellAbilityAi {
list = CardLists.filter(list, new Predicate<Card>() {
@Override
public boolean apply(final Card c) {
return !c.hasSVar("RemAIDeck") && c.canBeTargetedBy(sa);
return !c.getRules().getAiHints().getRemAIDecks() && c.canBeTargetedBy(sa);
}
});
object1 = ComputerUtilCard.getBestAI(list);

View File

@@ -171,7 +171,7 @@ public class ControlGainAi extends SpellAbilityAi {
}
// do not take control on something it doesn't know how to use
return !c.hasSVar("RemAIDeck");
return !c.getRules().getAiHints().getRemAIDecks();
}
});

View File

@@ -83,7 +83,7 @@ public class CopyPermanentAi extends SpellAbilityAi {
CardCollection list = new CardCollection(CardUtil.getValidCardsToTarget(sa.getTargetRestrictions(), sa));
list = CardLists.filter(list, Predicates.not(CardPredicates.hasSVar("RemAIDeck")));
list = CardLists.filter(list, Predicates.not(CardPredicates.isRemAIDeck()));
//Nothing to target
if (list.isEmpty()) {
return false;

View File

@@ -38,8 +38,7 @@ public class PowerExchangeAi extends SpellAbilityAi {
list = CardLists.filter(list, new Predicate<Card>() {
@Override
public boolean apply(final Card c) {
final Map<String, String> vars = c.getSVars();
return !vars.containsKey("RemAIDeck") && c.canBeTargetedBy(sa);
return !c.getRules().getAiHints().getRemAIDecks() && c.canBeTargetedBy(sa);
}
});
CardLists.sortByPowerAsc(list);

View File

@@ -133,7 +133,7 @@ public class SacrificeAi extends SpellAbilityAi {
List<Card> humanList =
CardLists.getValidCards(opp.getCardsIn(ZoneType.Battlefield), valid.split(","), sa.getActivatingPlayer(), sa.getHostCard(), sa);
// Since all of the cards have remAIDeck:True, I enabled 1 for 1
// Since all of the cards have AI:RemoveDeck:All, I enabled 1 for 1
// (or X for X) trades for special decks
if (humanList.size() < amount) {
return false;