Implement food poisoning damage properly~

This commit is contained in:
Elias Fleckenstein 2021-04-18 18:49:00 +02:00
parent 3ad5b30ea5
commit 2827542002
2 changed files with 4 additions and 7 deletions

@ -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
}
}

@ -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)