From 596d4ddc47d1369a1ed59c6b4800005f0cbdc7a6 Mon Sep 17 00:00:00 2001 From: Brandon Date: Mon, 6 Jul 2020 20:52:24 -0400 Subject: [PATCH] Correct poison effect duration --- mods/ITEMS/mcl_potions/potions.lua | 8 ++++---- mods/ITEMS/mcl_potions/splash.lua | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/mods/ITEMS/mcl_potions/potions.lua b/mods/ITEMS/mcl_potions/potions.lua index eaf6fd49cd..436b1e0a05 100644 --- a/mods/ITEMS/mcl_potions/potions.lua +++ b/mods/ITEMS/mcl_potions/potions.lua @@ -554,14 +554,14 @@ minetest.register_craftitem("mcl_potions:poison", { stack_max = 1, on_place = function(itemstack, user, pointed_thing) - mcl_potions.poison_func(user, 2.5, mcl_potions.DURATION*mcl_potions.INV_FACTOR*mcl_potions.INV_FACTOR) + mcl_potions.poison_func(user, 2.5, mcl_potions.DURATION*mcl_potions.INV_FACTOR^2) minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) mcl_potions._use_potion(itemstack, user, "#225533") return itemstack end, on_secondary_use = function(itemstack, user, pointed_thing) - mcl_potions.poison_func(user, 2.5, mcl_potions.DURATION*mcl_potions.INV_FACTOR*mcl_potions.INV_FACTOR) + mcl_potions.poison_func(user, 2.5, mcl_potions.DURATION*mcl_potions.INV_FACTOR^2) minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) mcl_potions._use_potion(itemstack, user, "#225533") return itemstack @@ -578,14 +578,14 @@ minetest.register_craftitem("mcl_potions:poison_2", { stack_max = 1, on_place = function(itemstack, user, pointed_thing) - mcl_potions.poison_func(user, 1.2, mcl_potions.DURATION_2*mcl_potions.INV_FACTOR*mcl_potions.INV_FACTOR) + mcl_potions.poison_func(user, 1.2, mcl_potions.DURATION_2*mcl_potions.INV_FACTOR^2) minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) mcl_potions._use_potion(itemstack, user, "#447755") return itemstack end, on_secondary_use = function(itemstack, user, pointed_thing) - mcl_potions.poison_func(user, 1.2, mcl_potions.DURATION_2*mcl_potions.INV_FACTOR*mcl_potions.INV_FACTOR) + mcl_potions.poison_func(user, 1.2, mcl_potions.DURATION_2*mcl_potions.INV_FACTOR^2) minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) mcl_potions._use_potion(itemstack, user, "#447755") return itemstack diff --git a/mods/ITEMS/mcl_potions/splash.lua b/mods/ITEMS/mcl_potions/splash.lua index 186c331a7b..e233dd9212 100644 --- a/mods/ITEMS/mcl_potions/splash.lua +++ b/mods/ITEMS/mcl_potions/splash.lua @@ -179,18 +179,18 @@ register_splash("slowness_plus", "Splash Slowness +", "#000066", { }) register_splash("poison", "Splash Poison", "#335544", { - potion_fun = function(player, redx) mcl_potions.poison_func(player, 2.5, splash_DUR*mcl_potions.INV_FACTOR*redx) end, - tt = "-1/2 heart / 2.5sec | "..time_string(splash_DUR*mcl_potions.INV_FACTOR) + potion_fun = function(player, redx) mcl_potions.poison_func(player, 2.5, splash_DUR*mcl_potions.INV_FACTOR^2*redx) end, + tt = "-1/2 heart / 2.5sec | "..time_string(splash_DUR*mcl_potions.INV_FACTOR^2) }) register_splash("poison_2", "Splash Poison II", "#446655", { - potion_fun = function(player, redx) mcl_potions.poison_func(player, 1.2, splash_DUR_2*mcl_potions.INV_FACTOR*redx) end, - tt = "-1/2 heart / 1.2sec | "..time_string(splash_DUR_2*mcl_potions.INV_FACTOR) + potion_fun = function(player, redx) mcl_potions.poison_func(player, 1.2, splash_DUR_2*mcl_potions.INV_FACTOR^2*redx) end, + tt = "-1/2 heart / 1.2sec | "..time_string(splash_DUR_2*mcl_potions.INV_FACTOR^2) }) register_splash("poison_plus", "Splash Poison +", "#557766", { - potion_fun = function(player, redx) mcl_potions.poison_func(player, 2.5, splash_DUR_pl*mcl_potions.INV_FACTOR*redx) end, - tt = "-1/2 heart / 2.5sec | "..time_string(splash_DUR_pl*mcl_potions.INV_FACTOR) + potion_fun = function(player, redx) mcl_potions.poison_func(player, 2.5, splash_DUR*mcl_potions.INV_FACTOR*redx) end, + tt = "-1/2 heart / 2.5sec | "..time_string(splash_DUR_pl*mcl_potions.INV_FACTOR^2) }) register_splash("regeneration", "Splash Regeneration", "#A52BB2", {