add named waypoints to the underworld

This commit is contained in:
FaceDeer 2020-01-25 13:55:40 -07:00
parent f11e878b08
commit a47c25a89c
6 changed files with 160 additions and 15 deletions

View File

@ -0,0 +1,26 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-01-25 13:52-0700\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"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: df_caverns\underworld.lua:12
msgid "A glowing pit"
msgstr ""
#: df_caverns\underworld.lua:27
msgid "A mysterious seal"
msgstr ""

View File

@ -0,0 +1,6 @@
@echo off
setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
cd ..
set LIST=
for /r %%X in (*.lua) do set LIST=!LIST! %%X
..\..\intllib\tools\xgettext.bat %LIST%

View File

@ -2,7 +2,42 @@ if not df_caverns.config.enable_underworld or not minetest.get_modpath("df_under
return
end
local S = minetest.get_translator("df_caverns")
local bones_loot_path = minetest.get_modpath("bones_loot")
local named_waypoints_path = minetest.get_modpath("named_waypoints")
if named_waypoints_path then
local pit_waypoint_def = {
default_name = S("A glowing pit"),
default_color = 0xFF88FF,
discovery_volume_radius = tonumber(minetest.settings:get("dfcaverns_pit_discovery_range")) or 60,
}
if minetest.settings:get_bool("dfcaverns_pit_hud_requires_mapping_kit", true)
and minetest.registered_items["map:mapping_kit"] then
pit_waypoint_def.visibility_requires_item = "map:mapping_kit"
end
if minetest.settings:get_bool("dfcaverns_show_pits_in_hud", true) then
pit_waypoint_def.visibility_volume_radius = tonumber(minetest.settings:get("dfcaverns_pit_visibility_range")) or 300
pit_waypoint_def.on_discovery = named_waypoints.default_discovery_popup
end
named_waypoints.register_named_waypoints("glowing_pits", pit_waypoint_def)
local seal_waypoint_def = {
default_name = S("A mysterious seal"),
default_color = 0xFF88FF,
discovery_volume_radius = tonumber(minetest.settings:get("dfcaverns_pit_discovery_range")) or 20,
}
if minetest.settings:get_bool("dfcaverns_pit_hud_requires_mapping_kit", true)
and minetest.registered_items["map:mapping_kit"] then
seal_waypoint_def.visibility_requires_item = "map:mapping_kit"
end
if minetest.settings:get_bool("dfcaverns_show_pits_in_hud", true) then
seal_waypoint_def.visibility_volume_radius = tonumber(minetest.settings:get("dfcaverns_pit_visibility_range")) or 300
seal_waypoint_def.on_discovery = named_waypoints.default_discovery_popup
end
named_waypoints.register_named_waypoints("puzzle_seals", seal_waypoint_def)
end
local c_slade = minetest.get_content_id("df_underworld_items:slade")
local c_slade_block = minetest.get_content_id("df_underworld_items:slade_block")
@ -203,9 +238,9 @@ local pit_region_size = region_mapblocks * mapgen_chunksize * 16
local scatter_2d = function(min_xz, gridscale, border_width)
local bordered_scale = gridscale - 2 * border_width
local point = {}
point.x = math.random() * bordered_scale + min_xz.x + border_width
point.x = math.floor(math.random() * bordered_scale + min_xz.x + border_width)
point.y = 0
point.z = math.random() * bordered_scale + min_xz.z + border_width
point.z = math.floor(math.random() * bordered_scale + min_xz.z + border_width)
return point
end
@ -226,7 +261,7 @@ local get_pit = function(pos)
local variance_multiplier = math.random()
local radius = variance_multiplier * (radius_pit_max - 15) + 15
local variance = radius_pit_variance/2 + radius_pit_variance*variance_multiplier/2
local depth = math.random(plasma_depth_min, plasma_depth_max)
local depth = math.random(plasma_depth_min, plasma_depth_max)
math.randomseed(next_seed)
return {location = location, radius = radius, variance = variance, depth = depth}
end
@ -287,6 +322,11 @@ minetest.register_on_generated(function(minp, maxp, seed)
local wave = nvals_wave[index2d] * wave_mult
local floor_height = math.floor(abs_cave * floor_mult + median + floor_displace + wave)
if named_waypoints_path and floor_height == y and pit and pit.location.x == x and pit.location.z == z then
named_waypoints.add_waypoint("glowing_pits", {x=x, y=y, z=z})
end
local underside_height = math.floor(y_min + math.abs(wave) / 5)+2 -- divide wave by five to smooth out the underside of the slade, we only want the interface to ripple a little down here
local ceiling_height = math.floor(abs_cave * ceiling_mult + median + ceiling_displace + wave)
if (y == underside_height or y == underside_height - 1) and (x % 8 == 0 or z % 8 == 0) then
@ -430,6 +470,10 @@ minetest.register_on_generated(function(minp, maxp, seed)
vm:write_to_map()
if puzzle_seal ~= nil then
if named_waypoints_path then
named_waypoints.add_waypoint("puzzle_seals", puzzle_seal)
end
minetest.place_schematic({x=puzzle_seal.x-3, y=puzzle_seal.y, z=puzzle_seal.z-3}, df_underworld_items.seal_temple_schem, 0, {}, true)
local node_name = minetest.get_node(puzzle_seal).name
local node_def = minetest.registered_nodes[node_name]

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-24 21:26-0700\n"
"POT-Creation-Date: 2020-01-25 13:52-0700\n"
"PO-Revision-Date: 2017-08-17 23:01+0100\n"
"Last-Translator: H4mlet <h4mlet@riseup.net>\n"
"Language-Team: ITALIANO\n"
@ -85,6 +85,38 @@ msgstr ""
msgid "Lightseam"
msgstr ""
#: df_underworld_items\puzzle_seal.lua:108
msgid "Turn"
msgstr ""
#: df_underworld_items\puzzle_seal.lua:178
msgid "Slade Puzzle Seal"
msgstr ""
#: df_underworld_items\puzzle_seal.lua:238
msgid "Active Slade Breacher"
msgstr ""
#: df_underworld_items\puzzle_seal.lua:336
msgid "A breach in the Slade"
msgstr ""
#: df_underworld_items\puzzle_seal.lua:347
msgid "Inscribed Slade Block"
msgstr ""
#: df_underworld_items\puzzle_seal.lua:370
msgid "Slade Capstone"
msgstr ""
#: df_underworld_items\puzzle_seal.lua:439
msgid "Slade Block Stair"
msgstr ""
#: df_underworld_items\puzzle_seal.lua:440
msgid "Slade Block Slab"
msgstr ""
#: df_underworld_items\slade.lua:18
msgid "Slade"
msgstr ""
@ -97,23 +129,23 @@ msgstr ""
msgid "Slade Wall"
msgstr ""
#: df_underworld_items\slade.lua:77
#: df_underworld_items\slade.lua:78
msgid "Slade Sand"
msgstr ""
#: df_underworld_items\slade.lua:89
#: df_underworld_items\slade.lua:90
msgid "Slade Block"
msgstr ""
#: df_underworld_items\slade.lua:105
#: df_underworld_items\slade.lua:106
msgid "Slade Seal"
msgstr ""
#: df_underworld_items\slade.lua:154
#: df_underworld_items\slade.lua:155
msgid "Slade Stair"
msgstr ""
#: df_underworld_items\slade.lua:155
#: df_underworld_items\slade.lua:156
msgid "Slade Slab"
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-24 21:26-0700\n"
"POT-Creation-Date: 2020-01-25 13:52-0700\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"
@ -84,6 +84,38 @@ msgstr ""
msgid "Lightseam"
msgstr ""
#: df_underworld_items\puzzle_seal.lua:108
msgid "Turn"
msgstr ""
#: df_underworld_items\puzzle_seal.lua:178
msgid "Slade Puzzle Seal"
msgstr ""
#: df_underworld_items\puzzle_seal.lua:238
msgid "Active Slade Breacher"
msgstr ""
#: df_underworld_items\puzzle_seal.lua:336
msgid "A breach in the Slade"
msgstr ""
#: df_underworld_items\puzzle_seal.lua:347
msgid "Inscribed Slade Block"
msgstr ""
#: df_underworld_items\puzzle_seal.lua:370
msgid "Slade Capstone"
msgstr ""
#: df_underworld_items\puzzle_seal.lua:439
msgid "Slade Block Stair"
msgstr ""
#: df_underworld_items\puzzle_seal.lua:440
msgid "Slade Block Slab"
msgstr ""
#: df_underworld_items\slade.lua:18
msgid "Slade"
msgstr ""
@ -96,22 +128,22 @@ msgstr ""
msgid "Slade Wall"
msgstr ""
#: df_underworld_items\slade.lua:77
#: df_underworld_items\slade.lua:78
msgid "Slade Sand"
msgstr ""
#: df_underworld_items\slade.lua:89
#: df_underworld_items\slade.lua:90
msgid "Slade Block"
msgstr ""
#: df_underworld_items\slade.lua:105
#: df_underworld_items\slade.lua:106
msgid "Slade Seal"
msgstr ""
#: df_underworld_items\slade.lua:154
#: df_underworld_items\slade.lua:155
msgid "Slade Stair"
msgstr ""
#: df_underworld_items\slade.lua:155
#: df_underworld_items\slade.lua:156
msgid "Slade Slab"
msgstr ""

View File

@ -2,6 +2,8 @@
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local named_waypoints_path = minetest.get_modpath("named_waypoints")
local invulnerable = df_underworld_items.config.invulnerable_slade and not minetest.settings:get_bool("creative_mode")
local slade_groups = nil
@ -330,6 +332,9 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
local pos_string = formname:sub(prefix_len+1)
local pos = minetest.string_to_pos(pos_string)
if test_key(pos) then
if named_waypoints_path then
named_waypoints.update_waypoint("puzzle_seals", pos, {name=S("A breach in the Slade")})
end
minetest.set_node(pos, {name="df_underworld_items:digging_seal", param2 = math.random(1,4)-1})
minetest.get_node_timer(pos):start(4)
minetest.close_formspec(player:get_player_name(), formname)