- Added check for discard cost for TapAi (eg. Stern Constable)

- Added SacMe and DiscardMe flags for Drownyard Temple
This commit is contained in:
excessum
2016-05-08 12:32:48 +00:00
parent 37f0b07a28
commit f31af9c1f8
2 changed files with 10 additions and 0 deletions

View File

@@ -1,9 +1,11 @@
package forge.ai.ability;
import forge.ai.ComputerUtil;
import forge.ai.ComputerUtilCost;
import forge.ai.SpellAbilityAi;
import forge.game.ability.AbilityUtils;
import forge.game.card.Card;
import forge.game.cost.Cost;
import forge.game.phase.PhaseHandler;
import forge.game.phase.PhaseType;
import forge.game.player.Player;
@@ -37,6 +39,12 @@ public class TapAi extends TapAiBase {
final TargetRestrictions tgt = sa.getTargetRestrictions();
final Card source = sa.getHostCard();
final Cost abCost = sa.getPayCosts();
if (abCost != null) {
if (!ComputerUtilCost.checkDiscardCost(ai, abCost, source)) {
return false;
}
}
if (tgt == null) {
final List<Card> defined = AbilityUtils.getDefinedCards(source, sa.getParam("Defined"), sa);