forked from VoxeLibre/VoxeLibre
Compare commits
21 Commits
master
...
dyable-lea
Author | SHA1 | Date |
---|---|---|
AFCMS | 45ca8dfbfb | |
AFCMS | 39481d8b10 | |
AFCMS | 422d48f658 | |
AFCMS | c1eefab8d6 | |
AFCMS | e573dd25e1 | |
AFCMS | 98226d677c | |
AFCMS | 547291c333 | |
AFCMS | 5637b649e8 | |
AFCMS | 16b4a6e5c2 | |
AFCMS | fb0a687bdc | |
AFCMS | 2aa7218126 | |
AFCMS | e0aa16cf06 | |
AFCMS | 69629d4ca3 | |
AFCMS | e7166430d7 | |
AFCMS | 31027aca2e | |
AFCMS | 9990db92b4 | |
AFCMS | c1ea059a14 | |
AFCMS | a01813e421 | |
AFCMS | d7ae8c62db | |
AFCMS | 2d585c9517 | |
AFCMS | 896b213f17 |
|
@ -1,4 +1,5 @@
|
||||||
local S = minetest.get_translator("mcl_armor")
|
local S = minetest.get_translator("mcl_armor")
|
||||||
|
local modpath = minetest.get_modpath(minetest.get_current_modname())
|
||||||
|
|
||||||
mcl_armor = {
|
mcl_armor = {
|
||||||
longdesc = S("This is a piece of equippable armor which reduces the amount of damage you receive."),
|
longdesc = S("This is a piece of equippable armor which reduces the amount of damage you receive."),
|
||||||
|
@ -66,3 +67,4 @@ dofile(modpath .. "/player.lua")
|
||||||
dofile(modpath .. "/damage.lua")
|
dofile(modpath .. "/damage.lua")
|
||||||
dofile(modpath .. "/register.lua")
|
dofile(modpath .. "/register.lua")
|
||||||
dofile(modpath .. "/alias.lua")
|
dofile(modpath .. "/alias.lua")
|
||||||
|
dofile(modpath.."/leather.lua")
|
||||||
|
|
|
@ -0,0 +1,85 @@
|
||||||
|
local S = minetest.get_translator(minetest.get_current_modname())
|
||||||
|
local colorize_value = 125
|
||||||
|
local modifier = "[colorize:<color>:"..colorize_value
|
||||||
|
|
||||||
|
local str = string
|
||||||
|
|
||||||
|
local longdesc = S("This is a piece of equippable armor which reduces the amount of damage you receive.")
|
||||||
|
local usage = S("To equip it, put it on the corresponding armor slot in your inventory menu.")
|
||||||
|
|
||||||
|
local colors = {
|
||||||
|
-- { ID, decription, wool, dye }
|
||||||
|
{ "red", "Red", "mcl_dye:red", "#951d1d" },
|
||||||
|
{ "blue", "Blue", "mcl_dye:blue", "#2a2c94" },
|
||||||
|
{ "cyan", "Cyan", "mcl_dye:cyan", "#0d7d8e" },
|
||||||
|
{ "grey", "Grey", "mcl_dye:dark_grey", "#363a3f" },
|
||||||
|
{ "silver", "Light Grey", "mcl_dye:grey", "#818177" },
|
||||||
|
{ "black", "Black", "mcl_dye:black", "#020307" },
|
||||||
|
{ "yellow", "Yellow", "mcl_dye:yellow", "#f2b410" },
|
||||||
|
{ "green", "Green", "mcl_dye:dark_green", "#495d20" },
|
||||||
|
{ "magenta", "Magenta", "mcl_dye:magenta", "#ae2ea4" },
|
||||||
|
{ "orange", "Orange", "mcl_dye:orange", "#e36501" },
|
||||||
|
{ "purple", "Purple", "mcl_dye:violet", "#681ba1" },
|
||||||
|
{ "brown", "Brown", "mcl_dye:brown", "#623b1a" },
|
||||||
|
{ "pink", "Pink", "mcl_dye:pink", "#d66691" },
|
||||||
|
{ "lime", "Lime", "mcl_dye:green", "#60ad13" },
|
||||||
|
{ "light_blue", "Light Blue", "mcl_dye:lightblue", "#1f8eca" },
|
||||||
|
{ "white", "White", "mcl_dye:white", "#d1d7d8" },
|
||||||
|
}
|
||||||
|
|
||||||
|
--local function get_color_rgb(color)
|
||||||
|
-- return tonumber(str.sub(first, 2, 3)), tonumber(str.sub(first, 4, 5)), tonumber(str.sub(first, 6, 7))
|
||||||
|
--end
|
||||||
|
|
||||||
|
local function calculate_color(first, last)
|
||||||
|
--local first_r = tonumber(str.sub(first, 2, 3))
|
||||||
|
--local first_g = tonumber(str.sub(first, 4, 5))
|
||||||
|
return tonumber(first)*tonumber(last)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function get_texture_function(texture)
|
||||||
|
local function get_texture(obj, itemstack)
|
||||||
|
local color = itemstack:get_meta():get_string("color")
|
||||||
|
if color == "" or color == nil then
|
||||||
|
return texture
|
||||||
|
else
|
||||||
|
return texture.."[colorize:"..color..":"..colorize_value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return get_texture
|
||||||
|
end
|
||||||
|
|
||||||
|
mcl_armor.register_set({
|
||||||
|
name = "leather_colored",
|
||||||
|
description = "Colored Leather",
|
||||||
|
descriptions = {
|
||||||
|
head = "Cap",
|
||||||
|
torso = "Tunic",
|
||||||
|
legs = "Pants",
|
||||||
|
},
|
||||||
|
durability = 80,
|
||||||
|
enchantability = 15,
|
||||||
|
points = {
|
||||||
|
head = 1,
|
||||||
|
torso = 3,
|
||||||
|
legs = 2,
|
||||||
|
feet = 1,
|
||||||
|
},
|
||||||
|
textures = {
|
||||||
|
head = get_texture_function("mcl_armor_helmet_leather.png"),
|
||||||
|
torso = get_texture_function("mcl_armor_chestplate_leather.png"),
|
||||||
|
legs = get_texture_function("mcl_armor_leggings_leather.png"),
|
||||||
|
feet = get_texture_function("mcl_armor_boots_leather.png"),
|
||||||
|
},
|
||||||
|
repair_material = "mcl_mobitems:leather",
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_chatcommand("colort", {
|
||||||
|
params = "<name> <privilege>", -- Short parameter description
|
||||||
|
description = "Remove privilege from player", -- Full description
|
||||||
|
func = function(name, param)
|
||||||
|
local player = minetest.get_player_by_name(name)
|
||||||
|
local item = player:get_wielded_item()
|
||||||
|
item:get_meta():set_string("color", "#951d1d")
|
||||||
|
end,
|
||||||
|
})
|
Loading…
Reference in New Issue