mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-01-11 18:40:25 +01:00
Add tile image in class switches' parameters and tweak colors
- Refers to #216
This commit is contained in:
parent
26fae174b1
commit
2cd80bccf1
@ -10,7 +10,9 @@ pclasses.api.register_class("admin", {
|
|||||||
on_assigned = function(pname)
|
on_assigned = function(pname)
|
||||||
minetest.chat_send_player(pname, "Hello admin.")
|
minetest.chat_send_player(pname, "Hello admin.")
|
||||||
end,
|
end,
|
||||||
switch_color = {r = 255, g = 00, b = 224}
|
switch_params = {
|
||||||
|
color = {r = 255, g = 00, b = 224}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
pclasses.api.reserve_item("admin", "3d_armor:helmet_admin")
|
pclasses.api.reserve_item("admin", "3d_armor:helmet_admin")
|
||||||
|
@ -21,7 +21,10 @@ pclasses.api.register_class("hunter", {
|
|||||||
on_unassigned = function(pname)
|
on_unassigned = function(pname)
|
||||||
sprint.set_default_maxstamina(pname)
|
sprint.set_default_maxstamina(pname)
|
||||||
end,
|
end,
|
||||||
switch_color = {r = 60, g = 75, b = 00}
|
switch_params = {
|
||||||
|
color = {r = 30, g = 170, b = 00},
|
||||||
|
tile = "default_wood.png"
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,7 +16,10 @@ pclasses.api.register_class("warrior", {
|
|||||||
on_unassigned = function(pname)
|
on_unassigned = function(pname)
|
||||||
sprint.set_default_maxstamina(pname)
|
sprint.set_default_maxstamina(pname)
|
||||||
end,
|
end,
|
||||||
switch_color = {r = 00, g = 00, b = 114}
|
switch_params = {
|
||||||
|
color = {r = 06, g = 06, b = 30},
|
||||||
|
tile = "default_steel_block.png"
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
pclasses.api.reserve_item("warrior", "moreores:sword_mithril")
|
pclasses.api.reserve_item("warrior", "moreores:sword_mithril")
|
||||||
|
@ -3,7 +3,10 @@
|
|||||||
--
|
--
|
||||||
|
|
||||||
pclasses.api.register_class("adventurer", {
|
pclasses.api.register_class("adventurer", {
|
||||||
switch_color = { r = 142, g = 00, b = 00},
|
switch_params = {
|
||||||
|
color = { r = 142, g = 64, b = 00},
|
||||||
|
tile = "wool_white.png",
|
||||||
|
},
|
||||||
on_assigned = function(pname)
|
on_assigned = function(pname)
|
||||||
minetest.chat_send_player(pname, "You are now an adventurer")
|
minetest.chat_send_player(pname, "You are now an adventurer")
|
||||||
end
|
end
|
||||||
|
@ -14,7 +14,7 @@ function pclasses.api.register_class(cname, def)
|
|||||||
cname .. ". Reason : no definition table.")
|
cname .. ". Reason : no definition table.")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
pclasses.register_class_switch(cname, def.switch_color)
|
pclasses.register_class_switch(cname, def.switch_params)
|
||||||
|
|
||||||
pclasses.classes[cname] = def
|
pclasses.classes[cname] = def
|
||||||
return true
|
return true
|
||||||
|
@ -61,16 +61,18 @@ local classes_items = {
|
|||||||
["hunter"] = "throwing:bow_minotaur_horn_improved",
|
["hunter"] = "throwing:bow_minotaur_horn_improved",
|
||||||
["warrior"] = "default:dungeon_master_s_blood_sword",
|
["warrior"] = "default:dungeon_master_s_blood_sword",
|
||||||
["admin"] = "maptools:pick_admin",
|
["admin"] = "maptools:pick_admin",
|
||||||
["adventurer"] = "unified_inventory:bag_large"
|
["adventurer"] = "unified_inventory:bag_large",
|
||||||
|
["wizard"] = "default:book"
|
||||||
}
|
}
|
||||||
|
|
||||||
function pclasses.register_class_switch(cname, color)
|
function pclasses.register_class_switch(cname, params)
|
||||||
color = color or { r = 255, g = 255, b = 255 }
|
local color = params.color or { r = 255, g = 255, b = 255 }
|
||||||
local txtcolor = string.format("#%02x%02x%02x", color.r, color.g, color.b)
|
local txtcolor = string.format("#%02x%02x%02x", color.r, color.g, color.b)
|
||||||
local overlay = "pclasses_class_switch_orb_overlay.png"
|
local overlay = "pclasses_class_switch_orb_overlay.png"
|
||||||
|
print((params.tile or overlay))
|
||||||
minetest.register_node(":pclasses:class_switch_" .. cname, {
|
minetest.register_node(":pclasses:class_switch_" .. cname, {
|
||||||
description = "Class switch orb (" .. cname .. ")",
|
description = "Class switch orb (" .. cname .. ")",
|
||||||
tiles = {overlay .. "^[colorize:" .. txtcolor .. "^" .. overlay},
|
tiles = {(params.tile or overlay) .. "^[colorize:" .. txtcolor .. ":200"},
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
node_box = { type = "fixed", fixed = {
|
node_box = { type = "fixed", fixed = {
|
||||||
{-7/16, -8/16, -7/16, 7/16, -7/16, 7/16}, -- bottom plate
|
{-7/16, -8/16, -7/16, 7/16, -7/16, 7/16}, -- bottom plate
|
||||||
|
Loading…
Reference in New Issue
Block a user