allow eating mushrooms, disable catching up (abm) and allow adding normalmaps for mushrooms

This commit is contained in:
HybridDog 2016-01-16 16:09:16 +01:00
parent 7bd30384cc
commit f34f37a6d7
4 changed files with 20 additions and 5 deletions

View File

@ -15,4 +15,4 @@ TODO:
— add more giant mushrooms — add more giant mushrooms
— finish supporting the mushrooms mod — finish supporting the mushrooms mod
— add lava suit — add lava suit
eating must become possible use visual_scale → crop textures and change nodeboxes (maybe automatically)

View File

@ -506,6 +506,7 @@ for name,i in pairs({
interval = 100, interval = 100,
chance = 18, chance = 18,
}, },
hp = 2,
}, },
red = { red = {
description = "red mushroom", description = "red mushroom",
@ -524,6 +525,7 @@ for name,i in pairs({
interval = 50, interval = 50,
chance = 30, chance = 30,
}, },
hp = -2,
}, },
fly_agaric = { fly_agaric = {
description = "fly agaric", description = "fly agaric",
@ -540,6 +542,7 @@ for name,i in pairs({
interval = 101, interval = 101,
chance = 30, chance = 30,
}, },
hp = -6,
}, },
lavashroom = { lavashroom = {
description = "Lavashroom", description = "Lavashroom",
@ -557,6 +560,7 @@ for name,i in pairs({
interval = 1010, interval = 1010,
chance = 60, chance = 60,
}, },
hp = -1,
}, },
glowshroom = { glowshroom = {
description = "Glowshroom", description = "Glowshroom",
@ -577,6 +581,7 @@ for name,i in pairs({
interval = 710, interval = 710,
chance = 320, chance = 320,
}, },
hp = -2,
}, },
nether_shroom = { nether_shroom = {
description = "Nether mushroom", description = "Nether mushroom",
@ -590,6 +595,7 @@ for name,i in pairs({
{ 2/16, -1/16, -2/16, 4/16, 1/16, 2/16} { 2/16, -1/16, -2/16, 4/16, 1/16, 2/16}
}, },
burntime = 6, burntime = 6,
hp = -3,
}, },
parasol = { parasol = {
description = "white parasol mushroom", description = "white parasol mushroom",
@ -608,6 +614,7 @@ for name,i in pairs({
interval = 51, interval = 51,
chance = 36, chance = 36,
}, },
hp = 3,
}, },
red45 = { red45 = {
description = "45 red mushroom", description = "45 red mushroom",
@ -627,6 +634,7 @@ for name,i in pairs({
interval = 1000, interval = 1000,
chance = 180, chance = 180,
}, },
hp = 1,
}, },
brown45 = { brown45 = {
description = "45 brown mushroom", description = "45 brown mushroom",
@ -645,6 +653,7 @@ for name,i in pairs({
interval = 100, interval = 100,
chance = 20, chance = 20,
}, },
hp = 1,
}, },
}) do }) do
local burntime = i.burntime or 1 local burntime = i.burntime or 1
@ -655,7 +664,11 @@ for name,i in pairs({
local nd = "riesenpilz:"..name local nd = "riesenpilz:"..name
minetest.register_node(nd, { minetest.register_node(nd, {
description = i.description, 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", inventory_image = "riesenpilz_"..name.."_side.png",
walkable = false, walkable = false,
buildable_to = true, buildable_to = true,
@ -665,7 +678,8 @@ for name,i in pairs({
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
node_box = box, node_box = box,
selection_box = box, selection_box = box,
furnace_burntime = burntime furnace_burntime = burntime,
on_secondary_use = minetest.item_eat(i.hp),
}) })
local g = i.growing local g = i.growing
@ -705,6 +719,7 @@ for name,i in pairs({
neighbors = g.neighbours, neighbors = g.neighbours,
interval = g.interval, interval = g.interval,
chance = g.chance, chance = g.chance,
catch_up = false,
action = function(pos, node) action = function(pos, node)
if not abm_allowed then if not abm_allowed then
return return
@ -745,7 +760,7 @@ for name,i in pairs({
-- should disallow lag -- should disallow lag
abm_allowed = false abm_allowed = false
minetest.after(2, function() abm_allowed = true end) minetest.after(2, function() abm_allowed = true end)
table.insert(disallowed_ps, pos) disallowed_ps[#disallowed_ps+1] = pos
-- witch circles -- witch circles
local ps = {} local ps = {}
@ -785,7 +800,7 @@ for name,i in pairs({
local light = minetest.get_node_light(pos, 0.5) local light = minetest.get_node_light(pos, 0.5)
if light >= lmin if light >= lmin
and light <= lmax then and light <= lmax then
table.insert(ps, pos) ps[#ps+1] = pos
end end
end end
end end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 B

After

Width:  |  Height:  |  Size: 363 B