From 56a89405107fd3cd9c913a3284f8c9974aa51f62 Mon Sep 17 00:00:00 2001 From: Brandon Date: Wed, 17 Jun 2020 22:17:16 -0400 Subject: [PATCH] Correct for splash invisibility. Add weakness + and splash potions. --- mods/ITEMS/mcl_potions/init.lua | 11 ++++++++--- mods/ITEMS/mcl_potions/potions.lua | 25 +++++++++++++++++++++++-- mods/ITEMS/mcl_potions/splash.lua | 12 ++++++++++-- 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/mods/ITEMS/mcl_potions/init.lua b/mods/ITEMS/mcl_potions/init.lua index 360d5c2582..beb2121452 100644 --- a/mods/ITEMS/mcl_potions/init.lua +++ b/mods/ITEMS/mcl_potions/init.lua @@ -315,17 +315,22 @@ local output_table = { local enhancement_table = {} local extension_table = {} local potions = {"awkward", "mundane", "thick"} -for i, potion in ipairs({"healing","harming","swiftness","leaping","poison","regeneration","invisibility"}) do - if potion ~= "invisibility" and potion ~= "night_vision" then +for i, potion in ipairs({"healing","harming","swiftness","leaping","poison","regeneration","invisibility","weakness"}) do + + table.insert(potions, potion) + + if potion ~= "invisibility" and potion ~= "night_vision" and potion ~= "weakness" then enhancement_table["mcl_potions:"..potion] = "mcl_potions:"..potion.."_2" enhancement_table["mcl_potions:"..potion.."_splash"] = "mcl_potions:"..potion.."_2_splash" - table.insert(potions, potion) table.insert(potions, potion.."_2") end + if potion ~= "healing" and potion ~= "harming" then extension_table["mcl_potions:"..potion.."_splash"] = "mcl_potions:"..potion.."_plus_splash" + extension_table["mcl_potions:"..potion] = "mcl_potions:"..potion.."_plus" table.insert(potions, potion.."_plus") end + end diff --git a/mods/ITEMS/mcl_potions/potions.lua b/mods/ITEMS/mcl_potions/potions.lua index 454867b30a..32ddb37807 100644 --- a/mods/ITEMS/mcl_potions/potions.lua +++ b/mods/ITEMS/mcl_potions/potions.lua @@ -337,13 +337,34 @@ minetest.register_craftitem("mcl_potions:weakness", { stack_max = 1, on_place = function(itemstack, user, pointed_thing) - mcl_potions.weakness_func(user, 1.2, 180) + mcl_potions.weakness_func(user, 1.2, 90) mcl_potions._use_potion(itemstack) return itemstack end, on_secondary_use = function(itemstack, user, pointed_thing) - mcl_potions.weakness_func(user, 1.2, 180) + mcl_potions.weakness_func(user, 1.2, 90) + mcl_potions._use_potion(itemstack) + return itemstack + end +}) + +minetest.register_craftitem("mcl_potions:weakness_plus", { + description = S("Weakness Potion +"), + _doc_items_longdesc = brewhelp, + wield_image = potion_image("#7700BB"), + inventory_image = potion_image("#7700BB"), + groups = { brewitem = 1, food=0}, + stack_max = 1, + + on_place = function(itemstack, user, pointed_thing) + mcl_potions.weakness_func(user, 1.4, 240) + mcl_potions._use_potion(itemstack) + return itemstack + end, + + on_secondary_use = function(itemstack, user, pointed_thing) + mcl_potions.weakness_func(user, 1.4, 240) mcl_potions._use_potion(itemstack) return itemstack end diff --git a/mods/ITEMS/mcl_potions/splash.lua b/mods/ITEMS/mcl_potions/splash.lua index 8074ca7a8e..8cc6209955 100644 --- a/mods/ITEMS/mcl_potions/splash.lua +++ b/mods/ITEMS/mcl_potions/splash.lua @@ -142,7 +142,7 @@ register_splash("poison_2", "Splash Poison II", "#446655", { potion_fun = function(player, redx) mcl_potions.poison_func(player, 0.85, 180*redx) end }) -register_splash("poison_plus", "Splash Poison II", "#557766", { +register_splash("poison_plus", "Splash Poison +", "#557766", { potion_fun = function(player, redx) mcl_potions.poison_func(player, 0.85, 180*redx) end }) @@ -162,6 +162,14 @@ register_splash("invisibility", "Splash Invisibility", "#B0B0B0", { potion_fun = function(player, redx) mcl_potions.invisiblility_func(player, 135*redx) end }) -register_splash("invisibility", "Splash Invisibility", "#A0A0A0", { +register_splash("invisibility_plus", "Splash Invisibility +", "#A0A0A0", { potion_fun = function(player, redx) mcl_potions.invisiblility_func(player, 300*redx) end }) + +register_splash("weakness", "Splash Weakness", "#6600AA", { + potion_fun = function(player, redx) mcl_potions.weakness_func(player, 1.2, 68*redx) end +}) + +register_splash("weakness_plus", "Splash Weakness +", "#7700BB", { + potion_fun = function(player, redx) mcl_potions.weakness_func(player, 1.4, 180*redx) end +})