Add more orange

This commit is contained in:
Sebastian Lundegård Kylander
2026-03-29 18:48:18 +02:00
parent 58b760ba72
commit 9c35a6ce75
12 changed files with 144 additions and 72 deletions

View File

@@ -438,6 +438,7 @@ colors_from_mana_symbols := {
if contains(input, match:"B") then str := str + ["black"]
if contains(input, match:"R") then str := str + ["red"]
if contains(input, match:"G") then str := str + ["green"]
if contains(input, match:"O") then str := str + ["orange"]
join(str, sep:", ")
}
@@ -590,6 +591,7 @@ colorless_color := {
else if cc == "black" then "b"
else if cc == "red" then "r"
else if cc == "green" then "g"
else if cc == "orange" then "o"
else "c"
}
@@ -620,6 +622,7 @@ color_name := {
else if input == "B" then "black"
else if input == "R" then "red"
else if input == "G" then "green"
else if input == "O" then "orange"
else ""
}
mana_name := {
@@ -628,6 +631,7 @@ mana_name := {
else if input == "black" then "B"
else if input == "red" then "R"
else if input == "green" then "G"
else if input == "orange" then "O"
else "C"
}
color_names_1 := { color_name(colors.0) }
@@ -701,6 +705,7 @@ land_to_color := {
else if watermark == "mana symbol black" then "black, land"
else if watermark == "mana symbol red" then "red, land"
else if watermark == "mana symbol green" then "green, land"
else if watermark == "mana symbol orange" then "orange, land"
else land_multicolor(colors:color_text_filter(input: rules))
}@(rules:card.rule_text)
@@ -708,7 +713,7 @@ land_to_color := {
text_to_color := {
#### Note: running filter_text is quite slow, do a quick 'contains' check first
if contains(match: card_name + " is") then (
text := filter_text(match: "is (colorless|all colors|((blue|white|green|red|black)((,|,? and) (blue|white|green|red|black))*))", in_context: regex_escape(card_name)+"(</[-a-z]+>)* <match>\\.")
text := filter_text(match: "is (colorless|all colors|((blue|white|green|red|black|orange)((,|,? and) (blue|white|green|red|black|orange))*))", in_context: regex_escape(card_name)+"(</[-a-z]+>)* <match>\\.")
if text != "" then (
if contains(text, match: "all colors") then (
colors := "WUBRGO"
@@ -721,6 +726,7 @@ text_to_color := {
if contains(text, match: "black") then colors := colors + "B"
if contains(text, match: "red") then colors := colors + "R"
if contains(text, match: "green") then colors := colors + "G"
if contains(text, match: "orange") then colors := colors + "O"
if land == true then land_multicolor()
else mana_to_color(hybrid: "")
)
@@ -743,7 +749,7 @@ card_color := {
else text_color
};
#### Number of colors in a card_color
card_color_color_count := count_chosen@(choices: "white,blue,black,red,green,artifact")
card_color_color_count := count_chosen@(choices: "white,blue,black,red,green,orange,artifact")
#### Clean up color field
card_color_filter := {
colors := card_color_color_count()
@@ -777,6 +783,7 @@ card_color_to_letters := {
+(if contains(color_string, match:"black") then "B" else "")
+(if contains(color_string, match:"red") then "R" else "")
+(if contains(color_string, match:"green") then "G" else "")
+(if contains(color_string, match:"orange") then "O" else "")
}
card_color_field := { if input <= 1 then card.card_color else card["card_color_" + input] }
@@ -825,30 +832,32 @@ color_of_card := {
#type := card.super_type
artifact := chosen(card_color, choice:"artifact")
if contains(card.shape, match: "split") and
card_color != card.card_color_2 then "I" #### Diff Color Splits
card_color != card.card_color_2 then "K" #### Diff Color Splits
else if chosen(choice: "land", card_color) then ( #### Lands
if card.rarity != "basic land" then "L" #### Nonbasic Land
if card.rarity != "basic land" then "M" #### Nonbasic Land
else basic_land_sort() #### Basic Land
) else if is_null_cost(casting_cost) then ( #### Non-Land Cards with no or zero costs.
if chosen(choice: "colorless", card_color) then "A" #### Clear Colorless
else if chosen(choice: "hybrid", card_color) then "HK" #### Hybrids
else if is_multicolor(card_color) then "GK" #### Multicolor
else if chosen(choice: "hybrid", card_color) then "IL" #### Hybrids
else if is_multicolor(card_color) then "HL" #### Multicolor
else if chosen(choice:"white", card_color) then "B" #### White
else if chosen(choice:"blue", card_color) then "C" #### Blue
else if chosen(choice:"black", card_color) then "D" #### Black
else if chosen(choice:"red", card_color) then "E" #### Red
else if chosen(choice:"green", card_color) then "F" #### Green
else "J" #### Artifact
else if chosen(choice:"orange", card_color) then "G" #### Orange
else "K" #### Artifact
) else (
#### Cards with costs.
colors := sort_text(casting_cost, order: "<WUBRGO>")
if colors == "" and artifact then "J" #### Artifact
if colors == "" and artifact then "K" #### Artifact
else if colors == "" then "A" #### Clear Colorless
else if colors == "W" then "B" #### White
else if colors == "U" then "C" #### Blue
else if colors == "B" then "D" #### Black
else if colors == "R" then "E" #### Red
else if colors == "G" then "F" #### Green
else if colors == "O" then "G" #### Orange
else if is_hybrid_cost() then hybrid_color_pair_sort() #### Hybrid (by pairs)
else if contains(casting_cost, match:"/") and artifact then "I" #### Hybrid Artifacts
else multi_color_pair_sort() #### Multicolor (by pairs)
@@ -867,6 +876,7 @@ basic_land_sort := {
else if contains(name, match:"Swamp") then "MD" #### Swamps
else if contains(name, match:"Mountain") then "ME" #### Mountains
else if contains(name, match:"Forest") then "MF" #### Forests
else if contains(name, match:"Desert") then "MG" #### Desert
else "MA" #### other basic lands
}
hybrid_color_pair_sort := {
@@ -882,7 +892,12 @@ hybrid_color_pair_sort := {
else if colors == "BG" then "HH"
else if colors == "WR" then "HI"
else if colors == "UG" then "HJ"
else "HK"
else if colors == "WO" then "HK"
else if colors == "UO" then "HL"
else if colors == "BO" then "HM"
else if colors == "RO" then "HN"
else if colors == "GO" then "HO"
else "HP"
}
multi_color_pair_sort := {
colors := sort_text(casting_cost, order: "<WUBRGO>")
@@ -897,8 +912,13 @@ multi_color_pair_sort := {
else if colors == "BG" then "GH"
else if colors == "WR" then "GI"
else if colors == "UG" then "GJ"
else if contains(card.casting_cost, match:"/") then "GL"
else "GK"
else if colors == "WO" then "GK"
else if colors == "UO" then "GL"
else if colors == "BO" then "GM"
else if colors == "RO" then "GN"
else if colors == "GO" then "GO"
else if contains(card.casting_cost, match:"/") then "GQ"
else "GP"
}
#### Sort the card into its rarity tier
@@ -1054,12 +1074,13 @@ remove_type := replace@(match: "(Artifact|Creature|Enchantment|Instant|Land|Plan
replace@(match: "[ ]+", in_context: "^<match>", replace: "")+
replace@(match: "[ ]+", in_context: "<match>$", replace: "")
write_wubrg := {
write_wubrgo := {
(if match(input, match:"white") then "W" else "")+
(if match(input, match:"blue") then "U" else "")+
(if match(input, match:"black") then "B" else "")+
(if match(input, match:"red") then "R" else "")+
(if match(input, match:"green") then "G" else "")
(if match(input, match:"green") then "G" else "")+
(if match(input, match:"orange") then "O" else "")
}
colored_mana := {to_number(
for each sym in cmc_split(to_text()) do (
@@ -1079,7 +1100,7 @@ generic_mana := {to_number(
}
primary_card_color := {
artifact := chosen(choice:"artifact") and not (chosen(choice:"white") or chosen(choice:"blue") or chosen(choice:"black") or chosen(choice:"red") or chosen(choice:"green"))
artifact := chosen(choice:"artifact") and not (chosen(choice:"white") or chosen(choice:"blue") or chosen(choice:"black") or chosen(choice:"red") or chosen(choice:"green") or chosen(choice:"orange"))
land := chosen(choice:"land")
multi := chosen(choice:"multicolor")
hybrid := chosen(choice:"hybrid")
@@ -1088,7 +1109,8 @@ primary_card_color := {
black := chosen(choice:"black")
red := chosen(choice:"red")
green := chosen(choice:"green")
multi_color := count_chosen(choices:"white, blue, black, red, green")
orange := chosen(choice:"orange")
multi_color := count_chosen(choices:"white, blue, black, red, green, orange")
if land then "land"
else if multi then "multicolor"
else if multi_color == 2 and chosen(choice:"artifact") then "hybrid" #### hybrid artifacts would show as their first color
@@ -1099,10 +1121,11 @@ primary_card_color := {
else if black then "black"
else if red then "red"
else if green then "green"
else if orange then "orange"
else input
}
sparker_card_color := {
artifact := chosen(choice:"artifact") and not (chosen(choice:"white") or chosen(choice:"blue") or chosen(choice:"black") or chosen(choice:"red") or chosen(choice:"green"))
artifact := chosen(choice:"artifact") and not (chosen(choice:"white") or chosen(choice:"blue") or chosen(choice:"black") or chosen(choice:"red") or chosen(choice:"green") or chosen(choice:"orange"))
land := chosen(choice:"land")
multi := chosen(choice:"multicolor")
hybrid := chosen(choice:"hybrid")
@@ -1111,7 +1134,8 @@ sparker_card_color := {
black := chosen(choice:"black")
red := chosen(choice:"red")
green := chosen(choice:"green")
multi_color := count_chosen(choices:"white, blue, black, red, green")
orange := chosen(choice:"orange")
multi_color := count_chosen(choices:"white, blue, black, red, green, orange")
if land then "colorless"
else if multi then "multicolor"
else if multi_color >= 2 then "multicolor"
@@ -1122,6 +1146,7 @@ sparker_card_color := {
else if black then "black"
else if red then "red"
else if green then "green"
else if orange then "orange"
else "colorless"
}
@@ -1141,7 +1166,8 @@ color_to_mana := replace@(match: "white", replace: "[W]")+
replace@(match: "blue", replace: "[U]")+
replace@(match: "black", replace: "[B]")+
replace@(match: "red", replace: "[R]")+
replace@(match: "green", replace: "[G]")
replace@(match: "green", replace: "[G]")+
replace@(match: "orange", replace: "[O]")
#### convert number word to digit
digital_number := {
@@ -1298,7 +1324,7 @@ protection_code := {
else if match(input, match:"^(converted|mana|power|toughness)") then "anything with " + replace(input, match:"and from", replace:"or", in_context:" <match> ")
else if contains(input, match:"the chosen player") then "anything " + replace(input, match:"the chosen", replace:"controlled by that")
else if contains(input, match:"the chosen") then "anything with " + replace(input, match:"the chosen", replace:"that")
else if contains(input, match:"all colors") then "anything " + replace(input, match:"all colors", replace:"that's white, blue, black, red, or green")
else if contains(input, match:"all colors") then "anything " + replace(input, match:"all colors", replace:"that's white, blue, black, red, green, or orange")
else if match(input, match:"^you$") then "anything you control"
else if match(input, match:"^its owner$") then "anything its owner controls"
else if match(input, match:"^(each of )?your opponents$") then "anything " + replace(input, match:"(each of )?your opponents", replace:"controlled by those players")
@@ -2627,6 +2653,7 @@ card_new_color := {
else if card.card_color == "black" then "b"
else if card.card_color == "red" then "r"
else if card.card_color == "green" then "g"
else if card.card_color == "orange" then "o"
else if contains(card.card_color, match:"artifact") then "a"
else if contains(card.card_color, match:"multi") or contains(card.card_color, match:"hybrid") then "m"
else "c"
@@ -5557,6 +5584,7 @@ alias_colors := {
b: rgb(39, 38, 36),
r: rgb(168, 88, 81),
g: rgb(6, 120, 69),
o: rgb(253, 196, 41),
a: rgb(239, 238, 236),
m: rgb(243, 210, 105),
c: rgb(173, 151, 137)
@@ -5758,7 +5786,7 @@ apply_index := {
}
color: {fill_len(color_of_card(), lead:"A")},
"color category": {
indexes := [[lang_setting("colorless")], [lang_setting("white")], [lang_setting("blue")], [lang_setting("black")], [lang_setting("red")], [lang_setting("green")], [lang_setting("purple")], [lang_setting("pink")], [lang_setting("yellow")], [lang_setting("orange")], [lang_setting("brown")], [lang_setting("multicolor")], [lang_setting("hybrid")]]
indexes := [[lang_setting("colorless")], [lang_setting("white")], [lang_setting("blue")], [lang_setting("black")], [lang_setting("red")], [lang_setting("green")], [lang_setting("orange")], [lang_setting("purple")], [lang_setting("pink")], [lang_setting("yellow")], [lang_setting("brown")], [lang_setting("multicolor")], [lang_setting("hybrid")]]
fill_len(position(of:[card.color_category], in:indexes, lead:"0", fill_to:2))
},
"exact color": {
@@ -5860,14 +5888,14 @@ skeleton_runner := {
(cards := cards + [new_card([name:prefix+letter_list[x]+fill_len(y, lead:"0"), rarity:rarity, super_type:super_type, casting_cost:mana_list[x]])];)
)
cards
}@(count:1, rarity:"common", type:"", prefix:"C", super_type:"", color_list:["white", "blue", "black", "red", "green"], letter_list:["W", "U", "B", "R", "G"], mana_list:"nope")
}@(count:1, rarity:"common", type:"", prefix:"C", super_type:"", color_list:["white", "blue", "black", "red", "green", "orange"], letter_list:["W", "U", "B", "R", "G", "O"], mana_list:"nope")
#### outside to make singleton scripts easier
blank_list_5 := ["","","","",""]
blank_list_10 := ["","","","","","","","","",""]
mana_list_ally := ["WU","UB","BR","RG","GW"]
mana_list_enemy := ["WB","UR","BG","RW","GU"]
mana_list_shard := ["WUB","UBR","BRG","RGW","GWU"]
mana_list_wedge := ["WBG","URW","BGU","RWB","GUR"]
mana_list_ally := ["WU","UB","BR","RG","GW","GO","OW"]
mana_list_enemy := ["WB","UR","BG","RW","GU","UO","BO","RO"]
mana_list_shard := ["WUB","UBR","BRG","RGW","GWU"] # TODO: Add shard triplets for orange
mana_list_wedge := ["WBG","URW","BGU","RWB","GUR"] # TODO: Add wedge triples for orange
skeleton_script := {
cards := [];
cards := cards + skeleton_runner(count:skeleton_commons);