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

initial commit

subgame + mods
This commit is contained in:
Ombridride
2014-10-28 18:01:32 +01:00
parent baab1b3f7c
commit 232b274c55
6451 changed files with 226156 additions and 0 deletions

13
mods/sprint/LICENSE Executable file
View File

@ -0,0 +1,13 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

3
mods/sprint/README.md Executable file
View File

@ -0,0 +1,3 @@
Sprint mod v1 by GunshipPenguin
Allows the player to sprint by double tapping w. By default, sprinting will make the player travel 50% faster and allow him/her to jump 10% higher. This can be changed however, by adjusting the SPRINT_SPEED and SPRINT_JUMP variables in the init.lua file.

51
mods/sprint/init.lua Executable file
View File

@ -0,0 +1,51 @@
--Sprint mod for minetest by GunshipPenguin
--CHANGE THESE VARIABLES TO ADJUST SPRINT SPEED/JUMP HEIGHT
--1 represents normal speed/jump height so 1.5 would mean 50% more and 2.0 would be 100% more
SPRINT_SPEED = 1.30 --Speed while sprinting
SPRINT_JUMP = 1.10 --Jump height while sprinting
STOP_ON_CLICK = true --If true, sprinting will stop when either the left mouse button or the right mouse button is pressed
players = {}
minetest.register_on_joinplayer(function(player)
players[player:get_player_name()] = {state = 0, timeOut = 0}
end)
minetest.register_on_leaveplayer(function(player)
playerName = player:get_player_name()
players[playerName] = nil
end)
minetest.register_globalstep(function(dtime)
--Loop through all connected players
for playerName,playerInfo in pairs(players) do
player = minetest.get_player_by_name(playerName)
if player ~= nil then
playerMovement = player:get_player_control()["up"]
if player:get_player_control()["RMB"] or player:get_player_control()["LMB"] and STOP_ON_CLICK == true then
players[playerName]["state"] = 0
player:set_physics_override({speed=1.0, jump=1.0})
end
if playerInfo["state"] == 2 then
players[playerName]["timeOut"] = players[playerName]["timeOut"] + 1
if playerInfo["timeOut"] == 10 then
players[playerName]["timeOut"] = 0
players[playerName]["state"] = 0
end
end
if playerMovement == false and playerInfo["state"] == 3 then --Stopped
players[playerName]["state"] = 0
player:set_physics_override({speed=1.0,jump=1.0})
elseif playerMovement == true and playerInfo["state"] == 0 then --Moving
players[playerName]["state"] = 1
elseif playerMovement == false and playerInfo["state"] == 1 then --Primed
players[playerName]["state"] = 2
elseif playerMovement == true and playerInfo["state"] == 2 then --Sprinting
players[playerName]["state"] = 3
player:set_physics_override({speed=SPRINT_SPEED,jump=SPRINT_JUMP})
end
end
end
end)