diff --git a/mods/default/crafting.lua b/mods/default/crafting.lua index c2ac093..22d0d48 100644 --- a/mods/default/crafting.lua +++ b/mods/default/crafting.lua @@ -343,7 +343,7 @@ minetest.register_craft( minetest.register_craft( { - output = "default:torch 4", + output = "default:torch 2", recipe = { {"default:lump_coal"}, {"default:fiber"}, @@ -351,6 +351,29 @@ minetest.register_craft( } }) +minetest.register_craft( + { + output = "default:torch_weak 2", + recipe = { + {"default:fiber"}, + {"default:stick"}, + } + }) + +minetest.register_craft( + { + output = "default:flint 2", + type = "shapeless", + recipe = {"default:gravel"}, + }) + +minetest.register_craft( + { + output = "default:flint_and_steel", + type = "shapeless", + recipe = {"default:ingot_steel", "default:flint"}, + }) + minetest.register_craft( { output = "default:chest", @@ -790,4 +813,36 @@ minetest.register_craftitem( on_use = minetest.item_eat({hp = 1, sat = 10}) }) +minetest.register_craftitem( + "default:flint", + { + description = "Flint Shard", + inventory_image = "default_flint.png", + }) + +minetest.register_tool( + "default:flint_and_steel", + { + description = "Flint and Steel", + inventory_image = "default_flint_and_steel.png", + on_use = function(itemstack, user, pointed_thing) + if pointed_thing == nil then return end + if pointed_thing.type ~= "node" then return end + + local pos = pointed_thing.under + + if minetest.get_node(pointed_thing.under).name == "default:torch_weak" then + local n = minetest.get_node(pointed_thing.under) + minetest.set_node(pos, {name = "default:torch", param = n.param, param2 = n.param2}) + itemstack:add_wear(800) + elseif minetest.get_node(pointed_thing.under).name == "default:torch_dead" then + local n = minetest.get_node(pointed_thing.under) + minetest.set_node(pos, {name = "default:torch_weak", param = n.param, param2 = n.param2}) + itemstack:add_wear(1300) + end + + return itemstack + end, + }) + default.log("crafting", "loaded") \ No newline at end of file diff --git a/mods/default/functions.lua b/mods/default/functions.lua index 6d2e9bd..7ecb56d 100644 --- a/mods/default/functions.lua +++ b/mods/default/functions.lua @@ -268,7 +268,7 @@ minetest.register_abm( -- papyrus grows minetest.register_abm( -- torch flame { - nodenames = {"default:torch"}, + nodenames = {"default:torch", "default:torch_weak"}, interval = 5, chance = 1, action = function(pos, node) @@ -291,4 +291,14 @@ minetest.register_abm( -- torch flame end }) +minetest.register_abm( -- weak torchs burn out and die after ~3 minutes + { + nodenames = {"default:torch_weak"}, + interval = 3, + chance = 60, + action = function(pos, node) + minetest.set_node(pos, {name = "default:torch_dead"}) + end + }) + default.log("functions", "loaded") \ No newline at end of file diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua index eec01cc..c6fff68 100644 --- a/mods/default/nodes.lua +++ b/mods/default/nodes.lua @@ -656,6 +656,58 @@ minetest.register_node( groups = {water=1, liquid=1}, }) +minetest.register_node( + "default:torch_dead", + { + description = "Dead Torch", + drawtype = "nodebox", + tiles ={ + { + name = "default_torch_3d_ends.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 1.0, + }, + }, + { + name = "default_torch_3d_ends.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 1.0, + }, + }, + { + name = "default_torch_3d.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 1.0, + }, + }, + }, + inventory_image = "default_torch_dead.png", + wield_image = "default_torch_dead.png", + paramtype = "light", + paramtype2 = "wallmounted", + sunlight_propagates = true, + is_ground_content = false, + walkable = false, + node_box = { + type = "wallmounted", + wall_top = {-2/16, 0, -2/16, 2/16, 0.5, 2/16}, + wall_bottom = {-2/16, -0.5, -2/16, 2/16, 0, 2/16}, + wall_side = {-0.5, -8/16, -0.1, -0.5+4/16, 0, 0.1}, + }, + groups = {choppy=2, dig_immediate=3, attached_node=1}, + legacy_wallmounted = true, + sounds = default.node_sound_defaults(), + }) + minetest.register_node( "default:torch", { @@ -708,6 +760,58 @@ minetest.register_node( legacy_wallmounted = true, sounds = default.node_sound_defaults(), }) +minetest.register_node( + "default:torch_weak", + { + description = "Weak Torch", + drawtype = "nodebox", + tiles ={ + { + name = "default_torch_3d_ends.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 1.0, + }, + }, + { + name = "default_torch_3d_ends.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 1.0, + }, + }, + { + name = "default_torch_3d.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 1.0, + }, + }, + }, + inventory_image = "default_torch.png", + wield_image = "default_torch.png", + paramtype = "light", + paramtype2 = "wallmounted", + sunlight_propagates = true, + is_ground_content = false, + walkable = false, + light_source = default.LIGHT_MAX-4, + node_box = { + type = "wallmounted", + wall_top = {-2/16, 0, -2/16, 2/16, 0.5, 2/16}, + wall_bottom = {-2/16, -0.5, -2/16, 2/16, 0, 2/16}, + wall_side = {-0.5, -8/16, -0.1, -0.5+4/16, 0, 0.1}, + }, + groups = {choppy=2, dig_immediate=3, attached_node=1}, + legacy_wallmounted = true, + sounds = default.node_sound_defaults(), + }) minetest.register_node( "default:sign", diff --git a/mods/default/textures/default_compressed_sandstone.png b/mods/default/textures/default_compressed_sandstone.png index cc2e7f2..e3db8ee 100644 Binary files a/mods/default/textures/default_compressed_sandstone.png and b/mods/default/textures/default_compressed_sandstone.png differ diff --git a/mods/default/textures/default_compressed_sandstone.xcf b/mods/default/textures/default_compressed_sandstone.xcf index 57ffeee..07d2b5a 100644 Binary files a/mods/default/textures/default_compressed_sandstone.xcf and b/mods/default/textures/default_compressed_sandstone.xcf differ diff --git a/mods/default/textures/default_flint.png b/mods/default/textures/default_flint.png new file mode 100644 index 0000000..0a53062 Binary files /dev/null and b/mods/default/textures/default_flint.png differ diff --git a/mods/default/textures/default_flint.xcf b/mods/default/textures/default_flint.xcf new file mode 100644 index 0000000..419fdca Binary files /dev/null and b/mods/default/textures/default_flint.xcf differ diff --git a/mods/default/textures/default_flint_and_steel.png b/mods/default/textures/default_flint_and_steel.png new file mode 100644 index 0000000..6a3b70a Binary files /dev/null and b/mods/default/textures/default_flint_and_steel.png differ diff --git a/mods/default/textures/default_flint_and_steel.xcf b/mods/default/textures/default_flint_and_steel.xcf new file mode 100644 index 0000000..42d2373 Binary files /dev/null and b/mods/default/textures/default_flint_and_steel.xcf differ diff --git a/mods/default/textures/default_torch.png b/mods/default/textures/default_torch.png index 83427eb..7b4da26 100644 Binary files a/mods/default/textures/default_torch.png and b/mods/default/textures/default_torch.png differ diff --git a/mods/default/textures/default_torch_dead.png b/mods/default/textures/default_torch_dead.png new file mode 100644 index 0000000..832ab29 Binary files /dev/null and b/mods/default/textures/default_torch_dead.png differ diff --git a/mods/default/textures/default_torch_dead.xcf b/mods/default/textures/default_torch_dead.xcf new file mode 100644 index 0000000..3cccd29 Binary files /dev/null and b/mods/default/textures/default_torch_dead.xcf differ