mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
- Improved and fixed AI using Ashiok, Nightmare Weaver.
This commit is contained in:
@@ -506,9 +506,8 @@ public class AiCostDecision extends CostDecisionMakerBase implements ICostVisito
|
||||
if (c == null) {
|
||||
final String sVar = ability.getSVar(amount);
|
||||
if (sVar.equals("XChoice")) {
|
||||
return null;
|
||||
}
|
||||
if (amount.equals("All")) {
|
||||
c = AbilityUtils.calculateAmount(source, "ChosenX", ability);
|
||||
} else if (amount.equals("All")) {
|
||||
c = source.getCounters(cost.counter);
|
||||
} else {
|
||||
c = AbilityUtils.calculateAmount(source, amount, ability);
|
||||
|
||||
@@ -87,9 +87,15 @@ public class ChooseCardAi extends SpellAbilityAi {
|
||||
}
|
||||
} else if (logic.equals("Ashiok")) {
|
||||
final int loyalty = host.getCounters(CounterType.LOYALTY) - 1;
|
||||
host.setSVar("ChosenX", "Number$" + loyalty);
|
||||
choiceZone = ZoneType.smartValueOf(sa.getParam("ChoiceZone"));
|
||||
choices = CardLists.getValidCards(choices, sa.getParam("Choices"), host.getController(), host);
|
||||
for (int i = loyalty; i >= 0; i--) {
|
||||
host.setSVar("ChosenX", "Number$" + i);
|
||||
choices = ai.getGame().getCardsIn(choiceZone);
|
||||
choices = CardLists.getValidCards(choices, sa.getParam("Choices"), host.getController(), host);
|
||||
if (!choices.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (choices.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user