commit f679925b30969fe6a7929d4c5c041869e1d4f788 Author: HybridDog Date: Tue Jan 29 18:38:49 2013 +0100 sort diff --git a/233.png b/233.png new file mode 100644 index 0000000..63b5232 Binary files /dev/null and b/233.png differ diff --git a/BlockCSS.png b/BlockCSS.png new file mode 100644 index 0000000..c97dfe3 Binary files /dev/null and b/BlockCSS.png differ diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..3a7daa1 --- /dev/null +++ b/depends.txt @@ -0,0 +1,2 @@ +default + diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..d952cb8 --- /dev/null +++ b/init.lua @@ -0,0 +1,180 @@ +---------------------------------------------------riesenpilz 12.12-------------------------------------------------- +--Textures (edited with gimp) from gamiano.de and minecraft + +local MAX_SIZE = 3 +local TIMT = 10 + + +--Growing Functions + +local function hybridpilz(pos) + local random = math.random(MAX_SIZE) + local height = 2 + random + local breite = random + local br = breite+1 + + for i = height, 0, -1 do + local p = {x=pos.x, y=pos.y+i, z=pos.z} + minetest.env:add_node(p, {name="riesenpilz:stamm"}) + end + + for j = -br, br, 1 do + for k = -br, br, 1 do + local o = {x=pos.x+j, y=pos.y+height, z=pos.z+k} + if k == br + or k == -br + or j == br + or j == -br then + minetest.env:add_node(o, {name="riesenpilz:kappe"}) + else + minetest.env:add_node(o, {name="riesenpilz:lamellen"}) + end + end + end + + for l = -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(n, {name="riesenpilz:kappe"}) + end + end +end + +local function brauner_minecraftpilz(pos) + local random = math.random(MAX_SIZE-1) + local height = 3+random + local breite = 2+random + + for i = height, 0, -1 do + local p = {x=pos.x, y=pos.y+i, z=pos.z} + minetest.env:add_node(p, {name="riesenpilz:stamm"}) + end + + for j = -breite, breite, 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+k, y=pos.y+height+1, z=pos.z+j}, {name="riesenpilz:kappe2"}) + end + end +end + +local function minecraft_fliegenpilz(pos) + local height = 3 + + for i = height, 0, -1 do + local p = {x=pos.x, y=pos.y+i, z=pos.z} + minetest.env:add_node(p, {name="riesenpilz:stamm"}) + end + + for j = -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"}) + end + 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:kappe3", 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:kappe3", param2=3}) + end + end +end + + +--Nodes + +local function pilzsapling(name, desc, texture) +minetest.register_node("riesenpilz:sapling_"..name, { + description = desc, + tile_images = {texture..".png"}, + inventory_image = texture..".png", + walkable = false, + paramtype = "light", + drawtype = "plantlike", + groups = { snappy = 3 }, + sounds = default.node_sound_leaves_defaults(), +}) +end + +pilzsapling("mc_fliegenpilz", "Giant Minecraft Mushroom Red", "pilzsapling2") +pilzsapling("mc_braun", "Giant Minecraft Mushroom Brown", "pilzsapling3") + +local MUSHH = { + type = "fixed", + fixed = { + {-1/16, -8/16, -1/16, 1/16, -6/16, 1/16}, + {-3/16, -6/16, -3/16, 3/16, -5/16, 3/16}, + {-4/16, -5/16, -4/16, 4/16, -4/16, 4/16}, + {-3/16, -4/16, -3/16, 3/16, -3/16, 3/16}, + {-2/16, -3/16, -2/16, 2/16, -2/16, 2/16}, + }, + } + +minetest.register_node("riesenpilz:sapling_hybrid", { + description = "Giant Mushroom", + tile_images = {"pilzsapling_t.png", "pilzsapling_t.png^pilzsapling_u.png", "pilzsapling.png"}, + inventory_image = "pilzsapling.png", + walkable = false, + paramtype = "light", + drawtype = "nodebox", + groups = { snappy = 3 }, + sounds = default.node_sound_leaves_defaults(), + node_box = MUSHH, + selection_box = MUSHH, +}) + +local function pilznode(name, desc, textures, sapling) +minetest.register_node("riesenpilz:"..name, { + description = desc, + tile_images = textures, + groups = {oddly_breakable_by_hand=3}, + drop = {max_items = 1, + items = {{items = {"riesenpilz:"..sapling},rarity = 20,}, + {items = {"riesenpilz:"..name},rarity = 1,}}}, +}) +end + +pilznode("stamm", "Giant Mushroom Stem", {"pilzstamm2.png","pilzstamm2.png","pilzstamm.png"}, "stamm") +pilznode("lamellen", "Giant Mushroom Lamella", {"pilzlamellen.png"}, "lamellen") +pilznode("kappe", "Giant Mushroom Head", {"pilzkappe.png", "pilzlamellen.png", "pilzkappe.png"}, "sapling_hybrid") +pilznode("kappe2", "Giant Mushroom Head Brown", {"pilzbraun.png","pilzlamellen.png","pilzbraun.png"}, "sapling_mc_braun") + +minetest.register_node("riesenpilz:kappe3", { + description = "Giant Mushroom Head Side", + tile_images = {"pilzkappe.png", "pilzlamellen.png", "pilzkappe.png", + "pilzkappe.png", "pilzkappe.png","pilzlamellen.png"}, + paramtype2 = "facedir", + groups = {oddly_breakable_by_hand=3}, + drop = {max_items = 1, + items = {{items = {"riesenpilz:sapling_mc_fliegenpilz"},rarity = 20,}, + {items = {"riesenpilz:kappe"},rarity = 1,}}}, +}) + + +--Growing + +minetest.register_abm({ + nodenames = {"riesenpilz:sapling_hybrid"}, + interval = TIMT, + chance = TIMT, + action = function(pos) + hybridpilz(pos) + end +}) + +minetest.register_abm({ + nodenames = {"riesenpilz:sapling_mc_fliegenpilz"}, + interval = TIMT, + chance = TIMT, + action = function(pos) + minecraft_fliegenpilz(pos) + end +}) + +minetest.register_abm({ + nodenames = {"riesenpilz:sapling_mc_braun"}, + interval = TIMT, + chance = TIMT, + action = function(pos) + brauner_minecraftpilz(pos) + end +}) diff --git a/textures/pilzbraun.png b/textures/pilzbraun.png new file mode 100644 index 0000000..7ad69ca Binary files /dev/null and b/textures/pilzbraun.png differ diff --git a/textures/pilzkappe.png b/textures/pilzkappe.png new file mode 100644 index 0000000..a5f7b0d Binary files /dev/null and b/textures/pilzkappe.png differ diff --git a/textures/pilzlamellen.png b/textures/pilzlamellen.png new file mode 100644 index 0000000..22d990a Binary files /dev/null and b/textures/pilzlamellen.png differ diff --git a/textures/pilzsapling.png b/textures/pilzsapling.png new file mode 100644 index 0000000..295e4c2 Binary files /dev/null and b/textures/pilzsapling.png differ diff --git a/textures/pilzsapling2.png b/textures/pilzsapling2.png new file mode 100644 index 0000000..68211b8 Binary files /dev/null and b/textures/pilzsapling2.png differ diff --git a/textures/pilzsapling3.png b/textures/pilzsapling3.png new file mode 100644 index 0000000..465fe9f Binary files /dev/null and b/textures/pilzsapling3.png differ diff --git a/textures/pilzsapling_t.png b/textures/pilzsapling_t.png new file mode 100644 index 0000000..d95d31e Binary files /dev/null and b/textures/pilzsapling_t.png differ diff --git a/textures/pilzsapling_u.png b/textures/pilzsapling_u.png new file mode 100644 index 0000000..44bce36 Binary files /dev/null and b/textures/pilzsapling_u.png differ diff --git a/textures/pilzstamm.png b/textures/pilzstamm.png new file mode 100644 index 0000000..c4fb14b Binary files /dev/null and b/textures/pilzstamm.png differ diff --git a/textures/pilzstamm2.png b/textures/pilzstamm2.png new file mode 100644 index 0000000..2bc3e64 Binary files /dev/null and b/textures/pilzstamm2.png differ