fix puzzle seal formspec for mcl

This commit is contained in:
FaceDeer 2022-08-09 22:35:37 -06:00
parent 82c4950715
commit 56850bb7e7
11 changed files with 56 additions and 10 deletions

View File

@ -53,6 +53,14 @@ local wave_mult = 10
local y_max = median + 2*wave_mult + -2*ceiling_mult + ceiling_displace
local y_min = median - 2*wave_mult - 2*floor_mult + floor_displace
df_caverns.register_biome_check(function(pos, heat, humidity)
if pos.y > y_max or pos.y < y_min then
return
end
-- TODO: account for perlin noise
return "lava_sea"
end)
minetest.register_on_generated(function(minp, maxp, seed)
--if out of range of cave definition limits, abort
if minp.y > y_max or maxp.y < y_min then

View File

@ -46,7 +46,7 @@ local get_biome = function(heat, humidity)
end
end
table.insert(df_caverns.get_biome_at_pos_list, function(pos, heat, humidity)
df_caverns.register_biome_check(function(pos, heat, humidity)
if pos.y < df_caverns.config.level1_min or pos.y > df_caverns.config.ymax then
return nil
end

View File

@ -47,7 +47,7 @@ local get_biome = function(heat, humidity)
end
end
table.insert(df_caverns.get_biome_at_pos_list, function(pos, heat, humidity)
df_caverns.register_biome_check(function(pos, heat, humidity)
if pos.y < df_caverns.config.level2_min or pos.y >= df_caverns.config.level1_min then
return nil
end

View File

@ -41,7 +41,7 @@ local get_biome = function(heat, humidity)
end
end
table.insert(df_caverns.get_biome_at_pos_list, function(pos, heat, humidity)
df_caverns.register_biome_check(function(pos, heat, humidity)
if pos.y < df_caverns.config.level3_min or pos.y >= df_caverns.config.level2_min then
return nil
end

View File

@ -46,6 +46,14 @@ local c_lava_set
local y_max = median + 2*wave_mult + 2*ceiling_mult + ceiling_displace
local y_min = median - 2*wave_mult + 2*floor_mult + floor_displace
df_caverns.register_biome_check(function(pos, heat, humidity)
if pos.y > y_max or pos.y < y_min then
return
end
-- TODO: account for perlin noise
return "oil_sea"
end)
minetest.register_on_generated(function(minp, maxp, seed)
--if out of range of cave definition limits, abort
if minp.y > y_max or maxp.y < y_min then

View File

@ -29,7 +29,7 @@ local perlin_wave_primordial = {
local giant_mycelium_timer_spread = tonumber(minetest.settings:get("dcaverns_giant_mycelium_timer_spread")) or 10
table.insert(df_caverns.get_biome_at_pos_list, function(pos, heat, humidity)
df_caverns.register_biome_check(function(pos, heat, humidity)
if pos.y < df_caverns.config.primordial_min or pos.y > df_caverns.config.primordial_max then
return nil
end

View File

@ -23,11 +23,14 @@ local c_webs_egg = df_caverns.node_id.big_webs_egg
df_caverns.data_param2 = {} -- shared among all mapgens to reduce memory clutter
df_caverns.get_biome_at_pos_list = {} -- a list of methods of the form function(pos, heat, humidity) to allow modpack-wide queries about what should grow where
local get_biome_at_pos_list = {} -- a list of methods of the form function(pos, heat, humidity) to allow modpack-wide queries about what should grow where
df_caverns.register_biome_check = function(func)
table.insert(get_biome_at_pos_list, func)
end
df_caverns.get_biome = function(pos)
local heat = minetest.get_heat(pos)
local humidity = minetest.get_humidity(pos)
for _, val in pairs(df_caverns.get_biome_at_pos_list) do
for _, val in pairs(get_biome_at_pos_list) do
local biome = val(pos, heat, humidity)
if biome ~= nil then
return biome

View File

@ -99,7 +99,7 @@ local hot_zone_boundary = 70
local middle_zone_boundary = 50
local cool_zone_boundary = 30
table.insert(df_caverns.get_biome_at_pos_list, function(pos, heat, humidity)
df_caverns.register_biome_check(function(pos, heat, humidity)
if pos.y < df_caverns.config.sunless_sea_min or pos.y >= df_caverns.config.level3_min then
return nil
end

View File

@ -333,6 +333,14 @@ minetest.register_chatcommand("find_pit", {
end,
})
df_caverns.register_biome_check(function(pos, heat, humidity)
if pos.y > y_max or pos.y < y_min then
return
end
-- TODO: account for perlin noise
return "underworld"
end)
minetest.register_on_generated(function(minp, maxp, seed)
--if out of range of cave definition limits, abort

View File

@ -191,4 +191,12 @@ elseif minetest.get_modpath("mcl_explosions") then
df_dependencies.tnt_boom = function(pos, def)
mcl_explosions.explode(pos, def.radius)
end
end
df_dependencies.mods_required.mcl_formspec = true
df_dependencies.get_itemslot_bg = function(X,Y,W,H)
return ""
end
if minetest.get_modpath("mcl_formspec") then
df_dependencies.get_itemslot_bg = mcl_formspec.get_itemslot_bg
end

View File

@ -124,8 +124,8 @@ end
--The danger is unleashed if you disturb this place.
--This place is best shunned and left uninhabited.
-- TODO: formspec needs Mineclone compatibility
local formspec_prefix = "df_underworld_items_puzzle_seal:"
local itemslot_bg = df_dependencies.get_itemslot_bg
local get_formspec = function(pos, unlocked)
local formspec =
"size[8,8]"
@ -133,13 +133,21 @@ local get_formspec = function(pos, unlocked)
.."image[5.8,0;2.5,4;dfcaverns_puzzle_inscription_background.png^[transformR180^dfcaverns_puzzle_inscription_2.png]"
.."container[2.25,0]"
.."list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0.25,0.25;1,1;0]"
..itemslot_bg(0.25,0.25,1,1)
.."list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;1.25,0;1,1;1]"
..itemslot_bg(1.25,0,1,1)
.."list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;2.25,0.25;1,1;2]"
..itemslot_bg(2.25,0.25,1,1)
.."list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;2.5,1.25;1,1;3]"
..itemslot_bg(2.5,1.25,1,1)
.."list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;2.25,2.25;1,1;4]"
..itemslot_bg(2.25,2.25,1,1)
.."list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;1.25,2.5;1,1;5]"
..itemslot_bg(1.25,2.5,1,1)
.."list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0.25,2.25;1,1;6]"
..itemslot_bg(0.25,2.25,1,1)
.."list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0,1.25;1,1;7]"
..itemslot_bg(0,1.25,1,1)
if unlocked then
formspec = formspec .. "image_button[1.25,1.25;1,1;dfcaverns_seal.png;open;"..S("Turn").."]"
else
@ -152,8 +160,11 @@ local get_formspec = function(pos, unlocked)
-- .."box[0,0;1,5;#0A0000]box[0.1,0.1;0.8,4.8;#000000]box[0.1," .. 0.1 + 4.8*completion ..";0.8,".. 4.8*completion ..";#FFCC22]"
-- .."container_end[]"
.."container[0,4]list[current_player;main;0,0;8,1;]listring[]"
.."list[current_player;main;0,1.25;8,3;8]container_end[]"
return formspec
..itemslot_bg(0,0,8,1)
.."list[current_player;main;0,1.25;8,3;8]"
..itemslot_bg(0,1.25,8,3)
.."container_end[]"
return formspec
end
local refresh_formspec = function(pos, player)
local player_name = player:get_player_name()