forked from minetest/minetest_game
Dye: Simplify recipes.
Create a simple triplet table (src1, src2, dst) for all the dye recipes and group them logically, with a bit of explanation where they actually come from. This prunes a lot of recipes from the list, but the old list had a ton of combinations that did not make any sense, as well as recipes that were just gross approximations and duplicates, mixing the same color with itself just to get the same color back, which just wastes packets at logon. The list has been checked to allow all colors created from the basic dyes (flowers+coal) so that all colors can be crafted.
This commit is contained in:
parent
c8b1671ef0
commit
df19b4eab0
|
@ -74,36 +74,40 @@ minetest.register_craft({
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Mix recipes
|
-- Mix recipes
|
||||||
-- Just mix everything to everything somehow sanely
|
local dye_recipes = {
|
||||||
|
-- src1, src2, dst
|
||||||
local mixbases = {"pink", "magenta", "red", "orange", "brown", "yellow", "green", "dark_green", "cyan", "blue", "violet", "black", "dark_grey", "grey", "white"}
|
-- RYB mixes
|
||||||
|
{"red", "blue", "violet"}, -- "purple"
|
||||||
local mixes = {
|
{"yellow", "red", "orange"},
|
||||||
-- pink, magenta, red, orange, brown, yellow, green, dark_green, cyan, blue, violet, black, dark_grey, grey, white
|
{"yellow", "blue", "green"},
|
||||||
white = {"pink", "pink", "pink", "orange", "orange", "yellow", "green", "green", "grey", "cyan", "violet","grey", "grey", "grey","white"},
|
-- RYB complementary mixes
|
||||||
grey = {"pink", "pink", "pink", "orange", "orange", "yellow", "green", "green", "grey", "cyan", "violet","dark_grey","grey", "grey"},
|
{"red", "green", "dark_grey"},
|
||||||
dark_grey = {"brown", "brown", "brown", "brown", "brown", "brown", "dark_green","dark_green","blue", "blue", "violet","black", "dark_grey"},
|
{"yellow", "violet", "dark_grey"},
|
||||||
black = {"black", "black", "black", "black", "black", "black", "black", "black", "black","black", "black", "black"},
|
{"blue", "orange", "dark_grey"},
|
||||||
violet = {"magenta","magenta","magenta","red", "brown", "red", "cyan", "brown", "blue", "violet","violet"},
|
-- CMY mixes - approximation
|
||||||
blue = {"violet", "violet", "magenta","brown", "brown", "dark_green","cyan", "cyan", "cyan", "blue"},
|
{"cyan", "yellow", "green"},
|
||||||
cyan = {"brown", "blue", "brown", "dark_green","dark_grey", "green", "cyan", "dark_green","cyan"},
|
{"cyan", "magenta", "blue"},
|
||||||
dark_green = {"brown", "brown", "brown", "brown", "brown", "green", "green", "dark_green"},
|
{"yellow", "magenta", "red"},
|
||||||
green = {"yellow", "brown", "yellow", "yellow", "dark_green","green", "green"},
|
-- other mixes that result in a color we have
|
||||||
yellow = {"orange", "red", "orange", "yellow", "orange", "yellow"},
|
{"red", "green", "brown"},
|
||||||
brown = {"brown", "brown", "brown", "orange", "brown"},
|
{"magenta", "blue", "violet"},
|
||||||
orange = {"orange", "red", "orange", "orange"},
|
{"green", "blue", "cyan"},
|
||||||
red = {"pink", "magenta","red"},
|
{"pink", "violet", "magenta"},
|
||||||
magenta = {"magenta","magenta"},
|
-- mixes with black
|
||||||
pink = {"pink"},
|
{"white", "black", "grey"},
|
||||||
|
{"grey", "black", "dark_grey"},
|
||||||
|
{"green", "black", "dark_green"},
|
||||||
|
{"orange", "black", "brown"},
|
||||||
|
-- mixes with white
|
||||||
|
{"white", "red", "pink"},
|
||||||
|
{"white", "dark_grey", "grey"},
|
||||||
|
{"white", "dark_green", "green"},
|
||||||
}
|
}
|
||||||
|
|
||||||
for one, results in pairs(mixes) do
|
for _, mix in pairs(dye_recipes) do
|
||||||
for i, result in ipairs(results) do
|
|
||||||
local another = mixbases[i]
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = 'dye:' .. result .. ' 2',
|
output = 'dye:' .. mix[3] .. ' 2',
|
||||||
recipe = {'dye:' .. one, 'dye:' .. another},
|
recipe = {'dye:' .. mix[1], 'dye:' .. mix[2]},
|
||||||
})
|
})
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user