Move fortress-related data to fortress.lua.
This commit is contained in:
parent
9333788d8e
commit
dffcc72cbd
2 changed files with 88 additions and 86 deletions
88
fortress.lua
88
fortress.lua
|
@ -1,6 +1,94 @@
|
||||||
local max_depth = 31000
|
local max_depth = 31000
|
||||||
|
|
||||||
|
|
||||||
|
dofile(fun_caves.path .. "/trophies.lua")
|
||||||
|
dofile(fun_caves.path .. "/tesseract.lua")
|
||||||
|
|
||||||
|
|
||||||
|
-- dungeon floor, basic
|
||||||
|
newnode = fun_caves.clone_node("default:stone")
|
||||||
|
newnode.description = "Dungeon Stone"
|
||||||
|
newnode.legacy_mineral = false
|
||||||
|
newnode.groups = {fortress = 1}
|
||||||
|
minetest.register_node("fun_caves:dungeon_floor_1", newnode)
|
||||||
|
|
||||||
|
-- dungeon walls, basic
|
||||||
|
newnode = fun_caves.clone_node("default:sandstone")
|
||||||
|
newnode.description = "Dungeon Stone"
|
||||||
|
newnode.groups = {fortress = 1}
|
||||||
|
minetest.register_node("fun_caves:dungeon_wall_1", newnode)
|
||||||
|
|
||||||
|
-- dungeon walls, type 2
|
||||||
|
newnode = fun_caves.clone_node("default:desert_stone")
|
||||||
|
newnode.description = "Dungeon Stone"
|
||||||
|
newnode.groups = {fortress = 1}
|
||||||
|
minetest.register_node("fun_caves:dungeon_wall_2", newnode)
|
||||||
|
|
||||||
|
newnode = fun_caves.clone_node("default:glass")
|
||||||
|
newnode.description = "Dungeon Stone"
|
||||||
|
newnode.groups = {fortress = 1}
|
||||||
|
minetest.register_node("fun_caves:dungeon_wall_transparent", newnode)
|
||||||
|
|
||||||
|
newnode = fun_caves.clone_node("default:glass")
|
||||||
|
newnode.description = "Dungeon Stone"
|
||||||
|
newnode.groups = {fortress = 1}
|
||||||
|
newnode.tiles = {'fun_caves_blank.png'}
|
||||||
|
newnode.pointable = false
|
||||||
|
minetest.register_node("fun_caves:dungeon_wall_invisible", newnode)
|
||||||
|
|
||||||
|
|
||||||
|
local treasures = {
|
||||||
|
{'fun_caves:aquamarine', 'fun_caves:garnet', 'fun_caves:zoisite', 'fun_caves:coral_gem', 'fun_caves:moonstone', 'fun_caves:pure_copper', 'fun_caves:sky_iron', 'fun_caves:sky_iron', 'fun_caves:sky_iron', 'fun_caves:sky_iron', 'default:obsidian'},
|
||||||
|
{'fun_caves:aquamarine', 'fun_caves:garnet', 'fun_caves:zoisite', 'fun_caves:coral_gem', 'fun_caves:moonstone', 'fun_caves:pure_copper', 'fun_caves:metallic_ice', 'fun_caves:metallic_ice', 'fun_caves:metallic_ice', 'fun_caves:metallic_ice', 'default:obsidian'},
|
||||||
|
{'fun_caves:aquamarine', 'fun_caves:garnet', 'fun_caves:zoisite', 'fun_caves:coral_gem', 'fun_caves:moonstone', 'default:obsidian'},
|
||||||
|
{'fun_caves:aquamarine', 'fun_caves:garnet', 'fun_caves:zoisite', 'fun_caves:coral_gem', 'fun_caves:moonstone', 'default:obsidian'},
|
||||||
|
{'fun_caves:aquamarine', 'fun_caves:garnet', 'fun_caves:zoisite', 'fun_caves:coral_gem', 'fun_caves:moonstone', 'default:obsidian'},
|
||||||
|
{'fun_caves:aquamarine', 'fun_caves:garnet', 'fun_caves:zoisite', 'fun_caves:coral_gem', 'fun_caves:moonstone', 'default:obsidian'},
|
||||||
|
}
|
||||||
|
local filler = {'default:apple 10', 'default:coal_lump 10', 'default:wood 10'}
|
||||||
|
local trophies = {
|
||||||
|
{'fun_caves:unobtainium', 'fun_caves:philosophers_stone'},
|
||||||
|
{'fun_caves:unobtainium', 'fun_caves:philosophers_stone'},
|
||||||
|
{'fun_caves:unobtainium', 'fun_caves:philosophers_stone'},
|
||||||
|
{'fun_caves:unobtainium', 'fun_caves:philosophers_stone'},
|
||||||
|
{'fun_caves:unobtainium', 'fun_caves:philosophers_stone'},
|
||||||
|
{'fun_caves:unobtainium', 'fun_caves:philosophers_stone'},
|
||||||
|
}
|
||||||
|
local chest_formspec =
|
||||||
|
"size[8,9]" ..
|
||||||
|
default.gui_bg ..
|
||||||
|
default.gui_bg_img ..
|
||||||
|
default.gui_slots ..
|
||||||
|
"list[current_name;main;0,0.3;8,4;]" ..
|
||||||
|
"list[current_player;main;0,4.85;8,1;]" ..
|
||||||
|
"list[current_player;main;0,6.08;8,3;8]" ..
|
||||||
|
"listring[current_name;main]" ..
|
||||||
|
"listring[current_player;main]" ..
|
||||||
|
default.get_hotbar_bg(0,4.85)
|
||||||
|
|
||||||
|
local newnode = fun_caves.clone_node("default:chest")
|
||||||
|
newnode.description = "Treasure Chest"
|
||||||
|
newnode.on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
local ready = meta:get_string('formspec')
|
||||||
|
if ready == '' then
|
||||||
|
local level = math.max(6, math.ceil(pos.y / math.floor(max_depth / 6)))
|
||||||
|
local big_item = treasures[level][math.random(#treasures[level])]
|
||||||
|
meta:set_string("formspec", chest_formspec)
|
||||||
|
local inv = meta:get_inventory()
|
||||||
|
inv:set_size("main", 8*4)
|
||||||
|
inv:add_item('main', big_item)
|
||||||
|
for i = 1, math.random(4) do
|
||||||
|
inv:add_item('main', filler[math.random(#filler)])
|
||||||
|
end
|
||||||
|
if math.random(10) == 1 then
|
||||||
|
inv:add_item('main', trophies[level][math.random(#trophies[level])])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
minetest.register_node("fun_caves:coffer", newnode)
|
||||||
|
|
||||||
|
|
||||||
-- All arrays in the maze functions are zero-based.
|
-- All arrays in the maze functions are zero-based.
|
||||||
local floor_noise_1 = {offset = 0, scale = 1, seed = 1587, spread = {x = 30, y = 30, z = 30}, octaves = 3, persist = 1, lacunarity = 2}
|
local floor_noise_1 = {offset = 0, scale = 1, seed = 1587, spread = {x = 30, y = 30, z = 30}, octaves = 3, persist = 1, lacunarity = 2}
|
||||||
|
|
||||||
|
|
86
nodes.lua
86
nodes.lua
|
@ -23,37 +23,6 @@ newnode.tiles = {"default_dirt.png^[colorize:#100020:100"}
|
||||||
newnode.groups.soil = 0
|
newnode.groups.soil = 0
|
||||||
minetest.register_node("fun_caves:polluted_dirt", newnode)
|
minetest.register_node("fun_caves:polluted_dirt", newnode)
|
||||||
|
|
||||||
-- dungeon floor, basic
|
|
||||||
newnode = fun_caves.clone_node("default:stone")
|
|
||||||
newnode.description = "Dungeon Stone"
|
|
||||||
newnode.legacy_mineral = false
|
|
||||||
newnode.groups = {fortress = 1}
|
|
||||||
minetest.register_node("fun_caves:dungeon_floor_1", newnode)
|
|
||||||
|
|
||||||
-- dungeon walls, basic
|
|
||||||
newnode = fun_caves.clone_node("default:sandstone")
|
|
||||||
newnode.description = "Dungeon Stone"
|
|
||||||
newnode.groups = {fortress = 1}
|
|
||||||
minetest.register_node("fun_caves:dungeon_wall_1", newnode)
|
|
||||||
|
|
||||||
-- dungeon walls, type 2
|
|
||||||
newnode = fun_caves.clone_node("default:desert_stone")
|
|
||||||
newnode.description = "Dungeon Stone"
|
|
||||||
newnode.groups = {fortress = 1}
|
|
||||||
minetest.register_node("fun_caves:dungeon_wall_2", newnode)
|
|
||||||
|
|
||||||
newnode = fun_caves.clone_node("default:glass")
|
|
||||||
newnode.description = "Dungeon Stone"
|
|
||||||
newnode.groups = {fortress = 1}
|
|
||||||
minetest.register_node("fun_caves:dungeon_wall_transparent", newnode)
|
|
||||||
|
|
||||||
newnode = fun_caves.clone_node("default:glass")
|
|
||||||
newnode.description = "Dungeon Stone"
|
|
||||||
newnode.groups = {fortress = 1}
|
|
||||||
newnode.tiles = {'fun_caves_blank.png'}
|
|
||||||
newnode.pointable = false
|
|
||||||
minetest.register_node("fun_caves:dungeon_wall_invisible", newnode)
|
|
||||||
|
|
||||||
-- ice -- add cold damage
|
-- ice -- add cold damage
|
||||||
minetest.add_group("default:ice", {surface_cold = 3})
|
minetest.add_group("default:ice", {surface_cold = 3})
|
||||||
|
|
||||||
|
@ -133,57 +102,6 @@ newnode.drop = "fun_caves:meteorite"
|
||||||
newnode.groups.soil = 0
|
newnode.groups.soil = 0
|
||||||
minetest.register_node("fun_caves:meteorite_crater", newnode)
|
minetest.register_node("fun_caves:meteorite_crater", newnode)
|
||||||
|
|
||||||
local treasures = {
|
|
||||||
{'fun_caves:aquamarine', 'fun_caves:garnet', 'fun_caves:zoisite', 'fun_caves:coral_gem', 'fun_caves:moonstone', 'fun_caves:sky_iron', 'fun_caves:sky_iron', 'fun_caves:sky_iron', 'fun_caves:sky_iron', 'default:obsidian'},
|
|
||||||
{'fun_caves:aquamarine', 'fun_caves:garnet', 'fun_caves:zoisite', 'fun_caves:coral_gem', 'fun_caves:moonstone', 'fun_caves:pure_copper', 'fun_caves:pure_copper', 'fun_caves:pure_copper', 'fun_caves:pure_copper', 'default:obsidian'},
|
|
||||||
{'fun_caves:aquamarine', 'fun_caves:garnet', 'fun_caves:zoisite', 'fun_caves:coral_gem', 'fun_caves:moonstone', 'default:obsidian'},
|
|
||||||
{'fun_caves:aquamarine', 'fun_caves:garnet', 'fun_caves:zoisite', 'fun_caves:coral_gem', 'fun_caves:moonstone', 'default:obsidian'},
|
|
||||||
{'fun_caves:aquamarine', 'fun_caves:garnet', 'fun_caves:zoisite', 'fun_caves:coral_gem', 'fun_caves:moonstone', 'default:obsidian'},
|
|
||||||
{'fun_caves:aquamarine', 'fun_caves:garnet', 'fun_caves:zoisite', 'fun_caves:coral_gem', 'fun_caves:moonstone', 'default:obsidian'},
|
|
||||||
}
|
|
||||||
local filler = {'default:apple 10', 'default:coal_lump 10', 'default:wood 10'}
|
|
||||||
local trophies = {
|
|
||||||
{'fun_caves:unobtainium', 'fun_caves:philosophers_stone'},
|
|
||||||
{'fun_caves:unobtainium', 'fun_caves:philosophers_stone'},
|
|
||||||
{'fun_caves:unobtainium', 'fun_caves:philosophers_stone'},
|
|
||||||
{'fun_caves:unobtainium', 'fun_caves:philosophers_stone'},
|
|
||||||
{'fun_caves:unobtainium', 'fun_caves:philosophers_stone'},
|
|
||||||
{'fun_caves:unobtainium', 'fun_caves:philosophers_stone'},
|
|
||||||
}
|
|
||||||
local chest_formspec =
|
|
||||||
"size[8,9]" ..
|
|
||||||
default.gui_bg ..
|
|
||||||
default.gui_bg_img ..
|
|
||||||
default.gui_slots ..
|
|
||||||
"list[current_name;main;0,0.3;8,4;]" ..
|
|
||||||
"list[current_player;main;0,4.85;8,1;]" ..
|
|
||||||
"list[current_player;main;0,6.08;8,3;8]" ..
|
|
||||||
"listring[current_name;main]" ..
|
|
||||||
"listring[current_player;main]" ..
|
|
||||||
default.get_hotbar_bg(0,4.85)
|
|
||||||
|
|
||||||
local newnode = fun_caves.clone_node("default:chest")
|
|
||||||
newnode.description = "Treasure Chest"
|
|
||||||
newnode.on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
|
||||||
local meta = minetest.get_meta(pos)
|
|
||||||
local ready = meta:get_string('formspec')
|
|
||||||
if ready == '' then
|
|
||||||
local level = math.max(6, math.ceil(pos.y / math.floor(max_depth / 6)))
|
|
||||||
local big_item = treasures[level][math.random(#treasures[level])]
|
|
||||||
meta:set_string("formspec", chest_formspec)
|
|
||||||
local inv = meta:get_inventory()
|
|
||||||
inv:set_size("main", 8*4)
|
|
||||||
inv:add_item('main', big_item)
|
|
||||||
for i = 1, math.random(4) do
|
|
||||||
inv:add_item('main', filler[math.random(#filler)])
|
|
||||||
end
|
|
||||||
if math.random(10) == 1 then
|
|
||||||
inv:add_item('main', trophies[level][math.random(#trophies[level])])
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
minetest.register_node("fun_caves:coffer", newnode)
|
|
||||||
|
|
||||||
|
|
||||||
newnode = fun_caves.clone_node("default:stone")
|
newnode = fun_caves.clone_node("default:stone")
|
||||||
newnode.tiles = {'dna.png'}
|
newnode.tiles = {'dna.png'}
|
||||||
|
@ -287,7 +205,3 @@ minetest.register_craft({
|
||||||
{'fun_caves:dry_fiber', '', 'fun_caves:dry_fiber'},
|
{'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