From 0cbea548b9c79c5538f3b8b686fbba92d11f86d2 Mon Sep 17 00:00:00 2001 From: DanDuncombe Date: Thu, 14 Nov 2013 18:35:27 +0000 Subject: [PATCH] Spikes --- mods/spikes/depends.txt | 1 + mods/spikes/init.lua | 45 +++++++++++++++++++++++ mods/spikes/textures/spikes_dark.png | Bin 0 -> 185 bytes mods/spikes/textures/spikes_dark_top.png | Bin 0 -> 187 bytes 4 files changed, 46 insertions(+) create mode 100644 mods/spikes/depends.txt create mode 100644 mods/spikes/init.lua create mode 100644 mods/spikes/textures/spikes_dark.png create mode 100644 mods/spikes/textures/spikes_dark_top.png diff --git a/mods/spikes/depends.txt b/mods/spikes/depends.txt new file mode 100644 index 0000000..429dc7c --- /dev/null +++ b/mods/spikes/depends.txt @@ -0,0 +1 @@ +trees diff --git a/mods/spikes/init.lua b/mods/spikes/init.lua new file mode 100644 index 0000000..8a9d131 --- /dev/null +++ b/mods/spikes/init.lua @@ -0,0 +1,45 @@ +spikes = {} + +for i, tree_name in ipairs(realtest.registered_trees_list) do + local tree = realtest.registered_trees[tree_name] + + local texture_plank = "trees_"..tree.name:remove_modname_prefix().."_planks.png" + local texture_top = texture_plank.."^spikes_dark_top.png" + local texture_side = texture_plank.."^spikes_dark.png" + local texture_bottom = texture_plank + + local spikes = { + description = tree.description.." Spike", + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + { -4/16, -8/16, -4/16, -3/16, -2/16, -3/16 }, + { 3/16, -8/16, -4/16, 4/16, -2/16, -3/16 }, + { -4/16, -8/16, 3/16, -3/16, -2/16, 4/16 }, + { 3/16, -8/16, 3/16, 4/16, -2/16, 4/16 }, + { -8/16, -8/16, -8/16, 8/16, -7/16, 8/16 }, + }, + }, + tiles = {texture_top, texture_bottom, texture_side}, + drop = "spikes:spike_"..tree.name:remove_modname_prefix(), + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = false, + groups = {oddly_breakable_by_hand=2, material=i}, + sounds = default.node_sound_wood_defaults(), + walkable = false, + damage_per_second = 10, + fall_damage_add_percent = 200, + } + + minetest.register_node("spikes:spike_"..tree.name:remove_modname_prefix(), spikes) + + minetest.register_craft({ + output = "spikes:spike_"..tree.name:remove_modname_prefix().." 2", + recipe = { + {tree.name.."_stick",tree.name.."_stick",tree.name.."_stick"}, + {tree.name.."_planks_slab",tree.name.."_planks_slab",tree.name.."_planks_slab"}, + } + }) +end diff --git a/mods/spikes/textures/spikes_dark.png b/mods/spikes/textures/spikes_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..0feabfb540f2432eef72e9cadd8330a69030893e GIT binary patch literal 185 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP)H?JrU+m5ft?SVp)C9V-A&iT2ysd*&~&PAz-C8;S2 z<(VZJ3hti10pX2&;y^`;o-U3d7N?U_5)v{}7BCnX25`9XN|+{GVbGF1@MFFcGeh4_ W#`#y?7nuSTGkCiCxvXwc6x=<11Hv2m#DR*GJzX3_EKVo?Iqx8ukR(yZW?*Ds@+hdsx3ADdz