mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Added check for targeted parameter to AI_getBestEnchantment.
This commit is contained in:
@@ -130,13 +130,15 @@ public class CardFactoryUtil {
|
|||||||
public static Card AI_getBestEnchantment(CardList list, final Card spell, boolean targeted) {
|
public static Card AI_getBestEnchantment(CardList list, final Card spell, boolean targeted) {
|
||||||
CardList all = list;
|
CardList all = list;
|
||||||
all = all.getType("Enchantment");
|
all = all.getType("Enchantment");
|
||||||
all = all.filter(new CardListFilter() {
|
if (targeted)
|
||||||
|
{
|
||||||
|
all = all.filter(new CardListFilter() {
|
||||||
|
|
||||||
public boolean addCard(Card c) {
|
public boolean addCard(Card c) {
|
||||||
return CardFactoryUtil.canTarget(spell, c);
|
return CardFactoryUtil.canTarget(spell, c);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
});
|
}
|
||||||
if(all.size() == 0) {
|
if(all.size() == 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user