Added dolphin's grace

This commit is contained in:
the-real-herowl 2024-01-24 02:37:24 +01:00 committed by the-real-herowl
parent 48b7b77b9d
commit c19ec0b617
1 changed files with 21 additions and 0 deletions

View File

@ -299,6 +299,27 @@ mcl_potions.register_effect({
uses_factor = false,
})
mcl_potions.register_effect({
name = "dolphin_grace",
description = S("Dolphin's Grace"),
get_tt = function(factor)
return S("swimming gracefully")
end,
on_hit_timer = function(object, factor, duration)
local node = minetest.get_node_or_nil(object:get_pos())
if node and minetest.registered_nodes[node.name]
and minetest.get_item_group(node.name, "liquid") ~= 0 then
playerphysics.add_physics_factor(object, "speed", "mcl_potions:dolphin", 2)
else
playerphysics.remove_physics_factor(object, "speed", "mcl_potions:dolphin", 2)
end
end,
particle_color = "#6AABFD",
uses_factor = false,
timer_uses_factor = false,
hit_timer_step = 1,
})
mcl_potions.register_effect({
name = "leaping",
description = S("Leaping"),