63 lines
2.5 KiB
Diff
63 lines
2.5 KiB
Diff
diff --git a/api.lua b/api.lua
|
|
index c390549..78e30f0 100644
|
|
--- a/api.lua
|
|
+++ b/api.lua
|
|
@@ -875,7 +875,7 @@ minetest.register_on_item_eat(function(hp_change, replace_with_item, itemstack,
|
|
local meta = user:get_meta()
|
|
local score = user:get_hp()
|
|
|
|
- if meta:get_int("snakepoison") > 0 then meta:set_int("snakepoison",0) end
|
|
+ if meta:get_int("snakepoison") > 0 then meta:set_int("snakepoison",0) hunger_ng.set_effect(user:get_player_name(), "heal", "enabled") end
|
|
water_life.change_hud(user,"poison",0)
|
|
end
|
|
|
|
diff --git a/behaviors.lua b/behaviors.lua
|
|
index 654fc5f..61935b6 100644
|
|
--- a/behaviors.lua
|
|
+++ b/behaviors.lua
|
|
@@ -297,6 +297,7 @@ function water_life.lq_jumpattack(self,height,target,extra)
|
|
local name = target:get_player_name()
|
|
local join = meta:get_int("jointime")
|
|
if not join or (os.time() - join) > water_life.newplayerbonus * 86400 then
|
|
+ hunger_ng.set_effect(target:get_player_name(), "heal", "disabled")
|
|
meta:set_int("snakepoison",1)
|
|
water_life.change_hud(target,"poison")
|
|
else
|
|
diff --git a/crafts.lua b/crafts.lua
|
|
index 84703e4..5e5bf71 100644
|
|
--- a/crafts.lua
|
|
+++ b/crafts.lua
|
|
@@ -340,7 +340,7 @@ if not water_life.apionly then
|
|
local meta = user:get_meta()
|
|
local score = user:get_hp()
|
|
|
|
- if meta:get_int("snakepoison") > 0 then meta:set_int("snakepoison",0) end
|
|
+ if meta:get_int("snakepoison") > 0 then meta:set_int("snakepoison",0) hunger_ng.set_effect(user:get_player_name(), "heal", "enabled") end
|
|
user:set_hp(score+10)
|
|
itemstack:take_item()
|
|
water_life.change_hud(user,"poison",0)
|
|
diff --git a/hud.lua b/hud.lua
|
|
index bff0dd4..1b205ba 100644
|
|
--- a/hud.lua
|
|
+++ b/hud.lua
|
|
@@ -71,6 +71,7 @@ minetest.register_on_joinplayer(function(player)
|
|
water_life.playerhud.repellant[name] = player:hud_add(water_life.hud_repellant)
|
|
|
|
if meta:get_int("snakepoison") > 0 then
|
|
+ hunger_ng.set_effect(player:get_player_name(), "heal", "disabled")
|
|
minetest.after(5, function(player)
|
|
water_life.change_hud(player,"poison")
|
|
end, player)
|
|
diff --git a/spawn.lua b/spawn.lua
|
|
index 00b5afc..bb46d6e 100644
|
|
--- a/spawn.lua
|
|
+++ b/spawn.lua
|
|
@@ -58,6 +58,7 @@ local function spawnstep(dtime)
|
|
|
|
if meta:get_int("snakepoison") > 0 then
|
|
local score = plyr:get_hp()
|
|
+ hunger_ng.set_effect(plyr:get_player_name(), "heal", "disabled")
|
|
plyr:set_hp(score-1)
|
|
end
|
|
|