2020-06-17 23:50:18 +02:00
|
|
|
local S = minetest.get_translator("mcl_potions")
|
2020-06-18 22:56:19 +02:00
|
|
|
local brewhelp = S("Try different combinations to create potions.")
|
2020-06-17 23:50:18 +02:00
|
|
|
|
|
|
|
local potion_image = function(colorstring, opacity)
|
|
|
|
if not opacity then
|
|
|
|
opacity = 127
|
|
|
|
end
|
2020-07-04 00:33:24 +02:00
|
|
|
return "mcl_potions_potion_overlay.png^[colorize:"..colorstring..":"..tostring(opacity).."^mcl_potions_potion_bottle.png"
|
2020-06-17 23:50:18 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
local how_to_drink = S("Use the “Place” key to drink it.")
|
|
|
|
|
2020-07-11 19:40:48 +02:00
|
|
|
|
|
|
|
local function register_potion(def)
|
|
|
|
minetest.register_craftitem("mcl_potions:"..def.name, {
|
|
|
|
description = def.description,
|
|
|
|
_tt_help = def._tt,
|
|
|
|
_doc_items_longdesc = def._longdesc,
|
|
|
|
_doc_items_usagehelp = how_to_drink,
|
|
|
|
stack_max = 1,
|
|
|
|
inventory_image = def.image,
|
|
|
|
wield_image = def.image,
|
|
|
|
groups = def.groups or {brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0},
|
|
|
|
on_place = def.on_use,
|
|
|
|
on_secondary_use = def.on_use,
|
|
|
|
})
|
|
|
|
|
|
|
|
if def.is_II then
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local awkward_def = {
|
|
|
|
name = "awkward",
|
2020-06-17 23:50:18 +02:00
|
|
|
description = S("Awkward Potion"),
|
2020-07-11 19:40:48 +02:00
|
|
|
_tt = S("No effect"),
|
|
|
|
_longdesc = S("Has an awkward taste and is used for brewing potions."),
|
|
|
|
image = potion_image("#0000FF"),
|
2020-07-11 01:22:11 +02:00
|
|
|
groups = {brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0},
|
2020-07-11 19:40:48 +02:00
|
|
|
on_use = minetest.item_eat(0, "mcl_potions:glass_bottle"),
|
|
|
|
}
|
2020-06-19 03:04:31 +02:00
|
|
|
|
2020-07-11 19:40:48 +02:00
|
|
|
local mundane_def = {
|
|
|
|
name = "mundane",
|
2020-06-17 23:50:18 +02:00
|
|
|
description = S("Mundane Potion"),
|
2020-07-11 19:40:48 +02:00
|
|
|
_tt = S("No effect"),
|
|
|
|
longdesc = S("Has a clean taste and is used for brewing potions."),
|
|
|
|
image = potion_image("#0000FF"),
|
|
|
|
on_use = minetest.item_eat(0, "mcl_potions:glass_bottle"),
|
|
|
|
}
|
|
|
|
|
|
|
|
local thick_def = {
|
|
|
|
name = "thick",
|
2020-06-17 23:50:18 +02:00
|
|
|
description = S("Thick Potion"),
|
2020-07-11 19:40:48 +02:00
|
|
|
_tt = S("No effect"),
|
|
|
|
_longdesc = S("Has a bitter taste and is used for brewing potions."),
|
|
|
|
image = potion_image("#0000FF"),
|
|
|
|
on_use = minetest.item_eat(0, "mcl_potions:glass_bottle"),
|
|
|
|
}
|
|
|
|
|
|
|
|
local dragon_breath_def = {
|
|
|
|
name = "dragon_breath",
|
2020-06-17 23:50:18 +02:00
|
|
|
description = S("Dragon's Breath"),
|
2020-07-11 19:40:48 +02:00
|
|
|
_tt = S("No effect"),
|
|
|
|
_longdesc = S("Combine with Splash potions to create a Lingering effect"),
|
|
|
|
image = "mcl_potions_dragon_breath.png",
|
2020-06-17 23:50:18 +02:00
|
|
|
groups = { brewitem = 1, not_in_creative_inventory = 0 },
|
2020-07-11 19:40:48 +02:00
|
|
|
on_use = nil,
|
|
|
|
}
|
2020-06-17 23:50:18 +02:00
|
|
|
|
2020-07-11 19:40:48 +02:00
|
|
|
local healing_def = {
|
|
|
|
name = "healing",
|
2020-06-17 23:50:18 +02:00
|
|
|
description = S("Healing Potion"),
|
2020-07-11 19:40:48 +02:00
|
|
|
_tt = S("+4 HP"),
|
|
|
|
_longdesc = S("Drink to heal yourself"),
|
|
|
|
image = potion_image("#CC0000"),
|
|
|
|
on_use = function (itemstack, user, pointed_thing)
|
|
|
|
mcl_potions.healing_func(user, 4)
|
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
|
|
|
mcl_potions._use_potion(itemstack, user, "#CC0000")
|
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
}
|
|
|
|
|
|
|
|
local healing_2_def = table.copy(healing_def)
|
|
|
|
healing_2_def.name = "healing_2"
|
|
|
|
healing_2_def.description = S("Healing Potion II")
|
|
|
|
healing_2_def._tt = S("+8 HP")
|
|
|
|
healing_2_def.on_use = function (itemstack, user, pointed_thing)
|
|
|
|
mcl_potions.healing_func(user, 8)
|
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
|
|
|
mcl_potions._use_potion(itemstack, user, "#CC0000")
|
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
local harming_def = {
|
|
|
|
name = "harming",
|
2020-06-17 23:50:18 +02:00
|
|
|
description = S("Harming Potion"),
|
2020-07-11 19:40:48 +02:00
|
|
|
_tt = S("-3 Hearts"),
|
|
|
|
_longdesc = S("Drink to heal yourself"),
|
|
|
|
image = potion_image("#660099"),
|
|
|
|
on_use = function (itemstack, user, pointed_thing)
|
|
|
|
mcl_potions.healing_func(user, -6)
|
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
|
|
|
mcl_potions._use_potion(itemstack, user, "#660099")
|
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
}
|
|
|
|
|
|
|
|
local harming_2_def = table.copy(healing_def)
|
|
|
|
harming_2_def.name = "harming_2"
|
|
|
|
harming_2_def.description = S("Harming Potion II")
|
|
|
|
harming_2_def._tt = S("-6 Hearts")
|
|
|
|
harming_2_def.on_use = function (itemstack, user, pointed_thing)
|
|
|
|
mcl_potions.healing_func(user, -12)
|
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
|
|
|
mcl_potions._use_potion(itemstack, user, "#660099")
|
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
|
|
|
|
register_potion(awkward_def)
|
|
|
|
register_potion(mundane_def)
|
|
|
|
register_potion(thick_def)
|
|
|
|
register_potion(dragon_breath_def)
|
|
|
|
register_potion(healing_def)
|
|
|
|
register_potion(healing_2_def)
|
|
|
|
register_potion(harming_def)
|
|
|
|
register_potion(harming_2_def)
|
|
|
|
|
|
|
|
|
2020-06-17 23:50:18 +02:00
|
|
|
|
|
|
|
|
|
|
|
minetest.register_craftitem("mcl_potions:night_vision", {
|
|
|
|
description = S("Night Vision Potion"),
|
2020-06-28 18:44:43 +02:00
|
|
|
_tt_help = S("3:00"),
|
2020-06-17 23:50:18 +02:00
|
|
|
_doc_items_longdesc = brewhelp,
|
2020-06-21 03:30:26 +02:00
|
|
|
wield_image = potion_image("#1010AA"),
|
|
|
|
inventory_image = potion_image("#1010AA"),
|
2020-06-26 22:55:22 +02:00
|
|
|
groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
2020-06-17 23:50:18 +02:00
|
|
|
stack_max = 1,
|
2020-06-21 03:17:45 +02:00
|
|
|
|
|
|
|
on_place = function(itemstack, user, pointed_thing)
|
2020-06-27 14:24:32 +02:00
|
|
|
mcl_potions.night_vision_func(user, mcl_potions.DURATION)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-21 03:30:26 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#1010AA")
|
2020-06-21 03:17:45 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_secondary_use = function(itemstack, user, pointed_thing)
|
2020-06-27 14:24:32 +02:00
|
|
|
mcl_potions.night_vision_func(user, mcl_potions.DURATION)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-21 03:30:26 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#1010AA")
|
2020-06-21 03:17:45 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("mcl_potions:night_vision_plus", {
|
|
|
|
description = S("Night Vision Potion +"),
|
2020-06-28 18:44:43 +02:00
|
|
|
_tt_help = S("8:00"),
|
2020-06-21 03:17:45 +02:00
|
|
|
_doc_items_longdesc = brewhelp,
|
2020-06-21 03:30:26 +02:00
|
|
|
wield_image = potion_image("#2020BA"),
|
|
|
|
inventory_image = potion_image("#2020BA"),
|
2020-06-26 22:55:22 +02:00
|
|
|
groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
2020-06-21 03:17:45 +02:00
|
|
|
stack_max = 1,
|
|
|
|
|
|
|
|
on_place = function(itemstack, user, pointed_thing)
|
2020-06-27 14:24:32 +02:00
|
|
|
mcl_potions.night_vision_func(user, mcl_potions.DURATION_PLUS)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-21 03:30:26 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#2020BA")
|
2020-06-21 03:17:45 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_secondary_use = function(itemstack, user, pointed_thing)
|
2020-06-27 14:24:32 +02:00
|
|
|
mcl_potions.night_vision_func(user, mcl_potions.DURATION_PLUS)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-21 03:30:26 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#2020BA")
|
2020-06-21 03:17:45 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
2020-06-17 23:50:18 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
minetest.register_craftitem("mcl_potions:swiftness", {
|
|
|
|
description = S("Swiftness Potion"),
|
2020-06-28 18:44:43 +02:00
|
|
|
_tt_help = S("+20% | 3:00"),
|
2020-06-17 23:50:18 +02:00
|
|
|
_doc_items_longdesc = brewhelp,
|
|
|
|
wield_image = potion_image("#009999"),
|
|
|
|
inventory_image = potion_image("#009999"),
|
2020-06-26 22:55:22 +02:00
|
|
|
groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
2020-06-17 23:50:18 +02:00
|
|
|
stack_max = 1,
|
|
|
|
|
|
|
|
on_place = function(itemstack, user, pointed_thing)
|
2020-06-27 14:24:32 +02:00
|
|
|
mcl_potions.swiftness_func(user, 1.2, mcl_potions.DURATION)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#009999")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_secondary_use = function(itemstack, user, pointed_thing)
|
2020-06-27 14:24:32 +02:00
|
|
|
mcl_potions.swiftness_func(user, 1.2, mcl_potions.DURATION)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#009999")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("mcl_potions:swiftness_2", {
|
|
|
|
description = S("Swiftness Potion II"),
|
2020-06-28 18:44:43 +02:00
|
|
|
_tt_help = S("+40% | 1:30"),
|
2020-06-17 23:50:18 +02:00
|
|
|
_doc_items_longdesc = brewhelp,
|
|
|
|
wield_image = potion_image("#00BBBB"),
|
|
|
|
inventory_image = potion_image("#00BBBB"),
|
2020-06-26 22:55:22 +02:00
|
|
|
groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
2020-06-17 23:50:18 +02:00
|
|
|
stack_max = 1,
|
|
|
|
|
|
|
|
on_place = function(itemstack, user, pointed_thing)
|
2020-06-27 14:24:32 +02:00
|
|
|
mcl_potions.swiftness_func(user, 1.4, mcl_potions.DURATION_2)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#00BBBB")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_secondary_use = function(itemstack, user, pointed_thing)
|
2020-06-27 14:24:32 +02:00
|
|
|
mcl_potions.swiftness_func(user, 1.4, mcl_potions.DURATION_2)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#00BBBB")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("mcl_potions:swiftness_plus", {
|
|
|
|
description = S("Swiftness Potion +"),
|
2020-06-28 18:44:43 +02:00
|
|
|
_tt_help = S("+20% | 8:00"),
|
2020-06-17 23:50:18 +02:00
|
|
|
_doc_items_longdesc = brewhelp,
|
|
|
|
wield_image = potion_image("#00AAAA"),
|
|
|
|
inventory_image = potion_image("#00AAAA"),
|
2020-06-26 22:55:22 +02:00
|
|
|
groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
2020-06-17 23:50:18 +02:00
|
|
|
stack_max = 1,
|
|
|
|
|
|
|
|
on_place = function(itemstack, user, pointed_thing)
|
2020-06-27 14:24:32 +02:00
|
|
|
mcl_potions.swiftness_func(user, 1.2, mcl_potions.DURATION_PLUS)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#00AAAA")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_secondary_use = function(itemstack, user, pointed_thing)
|
2020-06-27 14:24:32 +02:00
|
|
|
mcl_potions.swiftness_func(user, 1.2, mcl_potions.DURATION_PLUS)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#00AAAA")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("mcl_potions:slowness", {
|
|
|
|
description = S("Slowness Potion"),
|
2020-06-28 18:44:43 +02:00
|
|
|
_tt_help = S("-15% | 1:30"),
|
2020-06-17 23:50:18 +02:00
|
|
|
_doc_items_longdesc = brewhelp,
|
|
|
|
wield_image = potion_image("#000080"),
|
|
|
|
inventory_image = potion_image("#000080"),
|
2020-06-26 22:55:22 +02:00
|
|
|
groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
2020-06-17 23:50:18 +02:00
|
|
|
stack_max = 1,
|
|
|
|
|
|
|
|
on_place = function(itemstack, user, pointed_thing)
|
2020-06-28 18:44:43 +02:00
|
|
|
mcl_potions.swiftness_func(user, 0.85, mcl_potions.DURATION*mcl_potions.INV_FACTOR)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#000080")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_secondary_use = function(itemstack, user, pointed_thing)
|
2020-06-28 18:44:43 +02:00
|
|
|
mcl_potions.swiftness_func(user, 0.85, mcl_potions.DURATION*mcl_potions.INV_FACTOR)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#000080")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("mcl_potions:slowness_plus", {
|
|
|
|
description = S("Slowness Potion +"),
|
2020-06-28 18:44:43 +02:00
|
|
|
_tt_help = S("-15% | 4:00"),
|
2020-06-17 23:50:18 +02:00
|
|
|
_doc_items_longdesc = brewhelp,
|
|
|
|
wield_image = potion_image("#000066"),
|
|
|
|
inventory_image = potion_image("#000066"),
|
2020-06-26 22:55:22 +02:00
|
|
|
groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
2020-06-17 23:50:18 +02:00
|
|
|
stack_max = 1,
|
|
|
|
|
|
|
|
on_place = function(itemstack, user, pointed_thing)
|
2020-06-27 14:24:32 +02:00
|
|
|
mcl_potions.swiftness_func(user, 0.85, mcl_potions.DURATION_2*mcl_potions.INV_FACTOR)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#000066")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_secondary_use = function(itemstack, user, pointed_thing)
|
2020-06-27 14:24:32 +02:00
|
|
|
mcl_potions.swiftness_func(user, 0.85, mcl_potions.DURATION_2*mcl_potions.INV_FACTOR)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#000066")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
2020-06-27 13:57:51 +02:00
|
|
|
minetest.register_craftitem("mcl_potions:slowness_2", {
|
|
|
|
description = S("Slowness Potion IV"),
|
2020-06-28 18:44:43 +02:00
|
|
|
_tt_help = S("-60% | 0:20"),
|
2020-06-27 13:57:51 +02:00
|
|
|
_doc_items_longdesc = brewhelp,
|
|
|
|
wield_image = potion_image("#000090"),
|
|
|
|
inventory_image = potion_image("#000090"),
|
|
|
|
groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
|
|
|
stack_max = 1,
|
|
|
|
|
|
|
|
on_place = function(itemstack, user, pointed_thing)
|
|
|
|
mcl_potions.swiftness_func(user, 0.40, 20)
|
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
|
|
|
mcl_potions._use_potion(itemstack, user, "#000090")
|
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_secondary_use = function(itemstack, user, pointed_thing)
|
|
|
|
mcl_potions.swiftness_func(user, 0.40, 20)
|
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
|
|
|
mcl_potions._use_potion(itemstack, user, "#000090")
|
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
2020-06-17 23:50:18 +02:00
|
|
|
|
|
|
|
minetest.register_craftitem("mcl_potions:leaping", {
|
|
|
|
description = S("Leaping Potion"),
|
2020-06-28 18:44:43 +02:00
|
|
|
_tt_help = S("+50% | 3:00"),
|
2020-06-17 23:50:18 +02:00
|
|
|
_doc_items_longdesc = brewhelp,
|
|
|
|
wield_image = potion_image("#00CC33"),
|
|
|
|
inventory_image = potion_image("#00CC33"),
|
2020-06-26 22:55:22 +02:00
|
|
|
groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
2020-06-17 23:50:18 +02:00
|
|
|
stack_max = 1,
|
|
|
|
|
|
|
|
on_place = function(itemstack, user, pointed_thing)
|
2020-06-28 18:44:43 +02:00
|
|
|
mcl_potions.leaping_func(user, 1.5, mcl_potions.DURATION)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#00CC33")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_secondary_use = function(itemstack, user, pointed_thing)
|
2020-06-28 18:44:43 +02:00
|
|
|
mcl_potions.leaping_func(user, 1.5, mcl_potions.DURATION)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#00CC33")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("mcl_potions:leaping_2", {
|
|
|
|
description = S("Leaping Potion II"),
|
2020-06-28 18:44:43 +02:00
|
|
|
_tt_help = S("+125% | 1:30"),
|
2020-06-17 23:50:18 +02:00
|
|
|
_doc_items_longdesc = brewhelp,
|
|
|
|
wield_image = potion_image("#00EE33"),
|
|
|
|
inventory_image = potion_image("#00EE33"),
|
2020-06-26 22:55:22 +02:00
|
|
|
groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
2020-06-17 23:50:18 +02:00
|
|
|
stack_max = 1,
|
|
|
|
|
|
|
|
on_place = function(itemstack, user, pointed_thing)
|
2020-06-28 18:44:43 +02:00
|
|
|
mcl_potions.leaping_func(user, 2.25, mcl_potions.DURATION_2)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#00EE33")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_secondary_use = function(itemstack, user, pointed_thing)
|
2020-06-28 18:44:43 +02:00
|
|
|
mcl_potions.leaping_func(user, 2.25, mcl_potions.DURATION_2)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#00EE33")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("mcl_potions:leaping_plus", {
|
|
|
|
description = S("Leaping Potion +"),
|
2020-06-28 18:44:43 +02:00
|
|
|
_tt_help = S("+50% | 8:00"),
|
2020-06-17 23:50:18 +02:00
|
|
|
_doc_items_longdesc = brewhelp,
|
|
|
|
wield_image = potion_image("#00DD33"),
|
|
|
|
inventory_image = potion_image("#00DD33"),
|
2020-06-26 22:55:22 +02:00
|
|
|
groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
2020-06-17 23:50:18 +02:00
|
|
|
stack_max = 1,
|
|
|
|
|
|
|
|
on_place = function(itemstack, user, pointed_thing)
|
2020-06-28 18:44:43 +02:00
|
|
|
mcl_potions.leaping_func(user, 1.5, mcl_potions.DURATION_PLUS)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#00DD33")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_secondary_use = function(itemstack, user, pointed_thing)
|
2020-06-28 18:44:43 +02:00
|
|
|
mcl_potions.leaping_func(user, 1.5, mcl_potions.DURATION_PLUS)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#00DD33")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
|
2020-07-11 01:25:34 +02:00
|
|
|
-- minetest.register_craftitem("mcl_potions:weakness", {
|
|
|
|
-- description = S("Weakness Potion"),
|
|
|
|
-- _tt_help = S("-4 HP damage | 1:30"),
|
|
|
|
-- _doc_items_longdesc = brewhelp,
|
|
|
|
-- wield_image = potion_image("#6600AA"),
|
|
|
|
-- inventory_image = potion_image("#6600AA"),
|
|
|
|
-- groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
|
|
|
-- stack_max = 1,
|
|
|
|
--
|
|
|
|
-- on_place = function(itemstack, user, pointed_thing)
|
|
|
|
-- mcl_potions.weakness_func(user, -4, mcl_potions.DURATION*mcl_potions.INV_FACTOR)
|
|
|
|
-- minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
|
|
|
-- mcl_potions._use_potion(itemstack, user, "#6600AA")
|
|
|
|
-- return itemstack
|
|
|
|
-- end,
|
|
|
|
--
|
|
|
|
-- on_secondary_use = function(itemstack, user, pointed_thing)
|
|
|
|
-- mcl_potions.weakness_func(user, -4, mcl_potions.DURATION*mcl_potions.INV_FACTOR)
|
|
|
|
-- minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
|
|
|
-- mcl_potions._use_potion(itemstack, user, "#6600AA")
|
|
|
|
-- return itemstack
|
|
|
|
-- end
|
|
|
|
-- })
|
|
|
|
--
|
|
|
|
-- minetest.register_craftitem("mcl_potions:weakness_plus", {
|
|
|
|
-- description = S("Weakness Potion +"),
|
|
|
|
-- _tt_help = S("-4 HP damage | 4:00"),
|
|
|
|
-- _doc_items_longdesc = brewhelp,
|
|
|
|
-- wield_image = potion_image("#7700BB"),
|
|
|
|
-- inventory_image = potion_image("#7700BB"),
|
|
|
|
-- groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
|
|
|
-- stack_max = 1,
|
|
|
|
--
|
|
|
|
-- on_place = function(itemstack, user, pointed_thing)
|
|
|
|
-- mcl_potions.weakness_func(user, -4, mcl_potions.DURATION_2*mcl_potions.INV_FACTOR)
|
|
|
|
-- minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
|
|
|
-- mcl_potions._use_potion(itemstack, user, "#7700BB")
|
|
|
|
-- return itemstack
|
|
|
|
-- end,
|
|
|
|
--
|
|
|
|
-- on_secondary_use = function(itemstack, user, pointed_thing)
|
|
|
|
-- mcl_potions.weakness_func(user, -4, mcl_potions.DURATION_2*mcl_potions.INV_FACTOR)
|
|
|
|
-- minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
|
|
|
-- mcl_potions._use_potion(itemstack, user, "#7700BB")
|
|
|
|
-- return itemstack
|
|
|
|
-- end
|
|
|
|
-- })
|
|
|
|
--
|
|
|
|
-- minetest.register_craftitem("mcl_potions:strength", {
|
|
|
|
-- description = S("Strength Potion"),
|
|
|
|
-- _tt_help = S("+3 HP damage | 3:00"),
|
|
|
|
-- _doc_items_longdesc = brewhelp,
|
|
|
|
-- wield_image = potion_image("#D444D4"),
|
|
|
|
-- inventory_image = potion_image("#D444D4"),
|
|
|
|
-- groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
|
|
|
-- stack_max = 1,
|
|
|
|
--
|
|
|
|
-- on_place = function(itemstack, user, pointed_thing)
|
|
|
|
-- mcl_potions.weakness_func(user, 3, mcl_potions.DURATION)
|
|
|
|
-- minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
|
|
|
-- mcl_potions._use_potion(itemstack, user, "#D444D4")
|
|
|
|
-- return itemstack
|
|
|
|
-- end,
|
|
|
|
--
|
|
|
|
-- on_secondary_use = function(itemstack, user, pointed_thing)
|
|
|
|
-- mcl_potions.weakness_func(user, 3, mcl_potions.DURATION)
|
|
|
|
-- minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
|
|
|
-- mcl_potions._use_potion(itemstack, user, "#D444D4")
|
|
|
|
-- return itemstack
|
|
|
|
-- end
|
|
|
|
-- })
|
|
|
|
--
|
|
|
|
-- minetest.register_craftitem("mcl_potions:strength_2", {
|
|
|
|
-- description = S("Strength Potion II"),
|
|
|
|
-- _tt_help = S("+6 HP damage | 1:30"),
|
|
|
|
-- _doc_items_longdesc = brewhelp,
|
|
|
|
-- wield_image = potion_image("#D444E4"),
|
|
|
|
-- inventory_image = potion_image("#D444E4"),
|
|
|
|
-- groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
|
|
|
-- stack_max = 1,
|
|
|
|
--
|
|
|
|
-- on_place = function(itemstack, user, pointed_thing)
|
|
|
|
-- mcl_potions.weakness_func(user, 6, mcl_potions.DURATION_2)
|
|
|
|
-- minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
|
|
|
-- mcl_potions._use_potion(itemstack, user, "#D444E4")
|
|
|
|
-- return itemstack
|
|
|
|
-- end,
|
|
|
|
--
|
|
|
|
-- on_secondary_use = function(itemstack, user, pointed_thing)
|
|
|
|
-- mcl_potions.weakness_func(user, 6, mcl_potions.DURATION_2)
|
|
|
|
-- minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
|
|
|
-- mcl_potions._use_potion(itemstack, user, "#D444E4")
|
|
|
|
-- return itemstack
|
|
|
|
-- end
|
|
|
|
-- })
|
|
|
|
--
|
|
|
|
-- minetest.register_craftitem("mcl_potions:strength_plus", {
|
|
|
|
-- description = S("Strength Potion +"),
|
|
|
|
-- _tt_help = S("+3 HP damage | 8:00"),
|
|
|
|
-- _doc_items_longdesc = brewhelp,
|
|
|
|
-- wield_image = potion_image("#D444F4"),
|
|
|
|
-- inventory_image = potion_image("#D444F4"),
|
|
|
|
-- groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
|
|
|
-- stack_max = 1,
|
|
|
|
--
|
|
|
|
-- on_place = function(itemstack, user, pointed_thing)
|
|
|
|
-- mcl_potions.weakness_func(user, 3, mcl_potions.DURATION_PLUS)
|
|
|
|
-- minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
|
|
|
-- mcl_potions._use_potion(itemstack, user, "#D444F4")
|
|
|
|
-- return itemstack
|
|
|
|
-- end,
|
|
|
|
--
|
|
|
|
-- on_secondary_use = function(itemstack, user, pointed_thing)
|
|
|
|
-- mcl_potions.weakness_func(user, 3, mcl_potions.DURATION_PLUS)
|
|
|
|
-- minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
|
|
|
-- mcl_potions._use_potion(itemstack, user, "#D444F4")
|
|
|
|
-- return itemstack
|
|
|
|
-- end
|
|
|
|
-- })
|
2020-06-29 02:31:08 +02:00
|
|
|
|
|
|
|
|
2020-06-17 23:50:18 +02:00
|
|
|
minetest.register_craftitem("mcl_potions:poison", {
|
|
|
|
description = S("Poison Potion"),
|
2020-07-10 12:50:08 +02:00
|
|
|
_tt_help = S("-1 HP / 2.5s | 0:45"),
|
2020-06-17 23:50:18 +02:00
|
|
|
_doc_items_longdesc = brewhelp,
|
|
|
|
wield_image = potion_image("#225533"),
|
|
|
|
inventory_image = potion_image("#225533"),
|
2020-06-26 22:55:22 +02:00
|
|
|
groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
2020-06-17 23:50:18 +02:00
|
|
|
stack_max = 1,
|
|
|
|
|
|
|
|
on_place = function(itemstack, user, pointed_thing)
|
2020-07-07 02:52:24 +02:00
|
|
|
mcl_potions.poison_func(user, 2.5, mcl_potions.DURATION*mcl_potions.INV_FACTOR^2)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#225533")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_secondary_use = function(itemstack, user, pointed_thing)
|
2020-07-07 02:52:24 +02:00
|
|
|
mcl_potions.poison_func(user, 2.5, mcl_potions.DURATION*mcl_potions.INV_FACTOR^2)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#225533")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("mcl_potions:poison_2", {
|
|
|
|
description = S("Poison Potion II"),
|
2020-07-10 12:50:08 +02:00
|
|
|
_tt_help = S("-1 HP / 1.2s | 0:21"),
|
2020-06-17 23:50:18 +02:00
|
|
|
_doc_items_longdesc = brewhelp,
|
|
|
|
wield_image = potion_image("#447755"),
|
|
|
|
inventory_image = potion_image("#447755"),
|
2020-06-26 22:55:22 +02:00
|
|
|
groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
2020-06-17 23:50:18 +02:00
|
|
|
stack_max = 1,
|
|
|
|
|
|
|
|
on_place = function(itemstack, user, pointed_thing)
|
2020-07-07 02:52:24 +02:00
|
|
|
mcl_potions.poison_func(user, 1.2, mcl_potions.DURATION_2*mcl_potions.INV_FACTOR^2)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#447755")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_secondary_use = function(itemstack, user, pointed_thing)
|
2020-07-07 02:52:24 +02:00
|
|
|
mcl_potions.poison_func(user, 1.2, mcl_potions.DURATION_2*mcl_potions.INV_FACTOR^2)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#447755")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("mcl_potions:poison_plus", {
|
|
|
|
description = S("Poison Potion +"),
|
2020-07-10 12:50:08 +02:00
|
|
|
_tt_help = S("-1 HP / 2.5s | 1:30"),
|
2020-06-17 23:50:18 +02:00
|
|
|
_doc_items_longdesc = brewhelp,
|
|
|
|
wield_image = potion_image("#336644"),
|
|
|
|
inventory_image = potion_image("#336644"),
|
2020-06-26 22:55:22 +02:00
|
|
|
groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
2020-06-17 23:50:18 +02:00
|
|
|
stack_max = 1,
|
|
|
|
|
|
|
|
on_place = function(itemstack, user, pointed_thing)
|
2020-06-28 18:44:43 +02:00
|
|
|
mcl_potions.poison_func(user, 2.5, mcl_potions.DURATION*mcl_potions.INV_FACTOR)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#336644")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_secondary_use = function(itemstack, user, pointed_thing)
|
2020-06-28 18:44:43 +02:00
|
|
|
mcl_potions.poison_func(user, 2.5, mcl_potions.DURATION*mcl_potions.INV_FACTOR)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#336644")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
minetest.register_craftitem("mcl_potions:regeneration", {
|
|
|
|
description = S("Regeneration Potion"),
|
2020-07-10 12:50:08 +02:00
|
|
|
_tt_help = S("+1 HP / 2.5s | 0:45"),
|
2020-06-17 23:50:18 +02:00
|
|
|
_doc_items_longdesc = brewhelp,
|
|
|
|
wield_image = potion_image("#A52BB2"),
|
|
|
|
inventory_image = potion_image("#A52BB2"),
|
2020-06-26 22:55:22 +02:00
|
|
|
groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
2020-06-17 23:50:18 +02:00
|
|
|
stack_max = 1,
|
|
|
|
|
|
|
|
on_place = function(itemstack, user, pointed_thing)
|
2020-06-28 18:44:43 +02:00
|
|
|
mcl_potions.regeneration_func(user, 2.5, mcl_potions.DURATION*mcl_potions.INV_FACTOR^2)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#A52BB2")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_secondary_use = function(itemstack, user, pointed_thing)
|
2020-06-28 18:44:43 +02:00
|
|
|
mcl_potions.regeneration_func(user, 2.5, mcl_potions.DURATION*mcl_potions.INV_FACTOR^2)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#A52BB2")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("mcl_potions:regeneration_2", {
|
|
|
|
description = S("Regeneration Potion II"),
|
2020-07-10 12:50:08 +02:00
|
|
|
_tt_help = S("+1 HP / 1.2s | 0:22"),
|
2020-06-17 23:50:18 +02:00
|
|
|
_doc_items_longdesc = brewhelp,
|
|
|
|
wield_image = potion_image("#B52CC2"),
|
|
|
|
inventory_image = potion_image("#B52CC2"),
|
2020-06-26 22:55:22 +02:00
|
|
|
groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
2020-06-17 23:50:18 +02:00
|
|
|
stack_max = 1,
|
|
|
|
|
|
|
|
on_place = function(itemstack, user, pointed_thing)
|
2020-06-28 18:44:43 +02:00
|
|
|
mcl_potions.regeneration_func(user, 1.2, mcl_potions.DURATION*mcl_potions.INV_FACTOR^3 + 1)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#B52CC2")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_secondary_use = function(itemstack, user, pointed_thing)
|
2020-06-28 18:44:43 +02:00
|
|
|
mcl_potions.regeneration_func(user, 1.2, mcl_potions.DURATION*mcl_potions.INV_FACTOR^3 + 1)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#B52CC2")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("mcl_potions:regeneration_plus", {
|
|
|
|
description = S("Regeneration Potion +"),
|
2020-07-10 12:50:08 +02:00
|
|
|
_tt_help = S("+1 HP / 2.5s | 1:30"),
|
2020-06-17 23:50:18 +02:00
|
|
|
_doc_items_longdesc = brewhelp,
|
|
|
|
wield_image = potion_image("#C53DD3"),
|
|
|
|
inventory_image = potion_image("#C53DD3"),
|
2020-06-26 22:55:22 +02:00
|
|
|
groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
2020-06-17 23:50:18 +02:00
|
|
|
stack_max = 1,
|
|
|
|
|
|
|
|
on_place = function(itemstack, user, pointed_thing)
|
2020-06-28 18:44:43 +02:00
|
|
|
mcl_potions.regeneration_func(user, 2.5, mcl_potions.DURATION*mcl_potions.INV_FACTOR)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#C53DD3")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_secondary_use = function(itemstack, user, pointed_thing)
|
2020-06-28 18:44:43 +02:00
|
|
|
mcl_potions.regeneration_func(user, 2.5, mcl_potions.DURATION*mcl_potions.INV_FACTOR)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#C53DD3")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
minetest.register_craftitem("mcl_potions:invisibility", {
|
|
|
|
description = S("Invisibility Potion"),
|
2020-06-28 18:44:43 +02:00
|
|
|
_tt_help = S("3:00"),
|
2020-06-17 23:50:18 +02:00
|
|
|
_doc_items_longdesc = brewhelp,
|
|
|
|
wield_image = potion_image("#B0B0B0"),
|
|
|
|
inventory_image = potion_image("#B0B0B0"),
|
2020-06-26 22:55:22 +02:00
|
|
|
groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
2020-06-17 23:50:18 +02:00
|
|
|
stack_max = 1,
|
|
|
|
|
|
|
|
on_place = function(itemstack, user, pointed_thing)
|
2020-06-27 14:24:32 +02:00
|
|
|
mcl_potions.invisiblility_func(user, mcl_potions.DURATION)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#B0B0B0")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_secondary_use = function(itemstack, user, pointed_thing)
|
2020-06-27 14:24:32 +02:00
|
|
|
mcl_potions.invisiblility_func(user, mcl_potions.DURATION)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#B0B0B0")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("mcl_potions:invisibility_plus", {
|
|
|
|
description = S("Invisibility Potion +"),
|
2020-06-28 18:44:43 +02:00
|
|
|
_tt_help = S("8:00"),
|
2020-06-17 23:50:18 +02:00
|
|
|
_doc_items_longdesc = brewhelp,
|
|
|
|
wield_image = potion_image("#A0A0A0"),
|
|
|
|
inventory_image = potion_image("#A0A0A0"),
|
2020-06-26 22:55:22 +02:00
|
|
|
groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
2020-06-17 23:50:18 +02:00
|
|
|
stack_max = 1,
|
|
|
|
|
|
|
|
on_place = function(itemstack, user, pointed_thing)
|
2020-06-27 14:24:32 +02:00
|
|
|
mcl_potions.invisiblility_func(user, mcl_potions.DURATION_PLUS)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#A0A0A0")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_secondary_use = function(itemstack, user, pointed_thing)
|
2020-06-27 14:24:32 +02:00
|
|
|
mcl_potions.invisiblility_func(user, mcl_potions.DURATION_PLUS)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#A0A0A0")
|
2020-06-17 23:50:18 +02:00
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
-- Look into reducing attack on punch
|
|
|
|
minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing)
|
|
|
|
if puncher:get_attribute("weakness") then
|
|
|
|
print("Weakness Active")
|
|
|
|
end
|
|
|
|
end)
|
2020-06-18 23:59:36 +02:00
|
|
|
|
|
|
|
|
|
|
|
minetest.register_craftitem("mcl_potions:water_breathing", {
|
|
|
|
description = S("Water Breathing Potion"),
|
2020-06-28 18:44:43 +02:00
|
|
|
_tt_help = S("3:00"),
|
2020-06-18 23:59:36 +02:00
|
|
|
_doc_items_longdesc = brewhelp,
|
|
|
|
wield_image = potion_image("#0000AA"),
|
|
|
|
inventory_image = potion_image("#0000AA"),
|
2020-06-26 22:55:22 +02:00
|
|
|
groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
2020-06-18 23:59:36 +02:00
|
|
|
stack_max = 1,
|
|
|
|
|
|
|
|
on_place = function(itemstack, user, pointed_thing)
|
2020-06-27 14:24:32 +02:00
|
|
|
mcl_potions.water_breathing_func(user, mcl_potions.DURATION)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#0000AA")
|
2020-06-18 23:59:36 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_secondary_use = function(itemstack, user, pointed_thing)
|
2020-06-27 14:24:32 +02:00
|
|
|
mcl_potions.water_breathing_func(user, mcl_potions.DURATION)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#0000AA")
|
2020-06-18 23:59:36 +02:00
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("mcl_potions:water_breathing_plus", {
|
|
|
|
description = S("Water Breathing Potion +"),
|
2020-06-28 18:44:43 +02:00
|
|
|
_tt_help = S("8:00"),
|
2020-06-18 23:59:36 +02:00
|
|
|
_doc_items_longdesc = brewhelp,
|
|
|
|
wield_image = potion_image("#0000CC"),
|
|
|
|
inventory_image = potion_image("#0000CC"),
|
2020-06-26 22:55:22 +02:00
|
|
|
groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
2020-06-18 23:59:36 +02:00
|
|
|
stack_max = 1,
|
|
|
|
|
|
|
|
on_place = function(itemstack, user, pointed_thing)
|
2020-06-27 14:24:32 +02:00
|
|
|
mcl_potions.water_breathing_func(user, mcl_potions.DURATION_PLUS)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#0000CC")
|
2020-06-18 23:59:36 +02:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_secondary_use = function(itemstack, user, pointed_thing)
|
2020-06-27 14:24:32 +02:00
|
|
|
mcl_potions.water_breathing_func(user, mcl_potions.DURATION_PLUS)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-20 15:00:53 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#0000CC")
|
2020-06-18 23:59:36 +02:00
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
})
|
2020-06-21 03:00:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
minetest.register_craftitem("mcl_potions:fire_resistance", {
|
|
|
|
description = S("Fire Resistance Potion"),
|
2020-06-28 18:44:43 +02:00
|
|
|
_tt_help = S("3:00"),
|
2020-06-21 03:00:57 +02:00
|
|
|
_doc_items_longdesc = brewhelp,
|
|
|
|
wield_image = potion_image("#D0A040"),
|
|
|
|
inventory_image = potion_image("#D0A040"),
|
2020-06-26 22:55:22 +02:00
|
|
|
groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
2020-06-21 03:00:57 +02:00
|
|
|
stack_max = 1,
|
|
|
|
|
|
|
|
on_place = function(itemstack, user, pointed_thing)
|
2020-06-27 14:24:32 +02:00
|
|
|
mcl_potions.fire_resistance_func(user, mcl_potions.DURATION)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-21 03:00:57 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#D0A040")
|
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_secondary_use = function(itemstack, user, pointed_thing)
|
2020-06-27 14:24:32 +02:00
|
|
|
mcl_potions.fire_resistance_func(user, mcl_potions.DURATION)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-21 03:00:57 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#D0A040")
|
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("mcl_potions:fire_resistance_plus", {
|
|
|
|
description = S("Fire Resistance Potion +"),
|
2020-06-28 18:44:43 +02:00
|
|
|
_tt_help = S("8:00"),
|
2020-06-21 03:00:57 +02:00
|
|
|
_doc_items_longdesc = brewhelp,
|
|
|
|
wield_image = potion_image("#E0B050"),
|
|
|
|
inventory_image = potion_image("#E0B050"),
|
2020-06-26 22:55:22 +02:00
|
|
|
groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
|
2020-06-21 03:00:57 +02:00
|
|
|
stack_max = 1,
|
|
|
|
|
|
|
|
on_place = function(itemstack, user, pointed_thing)
|
2020-06-27 14:24:32 +02:00
|
|
|
mcl_potions.fire_resistance_func(user, mcl_potions.DURATION_PLUS)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-21 03:00:57 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#E0B050")
|
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_secondary_use = function(itemstack, user, pointed_thing)
|
2020-06-27 14:24:32 +02:00
|
|
|
mcl_potions.fire_resistance_func(user, mcl_potions.DURATION_PLUS)
|
2020-06-26 22:55:22 +02:00
|
|
|
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
|
2020-06-21 03:00:57 +02:00
|
|
|
mcl_potions._use_potion(itemstack, user, "#E0B050")
|
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
})
|