From 2827542002662aff9edae7044d3a49974b733ff2 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Sun, 18 Apr 2021 18:49:00 +0200 Subject: [PATCH] Implement food poisoning damage properly~ --- mods/CORE/mcl_damage/init.lua | 6 +++--- mods/PLAYER/mcl_hunger/hunger.lua | 5 +---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/mods/CORE/mcl_damage/init.lua b/mods/CORE/mcl_damage/init.lua index 3aabbd5258..18cb6cb13b 100644 --- a/mods/CORE/mcl_damage/init.lua +++ b/mods/CORE/mcl_damage/init.lua @@ -12,7 +12,7 @@ mcl_damage = { cactus = {}, fall = {bypasses_armor = true}, fly_into_wall = {bypasses_armor = true}, -- unused - out_of_world = {bypasses_armor = true, bypasses_invulnerability = true, bypasses_magic = true}, + out_of_world = {bypasses_armor = true, bypasses_invulnerability = true}, generic = {bypasses_armor = true}, magic = {is_magic = true, bypasses_armor = true}, wither = {bypasses_armor = true}, -- unused @@ -25,8 +25,8 @@ mcl_damage = { fireball = {is_projectile = true, is_fire = true}, thorns = {is_magic = true}, explosion = {is_explosion = true}, - cramming = {bypasses_armor = true}, - fireworks = {is_explosion = true}, + cramming = {bypasses_armor = true}, -- unused + fireworks = {is_explosion = true}, -- unused } } diff --git a/mods/PLAYER/mcl_hunger/hunger.lua b/mods/PLAYER/mcl_hunger/hunger.lua index 30ad10ac2e..2f192357a3 100644 --- a/mods/PLAYER/mcl_hunger/hunger.lua +++ b/mods/PLAYER/mcl_hunger/hunger.lua @@ -110,10 +110,7 @@ local function poisonp(tick, time, time_left, damage, exhaustion, name) -- Deal damage and exhaust player -- TODO: Introduce fatal poison at higher difficulties if player:get_hp()-damage > 0 then - if mod_death_messages then - mcl_death_messages.player_damage(player, S("@1 succumbed to the poison.", name)) - end - player:set_hp(player:get_hp()-damage) + mcl_util.deal_damage(player, damage, {type = "hunger"}) end mcl_hunger.exhaust(name, exhaustion)