From f34f37a6d7c61dac577d30157b473d02c0dc33ab Mon Sep 17 00:00:00 2001 From: HybridDog Date: Sat, 16 Jan 2016 16:09:16 +0100 Subject: [PATCH] allow eating mushrooms, disable catching up (abm) and allow adding normalmaps for mushrooms --- README.md | 2 +- init.lua | 23 +++++++++++++++++++---- textures/3apple_apple_bottom.png | Bin 246 -> 236 bytes textures/3apple_apple_top.png | Bin 321 -> 363 bytes 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b852403..7bb1b76 100644 --- a/README.md +++ b/README.md @@ -15,4 +15,4 @@ TODO: — add more giant mushrooms — finish supporting the mushrooms mod — add lava suit -— eating must become possible +— use visual_scale → crop textures and change nodeboxes (maybe automatically) diff --git a/init.lua b/init.lua index 8d195bb..43c6941 100644 --- a/init.lua +++ b/init.lua @@ -506,6 +506,7 @@ for name,i in pairs({ interval = 100, chance = 18, }, + hp = 2, }, red = { description = "red mushroom", @@ -524,6 +525,7 @@ for name,i in pairs({ interval = 50, chance = 30, }, + hp = -2, }, fly_agaric = { description = "fly agaric", @@ -540,6 +542,7 @@ for name,i in pairs({ interval = 101, chance = 30, }, + hp = -6, }, lavashroom = { description = "Lavashroom", @@ -557,6 +560,7 @@ for name,i in pairs({ interval = 1010, chance = 60, }, + hp = -1, }, glowshroom = { description = "Glowshroom", @@ -577,6 +581,7 @@ for name,i in pairs({ interval = 710, chance = 320, }, + hp = -2, }, nether_shroom = { description = "Nether mushroom", @@ -590,6 +595,7 @@ for name,i in pairs({ { 2/16, -1/16, -2/16, 4/16, 1/16, 2/16} }, burntime = 6, + hp = -3, }, parasol = { description = "white parasol mushroom", @@ -608,6 +614,7 @@ for name,i in pairs({ interval = 51, chance = 36, }, + hp = 3, }, red45 = { description = "45 red mushroom", @@ -627,6 +634,7 @@ for name,i in pairs({ interval = 1000, chance = 180, }, + hp = 1, }, brown45 = { description = "45 brown mushroom", @@ -645,6 +653,7 @@ for name,i in pairs({ interval = 100, chance = 20, }, + hp = 1, }, }) do local burntime = i.burntime or 1 @@ -655,7 +664,11 @@ for name,i in pairs({ local nd = "riesenpilz:"..name minetest.register_node(nd, { description = i.description, - tiles = {"riesenpilz_"..name.."_top.png", "riesenpilz_"..name.."_bottom.png", "riesenpilz_"..name.."_side.png"}, + tiles = { + {name = "riesenpilz_"..name.."_top.png", tileable_vertical = false}, + {name = "riesenpilz_"..name.."_bottom.png", tileable_vertical = false}, + {name = "riesenpilz_"..name.."_side.png", tileable_vertical = false}, + }, inventory_image = "riesenpilz_"..name.."_side.png", walkable = false, buildable_to = true, @@ -665,7 +678,8 @@ for name,i in pairs({ sounds = default.node_sound_leaves_defaults(), node_box = box, selection_box = box, - furnace_burntime = burntime + furnace_burntime = burntime, + on_secondary_use = minetest.item_eat(i.hp), }) local g = i.growing @@ -705,6 +719,7 @@ for name,i in pairs({ neighbors = g.neighbours, interval = g.interval, chance = g.chance, + catch_up = false, action = function(pos, node) if not abm_allowed then return @@ -745,7 +760,7 @@ for name,i in pairs({ -- should disallow lag abm_allowed = false minetest.after(2, function() abm_allowed = true end) - table.insert(disallowed_ps, pos) + disallowed_ps[#disallowed_ps+1] = pos -- witch circles local ps = {} @@ -785,7 +800,7 @@ for name,i in pairs({ local light = minetest.get_node_light(pos, 0.5) if light >= lmin and light <= lmax then - table.insert(ps, pos) + ps[#ps+1] = pos end end end diff --git a/textures/3apple_apple_bottom.png b/textures/3apple_apple_bottom.png index ce47ea4f5f3a724c2bbe7c7db7ff4f7b8aa3ee8c..e1dcd9aa2f65aef52f42df40171ffea576184005 100644 GIT binary patch delta 219 zcmV<103`qR0qg;g8Gix*005AYXf^-<0JBL%K~yNu)zUFa15p?R;P1U%9&D5l5>ncv zj~>J;Sb7ud9LL(;3s~4#h@H)n2*%z0tqtsgolZB!R}4&gE`F8FUjy|?-*qZp28GLt za8r+iU1!NUX|jf^tvIyIA@!@g~yIDFykU?c~l)VEV4GF7$3c7m7LM= z9x{c`iP2qX!!}uDnU8P?{RG&DhcC;b4TVE^>dk+GbaIWmqk)==!kpVO3I5}kz5$xV VFs$LY9?Ad!002ovPDHLkV1jq-WHK~#7F?T*h1K|vIU&vltMkcCH5%1TNS zDbux(KPi#2u;m%pD7vw+^e2zuVa8WOb~+Zaaq4U4Oy~E_k*`*!D3Y!HQj*Sl!N=81 zh>IX6;tDVcfnFUR!kkc#a}04(+?sw7DkRY(yibW+LJT(}?q0^4}pf-S=96%r4cj&zdmd8^DDeTW;KEmLv6SkzxFdcsS1N- fs6rj=+wi~cRefM}k=L_V00000NkvXXu0mjfJq~C> diff --git a/textures/3apple_apple_top.png b/textures/3apple_apple_top.png index 4d5ba399dc66315d45c9f4d37abaa75c24cb1986..a73c3f725e751fedffb6a323730fe050ddfb2504 100644 GIT binary patch delta 347 zcmV-h0i^!H0_y^h8Gi!+002a!ipBr{0FY2jR7Fw%09610RsaB3003J60ABzAU;qGX z003zL0B`^RZ22UPXI?&0e?Yj3{PhdT4NhgXAgu{ zD5*>%txO}bOe3>QBW-UXpJ*|C1WXeE005RrL_t(I%jMIz5`!=lL{Y&bgG9~(L^4Uh z|Notb%8eP1+_LRG?V|C=(BlBcgdhaq`>y*Bz&Hr{zHRe7O_L-HZ$Wnl2#KO$7{_^L ztSBr?9C%(`uT-yTIu6b$)%EXSotEJ{18Gi-<0047(dh`GQ0SHM%K~#7F?b5GGL_rt@@N@6%$^^lpZZL_( zY8Sy|Sy&Xj7c?jsRF=g*(I&dZ;u~nOT+p(MeZeR2iN-nKH@DnmnKI0QUzu_a!-xMS zCnqQ8p@b7g9YNK>)TpOYr8A%{elcoy6bwr-UA1D~gJ_I;4S%8!*z@8J2w(ozQwLQc z_Q%WO@Nz}`4y;)8AtnW-FyPUb(`?;}X1L`>zVPH?LriWq#mv7`vu4E@pg04F<