2014-11-14 20:27:08 +01:00
|
|
|
--[[
|
|
|
|
Sprint mod for Minetest by GunshipPenguin
|
|
|
|
|
|
|
|
To the extent possible under law, the author(s)
|
2015-06-10 17:14:58 +02:00
|
|
|
have dedicated all copyright and related and neighboring rights
|
2014-11-14 20:27:08 +01:00
|
|
|
to this software to the public domain worldwide. This software is
|
2015-06-10 17:14:58 +02:00
|
|
|
distributed without any warranty.
|
2014-11-14 20:27:08 +01:00
|
|
|
]]
|
2014-11-13 02:16:46 +01:00
|
|
|
|
|
|
|
--Configuration variables, these are all explained in README.md
|
2014-11-29 15:40:55 +01:00
|
|
|
SPRINT_METHOD = 1
|
2017-04-07 23:18:55 +02:00
|
|
|
SPRINT_SPEED = 0.35
|
|
|
|
SPRINT_JUMP = 0.1
|
2014-11-29 15:40:55 +01:00
|
|
|
SPRINT_STAMINA = 10
|
|
|
|
SPRINT_TIMEOUT = 0.5 --Only used if SPRINT_METHOD = 0
|
|
|
|
|
2015-07-26 01:05:10 +02:00
|
|
|
sprint = {}
|
|
|
|
|
2015-03-18 03:11:20 +01:00
|
|
|
if minetest.get_modpath("hudbars") ~= nil then
|
|
|
|
hb.register_hudbar("sprint", 0xFFFFFF, "Stamina",
|
2015-06-19 21:17:23 +02:00
|
|
|
{ bar = "sprint_stamina_bar.png", icon = "stamina.png" },
|
2015-03-18 03:11:20 +01:00
|
|
|
SPRINT_STAMINA, SPRINT_STAMINA,
|
|
|
|
false, "%s: %.1f/%.1f")
|
|
|
|
SPRINT_HUDBARS_USED = true
|
|
|
|
else
|
|
|
|
SPRINT_HUDBARS_USED = false
|
|
|
|
end
|
|
|
|
|
2014-11-29 15:40:55 +01:00
|
|
|
if SPRINT_METHOD == 0 then
|
|
|
|
dofile(minetest.get_modpath("sprint") .. "/wsprint.lua")
|
|
|
|
elseif SPRINT_METHOD == 1 then
|
|
|
|
dofile(minetest.get_modpath("sprint") .. "/esprint.lua")
|
|
|
|
else
|
|
|
|
minetest.log("error", "Sprint Mod - SPRINT_METHOD is not set properly, using e to sprint")
|
|
|
|
dofile(minetest.get_modpath("sprint") .. "/esprint.lua")
|
2014-11-13 02:16:46 +01:00
|
|
|
end
|