- Improved Auto mana payment for Cavern of Souls.

- Fixed the AI trying to play Endless One for 0 when in presence of Cavern of Souls.
This commit is contained in:
Agetian
2017-06-10 14:48:20 +00:00
parent a3f2112793
commit b88aa51507
2 changed files with 5 additions and 2 deletions

View File

@@ -223,7 +223,8 @@ public class ComputerUtilMana {
// to attempt to make the spell uncounterable when possible. // to attempt to make the spell uncounterable when possible.
if ((toPay == ManaCostShard.GENERIC || toPay == ManaCostShard.X) if ((toPay == ManaCostShard.GENERIC || toPay == ManaCostShard.X)
&& ma.getHostCard().getName().equals("Cavern of Souls") && ma.getHostCard().getName().equals("Cavern of Souls")
&& !ma.getManaPart().isAnyMana()) { && !ma.getManaPart().isAnyMana()
&& sa.getHostCard().getType().getCreatureTypes().contains(ma.getHostCard().getChosenType())) {
continue; continue;
} }

View File

@@ -590,7 +590,9 @@ public class CountersPutAi extends SpellAbilityAi {
// No target. So must be defined // No target. So must be defined
list = new CardCollection(AbilityUtils.getDefinedCards(source, sa.getParam("Defined"), sa)); list = new CardCollection(AbilityUtils.getDefinedCards(source, sa.getParam("Defined"), sa));
if (amountStr.equals("X") && ((sa.hasParam(amountStr) && sa.getSVar(amountStr).equals("Count$xPaid")) || source.getSVar(amountStr).equals("Count$xPaid") )) { if (amountStr.equals("X")
&& !source.hasSVar("PayX") /* SubAbility on something that already had set PayX, e.g. Endless One ETB counters */
&& ((sa.hasParam(amountStr) && sa.getSVar(amountStr).equals("Count$xPaid")) || source.getSVar(amountStr).equals("Count$xPaid") )) {
// detect if there's more than one X in the cost (Hangarback Walker, Walking Ballista, etc.) // detect if there's more than one X in the cost (Hangarback Walker, Walking Ballista, etc.)
SpellAbility testSa = sa; SpellAbility testSa = sa;