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;
|
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");
|
cards = cards.getType("Creature");
|
||||||
|
|
||||||
for(int i = 0; i < cards.size(); i++) {
|
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))) {
|
&& CardFactoryUtil.canDamage(card, cards.get(i))) {
|
||||||
cards.get(i).addDamage(3, card);
|
cards.get(i).addDamage(3, card);
|
||||||
}
|
}
|
||||||
@@ -12200,10 +12200,9 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
|
|
||||||
for(int i = 0; i < creatures.size(); i++) {
|
for(int i = 0; i < creatures.size(); i++) {
|
||||||
//if(!CardUtil.getColors(nonBlackCards.get(i)).contains(Constant.Color.Black))
|
if((creatures.get(i)).isRed()) {
|
||||||
if(CardUtil.getColors(creatures.get(i)).contains(Constant.Color.Red)) {
|
|
||||||
redGreen.add(creatures.get(i));
|
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));
|
redGreen.add(creatures.get(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12264,10 +12263,9 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
|
|
||||||
for(int i = 0; i < creatures.size(); i++) {
|
for(int i = 0; i < creatures.size(); i++) {
|
||||||
//if(!CardUtil.getColors(nonBlackCards.get(i)).contains(Constant.Color.Black))
|
if((creatures.get(i)).isWhite()) {
|
||||||
if(CardUtil.getColors(creatures.get(i)).contains(Constant.Color.White)) {
|
|
||||||
whiteBlue.add(creatures.get(i));
|
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));
|
whiteBlue.add(creatures.get(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12325,10 +12323,9 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
|
|
||||||
for(int i = 0; i < creatures.size(); i++) {
|
for(int i = 0; i < creatures.size(); i++) {
|
||||||
//if(!CardUtil.getColors(nonBlackCards.get(i)).contains(Constant.Color.Black))
|
if((creatures.get(i)).isGreen()) {
|
||||||
if(CardUtil.getColors(creatures.get(i)).contains(Constant.Color.Green)) {
|
|
||||||
greenWhite.add(creatures.get(i));
|
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));
|
greenWhite.add(creatures.get(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12514,10 +12511,9 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
|
|
||||||
for(int i = 0; i < creatures.size(); i++) {
|
for(int i = 0; i < creatures.size(); i++) {
|
||||||
//if(!CardUtil.getColors(nonBlackCards.get(i)).contains(Constant.Color.Black))
|
if(creatures.get(i).isBlack()) {
|
||||||
if(CardUtil.getColors(creatures.get(i)).contains(Constant.Color.Black)) {
|
|
||||||
blackBlue.add(creatures.get(i));
|
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));
|
blackBlue.add(creatures.get(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -15831,11 +15827,7 @@ public class CardFactory_Creatures {
|
|||||||
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController());
|
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController());
|
||||||
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
||||||
CardList list = new CardList(grave.getCards());
|
CardList list = new CardList(grave.getCards());
|
||||||
list = list.filter(new CardListFilter() {
|
list = list.filter(AllZoneUtil.black);
|
||||||
public boolean addCard(Card c) {
|
|
||||||
return CardUtil.getColors(c).contains(Constant.Color.Black);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if(list.size() > 0) {
|
if(list.size() > 0) {
|
||||||
if(card.getController().equals(Constant.Player.Human)) {
|
if(card.getController().equals(Constant.Player.Human)) {
|
||||||
@@ -15858,11 +15850,7 @@ public class CardFactory_Creatures {
|
|||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
||||||
CardList list = new CardList(grave.getCards());
|
CardList list = new CardList(grave.getCards());
|
||||||
list = list.filter(new CardListFilter() {
|
list = list.filter(AllZoneUtil.black);
|
||||||
public boolean addCard(Card c) {
|
|
||||||
return CardUtil.getColors(c).contains(Constant.Color.Black);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
SpellAbility sa;
|
SpellAbility sa;
|
||||||
for(int i = 0; i < AllZone.Stack.size(); i++) {
|
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.getNetAttack() < creature2.get(i).getNetAttack()) biggest2 = creature2.get(i);
|
||||||
}
|
}
|
||||||
if(biggest2 != null) {
|
if(biggest2 != null) {
|
||||||
if(CardUtil.getColors(biggest2).contains(Constant.Color.Green)) Color = "green";
|
if(biggest2.isGreen()) Color = "green";
|
||||||
if(CardUtil.getColors(biggest2).contains(Constant.Color.Blue)) Color = "blue";
|
if(biggest2.isBlue()) Color = "blue";
|
||||||
if(CardUtil.getColors(biggest2).contains(Constant.Color.White)) Color = "white";
|
if(biggest2.isWhite()) Color = "white";
|
||||||
if(CardUtil.getColors(biggest2).contains(Constant.Color.Red)) Color = "red";
|
if(biggest2.isRed()) Color = "red";
|
||||||
if(CardUtil.getColors(biggest2).contains(Constant.Color.Black)) Color = "black";
|
if(biggest2.isBlack()) Color = "black";
|
||||||
} else {
|
} else {
|
||||||
Color = "black";
|
Color = "black";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user