mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
Fix logic (#3365)
This commit is contained in:
@@ -2,6 +2,7 @@ package forge.ai.ability;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
|
||||||
import com.google.common.base.Predicate;
|
import com.google.common.base.Predicate;
|
||||||
import com.google.common.base.Predicates;
|
import com.google.common.base.Predicates;
|
||||||
@@ -1260,7 +1261,7 @@ public class AttachAi extends SpellAbilityAi {
|
|||||||
// TODO Somehow test for definitive advantage (e.g. opponent low on health, AI is attacking)
|
// TODO Somehow test for definitive advantage (e.g. opponent low on health, AI is attacking)
|
||||||
// to be able to deal the final blow with an enchanted vehicle like that
|
// to be able to deal the final blow with an enchanted vehicle like that
|
||||||
boolean canOnlyTargetCreatures = true;
|
boolean canOnlyTargetCreatures = true;
|
||||||
for (String valid : attachSource.getFirstAttachSpell().getTargetRestrictions().getValidTgts()) {
|
for (String valid : ObjectUtils.firstNonNull(attachSource.getFirstAttachSpell(), sa).getTargetRestrictions().getValidTgts()) {
|
||||||
if (!valid.startsWith("Creature")) {
|
if (!valid.startsWith("Creature")) {
|
||||||
canOnlyTargetCreatures = false;
|
canOnlyTargetCreatures = false;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ public class TriggerTapsForMana extends Trigger {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!produced.contains(MagicColor.toShortString(this.getParam("Produced")))) {
|
} else if (!produced.contains(MagicColor.toShortString(this.getParam("Produced")))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user