AnimateAi: non-Curse Animate not for opponent stuff

This commit is contained in:
Hanmac
2016-12-02 06:38:44 +00:00
parent f3ad503f42
commit 72ee5baf7c

View File

@@ -129,7 +129,6 @@ public class AnimateAi extends SpellAbilityAi {
@Override
protected boolean checkApiLogic(Player aiPlayer, SpellAbility sa) {
final TargetRestrictions tgt = sa.getTargetRestrictions();
final Card source = sa.getHostCard();
final Game game = aiPlayer.getGame();
final PhaseHandler ph = game.getPhaseHandler();
@@ -142,7 +141,7 @@ public class AnimateAi extends SpellAbilityAi {
if (!ComputerUtilCost.checkTapTypeCost(aiPlayer, sa.getPayCosts(), source, sa)) {
return false; // prevent crewing with equal or better creatures
}
if (null == tgt) {
if (!sa.usesTargeting()) {
final List<Card> defined = AbilityUtils.getDefinedCards(source, sa.getParam("Defined"), sa);
boolean bFlag = false;
boolean givesHaste = sa.hasParam("Keywords") && sa.getParam("Keywords").contains("Haste");
@@ -265,6 +264,11 @@ public class AnimateAi extends SpellAbilityAi {
continue;
}
// non-Curse Animate not on Opponent Stuff if able
if (c.getController().isOpponentOf(ai) && !sa.isCurse()) {
continue;
}
// if tapped it might not attack or block
if (c.isTapped()) {
continue;