- Added 6 events to Time Vault.

- Fixed some minor AI issues.
This commit is contained in:
Agetian
2018-12-02 22:34:15 +03:00
parent 1698ea5bf1
commit a7989737d9
16 changed files with 209 additions and 20 deletions

View File

@@ -821,6 +821,10 @@ public class SpecialCardAi {
int computerHandSize = ai.getZone(ZoneType.Hand).size();
int maxHandSize = ai.getMaxHandSize();
if (ai.getCardsIn(ZoneType.Library).isEmpty()) {
return false; // nothing to draw from the library
}
if (!CardLists.filter(ai.getCardsIn(ZoneType.Battlefield), CardPredicates.nameEquals("Yawgmoth's Bargain")).isEmpty()) {
// Prefer Yawgmoth's Bargain because AI is generally better with it
@@ -1337,6 +1341,10 @@ public class SpecialCardAi {
Game game = ai.getGame();
PhaseHandler ph = game.getPhaseHandler();
if (ai.getCardsIn(ZoneType.Library).isEmpty()) {
return false; // nothing to draw from the library
}
int computerHandSize = ai.getZone(ZoneType.Hand).size();
int maxHandSize = ai.getMaxHandSize();

View File

@@ -110,7 +110,8 @@ public class CopySpellAbilityAi extends SpellAbilityAi {
@Override
protected boolean doTriggerAINoCost(Player aiPlayer, SpellAbility sa, boolean mandatory) {
// the AI should not miss mandatory activations (e.g. Precursor Golem trigger)
return mandatory || "Always".equals(sa.getParam("AILogic"));
String logic = sa.getParamOrDefault("AILogic", "");
return mandatory || logic.contains("Always"); // this includes logic like AlwaysIfViable
}
@Override

View File

@@ -8,6 +8,12 @@ import forge.game.spellability.SpellAbility;
public class ShuffleAi extends SpellAbilityAi {
@Override
protected boolean canPlayAI(Player aiPlayer, SpellAbility sa) {
String logic = sa.getParamOrDefault("AILogic", "");
if (logic.equals("Always")) {
// We may want to play this for the subability, e.g. Mind's Desire
return true;
}
// not really sure when the compy would use this; maybe only after a
// human
// deliberately put a card on top of their library
@@ -47,7 +53,7 @@ public class ShuffleAi extends SpellAbilityAi {
@Override
public boolean confirmAction(Player player, SpellAbility sa, PlayerActionConfirmMode mode, String message) {
// ai could analyze parameter denoting the player to shuffle
// ai could analyze parameter denoting the player to shuffle
return true;
}
}