It is currently 05 May 2024, 15:10
   
Text Size

Disciple of Kangee

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Re: Disciple of Kangee

Postby DennisBergkamp » 25 Dec 2009, 18:37

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.
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Disciple of Kangee

Postby Chris H. » 25 Dec 2009, 19:31

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. :wink: I now have an interesting error condition. If a card displays a putrid purple colored border, we have a problem. :lol:

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);
    }
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: Disciple of Kangee

Postby Chris H. » 26 Dec 2009, 00:35

OK, I think that I got everything working and I merged my work into the SVN, r228:

- Modified GuiDisplayUtil.java and card border colors now include a test for
zerker's color keyword and will now display rules consistent colors.
- Fixed Disciple of Kangee and the target creature will now display a blue
colored border until EOT.
- Added "Ghostfire is colorless." text to Ghostfire's cards.txt entry.
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: Disciple of Kangee

Postby Marek14 » 26 Dec 2009, 22:27

I decided to look for other color-changing cards:

Simple cards changing to a specific color (or to colorless):
Aisling Leprechaun
Ancient Kavu
Aphotic Wisps
Aurora Griffin
Blazing Blade Askari
Celestial Dawn
Cerulean Wisps
Chainer, Dementia Master
Cloudchaser Kestrel
Crimson Wisps
Darkest Hour
Defiling Tears
(Disciple of Kangee)
Dralnu's Crusade
Dwarven Song
Fylamarid
Ghostflame Sliver
Ghostly Flame (complicated)
Grave Servitude
Heaven's Gate
Indigo Faerie (adds color)
Metathran Transport
Mycosynth Lattice
Neurok Transmuter (more complicated effects)
Nightcreep
Niveous Wisps
Possessed Aven
Possessed Barbarian
Possessed Centaur
Possessed Nomad
Raging Spirit
Rise from the Grave (adds color)
Sea Kings' Blessing
Shade's Breath
Singe
Sinister Strength
Sylvan Paradise
Thran Lens
Touch of Darkness
Traitor's Clutch
Viridescent Wisps
Wayward Angel

Cards that can change color of spells as well:
Chaoslace
Deathlace
Eight-and-a-Half-Tails
Ersatz Gnomes
Lifelace
Moonlace
Purelace
Thoughtlace

Effects that can change color to arbitrary color:
Alchor's Tomb
Alloy Golem
Blind Seer (also affects spells)
Caldera Kavu
Distorting Lens
Illusion//Reality (affects spells as well)
Kavu Chameleon
Painter's Servant (affects more things and adds color)
Rainbow Crow
Shifting Sky
Sisay's Ingenuity
Spiritmonger
Sway of Illusion
Tidal Visionary
Vodalian Mystic (affects only spells)
Wild Mongrel

Effects that can change color to arbitrary color OR combination of colors (perhaps a checkbox interface where at least one checkbox must be checked to OK it?):
Dream Coat
Govern the Guildless
Prismatic Lace
Prismwake Merrow
Quickchange
Scuttlemutt
Shyft
Swirling Spriggan
Marek14
Tester
 
Posts: 2763
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 297 times

Re: Disciple of Kangee

Postby silly freak » 27 Dec 2009, 20:19

the forge.gui.ListChooser handles multiple selection with arbitrary minimum and maximum of choices already. It is already used in getChoice and getChoiceOptional (GuiDisplay3) and could also be used in an enhanced getChoiceMinMax
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Previous

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 17 guests


Who is online

In total there are 17 users online :: 0 registered, 0 hidden and 17 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 17 guests

Login Form