Version 4.0 Release

Heaven biomes fully implemented!  Stairs is now a dependency, adding a
handful of new stair nodes.  Pools of healing spring water can now be
found in the heaven biome, and pregenerated buildings appear as well.
This commit is contained in:
Chris N 2014-07-26 13:53:25 -10:00
parent 43b409341a
commit 7af3e34b50
18 changed files with 326 additions and 25 deletions

108
abms.lua
View File

@ -86,3 +86,111 @@ minetest.register_abm({
minetest.remove_node(pos)
end,
})
--grab schematics
local parthenon = minetest.get_modpath("skylands").."/schems/parthenon.mts"
local pillar = minetest.get_modpath("skylands").."/schems/pillar.mts"
--place pillars in heaven
minetest.register_abm({
nodenames = {"skylands:s_pillar"},
interval = 1.0,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
minetest.place_schematic(pos, pillar, 0, {}, true)
end,
})
--place parthenons in heaven
minetest.register_abm({
nodenames = {"skylands:s_parthenon"},
interval = 1.0,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
npos = {x=pos.x,y=pos.y-7,z=pos.z}
minetest.place_schematic(npos, parthenon, "random", {}, true)
end,
})
--healing effect of springs
minetest.register_abm({
nodenames = {"skylands:spring", "skylands:spring_flowing"},
interval = 10.0,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local all_objects = minetest.get_objects_inside_radius(pos, 1)
local _,obj
for _,obj in ipairs(all_objects) do
if obj:is_player() then
if obj:get_hp() < 20 then
obj:set_hp(obj:get_hp() + 4)
end
end
end
end,
})
--heaven grass to and from rich_dirt
minetest.register_abm({
nodenames = {"skylands:rich_dirt"},
interval = 2,
chance = 200,
action = function(pos, node)
local above = {x=pos.x, y=pos.y+1, z=pos.z}
local name = minetest.get_node(above).name
local nodedef = minetest.registered_nodes[name]
if nodedef and (nodedef.sunlight_propagates or nodedef.paramtype == "light")
and nodedef.liquidtype == "none"
and (minetest.get_node_light(above) or 0) >= 13 then
minetest.set_node(pos, {name = "skylands:heaven_grass"})
end
end
})
minetest.register_abm({
nodenames = {"skylands:heaven_grass"},
interval = 2,
chance = 20,
action = function(pos, node)
local above = {x=pos.x, y=pos.y+1, z=pos.z}
local name = minetest.get_node(above).name
local nodedef = minetest.registered_nodes[name]
if name ~= "ignore" and nodedef
and not ((nodedef.sunlight_propagates or nodedef.paramtype == "light")
and nodedef.liquidtype == "none") then
minetest.set_node(pos, {name = "skylands:rich_dirt"})
end
end
})
minetest.register_abm({
nodenames = {"skylands:drygrass"},
interval = 2,
chance = 20,
action = function(pos, node)
local above = {x=pos.x, y=pos.y+1, z=pos.z}
local name = minetest.get_node(above).name
local nodedef = minetest.registered_nodes[name]
if name ~= "ignore" and nodedef
and not ((nodedef.sunlight_propagates or nodedef.paramtype == "light")
and nodedef.liquidtype == "none") then
minetest.set_node(pos, {name = "default:dirt"})
end
end
})
minetest.register_abm({
nodenames = {"skylands:icydirt"},
interval = 2,
chance = 20,
action = function(pos, node)
local above = {x=pos.x, y=pos.y+1, z=pos.z}
local name = minetest.get_node(above).name
local nodedef = minetest.registered_nodes[name]
if name ~= "ignore" and nodedef
and not ((nodedef.sunlight_propagates or nodedef.paramtype == "light")
and nodedef.liquidtype == "none") then
minetest.set_node(pos, {name = "default:dirt"})
end
end
})

View File

@ -1,5 +1,6 @@
default
fire
stairs
mesecons?
moreblocks?
moreores?

View File

@ -130,6 +130,8 @@ function skylands:remtree(x, y, z, area, data)
local c_jtree = minetest.get_content_id("default:jungletree")
local c_jleaves = minetest.get_content_id("default:jungleleaves")
local c_vine = minetest.get_content_id("skylands:vine")
local c_gapple = minetest.get_content_id("skylands:golden_apple")
local c_gleaves = minetest.get_content_id("skylands:golden_leaves")
local c_air = minetest.get_content_id("air")
for j = 1, 23 do
for i = -2, 2 do
@ -140,7 +142,9 @@ function skylands:remtree(x, y, z, area, data)
or data[vi] == c_leaves
or data[vi] == c_jtree
or data[vi] == c_vine
or data[vi] == c_jleaves then
or data[vi] == c_jleaves
or data[vi] == c_gapple
or data[vi] == c_gleaves then
data[vi] = c_air
end
end
@ -155,7 +159,9 @@ function skylands:remtree(x, y, z, area, data)
or data[vi] == c_leaves
or data[vi] == c_jtree
or data[vi] == c_vine
or data[vi] == c_jleaves then
or data[vi] == c_jleaves
or data[vi] == c_gapple
or data[vi] == c_gleaves then
data[vi] = c_air
end
end

View File

@ -1,6 +1,6 @@
-- skylands 4.0 by HeroOfTheWinds, based on floatindev 0.2.0 by paramat
-- For latest stable Minetest and back to 0.4.8
-- Depends default, fire, moreblocks?, moreores?, mesecons?
-- Depends default, fire, stairs, moreblocks?, moreores?, mesecons?
-- License: code WTFPL
-- Parameters
@ -37,8 +37,10 @@ local JUNGCHA = 0.2 -- Junglegrass chance
local FIRCHA = 0.03 -- Fire chance
local LAKCHA = 0.002
local ORECHA = 1 / (6 * 6 * 6)
local PILCHA = 0.002
local PARCHA = 0.0001
local HEAVEN = 10000 --altitude at which "heaven" islands begin appearing
local HEAVEN = 8000 --altitude at which "heaven" islands begin appearing
local HEAVINT = 800 --interval between "heaven" layers; also determines layer width
-- 3D noise for floatlands
@ -123,6 +125,7 @@ local np_humid = {
skylands = {}
dofile(minetest.get_modpath("skylands").."/nodes.lua")
dofile(minetest.get_modpath("skylands").."/stairs.lua")
dofile(minetest.get_modpath("skylands").."/wheat.lua")
dofile(minetest.get_modpath("skylands").."/abms.lua")
dofile(minetest.get_modpath("skylands").."/functions.lua")
@ -149,8 +152,6 @@ minetest.register_on_generated(function(minp, maxp, seed)
or minp.z < ZMIN or maxp.z > ZMAX then
return
end
local chulay = math.floor((minp.y + 32) / 80) -- chunk layer number, 0 = surface chunk
local tercen = (math.floor(chulay / CHUINT) * CHUINT + CHUINT / 2) * 80 - 32 -- terrain centre of this layer
local t1 = os.clock()
local x1 = maxp.x
@ -160,6 +161,11 @@ minetest.register_on_generated(function(minp, maxp, seed)
local y0 = minp.y
local z0 = minp.z
local sidelen = (x1 - x0 + 1)
local chulay = math.floor((minp.y + 32) / sidelen) -- chunk layer number, 0 = surface chunk
local tercen = (math.floor(chulay / CHUINT) * CHUINT + CHUINT / 2) * sidelen - 32 -- terrain centre of this layer
print ("[skylands] chunk minp ("..x0.." "..y0.." "..z0..")")
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
@ -212,8 +218,10 @@ minetest.register_on_generated(function(minp, maxp, seed)
local c_stowhite = minetest.get_content_id("skylands:white_stone")
local c_richdirt = minetest.get_content_id("skylands:rich_dirt")
local c_hvngrass = minetest.get_content_id("skylands:heaven_grass")
local c_pillar = minetest.get_content_id("skylands:s_pillar")
local c_parthenon = minetest.get_content_id("skylands:s_parthenon")
local sidelen = (x1 - x0 + 1)
local chulens = {x=sidelen, y=sidelen, z=sidelen}
local minposxyz = {x=x0, y=y0, z=z0}
local minposxz = {x=x0, y=z0}
@ -302,9 +310,12 @@ minetest.register_on_generated(function(minp, maxp, seed)
end
--NOT FULLY IMPLEMENTED, UNCOMMENT ONLY IF YOU WANT A SHODDY PREVIEW!
--if y >= HEAVEN and y < HEAVEN + HEAVINT then
--biome = 12 --heaven
--end
if y >= HEAVEN then
--print((math.floor((y-HEAVEN)/1000) * 1000 / HEAVINT))
if math.fmod((math.floor((y-HEAVEN)/1000) * 1000 / HEAVINT), 2) == 0 then --can you math?
biome = 12 --heaven
end
end
if y > flomid and density < STOTHR and stable[si] >= STABLE then
if biome == 7 then
@ -500,9 +511,11 @@ minetest.register_on_generated(function(minp, maxp, seed)
end
end
--NOT FULLY IMPLEMENTED, UNCOMMENT ONLY IF YOU WANT A SHODDY PREVIEW!
--if y >= HEAVEN and y < HEAVEN + HEAVINT then
--biome = 12 --heaven
--end
if y >= HEAVEN then
if math.fmod((math.floor((y-HEAVEN)/1000) * 1000 / HEAVINT), 2) == 0 then --can you math?
biome = 12 --heaven
end
end
if nvals_biome[nixz] <= 0.65 then --not volcano
if biome == 7 or biome == 11 then --desert
@ -522,12 +535,19 @@ minetest.register_on_generated(function(minp, maxp, seed)
end
dirt[si] = 0
elseif biome == 12 then --heaven
ppos = {x=x,y=y,z=z}
lakepoints[li] = {x=x,y=y,z=z}
li = li + 1
if dirt[si] >= 2 and math.random() < (APPCHA * 0.7) then
skylands:goldentree(x, y, z, area, data)
elseif math.random() < FLOCHA then
skylands:flower(data, vi)
elseif math.random() < GRACHA then
skylands:grass(data, vi)
elseif math.random() < PILCHA then
data[vi] = c_pillar
elseif math.random() < PARCHA then
data[vi] = c_parthenon
end
dirt[si] = 0
elseif biome == 10 then --wheat field
@ -591,9 +611,9 @@ minetest.register_on_generated(function(minp, maxp, seed)
nixz = nixz + 1
vi = vi + 1
end
nixz = nixz - 80
nixz = nixz - sidelen
end
nixz = nixz + 80
nixz = nixz + sidelen
end
skylands:gen_pool(lakepoints, area, data, x0, z0, x1, z1)

View File

@ -78,7 +78,7 @@ minetest.register_craft({
--gold heaven grass for heaven biome... rich soil
minetest.register_node("skylands:heaven_grass", {
description = "Dirt with Heaven Grass",
tiles = {"skylands_heavengrass.png", "default_dirt.png", "default_dirt.png^skylands_heavengrass_side.png"},
tiles = {"skylands_heavengrass2.png", "skylands_rich_dirt.png", "skylands_rich_dirt.png^skylands_heavengrass_side2.png"},
is_ground_content = true,
groups = {crumbly=3,soil=1},
drop = 'skylands:rich_dirt',
@ -477,3 +477,84 @@ minetest.register_craft({
}
})
--hacky schematic placers
minetest.register_node("skylands:s_pillar", {
description = "A Hack like you should know what this does...",
tiles = "skylands_quartz_pillar.png",
groups = {crumbly=3, schema=1},
})
minetest.register_node("skylands:s_parthenon", {
description = "A Hack like you should know what this does...",
tiles = "skylands_quartz.png",
groups = {crumbly=3, schema=1},
})
--spring water
minetest.register_node("skylands:spring_flowing", {
description = "Flowing Spring of Healing",
inventory_image = minetest.inventorycube("skylands_spring.png"),
drawtype = "flowingliquid",
tiles = {"skylands_spring.png"},
special_tiles = {
{
image="skylands_spring_flowing_animated.png",
backface_culling=false,
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=0.8}
},
{
image="skylands_spring_flowing_animated.png",
backface_culling=true,
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=0.8}
},
},
alpha = 160,
paramtype = "light",
paramtype2 = "flowingliquid",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
drowning = 1,
liquidtype = "flowing",
liquid_alternative_flowing = "skylands:spring_flowing",
liquid_alternative_source = "skylands:spring",
liquid_viscosity = 1,
post_effect_color = {a=64, r=100, g=100, b=0},
groups = {water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1, freezes=1, melt_around=1},
})
minetest.register_node("skylands:spring", {
description = "Spring of Healing",
inventory_image = minetest.inventorycube("skylands_spring.png"),
drawtype = "liquid",
tiles = {
{name="skylands_spring_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}}
},
special_tiles = {
-- New-style water source material (mostly unused)
{
name="skylands_spring_animated.png",
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0},
backface_culling = false,
}
},
alpha = 160,
paramtype = "light",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
drowning = 1,
liquidtype = "source",
liquid_alternative_flowing = "skylands:spring_flowing",
liquid_alternative_source = "skylands:spring",
liquid_viscosity = 1,
post_effect_color = {a=64, r=100, g=100, b=0},
groups = {water=3, liquid=3, puts_out_fire=1, freezes=1},
})

View File

@ -7,16 +7,21 @@ function skylands:gen_pool(lakepoints, area, data, x0, z0, x1, z1)
local c_ignore = minetest.get_content_id("ignore")
local c_watsour = minetest.get_content_id("default:water_source")
local c_lavasour = minetest.get_content_id("default:lava_source")
local c_spring = minetest.get_content_id("skylands:spring")
local c_ice = minetest.get_content_id("default:ice")
local c_grass = minetest.get_content_id("default:dirt_with_grass")
local c_tree = minetest.get_content_id("default:tree")
local c_apple = minetest.get_content_id("default:apple")
local c_leaves = minetest.get_content_id("default:leaves")
local c_gapple = minetest.get_content_id("skylands:golden_apple")
local c_gleaves = minetest.get_content_id("skylands:golden_leaves")
local c_dirt = minetest.get_content_id("default:dirt")
local c_snow = minetest.get_content_id("default:dirt_with_snow")
local c_cinder = minetest.get_content_id("skylands:cinder")
local c_gravel = minetest.get_content_id("default:gravel")
local c_obsidian = minetest.get_content_id("skylands:obsidian")
local c_hvngrass = minetest.get_content_id("skylands:heaven_grass")
local c_rich = minetest.get_content_id("skylands:rich_dirt")
local sidelen = x1 - x0 -- actually sidelen - 1
@ -53,6 +58,9 @@ function skylands:gen_pool(lakepoints, area, data, x0, z0, x1, z1)
elseif c_node == c_obsidian then
ftype = "lava"
surf = true
elseif c_node == c_hvngrass then
ftype = "spring"
surf = true
end
--end
if surf then
@ -68,7 +76,9 @@ function skylands:gen_pool(lakepoints, area, data, x0, z0, x1, z1)
elseif c_node ~= c_air
and c_node ~= c_tree
and c_node ~= c_leaves
and c_node ~= c_apple then
and c_node ~= c_apple
and c_node ~= c_gapple
and c_node ~= c_gleaves then
--print("found x+ edge")
break
end
@ -83,7 +93,9 @@ function skylands:gen_pool(lakepoints, area, data, x0, z0, x1, z1)
elseif c_node ~= c_air
and c_node ~= c_tree
and c_node ~= c_leaves
and c_node ~= c_apple then
and c_node ~= c_apple
and c_node ~= c_gapple
and c_node ~= c_gleaves then
--print("found x-")
break
end
@ -98,7 +110,9 @@ function skylands:gen_pool(lakepoints, area, data, x0, z0, x1, z1)
elseif c_node ~= c_air
and c_node ~= c_tree
and c_node ~= c_leaves
and c_node ~= c_apple then
and c_node ~= c_apple
and c_node ~= c_gapple
and c_node ~= c_gleaves then
--print("y+ found")
break
end
@ -113,7 +127,9 @@ function skylands:gen_pool(lakepoints, area, data, x0, z0, x1, z1)
elseif c_node ~= c_air
and c_node ~= c_tree
and c_node ~= c_leaves
and c_node ~= c_apple then
and c_node ~= c_apple
and c_node ~= c_gapple
and c_node ~= c_gleaves then
--print("y- found")
break
end
@ -130,9 +146,12 @@ function skylands:gen_pool(lakepoints, area, data, x0, z0, x1, z1)
if ftype == "lava" then
c_fluid = c_lavasour
c_under = c_lavasour
elseif c_fluid == "ice" then
elseif ftype == "ice" then
c_fluid = c_ice
c_under = c_watsour
elseif ftype == "spring" then
c_fluid = c_spring
c_under = c_spring
end
local vi = area:index(xcen, yasurf, zcen)
@ -157,7 +176,9 @@ function skylands:gen_pool(lakepoints, area, data, x0, z0, x1, z1)
data[vie] = c_fluid
elseif data[vie] == c_air
or data[vie] == c_apple
or data[vie] == c_leaves then
or data[vie] == c_leaves
or data[vie] == c_gapple
or data[vie] == c_gleaves then
data[vie] = c_fluid
end
if data[viw] == c_tree then
@ -165,7 +186,9 @@ function skylands:gen_pool(lakepoints, area, data, x0, z0, x1, z1)
data[viw] = c_fluid
elseif data[viw] == c_air
or data[viw] == c_apple
or data[viw] == c_leaves then
or data[viw] == c_leaves
or data[vie] == c_gapple
or data[vie] == c_gleaves then
data[viw] = c_fluid
end
if data[vin] == c_tree then
@ -173,7 +196,9 @@ function skylands:gen_pool(lakepoints, area, data, x0, z0, x1, z1)
data[vin] = c_fluid
elseif data[vin] == c_air
or data[vin] == c_apple
or data[vin] == c_leaves then
or data[vin] == c_leaves
or data[vie] == c_gapple
or data[vie] == c_gleaves then
data[vin] = c_fluid
end
if data[vis] == c_tree then
@ -181,7 +206,9 @@ function skylands:gen_pool(lakepoints, area, data, x0, z0, x1, z1)
data[vis] = c_fluid
elseif data[vis] == c_air
or data[vis] == c_apple
or data[vis] == c_leaves then
or data[vis] == c_leaves
or data[vie] == c_gapple
or data[vie] == c_gleaves then
data[vis] = c_fluid
end
end
@ -222,6 +249,8 @@ function skylands:gen_pool(lakepoints, area, data, x0, z0, x1, z1)
elseif data[viu] == c_grass then
data[viu] = c_dirt
break
elseif data[viu] == c_hvngrass then
data[viu] = c_rich
else
break
end

BIN
schems/parthenon.mts Normal file

Binary file not shown.

BIN
schems/pillar.mts Normal file

Binary file not shown.

56
stairs.lua Normal file
View File

@ -0,0 +1,56 @@
stairs.register_stair_and_slab("acaciawood", "skylands:acaciawood",
{snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
{"skylands_acaciawood.png"},
"Acacia Wood Stairs",
"Acacia Wood Slab",
default.node_sound_wood_defaults())
stairs.register_stair_and_slab("pinewood", "skylands:pinewood",
{snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
{"skylands_pinewood.png"},
"Pine Wood Stairs",
"Pine Wood Slab",
default.node_sound_wood_defaults())
stairs.register_stair_and_slab("cinder_block", "skylands:cinder_block",
{cracky=3, crumbly=1},
{"skylands_cinder_block.png"},
"Cinder Block Stairs",
"Cinder Block Slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("white_stone", "skylands:white_stone",
{cracky=3},
{"skylands_white_stone.png"},
"White Stone Stairs",
"White Stone Slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("white_cobble", "skylands:white_cobble",
{cracky=3},
{"skylands_white_cobble.png"},
"White Cobble Stairs",
"White Cobble Slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("white_stone_brick", "skylands:white_stone_brick",
{cracky=2},
{"skylands_white_stone_brick.png"},
"White Stone Brick Stairs",
"White Stone Brick Slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("quartz", "skylands:quartz",
{cracky=2},
{"skylands_quartz.png"},
"Quartz Stairs",
"Quartz Slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("quartz_pillar", "skylands:quartz_pillar",
{cracky=2},
{"skylands_quartz.png", "skylands_quartz.png", "skylands_quartz_pillar.png"},
"Quartz Pillar Stairs",
"Quartz Pillar Slab",
default.node_sound_stone_defaults())

BIN
textures/default_water.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 353 B

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 683 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB