From dc9d17d403be8750dc7ddcc9b35d201bf51779d5 Mon Sep 17 00:00:00 2001 From: kaadmy Date: Thu, 24 Sep 2015 10:59:16 -0700 Subject: [PATCH] added weak torches and flint and steel --- mods/default/crafting.lua | 57 +++++++++- mods/default/functions.lua | 12 +- mods/default/nodes.lua | 104 ++++++++++++++++++ .../textures/default_compressed_sandstone.png | Bin 308 -> 308 bytes .../textures/default_compressed_sandstone.xcf | Bin 1350 -> 1350 bytes mods/default/textures/default_flint.png | Bin 0 -> 407 bytes mods/default/textures/default_flint.xcf | Bin 0 -> 1300 bytes .../textures/default_flint_and_steel.png | Bin 0 -> 429 bytes .../textures/default_flint_and_steel.xcf | Bin 0 -> 1361 bytes mods/default/textures/default_torch.png | Bin 424 -> 406 bytes mods/default/textures/default_torch_dead.png | Bin 0 -> 405 bytes mods/default/textures/default_torch_dead.xcf | Bin 0 -> 1215 bytes 12 files changed, 171 insertions(+), 2 deletions(-) create mode 100644 mods/default/textures/default_flint.png create mode 100644 mods/default/textures/default_flint.xcf create mode 100644 mods/default/textures/default_flint_and_steel.png create mode 100644 mods/default/textures/default_flint_and_steel.xcf create mode 100644 mods/default/textures/default_torch_dead.png create mode 100644 mods/default/textures/default_torch_dead.xcf 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 cc2e7f267d3f2d9e6ef281b5517397838473a412..e3db8ee83136ff92663b4689e74d3a2dee95c10f 100644 GIT binary patch delta 16 XcmdnOw1sJcGaH9MeYaP^M95RngQ;0000PbVXQnLvL+uWo~o;Lvm$dbY)~9 zcWHEJAV*0}P*;Ht7XSbO5lKWrR5;6plfi8SAq+*|M0-jHGi{hQIBy3~)24%*-GWIkY`v(^hLYVH;xKb{qU}lI&6OndSx3tzyl^>4> z06FKDQli$1ssdnUORqf;gb+|wN-5-=n~1P&+f<{fgJdG;$~k9%mQn(s)(XJ7t|RXx zw<~Z5_IS-h2!Ae^*(tcI0+dn?^BOHYt!gPH-2Kq^p1|D!7BidnU?{%>yF2bqjB&Vd zd#aCt_2N#_fdC@1yb|Be2DEM41l%jCD(;S%O$3Xowix39*!$is(Q$|&1n%jR@2{V} z6w5Pb@6uUJF5J^6zyyr4qF(Q%|Hu861fM2$54*i3)>w*9P002ovPDHLkV1mwX BrrZDk literal 0 HcmV?d00001 diff --git a/mods/default/textures/default_flint.xcf b/mods/default/textures/default_flint.xcf new file mode 100644 index 0000000000000000000000000000000000000000..419fdca90bb68386071eef6d0e4db642a5330589 GIT binary patch literal 1300 zcmdT?&1%~~5Z;ySNd5^;e@{K^(J8nj>^Yb85DG2y6%<*kh}u$+6q+0gdkz$O)l2kA z{2cAAmqH80&h#5aN@eOkKn7;_oB6)komnYP7U$|RG|D9NNWk_QXZ#Q@C6>o<|M;^I z?64>B9^8dLYcT7cLVtpNH^#BkFk395v_veJeDo@hf-;(^4@r5ZPF}x#$IM}TZh*9xS4Z4aqQ8JrZG8sM8EadrPk!rFTGsq$^!Rqlg2t0GM9d6D5}a@ zxF!jfW81ee&1j86;xnK^WK137f)#VJIq4^Jkl-8_ zwbxqe8(utG>1zgSlzC`-g=^5}{TQR-F?iuIDh6wF563v-F?iuIju@=pY>Y7xlE$J( b1F=J%@To5b)DuH;?|guqM?N$oXkUmw@-c_< literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..6a3b70a262a92785a7bdea1ed2f794be9d291f28 GIT binary patch literal 429 zcmV;e0aE^nP)R5;6hld+M6FbqY%nT_b++=d-o6OQS?j<*CV*m$>t zjok!+oLmud2c)`ywFk2p&5#H^eMui6BDi{tF_-TLT!gh&0Eo4=Uv!}?%q&DC#uzci z$XT5dkyGX8^ZAtzA%KX~J~y1fF~%mx%p3gB>bTBurtF++ispF+J+uMMSxmC28IzgCoH&N&4DF-G}JpzNJNL~VmTyi=;M_Z~TC zl>3xp-a788$&Xlb3zzYWAQ7qCQQiNJn@xYfdud_j?G9S&zKtbb%i6#NOerD8*k9qb ztNuDdx^6f2mov=ZBR<-3#`XFx&WYc!u+V1a<#47VE6acQOn2Dg8|?l Xgs2N6o0djP00000NkvXXu0mjfWErn5 literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..42d2373d80e1fe024fcfe1ac4a8d0a1e07505dfe GIT binary patch literal 1361 zcmbV~%Wl(95Qfh=N$T7x%B?FFUZ#tnR^haGt@cunO$Z#N78B{b%s|0oHc=(Rl1l=EwyXpS+rSy}38A--YuF`|P#*mMaHY zYdG!&UN@MA1J=+jMQ1j@8F}_B8ij+SX2%cu(I}eQoy>Ko!FkUu8MZikcpg*W5*$oFU7e0xEj{!_YF%A@=q z%#ok+2tNNl{6<@+z5XzmMpu*UwJFoK2hU$e!|EpH_J)b!#EU}QEX1us+%ClXh4>L- z-kTo_0skJK{GXBE1(FK0%I~YASG_N5>I3JN-jHrIe&nc0vLrE(snrWD6m!|58SBpI(LVM*!l5NHu2Rq+oDAx&iR z1$pfIyoH4%D@(ecSG0;zB3&`-HoViqWfmN)F=gTUcN#4ILoEM zNem7K_&Ui$oP-!{i<8h$4vRPth6S92N;tf3!w<#*H*oy_!EsACu5`CJPKM*U2FEct z7+@UdA&x`j6mT4Jq*KI!;1qD2G7hiX@Pl#C2%I-1oI@dXTU2#J>}jiD4QLXzTIQ>| eB9vCB%gkGum-wqH&kwgQ$mnKZiaDs`Nn8pMgaUg B3e5lj delta 39 scmbQnyn=ax3O`$tx4R32F$lKVJAa#~D9_2kFK(jl@NCVJjh?=Y0LwTE{r~^~ diff --git a/mods/default/textures/default_torch_dead.png b/mods/default/textures/default_torch_dead.png new file mode 100644 index 0000000000000000000000000000000000000000..832ab296b57c2b3a3e126ff144651c55171ce51d GIT binary patch literal 405 zcmV;G0c!q`3tC?pTi=rgrJKy&TUrh?35lHKJ0X7eX8F-HE=inR@)ZQ%W3c|(kGwRf*i z#5bK?%T^#Fgtno&`T9xBR8r)`0NS*1E}sR62&xJYt+mLZOAvqDP9VjS*f|%iwS*8* z)d@sZ6U2f42A%N%|2BC@O*QeB)8qh@U00000NkvXXu0mjf#zmsd literal 0 HcmV?d00001 diff --git a/mods/default/textures/default_torch_dead.xcf b/mods/default/textures/default_torch_dead.xcf new file mode 100644 index 0000000000000000000000000000000000000000..3cccd29ca5c55cbce5c570b5002f5bca626d4842 GIT binary patch literal 1215 zcmZ{iOK#gR5Qa%w@iT7IXS(P@OK0IC0oU533!^{;^a_qFDT4e6EC)>%0k}3$pj%#| zR|ufP^aNcLb?oU3EjE(t5*YHI7x{VQIGJ3#w?X7a$v9-VjtV3F0*!OrUZFM5zcEIJ z>ouBF*xTZyx;I!qz_T0Uwf$f=nS|2?`izn^lri{fB5p3U8!Ir{VXa_F9ZI5lgJI4e>o*m}9A)#ly* z3u?X1u7^P~jomZ*76$M31&dh!W|}PAWExzB8THSiC<_;V0jc}n&^A(Sr8yLff42%x z`+aDlo%3Ok#`D?D)Qn9OWpzC1>i}A_&{W1INw-V7Q__be-7V?osOet28Yt*J zTK1n|Sui9LlX*hNT5(^EiLc}z!{!G(qpbsLNxP5&HWKRaTPmp~aPl1ZNuE*?08PNk zxI#Tjucf!ql?i*acgp08XuJ7;Q`WDxF!WCX^J6UA)glEP? zs2k*5h7<^rA$1Q6U|$4X{Hdpu-$!u{tzZ6AlWivj+Ngj60YY@Q(cf=4^Jf literal 0 HcmV?d00001