DennisBergkamp wrote:Cool!
No I don't think you have to change the code below, what it does is slightly change the colors of the borders around red, green and blue cards. If you set shade to 20 or 30, the borders will be even darker shades of red, green and blue (Black and White are not effected).
I think the reason
Ghostfire's text doesn't show up is because it's an instant, so it gets a clearSpellAbility(). Adding it to the text of the card as well should fix it:
- Code: Select all
Ghostfire
2 R
Instant
Ghostfire is colorless.
spDamageTgtCP:3
Ghostfire is colorless.
`
I modified the if test to check for colorless cards rather than artifacts. I also had to modify the section above. The logic is starting to get a little complex for me.

I now have an interesting error condition. If a card displays a putrid purple colored border, we have a problem.
Kobolds have a red border and
Ghostfire now has the correct gray border, I spent some time trying to figure out why zerker's color keyword was not displayed in the text box. Time to raise the white flag and go with the simplest solution.
For some reason, the
Disciple of Kangee is turning the Kobold into a gray border rather than a blue border. I now suspect that there is something wrong with my
Disciple of Kangee code.
- Code: Select all
public static Border getBorder(Card card) {
Color color;
if(CardUtil.getColors(card).size() > 1)
color = Color.orange;
else if((CardUtil.getColor(card).equals(Constant.Color.Black) && (!card.getIntrinsicKeyword().contains(card.getName() + " is colorless.")))
|| (card.getIntrinsicKeyword().contains(card.getName() + " is black."))) color = Color.black;
else if((CardUtil.getColor(card).equals(Constant.Color.Green) && (!card.getIntrinsicKeyword().contains(card.getName() + " is colorless.")))
|| (card.getIntrinsicKeyword().contains(card.getName() + " is green."))) color = new Color(0, 220, 39);
else if((CardUtil.getColor(card).equals(Constant.Color.White) && (!card.getIntrinsicKeyword().contains(card.getName() + " is colorless.")))
|| (card.getIntrinsicKeyword().contains(card.getName() + " is white."))) color = Color.white;
else if((CardUtil.getColor(card).equals(Constant.Color.Red) && (!card.getIntrinsicKeyword().contains(card.getName() + " is colorless.")))
|| (card.getIntrinsicKeyword().contains(card.getName() + " is red."))) color = Color.red;
else if((CardUtil.getColor(card).equals(Constant.Color.Blue) && (!card.getIntrinsicKeyword().contains(card.getName() + " is colorless.")))
|| (card.getIntrinsicKeyword().contains(card.getName() + " is blue."))) color = Color.blue;
else if(CardUtil.getColor(card).equals(Constant.Color.Colorless) || (card.getIntrinsicKeyword().contains(card.getName() + " is colorless.")))
color = Color.gray;
else color = new Color(200, 0, 230); // If your card has a violet border, something is wrong
if(!CardUtil.getColor(card).equals(Constant.Color.Colorless) || (!card.getIntrinsicKeyword().contains(card.getName() + " is colorless."))) {
int r = color.getRed();
int g = color.getGreen();
int b = color.getBlue();
int shade = 10;
r -= shade;
g -= shade;
b -= shade;
r = Math.max(0, r);
g = Math.max(0, g);
b = Math.max(0, b);
color = new Color(r, g, b);
}
//~
return BorderFactory.createLineBorder(color, 2);
}