mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-11-19 16:50:31 +01:00
0754d7a5aa
- Tweaked sprint bar in order to change its maximum value according to the one defined for each player - Reorganized pclasses into multiple files (api, init, one for each class). Next thing to do : document/simplify api
23 lines
663 B
Lua
23 lines
663 B
Lua
-------------------
|
|
-- Warrior class --
|
|
-------------------
|
|
|
|
--
|
|
-- See https://github.com/Ombridride/minetest-minetestforfun-server/issues/113
|
|
--
|
|
|
|
pclasses.api.register_class("warrior", {
|
|
determination = function(player)
|
|
return pclasses.api.util.does_wear_full_armor(player:get_player_name(), "blackmithril", true)
|
|
end,
|
|
on_assigned = function(pname)
|
|
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")
|
|
end,
|
|
on_unassigned = function(pname)
|
|
sprint.set_default_maxstamina(pname)
|
|
end,
|
|
})
|