get rid of meselamp dependency, bring in ancient lanterns from deep roads

This commit is contained in:
FaceDeer 2022-08-06 16:11:39 -06:00
parent 79e185f9cf
commit aec23c703d
11 changed files with 197 additions and 21 deletions

View File

@ -19,7 +19,6 @@ df_caverns.node_id.stone_with_coal = minetest.get_content_id(df_dependencies.nod
df_caverns.node_id.water = minetest.get_content_id(df_dependencies.node_name_water_source)
df_caverns.node_name = {}
df_caverns.node_name.meselamp = df_dependencies.node_name_meselamp
df_caverns.node_name.stone = df_dependencies.node_name_stone
minetest.after(0, function()

View File

@ -8,7 +8,7 @@ local n7 = { name = "stairs:stair_slade_brick", param2 = 1, force_place=true }
local n8 = { name = "df_underworld_items:slade_brick", force_place=true }
local n9 = { name = "stairs:stair_slade_brick", param2 = 3, force_place=true }
local n10 = { name = "df_underworld_items:slade_wall", force_place=true }
local n11 = { name = df_caverns.node_name.meselamp, force_place=true }
local n11 = { name = "df_underworld_items:stonebrick_light_worn", prob=192 } -- 50% chance of being force-placed
local n12 = { name = "stairs:stair_outer_slade_brick", param2 = 2, force_place=true }
local n13 = { name = "stairs:stair_slade_brick", param2 = 2, force_place=true }
local n14 = { name = "stairs:stair_outer_slade_brick", param2 = 3, force_place=true }
@ -18,13 +18,32 @@ return {
size = {x = 3, y = 15, z = 3},
center_pos = {x = 1, y = 7, z = 1},
data = {
n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
n1, n1, n1, n1, n1, n1, n1, n2, n3, n4, n5, n5, n5, n5, n5, n5, n5,
n5, n5, n5, n5, n5, n5, n5, n5, n5, n5, n5, n1, n1, n1, n1, n5, n1,
n1, n5, n1, n1, n5, n1, n1, n5, n1, n1, n5, n1, n1, n5, n1, n1, n6,
n1, n7, n8, n9, n5, n8, n5, n5, n8, n5, n5, n10, n5, n5, n10, n5, n5,
n11, n5, n5, n5, n5, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n12, n13, n14, n5,
n5, n5, n5, n5, n5, n5, n5, n5, n5, n5, n5, n5, n5, n5, n5, n5, n5,
n1, n1, n1, n1, n1, n1, n1, n1, n1,
n1, n1, n1, n1, n1, n1, n1, n1, n1,
n1, n1, n1, n1, n1, n1, n2, n3, n4,
n5, n5, n5,
n5, n5, n5,
n5, n5, n5,
n5, n5, n5,
n5, n11, n5,
n5, n5, n5,
n1, n1, n1, n1, n5, n1, n1, n5, n1,
n1, n5, n1, n1, n5, n1, n1, n5, n1,
n1, n5, n1, n1, n6, n1, n7, n8, n9,
n5, n8, n5,
n5, n8, n5,
n5, n10, n5,
n5, n10, n5,
n11, n10, n11,
n5, n5, n5,
n1, n1, n1, n1, n1, n1, n1, n1, n1,
n1, n1, n1, n1, n1, n1, n1, n1, n1,
n1, n1, n1, n1, n1, n1, n12, n13, n14,
n5, n5, n5,
n5, n5, n5,
n5, n5, n5,
n5, n5, n5,
n5, n11, n5,
n5, n5, n5,
}
}

View File

@ -469,6 +469,13 @@ minetest.register_on_generated(function(minp, maxp, seed)
mapgen_helper.place_schematic_on_data(data, data_param2, area, building.pos, oubliette_schematic, 0, {["df_underworld_items:slade_seal"] = "air"})
elseif building.building_type == "lamppost" then
mapgen_helper.place_schematic_on_data(data, data_param2, area, building.pos, lamppost_schematic)
local lamp_pos = vector.new(building.pos.x, building.pos.y+6, building.pos.z)
minetest.after(math.random()*10, function()
minetest.get_node_timer({x=lamp_pos.x+1, y=lamp_pos.y, z=lamp_pos.z}):start(math.random()*60)
minetest.get_node_timer({x=lamp_pos.x-1, y=lamp_pos.y, z=lamp_pos.z}):start(math.random()*60)
minetest.get_node_timer({x=lamp_pos.x, y=lamp_pos.y, z=lamp_pos.z+1}):start(math.random()*60)
minetest.get_node_timer({x=lamp_pos.x, y=lamp_pos.y, z=lamp_pos.z-1}):start(math.random()*60)
end)
elseif building.building_type == "small building" then
mapgen_helper.place_schematic_on_data(data, data_param2, area, building.pos, small_building_schematic, building.rotation)
elseif building.building_type == "medium building" then

View File

@ -38,7 +38,7 @@ df_dependencies.texture_stone = select_required({default="default_stone.png", mc
df_dependencies.texture_wood = select_required({default="default_wood.png", mcl_core="default_wood.png"})
df_dependencies.texture_mineral_coal = select_required({default="default_mineral_coal.png", mcl_core="mcl_core_coal_ore.png"}) -- MCL's coal texture isn't transparent, but is only used with gas seeps and should work fine that way
df_dependencies.texture_glass_bottle = select_required({vessels="vessels_glass_bottle.png", mcl_potions="mcl_potions_potion_bottle.png"})
df_dependencies.texture_meselamp = "dfcaverns_glow_mese.png"
local prefix = "dfcaverns_"
-- NOTE: These defaults are from df_caverns' config. Update them if those change.
@ -58,13 +58,15 @@ if minetest.settings:get_bool(prefix.."enable_primordial", true) then
end
lowest_elevation = lowest_elevation - 193 -- add a little buffer space
minetest.debug("lowest elevation: " .. tostring(lowest_elevation))
df_dependencies.mods_required.mcl_init = true
df_dependencies.mods_required.mcl_worlds = true
df_dependencies.mods_required.mcl_strongholds = true
df_dependencies.mods_required.mcl_compatibility = true
df_dependencies.mods_required.mcl_mapgen = true
if minetest.get_modpath("mcl_init") then -- Mineclone 2
local old_overworld_min = mcl_vars.mg_overworld_min -- rememeber this for weather control
local old_overworld_min = mcl_vars.mg_overworld_min -- remember this for weather control
mcl_vars.mg_overworld_min = lowest_elevation
mcl_vars.mg_bedrock_overworld_min = mcl_vars.mg_overworld_min
@ -105,8 +107,18 @@ end
if minetest.get_modpath("mcl_mapgen") then -- Mineclone 5
mcl_mapgen.overworld.min = lowest_elevation
mcl_mapgen.overworld.bedrock_min = mcl_mapgen.overworld.min
mcl_mapgen.overworld.bedrock_max = mcl_mapgen.overworld.min+4
mcl_mapgen.overworld.bedrock_max = mcl_mapgen.overworld.bedrock_min + (mcl_mapgen.bedrock_is_rough and 4 or 0)
mcl_mapgen.overworld.lava_max = mcl_mapgen.overworld.min+6
mcl_mapgen.end_.max = mcl_mapgen.overworld.min - 2000
mcl_mapgen.realm_barrier_overworld_end_max = mcl_mapgen.end_.max
mcl_mapgen.realm_barrier_overworld_end_min = mcl_mapgen.end_.max - 11
if mcl_mapgen.on_settings_changed then
mcl_mapgen.on_settings_changed()
end
end
--minetest.after(1, function()
--minetest.debug("mcl_vars="..dump(mcl_vars))
--minetest.debug("mcl_mapgen="..dump(mcl_mapgen))
--end)

View File

@ -39,7 +39,6 @@ df_dependencies.node_name_ice = select_required("default:ice", "mcl_core:ice")
df_dependencies.node_name_junglewood = select_required("default:junglewood", "mcl_core:junglewood")
df_dependencies.node_name_lava_source = select_required("default:lava_source", "mcl_core:lava_source")
df_dependencies.node_name_mese_crystal = select_required("default:mese_crystal", "mesecons:redstone") -- TODO make sure this is properly balanced. Also, mesecons mod conflict with non-mcl mesecons?
df_dependencies.node_name_meselamp = select_required("default:meselamp", "mcl_lanterns:lantern_floor")
df_dependencies.node_name_mossycobble = select_required("default:mossycobble", "mcl_core:mossycobble")
df_dependencies.node_name_obsidian = select_required("default:obsidian", "mcl_core:obsidian")
df_dependencies.node_name_paper = select_required("default:paper", "mcl_core:paper")

View File

@ -25,10 +25,10 @@ end
if not minetest.get_modpath("stairs") then
-- replace stairs with air
n3 = nil
n20 = nil
n21 = nil
n22 = nil
n3 = n1
n20 = n1
n21 = n1
n22 = n1
end
return {

View File

@ -0,0 +1,135 @@
local S = minetest.get_translator(minetest.get_current_modname())
local lantern_nodebox = {
{-0.5, -0.5, -0.5, -0.3125, 0.5, -0.3125},
{-0.5, -0.5, 0.3125, -0.3125, 0.5, 0.5},
{0.3125, -0.5, 0.3125, 0.5, 0.5, 0.5},
{0.3125, -0.5, -0.5, 0.5, 0.5, -0.3125},
{-0.3125, 0.3125, -0.5, 0.3125, 0.5, -0.3125},
{-0.3125, 0.3125, 0.3125, 0.3125, 0.5, 0.5},
{0.3125, 0.3125, -0.3125, 0.5, 0.5, 0.3125},
{-0.5, 0.3125, -0.3125, -0.3125, 0.5, 0.3125},
{-0.5, -0.5, -0.3125, -0.3125, -0.3125, 0.3125},
{0.3125, -0.5, -0.3125, 0.5, -0.3125, 0.3125},
{-0.3125, -0.5, 0.3125, 0.3125, -0.3125, 0.5},
{-0.3125, -0.5, -0.5, 0.3125, -0.3125, -0.3125},
{-0.375, -0.375, -0.375, 0.375, 0.375, 0.375},
}
local mese_crystal_node = df_underworld_items.nodes.mese_crystal
local brick_texture = "dfcaverns_slade_brick.png"--df_underworld_items.textures.stone_brick
local lantern_texture = df_underworld_items.textures.meselamp
local ancient_lantern_sound = df_underworld_items.sounds.slade
local invulnerable = df_underworld_items.config.invulnerable_slade and not minetest.settings:get_bool("creative_mode")
local can_dig
if invulnerable then
can_dig = function(pos, player)
return minetest.check_player_privs(player, "server")
end
end
local slade_groups = {stone=1, level=3, slade=1, pit_plasma_resistant=1, mese_radiation_shield=1, cracky = 3}
if invulnerable then
slade_groups.immortal = 1
end
local punch_fix = function(pos, node, puncher, pointed_thing)
local wielded = puncher:get_wielded_item()
if wielded:get_name() == mese_crystal_node then
minetest.set_node(pos, {name="df_underworld_items:stonebrick_light"})
minetest.get_node_timer(pos):stop()
if not (creative and creative.is_enabled_for and creative.is_enabled_for(puncher:get_player_name())) then
wielded:take_item()
puncher:set_wielded_item(wielded)
end
return
end
minetest.node_punch(pos, node, puncher, pointed_thing)
end
minetest.register_node("df_underworld_items:stonebrick_light", {
description = S("Ancient Lantern"),
paramtype2 = "facedir",
place_param2 = 0,
tiles = {brick_texture .. "^(" .. lantern_texture .. "^[mask:dfcaverns_lantern_mask.png)"},
is_ground_content = false,
groups = slade_groups,
sounds = ancient_lantern_sound,
drawtype= "nodebox",
light_source = minetest.LIGHT_MAX,
node_box = {
type = "fixed",
fixed = lantern_nodebox,
},
can_dig = can_dig,
})
minetest.register_node("df_underworld_items:stonebrick_light_worn", {
description = S("Ancient Lantern"),
paramtype2 = "facedir",
place_param2 = 0,
tiles = {brick_texture .. "^(" .. lantern_texture .. "^[multiply:#FF8888^[mask:dfcaverns_lantern_mask.png)"},
is_ground_content = false,
groups = slade_groups,
sounds = ancient_lantern_sound,
drawtype= "nodebox",
light_source = 6,
node_box = {
type = "fixed",
fixed = lantern_nodebox,
},
on_construct = function(pos)
minetest.get_node_timer(pos):start(math.random(100, 200))
end,
on_timer = function(pos, elapsed)
minetest.swap_node(pos, {name="df_underworld_items:stonebrick_light_burnt_out"})
if math.random() < 0.1 then
minetest.get_node_timer(pos):start(math.random(30, 60))
else
minetest.get_node_timer(pos):start(0.25)
end
end,
on_punch = punch_fix,
can_dig = can_dig,
})
minetest.register_node("df_underworld_items:stonebrick_light_burnt_out", {
description = S("Ancient Lantern"),
paramtype2 = "facedir",
place_param2 = 0,
tiles = {brick_texture .. "^(" .. lantern_texture .. "^[multiply:#884444^[mask:dfcaverns_lantern_mask.png)"},
is_ground_content = false,
groups = slade_groups,
sounds = ancient_lantern_sound,
drawtype= "nodebox",
light_source = 0,
node_box = {
type = "fixed",
fixed = lantern_nodebox,
},
drops = "df_underworld_items:stonebrick_light_worn",
on_construct = function(pos)
minetest.get_node_timer(pos):start(math.random(100, 200))
end,
on_timer = function(pos, elapsed)
minetest.swap_node(pos, {name="df_underworld_items:stonebrick_light_worn"})
if math.random() < 0.1 then
minetest.get_node_timer(pos):start(math.random(300, 600))
else
minetest.get_node_timer(pos):start(0.25)
end
end,
on_punch = punch_fix,
can_dig = can_dig,
})
--minetest.register_craft({
-- output = "df_underworld_items:stonebrick_light",
-- type = "shapeless",
-- recipe = {
-- "group:df_underworld_items_ancient_lantern",
-- mese_crystal_node,
-- }
--})

View File

@ -13,11 +13,15 @@ df_underworld_items.sounds.slade_gravel = df_dependencies.sound_gravel({footstep
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.nodes.mese_crystal = df_dependencies.node_name_mese_crystal
df_underworld_items.textures = {}
df_underworld_items.textures.meselamp = df_dependencies.texture_meselamp
-- This stuff should only be used during initialization
minetest.after(0, function()
df_underworld_items.abm_neighbors = nil
df_underworld_items.sounds = nil
df_underworld_items.nodes = nil
df_underworld_items.textures = nil
end)

View File

@ -14,4 +14,6 @@ dofile(modpath.."/slade.lua")
dofile(modpath.."/hunter_statue.lua")
dofile(modpath.."/glowing_pit_plasma.lua")
dofile(modpath.."/puzzle_seal.lua")
dofile(modpath.."/puzzle_seal.lua")
dofile(modpath.."/ancient_lanterns.lua")

View File

@ -419,7 +419,6 @@ minetest.register_node("df_underworld_items:slade_capstone", capstone_def)
-- Schematics
local n1 = { name = "df_underworld_items:slade_block" }
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"}

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B