Streamline tesseracts and separate trophies.
This commit is contained in:
parent
3de24bde95
commit
abffeb54d9
13 changed files with 278 additions and 424 deletions
428
nodes.lua
428
nodes.lua
|
@ -114,410 +114,6 @@ minetest.register_node("fun_caves:water_poison_flowing", newnode)
|
|||
-- pointable = false,
|
||||
--})
|
||||
|
||||
local function teleporter(user, area, power)
|
||||
if not user then
|
||||
return
|
||||
end
|
||||
|
||||
local name = user:get_player_name()
|
||||
local pos = user:getpos()
|
||||
|
||||
if not fun_caves.db then
|
||||
fun_caves.db = {}
|
||||
end
|
||||
if not fun_caves.db.teleport_data then
|
||||
fun_caves.db.teleport_data = {}
|
||||
end
|
||||
if not fun_caves.db.teleport_data[name] then
|
||||
fun_caves.db.teleport_data[name] = {}
|
||||
end
|
||||
|
||||
local out = io.open(fun_caves.world..'/fun_caves_data.txt','w')
|
||||
if not (out and name) then
|
||||
return
|
||||
end
|
||||
|
||||
if fun_caves.db.teleport_data[name].teleported_from then
|
||||
user:setpos(fun_caves.db.teleport_data[name].teleported_from)
|
||||
fun_caves.db.teleport_data[name].teleported_from = nil
|
||||
else
|
||||
local newpos
|
||||
if area == 'overworld' then
|
||||
newpos = {x=(math.random(2)*2-3)*(math.random(math.floor(max_depth/6))+power*math.floor(max_depth/6)), y=120, z=(math.random(2)*2-3)*(math.random(math.floor(max_depth/6))+power*math.floor(max_depth/6))}
|
||||
elseif area == 'hell' then
|
||||
newpos = {x=pos.x, y=fun_caves.underzones[({'Caina','Phlegethos','Dis','Minauros', 'Phlegethos','Styx'})[power+1]].ceiling-30, z=pos.z}
|
||||
elseif area == 'sky' then
|
||||
newpos = {x=pos.x, y=({4368, 8768, 13168, 4368, 4368, 4368})[power+1]+76, z=pos.z}
|
||||
elseif area == 'dungeon' then
|
||||
return
|
||||
elseif area == 'underworld' then
|
||||
return
|
||||
else
|
||||
return
|
||||
end
|
||||
|
||||
user:setpos(newpos)
|
||||
print('Fun Caves: '..name..' teleported to ('..pos.x..','..pos.y..','..pos.z..')')
|
||||
fun_caves.db.teleport_data[name].teleported_from = pos
|
||||
out:write(minetest.serialize(fun_caves.db))
|
||||
user:set_physics_override({gravity=0.1})
|
||||
|
||||
minetest.after(20, function()
|
||||
user:set_physics_override({gravity=1})
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_craftitem("fun_caves:teleporter_iron_moonstone", {
|
||||
description = "Iron and Moonstone Tesseract",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = {"fun_caves_tesseract_iron_moon.png"},
|
||||
inventory_image = "fun_caves_tesseract_iron_moon.png",
|
||||
groups = {dig_immediate = 3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
teleporter(user, 'sky', 0)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'fun_caves:teleporter_iron_moonstone',
|
||||
recipe = {
|
||||
{'fun_caves:sky_iron', 'fun_caves:pure_copper', 'fun_caves:sky_iron'},
|
||||
{'fun_caves:moonstone', 'fun_caves:moonstone', 'fun_caves:moonstone'},
|
||||
{'fun_caves:sky_iron', 'default:obsidian_shard', 'fun_caves:sky_iron'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("fun_caves:moonstone", {
|
||||
description = "Moonstone",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = {"fun_caves_moonstone.png"},
|
||||
inventory_image = "fun_caves_moonstone.png",
|
||||
groups = {dig_immediate = 3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("fun_caves:stone_with_moonstones", {
|
||||
description = "Moonstone Ore",
|
||||
tiles = {"default_stone.png^fun_caves_mineral_moonstone.png"},
|
||||
groups = {cracky = 1},
|
||||
drop = "fun_caves:moonstone",
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "fun_caves:stone_with_moonstones",
|
||||
wherein = "default:stone",
|
||||
clust_scarcity = 21 * 21 * 21,
|
||||
clust_num_ores = 1,
|
||||
clust_size = 1,
|
||||
y_min = -31000,
|
||||
y_max = 31000,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("fun_caves:teleporter_iron_coral", {
|
||||
description = "Iron and Coral Tesseract",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = {"fun_caves_tesseract_iron_coral.png"},
|
||||
inventory_image = "fun_caves_tesseract_iron_coral.png",
|
||||
groups = {dig_immediate = 3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
teleporter(user, 'hell', 0)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'fun_caves:teleporter_iron_coral',
|
||||
recipe = {
|
||||
{'fun_caves:sky_iron', 'fun_caves:pure_copper', 'fun_caves:sky_iron'},
|
||||
{'fun_caves:coral_gem', 'fun_caves:coral_gem', 'fun_caves:coral_gem'},
|
||||
{'fun_caves:sky_iron', 'default:obsidian_shard', 'fun_caves:sky_iron'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("fun_caves:coral_gem", {
|
||||
description = "Coral Gem",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = {"fun_caves_coral_gem.png"},
|
||||
inventory_image = "fun_caves_coral_gem.png",
|
||||
groups = {dig_immediate = 3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "fun_caves:coral_gem",
|
||||
recipe = "fun_caves:precious_coral",
|
||||
cooktime = 5,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("fun_caves:teleporter_iron_garnet", {
|
||||
description = "Iron and Garnet Tesseract",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = {"fun_caves_tesseract_iron_garnet.png"},
|
||||
inventory_image = "fun_caves_tesseract_iron_garnet.png",
|
||||
groups = {dig_immediate = 3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
teleporter(user, 'underworld', 0)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'fun_caves:teleporter_iron_garnet',
|
||||
recipe = {
|
||||
{'fun_caves:sky_iron', 'fun_caves:pure_copper', 'fun_caves:sky_iron'},
|
||||
{'fun_caves:garnet', 'fun_caves:garnet', 'fun_caves:garnet'},
|
||||
{'fun_caves:sky_iron', 'default:obsidian_shard', 'fun_caves:sky_iron'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("fun_caves:garnet", {
|
||||
description = "Garnet",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = {"fun_caves_garnet.png"},
|
||||
inventory_image = "fun_caves_garnet.png",
|
||||
groups = {dig_immediate = 3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("fun_caves:stone_with_garnets", {
|
||||
description = "Garnet Ore",
|
||||
tiles = {"default_stone.png^fun_caves_mineral_garnet.png"},
|
||||
groups = {cracky = 1},
|
||||
drop = "fun_caves:garnet",
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "fun_caves:stone_with_garnets",
|
||||
wherein = "default:stone",
|
||||
clust_scarcity = 21 * 21 * 21,
|
||||
clust_num_ores = 1,
|
||||
clust_size = 1,
|
||||
y_min = -31000,
|
||||
y_max = 31000,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("fun_caves:teleporter_iron_zoisite", {
|
||||
description = "Iron and Zoisite Tesseract",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = {"fun_caves_tesseract_iron_zois.png"},
|
||||
inventory_image = "fun_caves_tesseract_iron_zois.png",
|
||||
groups = {dig_immediate = 3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
teleporter(user, 'dungeon', 0)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'fun_caves:teleporter_iron_zoisite',
|
||||
recipe = {
|
||||
{'fun_caves:sky_iron', 'fun_caves:pure_copper', 'fun_caves:sky_iron'},
|
||||
{'fun_caves:zoisite', 'fun_caves:zoisite', 'fun_caves:zoisite'},
|
||||
{'fun_caves:sky_iron', 'default:obsidian_shard', 'fun_caves:sky_iron'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("fun_caves:zoisite", {
|
||||
description = "Zoisite",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = {"fun_caves_zoisite.png"},
|
||||
inventory_image = "fun_caves_zoisite.png",
|
||||
groups = {dig_immediate = 3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("fun_caves:stone_with_zoisites", {
|
||||
description = "Zoisite Ore",
|
||||
tiles = {"default_stone.png^fun_caves_mineral_zoisite.png"},
|
||||
groups = {cracky = 1},
|
||||
drop = "fun_caves:zoisite",
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "fun_caves:stone_with_zoisites",
|
||||
wherein = "default:stone",
|
||||
clust_scarcity = 21 * 21 * 21,
|
||||
clust_num_ores = 1,
|
||||
clust_size = 1,
|
||||
y_min = -31000,
|
||||
y_max = 31000,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("fun_caves:teleporter_iron_aquamarine", {
|
||||
description = "Iron and Aquamarine Tesseract",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = {"fun_caves_tesseract_iron_aqua.png"},
|
||||
inventory_image = "fun_caves_tesseract_iron_aqua.png",
|
||||
groups = {dig_immediate = 3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
teleporter(user, 'overworld', 0)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'fun_caves:teleporter_iron_aquamarine',
|
||||
recipe = {
|
||||
{'fun_caves:sky_iron', 'fun_caves:pure_copper', 'fun_caves:sky_iron'},
|
||||
{'fun_caves:aquamarine', 'fun_caves:aquamarine', 'fun_caves:aquamarine'},
|
||||
{'fun_caves:sky_iron', 'default:obsidian_shard', 'fun_caves:sky_iron'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("fun_caves:aquamarine", {
|
||||
description = "Aquamarine",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = {"fun_caves_aquamarine.png"},
|
||||
inventory_image = "fun_caves_aquamarine.png",
|
||||
groups = {dig_immediate = 3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("fun_caves:stone_with_aquamarines", {
|
||||
description = "Aquamarine Ore",
|
||||
tiles = {"default_stone.png^fun_caves_mineral_aquamarine.png"},
|
||||
groups = {cracky = 1},
|
||||
drop = "fun_caves:aquamarine",
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "fun_caves:stone_with_aquamarines",
|
||||
wherein = "default:stone",
|
||||
clust_scarcity = 21 * 21 * 21,
|
||||
clust_num_ores = 1,
|
||||
clust_size = 1,
|
||||
y_min = -31000,
|
||||
y_max = 31000,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("fun_caves:meteorite", {
|
||||
description = "Iron Meteorite",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = {"fun_caves_meteorite.png"},
|
||||
inventory_image = "fun_caves_meteorite.png",
|
||||
groups = {dig_immediate = 3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craftitem("fun_caves:sky_iron", {
|
||||
description = "Sky Iron",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = {"default_steel_ingot.png"},
|
||||
inventory_image = "default_steel_ingot.png",
|
||||
groups = {dig_immediate = 3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
local newnode = fun_caves.clone_node("default:stone_with_iron")
|
||||
newnode.description = "Stone With Sky Iron"
|
||||
newnode.drop = "fun_caves:sky_iron"
|
||||
minetest.register_node("fun_caves:stone_with_sky_iron", newnode)
|
||||
|
||||
minetest.register_craftitem("fun_caves:meteoritic_iron_crucible", {
|
||||
description = "Crucible of Meteoritic Iron",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = {"fun_caves_crucible.png"},
|
||||
inventory_image = "fun_caves_crucible.png",
|
||||
groups = {dig_immediate = 3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'fun_caves:meteoritic_iron_crucible',
|
||||
recipe = {
|
||||
{'fun_caves:meteorite', 'fun_caves:meteorite', 'fun_caves:meteorite'},
|
||||
{'fun_caves:meteorite', 'fun_caves:meteorite', 'fun_caves:meteorite'},
|
||||
{'fun_caves:meteorite', 'fun_caves:crucible', 'fun_caves:meteorite'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "fun_caves:sky_iron",
|
||||
recipe = "fun_caves:meteoritic_iron_crucible",
|
||||
cooktime = 30,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("fun_caves:pure_copper", {
|
||||
description = "Very Pure Copper",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = {"default_copper_ingot.png"},
|
||||
inventory_image = "default_copper_ingot.png",
|
||||
groups = {dig_immediate = 3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craftitem("fun_caves:copper_crucible", {
|
||||
description = "Crucible of Copper",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = {"fun_caves_crucible.png"},
|
||||
inventory_image = "fun_caves_crucible.png",
|
||||
groups = {dig_immediate = 3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'fun_caves:copper_crucible',
|
||||
recipe = {
|
||||
{'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'},
|
||||
{'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'},
|
||||
{'default:copper_ingot', 'fun_caves:crucible', 'default:copper_ingot'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "fun_caves:pure_copper",
|
||||
recipe = "fun_caves:copper_crucible",
|
||||
cooktime = 30,
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craftitem("fun_caves:crucible", {
|
||||
description = "Crucible",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = {"fun_caves_crucible.png"},
|
||||
inventory_image = "fun_caves_crucible.png",
|
||||
groups = {dig_immediate = 3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'fun_caves:crucible',
|
||||
recipe = {
|
||||
{'default:clay', '', 'default:clay'},
|
||||
{'default:clay', '', 'default:clay'},
|
||||
{'', 'default:clay', ''},
|
||||
}
|
||||
})
|
||||
|
||||
local newnode = fun_caves.clone_node("default:dirt")
|
||||
newnode.description = "Meteor Crater"
|
||||
newnode.tiles = {"fun_caves_crater.png", "default_dirt.png", "default_dirt.png", "default_dirt.png", "default_dirt.png", "default_dirt.png"}
|
||||
|
@ -576,26 +172,6 @@ newnode.on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
|||
end
|
||||
minetest.register_node("fun_caves:coffer", newnode)
|
||||
|
||||
minetest.register_craftitem("fun_caves:unobtainium", {
|
||||
description = "Unobtainium",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = {"fun_caves_unobtainium.png"},
|
||||
inventory_image = "fun_caves_unobtainium.png",
|
||||
groups = {dig_immediate = 3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craftitem("fun_caves:philosophers_stone", {
|
||||
description = "Philosopher's Stone",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = {"fun_caves_phil_stone.png"},
|
||||
inventory_image = "fun_caves_phil_stone.png",
|
||||
groups = {dig_immediate = 3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
|
||||
newnode = fun_caves.clone_node("default:stone")
|
||||
newnode.tiles = {'dna.png'}
|
||||
|
@ -699,3 +275,7 @@ minetest.register_craft({
|
|||
{'fun_caves:dry_fiber', '', 'fun_caves:dry_fiber'},
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
dofile(fun_caves.path .. "/trophies.lua")
|
||||
dofile(fun_caves.path .. "/tesseract.lua")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue