- Fix the AI killing itself with Mystic Forge.

- The AI shouldn't miss the NameCard trigger. However, there's no meaningful AI logic yet, so the AI will just name a random thing for now.
This commit is contained in:
Michael Kamensky
2020-08-27 07:38:49 +03:00
parent a3e692329a
commit 3bc2cde046
2 changed files with 5 additions and 1 deletions

View File

@@ -54,7 +54,7 @@ public class ChooseCardNameAi extends SpellAbilityAi {
@Override @Override
protected boolean doTriggerAINoCost(Player aiPlayer, SpellAbility sa, boolean mandatory) { protected boolean doTriggerAINoCost(Player aiPlayer, SpellAbility sa, boolean mandatory) {
// TODO - there is no AILogic implemented yet // TODO - there is no AILogic implemented yet
return false; return mandatory;
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see forge.card.ability.SpellAbilityAi#chooseSingleCard(forge.card.spellability.SpellAbility, java.util.List, boolean) * @see forge.card.ability.SpellAbilityAi#chooseSingleCard(forge.card.spellability.SpellAbility, java.util.List, boolean)

View File

@@ -32,6 +32,10 @@ public class DigAi extends SpellAbilityAi {
final Card host = sa.getHostCard(); final Card host = sa.getHostCard();
Player libraryOwner = ai; Player libraryOwner = ai;
if (!willPayCosts(ai, sa, sa.getPayCosts(), host)) {
return false;
}
if (sa.usesTargeting()) { if (sa.usesTargeting()) {
sa.resetTargets(); sa.resetTargets();
if (!opp.canBeTargetedBy(sa)) { if (!opp.canBeTargetedBy(sa)) {