1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-06-28 06:11:47 +02:00

Updated pclasses

- Moved the holographic item's name as a field in switch_params (pclasses.api.register_class)
 - Added wizard class' skeleton for later
 - Fixed a few bugs in nodes, inventory and api
 - Splitted tick function to bury items in two
 - Items from 3d_armor's armor inventory are also affected by inventory vacuuming (from tick function).
   The player's static armor inventory is first cleared, then copied to the detached one, then armor updates everything else (rendering, model, etc)
 - Fixed itemname of admin shield to reserve it properly
 - Return graveyard inventory if it already exists. Do not create it every two seconds
This commit is contained in:
LeMagnesium
2015-08-20 17:11:46 +02:00
parent 837e25bc13
commit 743507564f
11 changed files with 120 additions and 55 deletions

View File

@ -11,7 +11,8 @@ pclasses.api.register_class("admin", {
minetest.chat_send_player(pname, "Hello admin.")
end,
switch_params = {
color = {r = 255, g = 00, b = 224}
color = {r = 255, g = 00, b = 224},
holo_item = "maptools:pick_admin"
}
})
@ -19,6 +20,6 @@ pclasses.api.reserve_item("admin", "3d_armor:helmet_admin")
pclasses.api.reserve_item("admin", "3d_armor:chestplate_admin")
pclasses.api.reserve_item("admin", "3d_armor:leggings_admin")
pclasses.api.reserve_item("admin", "3d_armor:boots_admin")
pclasses.api.reserve_item("admin", "shields:shields_admin")
pclasses.api.reserve_item("admin", "shields:shield_admin")
pclasses.api.reserve_item("admin", "maptools:pick_admin")
pclasses.api.reserve_item("admin", "maptools:pick_admin_with_drops")

View File

@ -23,7 +23,8 @@ pclasses.api.register_class("hunter", {
end,
switch_params = {
color = {r = 30, g = 170, b = 00},
tile = "default_wood.png"
tile = "default_wood.png",
holo_item = "throwing:bow_minotaur_horn_improved"
}
})

View File

@ -3,3 +3,4 @@ local path = minetest.get_modpath("mff_pclasses")
dofile(path .. "/warrior.lua")
dofile(path .. "/hunter.lua")
dofile(path .. "/admin.lua")
dofile(path .. "/wizard.lua")

View File

@ -11,14 +11,15 @@ pclasses.api.register_class("warrior", {
minetest.sound_play("pclasses_full_warrior")
minetest.chat_send_player(pname, "You are now a warrior")
sprint.set_maxstamina(pname, 20)
minetest.log("action", "[PClasses] Player " .. pname .. " become a warrior")
minetest.log("action", "[PClasses] Player " .. pname .. " becomes a warrior")
end,
on_unassigned = function(pname)
sprint.set_default_maxstamina(pname)
end,
switch_params = {
color = {r = 06, g = 06, b = 30},
tile = "default_steel_block.png"
tile = "default_steel_block.png",
holo_item = "default:dungeon_master_s_blood_sword"
}
})

View File

@ -0,0 +1,22 @@
------------------
-- Wizard class --
------------------
--
-- No Issue Yet
--
pclasses.api.register_class("wizard", {
on_assigned = function(pname)
-- minetest.sound_play("pclasses_full_wizard")
minetest.chat_send_player(pname, "You are now a wizard.")
-- Add specs here
minetest.log("action", "[PClasses] Player " .. pname .. " becomes a wizard")
end,
switch_params = {
color = {r = 230, g = 230, b = 0},
holo_item = "default:book"
}
})
-- Reserved items here