Turquoise freshwater. Magma rising under ridges. Lavacooling

This commit is contained in:
paramat 2014-03-31 09:33:38 +01:00
parent 1049f85e88
commit db9094fbe8
6 changed files with 54 additions and 13 deletions

View File

@ -226,3 +226,27 @@ minetest.register_craft({
burntime = 60,
replacements = {{"watershed:bucket_lava", "bucket:bucket_empty"}},
})
-- ABM
minetest.register_abm({
nodenames = {"watershed:lavaflow"},
neighbors = {"group:water"},
interval = 1,
chance = 11,
action = function(pos, node, active_object_count, active_object_count_wider)
minetest.set_node(pos, {name="watershed:stone"})
minetest.sound_play("default_cool_lava", {pos = pos, gain = 0.25})
end,
})
minetest.register_abm({
nodenames = {"watershed:lava"},
neighbors = {"group:water"},
interval = 1,
chance = 11,
action = function(pos, node, active_object_count, active_object_count_wider)
minetest.set_node(pos, {name="default:obsidian"})
minetest.sound_play("default_cool_lava", {pos = pos, gain = 0.25})
end,
})

View File

@ -3,14 +3,14 @@
-- Depends default
-- License: code WTFPL
-- register bucket water lava
-- remove leaves from leafdecay, grass function
-- appleleaf mod node
-- TODO
-- greener freshwater in rivers
-- magma rising at ridges
-- lavacooling
-- turquiose freshwater in rivers
-- TODO
-- all tree heights vary
-- fog
-- singlenode option
-- singlenode game version
-- Parameters
@ -30,6 +30,7 @@ local ATANAMP = 1.1 -- Arctan function amplitude, smaller = more and larger floa
local TSTONE = 0.01 -- Density threshold for stone, depth of soil at TERCEN
local TRIV = -0.015 -- Maximum densitybase threshold for river water
local TSAND = -0.018 -- Maximum densitybase threshold for river sand
local TLAVA = 1
local FIST = 0 -- Fissure threshold at surface, controls size of fissure entrances at surface
local FISEXP = 0.02 -- Fissure expansion rate under surface
local ORETHI = 0.001 -- Ore seam thickness tuner
@ -179,6 +180,17 @@ local np_cloud = {
persist = 0.7
}
-- 2D noise for magma
local np_magma = {
offset = 0,
scale = 1,
spread = {x=128, y=128, z=128},
seed = -13,
octaves = 1,
persist = 0.5
}
-- Stuff
watershed = {}
@ -286,11 +298,11 @@ minetest.register_on_generated(function(minp, maxp, seed)
local nvals_base = minetest.get_perlin_map(np_base, chulens):get2dMap_flat(minposxz)
local nvals_xlscale = minetest.get_perlin_map(np_xlscale, chulens):get2dMap_flat(minposxz)
local nvals_cloud = minetest.get_perlin_map(np_cloud, chulens):get2dMap_flat(minposxz)
local nvals_magma = minetest.get_perlin_map(np_magma, chulens):get2dMap_flat(minposxz)
local ungen = false -- ungenerated chunk below?
if minetest.get_node({x=x0, y=y0-1, z=z0}).name == "ignore" then
ungen = true
print ("[watershed] ungen")
end
local nixyz = 1
@ -311,6 +323,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
local triv = TRIV * (1 - altprop * 1.1)
local tsand = TSAND * (1 - altprop * 1.1)
local tstone = TSTONE * (1 - math.atan(altprop) * 0.6) -- 1 to 0.05
local tlava = TLAVA * (0.9 - nvals_magma[nixz] ^ 4 * terblen ^ 16)
local density
if nvals_fault[nixyz] >= 0 then
density = densitybase
@ -378,7 +391,11 @@ minetest.register_on_generated(function(minp, maxp, seed)
end
end
if density >= tstone and nofis -- stone cut by fissures
if density >= tstone and densitybase >= tlava then
data[vi] = c_wslava
stable[si] = 0
under[si] = 0
elseif density >= tstone and nofis -- stone cut by fissures
or (density >= tstone and density < TSTONE * 3 and y <= YWAT) -- stone around water
or (density >= tstone and density < TSTONE * 3 and densitybase >= triv ) then -- stone around river
local densitystr = nvals_strata[nixyz] / 4 + (TERCEN - y) / TERSCA

View File

@ -162,18 +162,18 @@ minetest.register_node("watershed:vine", {
minetest.register_node("watershed:water", {
description = "WS Water Source",
inventory_image = minetest.inventorycube("default_water.png"),
inventory_image = minetest.inventorycube("watershed_water.png"),
drawtype = "liquid",
tiles = {
{
name="default_water_source_animated.png",
name="watershed_wateranim.png",
animation={type="vertical_frames",
aspect_w=16, aspect_h=16, length=2.0}
}
},
special_tiles = {
{
name="default_water_source_animated.png",
name="watershed_wateranim.png",
animation={type="vertical_frames",
aspect_w=16, aspect_h=16, length=2.0},
backface_culling = false,
@ -200,17 +200,17 @@ minetest.register_node("watershed:water", {
minetest.register_node("watershed:waterflow", {
description = "WS Flowing Water",
inventory_image = minetest.inventorycube("default_water.png"),
inventory_image = minetest.inventorycube("watershed_water.png"),
drawtype = "flowingliquid",
tiles = {"default_water.png"},
special_tiles = {
{
image="default_water_flowing_animated.png",
image="watershed_waterflowanim.png",
backface_culling=false,
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=0.8}
},
{
image="default_water_flowing_animated.png",
image="watershed_waterflowanim.png",
backface_culling=true,
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=0.8}
},

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB