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

46
mods/gauges/init.lua Executable file
View File

@ -0,0 +1,46 @@
-- Adds health bars above players.
-- Code by 4aiman, textures by Calinou. Licensed under CC0.
local hp_bar = {
physical = false,
collisionbox = {x = 0, y = 0, z = 0},
visual = "sprite",
textures = {"20.png"}, -- The texture is changed later in the code.
visual_size = {x = 1.5, y = 0.09375, z = 1.5}, -- Y value is (1 / 16) * 1.5.
wielder = nil,
}
function hp_bar:on_step(dtime)
local wielder = self.wielder
if wielder == nil then
self.object:remove()
return
elseif minetest.env:get_player_by_name(wielder:get_player_name()) == nil then
self.object:remove()
return
end
hp = wielder:get_hp()
breath = wielder:get_breath()
self.object:set_properties({textures = {"health_" .. tostring(hp) .. ".png^breath_" .. tostring(breath) .. ".png"}})
end
minetest.register_entity("gauges:hp_bar", hp_bar)
function add_HP_gauge(pl)
local pos = pl:getpos()
local ent = minetest.env:add_entity(pos, "gauges:hp_bar")
if ent ~= nil then
ent:set_attach(pl, "", {x = 0, y = 10, z = 0}, {x = 0, y = 0, z = 0})
ent = ent:get_luaentity()
ent.wielder = pl
end
end
if minetest.setting_getbool("health_bars") ~= false -- “If not defined or set to true then”
and minetest.setting_getbool("enable_damage") then -- Health bars only display when damage is enabled.
minetest.register_on_joinplayer(add_HP_gauge)
end
if minetest.setting_getbool("log_mods") then
minetest.log("action", "Carbone: [gauges] loaded.")
end

BIN
mods/gauges/textures/breath_0.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

BIN
mods/gauges/textures/breath_1.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 B

BIN
mods/gauges/textures/breath_2.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 B

BIN
mods/gauges/textures/breath_3.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

BIN
mods/gauges/textures/breath_4.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

BIN
mods/gauges/textures/breath_5.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

BIN
mods/gauges/textures/breath_6.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 B

BIN
mods/gauges/textures/breath_7.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

BIN
mods/gauges/textures/breath_8.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

BIN
mods/gauges/textures/breath_9.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 B

BIN
mods/gauges/textures/health_0.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 B

BIN
mods/gauges/textures/health_1.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

BIN
mods/gauges/textures/health_2.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

BIN
mods/gauges/textures/health_3.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

BIN
mods/gauges/textures/health_4.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

BIN
mods/gauges/textures/health_5.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

BIN
mods/gauges/textures/health_6.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

BIN
mods/gauges/textures/health_7.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

BIN
mods/gauges/textures/health_8.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

BIN
mods/gauges/textures/health_9.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B