2015-07-31 21:53:32 +02:00
|
|
|
------------------
|
|
|
|
-- Hunter class --
|
|
|
|
------------------
|
|
|
|
|
|
|
|
--
|
|
|
|
-- See https://github.com/Ombridride/minetest-minetestforfun-server/issues/114
|
|
|
|
--
|
|
|
|
|
|
|
|
pclasses.api.register_class("hunter", {
|
2016-01-03 23:01:40 +01:00
|
|
|
on_assigned = function(pname, inform)
|
|
|
|
if inform then
|
|
|
|
minetest.chat_send_player(pname, "You are now a hunter")
|
|
|
|
minetest.sound_play("pclasses_full_hunter", {to_player=pname, gain=1})
|
|
|
|
end
|
2015-07-31 21:53:32 +02:00
|
|
|
local reinforced = pclasses.api.util.does_wear_full_armor(pname, "reinforcedleather", true)
|
|
|
|
if reinforced then
|
2016-05-04 00:36:26 +02:00
|
|
|
sprint.increase_maxstamina(pname, 40)
|
2015-07-31 21:53:32 +02:00
|
|
|
else
|
2016-05-04 00:36:26 +02:00
|
|
|
sprint.increase_maxstamina(pname, 30)
|
2015-07-31 21:53:32 +02:00
|
|
|
end
|
|
|
|
minetest.log("action", "[PClasses] Player " .. pname .. " become a hunter")
|
|
|
|
end,
|
|
|
|
on_unassigned = function(pname)
|
|
|
|
sprint.set_default_maxstamina(pname)
|
|
|
|
end,
|
2015-08-17 10:53:13 +02:00
|
|
|
switch_params = {
|
|
|
|
color = {r = 30, g = 170, b = 00},
|
2015-08-20 17:11:46 +02:00
|
|
|
tile = "default_wood.png",
|
|
|
|
holo_item = "throwing:bow_minotaur_horn_improved"
|
2016-07-14 23:32:42 +02:00
|
|
|
},
|
2016-09-24 15:12:45 +02:00
|
|
|
informations = pclasses.api.textify("Being a hunter is mostly being tactical, or just kicking in and firing arrows like madness." ..
|
|
|
|
"Being a hunter, you're in the only class which member can use new and exclusive" ..
|
|
|
|
"ranged weapons, like spears, arbalests and bows. Your stamina is increased to" ..
|
|
|
|
"40, you're a sport person, able to sprint for a long time, which is found to be" ..
|
|
|
|
"useful when you hunt down animals and mobs who can't run faster than you walk.." ..
|
|
|
|
"and even more when you need to cowardly run away... anyway. The point is, being" ..
|
|
|
|
"a hunter is great, since you can access new and exclusive weapons, and leather" ..
|
|
|
|
"armors, crafted from leather. Obviously.. Those clothes are pretty strong, and" ..
|
|
|
|
"will protect you more than wooden pieces (at least the reinforced one), with the" ..
|
|
|
|
"satation consumption of wearing nothing. If you want to risk it and become a" ..
|
|
|
|
"hunter, you should look for a green pedestal with a bow so fancy over it that you" ..
|
|
|
|
"can already tell that we're gonna make you use loads of ores for it. (actually" ..
|
|
|
|
"you need to fight a super strong mob, but it's just details...)") .. "image[2.4,5.6;6,4;pclasses_showcase_hunter.png]"
|
2015-07-31 21:53:32 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
pclasses.api.reserve_item("hunter", "throwing:bow_minotaur_horn")
|
2016-03-17 22:03:07 +01:00
|
|
|
pclasses.api.reserve_item("hunter", "throwing:bow_minotaur_horn_loaded")
|
2015-07-31 21:53:32 +02:00
|
|
|
pclasses.api.reserve_item("hunter", "throwing:bow_minotaur_horn_improved")
|
2016-03-17 22:03:07 +01:00
|
|
|
pclasses.api.reserve_item("hunter", "throwing:bow_minotaur_horn_improved_loaded")
|
2015-07-31 21:53:32 +02:00
|
|
|
pclasses.api.reserve_item("hunter", "throwing:arrow_mithril")
|
2015-08-11 12:01:55 +02:00
|
|
|
pclasses.api.reserve_item("hunter", "throwing:arbalest_auto")
|
2016-03-17 22:03:07 +01:00
|
|
|
pclasses.api.reserve_item("hunter", "throwing:arbalest_auto_loaded")
|
2015-10-12 22:37:23 +02:00
|
|
|
pclasses.api.reserve_item("hunter", "spears:spear_stone")
|
|
|
|
pclasses.api.reserve_item("hunter", "spears:spear_steel")
|
|
|
|
pclasses.api.reserve_item("hunter", "spears:spear_obsidian")
|
|
|
|
pclasses.api.reserve_item("hunter", "spears:spear_diamond")
|
|
|
|
pclasses.api.reserve_item("hunter", "spears:spear_mithril")
|
2015-09-21 22:09:16 +02:00
|
|
|
|
2015-11-26 22:18:07 +01:00
|
|
|
for _, i in pairs({"helmet", "chestplate", "boots", "leggings"}) do
|
|
|
|
pclasses.api.reserve_item("hunter", "3d_armor:" .. i .. "_hardenedleather")
|
|
|
|
pclasses.api.reserve_item("hunter", "3d_armor:" .. i .. "_reinforcedleather")
|
|
|
|
end
|