Small stuff (#8)

* cave pearls and spindleshrooms (name subject to change) now are things. Not in mapgen yet.

* add the wandering "gas wisp" to light up some of the gas-filled caverns

* make wisps rarely spawned by gas explosions

* revamp spindlestems into a sort of mineral detector, add glowing extract bottles

* optimize pngs

* add gas wisps to mapgen

* add spindlestems to cavern level 1, most level 1 warrens are now lit up

* update internal names, adjust mineral detection range

* add cave pearls to some level 2 warrens and tunnels

* switch experimental simplecrafting_lib support to crafting mod

* Pearls don't grow on falling nodes

* put spindlestems with goblin caps, make them always grow red when near those

* bunch of documentation

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

* documentation for cave coral, update some locale text

* add a recipe for cooking oil into paraffin

* add old bones to the underworld

* MIT license for bones_loot

* also cook black cap gills into paraffin, they're oily

* add salt crystals to the bloodthorn caverns, illuminating the floor

* documentation for salt crystals

* auto-generate minetestmapper colors.

need to update the spindlestem colours manually

* add spindlestem to fungiwood caverns too, and increase warren coverage

* in anticipation of eventually adding stuff below the Slade, making glowing pit erosion self-limiting.

* add a bit of displacement to the underside of the slade layer

* Unique images and names for cooking recipes.

* revamp bones loot

* add softer footsteps for some fungus types

* update mapgen_helper

* update cave coral screenshot

* mention glowing salts in bloodthorn caverns
This commit is contained in:
FaceDeer
2019-08-18 22:20:07 -05:00
committed by GitHub
parent 5e113ec200
commit 12919e9a16
184 changed files with 2787 additions and 521 deletions

View File

@ -0,0 +1,96 @@
-- 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",
},
_doc_items_longdesc = df_mapitems.doc.castle_coral_desc,
_doc_items_usagehelp = df_mapitems.doc.castle_coral_usage,
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"),
_doc_items_longdesc = df_mapitems.doc.castle_coral_desc,
_doc_items_usagehelp = df_mapitems.doc.castle_coral_usage,
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,9 +7,9 @@ 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",
groups = {cracky = 3, dfcaverns_cave_coral = 1},
sounds = default.node_sound_stone_defaults(),
})
@ -19,9 +19,9 @@ 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",
groups = {cracky = 3, dfcaverns_cave_coral = 1},
sounds = default.node_sound_stone_defaults(),
})
@ -31,9 +31,9 @@ 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",
groups = {cracky = 3, dfcaverns_cave_coral = 1},
sounds = default.node_sound_stone_defaults(),
})
@ -46,70 +46,7 @@ minetest.register_abm{
interval = 2,
chance = 10,
action = function(pos)
minetest.swap_node(pos, {name=coral_names[math.random(1,3)]})
local node = minetest.get_node(pos)
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

@ -0,0 +1,26 @@
-- internationalization boilerplate
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
minetest.register_node("df_mapitems:cave_pearls", {
description = S("Cave Pearls"),
tiles = {"dfcaverns_cave_pearl.png"},
_doc_items_longdesc = df_mapitems.doc.cave_pearls_desc,
_doc_items_usagehelp = df_mapitems.doc.cave_pearls_usage,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 2},
walkable = false,
climbable = true,
light_source = 4,
node_box = {
type = "fixed",
fixed = {
{-0.375, -0.5, -0.375, -0.125, -0.3125, -0.125}, -- NodeBox1
{0.125, -0.5, -0.1875, 0.3125, -0.375, 0}, -- NodeBox2
{-0.125, -0.5, 0.25, 0.0625, -0.375, 0.4375}, -- NodeBox3
}
},
on_place = df_mapitems.place_against_surface,
})

View File

@ -40,6 +40,7 @@ minetest.register_node("df_mapitems:mese_crystal", {
sounds = default.node_sound_glass_defaults(),
use_texture_alpha = true,
sunlight_propagates = true,
on_place = df_mapitems.place_against_surface,
})
minetest.register_craft({

View File

@ -0,0 +1,33 @@
-- internationalization boilerplate
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
minetest.register_node("df_mapitems:salt_crystal", {
description = S("Luminous Salt Crystal"),
_doc_items_longdesc = df_mapitems.doc.salt_desc,
_doc_items_usagehelp = df_mapitems.doc.salt_usage,
tiles = {"dfcaverns_salt_crystal.png"},
groups = {cracky = 2},
paramtype = "light",
paramtype2 = "facedir",
drawtype = "mesh",
mesh = "underch_crystal.obj",
light_source = 6,
sounds = default.node_sound_glass_defaults(),
use_texture_alpha = true,
sunlight_propagates = true,
on_place = df_mapitems.place_against_surface,
})
minetest.register_node("df_mapitems:salty_cobble", {
description = S("Salty Cobble"),
_doc_items_longdesc = df_mapitems.doc.salty_cobble_desc,
_doc_items_usagehelp = df_mapitems.doc.salty_cobble_desc,
tiles = {"default_cobble.png^dfcaverns_salty.png"},
groups = {cracky = 3, stone = 1, lava_heatable = 1},
_magma_conduits_heats_to = "default:cobble",
is_ground_content = true,
light_source = 2,
drop = 'default:cobble',
sounds = default.node_sound_stone_defaults(),
})

View File

@ -41,3 +41,15 @@ df_mapitems.doc.glow_ruby_ore_usage = S("Aside from its aesthetic value this roc
df_mapitems.doc.big_crystal_desc = S("Monolithic crystals of this size form only over extremely long periods deep underground, in large long-lived cavities that allow them room to grow. Water and the life it hosts tend to disrupt the formation process of these crystals so they're only found in dry environments.")
df_mapitems.doc.big_crystal_usage = S("Aside from its aesthetic value this crystal has no particular use.")
df_mapitems.doc.cave_pearls_desc = S("These nodules are actually calcified bacterial colonies.")
df_mapitems.doc.cave_pearls_usage = S("Aside from their soft glow and beauty, cave pearls have no practical use. Except perhaps as handholds for climbing.")
df_mapitems.doc.castle_coral_desc = S("Deep under the surface of the Sunless Sea are the rare and beautiful Castle Corals, so named due to their resemblance to small undersea castles.")
df_mapitems.doc.castle_coral_usage = S("Castle Coral has little practical use aside from perhaps as a distinctive-looking building material.")
df_mapitems.doc.salt_desc = S("A crystal of salt grown from water that percolated through the depths of the earth, picking up all manner of minerals as it went.")
df_mapitems.doc.salt_usage = S("Traces of Mese must have been dissolved by the water as this crystal has an inherent glow to it. Not enough Mese to be useful as a reagent, unfortunately.")
df_mapitems.doc.salty_cobble_desc = S("Much water has seeped through the cracks in this rock and then quickly evaporated, leaving a crust of salt laced throughout.")
df_mapitems.doc.salty_cobble_usage = S("Attemping to mine this rock knocks the salt crust away, leaving only base stone.")

View File

@ -7,6 +7,7 @@ local modpath = minetest.get_modpath(minetest.get_current_modname())
dofile(modpath.."/config.lua")
dofile(modpath.."/doc.lua")
dofile(modpath.."/aliases.lua")
dofile(modpath.."/util.lua")
dofile(modpath.."/ground_cover.lua")
dofile(modpath.."/glow_worms.lua")
@ -16,5 +17,8 @@ dofile(modpath.."/cave_coral.lua")
dofile(modpath.."/crystals_mese.lua")
dofile(modpath.."/crystals_ruby.lua")
dofile(modpath.."/crystals_salt.lua")
dofile(modpath.."/veinstone.lua")
dofile(modpath.."/veinstone.lua")
dofile(modpath.."/cave_pearls.lua")
dofile(modpath.."/castle_coral.lua")

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: dfcaverns module's Italian locale\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-12-29 19:30-0700\n"
"POT-Creation-Date: 2019-08-07 21:33-0600\n"
"PO-Revision-Date: 2017-08-17 23:01+0100\n"
"Last-Translator: H4mlet <h4mlet@riseup.net>\n"
"Language-Team: ITALIANO\n"
@ -18,6 +18,14 @@ msgstr ""
"X-Generator: Poedit 1.6.10\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: df_mapitems\castle_coral.lua:6
msgid "Castle Coral"
msgstr ""
#: df_mapitems\castle_coral.lua:25
msgid "Castle Coral Skeleton"
msgstr ""
#: df_mapitems\cave_coral.lua:6
#: df_mapitems\cave_coral.lua:18
#: df_mapitems\cave_coral.lua:30
@ -25,6 +33,10 @@ msgstr ""
msgid "Cave Coral"
msgstr "Grano di caverna"
#: df_mapitems\cave_pearls.lua:6
msgid "Cave Pearls"
msgstr ""
#: df_mapitems\crystals_mese.lua:7
msgid "Flawless Mese Block"
msgstr ""
@ -49,6 +61,14 @@ msgstr ""
msgid "Big Red Crystal"
msgstr ""
#: df_mapitems\crystals_salt.lua:6
msgid "Luminous Salt Crystal"
msgstr ""
#: df_mapitems\crystals_salt.lua:23
msgid "Salty Cobble"
msgstr ""
#: df_mapitems\doc.lua:11
msgid ""
"Cave moss is technically a form of mold, but fortunately a relatively benign "
@ -199,6 +219,53 @@ msgstr ""
msgid "Aside from its aesthetic value this crystal has no particular use."
msgstr ""
#: df_mapitems\doc.lua:45
msgid "These nodules are actually calcified bacterial colonies."
msgstr ""
#: df_mapitems\doc.lua:46
msgid ""
"Aside from their soft glow and beauty, cave pearls have no practical use. "
"Except perhaps as handholds for climbing."
msgstr ""
#: df_mapitems\doc.lua:48
msgid ""
"Deep under the surface of the Sunless Sea are the rare and beautiful Castle "
"Corals, so named due to their resemblance to small undersea castles."
msgstr ""
#: df_mapitems\doc.lua:49
msgid ""
"Castle Coral has little practical use aside from perhaps as a distinctive-"
"looking building material."
msgstr ""
#: df_mapitems\doc.lua:51
msgid ""
"A crystal of salt grown from water that percolated through the depths of the "
"earth, picking up all manner of minerals as it went."
msgstr ""
#: df_mapitems\doc.lua:52
msgid ""
"Traces of Mese must have been dissolved by the water as this crystal has an "
"inherent glow to it. Not enough Mese to be useful as a reagent, "
"unfortunately."
msgstr ""
#: df_mapitems\doc.lua:54
msgid ""
"Much water has seeped through the cracks in this rock and then quickly "
"evaporated, leaving a crust of salt laced throughout."
msgstr ""
#: df_mapitems\doc.lua:55
msgid ""
"Attemping to mine this rock knocks the salt crust away, leaving only base "
"stone."
msgstr ""
#: df_mapitems\flowstone.lua:8
msgid "Dry Dripstone"
msgstr ""
@ -227,12 +294,12 @@ msgstr "Vermi luminosi"
msgid "Dirt With Cave Moss"
msgstr "Terra con muschio di caverna"
#: df_mapitems\ground_cover.lua:53
#: df_mapitems\ground_cover.lua:67
#: df_mapitems\ground_cover.lua:54
#: df_mapitems\ground_cover.lua:69
msgid "Cobblestone With Floor Fungus"
msgstr "Ciottoli con funghi del terreno"
#: df_mapitems\ground_cover.lua:106
#: df_mapitems\ground_cover.lua:109
msgid "Ice With Hoar Moss"
msgstr ""

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-12-29 19:30-0700\n"
"POT-Creation-Date: 2019-08-07 21:33-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,12 +17,24 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: df_mapitems\castle_coral.lua:6
msgid "Castle Coral"
msgstr ""
#: df_mapitems\castle_coral.lua:25
msgid "Castle Coral Skeleton"
msgstr ""
#: df_mapitems\cave_coral.lua:6
#: df_mapitems\cave_coral.lua:18
#: df_mapitems\cave_coral.lua:30
msgid "Cave Coral"
msgstr ""
#: df_mapitems\cave_pearls.lua:6
msgid "Cave Pearls"
msgstr ""
#: df_mapitems\crystals_mese.lua:7
msgid "Flawless Mese Block"
msgstr ""
@ -47,6 +59,14 @@ msgstr ""
msgid "Big Red Crystal"
msgstr ""
#: df_mapitems\crystals_salt.lua:6
msgid "Luminous Salt Crystal"
msgstr ""
#: df_mapitems\crystals_salt.lua:23
msgid "Salty Cobble"
msgstr ""
#: df_mapitems\doc.lua:11
msgid ""
"Cave moss is technically a form of mold, but fortunately a relatively benign "
@ -197,6 +217,53 @@ msgstr ""
msgid "Aside from its aesthetic value this crystal has no particular use."
msgstr ""
#: df_mapitems\doc.lua:45
msgid "These nodules are actually calcified bacterial colonies."
msgstr ""
#: df_mapitems\doc.lua:46
msgid ""
"Aside from their soft glow and beauty, cave pearls have no practical use. "
"Except perhaps as handholds for climbing."
msgstr ""
#: df_mapitems\doc.lua:48
msgid ""
"Deep under the surface of the Sunless Sea are the rare and beautiful Castle "
"Corals, so named due to their resemblance to small undersea castles."
msgstr ""
#: df_mapitems\doc.lua:49
msgid ""
"Castle Coral has little practical use aside from perhaps as a distinctive-"
"looking building material."
msgstr ""
#: df_mapitems\doc.lua:51
msgid ""
"A crystal of salt grown from water that percolated through the depths of the "
"earth, picking up all manner of minerals as it went."
msgstr ""
#: df_mapitems\doc.lua:52
msgid ""
"Traces of Mese must have been dissolved by the water as this crystal has an "
"inherent glow to it. Not enough Mese to be useful as a reagent, "
"unfortunately."
msgstr ""
#: df_mapitems\doc.lua:54
msgid ""
"Much water has seeped through the cracks in this rock and then quickly "
"evaporated, leaving a crust of salt laced throughout."
msgstr ""
#: df_mapitems\doc.lua:55
msgid ""
"Attemping to mine this rock knocks the salt crust away, leaving only base "
"stone."
msgstr ""
#: df_mapitems\flowstone.lua:8
msgid "Dry Dripstone"
msgstr ""
@ -225,12 +292,12 @@ msgstr ""
msgid "Dirt With Cave Moss"
msgstr ""
#: df_mapitems\ground_cover.lua:53
#: df_mapitems\ground_cover.lua:67
#: df_mapitems\ground_cover.lua:54
#: df_mapitems\ground_cover.lua:69
msgid "Cobblestone With Floor Fungus"
msgstr ""
#: df_mapitems\ground_cover.lua:106
#: df_mapitems\ground_cover.lua:109
msgid "Ice With Hoar Moss"
msgstr ""

View File

@ -1 +1,4 @@
name = df_mapitems
name = df_mapitems
description = Various node types used by the dfcaverns mapgen mod. Includes cave coral, flowstone, glowing crystals, glow worms, moss and fungi ground cover, and snare weed.
depends = default, subterrane
optional_depends = df_farming, farming, intllib, doc, radiant_damage

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 438 B

After

Width:  |  Height:  |  Size: 437 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 364 B

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 678 B

After

Width:  |  Height:  |  Size: 661 B

View File

@ -5,3 +5,5 @@ dfcaverns_glow_worm_animated - glow worm texture overlaid with rippling animatio
dfcaverns_glow_mese - from caverealms glow_mese
dfcaverns_glow_ruby, dfcaverns_glow_ruby4x, dfcaverns_glow_ruby_quarter - from caverealms glow_ruby
dfcaverns_glow_ruby_ore - from caverealms glow_ruby_ore
dfcaverns_salt_crystal - from caverealms
dfcaverns_salty - from caverealms with modified alpha channel

132
df_mapitems/util.lua Normal file
View File

@ -0,0 +1,132 @@
-- Used by cave pearls and crystal clusters
-- These methods simulate "wallmounted" nodes using regular facedir, randomizing the rotation around the wallmounted direction.
-- Useful for naturalistic objects you want to have look irregular
df_mapitems.place_against_surface = function(itemstack, placer, pointed_thing)
-- check if pointing at a node
if not pointed_thing then
return itemstack
end
if pointed_thing.type ~= "node" then
return itemstack
end
local under_pos = pointed_thing.under
local above_pos = pointed_thing.above
local under_node = minetest.get_node(under_pos)
local above_node = minetest.get_node(above_pos)
if minetest.is_protected(above_pos, placer:get_player_name()) then
minetest.record_protection_violation(above_pos, placer:get_player_name())
return
end
local under_name = under_node.name
local above_name = above_node.name
local under_def = minetest.registered_nodes[under_name]
local above_def = minetest.registered_nodes[above_name]
-- return if any of the nodes is not registered
if not under_def or not above_def then
return itemstack
end
-- check if you can replace the node above the pointed node
if not above_def.buildable_to then
return itemstack
end
local dir = vector.subtract(under_pos, above_pos)
local param2
if dir.x > 0 then
--facing +x: 16, 17, 18, 19,
param2 = 15 + math.random(1,4)
elseif dir.x < 0 then
--facing -x: 12, 13, 14, 15
param2 = 11 + math.random(1,4)
elseif dir.z > 0 then
--facing +z: 8, 9, 10, 11
param2 = 7 + math.random(1,4)
elseif dir.z < 0 then
--facing -z: 4, 5, 6, 7
param2 = 3 + math.random(1,4)
elseif dir.y > 0 then
--facing -y: 20, 21, 22, 23 (ceiling)
param2 = 19 + math.random(1,4)
else
--facing +y: 0, 1, 2, 3 (floor)
param2 = math.random(1,4) - 1
end
-- add the node and remove 1 item from the itemstack
minetest.add_node(above_pos, {name = itemstack:get_name(), param2 = param2})
if not minetest.setting_getbool("creative_mode") and not minetest.check_player_privs(placer, "creative") then
itemstack:take_item()
end
return itemstack
end
-- Mapgen version of the above
local add_to_table = function(dest, source)
for _, val in ipairs(source) do
table.insert(dest, val)
end
end
local valid_nodes = {} -- cache values
local is_valid_mounting_node = function(c_node)
if valid_nodes[c_node] ~= nil then
return valid_nodes[c_node]
end
local def = minetest.registered_nodes[minetest.get_name_from_content_id(c_node)]
if def ~= nil
and (def.drawtype == "normal" or def.drawtype == nil)
and not def.buildable_to
and not (def.groups and def.groups.falling_node) then
valid_nodes[c_node] = true
return true
end
valid_nodes[c_node] = false
return false
end
--facing +x: 16, 17, 18, 19,
--facing -x: 12, 13, 14, 15
--facing +z: 8, 9, 10, 11
--facing -z: 4, 5, 6, 7
--facing -y: 20, 21, 22, 23, (ceiling)
--facing +y: 0, 1, 2, 3
local get_valid_facedirs_vm = function(vi, area, data)
local dirs = {}
local ystride = area.ystride
local zstride = area.zstride
if is_valid_mounting_node(data[vi+1]) then
add_to_table(dirs, {16, 17, 18, 19})
end
if is_valid_mounting_node(data[vi-1]) then
add_to_table(dirs, {12, 13, 14, 15})
end
if is_valid_mounting_node(data[vi-ystride]) then
add_to_table(dirs, {0, 1, 2, 3})
end
if is_valid_mounting_node(data[vi+ystride]) then
add_to_table(dirs, {20, 21, 22, 23})
end
if is_valid_mounting_node(data[vi+zstride]) then
add_to_table(dirs, {8, 9, 10, 11})
end
if is_valid_mounting_node(data[vi-zstride]) then
add_to_table(dirs, {4, 5, 6, 7})
end
return dirs
end
df_mapitems.place_against_surface_vm = function(c_node, vi, area, data, data_param2)
local facedirs = get_valid_facedirs_vm(vi, area, data)
local count = #facedirs
if count > 0 then
data[vi] = c_node
data_param2[vi] = facedirs[math.random(1, count)]
end
end