Add initial random elixir ingredients.
This commit is contained in:
parent
a5906f635b
commit
eb6b544926
5 changed files with 163 additions and 1 deletions
157
elixir.lua
157
elixir.lua
|
@ -1,6 +1,163 @@
|
|||
local elixir_duration = 3600
|
||||
|
||||
|
||||
local elixir_ingredients = {
|
||||
'default:acacia_leaves',
|
||||
'default:acacia_sapling',
|
||||
'default:acacia_tree',
|
||||
'default:acacia_wood',
|
||||
'default:apple',
|
||||
'default:aspen_leaves',
|
||||
'default:aspen_sapling',
|
||||
'default:aspen_tree',
|
||||
'default:aspen_wood',
|
||||
'default:bronze_lump',
|
||||
'default:cactus',
|
||||
'default:clay_lump',
|
||||
'default:cloud',
|
||||
'default:coal_lump',
|
||||
'default:copper_lump',
|
||||
'default:desert_sand',
|
||||
'default:desert_stone',
|
||||
'default:diamond',
|
||||
'default:dirt',
|
||||
'default:dry_shrub',
|
||||
'default:gold_lump',
|
||||
'default:gravel',
|
||||
'default:ice',
|
||||
'default:iron_lump',
|
||||
'default:junglegrass',
|
||||
'default:jungleleaves',
|
||||
'default:junglesapling',
|
||||
'default:jungletree',
|
||||
'default:junglewood',
|
||||
'default:leaves',
|
||||
'default:mese_crystal',
|
||||
'default:obsidian',
|
||||
'default:pine_needles',
|
||||
'default:pine_sapling',
|
||||
'default:pine_tree',
|
||||
'default:pine_wood',
|
||||
'default:sand',
|
||||
'default:sandstone',
|
||||
'default:sapling',
|
||||
'default:snow',
|
||||
'default:stone',
|
||||
'default:tree',
|
||||
'default:wood',
|
||||
'farming:seed_cotton',
|
||||
'farming:seed_wheat',
|
||||
'flowers:dandelion_white',
|
||||
'flowers:dandelion_yellow',
|
||||
'flowers:geranium',
|
||||
'flowers:mushroom_brown',
|
||||
'flowers:mushroom_red',
|
||||
'flowers:rose',
|
||||
'flowers:tulip',
|
||||
'flowers:viola',
|
||||
'flowers:waterlily',
|
||||
'fun_caves:amber',
|
||||
'fun_caves:bark',
|
||||
'fun_caves:bird_of_paradise',
|
||||
'fun_caves:black_sand',
|
||||
'fun_caves:brain_coral',
|
||||
'fun_caves:cloud',
|
||||
'fun_caves:diamondwood',
|
||||
'fun_caves:dragon_eye',
|
||||
'fun_caves:dry_fiber',
|
||||
'fun_caves:gerbera',
|
||||
'fun_caves:giant_mushroom_cap',
|
||||
'fun_caves:giant_mushroom_stem',
|
||||
'fun_caves:hibiscus',
|
||||
'fun_caves:hot_brass',
|
||||
'fun_caves:hot_cobble',
|
||||
'fun_caves:hot_iron',
|
||||
'fun_caves:huge_mushroom_cap',
|
||||
'fun_caves:icicle_down',
|
||||
'fun_caves:icicle_up',
|
||||
'fun_caves:ironwood',
|
||||
'fun_caves:leaves',
|
||||
'fun_caves:leaves_black',
|
||||
'fun_caves:leaves_lumin',
|
||||
'fun_caves:lumin_tree',
|
||||
'fun_caves:moon_weed',
|
||||
'fun_caves:onion',
|
||||
'fun_caves:orchid',
|
||||
'fun_caves:petrified_wood',
|
||||
'fun_caves:pillar_coral',
|
||||
'fun_caves:polluted_dirt',
|
||||
'fun_caves:precious_coral',
|
||||
'fun_caves:radioactive_ore',
|
||||
'fun_caves:small_rocks',
|
||||
'fun_caves:staghorn_coral',
|
||||
'fun_caves:stalactite',
|
||||
'fun_caves:stalactite_mossy',
|
||||
'fun_caves:stalactite_slimy',
|
||||
'fun_caves:stalagmite',
|
||||
'fun_caves:stalagmite_mossy',
|
||||
'fun_caves:stalagmite_slimy',
|
||||
'fun_caves:storm_cloud',
|
||||
'fun_caves:thin_ice',
|
||||
'fun_caves:tree',
|
||||
'wool:white',
|
||||
'wool:black',
|
||||
}
|
||||
|
||||
for _, name in pairs(elixir_ingredients) do
|
||||
local item = minetest.registered_items[name]
|
||||
if not item then
|
||||
item = minetest.registered_nodes[name]
|
||||
end
|
||||
if item then
|
||||
if item.groups then
|
||||
groups = table.copy(item.groups)
|
||||
else
|
||||
groups = {}
|
||||
end
|
||||
groups.elixir_ingredient = 1
|
||||
minetest.override_item(name, {groups = groups})
|
||||
else
|
||||
--print(name)
|
||||
end
|
||||
end
|
||||
--for _, list in pairs({'registered_items', 'registered_nodes', 'registered_craftitems'}) do
|
||||
-- for _, item in pairs(minetest[list]) do
|
||||
-- if item and item.groups.elixir_ingredient then
|
||||
-- print(item.name)
|
||||
-- end
|
||||
-- end
|
||||
--end
|
||||
|
||||
minetest.register_craftitem("fun_caves:elixir", {
|
||||
description = "Unknown Elixir",
|
||||
inventory_image = "fun_caves_elixir.png",
|
||||
on_use = minetest.item_eat(-2),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = 'fun_caves:elixir',
|
||||
recipe = {
|
||||
'mobs_slimes:green_slimeball',
|
||||
'group:elixir_ingredient',
|
||||
'group:elixir_ingredient',
|
||||
'group:elixir_ingredient',
|
||||
"vessels:glass_bottle",
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = 'fun_caves:elixir',
|
||||
recipe = {
|
||||
'fun_caves:syrup',
|
||||
'group:elixir_ingredient',
|
||||
'group:elixir_ingredient',
|
||||
'group:elixir_ingredient',
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
fun_caves.register_status({
|
||||
name = 'armor_elixir',
|
||||
terminate = function(player)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue