Make PV a nodebox. Add air cylinder and use in crafting recipies. Simplify localisation of noise buffers. Tune noise parameters. Remove spawn egg
This commit is contained in:
parent
5f730ac860
commit
c0851059a8
136
README.txt
136
README.txt
@ -2,139 +2,3 @@ moonrealm 0.10.0 by paramat
|
||||
For Minetest 0.4.14 or later
|
||||
Depends default
|
||||
Licenses: Code LGPL 2.1. Media CC BY-SA 3.0
|
||||
|
||||
|
||||
Crafting
|
||||
--------
|
||||
|
||||
Spacesuit
|
||||
To avoid asphyxiation in vacuum put a spacesuit in your inventory.
|
||||
|
||||
Mesetinted helmet
|
||||
|
||||
-C-
|
||||
-G-
|
||||
-S-
|
||||
|
||||
C = default mese crystal (mese tint)
|
||||
G = default glass
|
||||
S = default steel ingot
|
||||
|
||||
|
||||
Lifesupport backpack
|
||||
|
||||
SSS
|
||||
S-S
|
||||
SMS
|
||||
|
||||
S = default steel ingot
|
||||
M = default mese block (power source)
|
||||
|
||||
|
||||
Spacesuit
|
||||
|
||||
WHW
|
||||
-L-
|
||||
W-W
|
||||
|
||||
W = wool white (fabric)
|
||||
H = moonrealm helmet
|
||||
L = moonrealm lifesupport
|
||||
|
||||
|
||||
Moon stone brick x 4
|
||||
|
||||
MM
|
||||
MM
|
||||
|
||||
M = moon stone
|
||||
|
||||
|
||||
Moon stone stair x 4
|
||||
|
||||
M
|
||||
MM
|
||||
|
||||
M = moon stone
|
||||
|
||||
|
||||
Moon stone slab x 4
|
||||
|
||||
MM
|
||||
|
||||
M = moon stone
|
||||
|
||||
|
||||
Default furnace
|
||||
You can cook moon dust to moonrealm glass, use mese crystal as fuel.
|
||||
|
||||
MMM
|
||||
M-M
|
||||
MMM
|
||||
|
||||
M = moon stone
|
||||
|
||||
|
||||
Airgen
|
||||
Place in the centre of a sealed habitat.
|
||||
Will only add air to a distance of 8 nodes, if the habitat interior exceeds this
|
||||
volume vacuum will remain which will then gradually spread and replace the air.
|
||||
|
||||
SIS
|
||||
IMI
|
||||
SIS
|
||||
|
||||
S = default steel ingot
|
||||
I = moonrealm waterice
|
||||
M = default mese block (power source)
|
||||
|
||||
|
||||
Airlock with light source
|
||||
Walk through it, life support air cannot pass through.
|
||||
|
||||
S-S
|
||||
SMS
|
||||
S-S
|
||||
|
||||
S = default steel ingot
|
||||
M = default mese block (power source)
|
||||
|
||||
|
||||
Light x 8
|
||||
|
||||
GGG
|
||||
GMG
|
||||
GGG
|
||||
|
||||
G = moonrealm glass
|
||||
M = default mese block (power source)
|
||||
|
||||
|
||||
Light x 1
|
||||
|
||||
G+C
|
||||
|
||||
shapeless crafting
|
||||
G = moonrealm glass
|
||||
C = default mese crystal (power source)
|
||||
|
||||
|
||||
Default water source
|
||||
Ice spawns in dust at mid to low altitudes
|
||||
|
||||
I
|
||||
|
||||
I = moonrealm waterice
|
||||
|
||||
|
||||
Hydroponic liquid source
|
||||
Hydroponic liquid will saturate the 5x5 node area of dust around it,
|
||||
changing it to moonrealm soil. For growth a moonrealm sapling requires
|
||||
moonrealm soil and 5x5x5 nodes of moonrealm air around it.
|
||||
|
||||
LLL
|
||||
LIL
|
||||
LLL
|
||||
|
||||
L = moonrealm appleleaf
|
||||
I = moonrealm waterice
|
||||
|
83
crafting.lua
83
crafting.lua
@ -3,21 +3,27 @@
|
||||
minetest.register_craft({
|
||||
output = "moonrealm:airlock",
|
||||
recipe = {
|
||||
{"default:steel_ingot", "", "default:steel_ingot"},
|
||||
{"default:steel_ingot", "default:mese", "default:steel_ingot"},
|
||||
{"default:steel_ingot", "", "default:steel_ingot"},
|
||||
{"default:steel_ingot", "default:mese_crystal", "default:steel_ingot"},
|
||||
{"default:steel_ingot", "moonrealm:glass", "default:steel_ingot"},
|
||||
{"default:steel_ingot", "moonrealm:air_cylinder", "default:steel_ingot"},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "moonrealm:airgen",
|
||||
recipe = {
|
||||
{"default:steel_ingot", "moonrealm:waterice", "default:steel_ingot"},
|
||||
{"moonrealm:waterice", "default:mese", "moonrealm:waterice"},
|
||||
{"default:steel_ingot", "moonrealm:waterice", "default:steel_ingot"},
|
||||
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
|
||||
{"", "moonrealm:air_cylinder", ""},
|
||||
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "moonrealm:airgen",
|
||||
recipe = {"moonrealm:airgen_empty", "moonrealm:air_cylinder"},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:water_source",
|
||||
recipe = {
|
||||
@ -42,15 +48,6 @@ minetest.register_craft({
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:furnace",
|
||||
recipe = {
|
||||
{"moonrealm:stone", "moonrealm:stone", "moonrealm:stone"},
|
||||
{"moonrealm:stone", "", "moonrealm:stone"},
|
||||
{"moonrealm:stone", "moonrealm:stone", "moonrealm:stone"},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "moonrealm:stoneslab 4",
|
||||
recipe = {
|
||||
@ -66,33 +63,6 @@ minetest.register_craft({
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "moonrealm:helmet",
|
||||
recipe = {
|
||||
{"default:mese_crystal"},
|
||||
{"default:glass"},
|
||||
{"default:steel_ingot"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "moonrealm:lifesupport",
|
||||
recipe = {
|
||||
{"default:steel_ingot","default:steel_ingot" , "default:steel_ingot"},
|
||||
{"default:steel_ingot", "", "default:steel_ingot"},
|
||||
{"default:steel_ingot", "default:mese", "default:steel_ingot"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "moonrealm:spacesuit",
|
||||
recipe = {
|
||||
{"wool:white", "moonrealm:helmet", "wool:white"},
|
||||
{"", "moonrealm:lifesupport", ""},
|
||||
{"wool:white", "", "wool:white"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "moonrealm:light 8",
|
||||
recipe = {
|
||||
@ -109,16 +79,31 @@ minetest.register_craft({
|
||||
})
|
||||
|
||||
|
||||
-- Cooking
|
||||
-- Spacesuit
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "moonrealm:glass",
|
||||
recipe = "moonrealm:dust",
|
||||
output = "moonrealm:helmet",
|
||||
recipe = {
|
||||
{"default:mese_crystal"},
|
||||
{"default:glass"},
|
||||
{"default:steel_ingot"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "default:mese_crystal",
|
||||
burntime = 50,
|
||||
output = "moonrealm:lifesupport",
|
||||
recipe = {
|
||||
{"default:steel_ingot","default:steel_ingot" , "default:steel_ingot"},
|
||||
{"default:steel_ingot", "moonrealm:air_cylinder", "default:steel_ingot"},
|
||||
{"default:steel_ingot", "default:mese_crystal", "default:steel_ingot"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "moonrealm:spacesuit",
|
||||
recipe = {
|
||||
{"wool:white", "moonrealm:helmet", "wool:white"},
|
||||
{"", "moonrealm:lifesupport", ""},
|
||||
{"wool:white", "", "wool:white"},
|
||||
}
|
||||
})
|
||||
|
98
init.lua
98
init.lua
@ -26,9 +26,9 @@ local FOOT = true -- Footprints in dust
|
||||
local np_terrain = {
|
||||
offset = 0,
|
||||
scale = 1,
|
||||
spread = {x = 512, y = 512, z = 512},
|
||||
spread = {x = 384, y = 384, z = 384},
|
||||
seed = 58588900033,
|
||||
octaves = 6,
|
||||
octaves = 5,
|
||||
persist = 0.67
|
||||
}
|
||||
|
||||
@ -37,9 +37,9 @@ local np_terrain = {
|
||||
local np_terralt = {
|
||||
offset = 0,
|
||||
scale = 1,
|
||||
spread = {x = 414, y = 414, z = 414},
|
||||
spread = {x = 311, y = 311, z = 311},
|
||||
seed = 13331930910,
|
||||
octaves = 6,
|
||||
octaves = 5,
|
||||
persist = 0.67
|
||||
}
|
||||
|
||||
@ -48,9 +48,9 @@ local np_terralt = {
|
||||
local np_smooth = {
|
||||
offset = 0,
|
||||
scale = 1,
|
||||
spread = {x = 828, y = 828, z = 828},
|
||||
spread = {x = 512, y = 512, z = 512},
|
||||
seed = 113,
|
||||
octaves = 4,
|
||||
octaves = 3,
|
||||
persist = 0.4
|
||||
}
|
||||
|
||||
@ -59,9 +59,9 @@ local np_smooth = {
|
||||
local np_fissure = {
|
||||
offset = 0,
|
||||
scale = 1,
|
||||
spread = {x = 256, y = 256, z = 256},
|
||||
spread = {x = 192, y = 192, z = 192},
|
||||
seed = 8181112,
|
||||
octaves = 5,
|
||||
octaves = 4,
|
||||
persist = 0.5
|
||||
}
|
||||
|
||||
@ -93,7 +93,7 @@ local np_gradcen = {
|
||||
local np_terblen = {
|
||||
offset = 0,
|
||||
scale = 1,
|
||||
spread = {x = 2048, y = 2048, z = 2048},
|
||||
spread = {x = 1024, y = 1024, z = 1024},
|
||||
seed = -13002,
|
||||
octaves = 3,
|
||||
persist = 0.4
|
||||
@ -109,7 +109,7 @@ dofile(minetest.get_modpath("moonrealm") .. "/functions.lua")
|
||||
|
||||
-- Set mapgen parameters
|
||||
|
||||
minetest.set_mapgen_params({mgname = "singlenode", water_level = -32000})
|
||||
minetest.set_mapgen_params({mgname = "singlenode", water_level = -31000})
|
||||
|
||||
|
||||
-- Player positions, spacesuit texture status
|
||||
@ -240,16 +240,16 @@ local nobj_terblen = nil
|
||||
local nobj_gradcen = nil
|
||||
|
||||
|
||||
-- Create noise buffers
|
||||
-- Localise noise buffers
|
||||
|
||||
local nbuf_terrain = {}
|
||||
local nbuf_terralt = {}
|
||||
local nbuf_fissure = {}
|
||||
local nbuf_fault = {}
|
||||
local nbuf_terrain
|
||||
local nbuf_terralt
|
||||
local nbuf_fissure
|
||||
local nbuf_fault
|
||||
|
||||
local nbuf_smooth = {}
|
||||
local nbuf_terblen = {}
|
||||
local nbuf_gradcen = {}
|
||||
local nbuf_smooth
|
||||
local nbuf_terblen
|
||||
local nbuf_gradcen
|
||||
|
||||
|
||||
-- On generated function
|
||||
@ -412,19 +412,20 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
||||
end
|
||||
|
||||
vm:set_data(data)
|
||||
vm:set_lighting({day=0, night=0}) -- not "nolight" because mapgen does not run in all chunks
|
||||
--vm:set_lighting({day=0, night=0})
|
||||
vm:calc_lighting()
|
||||
vm:write_to_map(data)
|
||||
|
||||
local chugent = math.ceil((os.clock() - t1) * 1000)
|
||||
print ("[moonrealm] " .. chugent .. " ms")
|
||||
print ("[moonrealm] chunk generation " .. chugent .. " ms")
|
||||
end)
|
||||
|
||||
|
||||
-- Find spawn function, dependant on chunk size of 80 nodes (TODO allow any chunksize)
|
||||
-- Find spawn function, dependant on chunk size of 80 nodes
|
||||
-- TODO allow any chunksize, search using 2D noises first
|
||||
|
||||
local function moonrealm_find_spawn()
|
||||
local PSCA = 16
|
||||
local PSCA = 8
|
||||
|
||||
local nobj_terrain = nil
|
||||
local nobj_terralt = nil
|
||||
@ -501,7 +502,7 @@ local function moonrealm_find_spawn()
|
||||
-- just above ground, smooth terrain, away from faults
|
||||
elseif stable[si] and density < 0 and terblen == 1 and
|
||||
math.abs(nvals_fault[ni3d]) > 0.25 then
|
||||
return {x = x, y = y + 3, z = z}
|
||||
return {x = x, y = y, z = z}
|
||||
end
|
||||
|
||||
ni3d = ni3d + 1
|
||||
@ -521,10 +522,8 @@ end
|
||||
|
||||
minetest.register_on_newplayer(function(player)
|
||||
local spawn_pos = moonrealm_find_spawn()
|
||||
local xsp = spawn_pos.x
|
||||
local ysp = spawn_pos.y
|
||||
local zsp = spawn_pos.z
|
||||
print ("[moonrealm] spawn player (" .. xsp .. " " .. ysp .. " " .. zsp .. ")")
|
||||
print ("[moonrealm] spawn new player (" .. spawn_pos.x .. " " ..
|
||||
spawn_pos.y .. " " .. spawn_pos.z .. ")")
|
||||
player:setpos(spawn_pos)
|
||||
|
||||
local inv = player:get_inventory()
|
||||
@ -532,53 +531,16 @@ minetest.register_on_newplayer(function(player)
|
||||
inv:add_item("main", "default:shovel_diamond 4")
|
||||
inv:add_item("main", "default:axe_diamond 4")
|
||||
inv:add_item("main", "default:apple 64")
|
||||
inv:add_item("main", "moonrealm:photovoltaic 16")
|
||||
inv:add_item("main", "moonrealm:light 4")
|
||||
inv:add_item("main", "moonrealm:glass 4")
|
||||
inv:add_item("main", "moonrealm:photovoltaic 256")
|
||||
inv:add_item("main", "moonrealm:light 16")
|
||||
inv:add_item("main", "moonrealm:glass 16")
|
||||
inv:add_item("main", "moonrealm:storage 4")
|
||||
inv:add_item("main", "moonrealm:airlock 4")
|
||||
inv:add_item("main", "moonrealm:airgen 4")
|
||||
inv:add_item("main", "moonrealm:air_cylinder 4")
|
||||
inv:add_item("main", "moonrealm:hlsource 4")
|
||||
inv:add_item("main", "moonrealm:sapling 4")
|
||||
inv:add_item("main", "moonrealm:spacesuit 4")
|
||||
|
||||
-- create spawn egg
|
||||
local vm = minetest.get_voxel_manip()
|
||||
local pos1 = {x = xsp - 3, y = ysp - 3, z = zsp - 3}
|
||||
local pos2 = {x = xsp + 3, y = ysp + 6, z = zsp + 3}
|
||||
local emin, emax = vm:read_from_map(pos1, pos2)
|
||||
local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax})
|
||||
local data = vm:get_data()
|
||||
local c_shell = minetest.get_content_id("moonrealm:shell")
|
||||
local c_light = minetest.get_content_id("moonrealm:light")
|
||||
local c_lsair = minetest.get_content_id("moonrealm:air")
|
||||
|
||||
for i = -3, 3 do
|
||||
for j = -3, 6 do
|
||||
for k = -3, 3 do
|
||||
local vi = area:index(xsp + i, ysp + j, zsp + k)
|
||||
local rad
|
||||
if j <= 0 then
|
||||
rad = math.sqrt(i ^ 2 + j ^ 2 + k ^ 2)
|
||||
else
|
||||
rad = math.sqrt(i ^ 2 + j ^ 2 * 0.3 + k ^ 2)
|
||||
end
|
||||
if rad <= 3.5 then
|
||||
if rad >= 2.5 then
|
||||
data[vi] = c_shell
|
||||
elseif rad >= 1.5 then
|
||||
data[vi] = c_light
|
||||
else
|
||||
data[vi] = c_lsair
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
vm:set_data(data)
|
||||
vm:write_to_map()
|
||||
vm:update_map()
|
||||
end)
|
||||
|
||||
|
||||
|
33
nodes.lua
33
nodes.lua
@ -231,7 +231,8 @@ minetest.register_node("moonrealm:hlflowing", {
|
||||
liquid_alternative_source = "moonrealm:hlsource",
|
||||
liquid_viscosity = 1,
|
||||
post_effect_color = {a = 224, r = 115, g = 55, b = 24},
|
||||
groups = {water = 3, liquid = 3, puts_out_fire = 1},
|
||||
groups = {water = 3, liquid = 3, puts_out_fire = 1,
|
||||
not_in_creative_inventory = 1},
|
||||
})
|
||||
|
||||
minetest.register_node("moonrealm:hlsource", {
|
||||
@ -287,7 +288,6 @@ minetest.register_node("moonrealm:glass", {
|
||||
minetest.register_node("moonrealm:sapling", {
|
||||
description = "Sapling",
|
||||
drawtype = "plantlike",
|
||||
visual_scale = 1.0,
|
||||
tiles = {"default_sapling.png"},
|
||||
inventory_image = "default_sapling.png",
|
||||
wield_image = "default_sapling.png",
|
||||
@ -384,25 +384,35 @@ minetest.register_node("moonrealm:stonestair", {
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("moonrealm:shell", {
|
||||
description = "Spawn Shell",
|
||||
tiles = {"moonrealm_shell.png"},
|
||||
is_ground_content = false,
|
||||
groups = {dig_immediate = 3},
|
||||
drop = "",
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("moonrealm:photovoltaic", {
|
||||
description = "Photovoltaic Panel",
|
||||
tiles = {"moonrealm_photovoltaic_top.png",
|
||||
"moonrealm_photovoltaic_base.png",
|
||||
"moonrealm_photovoltaic_side.png"},
|
||||
paramtype = "light",
|
||||
is_ground_content = false,
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.0, 0.5},
|
||||
},
|
||||
},
|
||||
groups = {dig_immediate = 3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("moonrealm:air_cylinder", {
|
||||
description = "Air Cylinder",
|
||||
drawtype = "plantlike",
|
||||
tiles = {"moonrealm_air_cylinder.png"},
|
||||
paramtype = "light",
|
||||
is_ground_content = false,
|
||||
groups = {dig_immediate = 3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
|
||||
-- Storage
|
||||
|
||||
local chest_formspec =
|
||||
@ -468,6 +478,7 @@ minetest.register_node("moonrealm:storage", {
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
-- Items
|
||||
|
||||
minetest.register_craftitem("moonrealm:spacesuit", {
|
||||
|
BIN
textures/moonrealm_air_cylinder.png
Normal file
BIN
textures/moonrealm_air_cylinder.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 261 B |
Binary file not shown.
Before Width: | Height: | Size: 203 B After Width: | Height: | Size: 195 B |
Binary file not shown.
Before Width: | Height: | Size: 145 B After Width: | Height: | Size: 134 B |
Binary file not shown.
Before Width: | Height: | Size: 136 B |
Loading…
x
Reference in New Issue
Block a user