add castle coral to replace cave coral, which has been repurposed into column decoration

This commit is contained in:
FaceDeer 2019-08-05 19:35:34 -06:00
parent 40f076ee1c
commit 4817204b6d
8 changed files with 277 additions and 70 deletions

View File

@ -276,7 +276,7 @@ local decorate_sunless_sea = function(minp, maxp, seed, vm, node_arrays, area, d
if math.random() < 0.001 then
local iterations = math.random(1, 6)
df_mapitems.spawn_coral_pile(area, data, vi, iterations)
df_mapitems.spawn_cave_coral(area, data, vi+area.ystride, iterations)
df_mapitems.spawn_castle_coral(area, data, vi+area.ystride, iterations)
end
end
end

View File

@ -0,0 +1,92 @@
-- internationalization boilerplate
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
minetest.register_node("df_mapitems:castle_coral", {
description = S("Castle Coral"),
tiles = {
"dfcaverns_castle_coral_gradient.png",
"dfcaverns_castle_coral.png",
"dfcaverns_castle_coral.png",
"dfcaverns_castle_coral.png^[multiply:#888888",
},
drawtype = "mesh",
light_source = 2,
mesh = "octagonal_coral.obj",
drop = "df_mapitems:castle_coral_skeleton",
paramtype = "light",
groups = {cracky=2,},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("df_mapitems:castle_coral_skeleton", {
description = S("Castle Coral Skeleton"),
tiles = {
"default_coral_skeleton.png",
"default_coral_skeleton.png",
"default_coral_skeleton.png",
"default_coral_skeleton.png",
},
drawtype = "mesh",
mesh = "octagonal_coral.obj",
paramtype = "light",
groups = {cracky = 3},
sounds = default.node_sound_stone_defaults(),
})
local c_coral = minetest.get_content_id("df_mapitems:castle_coral")
local c_coral_skeleton = minetest.get_content_id("df_mapitems:castle_coral_skeleton")
local c_stone = minetest.get_content_id("default:stone")
local c_water = minetest.get_content_id("default:water_source")
df_mapitems.spawn_castle_coral = function(area, data, vi, iterations)
local run = math.random(2,4)
local index = vi
local zstride = area.zstride
local ystride = area.ystride
while run > 0 do
if math.random() > 0.95 or data[index] == c_stone or not area:containsi(index) then return end
data[index] = c_coral
if iterations > 2 then
data[index + 1] = c_coral
data[index - 1] = c_coral
data[index + zstride] = c_coral
data[index - zstride] = c_coral
end
if iterations > 3 then
data[index + 2] = c_coral
data[index - 2] = c_coral
data[index + zstride * 2] = c_coral
data[index - zstride * 2] = c_coral
data[index + 1 + zstride] = c_coral
data[index - 1 + zstride] = c_coral
data[index + 1 - zstride] = c_coral
data[index - 1 - zstride] = c_coral
end
index = index + ystride
run = run - 1
end
local newiterations = iterations - 1
if newiterations == 0 then return end
if math.random() > 0.5 then
df_mapitems.spawn_castle_coral(area, data, index + 1 - ystride, newiterations)
df_mapitems.spawn_castle_coral(area, data, index - 1 - ystride, newiterations)
else
df_mapitems.spawn_castle_coral(area, data, index + zstride - ystride, newiterations)
df_mapitems.spawn_castle_coral(area, data, index - zstride - ystride, newiterations)
end
end
df_mapitems.spawn_coral_pile = function(area, data, vi, radius)
local pos = area:position(vi)
for li in area:iterp(vector.add(pos, -radius), vector.add(pos, radius)) do
local adjacent = li + area.ystride
local node_type = data[li]
if math.random() < 0.2 and not mapgen_helper.buildable_to(node_type) and data[adjacent] == c_water then
data[adjacent] = c_coral_skeleton
end
end
end

View File

@ -7,7 +7,6 @@ minetest.register_node("df_mapitems:cave_coral_3", {
_doc_items_longdesc = df_mapitems.doc.cave_coral_desc,
_doc_items_usagehelp = df_mapitems.doc.cave_coral_usage,
tiles = {"dfcaverns_cave_coral_end.png", "dfcaverns_cave_coral_end.png", "dfcaverns_cave_coral.png"},
is_ground_content = true,
drop = "default:coral_skeleton",
light_source = 3,
paramtype2 = "facedir",
@ -20,7 +19,6 @@ minetest.register_node("df_mapitems:cave_coral_2", {
_doc_items_longdesc = df_mapitems.doc.cave_coral_desc,
_doc_items_usagehelp = df_mapitems.doc.cave_coral_usage,
tiles = {"dfcaverns_cave_coral_end.png", "dfcaverns_cave_coral_end.png", "dfcaverns_cave_coral.png"},
is_ground_content = true,
drop = "default:coral_skeleton",
light_source = 2,
paramtype2 = "facedir",
@ -33,7 +31,6 @@ minetest.register_node("df_mapitems:cave_coral_1", {
_doc_items_longdesc = df_mapitems.doc.cave_coral_desc,
_doc_items_usagehelp = df_mapitems.doc.cave_coral_usage,
tiles = {"dfcaverns_cave_coral_end.png", "dfcaverns_cave_coral_end.png", "dfcaverns_cave_coral.png"},
is_ground_content = true,
drop = "default:coral_skeleton",
light_source = 1,
paramtype2 = "facedir",
@ -53,67 +50,3 @@ minetest.register_abm{
minetest.swap_node(pos, {name=coral_names[math.random(1,3)], param2=node.param2})
end,
}
local c_coral_1 = minetest.get_content_id("df_mapitems:cave_coral_1")
local c_coral_2 = minetest.get_content_id("df_mapitems:cave_coral_2")
local c_coral_3 = minetest.get_content_id("df_mapitems:cave_coral_3")
local c_coral_skeleton = minetest.get_content_id("default:coral_skeleton")
local c_dirt = minetest.get_content_id("default:dirt")
local c_stone = minetest.get_content_id("default:stone")
local c_water = minetest.get_content_id("default:water_source")
local corals = {c_coral_1, c_coral_2, c_coral_3}
local get_coral = function()
return corals[math.random(1,3)]
end
df_mapitems.spawn_cave_coral = function(area, data, vi, iterations)
local run = math.random(2,4)
local index = vi
local zstride = area.zstride
local ystride = area.ystride
while run > 0 do
if math.random() > 0.95 or data[index] == c_stone or not area:containsi(index) then return end
data[index] = get_coral()
if iterations > 2 then
data[index + 1] = get_coral()
data[index - 1] = get_coral()
data[index + zstride] = get_coral()
data[index - zstride] = get_coral()
end
if iterations > 3 then
data[index + 2] = get_coral()
data[index - 2] = get_coral()
data[index + zstride * 2] = get_coral()
data[index - zstride * 2] = get_coral()
data[index + 1 + zstride] = get_coral()
data[index - 1 + zstride] = get_coral()
data[index + 1 - zstride] = get_coral()
data[index - 1 - zstride] = get_coral()
end
index = index + ystride
run = run - 1
end
local newiterations = iterations - 1
if newiterations == 0 then return end
if math.random() > 0.5 then
df_mapitems.spawn_cave_coral(area, data, index + 1 - ystride, newiterations)
df_mapitems.spawn_cave_coral(area, data, index - 1 - ystride, newiterations)
else
df_mapitems.spawn_cave_coral(area, data, index + zstride - ystride, newiterations)
df_mapitems.spawn_cave_coral(area, data, index - zstride - ystride, newiterations)
end
end
df_mapitems.spawn_coral_pile = function(area, data, vi, radius)
local pos = area:position(vi)
for li in area:iterp(vector.add(pos, -radius), vector.add(pos, radius)) do
local adjacent = li + area.ystride
local node_type = data[li]
if math.random() < 0.2 and not mapgen_helper.buildable_to(node_type) and data[adjacent] == c_water then
data[adjacent] = c_coral_skeleton
end
end
end

View File

@ -18,4 +18,5 @@ dofile(modpath.."/crystals_mese.lua")
dofile(modpath.."/crystals_ruby.lua")
dofile(modpath.."/veinstone.lua")
dofile(modpath.."/cave_pearls.lua")
dofile(modpath.."/cave_pearls.lua")
dofile(modpath.."/castle_coral.lua")

View File

@ -1,3 +1,3 @@
All hex crystal models were created by FaceDeer and released under both the MIT license and under the Creative Commons CC0 license.
All hex crystal models and the octagonal_coral model were created by FaceDeer and released under both the MIT license and under the Creative Commons CC0 license.
underch_crystal is from the [underch] (Underground Challenge) mod by Hume2 (https://gitlab.com/h2mm/underch) under the WTFPL license, relicened here to the MIT license

View File

@ -0,0 +1,181 @@
# Blender v2.79 (sub 0) OBJ File: 'octagonal_coral.blend'
# www.blender.org
g Cylinder.003_Cylinder.004
v -0.120061 0.505000 -0.289852
v 0.120061 0.505000 -0.289852
v 0.289852 0.505000 -0.120061
v 0.289852 0.505000 0.120061
v 0.120060 0.505000 0.289852
v -0.120061 0.505000 0.289852
v -0.289852 0.505000 0.120061
v -0.289852 0.505000 -0.120060
v -0.120061 -0.250000 -0.289852
v 0.120061 -0.250000 -0.289852
v 0.289852 -0.250000 -0.120061
v 0.289852 -0.250000 0.120061
v 0.120060 -0.250000 0.289852
v -0.120061 -0.250000 0.289852
v -0.289852 -0.250000 0.120061
v -0.289852 -0.250000 -0.120060
vt 0.500000 1.000024
vt 0.250000 1.000024
vt 0.250000 -0.000024
vt 0.500000 -0.000024
vt 0.750000 1.000024
vt 0.500000 1.000024
vt 0.500000 -0.000024
vt 0.750000 -0.000024
vt 0.750000 1.000024
vt 0.500000 1.000024
vt 0.500000 -0.000024
vt 0.750000 -0.000024
vt 0.750000 1.000024
vt 0.500000 1.000024
vt 0.500000 -0.000024
vt 0.750000 -0.000024
vt 0.250000 1.000024
vt 0.250000 -0.000024
vt 0.750000 1.000024
vt 0.750000 -0.000024
vt 0.250000 1.000024
vt 0.250000 -0.000024
vt 0.250000 1.000024
vt 0.250000 -0.000024
s off
f 3/1 2/2 10/3 11/4
f 8/5 7/6 15/7 16/8
f 6/9 5/10 13/11 14/12
f 2/13 1/14 9/15 10/16
f 5/10 4/17 12/18 13/11
f 4/19 3/1 11/4 12/20
f 1/14 8/21 16/22 9/15
f 7/6 6/23 14/24 15/7
g Cylinder.002_Cylinder.003
v -0.120061 0.505000 -0.289852
v -0.292831 -0.505000 -0.706955
v -0.292831 0.505000 -0.706955
v 0.292830 -0.505000 -0.706955
v 0.292830 0.505000 -0.706955
v 0.706955 -0.505000 -0.292831
v 0.706955 0.505000 -0.292831
v 0.706955 -0.505000 0.292830
v 0.706955 0.505000 0.292830
v 0.292830 -0.505000 0.706955
v 0.292830 0.505000 0.706955
v -0.292831 -0.505000 0.706955
v -0.292831 0.505000 0.706955
v -0.706955 -0.505000 0.292831
v -0.706955 0.505000 0.292831
v -0.706955 -0.505000 -0.292830
v -0.706955 0.505000 -0.292830
v 0.120061 0.505000 -0.289852
v 0.289852 0.505000 -0.120061
v 0.289852 0.505000 0.120061
v 0.120060 0.505000 0.289852
v -0.120061 0.505000 0.289852
v -0.289852 0.505000 0.120061
v -0.289852 0.505000 -0.120060
vt -0.207066 0.792876
vt -0.207066 0.207124
vt 0.210103 0.379921
vt 0.210103 0.620079
vt 0.500000 -0.000000
vt 0.500000 1.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 1.207066 0.207124
vt 1.207066 0.792876
vt 0.789897 0.620079
vt 0.789897 0.379921
vt 1.000000 -0.000000
vt 1.000000 1.000000
vt 0.500000 1.000000
vt 0.500000 -0.000000
vt 0.792876 1.207066
vt 0.207124 1.207066
vt 0.379921 0.789897
vt 0.620079 0.789897
vt -0.000000 1.000000
vt -0.000000 0.000000
vt 0.207124 -0.207066
vt 0.379921 0.210103
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 0.500000 1.000000
vt 0.500000 0.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 0.792876 -0.207066
vt 0.620079 0.210103
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 0.500000 1.000000
vt 0.500000 0.000000
vt -0.000000 1.000000
vt -0.000000 0.000000
vt 1.000000 -0.000000
vt 1.000000 1.000000
s off
f 33/25 31/26 39/27 40/28
f 18/29 19/30 21/31 20/32
f 25/33 23/34 35/35 36/36
f 20/37 21/38 23/39 22/40
f 21/41 19/42 17/43 34/44
f 22/40 23/39 25/45 24/46
f 31/26 29/47 38/48 39/27
f 24/49 25/50 27/51 26/52
f 23/34 21/41 34/44 35/35
f 26/52 27/51 29/53 28/54
f 29/47 27/55 37/56 38/48
f 28/57 29/58 31/59 30/60
f 30/60 31/59 33/61 32/62
f 27/55 25/33 36/36 37/56
f 32/63 33/64 19/30 18/29
f 19/42 33/25 40/28 17/43
g Cylinder.001_Cylinder.002
v 0.000000 -0.505000 0.000000
v -0.292831 -0.505000 -0.706955
v 0.292830 -0.505000 -0.706955
v 0.706955 -0.505000 -0.292831
v 0.706955 -0.505000 0.292830
v 0.292830 -0.505000 0.706955
v -0.292831 -0.505000 0.706955
v -0.706955 -0.505000 0.292831
v -0.706955 -0.505000 -0.292830
vt 0.500000 0.500000
vt 0.207147 1.207009
vt 0.792853 1.207009
vt 1.207009 0.792853
vt 1.207009 0.207147
vt 0.792853 -0.207009
vt 0.207147 -0.207009
vt -0.207009 0.207147
vt -0.207009 0.792853
s off
f 41/65 42/66 43/67
f 41/65 43/67 44/68
f 41/65 44/68 45/69
f 41/65 45/69 46/70
f 41/65 46/70 47/71
f 41/65 47/71 48/72
f 41/65 48/72 49/73
f 41/65 49/73 42/66
g Cylinder
v -0.120061 -0.250000 -0.289852
v 0.120061 -0.250000 -0.289852
v 0.289852 -0.250000 -0.120061
v 0.289852 -0.250000 0.120061
v 0.120060 -0.250000 0.289852
v -0.120061 -0.250000 0.289852
v -0.289852 -0.250000 0.120061
v -0.289852 -0.250000 -0.120060
vt 0.707087 0.999951
vt 0.292913 0.999951
vt 0.000049 0.707087
vt 0.000049 0.292913
vt 0.292913 0.000049
vt 0.707087 0.000049
vt 0.999951 0.292913
vt 0.999951 0.707087
s off
f 51/74 50/75 57/76 56/77 55/78 54/79 53/80 52/81

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 964 B