update
149
init.lua
@ -2,20 +2,20 @@
|
|||||||
--Textures (edited with gimp) from gamiano.de and minecraft
|
--Textures (edited with gimp) from gamiano.de and minecraft
|
||||||
|
|
||||||
local MAX_SIZE = 3
|
local MAX_SIZE = 3
|
||||||
local TIMT = 10
|
|
||||||
|
|
||||||
|
|
||||||
--Growing Functions
|
--Growing Functions
|
||||||
|
|
||||||
|
|
||||||
local function hybridpilz(pos)
|
local function hybridpilz(pos)
|
||||||
local random = math.random(MAX_SIZE)
|
local random = math.random(MAX_SIZE)
|
||||||
local height = 2 + random
|
local height = 2 + random
|
||||||
local breite = random
|
local breite = random
|
||||||
local br = breite+1
|
local br = breite+1
|
||||||
|
|
||||||
for i = height, 0, -1 do
|
for i = 0, height, 1 do
|
||||||
local p = {x=pos.x, y=pos.y+i, z=pos.z}
|
minetest.env:add_node({x=pos.x, y=pos.y+i, z=pos.z}, {name="riesenpilz:stem"})
|
||||||
minetest.env:add_node(p, {name="riesenpilz:stamm"})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for j = -br, br, 1 do
|
for j = -br, br, 1 do
|
||||||
@ -25,80 +25,80 @@ local function hybridpilz(pos)
|
|||||||
or k == -br
|
or k == -br
|
||||||
or j == br
|
or j == br
|
||||||
or j == -br then
|
or j == -br then
|
||||||
minetest.env:add_node(o, {name="riesenpilz:kappe"})
|
minetest.env:add_node(o, {name="riesenpilz:head_red"})
|
||||||
else
|
else
|
||||||
minetest.env:add_node(o, {name="riesenpilz:lamellen"})
|
minetest.env:add_node(o, {name="riesenpilz:lamellas"})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for l = -breite, breite, 1 do
|
for l = -breite, breite, 1 do
|
||||||
for m = -breite, breite, 1 do
|
for m = -breite, breite, 1 do
|
||||||
local n = {x=pos.x+l, y=pos.y+height+1, z=pos.z+m}
|
minetest.env:add_node({x=pos.x+l, y=pos.y+height+1, z=pos.z+m}, {name="riesenpilz:head_red"})
|
||||||
minetest.env:add_node(n, {name="riesenpilz:kappe"})
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local function brauner_minecraftpilz(pos)
|
local function brauner_minecraftpilz(pos)
|
||||||
local random = math.random(MAX_SIZE-1)
|
local random = math.random(MAX_SIZE-1)
|
||||||
local height = 3+random
|
local height = 3+random
|
||||||
local breite = 2+random
|
local breite = 2+random
|
||||||
|
|
||||||
for i = height, 0, -1 do
|
for i = 0, height, 1 do
|
||||||
local p = {x=pos.x, y=pos.y+i, z=pos.z}
|
minetest.env:add_node({x=pos.x, y=pos.y+i, z=pos.z}, {name="riesenpilz:stem"})
|
||||||
minetest.env:add_node(p, {name="riesenpilz:stamm"})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for j = -breite, breite, 1 do
|
for j = -breite, breite, 1 do
|
||||||
for k = -(breite-1), breite-1, 1 do
|
for k = -(breite-1), breite-1, 1 do
|
||||||
minetest.env:add_node({x=pos.x+j, y=pos.y+height+1, z=pos.z+k}, {name="riesenpilz:kappe2"})
|
minetest.env:add_node({x=pos.x+j, y=pos.y+height+1, z=pos.z+k}, {name="riesenpilz:head_brown"})
|
||||||
minetest.env:add_node({x=pos.x+k, y=pos.y+height+1, z=pos.z+j}, {name="riesenpilz:kappe2"})
|
minetest.env:add_node({x=pos.x+k, y=pos.y+height+1, z=pos.z+j}, {name="riesenpilz:head_brown"})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local function minecraft_fliegenpilz(pos)
|
local function minecraft_fliegenpilz(pos)
|
||||||
local height = 3
|
local height = 3
|
||||||
|
|
||||||
for i = height, 0, -1 do
|
for i = 0, height, 1 do
|
||||||
local p = {x=pos.x, y=pos.y+i, z=pos.z}
|
minetest.env:add_node({x=pos.x, y=pos.y+i, z=pos.z}, {name="riesenpilz:stem"})
|
||||||
minetest.env:add_node(p, {name="riesenpilz:stamm"})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for j = -1, 1, 1 do
|
for j = -1, 1, 1 do
|
||||||
for k = -1, 1, 1 do
|
for k = -1, 1, 1 do
|
||||||
minetest.env:add_node({x=pos.x+j, y=pos.y+height+1, z=pos.z+k}, {name="riesenpilz:kappe"})
|
minetest.env:add_node({x=pos.x+j, y=pos.y+height+1, z=pos.z+k}, {name="riesenpilz:head_red"})
|
||||||
end
|
end
|
||||||
for l = 1, height, 1 do
|
for l = 1, height, 1 do
|
||||||
minetest.env:set_node({x=pos.x+j, y=pos.y+l, z=pos.z+2}, {name="riesenpilz:kappe3", param2=0})
|
minetest.env:set_node({x=pos.x+j, y=pos.y+l, z=pos.z+2}, {name="riesenpilz:head_red_side", param2=0})
|
||||||
minetest.env:set_node({x=pos.x+j, y=pos.y+l, z=pos.z-2}, {name="riesenpilz:kappe3", param2=2})
|
minetest.env:set_node({x=pos.x+j, y=pos.y+l, z=pos.z-2}, {name="riesenpilz:head_red_side", param2=2})
|
||||||
minetest.env:set_node({x=pos.x+2, y=pos.y+l, z=pos.z+j}, {name="riesenpilz:kappe3", param2=1})
|
minetest.env:set_node({x=pos.x+2, y=pos.y+l, z=pos.z+j}, {name="riesenpilz:head_red_side", param2=1})
|
||||||
minetest.env:set_node({x=pos.x-2, y=pos.y+l, z=pos.z+j}, {name="riesenpilz:kappe3", param2=3})
|
minetest.env:set_node({x=pos.x-2, y=pos.y+l, z=pos.z+j}, {name="riesenpilz:head_red_side", param2=3})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--Nodes
|
|
||||||
|
|
||||||
local function pilzsapling(name, desc, texture)
|
--Mushroom Nodes
|
||||||
minetest.register_node("riesenpilz:sapling_"..name, {
|
|
||||||
|
|
||||||
|
local function pilz(name, desc, box)
|
||||||
|
minetest.register_node("riesenpilz:"..name, {
|
||||||
description = desc,
|
description = desc,
|
||||||
tile_images = {texture..".png"},
|
tile_images = {"riesenpilz_"..name.."_top.png", "riesenpilz_"..name.."_bottom.png", "riesenpilz_"..name.."_side.png"},
|
||||||
inventory_image = texture..".png",
|
inventory_image = "riesenpilz_"..name.."_side.png",
|
||||||
walkable = false,
|
walkable = false,
|
||||||
|
drawtype = "nodebox",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
drawtype = "plantlike",
|
groups = {snappy=3,flammable=2},
|
||||||
groups = { snappy = 3 },
|
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
|
node_box = box,
|
||||||
|
selection_box = box,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
pilzsapling("mc_fliegenpilz", "Giant Minecraft Mushroom Red", "pilzsapling2")
|
local BOX_RED = {
|
||||||
pilzsapling("mc_braun", "Giant Minecraft Mushroom Brown", "pilzsapling3")
|
|
||||||
|
|
||||||
local MUSHH = {
|
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
{-1/16, -8/16, -1/16, 1/16, -6/16, 1/16},
|
{-1/16, -8/16, -1/16, 1/16, -6/16, 1/16},
|
||||||
@ -109,19 +109,34 @@ local MUSHH = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
minetest.register_node("riesenpilz:sapling_hybrid", {
|
local BOX_BROWN = {
|
||||||
description = "Giant Mushroom",
|
type = "fixed",
|
||||||
tile_images = {"pilzsapling_t.png", "pilzsapling_t.png^pilzsapling_u.png", "pilzsapling.png"},
|
fixed = {
|
||||||
inventory_image = "pilzsapling.png",
|
{-0.15, -0.2, -0.15, 0.15, -0.1, 0.15},
|
||||||
|
{-0.2, -0.3, -0.2, 0.2, -0.2, 0.2},
|
||||||
|
{-0.05, -0.5, -0.05, 0.05, -0.3, 0.05},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
pilz("brown", "Brown Mushroom", BOX_BROWN)
|
||||||
|
pilz("red", "Red Mushroom", BOX_RED)
|
||||||
|
|
||||||
|
minetest.register_node("riesenpilz:fly_agaric", {
|
||||||
|
description = "Fly Agaric",
|
||||||
|
tile_images = {"riesenpilz_fly_agaric_side.png"},
|
||||||
|
inventory_image = "riesenpilz_fly_agaric_side.png",
|
||||||
walkable = false,
|
walkable = false,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
drawtype = "nodebox",
|
drawtype = "plantlike",
|
||||||
groups = { snappy = 3 },
|
groups = {snappy=3,flammable=2},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
node_box = MUSHH,
|
|
||||||
selection_box = MUSHH,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
--Mushroom Blocks
|
||||||
|
|
||||||
|
|
||||||
local function pilznode(name, desc, textures, sapling)
|
local function pilznode(name, desc, textures, sapling)
|
||||||
minetest.register_node("riesenpilz:"..name, {
|
minetest.register_node("riesenpilz:"..name, {
|
||||||
description = desc,
|
description = desc,
|
||||||
@ -133,48 +148,40 @@ minetest.register_node("riesenpilz:"..name, {
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
pilznode("stamm", "Giant Mushroom Stem", {"pilzstamm2.png","pilzstamm2.png","pilzstamm.png"}, "stamm")
|
pilznode("stem", "Giant Mushroom Stem", {"riesenpilz_stem_top.png","riesenpilz_stem_top.png","riesenpilz_stem.png"}, "stem")
|
||||||
pilznode("lamellen", "Giant Mushroom Lamella", {"pilzlamellen.png"}, "lamellen")
|
pilznode("lamellas", "Giant Mushroom Lamella", {"riesenpilz_lamellas.png"}, "lamellas")
|
||||||
pilznode("kappe", "Giant Mushroom Head", {"pilzkappe.png", "pilzlamellen.png", "pilzkappe.png"}, "sapling_hybrid")
|
pilznode("head_red", "Giant Mushroom Head Red", {"riesenpilz_head.png", "riesenpilz_lamellas.png", "riesenpilz_head.png"}, "red")
|
||||||
pilznode("kappe2", "Giant Mushroom Head Brown", {"pilzbraun.png","pilzlamellen.png","pilzbraun.png"}, "sapling_mc_braun")
|
pilznode("head_brown", "Giant Mushroom Head Brown", {"riesenpilz_brown_top.png","riesenpilz_lamellas.png","riesenpilz_brown_top.png"}, "brown")
|
||||||
|
|
||||||
minetest.register_node("riesenpilz:kappe3", {
|
minetest.register_node("riesenpilz:head_red_side", {
|
||||||
description = "Giant Mushroom Head Side",
|
description = "Giant Mushroom Head Side",
|
||||||
tile_images = {"pilzkappe.png", "pilzlamellen.png", "pilzkappe.png",
|
tile_images = {"riesenpilz_head.png", "riesenpilz_lamellas.png", "riesenpilz_head.png",
|
||||||
"pilzkappe.png", "pilzkappe.png","pilzlamellen.png"},
|
"riesenpilz_head.png", "riesenpilz_head.png", "riesenpilz_lamellas.png"},
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
groups = {oddly_breakable_by_hand=3},
|
groups = {oddly_breakable_by_hand=3},
|
||||||
drop = {max_items = 1,
|
drop = {max_items = 1,
|
||||||
items = {{items = {"riesenpilz:sapling_mc_fliegenpilz"},rarity = 20,},
|
items = {{items = {"riesenpilz:fly_agaric"},rarity = 20,},
|
||||||
{items = {"riesenpilz:kappe"},rarity = 1,}}},
|
{items = {"riesenpilz:head_red"},rarity = 1,}}},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--Growing
|
--Growing
|
||||||
|
|
||||||
minetest.register_abm({
|
|
||||||
nodenames = {"riesenpilz:sapling_hybrid"},
|
minetest.register_tool("riesenpilz:growingtool", {
|
||||||
interval = TIMT,
|
description = "Growingtool",
|
||||||
chance = TIMT,
|
inventory_image = "riesenpilz_growingtool.png",
|
||||||
action = function(pos)
|
})
|
||||||
|
|
||||||
|
minetest.register_on_punchnode(function(pos, node, puncher)
|
||||||
|
if puncher:get_wielded_item():get_name() == "riesenpilz:growingtool" then
|
||||||
|
if minetest.env:get_node(pos).name == "riesenpilz:red" then
|
||||||
hybridpilz(pos)
|
hybridpilz(pos)
|
||||||
end
|
elseif minetest.env:get_node(pos).name == "riesenpilz:fly_agaric" then
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_abm({
|
|
||||||
nodenames = {"riesenpilz:sapling_mc_fliegenpilz"},
|
|
||||||
interval = TIMT,
|
|
||||||
chance = TIMT,
|
|
||||||
action = function(pos)
|
|
||||||
minecraft_fliegenpilz(pos)
|
minecraft_fliegenpilz(pos)
|
||||||
end
|
elseif minetest.env:get_node(pos).name == "riesenpilz:brown" then
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_abm({
|
|
||||||
nodenames = {"riesenpilz:sapling_mc_braun"},
|
|
||||||
interval = TIMT,
|
|
||||||
chance = TIMT,
|
|
||||||
action = function(pos)
|
|
||||||
brauner_minecraftpilz(pos)
|
brauner_minecraftpilz(pos)
|
||||||
end
|
end
|
||||||
})
|
end
|
||||||
|
end)
|
||||||
|
Before Width: | Height: | Size: 580 B |
Before Width: | Height: | Size: 167 B |
BIN
textures/riesenpilz_brown_bottom.png
Normal file
After Width: | Height: | Size: 336 B |
BIN
textures/riesenpilz_brown_side.png
Normal file
After Width: | Height: | Size: 264 B |
Before Width: | Height: | Size: 240 B After Width: | Height: | Size: 240 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
BIN
textures/riesenpilz_growingtool.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 1013 B After Width: | Height: | Size: 1013 B |
BIN
textures/riesenpilz_red_bottom.png
Normal file
After Width: | Height: | Size: 319 B |
Before Width: | Height: | Size: 285 B After Width: | Height: | Size: 285 B |
Before Width: | Height: | Size: 282 B After Width: | Height: | Size: 282 B |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 145 B After Width: | Height: | Size: 145 B |