1
0
Fork 0

work on chaning how potions are created

This commit is contained in:
Brandon 2020-07-11 13:40:48 -04:00
parent 64046d2c5f
commit 5981c0756b
1 changed files with 102 additions and 127 deletions

View File

@ -10,152 +10,127 @@ end
local how_to_drink = S("Use the “Place” key to drink it.") local how_to_drink = S("Use the “Place” key to drink it.")
minetest.register_craftitem("mcl_potions:awkward", {
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",
description = S("Awkward Potion"), description = S("Awkward Potion"),
_tt_help = S("No effect"), _tt = S("No effect"),
_doc_items_longdesc = S("This potion has an awkward taste and is used for brewing more potions. Drinking it has no effect."), _longdesc = S("Has an awkward taste and is used for brewing potions."),
_doc_items_usagehelp = how_to_drink, image = potion_image("#0000FF"),
stack_max = 1,
inventory_image = potion_image("#0000FF"),
wield_image = potion_image("#0000FF"),
groups = {brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0}, groups = {brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0},
on_place = minetest.item_eat(0, "mcl_potions:glass_bottle"), on_use = minetest.item_eat(0, "mcl_potions:glass_bottle"),
on_secondary_use = minetest.item_eat(0, "mcl_potions:glass_bottle"), }
})
minetest.register_craftitem("mcl_potions:mundane", { local mundane_def = {
name = "mundane",
description = S("Mundane Potion"), description = S("Mundane Potion"),
_tt_help = S("No effect"), _tt = S("No effect"),
_doc_items_longdesc = S("This potion has a clean taste and is used for brewing more potions. Drinking it has no effect."), longdesc = S("Has a clean taste and is used for brewing potions."),
_doc_items_usagehelp = how_to_drink, image = potion_image("#0000FF"),
stack_max = 1, on_use = minetest.item_eat(0, "mcl_potions:glass_bottle"),
inventory_image = potion_image("#0000FF"), }
wield_image = potion_image("#0000FF"),
groups = {brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
on_place = minetest.item_eat(0, "mcl_potions:glass_bottle"),
on_secondary_use = minetest.item_eat(0, "mcl_potions:glass_bottle"),
})
minetest.register_craftitem("mcl_potions:thick", { local thick_def = {
name = "thick",
description = S("Thick Potion"), description = S("Thick Potion"),
_tt_help = S("No effect"), _tt = S("No effect"),
_doc_items_longdesc = S("This potion has a bitter taste and is used for brewing more potions. Drinking it has no effect."), _longdesc = S("Has a bitter taste and is used for brewing potions."),
_doc_items_usagehelp = how_to_drink, image = potion_image("#0000FF"),
stack_max = 1, on_use = minetest.item_eat(0, "mcl_potions:glass_bottle"),
inventory_image = potion_image("#0000FF"), }
wield_image = potion_image("#0000FF"),
groups = {brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 },
on_place = minetest.item_eat(0, "mcl_potions:glass_bottle"),
on_secondary_use = minetest.item_eat(0, "mcl_potions:glass_bottle"),
})
local dragon_breath_def = {
minetest.register_craftitem("mcl_potions:dragon_breath", { name = "dragon_breath",
description = S("Dragon's Breath"), description = S("Dragon's Breath"),
_doc_items_longdesc = brewhelp, _tt = S("No effect"),
wield_image = "mcl_potions_dragon_breath.png", _longdesc = S("Combine with Splash potions to create a Lingering effect"),
inventory_image = "mcl_potions_dragon_breath.png", image = "mcl_potions_dragon_breath.png",
groups = { brewitem = 1, not_in_creative_inventory = 0 }, groups = { brewitem = 1, not_in_creative_inventory = 0 },
stack_max = 1, on_use = nil,
}) }
local healing_def = {
minetest.register_craftitem("mcl_potions:healing", { name = "healing",
description = S("Healing Potion"), description = S("Healing Potion"),
_tt_help = S("+4 HP"), _tt = S("+4 HP"),
_doc_items_longdesc = brewhelp, _longdesc = S("Drink to heal yourself"),
wield_image = potion_image("#CC0000"), image = potion_image("#CC0000"),
inventory_image = potion_image("#CC0000"), on_use = function (itemstack, user, pointed_thing)
groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 }, mcl_potions.healing_func(user, 4)
stack_max = 1, minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
mcl_potions._use_potion(itemstack, user, "#CC0000")
return itemstack
end
}
on_place = function(itemstack, user, pointed_thing) local healing_2_def = table.copy(healing_def)
mcl_potions.healing_func(user, 4) healing_2_def.name = "healing_2"
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) healing_2_def.description = S("Healing Potion II")
mcl_potions._use_potion(itemstack, user, "#CC0000") healing_2_def._tt = S("+8 HP")
return itemstack healing_2_def.on_use = function (itemstack, user, pointed_thing)
end, 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
on_secondary_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,
})
minetest.register_craftitem("mcl_potions:healing_2", { local harming_def = {
description = S("Healing Potion II"), name = "harming",
_tt_help = S("+8 HP"),
_doc_items_longdesc = brewhelp,
wield_image = potion_image("#DD0000"),
inventory_image = potion_image("#DD0000"),
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.healing_func(user, 8)
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
mcl_potions._use_potion(itemstack, user, "#DD0000")
return itemstack
end,
on_secondary_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, "#DD0000")
return itemstack
end,
})
minetest.register_craftitem("mcl_potions:harming", {
description = S("Harming Potion"), description = S("Harming Potion"),
_tt_help = S("-6 HP"), _tt = S("-3 Hearts"),
_doc_items_longdesc = brewhelp, _longdesc = S("Drink to heal yourself"),
wield_image = potion_image("#660099"), image = potion_image("#660099"),
inventory_image = potion_image("#660099"), on_use = function (itemstack, user, pointed_thing)
groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 }, mcl_potions.healing_func(user, -6)
stack_max = 1, minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
mcl_potions._use_potion(itemstack, user, "#660099")
return itemstack
end
}
on_place = function(itemstack, user, pointed_thing) local harming_2_def = table.copy(healing_def)
mcl_potions.healing_func(user, -6) harming_2_def.name = "harming_2"
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) harming_2_def.description = S("Harming Potion II")
mcl_potions._use_potion(itemstack, user, "#660099") harming_2_def._tt = S("-6 Hearts")
return itemstack harming_2_def.on_use = function (itemstack, user, pointed_thing)
end, 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
on_secondary_use = function(itemstack, user, pointed_thing) register_potion(awkward_def)
mcl_potions.healing_func(user, -6) register_potion(mundane_def)
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) register_potion(thick_def)
mcl_potions._use_potion(itemstack, user, "#660099") register_potion(dragon_breath_def)
return itemstack register_potion(healing_def)
end, register_potion(healing_2_def)
}) register_potion(harming_def)
register_potion(harming_2_def)
minetest.register_craftitem("mcl_potions:harming_2", {
description = S("Harming Potion II"),
_tt_help = S("-12 HP"),
_doc_items_longdesc = brewhelp,
wield_image = potion_image("#330066"),
inventory_image = potion_image("#330066"),
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.healing_func(user, -12)
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing)
mcl_potions._use_potion(itemstack, user, "#330066")
return itemstack
end,
on_secondary_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, "#330066")
return itemstack
end,
})
minetest.register_craftitem("mcl_potions:night_vision", { minetest.register_craftitem("mcl_potions:night_vision", {