mirror of
https://github.com/FaceDeer/dfcaverns.git
synced 2025-01-24 17:20:19 +01:00
fixing up explosions. Also make slade sand diggable in mcl, and fix a bug in web generators
This commit is contained in:
parent
de3e15e87b
commit
c1bddb9ef7
@ -24,7 +24,7 @@ local anchor_groups = {"group:soil", "group:stone", "group:tree", "group:wood",
|
||||
|
||||
local in_anchor_group = function(name)
|
||||
for _, group in pairs(anchor_groups) do
|
||||
if minetest.get_item_group(name, group:strsub(7)) then
|
||||
if minetest.get_item_group(name, string.sub(group, 7)) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
@ -21,6 +21,13 @@ end
|
||||
if minetest.get_modpath("bones") then
|
||||
df_dependencies.node_name_bones = "bones:bones"
|
||||
else
|
||||
|
||||
local function drop_item_stack(pos, stack)
|
||||
if not stack or stack:is_empty() then return end
|
||||
local drop_offset = vector.new(math.random() - 0.5, 0, math.random() - 0.5)
|
||||
minetest.add_item(vector.add(pos, drop_offset), stack)
|
||||
end
|
||||
|
||||
minetest.register_node("bones_loot:bones", {
|
||||
description = S("Bones"),
|
||||
tiles = {
|
||||
@ -48,19 +55,16 @@ else
|
||||
inv:set_size("main", 8*4)
|
||||
end,
|
||||
|
||||
on_blast = function(pos)
|
||||
local drops = {}
|
||||
local n = 0
|
||||
on_blast = function(pos, intensity)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
for i = 1, inv:get_size("main") do
|
||||
local stack = inv:get_stack("main", i)
|
||||
if stack:get_count() > 0 then
|
||||
drops[n+1] = stack:to_table()
|
||||
n = n + 1
|
||||
end
|
||||
end
|
||||
drops[#drops+1] = "bones_loot:bones"
|
||||
drop_item_stack(pos, inv:get_stack("main", i))
|
||||
end
|
||||
meta:from_table()
|
||||
minetest.remove_node(pos)
|
||||
return drops
|
||||
if math.random(1, math.floor((intensity or 1) * 2)) ~= 1 then return end
|
||||
drop_item_stack(pos, "bones_loot:bones")
|
||||
end
|
||||
})
|
||||
|
||||
|
@ -138,7 +138,7 @@ df_ambience.add_set({
|
||||
frequency = 0.025,
|
||||
nodes = {"df_underworld_items:slade"},
|
||||
sounds = {
|
||||
{name = "dfcaverns_whispers", gain = 0.25},
|
||||
{name = "dfcaverns_whispers", gain = 0.15},
|
||||
},
|
||||
sound_check = function(def)
|
||||
return def.biome == "underworld"
|
||||
|
@ -32,7 +32,7 @@ end
|
||||
|
||||
local slade_mcl_blast_resistance = 1200
|
||||
local slade_mcl_hardness = 50
|
||||
local slade_groups = {stone=1, level=3, slade=1, pit_plasma_resistant=1, mese_radiation_shield=1, cracky = 3, creative_breakable=1, building_block=1, material_stone=1}
|
||||
local slade_groups = {stone=1, slade=1, pit_plasma_resistant=1, mese_radiation_shield=1, cracky = 3, creative_breakable=1, building_block=1, material_stone=1}
|
||||
if invulnerable then
|
||||
slade_groups.immortal = 1
|
||||
slade_mcl_blast_resistance = 3600000
|
||||
|
@ -13,7 +13,7 @@ end
|
||||
|
||||
local slade_mcl_blast_resistance = 1200
|
||||
local slade_mcl_hardness = 50
|
||||
local slade_groups = {stone=1, level=3, slade=1, pit_plasma_resistant=1, mese_radiation_shield=1, cracky = 3, not_in_creative_inventory=1,creative_breakable=1, building_block=1, material_stone=1}
|
||||
local slade_groups = {stone=1, slade=1, pit_plasma_resistant=1, mese_radiation_shield=1, cracky = 3, not_in_creative_inventory=1,creative_breakable=1, building_block=1, material_stone=1}
|
||||
if invulnerable then
|
||||
slade_groups.immortal = 1
|
||||
slade_mcl_blast_resistance = 3600000
|
||||
@ -296,7 +296,7 @@ local digging_seal_def = {
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
light_source = minetest.LIGHT_MAX,
|
||||
groups = {immortal=1, stone=1, level=3, slade=1, pit_plasma_resistant=1, mese_radiation_shield=1, not_in_creative_inventory=1,building_block=1, material_stone=1},
|
||||
groups = {immortal=1, stone=1, slade=1, pit_plasma_resistant=1, mese_radiation_shield=1, not_in_creative_inventory=1,building_block=1, material_stone=1},
|
||||
sounds = df_dependencies.sound_stone({ footstep = { name = "bedrock2_step", gain = 1 } }),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
|
@ -17,7 +17,7 @@ local add_immortality = function(slade_def)
|
||||
return slade_def
|
||||
end
|
||||
|
||||
local slade_groups = {cracky=3, stone=1, level=3, slade=1, pit_plasma_resistant=1, mese_radiation_shield=1,creative_breakable=1, building_block=1, material_stone=1}
|
||||
local slade_groups = {cracky=3, stone=1, slade=1, pit_plasma_resistant=1, mese_radiation_shield=1,creative_breakable=1, building_block=1, material_stone=1}
|
||||
|
||||
local slade_def = {
|
||||
description = S("Slade"),
|
||||
@ -27,10 +27,10 @@ local slade_def = {
|
||||
groups = slade_groups,
|
||||
sounds = df_dependencies.sound_stone({ footstep = { name = "bedrock2_step", gain = 1 } }),
|
||||
is_ground_content = false,
|
||||
_mcl_blast_resistance = 1200,
|
||||
_mcl_hardness = 50,
|
||||
_mcl_blast_resistance = 8,
|
||||
_mcl_hardness = 5,
|
||||
on_blast = function(pos, intensity)
|
||||
if intensity > 3.0 then
|
||||
if intensity >= 1.0 then
|
||||
minetest.set_node(pos, {name="df_underworld_items:slade_sand"})
|
||||
minetest.check_for_falling(pos)
|
||||
end
|
||||
@ -38,6 +38,8 @@ local slade_def = {
|
||||
}
|
||||
if invulnerable then
|
||||
add_immortality(slade_def)
|
||||
slade_def._mcl_blast_resistance = 8
|
||||
slade_def._mcl_hardness = 5
|
||||
end
|
||||
minetest.register_node("df_underworld_items:slade", slade_def)
|
||||
|
||||
@ -88,16 +90,15 @@ if invulnerable then
|
||||
end
|
||||
minetest.register_node("df_underworld_items:slade_wall", slade_wall_def)
|
||||
|
||||
-- TODO: ensure that explosives turn slade into slade sand in MCL too
|
||||
minetest.register_node("df_underworld_items:slade_sand", {
|
||||
description = S("Slade Sand"),
|
||||
_doc_items_longdesc = df_underworld_items.doc.slade_desc,
|
||||
_doc_items_usagehelp = df_underworld_items.doc.slade_usage,
|
||||
tiles = {"dfcaverns_slade_sand.png"},
|
||||
is_ground_content = false,
|
||||
groups = {crumbly = 3, level = 2, falling_node = 1, slade=1, pit_plasma_resistant=1, mese_radiation_shield=1,building_block=1, material_sand=1, crush_after_fall=1, falling_node_damage=1},
|
||||
groups = {crumbly = 3, falling_node = 1, slade=1, pit_plasma_resistant=1, mese_radiation_shield=1,handy=1,shovely=3, sand=1, enderman_takable=1, building_block=1, material_sand=1, crush_after_fall=1, falling_node_damage=1},
|
||||
sounds = df_dependencies.sound_gravel({footstep = {name = df_dependencies.soundfile_gravel_footstep, gain = 0.45},}),
|
||||
_mcl_blast_resistance = 2000,
|
||||
_mcl_blast_resistance = 8,
|
||||
_mcl_hardness = 5,
|
||||
})
|
||||
|
||||
|
@ -60,7 +60,7 @@ hunter_statue.register_hunter_statue = function(node_name, statue_def)
|
||||
|
||||
if statue_def.tnt_vulnerable then
|
||||
def.on_blast = function(pos, intensity)
|
||||
if intensity > 3.0 then
|
||||
if intensity >= 1.0 then
|
||||
minetest.set_node(pos, {name= statue_def.tnt_debris or "air"})
|
||||
minetest.check_for_falling(pos)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user