123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482 |
- --[[
- minetest.register_node("caverealms:hotspring_seed", {
- description = "Hotspring seed",
- drawtype = "node",
- tiles = {"default_mese_block.png"},
- groups = {cracky=3,},
- })
- ]]
- minetest.register_node("caverealms:sulphur_deposit_1", {
- description = "Sulphur",
- paramtype = "light",
- paramtype2 = "facedir",
- drawtype = "nodebox",
- tiles = {"default_silver_sandstone.png^[colorize:yellow:140"},
- -- drops = {},
- node_box = {
- type = "fixed",
- fixed = {
- {-.3, -.5, -.3, -0.1, -.45, -0.1},
- {.3, -.5, .3, 0.1, -.45, 0.1,},
- {-.3, -.5, .3, -0.1, -.45, 0.1},
- },
- },
- groups = {cracky=3, geode_wall = 1 },
- })
- minetest.register_node("caverealms:fumarole", {
- description = "Fumarole",
- paramtype = "light",
- paramtype2 = "facedir",
- drawtype = "nodebox",
- tiles = {"default_stone.png^[colorize:black:10"},
- drop = 'default:cobble',
- damage_per_second = 3,
- node_box = {
- type = "fixed",
- fixed = {
- {-.4, -.5, -.4, 0.3, -.4, 0.3},
- {-.3+.05, -.4, -.3+.05, 0.2+.05, -.3, 0.2+.05},
- {-.2+.08, -.3, -.2+.08, 0.1+.08, -.2, 0.1+.08},
- },
- },
- groups = {cracky=3, },
- })
- minetest.register_abm({
- nodenames = "caverealms:fumarole",
- chance = 1,
- interval = 20,
- action = function(pos, node)
- pos.y = pos.y + 0
- minetest.add_particlespawner({
- amount = 20,
- time = 20,
- minpos = pos,
- maxpos = pos,
- minvel = {x=-0.1, y=.6, z=-0.1},
- maxvel = {x=0.1, y=1.6, z=0.1},
- minacc = {x=-0.1, y=.1, z=-0.1},
- maxacc = {x=0.1, y=.1, z=0.1},
- minexptime = 2.5,
- maxexptime = 4.5,
- minsize = 4.2,
- maxsize = 5.2,
- texture = "tnt_smoke.png",
- })
- end
- })
- minetest.register_node("caverealms:hotspring_water_source", {
- description = "Hotspring Water Source",
- drawtype = "liquid",
- light_source = 7,
- tiles = {
- {
- name = "default_river_water_source_animated.png^[colorize:yellow:50",
- backface_culling = false,
- animation = {
- type = "vertical_frames",
- aspect_w = 16,
- aspect_h = 16,
- length = 2.0,
- },
- },
- {
- name = "default_river_water_source_animated.png^[colorize:yellow:50",
- backface_culling = true,
- animation = {
- type = "vertical_frames",
- aspect_w = 16,
- aspect_h = 16,
- length = 2.0,
- },
- },
- },
- alpha = 160,
- paramtype = "light",
- walkable = false,
- pointable = false,
- diggable = false,
- buildable_to = true,
- is_ground_content = false,
- drop = "",
- drowning = 1,
- liquidtype = "source",
- liquid_alternative_flowing = "caverealms:hotspring_water_flowing",
- liquid_alternative_source = "caverealms:hotspring_water_source",
- liquid_viscosity = 1,
- -- Not renewable to avoid horizontal spread of water sources in sloping
- -- rivers that can cause water to overflow riverbanks and cause floods.
- -- River water source is instead made renewable by the 'force renew'
- -- option used in the 'bucket' mod by the river water bucket.
- liquid_renewable = false,
- liquid_range = 2,
- damage_per_second = 1,
- post_effect_color = {a = 103, r = 60, g = 96, b = 90},
- groups = {water = 3, liquid = 3, cools_lava = 1},
- sounds = default.node_sound_water_defaults(),
- })
- minetest.register_node("caverealms:hotspring_water_flowing", {
- description = "Flowing Hotspring Water",
- drawtype = "flowingliquid",
- tiles = {"default_river_water.png^[colorize:yellow:50"},
- special_tiles = {
- {
- name = "default_river_water_flowing_animated.png^[colorize:yellow:50",
- backface_culling = false,
- animation = {
- type = "vertical_frames",
- aspect_w = 16,
- aspect_h = 16,
- length = 0.8,
- },
- },
- {
- name = "default_river_water_flowing_animated.png^[colorize:yellow:50",
- 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,
- is_ground_content = false,
- drop = "",
- drowning = 1,
- liquidtype = "flowing",
- liquid_alternative_flowing = "caverealms:hotspring_water_flowing",
- liquid_alternative_source = "caverealms:hotspring_water_source",
- liquid_viscosity = 1,
- liquid_renewable = false,
- liquid_range = 2,
- damage_per_second = 1,
- post_effect_color = {a = 103, r = 60, g = 96, b = 90},
- groups = {water = 3, liquid = 3, not_in_creative_inventory = 1,
- cools_lava = 1},
- sounds = default.node_sound_water_defaults(),
- })
- minetest.register_node("caverealms:scalding_stone_1", {
- description = "Scalding Stone",
- tiles = {"default_stone.png^[colorize:orange:120"},
- groups = {cracky = 3, scalding_stone = 1},
- drop = 'default:cobble',
- damage_per_second = 1,
- sounds = default.node_sound_stone_defaults(),
- })
- minetest.register_node("caverealms:scalding_stone_2", {
- description = "Scalding Stone",
- tiles = {"default_stone.png^[colorize:yellow:80"},
- groups = {cracky = 3, scalding_stone = 1},
- drop = 'default:cobble',
- damage_per_second = 1,
- sounds = default.node_sound_stone_defaults(),
- })
- minetest.register_node("caverealms:scalding_stone_3", {
- description = "Scalding Stone",
- tiles = {"default_desert_stone.png^[colorize:orange:120"},
- groups = {cracky = 3, scalding_stone = 1},
- drop = 'default:cobble',
- damage_per_second = 1,
- sounds = default.node_sound_stone_defaults(),
- })
- minetest.register_node("caverealms:scalding_stone_4", {
- description = "Scalding Stone",
- tiles = {"default_desert_stone.png^[colorize:yellow:80"},
- groups = {cracky = 3, scalding_stone = 1},
- drop = 'default:cobble',
- damage_per_second = 1,
- sounds = default.node_sound_stone_defaults(),
- })
- minetest.register_node("caverealms:scalding_stone_5", {
- description = "Scalding Stone",
- tiles = {"default_stone.png^[colorize:red:80"},
- groups = {cracky = 3, scalding_stone = 1},
- drop = 'default:cobble',
- damage_per_second = 1,
- sounds = default.node_sound_stone_defaults(),
- })
- local scalding_stones = {
- minetest.get_content_id("caverealms:scalding_stone_1"),
- minetest.get_content_id("caverealms:scalding_stone_2"),
- minetest.get_content_id("caverealms:scalding_stone_3"),
- minetest.get_content_id("caverealms:scalding_stone_4"),
- minetest.get_content_id("caverealms:scalding_stone_5"),
- }
- local scalding_stone_names = {
- "caverealms:scalding_stone_1",
- "caverealms:scalding_stone_2",
- "caverealms:scalding_stone_3",
- "caverealms:scalding_stone_4",
- "caverealms:scalding_stone_5",
- }
- local function dist3(a, b)
- local x = a.x - b.x
- local y = a.y - b.y
- local z = a.z - b.z
- return math.sqrt(x*x + y*y + z*z)
- end
- -- local function spawn_hotspring(pos, size)
- function caverealms:spawn_hotspring(px,py,pz, area, data, size)
-
- local c_hotspring = minetest.get_content_id("caverealms:hotspring_water_source")
- local r = size
-
- local r2 = math.ceil(r+1)
-
- for x = px-r2,px+r2,1 do
- for y = -r2,r2,1 do
- for z = pz-r2,pz+r2,1 do
- local p = {x=x, y=py+y, z=z}
- local p_squash = {x=x, y=py + (y*2), z=z}
- local d = dist3(p_squash, {x=px, y=py, z=pz})
-
- d = d + math.random() * .5
-
- local dd = d - r
-
- local n = minetest.get_node(p)
- if n.name ~= "air" then
- if dd <= -.5 then
- local vi = area:index(x, py+y, z)
- data[vi] = c_hotspring
- elseif dd < 1.5 then
- local vi = area:index(x, py+y, z)
- data[vi] = scalding_stones[math.random(#scalding_stones)]
- end
- end
- end
- end
- end
-
-
-
- end
- minetest.register_abm({
- nodenames = "caverealms:hotspring_water_source",
- chance = 60,
- interval = 5,
- action = function(pos, node)
- minetest.add_particlespawner({
- amount = 1,
- time = 1,
- minpos = pos,
- maxpos = pos,
- minvel = {x=-0.1, y=.6, z=-0.1},
- maxvel = {x=0.1, y=1.6, z=0.1},
- minacc = {x=-0.1, y=.1, z=-0.1},
- maxacc = {x=0.1, y=.1, z=0.1},
- minexptime = 3.5,
- maxexptime = 6.5,
- minsize = 10.2,
- maxsize = 12.2,
- texture = "tnt_smoke.png",
- })
- end
- })
- local function random_pos(pos, dist)
- local p = {
- x=pos.x + math.random(-dist, dist),
- y=pos.y + dist,
- z=pos.z + math.random(-dist, dist),
- }
-
- while p.y > pos.y - dist do
- local n = minetest.get_node(p)
- if n.name ~= "air" and n.name ~= "ignore" then
- if n.name == "default:water_source" or n.name == "default:water_flowing" then
- return nil
- end
-
- return p
- end
-
- p.y = p.y - 1
- end
-
- return nil
- end
- -- life dies near hotsprings
- minetest.register_abm({
- nodenames = "group:flora",
- neighbors = {"group:scalding_stone"},
- chance = 10,
- interval = 15,
- action = function(pos, node)
- minetest.set_node(pos, {name="air"})
- end
- })
- -- life dies near hotsprings
- minetest.register_abm({
- nodenames = "group:flora",
- neighbors = {"group:scalding_stone"},
- chance = 80,
- interval = 15,
- action = function(pos, node)
- local p = minetest.find_node_near(pos, 15, {"group:flora", "group:sapling", "group:leaves", "group:leafdecay"})
- if p then
- minetest.set_node(p, {name="air"})
- end
- end
- })
- -- minerals accumulate
- minetest.register_abm({
- nodenames = "group:scalding_stone",
- neighbors = {"air"},
- chance = 180,
- interval = 30,
- action = function(pos, node)
- -- TODO: place sulphur on sides too
- pos.y = pos.y + 1
- local n = minetest.get_node(pos)
- if n.name == "air" then
- minetest.set_node(pos, {name="caverealms:sulphur_deposit_1"})
- end
- end
- })
- -- water scalds stone
- minetest.register_abm({
- nodenames = {"group:stone", "group:dirt"},
- neighbors = {"caverealms:hotspring_water_source", "caverealms:hotspring_water_flowing"},
- chance = 80,
- interval = 10,
- action = function(pos, node)
- minetest.set_node(pos, {name=scalding_stone_names[math.random(#scalding_stone_names)]})
- end
- })
- -- stones scald dirt
- minetest.register_abm({
- nodenames = "group:soil",
- neighbors = {"group:scalding_stone"},
- chance = 80,
- interval = 10,
- action = function(pos, node)
- minetest.set_node(pos, {name="default:stone"})
- end
- })
- -- water melts snow
- minetest.register_abm({
- nodenames = {"default:snow", "default:snowblock"},
- neighbors = {"caverealms:hotspring_water_source", "caverealms:hotspring_water_flowing"},
- chance = 80,
- interval = 10,
- action = function(pos, node)
- minetest.set_node(pos, {name="air"})
- end
- })
- --[[ add hotspring seeds to mapgen
- minetest.register_decoration({
- name = "caverealms:hotspring_seed",
- deco_type = "simple",
- place_on = {"default:dirt_with_grass", "default:dirt_with_snow", "default:snowblock",
- "default:silver_sand", "default:sand", "default:desert_sand"
- },
- place_offset_y = 1,
- sidelen = 16,
- noise_params = {
- offset = -0.010,
- scale = 0.01,
- spread = {x = 200, y = 200, z = 200},
- seed = 65645647,
- octaves = 3,
- persist = 0.7,
- },
- biomes = {"grassland", "snowy_grassland", "tundra", "taiga", "desert", "cold_desert", "sandstone_desert"},
- y_max = 1000,
- y_min = 5,
- place_offset_y = 1,
- decoration = "caverealms:hotspring_seed",
- flags = "force_placement",
- })
- ]]
- -- hotsprings boil rivers
- minetest.register_abm({
- nodenames = {"default:river_water_source"},
- neighbors = {"caverealms:hotspring_water_source", "caverealms:hotspring_water_flowing"},
- chance = 15,
- interval = 5,
- action = function(pos, node)
-
- -- only spread downhill
- local hw = minetest.find_nodes_in_area(
- {x=pos.x-1, y=pos.y, z=pos.z-1},
- {x=pos.x+1, y=pos.y+1, z=pos.z+1},
- {"caverealms:hotspring_water_source", "caverealms:hotspring_water_flowing"})
-
- if not hw or #hw == 0 then
- return
- end
-
- -- don't spread under rivers
- pos.y = pos.y + 1
- local n = minetest.get_node(pos)
- if n.name == "default:river_water_source" or n.name == "default:river_water_flowing" then
- return
- end
-
- pos.y = pos.y - 1
-
- minetest.set_node(pos, {name="caverealms:hotspring_water_source"})
- end
- })
|