1
0
mirror of git://repo.or.cz/minetest_hbhunger.git synced 2025-06-29 21:31:01 +02:00

13 Commits

18 changed files with 28 additions and 99 deletions

View File

@ -1,12 +1,12 @@
# Hunger with HUD bar [`hbhunger`] # Hunger with HUD bar [`hbhunger`]
* Version: 0.7.1 * Version: 1.0.1
## Using the mod ## Using the mod
This mod adds a mechanic for hunger. This mod adds a mechanic for hunger.
This mod depends on the HUD bars mod [`hudbars`], version 1.4.1 or any later version This mod depends on the HUD bars mod [`hudbars`], version 1.4.1 or any later version
starting with “1.”. starting with “1.” or “2.”.
## About hunger ## About hunger
This mod adds a hunger mechanic to the game. Players get a new attribute called “satiation”: This mod adds a hunger mechanic to the game. Players get a new attribute called “satiation”:

View File

@ -1,51 +0,0 @@
0.1.0
-----
Initial release
0.2.0
-----
- Change “saturation” to “satiation”
- Rename global table to “hbhunger” to avoid collisions
- General cleanup
0.3.0
-----
- Play simple eating sound when something is eaten
0.3.1
-----
- Add Ethereal orange
- Fix exhaus variable
0.3.2
-----
- Fix another crash
0.4.0
-----
- Generic eating functionality, items using the minetest.item_eat are automatically supported
- Change health bar and icon when poisoned
- Special support for red and brown mushroom from Minetest Game [flowers]
- Special support for [pizza]
- Special support for beans from Farming Redo [farming]
- Fix crash when poisoned player leaves server
- Changed license to LGPL v2.1
0.4.1
-----
- Add foods from Not So Simple Mobs [nssm]
0.5.0
-----
- Fix custom sound not working
- Add Portuguese translation
0.5.1
-----
- Fix incompability problem with pipeworks mod
0.5.2
-----
- Fix mod not working with both intllib and mod security enabled
- Add missing screenshot
- Rewrite README and use Markdown format

View File

@ -1,32 +0,0 @@
hudbars
intllib?
default?
flowers?
animalmaterials?
bucket?
bushes?
bushes_classic?
cooking?
creatures?
docfarming?
dwarves?
ethereal?
farming?
farming_plus?
ferns?
fishing?
fruit?
glooptest?
jkanimals?
jkfarming?
jkwine?
kpgmobs?
mobfcooking?
mobs?
moretrees?
mtfoods?
mush45?
mushroom?
seaplants?
pizza?
nssm?

View File

@ -1 +0,0 @@
Adds a simple hunger meachanic with satiation, food poisoning and different healing.

View File

@ -79,7 +79,13 @@ function hbhunger.item_eat(hunger_change, replace_with_item, poisen, heal, sound
if h == nil or hp == nil then if h == nil or hp == nil then
return return
end end
minetest.sound_play({name = sound or "hbhunger_eat_generic", gain = 1}, {pos=user:getpos(), max_hear_distance = 16}) minetest.sound_play(
{name = sound or "hbhunger_eat_generic",
gain = 1},
{object=user,
max_hear_distance = 16,
pitch = 1 + math.random(-10, 10)*0.005,}
)
-- Saturation -- Saturation
if h < 30 and hunger_change then if h < 30 and hunger_change then

View File

@ -1,9 +1,4 @@
local S local S = minetest.get_translator("hbhunger")
if (minetest.get_modpath("intllib")) then
S = intllib.Getter()
else
S = function ( s ) return s end
end
if minetest.settings:get_bool("enable_damage") then if minetest.settings:get_bool("enable_damage") then
@ -46,7 +41,7 @@ end
dofile(minetest.get_modpath("hbhunger").."/hunger.lua") dofile(minetest.get_modpath("hbhunger").."/hunger.lua")
-- register satiation hudbar -- register satiation hudbar
hb.register_hudbar("satiation", 0xFFFFFF, S("Satiation"), { icon = "hbhunger_icon.png", bgicon = "hbhunger_bgicon.png", bar = "hbhunger_bar.png" }, 20, 30, false) hb.register_hudbar("satiation", 0xFFFFFF, S("Satiation"), { icon = "hbhunger_icon.png", bgicon = "hbhunger_bgicon.png", bar = "hbhunger_bar.png" }, 20, 30, false, nil, { format_value = "%.1f", format_max_value = "%d" })
-- update hud elemtens if value has changed -- update hud elemtens if value has changed
local function update_hud(player) local function update_hud(player)
@ -153,3 +148,5 @@ minetest.register_globalstep(function(dtime)
end) end)
end end
minetest.log("action", "[hbhunger] loaded.")

View File

@ -1 +0,0 @@
Satiation = Sättigung

2
locale/hbhunger.de.tr Normal file
View File

@ -0,0 +1,2 @@
# textdomain:hbhunger
Satiation=Sättigung

2
locale/hbhunger.it.tr Normal file
View File

@ -0,0 +1,2 @@
# textdomain:hbhunger
Satiation=Sazietà

2
locale/hbhunger.ms.tr Normal file
View File

@ -0,0 +1,2 @@
# textdomain:hbhunger
Satiation=Kekenyangan

2
locale/hbhunger.pt.tr Normal file
View File

@ -0,0 +1,2 @@
# textdomain:hbhunger
Satiation=Saciedade

2
locale/hbhunger.ru.tr Normal file
View File

@ -0,0 +1,2 @@
# textdomain:hbhunger
Satiation=голод

View File

@ -1 +0,0 @@
Satiation = Sazietà

View File

@ -1 +0,0 @@
Satiation = Kekenyangan

View File

@ -1 +0,0 @@
Satiation = Saciedade

View File

@ -1 +1,2 @@
Satiation # textdomain:hbhunger
Satiation=

View File

@ -1 +1,4 @@
name = hbhunger name = hbhunger
description = Adds a simple hunger meachanic with satiation, food poisoning and different healing.
depends = hudbars
optional_depends = default, flowers, animalmaterials, bucket, bushes, bushes_classic, cooking, creatures, docfarming, dwarves, ethereal, farming, farming_plus, ferns, fishing, fruit, glooptest, jkanimals, jkfarming, jkwine, kpgmobs, mobfcooking, mobs, moretrees, mtfoods, mush45, mushroom, seaplants, pizza, nssm

Binary file not shown.