- Fixed the AI tapping a creature for mana to cast a pump instant/sorcery spell on that creature.

This commit is contained in:
Agetian
2017-08-24 17:44:03 +00:00
parent ed49943039
commit 5328e443db

View File

@@ -203,7 +203,8 @@ public class ComputerUtilMana {
continue; continue;
} }
if (sa.getHostCard() != null && sa.getApi() == ApiType.Animate) { if (sa.getHostCard() != null) {
if (sa.getApi() == ApiType.Animate) {
// For abilities like Genju of the Cedars, make sure that we're not activating the aura ability by tapping the enchanted card for mana // For abilities like Genju of the Cedars, make sure that we're not activating the aura ability by tapping the enchanted card for mana
if (sa.getHostCard().isAura() && "Enchanted".equals(sa.getParam("Defined")) if (sa.getHostCard().isAura() && "Enchanted".equals(sa.getParam("Defined"))
&& ma.getHostCard() == sa.getHostCard().getEnchantingCard() && ma.getHostCard() == sa.getHostCard().getEnchantingCard()
@@ -217,6 +218,18 @@ public class ComputerUtilMana {
&& AnimateAi.isAnimatedThisTurn(ai, ma.getHostCard())) { && AnimateAi.isAnimatedThisTurn(ai, ma.getHostCard())) {
continue; continue;
} }
} else if (sa.getApi() == ApiType.Pump) {
if ((sa.getHostCard().isInstant() || sa.getHostCard().isSorcery())
&& ma.getHostCard().isCreature()
&& ai.getController().isAI()
&& ma.getPayCosts().hasTapCost()
&& sa.getTargets().getTargetCards().contains(ma.getHostCard())) {
// do not activate pump instants targeting creatures by tapping targeted
// creatures for mana (for example, Servant of the Conduit)
continue;
}
}
} }
SpellAbility paymentChoice = ma; SpellAbility paymentChoice = ma;