Correct splash harming, remove double damage to entity, and add harming to armor bypass

This commit is contained in:
Brandon 2020-07-06 20:23:59 -04:00
parent cf8f6956f7
commit 78768c3dab
3 changed files with 4 additions and 9 deletions

View File

@ -499,7 +499,8 @@ minetest.register_on_player_hpchange(function(player, hp_change, reason)
return hp_change
end
if reason.other == "poison" then
-- Account for potion effects (armor doesn't save the target)
if reason.other == "poison" or reason.other == "harming" then
return hp_change
end

View File

@ -481,12 +481,6 @@ function mcl_potions.healing_func(player, hp)
end
-- adjust mob health
obj = player:get_luaentity()
if obj and obj._cmi_is_mob then
obj.health = obj.health + hp
end
end
function mcl_potions.swiftness_func(player, factor, duration)

View File

@ -123,12 +123,12 @@ register_splash("healing_2", "Splash Healing II", "#DD0000", {
})
register_splash("harming", "Splash Harming", "#660099", {
potion_fun = function(player, redx) mcl_potions.healing_func(player, -4*redx) end,
potion_fun = function(player, redx) mcl_potions.healing_func(player, -6*redx) end,
tt = "-2 hearts"
})
register_splash("harming_2", "Splash Harming II", "#330066", {
potion_fun = function(player, redx) mcl_potions.healing_func(player, -6*redx) end,
potion_fun = function(player, redx) mcl_potions.healing_func(player, -12*redx) end,
tt = "-3 hearts"
})