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
|
||||
Depends default
|
||||
Licenses: code WTFPL, textures CC BY-SA
|
||||
|
||||
Preparation crafting
|
||||
--------------------
|
||||
Crafting
|
||||
--------
|
||||
|
||||
Spacesuit.
|
||||
To avoid drowning in the vacuum nodes put a spacesuit in your inventory.
|
||||
@ -33,15 +33,13 @@ H = moonrealm helmet
|
||||
L = moonrealm lifesupport
|
||||
|
||||
|
||||
|
||||
Moonrealm sapling.
|
||||
-C-
|
||||
-S-
|
||||
C = default mese crystal
|
||||
S = sapling
|
||||
|
||||
Moonrealm crafting
|
||||
------------------
|
||||
|
||||
Moon stone brick x 4.
|
||||
MM
|
||||
MM
|
||||
|
@ -182,15 +182,18 @@ if SINGLENODE then
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
minetest.setting_set("enable_clouds", "false")
|
||||
minetest.set_timeofday(0.5)
|
||||
minetest.setting_set("time_speed", 0)
|
||||
end)
|
||||
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
minetest.setting_set("enable_clouds", "true")
|
||||
minetest.setting_set("time_speed", 72)
|
||||
end)
|
||||
|
||||
-- Spawn player
|
||||
|
||||
function spawnplayer(player)
|
||||
function moonrealm_spawnplayer(player)
|
||||
local GRADCEN = 1 -- -- Gradient centre / terrain centre average level
|
||||
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
|
||||
@ -322,7 +325,14 @@ 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")
|
||||
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 pos1 = {x=xsp-3, y=ysp-3, 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 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
|
||||
@ -339,11 +350,13 @@ if SINGLENODE then
|
||||
if j <= 0 then
|
||||
rad = math.sqrt(i ^ 2 + j ^ 2 + k ^ 2)
|
||||
else
|
||||
rad = math.sqrt(i ^ 2 + j ^ 2 * 0.33 + k ^ 2)
|
||||
rad = math.sqrt(i ^ 2 + j ^ 2 * 0.3 + k ^ 2)
|
||||
end
|
||||
if rad <= 3.5 then
|
||||
if rad >= 2 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
|
||||
@ -357,11 +370,11 @@ if SINGLENODE then
|
||||
end
|
||||
|
||||
minetest.register_on_newplayer(function(player)
|
||||
spawnplayer(player)
|
||||
moonrealm_spawnplayer(player)
|
||||
end)
|
||||
|
||||
minetest.register_on_respawnplayer(function(player)
|
||||
spawnplayer(player)
|
||||
moonrealm_spawnplayer(player)
|
||||
return true
|
||||
end)
|
||||
end
|
28
init.lua
28
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
|
||||
-- Depends default
|
||||
-- Licenses: code WTFPL, textures CC BY-SA
|
||||
|
||||
-- singlenode mode:
|
||||
-- disable clouds
|
||||
-- spawn egg with provided spacesuit
|
||||
-- non falling dust nodes
|
||||
|
||||
-- TODO
|
||||
-- LVM sapligs
|
||||
-- give more stuff at spawn
|
||||
-- terrain will not overwrite egg
|
||||
-- lights as yolk
|
||||
|
||||
-- Parameters
|
||||
|
||||
@ -243,7 +239,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
||||
local icecha = ICECHA * (1 + (GRADCEN - y) / ICEGRAD)
|
||||
for x = x0, x1 do -- for each node
|
||||
local nodid = data[vi]
|
||||
local air = nodid == c_air
|
||||
local empty = (nodid == c_air or nodid == c_ignore)
|
||||
local grad
|
||||
local density
|
||||
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)
|
||||
- nvals_smooth[ni] * terblen + grad
|
||||
end
|
||||
if density > 0 then -- if terrain
|
||||
if density > 0 and empty then -- if terrain and node empty
|
||||
local nofis = false
|
||||
if math.abs(nvals_fissure[ni]) > FISTS + math.sqrt(density) * FISEXP then
|
||||
nofis = true
|
||||
@ -292,19 +288,15 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
||||
data[vi] = c_dust
|
||||
end
|
||||
else -- fissure
|
||||
if air then
|
||||
data[vi] = c_vacuum
|
||||
end
|
||||
data[vi] = c_vacuum
|
||||
stable[si] = false
|
||||
end
|
||||
else -- fissure or unstable missing node
|
||||
if air then
|
||||
data[vi] = c_vacuum
|
||||
end
|
||||
data[vi] = c_vacuum
|
||||
stable[si] = false
|
||||
end
|
||||
else -- vacuum
|
||||
if air then
|
||||
else -- vacuum or spawn egg
|
||||
if empty then
|
||||
data[vi] = c_vacuum
|
||||
end
|
||||
stable[si] = false
|
||||
|
@ -322,7 +322,6 @@ minetest.register_node("moonrealm:stonestair", {
|
||||
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(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user