mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Cleanup in the code of Sovereigns of Lost Alara.
This commit is contained in:
@@ -253,6 +253,15 @@ public class CardList implements Iterable<Card> {
|
||||
});
|
||||
}
|
||||
|
||||
//get all cards that don't have this string in their keywords
|
||||
public CardList getKeywordsDontContain(final String keyword) {
|
||||
return this.filter(new CardListFilter() {
|
||||
public boolean addCard(Card c) {
|
||||
return !c.KeywordsContain(keyword);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public CardList getTokens() {
|
||||
return this.filter(new CardListFilter() {
|
||||
public boolean addCard(Card c) {
|
||||
|
||||
@@ -2744,10 +2744,14 @@ public class CombatUtil {
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Play, attacker.getController());
|
||||
|
||||
CardList enchantments = new CardList(library.getCards());
|
||||
final String turn = attacker.getController();
|
||||
//final String turn = attacker.getController();
|
||||
enchantments = enchantments.filter(new CardListFilter() {
|
||||
public boolean addCard(Card c) {
|
||||
if(attacker.hasKeyword("Protection from enchantments") || (attacker.hasKeyword("Protection from everything"))) return false;
|
||||
return(c.isEnchantment() && c.getKeyword().contains("Enchant creature")
|
||||
&& !CardFactoryUtil.hasProtectionFrom(c,attacker));
|
||||
|
||||
/* What a mess ???
|
||||
ArrayList<String> keywords = c.getKeyword();
|
||||
for(String keyword:keywords) {
|
||||
if(keyword.startsWith("Enchant creature")) {
|
||||
@@ -2783,7 +2787,7 @@ public class CombatUtil {
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return false; */
|
||||
}
|
||||
});
|
||||
String player = attacker.getController();
|
||||
@@ -2799,6 +2803,8 @@ public class CombatUtil {
|
||||
Enchantment = ((Card) check);
|
||||
}
|
||||
} else {
|
||||
//enchantments = enchantments.getKeywordsContain("enPump"); Doesn't seem to work
|
||||
//enchantments = enchantments.getKeywordsDontContain("enPumpCurse");
|
||||
Enchantment = CardFactoryUtil.AI_getBestEnchantment(enchantments,attacker, false);
|
||||
}
|
||||
if(Enchantment != null && AllZone.GameAction.isCardInPlay(attacker)){
|
||||
|
||||
Reference in New Issue
Block a user