mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
color simplification
This commit is contained in:
@@ -504,4 +504,34 @@ public class AllZoneUtil {
|
||||
};
|
||||
return filter;
|
||||
}
|
||||
|
||||
public static CardListFilter black = new CardListFilter() {
|
||||
public boolean addCard(Card c) {
|
||||
return c.isBlack();
|
||||
}
|
||||
};
|
||||
|
||||
public static CardListFilter blue = new CardListFilter() {
|
||||
public boolean addCard(Card c) {
|
||||
return c.isBlue();
|
||||
}
|
||||
};
|
||||
|
||||
public static CardListFilter green = new CardListFilter() {
|
||||
public boolean addCard(Card c) {
|
||||
return c.isGreen();
|
||||
}
|
||||
};
|
||||
|
||||
public static CardListFilter red = new CardListFilter() {
|
||||
public boolean addCard(Card c) {
|
||||
return c.isRed();
|
||||
}
|
||||
};
|
||||
|
||||
public static CardListFilter white = new CardListFilter() {
|
||||
public boolean addCard(Card c) {
|
||||
return c.isWhite();
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -11343,7 +11343,7 @@ public class CardFactory_Creatures {
|
||||
cards = cards.getType("Creature");
|
||||
|
||||
for(int i = 0; i < cards.size(); i++) {
|
||||
if(!CardUtil.getColors(cards.get(i)).contains(Constant.Color.White)
|
||||
if(!(cards.get(i)).isWhite()
|
||||
&& CardFactoryUtil.canDamage(card, cards.get(i))) {
|
||||
cards.get(i).addDamage(3, card);
|
||||
}
|
||||
@@ -12200,10 +12200,9 @@ public class CardFactory_Creatures {
|
||||
|
||||
|
||||
for(int i = 0; i < creatures.size(); i++) {
|
||||
//if(!CardUtil.getColors(nonBlackCards.get(i)).contains(Constant.Color.Black))
|
||||
if(CardUtil.getColors(creatures.get(i)).contains(Constant.Color.Red)) {
|
||||
if((creatures.get(i)).isRed()) {
|
||||
redGreen.add(creatures.get(i));
|
||||
} else if(CardUtil.getColors(creatures.get(i)).contains(Constant.Color.Green)) {
|
||||
} else if((creatures.get(i)).isGreen()) {
|
||||
redGreen.add(creatures.get(i));
|
||||
}
|
||||
}
|
||||
@@ -12264,10 +12263,9 @@ public class CardFactory_Creatures {
|
||||
|
||||
|
||||
for(int i = 0; i < creatures.size(); i++) {
|
||||
//if(!CardUtil.getColors(nonBlackCards.get(i)).contains(Constant.Color.Black))
|
||||
if(CardUtil.getColors(creatures.get(i)).contains(Constant.Color.White)) {
|
||||
if((creatures.get(i)).isWhite()) {
|
||||
whiteBlue.add(creatures.get(i));
|
||||
} else if(CardUtil.getColors(creatures.get(i)).contains(Constant.Color.Blue)) {
|
||||
} else if((creatures.get(i)).isBlue()) {
|
||||
whiteBlue.add(creatures.get(i));
|
||||
}
|
||||
}
|
||||
@@ -12325,10 +12323,9 @@ public class CardFactory_Creatures {
|
||||
|
||||
|
||||
for(int i = 0; i < creatures.size(); i++) {
|
||||
//if(!CardUtil.getColors(nonBlackCards.get(i)).contains(Constant.Color.Black))
|
||||
if(CardUtil.getColors(creatures.get(i)).contains(Constant.Color.Green)) {
|
||||
if((creatures.get(i)).isGreen()) {
|
||||
greenWhite.add(creatures.get(i));
|
||||
} else if(CardUtil.getColors(creatures.get(i)).contains(Constant.Color.White)) {
|
||||
} else if((creatures.get(i)).isWhite()) {
|
||||
greenWhite.add(creatures.get(i));
|
||||
}
|
||||
}
|
||||
@@ -12514,10 +12511,9 @@ public class CardFactory_Creatures {
|
||||
|
||||
|
||||
for(int i = 0; i < creatures.size(); i++) {
|
||||
//if(!CardUtil.getColors(nonBlackCards.get(i)).contains(Constant.Color.Black))
|
||||
if(CardUtil.getColors(creatures.get(i)).contains(Constant.Color.Black)) {
|
||||
if(creatures.get(i).isBlack()) {
|
||||
blackBlue.add(creatures.get(i));
|
||||
} else if(CardUtil.getColors(creatures.get(i)).contains(Constant.Color.Blue)) {
|
||||
} else if(creatures.get(i).isBlue()) {
|
||||
blackBlue.add(creatures.get(i));
|
||||
}
|
||||
}
|
||||
@@ -15831,11 +15827,7 @@ public class CardFactory_Creatures {
|
||||
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController());
|
||||
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
||||
CardList list = new CardList(grave.getCards());
|
||||
list = list.filter(new CardListFilter() {
|
||||
public boolean addCard(Card c) {
|
||||
return CardUtil.getColors(c).contains(Constant.Color.Black);
|
||||
}
|
||||
});
|
||||
list = list.filter(AllZoneUtil.black);
|
||||
|
||||
if(list.size() > 0) {
|
||||
if(card.getController().equals(Constant.Player.Human)) {
|
||||
@@ -15858,11 +15850,7 @@ public class CardFactory_Creatures {
|
||||
public boolean canPlay() {
|
||||
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
||||
CardList list = new CardList(grave.getCards());
|
||||
list = list.filter(new CardListFilter() {
|
||||
public boolean addCard(Card c) {
|
||||
return CardUtil.getColors(c).contains(Constant.Color.Black);
|
||||
}
|
||||
});
|
||||
list = list.filter(AllZoneUtil.black);
|
||||
|
||||
SpellAbility sa;
|
||||
for(int i = 0; i < AllZone.Stack.size(); i++) {
|
||||
|
||||
@@ -238,11 +238,11 @@ class CardFactory_Lands {
|
||||
if(biggest2.getNetAttack() < creature2.get(i).getNetAttack()) biggest2 = creature2.get(i);
|
||||
}
|
||||
if(biggest2 != null) {
|
||||
if(CardUtil.getColors(biggest2).contains(Constant.Color.Green)) Color = "green";
|
||||
if(CardUtil.getColors(biggest2).contains(Constant.Color.Blue)) Color = "blue";
|
||||
if(CardUtil.getColors(biggest2).contains(Constant.Color.White)) Color = "white";
|
||||
if(CardUtil.getColors(biggest2).contains(Constant.Color.Red)) Color = "red";
|
||||
if(CardUtil.getColors(biggest2).contains(Constant.Color.Black)) Color = "black";
|
||||
if(biggest2.isGreen()) Color = "green";
|
||||
if(biggest2.isBlue()) Color = "blue";
|
||||
if(biggest2.isWhite()) Color = "white";
|
||||
if(biggest2.isRed()) Color = "red";
|
||||
if(biggest2.isBlack()) Color = "black";
|
||||
} else {
|
||||
Color = "black";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user