From 4817204b6d957c3a26b16310c256df6f8a2175a6 Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Mon, 5 Aug 2019 19:35:34 -0600 Subject: [PATCH] add castle coral to replace cave coral, which has been repurposed into column decoration --- df_caverns/sunless_sea.lua | 2 +- df_mapitems/castle_coral.lua | 92 +++++++++ df_mapitems/cave_coral.lua | 67 ------- df_mapitems/init.lua | 3 +- df_mapitems/models/license.txt | 2 +- df_mapitems/models/octagonal_coral.obj | 181 ++++++++++++++++++ .../textures/dfcaverns_castle_coral.png | Bin 0 -> 629 bytes .../dfcaverns_castle_coral_gradient.png | Bin 0 -> 964 bytes 8 files changed, 277 insertions(+), 70 deletions(-) create mode 100644 df_mapitems/castle_coral.lua create mode 100644 df_mapitems/models/octagonal_coral.obj create mode 100644 df_mapitems/textures/dfcaverns_castle_coral.png create mode 100644 df_mapitems/textures/dfcaverns_castle_coral_gradient.png diff --git a/df_caverns/sunless_sea.lua b/df_caverns/sunless_sea.lua index 6bd5403..d4888bb 100644 --- a/df_caverns/sunless_sea.lua +++ b/df_caverns/sunless_sea.lua @@ -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 diff --git a/df_mapitems/castle_coral.lua b/df_mapitems/castle_coral.lua new file mode 100644 index 0000000..d557154 --- /dev/null +++ b/df_mapitems/castle_coral.lua @@ -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 \ No newline at end of file diff --git a/df_mapitems/cave_coral.lua b/df_mapitems/cave_coral.lua index 7ccdbc4..9a38c80 100644 --- a/df_mapitems/cave_coral.lua +++ b/df_mapitems/cave_coral.lua @@ -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 diff --git a/df_mapitems/init.lua b/df_mapitems/init.lua index 6d310be..e4650a2 100644 --- a/df_mapitems/init.lua +++ b/df_mapitems/init.lua @@ -18,4 +18,5 @@ dofile(modpath.."/crystals_mese.lua") dofile(modpath.."/crystals_ruby.lua") dofile(modpath.."/veinstone.lua") -dofile(modpath.."/cave_pearls.lua") \ No newline at end of file +dofile(modpath.."/cave_pearls.lua") +dofile(modpath.."/castle_coral.lua") \ No newline at end of file diff --git a/df_mapitems/models/license.txt b/df_mapitems/models/license.txt index 06e53b3..99cd1e6 100644 --- a/df_mapitems/models/license.txt +++ b/df_mapitems/models/license.txt @@ -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 \ No newline at end of file diff --git a/df_mapitems/models/octagonal_coral.obj b/df_mapitems/models/octagonal_coral.obj new file mode 100644 index 0000000..b25bf74 --- /dev/null +++ b/df_mapitems/models/octagonal_coral.obj @@ -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 diff --git a/df_mapitems/textures/dfcaverns_castle_coral.png b/df_mapitems/textures/dfcaverns_castle_coral.png new file mode 100644 index 0000000000000000000000000000000000000000..1b3a2f08a35edfeb521810da9df06d53bcae908b GIT binary patch literal 629 zcmV-*0*d{KP)uAo7%ra`-{LAatzi$SQKKA4U?tC=yXojIY0KbU+(xTid{p)#zHD5;e&sFyab zqdK0DJhQGtx3)g2txckiMyI1qs+u^ks5_#JM6|6(s)ZY@jVGXqG@Ok+uB}I_sY;`w zQoF)cxwk~HwN9a*RI;x@wWBzsk1(H$I;)W@riwAGpf{qEJez$tsF^dqyFwhYPpzars+K&Nb1s~NEuw@esFyjTkvX1;LZqKnn}$T6fh)JLOT4sAoQyx1 ze?O#{J*=oks+=*arbeEQIGuejql_t{gD#qcLam@Pu%$n%q*1!ENW!r>!@EPfzf7c- zN3fwSwX{RJz)PN$Jf)pMhHxqo00026Nkl*}-m zCrAJWlf~w6d3=FTB$h~JkSmlbwMMJc8;mBi#cG4y;dHq@UY|b@422`n7~+X!DxJyZ z@`YllT&dPjZ!}x&PPf+|3`gV1bcXrD;?nZU>e~9o=GOMk?jH6J4v&scPS4ISF0Za{ zZtrma@c8un^7{7v@%i=r^ZN(#=>ziV1M=wu^63Ne=>ziV1M=wu^6B#rC3HW5==|aD P00000NkvXXu0mjf0Jk@s literal 0 HcmV?d00001 diff --git a/df_mapitems/textures/dfcaverns_castle_coral_gradient.png b/df_mapitems/textures/dfcaverns_castle_coral_gradient.png new file mode 100644 index 0000000000000000000000000000000000000000..a12ec9ec092351a00f00afe942c8830f05190327 GIT binary patch literal 964 zcmV;#13UbQP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+I>;m4Z|=9{AY@efC1Yuj`OJ04LW{FAZ=2qMamft zn>#zOJ|B0uZ9!E*YS(71p@*0l4Nnv!#*PJL$1LzjE0+{MM(;D(cCJow{=0@_D>nSt4=!=#!!GS*edN&2biHn# zKMa5N)qyb+-cGiE0(||a(??zN>-;)Mfj)O!ANaBkV>_K`v%lrGL}QE4B=nEJCGI}W z6fXCZ%TgCERYUiG2lk|zYR;c~_Y#_;3NEM`5)&W4GQ55J&U9l_mxSIv*EWjMDAo$H zcVO8!b%i4rc|1Ex$($y1WiMMv3x=Ctq&+r z#$E0L#hU7(yW$9uk80Q0Ys6mr5D`nvtp5xm*+hPN4Oz&-I9AbK?{Gwnk>!$tR1IGk z%hScDoZvqP-Z81yq_a@%QLUM0g;@%W5$w%??A#Q~3U)}mcEl1FEh<4?kO`cx-Lckk zAt%Mtp;-+S=7A$6CpK+}nOuPi!wTdD?>lRX9So>0Cyv_>Kpf{wX64SCmP-f*u+yuZ mA#!58(SvGKhCRgy!T%39)_Ok9Zkxma0000