diff --git a/df_mapitems/castle_coral.lua b/df_mapitems/castle_coral.lua index a59d67d..dc2beac 100644 --- a/df_mapitems/castle_coral.lua +++ b/df_mapitems/castle_coral.lua @@ -1,4 +1,4 @@ -local S = df_mapitems.S +local S = minetest.get_translator(minetest.get_current_modname()) minetest.register_node("df_mapitems:castle_coral", { description = S("Castle Coral"), diff --git a/df_mapitems/cave_coral.lua b/df_mapitems/cave_coral.lua index 82e312b..263ce31 100644 --- a/df_mapitems/cave_coral.lua +++ b/df_mapitems/cave_coral.lua @@ -1,4 +1,4 @@ -local S = df_mapitems.S +local S = minetest.get_translator(minetest.get_current_modname()) local water_source = df_dependencies.node_name_water_source local coral_skeleton = df_dependencies.node_name_coral_skeleton diff --git a/df_mapitems/cave_pearls.lua b/df_mapitems/cave_pearls.lua index 5eb58a6..4eaa2ff 100644 --- a/df_mapitems/cave_pearls.lua +++ b/df_mapitems/cave_pearls.lua @@ -1,4 +1,4 @@ -local S = df_mapitems.S +local S = minetest.get_translator(minetest.get_current_modname()) minetest.register_node("df_mapitems:cave_pearls", { description = S("Cave Pearls"), diff --git a/df_mapitems/crystals_mese.lua b/df_mapitems/crystals_mese.lua index d7d53ca..bfe5b8d 100644 --- a/df_mapitems/crystals_mese.lua +++ b/df_mapitems/crystals_mese.lua @@ -1,4 +1,4 @@ -local S = df_mapitems.S +local S = minetest.get_translator(minetest.get_current_modname()) --glowing mese crystal blocks minetest.register_node("df_mapitems:glow_mese", { diff --git a/df_mapitems/crystals_ruby.lua b/df_mapitems/crystals_ruby.lua index e84dbd5..b6fec2f 100644 --- a/df_mapitems/crystals_ruby.lua +++ b/df_mapitems/crystals_ruby.lua @@ -1,4 +1,4 @@ -local S = df_mapitems.S +local S = minetest.get_translator(minetest.get_current_modname()) minetest.register_node("df_mapitems:glow_ruby_ore", { description = S("Red Crystal Vein"), diff --git a/df_mapitems/crystals_salt.lua b/df_mapitems/crystals_salt.lua index 7cf7312..51a0599 100644 --- a/df_mapitems/crystals_salt.lua +++ b/df_mapitems/crystals_salt.lua @@ -1,4 +1,4 @@ -local S = df_mapitems.S +local S = minetest.get_translator(minetest.get_current_modname()) minetest.register_node("df_mapitems:salt_crystal", { description = S("Luminous Salt Crystal"), diff --git a/df_mapitems/doc.lua b/df_mapitems/doc.lua index bc0f0c9..359e090 100644 --- a/df_mapitems/doc.lua +++ b/df_mapitems/doc.lua @@ -4,7 +4,7 @@ if not minetest.get_modpath("doc") then return end -local S = df_mapitems.S +local S = minetest.get_translator(minetest.get_current_modname()) df_mapitems.doc.cave_moss_desc = S("Cave moss is technically a form of mold, but fortunately a relatively benign one given its ubiquity. Its fibers form a tough but springy mat over the surface of any organic-rich soil that accumulates deep underground.") df_mapitems.doc.cave_moss_usage = S("Cave moss has no known uses aside from the faint glow it emits. It dies when exposed to bright light sources such as the Sun.") diff --git a/df_mapitems/flowstone.lua b/df_mapitems/flowstone.lua index 2365fc8..d622697 100644 --- a/df_mapitems/flowstone.lua +++ b/df_mapitems/flowstone.lua @@ -1,4 +1,4 @@ -local S = df_mapitems.S +local S = minetest.get_translator(minetest.get_current_modname()) ----------------------------------------------- diff --git a/df_mapitems/glow_worms.lua b/df_mapitems/glow_worms.lua index 2e95c45..3b28501 100644 --- a/df_mapitems/glow_worms.lua +++ b/df_mapitems/glow_worms.lua @@ -1,4 +1,4 @@ -local S = df_mapitems.S +local S = minetest.get_translator(minetest.get_current_modname()) local growth_multiplier = 1 if minetest.get_modpath("df_farming") then diff --git a/df_mapitems/ground_cover.lua b/df_mapitems/ground_cover.lua index fe7693c..531d8de 100644 --- a/df_mapitems/ground_cover.lua +++ b/df_mapitems/ground_cover.lua @@ -1,4 +1,4 @@ -local S = df_mapitems.S +local S = minetest.get_translator(minetest.get_current_modname()) local function soil_type_spread(label, node_to_spread, target_node) diff --git a/df_mapitems/init.lua b/df_mapitems/init.lua index 9ef8bb6..b2db915 100644 --- a/df_mapitems/init.lua +++ b/df_mapitems/init.lua @@ -1,7 +1,6 @@ df_mapitems = {} local modname = minetest.get_current_modname() -df_mapitems.S = minetest.get_translator(modname) local modpath = minetest.get_modpath(modname) --load companion lua files diff --git a/df_mapitems/snareweed.lua b/df_mapitems/snareweed.lua index ec8167b..1b8dc22 100644 --- a/df_mapitems/snareweed.lua +++ b/df_mapitems/snareweed.lua @@ -1,4 +1,4 @@ -local S = df_mapitems.S +local S = minetest.get_translator(minetest.get_current_modname()) minetest.register_node("df_mapitems:snareweed", { description = S("Snareweed"), diff --git a/df_mapitems/veinstone.lua b/df_mapitems/veinstone.lua index 05babf7..4df71f9 100644 --- a/df_mapitems/veinstone.lua +++ b/df_mapitems/veinstone.lua @@ -1,4 +1,4 @@ -local S = df_mapitems.S +local S = minetest.get_translator(minetest.get_current_modname()) -- overridden to trigger an achievement, without making achievements a dependency of this mod df_mapitems.on_veinstone_punched = function() diff --git a/df_underworld_items/config.lua b/df_underworld_items/config.lua index 110e40b..4129a5c 100644 --- a/df_underworld_items/config.lua +++ b/df_underworld_items/config.lua @@ -25,4 +25,5 @@ end setting("bool", "invulnerable_slade", true, "Slade is invulnerable to players") setting("bool", "destructive_pit_plasma", true, "Pit plasma destroys adjacent nodes") -setting("bool", "underworld_hunter_statues", true, "Enable hunter statues in the underworld") \ No newline at end of file +setting("bool", "underworld_hunter_statues", true, "Enable hunter statues in the underworld") +setting("bool", "enable_slade_drill", true, "Enable slade drills") \ No newline at end of file diff --git a/df_underworld_items/crystals_amethyst.lua b/df_underworld_items/crystals_amethyst.lua index dd42fbc..c64898d 100644 --- a/df_underworld_items/crystals_amethyst.lua +++ b/df_underworld_items/crystals_amethyst.lua @@ -1,4 +1,4 @@ -local S = df_underworld_items.S +local S = minetest.get_translator(minetest.get_current_modname()) minetest.register_node("df_underworld_items:glow_amethyst", { description = S("Glowing Amethyst Block"), diff --git a/df_underworld_items/doc.lua b/df_underworld_items/doc.lua index 525a680..720d9d8 100644 --- a/df_underworld_items/doc.lua +++ b/df_underworld_items/doc.lua @@ -4,7 +4,7 @@ if not minetest.get_modpath("doc") then return end -local S = df_underworld_items.S +local S = minetest.get_translator(minetest.get_current_modname()) df_underworld_items.doc.glowstone_desc = S("Bright glowing stones of unknown origin found lodged in the crevices of the underworld's ceiling.") df_underworld_items.doc.glowstone_usage = S("These stones are highly volatile and should not be disturbed.") @@ -21,4 +21,7 @@ df_underworld_items.doc.glow_amethyst_desc = S("Glowing purple crystals that gro df_underworld_items.doc.glow_amethyst_usage = S("These crystals have no known use.") df_underworld_items.doc.pit_plasma_desc = S("The liquid found in the deepest pits in the underworld is highly dangerous and damaging.") -df_underworld_items.doc.pit_plasma_usage = S("The only use for this material is that it destroys whatever is thrown into it. It cannot otherwise be manipulated.") \ No newline at end of file +df_underworld_items.doc.pit_plasma_usage = S("The only use for this material is that it destroys whatever is thrown into it. It cannot otherwise be manipulated.") + +df_underworld_items.doc.slade_drill_desc = S("This shard of a spent slade breacher doesn't appear to have been intended as a portable tool, but it can be used as one.") +df_underworld_items.doc.slade_drill_usage = S("Use this on a target to unleash the energies used to dig through the foundations of the world.") diff --git a/df_underworld_items/glow_stone.lua b/df_underworld_items/glow_stone.lua index a111926..f3699ea 100644 --- a/df_underworld_items/glow_stone.lua +++ b/df_underworld_items/glow_stone.lua @@ -1,4 +1,4 @@ -local S = df_underworld_items.S +local S = minetest.get_translator(minetest.get_current_modname()) local glowstone_def = { _doc_items_longdesc = df_underworld_items.doc.glowstone_desc, diff --git a/df_underworld_items/glowing_pit_plasma.lua b/df_underworld_items/glowing_pit_plasma.lua index 3162289..f12af38 100644 --- a/df_underworld_items/glowing_pit_plasma.lua +++ b/df_underworld_items/glowing_pit_plasma.lua @@ -1,4 +1,4 @@ -local S = df_underworld_items.S +local S = minetest.get_translator(minetest.get_current_modname()) local lava_source = df_dependencies.node_name_lava_source diff --git a/df_underworld_items/hunter_statue.lua b/df_underworld_items/hunter_statue.lua index ed67e90..6068837 100644 --- a/df_underworld_items/hunter_statue.lua +++ b/df_underworld_items/hunter_statue.lua @@ -1,6 +1,6 @@ if minetest.get_modpath("hunter_statue") and df_underworld_items.config.underworld_hunter_statues then - local S = df_underworld_items.S + local S = minetest.get_translator(minetest.get_current_modname()) hunter_statue.register_hunter_statue("df_underworld_items:hunter_statue", { description = S("Guardian Statue"), diff --git a/df_underworld_items/init.lua b/df_underworld_items/init.lua index 5ff95ae..a8d3b37 100644 --- a/df_underworld_items/init.lua +++ b/df_underworld_items/init.lua @@ -1,7 +1,6 @@ df_underworld_items = {} local modname = minetest.get_current_modname() -df_underworld_items.S = minetest.get_translator(modname) local modpath = minetest.get_modpath(modname) dofile(modpath.."/config.lua") @@ -14,5 +13,7 @@ dofile(modpath.."/hunter_statue.lua") dofile(modpath.."/glowing_pit_plasma.lua") dofile(modpath.."/puzzle_seal.lua") - -dofile(modpath.."/ancient_lanterns.lua") \ No newline at end of file +dofile(modpath.."/ancient_lanterns.lua") +if df_underworld_items.config.enable_slade_drill then + dofile(modpath.."/slade_drill.lua") +end diff --git a/df_underworld_items/locale/df_underworld_items.de.tr b/df_underworld_items/locale/df_underworld_items.de.tr index 99cee6e..90147cf 100644 --- a/df_underworld_items/locale/df_underworld_items.de.tr +++ b/df_underworld_items/locale/df_underworld_items.de.tr @@ -42,6 +42,10 @@ These stones are highly volatile and should not be disturbed.=Diese Steine ​ #WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE This block of Slade, carved by an unknown hand, is engraved with mysterious symbols. Most of the engraving's meaning is lost to the mists of time but one frament in the oldest known language can be translated: "This place is not a place of honor."=Dieser von einer unbekannten Hand geschnitzte Slade-Block ist mit mysteriösen Symbolen versehen. Der größte Teil der Bedeutung der Gravur geht den Nebeln der Zeit verloren, aber ein Frament in der ältesten bekannten Sprache kann übersetzt werden: "Dieser Ort ist kein Ehrenplatz." +This shard of a spent slade breacher doesn't appear to have been intended as a portable tool, but it can be used as one.= + +Use this on a target to unleash the energies used to dig through the foundations of the world.= + ### glow_stone.lua ### @@ -80,6 +84,10 @@ Slade Sand= Slade Seal= Slade Wall= +### slade_drill.lua ### + +Slade Drill= + ##### not used anymore ##### diff --git a/df_underworld_items/locale/df_underworld_items.it.tr b/df_underworld_items/locale/df_underworld_items.it.tr index 8b5f190..ff01be4 100644 --- a/df_underworld_items/locale/df_underworld_items.it.tr +++ b/df_underworld_items/locale/df_underworld_items.it.tr @@ -42,6 +42,10 @@ These stones are highly volatile and should not be disturbed.=Queste pietre sono #WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE This block of Slade, carved by an unknown hand, is engraved with mysterious symbols. Most of the engraving's meaning is lost to the mists of time but one frament in the oldest known language can be translated: "This place is not a place of honor."=Questo blocco di Slade, scolpito da una mano sconosciuta, è inciso con simboli misteriosi. La maggior parte del significato dell'incisione si perde nella notte dei tempi, ma un frammento nella più antica lingua conosciuta può essere tradotto: "Questo posto non è un posto d'onore". +This shard of a spent slade breacher doesn't appear to have been intended as a portable tool, but it can be used as one.= + +Use this on a target to unleash the energies used to dig through the foundations of the world.= + ### glow_stone.lua ### @@ -77,3 +81,7 @@ Slade Sand= #WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE Slade Seal=Sigillo Slade Slade Wall= + +### slade_drill.lua ### + +Slade Drill= diff --git a/df_underworld_items/locale/template.txt b/df_underworld_items/locale/template.txt index ebf055b..089c2e2 100644 --- a/df_underworld_items/locale/template.txt +++ b/df_underworld_items/locale/template.txt @@ -31,6 +31,10 @@ These stones are highly volatile and should not be disturbed.= This block of Slade, carved by an unknown hand, is engraved with mysterious symbols. Most of the engraving's meaning is lost to the mists of time but one frament in the oldest known language can be translated: "This place is not a place of honor."= +This shard of a spent slade breacher doesn't appear to have been intended as a portable tool, but it can be used as one.= + +Use this on a target to unleash the energies used to dig through the foundations of the world.= + ### glow_stone.lua ### @@ -61,3 +65,7 @@ Slade Brick= Slade Sand= Slade Seal= Slade Wall= + +### slade_drill.lua ### + +Slade Drill= diff --git a/df_underworld_items/puzzle_seal.lua b/df_underworld_items/puzzle_seal.lua index 8715a28..90e853a 100644 --- a/df_underworld_items/puzzle_seal.lua +++ b/df_underworld_items/puzzle_seal.lua @@ -1,4 +1,4 @@ -local S = df_underworld_items.S +local S = minetest.get_translator(minetest.get_current_modname()) local named_waypoints_path = minetest.get_modpath("named_waypoints") @@ -357,7 +357,11 @@ 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=lava_source}) + if df_underworld_items.config.enable_slade_drill then + minetest.item_drop("df_underworld_items:slade_drill", nil, pos) + else + minetest.set_node(pos, {name=lava_source}) + end return end diff --git a/df_underworld_items/settingtypes.txt b/df_underworld_items/settingtypes.txt index 8d921c5..07da5a9 100644 --- a/df_underworld_items/settingtypes.txt +++ b/df_underworld_items/settingtypes.txt @@ -1,3 +1,4 @@ dfcaverns_invulnerable_slade (Slade cannot be damaged) bool true dfcaverns_destructive_pit_plasma (Pit plasma destroys adjacent nodes) bool true -dfcaverns_underworld_hunter_statues (Enable hunter statues in the underworld) bool true \ No newline at end of file +dfcaverns_underworld_hunter_statues (Enable hunter statues in the underworld) bool true +dfcaverns_enable_slade_drill (Enable slade drills) bool true \ No newline at end of file diff --git a/df_underworld_items/slade.lua b/df_underworld_items/slade.lua index 7c419c0..9e44b30 100644 --- a/df_underworld_items/slade.lua +++ b/df_underworld_items/slade.lua @@ -1,4 +1,4 @@ -local S = df_underworld_items.S +local S = minetest.get_translator(minetest.get_current_modname()) local invulnerable = df_underworld_items.config.invulnerable_slade and not minetest.settings:get_bool("creative_mode") diff --git a/df_underworld_items/slade_drill.lua b/df_underworld_items/slade_drill.lua new file mode 100644 index 0000000..4dd9c26 --- /dev/null +++ b/df_underworld_items/slade_drill.lua @@ -0,0 +1,87 @@ +local S = minetest.get_translator(minetest.get_current_modname()) + +local use_timeout = {} + +local check_timeout = function(user) + if not user:is_player() then return false end + local player_name = user:get_player_name() + local curr_time = minetest.get_gametime() -- minetest.get_us_time() for microsecond precision + local last_used = use_timeout[player_name] + if not last_used or curr_time > last_used + 1 then + use_timeout[player_name] = curr_time + return true + end +end + +local drill_particles = function(pos) + minetest.add_particlespawner({ + amount = 25, + time = 0.5, + minpos = pos, + maxpos = pos, + minvel = {x=-5, y=0, z=-5}, + maxvel = {x=5, y=10, z=5}, + minacc = {x=0, y=-10, z=0}, + maxacc = {x=0, y=-10, z=0}, + minexptime = 2.5, + maxexptime = 7.5, + minsize = 1, + maxsize = 5, + texture = "dfcaverns_glowpit_particle.png", + collisiondetection = true, + collision_removal = true, + glow = 15, + }) +end + +local slade_drill_def = { + _doc_items_longdesc = df_underworld_items.doc.slade_drill_desc, + _doc_items_usagehelp = df_underworld_items.doc.slade_drill_usage, + light_source = minetest.LIGHT_MAX, + description = S("Slade Drill"), + inventory_image = "dfcaverns_slade_drill.png", + is_ground_content = false, + groups = {cracky=3, stone=1, slade=1, pit_plasma_resistant=1, mese_radiation_shield=1,creative_breakable=1, building_block=1, material_stone=1}, + sounds = df_dependencies.sound_stone({ footstep = { name = "bedrock2_step", gain = 1 } }), + paramtype = "light", + sunlight_propagates = true, + _mcl_blast_resistance = 8, + _mcl_hardness = 5, + on_use = function(itemstack, user, pointed_thing) + if pointed_thing.type == "node" then + local pos = pointed_thing.under + local node = minetest.get_node(pos) + if node.name == "df_underworld_items:slade" and check_timeout(user) then + if not minetest.is_creative_enabled(user:get_player_name()) then + itemstack:set_wear(itemstack:get_wear()+1) + end + minetest.sound_play("dfcaverns_slade_drill", {pos = user:get_pos()}) + minetest.set_node(pos, {name="df_underworld_items:slade_sand"}) + drill_particles(pointed_thing.above) + return itemstack + end + end + end, +} + +local tnt_boom = df_dependencies.tnt_boom +if tnt_boom then + slade_drill_def.on_use = function(itemstack, user, pointed_thing) + if not check_timeout(user) then return end + local pos + if pointed_thing.type == "node" then pos = pointed_thing.under + elseif pointed_thing.type == "object" then pos = pointed_thing.ref:get_pos() end + if pos then + tnt_boom(pos, {radius=1}) + minetest.sound_play("dfcaverns_slade_drill", {pos = user:get_pos()}) + if not minetest.is_creative_enabled(user:get_player_name()) then + itemstack:set_wear(itemstack:get_wear()+1) + end + drill_particles(pos) + minetest.check_for_falling({x=pos.x, y=pos.y+1, z=pos.z}) + return itemstack + end + end +end + +minetest.register_tool("df_underworld_items:slade_drill", slade_drill_def) \ No newline at end of file diff --git a/df_underworld_items/sounds/dfcaverns_slade_drill.ogg b/df_underworld_items/sounds/dfcaverns_slade_drill.ogg new file mode 100644 index 0000000..d81473b Binary files /dev/null and b/df_underworld_items/sounds/dfcaverns_slade_drill.ogg differ diff --git a/df_underworld_items/sounds/license.txt b/df_underworld_items/sounds/license.txt index 8027b80..21c3566 100644 --- a/df_underworld_items/sounds/license.txt +++ b/df_underworld_items/sounds/license.txt @@ -15,4 +15,6 @@ dfcaverns_seal_unlocked.ogg - from https://freesound.org/people/juskiddink/sound dfcaverns_seal_key.ogg - From https://freesound.org/people/megashroom/sounds/391488/ by megashroom under the CC0 public domain license dfcaverns_massive_digging.1.ogg - from https://freesound.org/people/OGsoundFX/sounds/423120/ by OGsoundFX under Creative Commons BY 3.0 dfcaverns_massive_digging.2.ogg - from https://freesound.org/people/OGsoundFX/sounds/423120/ by OGsoundFX under Creative Commons BY 3.0 -dfcaverns_massive_digging.3.ogg - from https://freesound.org/people/OGsoundFX/sounds/423120/ by OGsoundFX under Creative Commons BY 3.0 \ No newline at end of file +dfcaverns_massive_digging.3.ogg - from https://freesound.org/people/OGsoundFX/sounds/423120/ by OGsoundFX under Creative Commons BY 3.0 + +dfcaverns_drill - from https://freesound.org/people/Jagadamba/sounds/257021/ by Jagadamba under the CC-BY-A 3.0 license \ No newline at end of file diff --git a/df_underworld_items/textures/dfcaverns_slade_drill.png b/df_underworld_items/textures/dfcaverns_slade_drill.png new file mode 100644 index 0000000..2edae29 Binary files /dev/null and b/df_underworld_items/textures/dfcaverns_slade_drill.png differ