- For Multikicker cards, AI should bail if the original cost was {0} and no multikicker was paid (e.g. Everflowing Chalice).

This commit is contained in:
Agetian
2017-06-28 16:53:10 +00:00
parent e30b3f9166
commit b3e96da2e2

View File

@@ -124,6 +124,7 @@ public class PermanentAi extends SpellAbilityAi {
// String announce = sa.getParam("Announce"); // String announce = sa.getParam("Announce");
ManaCost mkCost = sa.getMultiKickerManaCost(); ManaCost mkCost = sa.getMultiKickerManaCost();
ManaCost mCost = sa.getPayCosts().getTotalMana(); ManaCost mCost = sa.getPayCosts().getTotalMana();
boolean isZeroCost = mCost.isZero();
for (int i = 0; i < 10; i++) { for (int i = 0; i < 10; i++) {
mCost = ManaCost.combine(mCost, mkCost); mCost = ManaCost.combine(mCost, mkCost);
ManaCostBeingPaid mcbp = new ManaCostBeingPaid(mCost); ManaCostBeingPaid mcbp = new ManaCostBeingPaid(mCost);
@@ -133,6 +134,11 @@ public class PermanentAi extends SpellAbilityAi {
} }
card.setKickerMagnitude(i + 1); card.setKickerMagnitude(i + 1);
} }
if (isZeroCost && card.getKickerMagnitude() == 0) {
// Bail if the card cost was {0} and no multikicker was paid (e.g. Everflowing Chalice).
// TODO: update this if there's ever a card where it makes sense to play it for {0} with no multikicker
return false;
}
} }
// don't play cards without being able to pay the upkeep for // don't play cards without being able to pay the upkeep for