Add teleporter prerequisites.
40
abms.lua
|
@ -241,6 +241,46 @@ minetest.register_abm({
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- meteor strikes
|
||||||
|
minetest.register_abm({
|
||||||
|
nodenames = {"default:dirt_with_grass", "default:dirt_with_dry_grass"},
|
||||||
|
neighbors = {"air"},
|
||||||
|
interval = 100000 * fun_caves.time_factor,
|
||||||
|
catch_up = false,
|
||||||
|
chance = 10000,
|
||||||
|
action = function(pos, node)
|
||||||
|
local ps = {}
|
||||||
|
local players = minetest.get_connected_players()
|
||||||
|
for i = 1, #players do
|
||||||
|
local pp = players[i]:getpos()
|
||||||
|
if pp and pp.y > 0 then
|
||||||
|
local sky = {}
|
||||||
|
sky.bgcolor, sky.type, sky.textures = players[i]:get_sky()
|
||||||
|
ps[#ps+1] = { p = players[i], sky = sky }
|
||||||
|
players[i]:set_sky(0xffffff, "plain", {})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.set_node(pos, {name="fun_caves:meteorite_crater"})
|
||||||
|
--print('Fun Caves: meteorite impact '..pos.x..','..pos.y..','..pos.z)
|
||||||
|
|
||||||
|
minetest.after(1, function()
|
||||||
|
for i = 1, #ps do
|
||||||
|
ps[i].p:set_sky(ps[i].sky.bgcolor, ps[i].sky.type, ps[i].sky.textures)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_abm({
|
||||||
|
nodenames = {"fun_caves:meteorite_crater"},
|
||||||
|
interval = 100 * fun_caves.time_factor,
|
||||||
|
chance = 10,
|
||||||
|
action = function(pos, node)
|
||||||
|
minetest.set_node(pos, {name="default:dirt"})
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
-- new mushrooms
|
-- new mushrooms
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
nodenames = {"default:dirt"},
|
nodenames = {"default:dirt"},
|
||||||
|
|
15
fortress.lua
|
@ -2,6 +2,12 @@ local rand = math.random
|
||||||
local floor = math.floor
|
local floor = math.floor
|
||||||
|
|
||||||
|
|
||||||
|
local treasures = {
|
||||||
|
'fun_caves:stone_with_aquamarines',
|
||||||
|
'fun_caves:stone_with_sky_iron',
|
||||||
|
'default:obsidian',
|
||||||
|
}
|
||||||
|
|
||||||
fun_caves.fortress = function(minp, maxp, data, area, node)
|
fun_caves.fortress = function(minp, maxp, data, area, node)
|
||||||
-- invisible maze
|
-- invisible maze
|
||||||
-- hungry maze
|
-- hungry maze
|
||||||
|
@ -16,6 +22,7 @@ fun_caves.fortress = function(minp, maxp, data, area, node)
|
||||||
local inner_floor = node['fun_caves:dungeon_floor_1']
|
local inner_floor = node['fun_caves:dungeon_floor_1']
|
||||||
local outer_wall = node['fun_caves:dungeon_wall_2']
|
local outer_wall = node['fun_caves:dungeon_wall_2']
|
||||||
local inner_wall = node['fun_caves:dungeon_wall_1']
|
local inner_wall = node['fun_caves:dungeon_wall_1']
|
||||||
|
local treasure_count = 0
|
||||||
|
|
||||||
for y2 = 0, n-1 do
|
for y2 = 0, n-1 do
|
||||||
--for y2 = 0, 0 do
|
--for y2 = 0, 0 do
|
||||||
|
@ -40,7 +47,12 @@ fun_caves.fortress = function(minp, maxp, data, area, node)
|
||||||
end
|
end
|
||||||
elseif (z - minp.z) % 5 == 0 or (x - minp.x) % 5 == 0 then
|
elseif (z - minp.z) % 5 == 0 or (x - minp.x) % 5 == 0 then
|
||||||
--data[ivm] = fun_caves.DEBUG and node["default:glass"] or inner_wall
|
--data[ivm] = fun_caves.DEBUG and node["default:glass"] or inner_wall
|
||||||
data[ivm] = inner_wall
|
if y2 == 0 and rand(3000) == 1 then
|
||||||
|
treasure_count = treasure_count + 1
|
||||||
|
data[ivm] = node[treasures[rand(#treasures)]]
|
||||||
|
else
|
||||||
|
data[ivm] = inner_wall
|
||||||
|
end
|
||||||
else
|
else
|
||||||
data[ivm] = node["air"]
|
data[ivm] = node["air"]
|
||||||
end
|
end
|
||||||
|
@ -88,4 +100,5 @@ fun_caves.fortress = function(minp, maxp, data, area, node)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
--print(treasure_count)
|
||||||
end
|
end
|
||||||
|
|
|
@ -48,6 +48,7 @@ fun_caves.is_fortress = function(pos, cs, debug)
|
||||||
-- Fix this to get csize, somehow.
|
-- Fix this to get csize, somehow.
|
||||||
-- Remember that this function may be called
|
-- Remember that this function may be called
|
||||||
-- before any chunks are generated.
|
-- before any chunks are generated.
|
||||||
|
|
||||||
local cs = cs or {x=80, y=80, z=80}
|
local cs = cs or {x=80, y=80, z=80}
|
||||||
local offset = floor(cs.y / 2) - 8 + 1
|
local offset = floor(cs.y / 2) - 8 + 1
|
||||||
|
|
||||||
|
@ -63,10 +64,11 @@ fun_caves.is_fortress = function(pos, cs, debug)
|
||||||
local z = floor((pos.z + offset) / cs.z)
|
local z = floor((pos.z + offset) / cs.z)
|
||||||
|
|
||||||
local n = minetest.get_perlin(fortress_noise):get3d({x=x, y=y, z=z})
|
local n = minetest.get_perlin(fortress_noise):get3d({x=x, y=y, z=z})
|
||||||
if debug then
|
if fun_caves.DEBUG and floor((n * 10000) % 4) == 1 then
|
||||||
print(x, y, z, n, floor((n * 10000) % 19))
|
print('fortress ('..x..','..y..','..zn..')')
|
||||||
|
return true
|
||||||
end
|
end
|
||||||
if floor((n * 10000) % 19) == 1 or fun_caves.DEBUG then
|
if floor((n * 10000) % 19) == 1 then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
115
nodes.lua
|
@ -159,12 +159,12 @@ local function teleporter(user, area, power)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_craftitem("fun_caves:teleporter_steel_aquamarine", {
|
minetest.register_craftitem("fun_caves:teleporter_iron_aquamarine", {
|
||||||
description = "Steel and Aquamarine Teleporter",
|
description = "Iron and Aquamarine Teleporter",
|
||||||
drawtype = "plantlike",
|
drawtype = "plantlike",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
tiles = {"fun_caves_tesseract_steel_aqua.png"},
|
tiles = {"fun_caves_tesseract_iron_aqua.png"},
|
||||||
inventory_image = "fun_caves_tesseract_steel_aqua.png",
|
inventory_image = "fun_caves_tesseract_iron_aqua.png",
|
||||||
groups = {dig_immediate = 3},
|
groups = {dig_immediate = 3},
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
on_use = function(itemstack, user, pointed_thing)
|
on_use = function(itemstack, user, pointed_thing)
|
||||||
|
@ -172,8 +172,27 @@ minetest.register_craftitem("fun_caves:teleporter_steel_aquamarine", {
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("fun_caves:pure_steel", {
|
minetest.register_craft({
|
||||||
description = "Incredibly Pure Steel",
|
output = 'fun_caves:teleporter_iron_aquamarine',
|
||||||
|
recipe = {
|
||||||
|
{'fun_caves:sky_iron', 'default:copper_ingot', 'fun_caves:sky_iron'},
|
||||||
|
{'fun_caves:perfect_aquamarine', 'fun_caves:perfect_aquamarine', 'fun_caves:perfect_aquamarine'},
|
||||||
|
{'fun_caves:sky_iron', 'default:obsidian_shard', 'fun_caves:sky_iron'},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
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",
|
drawtype = "plantlike",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
tiles = {"default_steel_ingot.png"},
|
tiles = {"default_steel_ingot.png"},
|
||||||
|
@ -182,6 +201,76 @@ minetest.register_craftitem("fun_caves:pure_steel", {
|
||||||
sounds = default.node_sound_stone_defaults(),
|
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 = {"crucible.png"},
|
||||||
|
inventory_image = "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:crucible", {
|
||||||
|
description = "Crucible",
|
||||||
|
drawtype = "plantlike",
|
||||||
|
paramtype = "light",
|
||||||
|
tiles = {"crucible.png"},
|
||||||
|
inventory_image = "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', ''},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("fun_caves:stone_with_aquamarines", {
|
||||||
|
description = "Aquamarine Ore",
|
||||||
|
tiles = {"default_stone.png^default_mineral_diamond.png"},
|
||||||
|
groups = {cracky = 1},
|
||||||
|
drop = "fun_caves:perfect_aquamarine",
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_ore({
|
||||||
|
ore_type = "scatter",
|
||||||
|
ore = "fun_caves:stone_with_aquamarines",
|
||||||
|
wherein = "default:stone",
|
||||||
|
clust_scarcity = 30 * 30 * 30,
|
||||||
|
clust_num_ores = 1,
|
||||||
|
clust_size = 1,
|
||||||
|
y_min = -6000,
|
||||||
|
y_max = 31000,
|
||||||
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("fun_caves:perfect_aquamarine", {
|
minetest.register_craftitem("fun_caves:perfect_aquamarine", {
|
||||||
description = "Perfect Aquamarine",
|
description = "Perfect Aquamarine",
|
||||||
drawtype = "plantlike",
|
drawtype = "plantlike",
|
||||||
|
@ -192,11 +281,9 @@ minetest.register_craftitem("fun_caves:perfect_aquamarine", {
|
||||||
sounds = default.node_sound_glass_defaults(),
|
sounds = default.node_sound_glass_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
local newnode = fun_caves.clone_node("default:dirt")
|
||||||
output = 'fun_caves:teleporter_steel_aquamarine',
|
newnode.description = "Meteor Crater"
|
||||||
recipe = {
|
newnode.tiles = {"fun_caves_crater.png", "default_dirt.png", "default_dirt.png", "default_dirt.png", "default_dirt.png", "default_dirt.png"}
|
||||||
{'fun_caves:pure_steel', 'default:copper_ingot', 'fun_caves:pure_steel'},
|
newnode.drop = "fun_caves:meteorite"
|
||||||
{'fun_caves:perfect_aquamarine', 'fun_caves:perfect_aquamarine', 'fun_caves:perfect_aquamarine'},
|
newnode.groups.soil = 0
|
||||||
{'fun_caves:pure_steel', 'default:obsidianbrick', 'fun_caves:pure_steel'},
|
minetest.register_node("fun_caves:meteorite_crater", newnode)
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
BIN
textures/crucible.png
Normal file
After Width: | Height: | Size: 984 B |
BIN
textures/default_grass.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
textures/default_grass_side.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
textures/fun_caves_crater.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
textures/fun_caves_grassy_crater.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
textures/fun_caves_meteorite.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
@ -1,3 +1,4 @@
|
||||||
Original spider textures: AspireMint
|
Original spider textures: AspireMint
|
||||||
Original goblins textures and models: Francisco "FreeLikeGNU" Athens
|
Original goblins textures and models: Francisco "FreeLikeGNU" Athens
|
||||||
Original tesseract: Claudio Rocchini (cc-by-sa 2.5), https://en.wikipedia.org/wiki/File:Runci_trunc_tessaract.png
|
Original tesseract: Claudio Rocchini (cc-by-sa 2.5), https://en.wikipedia.org/wiki/File:Runci_trunc_tessaract.png
|
||||||
|
Original meteorite: MeteoriteKid (cc-by-sa 3), https://en.wikipedia.org/wiki/File:Oriented_Taza_Meteorite.jpg
|
||||||
|
|