forked from mtcontrib/minetest_hbhunger
		
	Compare commits
	
		
			10 Commits
		
	
	
		
			nalc-1.0
			...
			235a8652eb
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 235a8652eb | |||
| 
						 | 
					91d6d3de5d | ||
| 
						 | 
					ebf40debc6 | ||
| 
						 | 
					564413a871 | ||
| 
						 | 
					96f05c4e73 | ||
| 9989c26c65 | |||
| 
						 | 
					957decb6ac | ||
| 
						 | 
					da66d0a1af | ||
| 
						 | 
					f293d3c7fe | ||
| 
						 | 
					d6b281bcab | 
@@ -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”:
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										32
									
								
								depends.txt
									
									
									
									
									
								
							
							
						
						
									
										32
									
								
								depends.txt
									
									
									
									
									
								
							@@ -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?
 | 
					 | 
				
			||||||
@@ -1 +0,0 @@
 | 
				
			|||||||
Adds a simple hunger meachanic with satiation, food poisoning and different healing.
 | 
					 | 
				
			||||||
@@ -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
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										9
									
								
								init.lua
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								init.lua
									
									
									
									
									
								
							@@ -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)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1 +0,0 @@
 | 
				
			|||||||
Satiation = Sättigung
 | 
					 | 
				
			||||||
							
								
								
									
										2
									
								
								locale/hbhunger.de.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								locale/hbhunger.de.tr
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
				
			|||||||
 | 
					# textdomain:hbhunger
 | 
				
			||||||
 | 
					Satiation=Sättigung
 | 
				
			||||||
							
								
								
									
										2
									
								
								locale/hbhunger.it.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								locale/hbhunger.it.tr
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
				
			|||||||
 | 
					# textdomain:hbhunger
 | 
				
			||||||
 | 
					Satiation=Sazietà
 | 
				
			||||||
							
								
								
									
										2
									
								
								locale/hbhunger.ms.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								locale/hbhunger.ms.tr
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
				
			|||||||
 | 
					# textdomain:hbhunger
 | 
				
			||||||
 | 
					Satiation=Kekenyangan
 | 
				
			||||||
							
								
								
									
										2
									
								
								locale/hbhunger.pt.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								locale/hbhunger.pt.tr
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
				
			|||||||
 | 
					# textdomain:hbhunger
 | 
				
			||||||
 | 
					Satiation=Saciedade
 | 
				
			||||||
							
								
								
									
										2
									
								
								locale/hbhunger.ru.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								locale/hbhunger.ru.tr
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
				
			|||||||
 | 
					# textdomain:hbhunger
 | 
				
			||||||
 | 
					Satiation=голод
 | 
				
			||||||
@@ -1 +0,0 @@
 | 
				
			|||||||
Satiation = Sazietà
 | 
					 | 
				
			||||||
@@ -1 +0,0 @@
 | 
				
			|||||||
Satiation = Kekenyangan
 | 
					 | 
				
			||||||
@@ -1 +0,0 @@
 | 
				
			|||||||
Satiation = Saciedade
 | 
					 | 
				
			||||||
@@ -1 +1,2 @@
 | 
				
			|||||||
Satiation
 | 
					# textdomain:hbhunger
 | 
				
			||||||
 | 
					Satiation=
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										3
									
								
								mod.conf
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								mod.conf
									
									
									
									
									
								
							@@ -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
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,54 +0,0 @@
 | 
				
			|||||||
OLD CHANGELOG
 | 
					 | 
				
			||||||
-------------
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
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
 | 
					 | 
				
			||||||
		Reference in New Issue
	
	Block a user