diff --git a/mods/mff/mff_pclasses/admin.lua b/mods/mff/mff_pclasses/admin.lua index 1aba1c9e..c72f9312 100755 --- a/mods/mff/mff_pclasses/admin.lua +++ b/mods/mff/mff_pclasses/admin.lua @@ -10,7 +10,9 @@ pclasses.api.register_class("admin", { on_assigned = function(pname) minetest.chat_send_player(pname, "Hello admin.") 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") diff --git a/mods/mff/mff_pclasses/hunter.lua b/mods/mff/mff_pclasses/hunter.lua index 94153bce..75c30b61 100755 --- a/mods/mff/mff_pclasses/hunter.lua +++ b/mods/mff/mff_pclasses/hunter.lua @@ -21,7 +21,10 @@ pclasses.api.register_class("hunter", { on_unassigned = function(pname) sprint.set_default_maxstamina(pname) end, - switch_color = {r = 60, g = 75, b = 00} + switch_params = { + color = {r = 30, g = 170, b = 00}, + tile = "default_wood.png" + } }) diff --git a/mods/mff/mff_pclasses/warrior.lua b/mods/mff/mff_pclasses/warrior.lua index 8b37bf93..d612ef6a 100755 --- a/mods/mff/mff_pclasses/warrior.lua +++ b/mods/mff/mff_pclasses/warrior.lua @@ -16,7 +16,10 @@ pclasses.api.register_class("warrior", { on_unassigned = function(pname) sprint.set_default_maxstamina(pname) 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") diff --git a/mods/pclasses/adventurer.lua b/mods/pclasses/adventurer.lua index 04e2267c..5a9120c5 100755 --- a/mods/pclasses/adventurer.lua +++ b/mods/pclasses/adventurer.lua @@ -3,7 +3,10 @@ -- 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) minetest.chat_send_player(pname, "You are now an adventurer") end diff --git a/mods/pclasses/api.lua b/mods/pclasses/api.lua index 4173a60c..f85cfb90 100755 --- a/mods/pclasses/api.lua +++ b/mods/pclasses/api.lua @@ -14,7 +14,7 @@ function pclasses.api.register_class(cname, def) cname .. ". Reason : no definition table.") return end - pclasses.register_class_switch(cname, def.switch_color) + pclasses.register_class_switch(cname, def.switch_params) pclasses.classes[cname] = def return true diff --git a/mods/pclasses/nodes.lua b/mods/pclasses/nodes.lua index c2846e1c..6364990f 100755 --- a/mods/pclasses/nodes.lua +++ b/mods/pclasses/nodes.lua @@ -61,16 +61,18 @@ local classes_items = { ["hunter"] = "throwing:bow_minotaur_horn_improved", ["warrior"] = "default:dungeon_master_s_blood_sword", ["admin"] = "maptools:pick_admin", - ["adventurer"] = "unified_inventory:bag_large" + ["adventurer"] = "unified_inventory:bag_large", + ["wizard"] = "default:book" } -function pclasses.register_class_switch(cname, color) - color = color or { r = 255, g = 255, b = 255 } +function pclasses.register_class_switch(cname, params) + 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 overlay = "pclasses_class_switch_orb_overlay.png" + print((params.tile or overlay)) minetest.register_node(":pclasses:class_switch_" .. cname, { description = "Class switch orb (" .. cname .. ")", - tiles = {overlay .. "^[colorize:" .. txtcolor .. "^" .. overlay}, + tiles = {(params.tile or overlay) .. "^[colorize:" .. txtcolor .. ":200"}, drawtype = "nodebox", node_box = { type = "fixed", fixed = { {-7/16, -8/16, -7/16, 7/16, -7/16, 7/16}, -- bottom plate