From c68edd9e253b3cfc80122327aa7fd24bee2a2074 Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Wed, 24 Jan 2024 02:37:24 +0100 Subject: [PATCH] Added dolphin's grace --- mods/ITEMS/mcl_potions/functions.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index 72252c910..cdcb04f1b 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -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"),