Give more stuff at spawn. Terrain will not overwrite egg. Lights as yolk
This commit is contained in:
parent
73cd059b74
commit
841225aaa1
10
README.txt
10
README.txt
@ -1,10 +1,10 @@
|
|||||||
moonrealm 0.7.0 by paramat
|
moonrealm 0.7.1 by paramat
|
||||||
For latest stable Minetest and back to 0.4.8
|
For latest stable Minetest and back to 0.4.8
|
||||||
Depends default
|
Depends default
|
||||||
Licenses: code WTFPL, textures CC BY-SA
|
Licenses: code WTFPL, textures CC BY-SA
|
||||||
|
|
||||||
Preparation crafting
|
Crafting
|
||||||
--------------------
|
--------
|
||||||
|
|
||||||
Spacesuit.
|
Spacesuit.
|
||||||
To avoid drowning in the vacuum nodes put a spacesuit in your inventory.
|
To avoid drowning in the vacuum nodes put a spacesuit in your inventory.
|
||||||
@ -33,15 +33,13 @@ H = moonrealm helmet
|
|||||||
L = moonrealm lifesupport
|
L = moonrealm lifesupport
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Moonrealm sapling.
|
Moonrealm sapling.
|
||||||
-C-
|
-C-
|
||||||
-S-
|
-S-
|
||||||
C = default mese crystal
|
C = default mese crystal
|
||||||
S = sapling
|
S = sapling
|
||||||
|
|
||||||
Moonrealm crafting
|
|
||||||
------------------
|
|
||||||
|
|
||||||
Moon stone brick x 4.
|
Moon stone brick x 4.
|
||||||
MM
|
MM
|
||||||
MM
|
MM
|
||||||
|
@ -182,15 +182,18 @@ if SINGLENODE then
|
|||||||
|
|
||||||
minetest.register_on_joinplayer(function(player)
|
minetest.register_on_joinplayer(function(player)
|
||||||
minetest.setting_set("enable_clouds", "false")
|
minetest.setting_set("enable_clouds", "false")
|
||||||
|
minetest.set_timeofday(0.5)
|
||||||
|
minetest.setting_set("time_speed", 0)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.register_on_leaveplayer(function(player)
|
minetest.register_on_leaveplayer(function(player)
|
||||||
minetest.setting_set("enable_clouds", "true")
|
minetest.setting_set("enable_clouds", "true")
|
||||||
|
minetest.setting_set("time_speed", 72)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Spawn player
|
-- Spawn player
|
||||||
|
|
||||||
function spawnplayer(player)
|
function moonrealm_spawnplayer(player)
|
||||||
local GRADCEN = 1 -- -- Gradient centre / terrain centre average level
|
local GRADCEN = 1 -- -- Gradient centre / terrain centre average level
|
||||||
local CENAMP = 64 -- -- Grad centre amplitude, terrain centre is varied by this
|
local CENAMP = 64 -- -- Grad centre amplitude, terrain centre is varied by this
|
||||||
local HIGRAD = 128 -- -- Surface generating noise gradient above gradcen, controls depth of upper terrain
|
local HIGRAD = 128 -- -- Surface generating noise gradient above gradcen, controls depth of upper terrain
|
||||||
@ -322,7 +325,14 @@ if SINGLENODE then
|
|||||||
end
|
end
|
||||||
print ("[moonrealm] spawn player ("..xsp.." "..ysp.." "..zsp..")")
|
print ("[moonrealm] spawn player ("..xsp.." "..ysp.." "..zsp..")")
|
||||||
player:setpos({x=xsp, y=ysp, z=zsp})
|
player:setpos({x=xsp, y=ysp, z=zsp})
|
||||||
minetest.add_item({x=xsp, y=ysp, z=zsp}, "moonrealm:spacesuit")
|
minetest.add_item({x=xsp, y=ysp+1, z=zsp}, "moonrealm:spacesuit")
|
||||||
|
minetest.add_item({x=xsp, y=ysp+1, z=zsp}, "moonrealm:sapling")
|
||||||
|
minetest.add_item({x=xsp, y=ysp+1, z=zsp}, "moonrealm:airlock 2")
|
||||||
|
minetest.add_item({x=xsp, y=ysp+1, z=zsp}, "moonrealm:airgen")
|
||||||
|
minetest.add_item({x=xsp, y=ysp+1, z=zsp}, "default:apple 64")
|
||||||
|
minetest.add_item({x=xsp, y=ysp+1, z=zsp}, "default:pick_diamond")
|
||||||
|
minetest.add_item({x=xsp, y=ysp+1, z=zsp}, "default:axe_diamond")
|
||||||
|
minetest.add_item({x=xsp, y=ysp+1, z=zsp}, "default:shovel_diamond")
|
||||||
local vm = minetest.get_voxel_manip()
|
local vm = minetest.get_voxel_manip()
|
||||||
local pos1 = {x=xsp-3, y=ysp-3, z=zsp-3}
|
local pos1 = {x=xsp-3, y=ysp-3, z=zsp-3}
|
||||||
local pos2 = {x=xsp+3, y=ysp+6, z=zsp+3}
|
local pos2 = {x=xsp+3, y=ysp+6, z=zsp+3}
|
||||||
@ -330,6 +340,7 @@ if SINGLENODE then
|
|||||||
local area = VoxelArea:new({MinEdge=emin, MaxEdge=emax})
|
local area = VoxelArea:new({MinEdge=emin, MaxEdge=emax})
|
||||||
local data = vm:get_data()
|
local data = vm:get_data()
|
||||||
local c_shell = minetest.get_content_id("moonrealm:shell")
|
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")
|
local c_lsair = minetest.get_content_id("moonrealm:air")
|
||||||
for i = -3, 3 do
|
for i = -3, 3 do
|
||||||
for j = -3, 6 do
|
for j = -3, 6 do
|
||||||
@ -339,11 +350,13 @@ if SINGLENODE then
|
|||||||
if j <= 0 then
|
if j <= 0 then
|
||||||
rad = math.sqrt(i ^ 2 + j ^ 2 + k ^ 2)
|
rad = math.sqrt(i ^ 2 + j ^ 2 + k ^ 2)
|
||||||
else
|
else
|
||||||
rad = math.sqrt(i ^ 2 + j ^ 2 * 0.33 + k ^ 2)
|
rad = math.sqrt(i ^ 2 + j ^ 2 * 0.3 + k ^ 2)
|
||||||
end
|
end
|
||||||
if rad <= 3.5 then
|
if rad <= 3.5 then
|
||||||
if rad >= 2 then
|
if rad >= 2.5 then
|
||||||
data[vi] = c_shell
|
data[vi] = c_shell
|
||||||
|
elseif rad >= 1.5 then
|
||||||
|
data[vi] = c_light
|
||||||
else
|
else
|
||||||
data[vi] = c_lsair
|
data[vi] = c_lsair
|
||||||
end
|
end
|
||||||
@ -357,11 +370,11 @@ if SINGLENODE then
|
|||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_on_newplayer(function(player)
|
minetest.register_on_newplayer(function(player)
|
||||||
spawnplayer(player)
|
moonrealm_spawnplayer(player)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.register_on_respawnplayer(function(player)
|
minetest.register_on_respawnplayer(function(player)
|
||||||
spawnplayer(player)
|
moonrealm_spawnplayer(player)
|
||||||
return true
|
return true
|
||||||
end)
|
end)
|
||||||
end
|
end
|
24
init.lua
24
init.lua
@ -1,15 +1,11 @@
|
|||||||
-- moonrealm 0.7.0 by paramat
|
-- moonrealm 0.7.1 by paramat
|
||||||
-- For latest stable Minetest and back to 0.4.8
|
-- For latest stable Minetest and back to 0.4.8
|
||||||
-- Depends default
|
-- Depends default
|
||||||
-- Licenses: code WTFPL, textures CC BY-SA
|
-- Licenses: code WTFPL, textures CC BY-SA
|
||||||
|
|
||||||
-- singlenode mode:
|
-- give more stuff at spawn
|
||||||
-- disable clouds
|
-- terrain will not overwrite egg
|
||||||
-- spawn egg with provided spacesuit
|
-- lights as yolk
|
||||||
-- non falling dust nodes
|
|
||||||
|
|
||||||
-- TODO
|
|
||||||
-- LVM sapligs
|
|
||||||
|
|
||||||
-- Parameters
|
-- Parameters
|
||||||
|
|
||||||
@ -243,7 +239,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
local icecha = ICECHA * (1 + (GRADCEN - y) / ICEGRAD)
|
local icecha = ICECHA * (1 + (GRADCEN - y) / ICEGRAD)
|
||||||
for x = x0, x1 do -- for each node
|
for x = x0, x1 do -- for each node
|
||||||
local nodid = data[vi]
|
local nodid = data[vi]
|
||||||
local air = nodid == c_air
|
local empty = (nodid == c_air or nodid == c_ignore)
|
||||||
local grad
|
local grad
|
||||||
local density
|
local density
|
||||||
local si = x - x0 + 1 -- indexes start from 1
|
local si = x - x0 + 1 -- indexes start from 1
|
||||||
@ -261,7 +257,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
density = (nvals_terrain[ni] - nvals_terralt[ni]) / 2 * (1 - terblen)
|
density = (nvals_terrain[ni] - nvals_terralt[ni]) / 2 * (1 - terblen)
|
||||||
- nvals_smooth[ni] * terblen + grad
|
- nvals_smooth[ni] * terblen + grad
|
||||||
end
|
end
|
||||||
if density > 0 then -- if terrain
|
if density > 0 and empty then -- if terrain and node empty
|
||||||
local nofis = false
|
local nofis = false
|
||||||
if math.abs(nvals_fissure[ni]) > FISTS + math.sqrt(density) * FISEXP then
|
if math.abs(nvals_fissure[ni]) > FISTS + math.sqrt(density) * FISEXP then
|
||||||
nofis = true
|
nofis = true
|
||||||
@ -292,19 +288,15 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
data[vi] = c_dust
|
data[vi] = c_dust
|
||||||
end
|
end
|
||||||
else -- fissure
|
else -- fissure
|
||||||
if air then
|
|
||||||
data[vi] = c_vacuum
|
data[vi] = c_vacuum
|
||||||
end
|
|
||||||
stable[si] = false
|
stable[si] = false
|
||||||
end
|
end
|
||||||
else -- fissure or unstable missing node
|
else -- fissure or unstable missing node
|
||||||
if air then
|
|
||||||
data[vi] = c_vacuum
|
data[vi] = c_vacuum
|
||||||
end
|
|
||||||
stable[si] = false
|
stable[si] = false
|
||||||
end
|
end
|
||||||
else -- vacuum
|
else -- vacuum or spawn egg
|
||||||
if air then
|
if empty then
|
||||||
data[vi] = c_vacuum
|
data[vi] = c_vacuum
|
||||||
end
|
end
|
||||||
stable[si] = false
|
stable[si] = false
|
||||||
|
@ -322,7 +322,6 @@ minetest.register_node("moonrealm:stonestair", {
|
|||||||
minetest.register_node("moonrealm:shell", {
|
minetest.register_node("moonrealm:shell", {
|
||||||
description = "Spawn Shell",
|
description = "Spawn Shell",
|
||||||
tiles = {"moonrealm_shell.png"},
|
tiles = {"moonrealm_shell.png"},
|
||||||
light_source = 3,
|
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
groups = {choppy=2,oddly_breakable_by_hand=1},
|
groups = {choppy=2,oddly_breakable_by_hand=1},
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user