distilling out more dependencies

This commit is contained in:
FaceDeer
2022-08-01 21:38:01 -06:00
parent b6c4dedcfb
commit 57792c07f8
15 changed files with 140 additions and 98 deletions

View File

@ -7,7 +7,7 @@ minetest.register_node("df_underworld_items:glow_amethyst", {
tiles = {"dfcaverns_glow_amethyst.png"},
is_ground_content = false,
groups = {cracky=3, pit_plasma_resistant=1},
sounds = default.node_sound_glass_defaults(),
sounds = df_underworld_items.sounds.glass(),
light_source = 6,
paramtype = "light",
use_texture_alpha = "blend",

View File

@ -4,7 +4,23 @@ df_underworld_items.abm_neighbors = {}
-- don't trigger on air, that's for sparkle generation
df_underworld_items.abm_neighbors.pit_plasma = {"group:stone", "df_underworld_items:glow_amethyst", "group:lava", "group:water"}
df_underworld_items.sounds = {}
df_underworld_items.sounds.glass = df_dependencies.sound_glass
df_underworld_items.sounds.stone = df_dependencies.sound_stone
df_underworld_items.sounds.slade = df_dependencies.sound_stone({ footstep = { name = "bedrock2_step", gain = 1 } })
df_underworld_items.sounds.slade_gravel = df_dependencies.sound_gravel({footstep = {name = df_dependencies.soundfile_gravel_footstep, gain = 0.45},})
df_underworld_items.nodes = {}
df_underworld_items.nodes.lava_source = df_dependencies.node_name_lava_source
df_underworld_items.nodes.meselamp = df_dependencies.node_name_meselamp
df_underworld_items.LIGHT_MAX = df_dependencies.LIGHT_MAX
-- This stuff should only be used during initialization
minetest.after(0, function()
df_underworld_items.abm_neighbors = nil
df_underworld.sounds = nil
df_underworld.nodes = nil
df_underworld.LIGHT_MAX = nil
end)

View File

@ -19,7 +19,7 @@ local glowstone_def = {
},
is_ground_content = false,
groups = {cracky=3},
sounds = default.node_sound_glass_defaults(),
sounds = df_underworld_items.sounds.glass(),
paramtype = "light",
drawtype = "glasslike",
drop = "",

View File

@ -1,5 +1,7 @@
local S = df_underworld_items.S
local lava_source = df_underworld_items.nodes.lava_source
minetest.register_node("df_underworld_items:pit_plasma", {
description = S("Glowing Pit Plasma"),
_doc_items_longdesc = df_underworld_items.doc.pit_plasma_desc,
@ -144,7 +146,7 @@ if df_underworld_items.config.destructive_pit_plasma then
if math.random() < 0.66 then
minetest.set_node(test_pos, {name="df_underworld_items:glow_amethyst"})
else
minetest.set_node(test_pos, {name="default:lava_source"})
minetest.set_node(test_pos, {name=lava_source})
end
else
minetest.set_node(test_pos, {name="air"})

View File

@ -1,4 +1,4 @@
name = df_underworld_items
description = Various node types used by the dfcaverns mapgen mod for its underworld layer.
depends = default
depends = df_dependencies
optional_depends = doc, radiant_damage, mesecons_mvps, tnt, stairs, hunter_statue

View File

@ -16,6 +16,7 @@ if invulnerable then
slade_groups.immortal = 1
end
local lava_source = df_underworld_items.nodes.lava_source
-- Ensures that the node is functioning correctly
local ensure_meta = function(pos)
@ -188,7 +189,7 @@ local puzzle_seal_def = {
paramtype2 = "facedir",
light_source = 8,
groups = slade_groups,
sounds = default.node_sound_stone_defaults({ footstep = { name = "bedrock2_step", gain = 1 } }),
sounds = df_underworld_items.sounds.slade,
selection_box = {
type = "fixed",
fixed = {-0.625, -0.625, -0.625, 0.625, 0.625, 0.625},
@ -247,9 +248,9 @@ local digging_seal_def = {
tiles = {"dfcaverns_pit_plasma_static.png", "dfcaverns_pit_plasma_static.png^dfcaverns_seal.png", "dfcaverns_pit_plasma_static.png"},
paramtype = "light",
paramtype2 = "facedir",
light_source = default.LIGHT_MAX,
light_source = df_underworld_items.LIGHT_MAX,
groups = {immortal=1, stone=1, level=3, slade=1, pit_plasma_resistant=1, mese_radiation_shield=1, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults({ footstep = { name = "bedrock2_step", gain = 1 } }),
sounds = df_underworld_items.sounds.slade,
selection_box = {
type = "fixed",
fixed = {-0.625, -0.625, -0.625, 0.625, 0.625, 0.625},
@ -302,7 +303,7 @@ local digging_seal_def = {
if minetest.get_item_group(below_node.name, "slade") == 0 then
tnt.boom({x=pos.x, y=pos.y-2, z=pos.z}, {radius=3})
minetest.set_node(pos, {name="default:lava_source"})
minetest.set_node(pos, {name=lava_source})
return
end
@ -321,7 +322,7 @@ local digging_seal_def = {
node.param2 = 0
else
tnt.boom(pos, {radius=3})
minetest.set_node(pos, {name="default:lava_source"})
minetest.set_node(pos, {name=lava_source})
return
end
minetest.set_node(pos, {name="air"})
@ -367,7 +368,7 @@ local inscription_block_def = {
},
paramtype2 = "facedir",
groups = slade_groups,
sounds = default.node_sound_stone_defaults({ footstep = { name = "bedrock2_step", gain = 1 } }),
sounds = df_underworld_items.sounds.slade,
is_ground_content = false,
can_dig = can_dig,
on_blast = function() end,
@ -405,7 +406,7 @@ local capstone_def = {
paramtype2 = "facedir",
groups = slade_groups,
light_source = 8,
sounds = default.node_sound_stone_defaults({ footstep = { name = "bedrock2_step", gain = 1 } }),
sounds = df_underworld_items.sounds.slade,
is_ground_content = false,
can_dig = can_dig,
on_blast = function() end,
@ -418,7 +419,7 @@ minetest.register_node("df_underworld_items:slade_capstone", capstone_def)
-- Schematics
local n1 = { name = "df_underworld_items:slade_block" }
local n5 = { name = "default:meselamp" }
local n5 = { name = df_underworld_items.nodes.meselamp }
local n6 = { name = "air", prob = 0 } -- ceiling pieces to leave in place
local n8 = { name = "df_underworld_items:puzzle_seal" }
local n3 = { name = "air"}
@ -448,7 +449,7 @@ if minetest.get_modpath("stairs") then
{"dfcaverns_slade_block.png"},
S("Slade Block Stair"),
S("Slade Block Slab"),
default.node_sound_stone_defaults({ footstep = { name = "bedrock2_step", gain = 1 } })
df_underworld_items.sounds.slade
)
if invulnerable then

View File

@ -21,7 +21,7 @@ local slade_def = {
_doc_items_usagehelp = df_underworld_items.doc.slade_usage,
tiles = {"dfcaverns_slade.png"},
groups = {cracky=3, stone=1, level=3, slade=1, pit_plasma_resistant=1, mese_radiation_shield=1},
sounds = default.node_sound_stone_defaults({ footstep = { name = "bedrock2_step", gain = 1 } }),
sounds = df_underworld_items.sounds.slade,
is_ground_content = false,
on_blast = function(pos, intensity)
if intensity > 3.0 then
@ -41,7 +41,7 @@ local slade_brick_def = {
_doc_items_usagehelp = df_underworld_items.doc.slade_usage,
tiles = {"dfcaverns_slade_brick.png"},
groups = { cracky=3, stone=1, level=3, slade=1, pit_plasma_resistant=1, mese_radiation_shield=1},
sounds = default.node_sound_stone_defaults({ footstep = { name = "bedrock2_step", gain = 1 } }),
sounds = df_underworld_items.sounds.slade,
is_ground_content = false,
}
if invulnerable then
@ -67,7 +67,7 @@ local slade_wall_def = {
walkable = true,
is_ground_content = false,
groups = { cracky=3, stone=1, level=3, slade=1, pit_plasma_resistant=1, mese_radiation_shield=1},
sounds = default.node_sound_stone_defaults({ footstep = { name = "bedrock2_step", gain = 1 } }),
sounds = df_underworld_items.sounds.slade,
}
if invulnerable then
add_immortality(slade_wall_def)
@ -82,9 +82,7 @@ minetest.register_node("df_underworld_items:slade_sand", {
tiles = {"dfcaverns_slade_sand.png"},
is_ground_content = false,
groups = {crumbly = 3, level = 2, falling_node = 1, slade=1, pit_plasma_resistant=1, mese_radiation_shield=1},
sounds = default.node_sound_gravel_defaults({
footstep = {name = "default_gravel_footstep", gain = 0.45},
}),
sounds = df_dependencies.sound_gravel,
})
local slade_block_def = {
@ -93,7 +91,7 @@ local slade_block_def = {
_doc_items_usagehelp = df_underworld_items.doc.slade_usage,
tiles = {"dfcaverns_slade_block.png"},
groups = {cracky=3, stone=1, level=3, slade=1, pit_plasma_resistant=1, mese_radiation_shield=1},
sounds = default.node_sound_stone_defaults({ footstep = { name = "bedrock2_step", gain = 1 } }),
sounds = df_underworld_items.sounds.slade,
is_ground_content = false,
}
if invulnerable then
@ -109,7 +107,7 @@ local slade_seal_def = {
_doc_items_usagehelp = df_underworld_items.doc.slade_usage,
tiles = {"dfcaverns_slade_block.png^dfcaverns_seal.png", "dfcaverns_slade_block.png"},
groups = {cracky=3, stone=1, level=3, slade=1, pit_plasma_resistant=1, mese_radiation_shield=1},
sounds = default.node_sound_stone_defaults({ footstep = { name = "bedrock2_step", gain = 1 } }),
sounds = df_underworld_items.sounds.slade,
is_ground_content = false,
}
if invulnerable then
@ -154,7 +152,7 @@ if minetest.get_modpath("stairs") then
{"dfcaverns_slade_brick.png"},
S("Slade Stair"),
S("Slade Slab"),
default.node_sound_stone_defaults({ footstep = { name = "bedrock2_step", gain = 1 } })
df_underworld_items.sounds.slade
)
if invulnerable then