How to use card.card_color to get colors when there are 3 or more?

Login or register to post comments
Fri, 2016-06-03 15:54

Hi there,

I've been playing around with the card.card_color variable to try to word some keywords, and noticed a problem when getting to tri-color cards:

- If a card is Black and Green, for example, card.card_color will be "black, green, multicolor"
- But if a card is Black, Green, and Red, card.card_color will be "multicolor"

I am trying to use this variable to produce mana symbols using color_to_mana, but this obviously fails when the card.card_color variable doesn't list the colors.

Any input on another way to get this information? I've also tried playing with <b>card.casting_cost</b>, but have found difficulty extracting unique color values. Plus, this would fail on a card like Pact of Negation.

Any thoughts?


Fri, 2016-06-03 16:19
Pichoro's picture

Unfortunately, card.card_color, is actually the instructions for how to make the frame. If all three colors do not appear in the frame, they won't be listed in the field.

Fri, 2016-06-03 16:22

I thought as much. Is there any other way to get the information? I don't actually intend to use it on multicolor cards at all, but I always prefer to code things to be future-compatible with anything you could reasonable throw at them.

Fri, 2016-06-03 17:50
Pichoro's picture

That exact information isn't stored anywhere else I can think of.