Singlenode mode. Disable clouds. Spawn egg with spacesuit. No falling nodes

master
paramat 2014-05-27 00:50:39 +01:00
parent 19e2d52709
commit 73cd059b74
5 changed files with 57 additions and 23 deletions

View File

@ -1,4 +1,4 @@
moonrealm 0.6.6 by paramat
moonrealm 0.7.0 by paramat
For latest stable Minetest and back to 0.4.8
Depends default
Licenses: code WTFPL, textures CC BY-SA

View File

@ -179,6 +179,14 @@ if SINGLENODE then
minetest.register_on_mapgen_init(function(mgparams)
minetest.set_mapgen_params({mgname="singlenode", water_level=-33000})
end)
minetest.register_on_joinplayer(function(player)
minetest.setting_set("enable_clouds", "false")
end)
minetest.register_on_leaveplayer(function(player)
minetest.setting_set("enable_clouds", "true")
end)
-- Spawn player
@ -190,7 +198,7 @@ if SINGLENODE then
local HEXP = 0.5 -- -- Noise offset exponent above gradcen, 1 = normal 3D perlin terrain
local LEXP = 2 -- -- Noise offset exponent below gradcen
local STOT = 0.04 -- -- Stone density threshold, depth of dust
local PSCA = 4 -- Player scatter from world centre in chunks (80 nodes).
local PSCA = 16 -- Player scatter from world centre in chunks (80 nodes).
local xsp
local ysp
local zsp
@ -289,8 +297,8 @@ if SINGLENODE then
end
if density >= STOT then
stable[si] = true
elseif stable[si] and density < 0 then
ysp = y + 8
elseif stable[si] and density < 0 and terblen == 1 then
ysp = y + 4
xsp = x
zsp = z
break
@ -314,22 +322,31 @@ if SINGLENODE then
end
print ("[moonrealm] spawn player ("..xsp.." "..ysp.." "..zsp..")")
player:setpos({x=xsp, y=ysp, z=zsp})
minetest.add_item({x=xsp, y=ysp, z=zsp}, "moonrealm:spacesuit")
local vm = minetest.get_voxel_manip()
local pos1 = {x=xsp-2, y=ysp-2, z=zsp-2}
local pos2 = {x=xsp+2, y=ysp+2, z=zsp+2}
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_glass = minetest.get_content_id("default:glass")
local c_shell = minetest.get_content_id("moonrealm:shell")
local c_lsair = minetest.get_content_id("moonrealm:air")
for i = -2, 2 do
for j = -2, 2 do
for k = -2, 2 do
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)
if i ^ 2 + j ^ 2 + k ^ 2 >= 4 then
data[vi] = c_glass
local rad
if j <= 0 then
rad = math.sqrt(i ^ 2 + j ^ 2 + k ^ 2)
else
data[vi] = c_lsair
rad = math.sqrt(i ^ 2 + j ^ 2 * 0.33 + k ^ 2)
end
if rad <= 3.5 then
if rad >= 2 then
data[vi] = c_shell
else
data[vi] = c_lsair
end
end
end
end

View File

@ -1,9 +1,15 @@
-- moonrealm 0.6.6 by paramat
-- moonrealm 0.7.0 by paramat
-- For latest stable Minetest and back to 0.4.8
-- Depends default
-- Licenses: code WTFPL, textures CC BY-SA
-- singlenode mode with spawn chamber
-- singlenode mode:
-- disable clouds
-- spawn egg with provided spacesuit
-- non falling dust nodes
-- TODO
-- LVM sapligs
-- Parameters
@ -249,9 +255,11 @@ minetest.register_on_generated(function(minp, maxp, seed)
grad = ((gradcen - y) / LOGRAD) ^ LEXP
end
if nvals_fault[ni] >= 0 then
density = (nvals_terrain[ni] + nvals_terralt[ni]) / 2 * (1 - terblen) + nvals_smooth[ni] * terblen + grad
density = (nvals_terrain[ni] + nvals_terralt[ni]) / 2 * (1 - terblen)
+ nvals_smooth[ni] * terblen + grad
else
density = (nvals_terrain[ni] - nvals_terralt[ni]) / 2 * (1 - terblen) - nvals_smooth[ni] * terblen + grad
density = (nvals_terrain[ni] - nvals_terralt[ni]) / 2 * (1 - terblen)
- nvals_smooth[ni] * terblen + grad
end
if density > 0 then -- if terrain
local nofis = false

View File

@ -46,9 +46,9 @@ minetest.register_node("moonrealm:dust", {
description = "Moon Dust",
tiles = {"moonrealm_dust.png"},
is_ground_content = false,
groups = {crumbly=3, falling_node=1},
groups = {crumbly=3},
sounds = default.node_sound_sand_defaults({
footstep = {name="default_sand_footstep", gain=0.1},
footstep = {name="default_sand_footstep", gain=0.05},
}),
})
@ -56,10 +56,10 @@ minetest.register_node("moonrealm:dustprint1", {
description = "Moon Dust Footprint1",
tiles = {"moonrealm_dustprint1.png", "moonrealm_dust.png"},
is_ground_content = false,
groups = {crumbly=3, falling_node=1},
groups = {crumbly=3},
drop = "moonrealm:dust",
sounds = default.node_sound_sand_defaults({
footstep = {name="default_sand_footstep", gain=0.1},
footstep = {name="default_sand_footstep", gain=0.05},
}),
})
@ -67,10 +67,10 @@ minetest.register_node("moonrealm:dustprint2", {
description = "Moon Dust Footprint2",
tiles = {"moonrealm_dustprint2.png", "moonrealm_dust.png"},
is_ground_content = false,
groups = {crumbly=3, falling_node=1},
groups = {crumbly=3},
drop = "moonrealm:dust",
sounds = default.node_sound_sand_defaults({
footstep = {name="default_sand_footstep", gain=0.1},
footstep = {name="default_sand_footstep", gain=0.05},
}),
})
@ -319,6 +319,15 @@ minetest.register_node("moonrealm:stonestair", {
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("moonrealm:shell", {
description = "Spawn Shell",
tiles = {"moonrealm_shell.png"},
light_source = 3,
is_ground_content = false,
groups = {choppy=2,oddly_breakable_by_hand=1},
sounds = default.node_sound_stone_defaults(),
})
-- Items
minetest.register_craftitem("moonrealm:spacesuit", {

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 B