mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
- Added 6 events to Time Vault.
- Fixed some minor AI issues.
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user