Add initial random elixir ingredients.
This commit is contained in:
parent
a5906f635b
commit
eb6b544926
5 changed files with 163 additions and 1 deletions
4
abms.lua
4
abms.lua
|
@ -221,6 +221,10 @@ minetest.register_globalstep(function(dtime)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if fun_caves.db.status[player_name]['breathe'] then
|
||||||
|
player:set_breath(11)
|
||||||
|
end
|
||||||
|
|
||||||
-- ... from standing on or near hot objects.
|
-- ... from standing on or near hot objects.
|
||||||
local counts = minetest_find_nodes_in_area(minp, maxp, hot_stuff)
|
local counts = minetest_find_nodes_in_area(minp, maxp, hot_stuff)
|
||||||
if #counts > 1 then
|
if #counts > 1 then
|
||||||
|
|
157
elixir.lua
157
elixir.lua
|
@ -1,6 +1,163 @@
|
||||||
local elixir_duration = 3600
|
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({
|
fun_caves.register_status({
|
||||||
name = 'armor_elixir',
|
name = 'armor_elixir',
|
||||||
terminate = function(player)
|
terminate = function(player)
|
||||||
|
|
2
init.lua
2
init.lua
|
@ -155,10 +155,10 @@ dofile(fun_caves.path .. "/abms.lua")
|
||||||
dofile(fun_caves.path .. "/nodes.lua")
|
dofile(fun_caves.path .. "/nodes.lua")
|
||||||
dofile(fun_caves.path .. "/deco.lua")
|
dofile(fun_caves.path .. "/deco.lua")
|
||||||
dofile(fun_caves.path .. "/fungal_tree.lua")
|
dofile(fun_caves.path .. "/fungal_tree.lua")
|
||||||
dofile(fun_caves.path .. "/elixir.lua")
|
|
||||||
dofile(fun_caves.path .. "/wallhammer.lua")
|
dofile(fun_caves.path .. "/wallhammer.lua")
|
||||||
dofile(fun_caves.path .. "/mapgen.lua")
|
dofile(fun_caves.path .. "/mapgen.lua")
|
||||||
dofile(fun_caves.path .. "/spec_bomb.lua")
|
dofile(fun_caves.path .. "/spec_bomb.lua")
|
||||||
|
dofile(fun_caves.path .. "/elixir.lua") -- must go after all items are registered
|
||||||
dofile(fun_caves.path .. "/chat.lua")
|
dofile(fun_caves.path .. "/chat.lua")
|
||||||
|
|
||||||
if mobs and mobs.mod == "redo" then
|
if mobs and mobs.mod == "redo" then
|
||||||
|
|
|
@ -14,6 +14,7 @@ function minetest.is_protected(pos, name)
|
||||||
return old_is_protected(pos, name)
|
return old_is_protected(pos, name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- dirt, cave
|
-- dirt, cave
|
||||||
local newnode = fun_caves.clone_node("default:dirt")
|
local newnode = fun_caves.clone_node("default:dirt")
|
||||||
newnode.drop = "default:dirt"
|
newnode.drop = "default:dirt"
|
||||||
|
|
BIN
textures/fun_caves_elixir.png
Normal file
BIN
textures/fun_caves_elixir.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
Loading…
Add table
Add a link
Reference in a new issue