mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-25 10:52:25 +01:00
Correct splash harming, remove double damage to entity, and add harming to armor bypass
This commit is contained in:
parent
cf8f6956f7
commit
78768c3dab
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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"
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user