Add a little bonus for players who activate a slade breacher - a handheld 'splosion tool

This commit is contained in:
FaceDeer 2022-08-22 19:58:46 -06:00
parent eb1b30b097
commit 434da63501
30 changed files with 150 additions and 28 deletions

View File

@ -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"),

View File

@ -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

View File

@ -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"),

View File

@ -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", {

View File

@ -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"),

View File

@ -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"),

View File

@ -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.")

View File

@ -1,4 +1,4 @@
local S = df_mapitems.S
local S = minetest.get_translator(minetest.get_current_modname())
-----------------------------------------------

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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"),

View File

@ -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()

View File

@ -26,3 +26,4 @@ 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")
setting("bool", "enable_slade_drill", true, "Enable slade drills")

View File

@ -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"),

View File

@ -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.")
@ -22,3 +22,6 @@ df_underworld_items.doc.glow_amethyst_usage = S("These crystals have no known us
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.")
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.")

View File

@ -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,

View File

@ -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

View File

@ -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"),

View File

@ -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")
if df_underworld_items.config.enable_slade_drill then
dofile(modpath.."/slade_drill.lua")
end

View File

@ -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 #####

View File

@ -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=

View File

@ -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=

View File

@ -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})
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

View File

@ -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
dfcaverns_enable_slade_drill (Enable slade drills) bool true

View File

@ -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")

View File

@ -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)

Binary file not shown.

View File

@ -16,3 +16,5 @@ dfcaverns_seal_key.ogg - From https://freesound.org/people/megashroom/sounds/391
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
dfcaverns_drill - from https://freesound.org/people/Jagadamba/sounds/257021/ by Jagadamba under the CC-BY-A 3.0 license

Binary file not shown.

After

Width:  |  Height:  |  Size: 571 B