Massive update (#6)

* Refactor some of the code, multiple bug fixes

* Fix something stupid

* More bug fixes

* LOTS OF STUFF

* Make the sniper alot stronger and other changes

* Prevent Players from respawning in the middle of a match

* Fix stupid mistake

* Small update

* More updates

* Remove minimap access.. and downgrade the sniper class
This commit is contained in:
IonicCheese 2025-12-10 19:17:42 -08:00 committed by GitHub
commit 17eeae8937
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
499 changed files with 616 additions and 225 deletions

View file

@ -1,42 +0,0 @@
local api = {}
local MODNAME = minetest.get_current_modname()
rawset(_G, MODNAME, api)
local files = {
"bullet.lua",
"ammo.lua"
}
for _, file in ipairs(files) do
dofile(minetest.get_modpath(MODNAME).."/"..file)
end
local checking = {}
-- Returns false if the automatic timer is currently running, returns true otherwise
function api.enable_automatic(fire_interval, itemstack, user)
local pname = user:get_player_name()
if checking[pname] then return false end
checking[pname] = minetest.after(fire_interval, function()
checking[pname] = nil
if user and user:get_player_control().LMB then
local wielded = user:get_wielded_item()
if wielded:get_name() == itemstack:get_name() then
user:set_wielded_item(itemstack:get_definition().on_use(wielded, user, {type = "nothing"}) or wielded)
end
end
end)
return true
end
minetest.register_on_leaveplayer(function(player)
local pname = player:get_player_name()
if checking[pname] then
checking[pname]:cancel()
end
end)