From 6f6b3d627255376f8481e225d9cf58638a65caa7 Mon Sep 17 00:00:00 2001 From: HybridDog Date: Thu, 4 Apr 2013 18:44:35 +0200 Subject: [PATCH] update --- init.lua | 167 +++++++++--------- textures/pilzsapling3.png | Bin 580 -> 0 bytes textures/pilzsapling_u.png | Bin 167 -> 0 bytes textures/riesenpilz_brown_bottom.png | Bin 0 -> 336 bytes textures/riesenpilz_brown_side.png | Bin 0 -> 264 bytes ...pilzbraun.png => riesenpilz_brown_top.png} | Bin ...ng2.png => riesenpilz_fly_agaric_side.png} | Bin textures/riesenpilz_growingtool.png | Bin 0 -> 2397 bytes .../{pilzkappe.png => riesenpilz_head.png} | Bin ...lzlamellen.png => riesenpilz_lamellas.png} | Bin textures/riesenpilz_red_bottom.png | Bin 0 -> 319 bytes ...ilzsapling.png => riesenpilz_red_side.png} | Bin ...lzsapling_t.png => riesenpilz_red_top.png} | Bin .../{pilzstamm.png => riesenpilz_stem.png} | Bin ...pilzstamm2.png => riesenpilz_stem_top.png} | Bin 15 files changed, 87 insertions(+), 80 deletions(-) delete mode 100644 textures/pilzsapling3.png delete mode 100644 textures/pilzsapling_u.png create mode 100644 textures/riesenpilz_brown_bottom.png create mode 100644 textures/riesenpilz_brown_side.png rename textures/{pilzbraun.png => riesenpilz_brown_top.png} (100%) rename textures/{pilzsapling2.png => riesenpilz_fly_agaric_side.png} (100%) create mode 100644 textures/riesenpilz_growingtool.png rename textures/{pilzkappe.png => riesenpilz_head.png} (100%) rename textures/{pilzlamellen.png => riesenpilz_lamellas.png} (100%) create mode 100644 textures/riesenpilz_red_bottom.png rename textures/{pilzsapling.png => riesenpilz_red_side.png} (100%) rename textures/{pilzsapling_t.png => riesenpilz_red_top.png} (100%) rename textures/{pilzstamm.png => riesenpilz_stem.png} (100%) rename textures/{pilzstamm2.png => riesenpilz_stem_top.png} (100%) diff --git a/init.lua b/init.lua index d952cb8..d41d7c8 100644 --- a/init.lua +++ b/init.lua @@ -2,20 +2,20 @@ --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"}) + for i = 0, height, 1 do + minetest.env:add_node({x=pos.x, y=pos.y+i, z=pos.z}, {name="riesenpilz:stem"}) end for j = -br, br, 1 do @@ -25,103 +25,118 @@ local function hybridpilz(pos) or k == -br or j == br or j == -br then - minetest.env:add_node(o, {name="riesenpilz:kappe"}) + minetest.env:add_node(o, {name="riesenpilz:head_red"}) else - minetest.env:add_node(o, {name="riesenpilz:lamellen"}) + minetest.env:add_node(o, {name="riesenpilz:lamellas"}) 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"}) + minetest.env:add_node({x=pos.x+l, y=pos.y+height+1, z=pos.z+m}, {name="riesenpilz:head_red"}) 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"}) + for i = 0, height, 1 do + minetest.env:add_node({x=pos.x, y=pos.y+i, z=pos.z}, {name="riesenpilz:stem"}) 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"}) + 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:head_brown"}) 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"}) + for i = 0, height, 1 do + minetest.env:add_node({x=pos.x, y=pos.y+i, z=pos.z}, {name="riesenpilz:stem"}) 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"}) + minetest.env:add_node({x=pos.x+j, y=pos.y+height+1, z=pos.z+k}, {name="riesenpilz:head_red"}) 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}) + 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:head_red_side", param2=2}) + 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:head_red_side", param2=3}) end end end ---Nodes -local function pilzsapling(name, desc, texture) -minetest.register_node("riesenpilz:sapling_"..name, { +--Mushroom Nodes + + +local function pilz(name, desc, box) +minetest.register_node("riesenpilz:"..name, { description = desc, - tile_images = {texture..".png"}, - inventory_image = texture..".png", + tile_images = {"riesenpilz_"..name.."_top.png", "riesenpilz_"..name.."_bottom.png", "riesenpilz_"..name.."_side.png"}, + inventory_image = "riesenpilz_"..name.."_side.png", walkable = false, + drawtype = "nodebox", paramtype = "light", - drawtype = "plantlike", - groups = { snappy = 3 }, + groups = {snappy=3,flammable=2}, sounds = default.node_sound_leaves_defaults(), + node_box = box, + selection_box = box, }) end -pilzsapling("mc_fliegenpilz", "Giant Minecraft Mushroom Red", "pilzsapling2") -pilzsapling("mc_braun", "Giant Minecraft Mushroom Brown", "pilzsapling3") +local BOX_RED = { + 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}, + }, +} -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}, - }, - } +local BOX_BROWN = { + type = "fixed", + fixed = { + {-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}, + }, +} -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", +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, paramtype = "light", - drawtype = "nodebox", - groups = { snappy = 3 }, + drawtype = "plantlike", + groups = {snappy=3,flammable=2}, sounds = default.node_sound_leaves_defaults(), - node_box = MUSHH, - selection_box = MUSHH, }) + + +--Mushroom Blocks + + local function pilznode(name, desc, textures, sapling) minetest.register_node("riesenpilz:"..name, { description = desc, @@ -133,48 +148,40 @@ minetest.register_node("riesenpilz:"..name, { }) 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") +pilznode("stem", "Giant Mushroom Stem", {"riesenpilz_stem_top.png","riesenpilz_stem_top.png","riesenpilz_stem.png"}, "stem") +pilznode("lamellas", "Giant Mushroom Lamella", {"riesenpilz_lamellas.png"}, "lamellas") +pilznode("head_red", "Giant Mushroom Head Red", {"riesenpilz_head.png", "riesenpilz_lamellas.png", "riesenpilz_head.png"}, "red") +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", - tile_images = {"pilzkappe.png", "pilzlamellen.png", "pilzkappe.png", - "pilzkappe.png", "pilzkappe.png","pilzlamellen.png"}, + tile_images = {"riesenpilz_head.png", "riesenpilz_lamellas.png", "riesenpilz_head.png", + "riesenpilz_head.png", "riesenpilz_head.png", "riesenpilz_lamellas.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,}}}, + items = {{items = {"riesenpilz:fly_agaric"},rarity = 20,}, + {items = {"riesenpilz:head_red"},rarity = 1,}}}, }) + --Growing -minetest.register_abm({ - nodenames = {"riesenpilz:sapling_hybrid"}, - interval = TIMT, - chance = TIMT, - action = function(pos) - hybridpilz(pos) - end + +minetest.register_tool("riesenpilz:growingtool", { + description = "Growingtool", + inventory_image = "riesenpilz_growingtool.png", }) -minetest.register_abm({ - nodenames = {"riesenpilz:sapling_mc_fliegenpilz"}, - interval = TIMT, - chance = TIMT, - action = function(pos) - minecraft_fliegenpilz(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) + elseif minetest.env:get_node(pos).name == "riesenpilz:fly_agaric" then + minecraft_fliegenpilz(pos) + elseif minetest.env:get_node(pos).name == "riesenpilz:brown" then + brauner_minecraftpilz(pos) + end end -}) - -minetest.register_abm({ - nodenames = {"riesenpilz:sapling_mc_braun"}, - interval = TIMT, - chance = TIMT, - action = function(pos) - brauner_minecraftpilz(pos) - end -}) +end) diff --git a/textures/pilzsapling3.png b/textures/pilzsapling3.png deleted file mode 100644 index 465fe9fb6893da54cb29284b959fac497e8f4a12..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 580 zcmV-K0=xZ*P)Px#PEbr#MF1H9do2K(O%tnNB&%aDyka52Viu`tLe6w9)^#b)c{{~>N5Otp+>BDy zk6-AGNYa&d>ziKYpm6z}Sm3FM`>t~Kuzva0xcTAC|NZs`51;q|0004WQchC}t zCPYEpv-dMlBJ$p^TWh_I5-iL1@u1VcO-zUIe_?;@eL5cSOOVj`_vCO zgDfCu3aS>y3LrysW#E+X5)g#il+lJV(8ATuyzhG{F_u)An3{au@>mB|8Qc4Q0hCeX zjeF2upph-CZOh*a*o!iXMrK~OKGIFdy@yrC^RCmE6t9O6)>R7myrmcBUOh2lif)N1 z#kj=ikjYm8#HRp*oU{=+p>@U~I_oSVqf~-BJ#WSdD<<#(0gZ8Pan=|kwM;N4sxUp@ z1j9rLz&mHHbsCMab_Q#Sc<3}ZgoGeoy|j^>vBu8E0^&5(%ag;)tvAXBUYSU6W*R-u zlV~~5^YeVD=$99NO3UXToy!|P#qt;6_)oxjnl}Ku7=H-UTY%#@9t$}B4fq1$m>rJkSmX22WQ% Jmvv4FO#of@GHd_< diff --git a/textures/riesenpilz_brown_bottom.png b/textures/riesenpilz_brown_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..55a03f46ea152f1271426b7dc5e41bcd3252cef4 GIT binary patch literal 336 zcmV-W0k8gvP)Px#OHfQyMP@h^e^DxsVmq61K%{g{tbSIzhGe#gV!4c9x{zzZmvY0HYRsH=$Deu7 zqjl4wd(NeN&ZdLcr-#?9gVn8y+p~@4w3Fq#l=sV~nJrgE00029Nklo-p&XP9tNn=NU1l_p8UG6U6OZeMo@QNWKVw7`U!d4XH@K%S$Px&08mU+MbK=w00961022ZL82|t(0RT1u0AK(Bc>n@v4FH=X5eF6k|2GyEFB}d) z7z#HU5jz|TKpGM^9|=br21^+cHX#yL84))hF*YG3JR&zkBp5*@FhnO5OeGgjB@<^L z5JV^|M=B>rEgn@WB3UaRO)fQEEF4-c7EUiQRxcb-F&a)UJY*{)Q!yY?F(h9tCr~jg zRxl-CFb!-hB4scbX)hvNG#^en7+E$YV>BFPGa_9zCR{fgTQ?zDH!5W`C|Wi=aWN}i zH!Nf}E?qb=T{t#!HyC|0A!<4&VLc{kJs4v+UT-=rZag1jJvnGEMAa_78aY8w5L^*swH+DlSaz!O|Lp5SXqr$GK5z|iBWNkRyTfGMUYo6 zhE`ULS3ZPTOqo?Ml2<^1TTPT$JC;~Bj965EUP+i)GLBkNeqT?HSZt16JbGbRnpsMf zSzC}?O@v`Vjb2ELUrv}_G?Q3`onA1QT}qu^HltlJonAbcUQvK%Nv2&noLyLxVnm)` zL!MwsjbmS;U{H)^SfXM;q+>OWXh@r6M}=uuq+>gwUv#HpN26j_mS|R$Xk3$rSvuZxDYEQLmIjm`Fl5@Fen-!KU)F&`y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dgaA;RVRBvC!_Jg3i zU-$6U8eR65?VvfCmymw|QjumatCL$u P00000NkvXXu0mjfg?<6v literal 0 HcmV?d00001 diff --git a/textures/pilzkappe.png b/textures/riesenpilz_head.png similarity index 100% rename from textures/pilzkappe.png rename to textures/riesenpilz_head.png diff --git a/textures/pilzlamellen.png b/textures/riesenpilz_lamellas.png similarity index 100% rename from textures/pilzlamellen.png rename to textures/riesenpilz_lamellas.png diff --git a/textures/riesenpilz_red_bottom.png b/textures/riesenpilz_red_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..9a6b79244801453ac512dbeff9eae9ed492d4f42 GIT binary patch literal 319 zcmV-F0l@x=P)Px#MNmvsMe+$R{1GqvA~=*>E&D$~`AkNjYd-&4KCF04|7cMBX;HF*SpIND{c}|3 zeowrRWdDO$|BPM6oOJ(@PXCr+%cgwTwU331;sgKy0H{esK~xyi9gjf*!ypI*0ks+m zLaOQipW3x2#}yf%-bL?B>U|kbfLS`}-E*xwRY^n$ffzFh<03r|C|9r}X!R1G-k61G z;&*l0{*LEcUY=AJxvkbllrdh@w;!EsFYzEs*T2R1envzo%t`szUJ)n>__H31dpw^q zzV40+GqDMOww%zP(U;*N71PX#U8->&=xfQ=R64C?qIKm>l$ak&5fcme&=1%w2=ca^ RBklkI002ovPDHLkV1n8HhVK9X literal 0 HcmV?d00001 diff --git a/textures/pilzsapling.png b/textures/riesenpilz_red_side.png similarity index 100% rename from textures/pilzsapling.png rename to textures/riesenpilz_red_side.png diff --git a/textures/pilzsapling_t.png b/textures/riesenpilz_red_top.png similarity index 100% rename from textures/pilzsapling_t.png rename to textures/riesenpilz_red_top.png diff --git a/textures/pilzstamm.png b/textures/riesenpilz_stem.png similarity index 100% rename from textures/pilzstamm.png rename to textures/riesenpilz_stem.png diff --git a/textures/pilzstamm2.png b/textures/riesenpilz_stem_top.png similarity index 100% rename from textures/pilzstamm2.png rename to textures/riesenpilz_stem_top.png