|
Post by temp on Sept 27, 2020 13:29:56 GMT
Hello
In order to script the reminder text of a keyword, how can I get the colors list of a card? card.card_color doesn't work. It returns "multicolor" on multicolors cards whereas I want the list of all its actual colors.
Thanks.
|
|
|
Post by sade612 on Oct 6, 2020 23:51:20 GMT
If you use card.card_color, unless you update the card's colors manually by clicking on the frame, after three colors it golds everything out. I encountered this while making my Refund mechanic, so I opted to do string operations on the mana cost instead, with the added benefit that it can now count colorless mana symbols.
{if not contains(card.super_type, match: "Sorcery") then "When {if contains(card.super_type, match: "Legendary") then "LEGENDNAME" else if contains(card.super_type, match: "Creature") then "this creature" else if contains(card.super_type, match: "Land") then "this land" else if contains(card.super_type, match: "Artifact") then "this artifact" else if contains(card.super_type, match: "Enchantment") then "this enchantment" else if contains(card.super_type, match: "Planeswalker") then card.sub_type else "this sorcery"}. enters the battlefield, a" else "A"}dd { WUBRGC := break_text(match: ".", replace(replace(replace(replace(replace(replace(mana_sort(filter_text(card.casting_cost, match:"[WUBRGC]")), match: "G+", replace: "G"), match: "R+", replace: "R"), match: "B+", replace: "B"), match: "U+", replace: "U"), match: "W+", replace: "W"), match: "C+", replace: "C"));
color_len := number_of_items(in:WUBRGC); WUBRGC := for each char in WUBRGC do "J/{char} ";
first := substring(WUBRGC, end: color_len * 4 -4); last := substring(WUBRGC, begin: color_len * 4 -4, end: color_len*4-1);
output := ""; output:= "<sym>";
if (color_len > 1) then output:= output + separate_words(spacer: "</sym>, <sym>", first) + "</sym>" + ", or <sym>"; output := output + "{last}</sym>";
output }. Players don’t lose <sym>J/C</sym> until end of turn.
|
|