Add mini-hunger mod. Correct meat drops in some mobs.
This commit is contained in:
parent
aac2db0da4
commit
36af3b1d92
4 changed files with 91 additions and 21 deletions
12
abms.lua
12
abms.lua
|
@ -68,6 +68,12 @@ minetest.register_globalstep(function(dtime)
|
|||
return
|
||||
end
|
||||
|
||||
local out = io.open(fun_caves.world..'/fun_caves_data.txt','w')
|
||||
if out then
|
||||
out:write(minetest.serialize(fun_caves.db))
|
||||
out.close()
|
||||
end
|
||||
|
||||
-- Promote mobs based on spawn position
|
||||
local is_fortress = fun_caves.is_fortress
|
||||
for _, mob in pairs(minetest.luaentities) do
|
||||
|
@ -183,11 +189,7 @@ minetest.register_globalstep(function(dtime)
|
|||
|
||||
-- ... from hunger (even less often).
|
||||
if dps_count % hunger_delay == 0 then
|
||||
if hunger_mod then
|
||||
hunger.update_hunger(player, hunger.players[player_name].lvl - 4)
|
||||
else
|
||||
player:set_hp(player:get_hp() - 1)
|
||||
end
|
||||
fun_caves.hunger_change(player, -1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue