0
0
Fork 0

Correct for splash invisibility. Add weakness + and splash potions.

This commit is contained in:
Brandon 2020-06-17 22:17:16 -04:00
parent 2c6f62354b
commit 56a8940510
3 changed files with 41 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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
})