From 940974734df05afee915f34b768f2a4ea36b708d Mon Sep 17 00:00:00 2001 From: HybridDog Date: Wed, 24 Apr 2013 20:53:20 +0200 Subject: [PATCH] add mapgen --- 233.png | Bin 295 -> 0 bytes BlockCSS.png | Bin 270 -> 0 bytes init.lua | 30 +++++++-- mapgen.lua | 95 ++++++++++++++++++++++++++++ settings.lua | 7 ++ textures/riesenpilz_ground_side.png | Bin 0 -> 688 bytes textures/riesenpilz_ground_top.png | Bin 0 -> 633 bytes 7 files changed, 126 insertions(+), 6 deletions(-) delete mode 100644 233.png delete mode 100644 BlockCSS.png create mode 100644 mapgen.lua create mode 100644 settings.lua create mode 100644 textures/riesenpilz_ground_side.png create mode 100644 textures/riesenpilz_ground_top.png diff --git a/233.png b/233.png deleted file mode 100644 index 63b52324df153cf983d399495d3f83297c53b35a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 295 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~;{cx!*Vyo| zgvhw0*qF??_>6?q^u(Opq@=v0ytItevXr!(jPmBJ{PO(P#{9yb;__KljcpyR9^a&{ z1GO*mba4!kxXjz= -10 then + local x0,z0,x1,z1 = minp.x,minp.z,maxp.x,maxp.z -- Assume X and Z lengths are equal + local env = minetest.env --Should make things a bit faster. + local perlin1 = env:get_perlin(11,3, 0.5, 200) --Get map specific perlin + + --[[if not (perlin1:get2d({x=x0, y=z0}) > 0.53) and not (perlin1:get2d({x=x1, y=z1}) > 0.53) + and not (perlin1:get2d({x=x0, y=z1}) > 0.53) and not (perlin1:get2d({x=x1, y=z0}) > 0.53) + and not (perlin1:get2d({x=(x1-x0)/2, y=(z1-z0)/2}) > 0.53) then]] + if not ( perlin1:get2d( {x=x0, y=z0} ) > 0.53 ) --top left + and not ( perlin1:get2d( { x = x0 + ( (x1-x0)/2), y=z0 } ) > 0.53 )--top middle + and not (perlin1:get2d({x=x1, y=z1}) > 0.53) --bottom right + and not (perlin1:get2d({x=x1, y=z0+((z1-z0)/2)}) > 0.53) --right middle + and not (perlin1:get2d({x=x0, y=z1}) > 0.53) --bottom left + and not (perlin1:get2d({x=x1, y=z0}) > 0.53) --top right + and not (perlin1:get2d({x=x0+((x1-x0)/2), y=z1}) > 0.53) --left middle + and not (perlin1:get2d({x=(x1-x0)/2, y=(z1-z0)/2}) > 0.53) --middle + and not (perlin1:get2d({x=x0, y=z1+((z1-z0)/2)}) > 0.53) then --bottom middle + print("abortsumpf") + return + end + local divs = (maxp.x-minp.x); + local pr = PseudoRandom(seed+68) + + --remove usual stuff + local trees = env:find_nodes_in_area(minp, maxp, USUAL_STUFF) + for i,v in pairs(trees) do + env:remove_node(v) + end + + --Information: + local geninfo = "-#- giant mushrooms generate: x=["..minp.x.."; "..maxp.x.."] z=["..minp.z.."; "..maxp.z.."]" + print(geninfo) + minetest.chat_send_all(geninfo) + + local smooth = riesenpilz.smooth + + for j=0,divs do + for i=0,divs do + local x,z = x0+i,z0+j + + --Check if we are in a "riesenpilz biome" + local in_biome = false + local test = perlin1:get2d({x=x, y=z}) + --smooth mapgen + if smooth and (test > 0.73 or (test > 0.43 and pr:next(0,29) > (0.73 - test) * 100 )) then + in_biome = true + elseif (not smooth) and test > 0.53 then + in_biome = true + end + + if in_biome then + + local ground_y = nil --Definition des Bodens: + for y=maxp.y,0,-1 do + if find_ground({x=x,y=y,z=z}, GROUND) then + ground_y = y + break + end + end + if ground_y then + local boden = {x=x,y=ground_y+1,z=z} + if pr:next(1,380) == 1 then + riesenpilz_hybridpilz(boden) + elseif pr:next(1,340) == 10 then + riesenpilz_brauner_minecraftpilz(boden) + elseif pr:next(1,390) == 20 then + riesenpilz_minecraft_fliegenpilz(boden) + end + env:add_node({x=x,y=ground_y,z=z}, {name="riesenpilz:ground"}) + for i = -1,-5,-1 do + local pos = {x=x,y=ground_y+i,z=z} + if env:get_node(pos).name == "default:desert_sand" then + env:add_node(pos, {name="default:dirt"}) + else + break + end + end + end + end + end + end + end +end) diff --git a/settings.lua b/settings.lua new file mode 100644 index 0000000..ae3bfad --- /dev/null +++ b/settings.lua @@ -0,0 +1,7 @@ +--This file contains configuration options for riesenpilz mod. + +--Enables mapgen. +riesenpilz.enable_mapgen = false + +--Enables smooth transition of biomes. +riesenpilz.smooth = false diff --git a/textures/riesenpilz_ground_side.png b/textures/riesenpilz_ground_side.png new file mode 100644 index 0000000000000000000000000000000000000000..4241941d0edde023c357dc05d3723db5d71a098a GIT binary patch literal 688 zcmV;h0#E&kP)Px%YDq*vR5;7!%uh%ZVI0Qs=l#vRv$HeqA6NUQUOQChAn@d&4qfV&6-1d?f|sy@ z@X$FbgfP^oFe4!>2niyL=+Gg$mIxIkK`NHHJG-;o9QN0p}W}LV(NwE_peq%pmV**pMI+3zWvtTG%Dp*Y%~eX5J;&Ewe@9GH&y^EQ7nY;{UU;vR{W|bbJAFAEkPO&Ymrq@0l?6)BMY#y=icnoUFT08e_Jkuos@Hs0l>t} z^kAVSoXH1%BM9>E0bpcsVA=~i);G__W*+SkB8mZEbn4+gg6eQxFDPB=KYfTXb5|jU&X(;&^NFj|Bv61 Wh%}{24IerH0000p>P literal 0 HcmV?d00001 diff --git a/textures/riesenpilz_ground_top.png b/textures/riesenpilz_ground_top.png new file mode 100644 index 0000000000000000000000000000000000000000..654bcfa74dabeff35e8b5a82d7afa9822140cde2 GIT binary patch literal 633 zcmV-<0*3vGP)Px%Gf6~2R4C5{!EJ8bHV^>N5jo^gqCPCg4$>dZ^#bGoJ#Ep#Fj^pXcAZ^`qDT%o zd9VBH+jlbN9)&q$$0H&2J~e&&xS-0D#}GAjSx`)@7f0QKe);-3q zRn)*KZDkw$0>*Vvxe@tAAq`vw%KkKy?)bLfQ%WLW5tenGAD+%!2xT27OG7*vw-89B z5Ppq4E%Qjj<1L);zi!W;My}Gd1FN;dl#(OI(5acEmTQRH$F?z0YC2_EpZ-8IgyYOr zb;{o(@7(qfI$#9gD)9Mn>eP~fZkKzN`aIai49W;7-_scrvns7lMzD6OcTYWbmyM4Y z=Jk_z6z)G-t-YUfX(5E;%#Q55%=>*q)H;`n3b|~hv@;;EI^*&Aftt~Nd<^$@i{hQp z!W}RQr&Mw59a%%x)EeL3H|M4VWOzG{Yssm##-$q7``)5OfKJYMII;r9nql^i$SD7n zAWFIX`|{SHo1BJLv~Jk<^Q1LE-NIp9Z?O~Y;<<Oi)EDWa~|o6=T6RT{@>oY#jlYpzuQdN*QgVBC^e(mfm}`=R&V zpDBV=XPq__GaIXf8Ldw&ia8Nla!UjB0}?9Kz@h*kGq;*z__$tw=GszLF&)1FyFPQW TB}Z9P00000NkvXXu0mjf?r