mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +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;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ ManaCost:1 U B
|
||||
Types:Planeswalker Ashiok
|
||||
Loyalty:3
|
||||
A:AB$ Mill | Cost$ AddCounter<2/LOYALTY> | ValidTgts$ Opponent | NumCards$ 3 | Destination$ Exile | Planeswalker$ True | RememberMilled$ True | SpellDescription$ Exile the top three cards of target opponent's library.
|
||||
A:AB$ ChooseCard | Cost$ SubCounter<X/LOYALTY> | References$ X | Choices$ Creature.cmcEQChosenX+IsRemembered | ChoiceZone$ Exile | Planeswalker$ True | SubAbility$ DBChangeZone | SpellDescription$ Put a creature card with converted mana cost X exiled with CARDNAME onto the battlefield under your control. That creature is a Nightmare in addition to its other types.
|
||||
A:AB$ ChooseCard | Cost$ SubCounter<X/LOYALTY> | References$ X | Choices$ Creature.cmcEQChosenX+IsRemembered | ChoiceZone$ Exile | Planeswalker$ True | SubAbility$ DBChangeZone | AILogic$ Ashiok | SpellDescription$ Put a creature card with converted mana cost X exiled with CARDNAME onto the battlefield under your control. That creature is a Nightmare in addition to its other types.
|
||||
SVar:DBChangeZone:DB$ ChangeZone | Defined$ ChosenCard | Origin$ Exile | Destination$ Battlefield | ChangeType$ Creature.cmcEQChosenX+IsRemembered | ChangeNum$ 1 | GainControl$ True | Imprint$ True | SubAbility$ DBAnimate
|
||||
SVar:DBAnimate:DB$ Animate | Defined$ Imprinted | Types$ Nightmare | Permanent$ True | SubAbility$ DBCleanImprint
|
||||
SVar:DBCleanImprint:DB$ Cleanup | ClearImprinted$ True
|
||||
|
||||
Reference in New Issue
Block a user