Compare commits

..

No commits in common. "master" and "nalc-1.0" have entirely different histories.

74 changed files with 307 additions and 154 deletions

BIN
/ 😿 Normal file

Binary file not shown.

BIN
/caverealms_fungi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

BIN
/caverealms_mycena.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 B

BIN
/frying.mp3 Normal file

Binary file not shown.

2
/info.txt Normal file
View File

@ -0,0 +1,2 @@
frying from http://freesound.org/people/davidkay/sounds/132472/ (WTFPL)
cutting from http://freesound.org/people/nhaudio/sounds/192416/ (WTFPL)

BIN
/mush45_b.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

BIN
/mush45_b0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 B

BIN
/mush45_b1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 B

BIN
/mush45_b2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

BIN
/mush45_bm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

BIN
/mush45_bm2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

BIN
/mush45_bm3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

BIN
/mush45_bm4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

BIN
/mush45_r.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

BIN
/mush45_r0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 B

BIN
/mush45_rm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 B

BIN
/mush45_rm2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

BIN
/mush45_rm3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 B

BIN
/mush45_rm4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

203
/old_mapgen.lua Normal file
View File

@ -0,0 +1,203 @@
--[[
function riesenpilz_circle(nam, pos, radius, rand, seed)
local ra = seed
for i = -radius, radius, 1 do
for j = -radius, radius, 1 do
if math.floor( math.sqrt(i^2+j^2) +0.5) == radius then
random = PseudoRandom(ra)
p={x=pos.x+i, y=pos.y, z=pos.z+j}
if minetest.get_node(p).name == "air"
and random:next(1,rand) == 1
and minetest.get_node({x=pos.x+i, y=pos.y-1, z=pos.z+j}).name ~= "air" then
minetest.add_node(p, {name=nam})
end
ra = ra+1
end
end
end
end
elseif pr:next(1,80) == 1 then
riesenpilz_circle("riesenpilz:brown", boden, pr:next(2,3), 3, seed)
elseif pr:next(1,90) == 1 then
riesenpilz_circle("riesenpilz:red", boden, pr:next(3,4), 3, seed)
elseif pr:next(1,100) == 1 then
riesenpilz_circle("riesenpilz:fly_agaric", boden, 3, 3, seed)
elseif pr:next(1,4000) == 1 then
riesenpilz_circle("riesenpilz:lavashroom", boden, pr:next(4,5), 3, seed)
elseif pr:next(1,5000) == 1 then
riesenpilz_circle("riesenpilz:glowshroom", boden, 2, 3, seed)
]]
function riesenpilz_circle(nam, pos, radius, chance)
for i = -radius, radius, 1 do
for j = -radius, radius, 1 do
if math.floor( math.sqrt(i^2+j^2) +0.5) == radius
and minetest.get_node({x=pos.x+i, y=pos.y, z=pos.z+j}).name == "air"
and math.random(1,chance) == 1
and minetest.get_node({x=pos.x+i, y=pos.y-1, z=pos.z+j}).name == "riesenpilz:ground" then
minetest.add_node({x=pos.x+i, y=pos.y, z=pos.z+j}, {name=nam})
end
end
end
end
local function find_ground(pos, nodes)
for _, evground in ipairs(nodes) do
if minetest.get_node(pos).name == evground then
return true
end
end
return false
end
local GROUND = {"default:dirt_with_grass","default:dirt","default:sand","default:desert_sand"}
USUAL_STUFF = {"default:leaves","default:apple","default:tree","default:cactus","default:papyrus"}
minetest.register_on_generated(function(minp, maxp, seed)
if maxp.y >= -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
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
local boden = {x=x,y=ground_y+1,z=z}
if pr:next(1,15) == 1 then
env:add_node(boden, {name="default:dry_shrub"})
elseif pr:next(1,80) == 1 then
riesenpilz_circle("riesenpilz:brown", boden, pr:next(3,4), 3)
elseif pr:next(1,90) == 1 then
riesenpilz_circle("riesenpilz:red", boden, pr:next(4,5), 3)
elseif pr:next(1,100) == 1 then
riesenpilz_circle("riesenpilz:fly_agaric", boden, 4, 3)
elseif pr:next(1,4000) == 1 then
riesenpilz_circle("riesenpilz:lavashroom", boden, pr:next(5,6), 3)
elseif pr:next(1,5000) == 1 then
riesenpilz_circle("riesenpilz:glowshroom", boden, 3, 3)
--[[elseif pr:next(1,80) == 1 then
env:add_node(boden, {name="riesenpilz:brown"})
elseif pr:next(1,90) == 1 then
env:add_node(boden, {name="riesenpilz:red"})
elseif pr:next(1,100) == 1 then
env:add_node(boden, {name="riesenpilz:fly_agaric"})
elseif pr:next(1,4000) == 1 then
env:add_node(boden, {name="riesenpilz:lavashroom"})
elseif pr:next(1,5000) == 1 then
env:add_node(boden, {name="riesenpilz:glowshroom"})]]
elseif 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)
elseif pr:next(1,6000) == 2 and pr:next(1,200) == 15 then
riesenpilz_lavashroom(boden)
end
end
end
end
end
end
if maxp.y < -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)
for j=0,divs do
for i=0,divs do
local x,z = x0+i,z0+j
for y=minp.y,maxp.y,1 do
local pos = {x=x, y=y, z=z}
if env:get_node(pos).name == "air"
and env:get_node({x=x, y=y-1, z=z}).name == "default:stone"
and pr:next(1,40) == 33
and env:find_node_near(pos, 4, "group:igniter")
and not env:find_node_near(pos, 3, "group:igniter") then
env:add_node(pos, {name="riesenpilz:lavashroom"})
end
end
end
end
end
end)

BIN
/smallhead.1.ogg Normal file

Binary file not shown.

View File

@ -1,3 +0,0 @@
read_globals = {"minetest", "vector", "PseudoRandom", "ItemStack", "VoxelArea",
"table", "dump", "default"}
globals = {"riesenpilz"}

View File

@ -1,9 +1,6 @@
Sounds and textures ------Mushrooms------
CC by 3.0 — glowshroom and lavashroom from bas080's plants mod (WTFPL)
Code — parasol mushroom from a mod called mushrooms (WTFPL)
MIT — "45" mushrooms from r01922090's mush45 mod (WTFPL)
Some source information: rest also WTFPL
— glowshroom and lavashroom from bas080's plants mod (originally WTFPL)
— parasol mushroom from a mod called mushrooms (originally WTFPL)
— "45" mushrooms from r01922090's mush45 mod (originally WTFPL)

View File

@ -12,14 +12,10 @@ If you got ideas or found bugs, please tell them to me.
TODO: TODO:
* Mapgen: Do not use a fixed table of tree nodes; instead use a more flexible * add more giant mushrooms
way to remove trees. * finish supporting the mushrooms mod
* Add a settingtypes.txt * add lava suit
* Make the growingtool craftable * use visual_scale → crop textures and change nodeboxes (maybe automatically)
* Test if visual_scale is useful for the small mushroom nodes, * make the growingtool craftable
e.g. to make textures smaller or to use power-of-two sized textures. * mapgen: do not use fixed tree stuff
Nodeboxes would need to be changed accordingly (maybe automatically). * add settingtypes.txt
* Add new features:
* Add more giant mushrooms
* Add more content from the mushrooms mod
* Add a lava suit

5
depends.txt Normal file
View File

@ -0,0 +1,5 @@
default
vector_extras
digilines?
fence_registration?
technic?

View File

@ -17,21 +17,3 @@ else
function riesenpilz.inform() function riesenpilz.inform()
end end
end end
local circle_tables = {}
function riesenpilz.circle(r)
local circle = circle_tables[r]
if circle then
return circle
end
circle = {}
for i = -r, r do
for j = -r, r do
if math.floor(math.sqrt(i * i + j * j) + 0.5) == r then
circle[#circle+1] = {x=i, y=0, z=j}
end
end
end
circle_tables[r] = circle
return circle
end

150
init.lua
View File

@ -67,16 +67,15 @@ local function set_vm_data(manip, pznodes, pos, t1, name)
return return
end end
manip:write_to_map() manip:write_to_map()
riesenpilz.inform("a giant " .. name .. " mushroom grew at " .. riesenpilz.inform("a giant "..name.." mushroom grew at "..vector.pos_to_string(pos), 3, t1)
minetest.pos_to_string(pos), 3, t1) local t1 = os.clock()
local t2 = os.clock()
manip:update_map() manip:update_map()
riesenpilz.inform("map updated", 3, t2) riesenpilz.inform("map updated", 3, t1)
end end
function riesenpilz.red(pos, nodes, area, w) function riesenpilz.red(pos, nodes, area, w)
w = w or math.random(MAX_SIZE) local w = w or math.random(MAX_SIZE)
local h = w+2 local h = w+2
for i = 0, h do for i = 0, h do
@ -115,7 +114,7 @@ end
function riesenpilz.brown(pos, nodes, area, br) function riesenpilz.brown(pos, nodes, area, br)
br = br or math.random(MAX_SIZE-1)+1 local br = br or math.random(MAX_SIZE-1)+1
local h = br+2 local h = br+2
for i in area:iterp(pos, {x=pos.x, y=pos.y+h, z=pos.z}) do for i in area:iterp(pos, {x=pos.x, y=pos.y+h, z=pos.z}) do
@ -192,8 +191,7 @@ local function riesenpilz_minecraft_fliegenpilz(pos)
manip:set_param2_data(param2s) manip:set_param2_data(param2s)
manip:write_to_map() manip:write_to_map()
manip:update_map() manip:update_map()
riesenpilz.inform("a fly agaric grew at " .. minetest.pos_to_string(pos), riesenpilz.inform("a fly agaric grew at "..vector.pos_to_string(pos), 3, t1)
3, t1)
end end
@ -205,7 +203,7 @@ local function ran_node(a, b, ran)
end end
function riesenpilz.lavashroom(pos, nodes, area, h) function riesenpilz.lavashroom(pos, nodes, area, h)
h = h or 3 + math.random(MAX_SIZE - 2) local h = h or 3+math.random(MAX_SIZE-2)
-- remove the mushroom -- remove the mushroom
nodes[area:indexp(pos)] = c.air nodes[area:indexp(pos)] = c.air
@ -274,7 +272,7 @@ end
function riesenpilz.glowshroom(pos, nodes, area, h) function riesenpilz.glowshroom(pos, nodes, area, h)
h = h or 2 + math.random(MAX_SIZE) local h = h or 2+math.random(MAX_SIZE)
for i = 0, h do for i = 0, h do
nodes[area:index(pos.x, pos.y+i, pos.z)] = c.stem_blue nodes[area:index(pos.x, pos.y+i, pos.z)] = c.stem_blue
@ -323,20 +321,20 @@ end
function riesenpilz.parasol(pos, nodes, area, w, h) function riesenpilz.parasol(pos, nodes, area, w, h)
h = h or 6 + math.random(MAX_SIZE) local h = h or 6+math.random(MAX_SIZE)
--stem --stem
for i in area:iterp(pos, {x=pos.x, y=pos.y+h-2, z=pos.z}) do for i in area:iterp(pos, {x=pos.x, y=pos.y+h-2, z=pos.z}) do
nodes[i] = c.stem nodes[i] = c.stem
end end
w = w or MAX_SIZE + math.random(2) local w = w or MAX_SIZE+math.random(2)
local bhead1 = w-1 local bhead1 = w-1
local bhead2 = math.random(1,w-2) local bhead2 = math.random(1,w-2)
for _,j in pairs({ for _,j in pairs({
{bhead2, 0, c.head_brown_bright}, {bhead2, 0, c.head_brown_bright},
{bhead1, -1, c.head_beige} {bhead1, -1, c.head_binge}
}) do }) do
for i in area:iter(pos.x-j[1], pos.y+h+j[2], pos.z-j[1], pos.x+j[1], pos.y+h+j[2], pos.z+j[1]) do for i in area:iter(pos.x-j[1], pos.y+h+j[2], pos.z-j[1], pos.x+j[1], pos.y+h+j[2], pos.z+j[1]) do
nodes[i] = j[3] nodes[i] = j[3]
@ -350,8 +348,8 @@ function riesenpilz.parasol(pos, nodes, area, w, h)
nodes[area:index(pos.x+l*k, pos.y+rh, pos.z+k)] = c.head_white nodes[area:index(pos.x+l*k, pos.y+rh, pos.z+k)] = c.head_white
end end
for l = -w+1, w do for l = -w+1, w do
nodes[area:index(pos.x+w*k, pos.y+h-2, pos.z-l*k)] = c.head_beige nodes[area:index(pos.x+w*k, pos.y+h-2, pos.z-l*k)] = c.head_binge
nodes[area:index(pos.x+l*k, pos.y+h-2, pos.z+w*k)] = c.head_beige nodes[area:index(pos.x+l*k, pos.y+h-2, pos.z+w*k)] = c.head_binge
end end
for l = -bhead1+1, bhead1 do for l = -bhead1+1, bhead1 do
nodes[area:index(pos.x+bhead1*k, pos.y+h-2, pos.z-l*k)] = c.head_white nodes[area:index(pos.x+bhead1*k, pos.y+h-2, pos.z-l*k)] = c.head_white
@ -418,15 +416,13 @@ function riesenpilz.red45(pos, nodes, area, h1, h2)
or math.random(4) ~= 2 then or math.random(4) ~= 2 then
nodes[area:index(pos.x+x*j, pos.y+h, pos.z+z*i)] = c.head_red nodes[area:index(pos.x+x*j, pos.y+h, pos.z+z*i)] = c.head_red
end end
local zo = z+1 local z = z+1
local xo = x+1 x = x+1
nodes[area:index(pos.x + xo * j, pos.y + walkspace + 2, nodes[area:index(pos.x+x*j, pos.y+walkspace+2, pos.z+z*i)] = c.head_red
pos.z + zo * i)] = c.head_red if z ~= 3
if zo ~= 3 or x ~= 3
or xo ~= 3
or math.random(2) == 1 then or math.random(2) == 1 then
nodes[area:index(pos.x + xo * j, pos.y + walkspace + 3, nodes[area:index(pos.x+x*j, pos.y+walkspace+3, pos.z+z*i)] = c.head_red
pos.z + zo * i)] = c.head_red
end end
end end
end end
@ -505,7 +501,7 @@ local function riesenpilz_apple(pos)
return return
end end
manip:write_to_map() manip:write_to_map()
riesenpilz.inform("an apple grew at " .. minetest.pos_to_string(pos), 3, t1) riesenpilz.inform("an apple grew at "..vector.pos_to_string(pos), 3, t1)
manip:update_map() manip:update_map()
end end
@ -542,7 +538,7 @@ end
local abm_allowed = true local abm_allowed = true
local disallowed_ps = {} local disallowed_ps = {}
for name, ndata in pairs({ for name,i in pairs({
brown = { brown = {
description = "brown mushroom", description = "brown mushroom",
box = { box = {
@ -708,14 +704,14 @@ for name, ndata in pairs({
hp = 1, hp = 1,
}, },
}) do }) do
local burntime = ndata.burntime or 1 local burntime = i.burntime or 1
local box = { local box = {
type = "fixed", type = "fixed",
fixed = ndata.box fixed = i.box
} }
local nd = "riesenpilz:"..name local nd = "riesenpilz:"..name
minetest.register_node(nd, { minetest.register_node(nd, {
description = ndata.description, description = i.description,
tiles = { tiles = {
--~ {name = "riesenpilz_"..name.."_top.png", tileable_vertical = false}, --~ {name = "riesenpilz_"..name.."_top.png", tileable_vertical = false},
--~ {name = "riesenpilz_"..name.."_bottom.png", tileable_vertical = false}, --~ {name = "riesenpilz_"..name.."_bottom.png", tileable_vertical = false},
@ -724,7 +720,6 @@ for name, ndata in pairs({
"riesenpilz_"..name.."_bottom.png", "riesenpilz_"..name.."_bottom.png",
"riesenpilz_"..name.."_side.png", "riesenpilz_"..name.."_side.png",
}, },
use_texture_alpha = "opaque",
inventory_image = "riesenpilz_"..name.."_side.png", inventory_image = "riesenpilz_"..name.."_side.png",
walkable = false, walkable = false,
buildable_to = true, buildable_to = true,
@ -735,10 +730,10 @@ for name, ndata in pairs({
node_box = box, node_box = box,
selection_box = box, selection_box = box,
furnace_burntime = burntime, furnace_burntime = burntime,
on_secondary_use = minetest.item_eat(ndata.hp), on_secondary_use = minetest.item_eat(i.hp),
}) })
local g = ndata.growing local g = i.growing
if g then if g then
local grounds = g.grounds local grounds = g.grounds
@ -800,8 +795,8 @@ for name, ndata in pairs({
return return
end end
local groups = data.groups local groups = data.groups
for groupname, groupvalue in pairs(grounds) do for n,i in pairs(grounds) do
if groups[groupname] ~= groupvalue then if groups[n] ~= i then
return return
end end
end end
@ -820,32 +815,32 @@ for name, ndata in pairs({
-- witch circles -- witch circles
local ps = {} local ps = {}
for _,p in pairs(riesenpilz.circle(math.random(rmin, rmax))) do for _,p in pairs(vector.circle(math.random(rmin, rmax))) do
p = vector.add(pos, p) local p = vector.add(pos, p)
-- currently 3 is used here, approved by its use in the mapgen -- currently 3 is used here, approved by its use in the mapgen
if math.random(3) == 1 then if math.random(3) == 1 then
-- don't only use the current y for them -- don't only use the current y for them
for y = 1,-1,-1 do for y = 1,-1,-1 do
local pos_above = {x=p.x, y=p.y+y, z=p.z} local pos = {x=p.x, y=p.y+y, z=p.z}
if minetest.get_node(pos_above).name ~= "air" then if minetest.get_node(pos).name ~= "air" then
break break
end end
local f = minetest.get_node({x=p.x, y=p.y+y-1, z=p.z}).name local f = minetest.get_node({x=p.x, y=p.y+y-1, z=p.z}).name
if f ~= "air" then if f ~= "air" then
-- they grown on specific nodes -- they grown on specific nodes
local data_ground = minetest.registered_nodes[f] local data = minetest.registered_nodes[f]
if data_ground if data
and data_ground.walkable and data.walkable
and data_ground.groups and data.groups
and (not data_ground.drawtype and (not data.drawtype
or data_ground.drawtype == "normal" or data.drawtype == "normal"
) then ) then
local ground_disallowed local ground_disallowed
for n,i in pairs(grounds) do for n,i in pairs(grounds) do
if data_ground.groups[n] ~= i then if data.groups[n] ~= i then
ground_disallowed = true ground_disallowed = true
break break
end end
@ -853,11 +848,10 @@ for name, ndata in pairs({
if not ground_disallowed then if not ground_disallowed then
-- they also need specific light strengths -- they also need specific light strengths
local light = minetest.get_node_light( local light = minetest.get_node_light(pos, 0.5)
pos_above, 0.5)
if light >= lmin if light >= lmin
and light <= lmax then and light <= lmax then
ps[#ps+1] = pos_above ps[#ps+1] = pos
end end
end end
end end
@ -901,10 +895,10 @@ local head_sounds = default.node_sound_wood_defaults({
dig = {name="riesenpilz_head", gain=0.2}, dig = {name="riesenpilz_head", gain=0.2},
dug = {name="riesenpilz_stem", gain=0.1} dug = {name="riesenpilz_stem", gain=0.1}
}) })
local add_fence = default.register_fence local add_fence = minetest.register_fence
local node_groups = {oddly_breakable_by_hand=3, fall_damage_add_percent=-80, bouncy=10} local node_groups = {oddly_breakable_by_hand=3, fall_damage_add_percent=-80, bouncy=10}
for _, ndata in ipairs({ for _,i in pairs({
{ {
typ = "stem", typ = "stem",
description = "white", description = "white",
@ -986,8 +980,8 @@ for _, ndata in ipairs({
}, },
{ {
typ = "head", typ = "head",
name = "beige", name = "binge",
textures = {"head_beige.png", "head_white.png", "head_beige.png"}, textures = {"head_binge.png", "head_white.png", "head_binge.png"},
sapling = "parasol" sapling = "parasol"
}, },
{ {
@ -999,8 +993,8 @@ for _, ndata in ipairs({
}, },
}) do }) do
-- fill missing stuff -- fill missing stuff
local textures = ndata.textures local textures = i.textures
ndata.description = ndata.description or ndata.name i.description = i.description or i.name
if type(textures) == "string" then if type(textures) == "string" then
textures = {textures} textures = {textures}
end end
@ -1009,26 +1003,25 @@ for _, ndata in ipairs({
end end
local nodename = "riesenpilz:" local nodename = "riesenpilz:"
local desctiption,sounds = "giant mushroom " local desctiption,sounds = "giant mushroom "
if ndata.typ == "stem" then if i.typ == "stem" then
desctiption = desctiption .. "stem " .. ndata.description desctiption = desctiption.."stem "..i.description
nodename = nodename .. "stem" .. nodename = nodename.."stem"..((i.name and "_"..i.name) or "")
((ndata.name and "_" .. ndata.name) or "")
sounds = default.node_sound_wood_defaults({ sounds = default.node_sound_wood_defaults({
footstep = {name="riesenpilz_stem", gain=0.2}, footstep = {name="riesenpilz_stem", gain=0.2},
place = {name="default_place_node", gain=0.5}, place = {name="default_place_node", gain=0.5},
dig = {name="riesenpilz_stem", gain=0.4}, dig = {name="riesenpilz_stem", gain=0.4},
dug = {name="default_wood_footstep", gain=0.3} dug = {name="default_wood_footstep", gain=0.3}
}) })
elseif ndata.typ == "head" then elseif i.typ == "head" then
desctiption = desctiption .. "head " .. ndata.description desctiption = desctiption.."head "..i.description
nodename = nodename .. "head_" .. ndata.name nodename = nodename.."head_"..i.name
sounds = head_sounds sounds = head_sounds
else else
nodename = nodename .. ndata.name nodename = nodename..i.name
desctiption = desctiption .. ndata.description desctiption = desctiption..i.description
end end
local drop = ndata.sapling and {max_items = 1, items = { local drop = i.sapling and {max_items = 1, items = {
{items = {"riesenpilz:" .. ndata.sapling}, rarity = 20}, {items = {"riesenpilz:"..i.sapling}, rarity = 20},
{items = {nodename}, rarity = 1} {items = {nodename}, rarity = 1}
}} }}
minetest.register_node(nodename, { minetest.register_node(nodename, {
@ -1040,15 +1033,8 @@ for _, ndata in ipairs({
}) })
if add_fence if add_fence
and ndata.fence ~= false then and i.fence ~= false then
add_fence( add_fence({fence_of = nodename})
nodename.."_fence",
{
material = nodename,
texture = textures[#textures],
groups = node_groups,
sounds = sounds,
})
end end
end end
@ -1098,7 +1084,7 @@ c = {
head_blue_bright = minetest.get_content_id("riesenpilz:head_blue_bright"), head_blue_bright = minetest.get_content_id("riesenpilz:head_blue_bright"),
head_white = minetest.get_content_id("riesenpilz:head_white"), head_white = minetest.get_content_id("riesenpilz:head_white"),
head_beige = minetest.get_content_id("riesenpilz:head_beige"), head_binge = minetest.get_content_id("riesenpilz:head_binge"),
head_brown_bright = minetest.get_content_id("riesenpilz:head_brown_bright"), head_brown_bright = minetest.get_content_id("riesenpilz:head_brown_bright"),
stem_red = minetest.get_content_id("riesenpilz:stem_red"), stem_red = minetest.get_content_id("riesenpilz:stem_red"),
@ -1136,11 +1122,6 @@ local function get_grow(name)
local is = {} local is = {}
for i = 1,#minetest.registered_abms do for i = 1,#minetest.registered_abms do
local ad = minetest.registered_abms[i] local ad = minetest.registered_abms[i]
if type(ad.nodenames) ~= "table" then
minetest.log("warning", "ABM nodenames is not a table: " ..
dump(ad))
return
end
if ad.chance > 1 if ad.chance > 1
and table.indexof(ad.nodenames, name) ~= -1 then and table.indexof(ad.nodenames, name) ~= -1 then
is[#is+1] = ad.action is[#is+1] = ad.action
@ -1160,7 +1141,7 @@ local function get_grow(name)
if def.on_timer then if def.on_timer then
func = def.on_timer func = def.on_timer
else else
func = function(pos, _, player) func = function(pos, node, player)
if def.on_place then if def.on_place then
def.on_place(ItemStack(name), player, { def.on_place(ItemStack(name), player, {
type = "node", type = "node",
@ -1235,6 +1216,7 @@ if minetest.global_exists(technic) then
end end
--[ [
if minetest.global_exists(3darmor) then add to depends if minetest.global_exists(3darmor) then add to depends
--lavashroom skin armor, swimming in lava possible --lavashroom skin armor, swimming in lava possible
@ -1258,7 +1240,7 @@ if minetest.global_exists(technic) then
technic.comp("riesenpilz:lavashroom_skin 5", "riesenpilz:antilava_plate") technic.comp("riesenpilz:lavashroom_skin 5", "riesenpilz:antilava_plate")
armor_register(plate blah) armor_register(plate blah)
end end--] ]
}) })
end--]] end--]]
@ -1267,12 +1249,6 @@ if riesenpilz.enable_mapgen then
dofile(modpath.."mapgen.lua") dofile(modpath.."mapgen.lua")
end end
-- Legacy
minetest.register_alias("riesenpilz:head_binge", "riesenpilz:head_beige")
local time = math.floor(tonumber(os.clock()-load_time_start)*100+0.5)/100 local time = math.floor(tonumber(os.clock()-load_time_start)*100+0.5)/100
local msg = "[riesenpilz] loaded after ca. "..time local msg = "[riesenpilz] loaded after ca. "..time
if time > 0.05 then if time > 0.05 then

View File

@ -34,7 +34,7 @@ end
local grounds = {} local grounds = {}
local function is_ground(id) function is_ground(id)
local is = grounds[id] local is = grounds[id]
if is ~= nil then if is ~= nil then
return is return is
@ -56,7 +56,7 @@ local function is_ground(id)
end end
local toremoves = {} local toremoves = {}
local function is_toremove(id) function is_toremove(id)
local is = toremoves[id] local is = toremoves[id]
if is ~= nil then if is ~= nil then
return is return is
@ -79,8 +79,8 @@ end
local data = {} local data = {}
local area, pr local area, pr
local function make_circle(nam, pos, radius, chance) function riesenpilz_circle(nam, pos, radius, chance)
local circle = riesenpilz.circle(radius) local circle = vector.circle(radius)
for i = 1,#circle do for i = 1,#circle do
if pr:next(1, chance) == 1 then if pr:next(1, chance) == 1 then
local vi = area:indexp(vector.add(pos, circle[i])) local vi = area:indexp(vector.add(pos, circle[i]))
@ -128,9 +128,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
end end
local t1 = os.clock() local t1 = os.clock()
riesenpilz.inform(("tries to generate a giant mushroom biome at: " .. riesenpilz.inform("tries to generate a giant mushroom biome at: x=["..minp.x.."; "..maxp.x.."]; y=["..minp.y.."; "..maxp.y.."]; z=["..minp.z.."; "..maxp.z.."]", 2)
"x=[%d; %d]; y=[%d; %d]; z=[%d; %d]"):format(minp.x, maxp.x, minp.y,
maxp.y, minp.z, maxp.z), 2)
if not contents_defined then if not contents_defined then
define_contents() define_contents()
@ -170,7 +168,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
--smooth mapgen --smooth mapgen
if riesenpilz.always_generate then if riesenpilz.always_generate then
in_biome = true in_biome = true
elseif riesenpilz.smooth then elseif smooth then
if test >= smooth_rarity_max if test >= smooth_rarity_max
or ( or (
test > smooth_rarity_min test > smooth_rarity_min
@ -219,8 +217,8 @@ minetest.register_on_generated(function(minp, maxp, seed)
if ground_y then if ground_y then
-- add ground and dirt below if needed -- add ground and dirt below if needed
data[vi] = c.ground data[vi] = c.ground
for off = -1,-5,-1 do for i = -1,-5,-1 do
local p_pos = vi + off * area.ystride local p_pos = vi + i * area.ystride
if not is_ground(data[p_pos]) if not is_ground(data[p_pos])
or data[p_pos] == c.dirt then or data[p_pos] == c.dirt then
break break
@ -233,13 +231,13 @@ minetest.register_on_generated(function(minp, maxp, seed)
if pr:next(1,15) == 1 then if pr:next(1,15) == 1 then
data[vi + area.ystride] = c.dry_shrub data[vi + area.ystride] = c.dry_shrub
elseif pr:next(1,80) == 1 then elseif pr:next(1,80) == 1 then
make_circle(c.riesenpilz_brown, boden, pr:next(3,4), 3) riesenpilz_circle(c.riesenpilz_brown, boden, pr:next(3,4), 3)
elseif pr:next(1,85) == 1 then elseif pr:next(1,85) == 1 then
make_circle(c.riesenpilz_parasol, boden, pr:next(3,5), 3) riesenpilz_circle(c.riesenpilz_parasol, boden, pr:next(3,5), 3)
elseif pr:next(1,90) == 1 then elseif pr:next(1,90) == 1 then
make_circle(c.riesenpilz_red, boden, pr:next(4,5), 3) riesenpilz_circle(c.riesenpilz_red, boden, pr:next(4,5), 3)
elseif pr:next(1,100) == 1 then elseif pr:next(1,100) == 1 then
make_circle(c.riesenpilz_fly_agaric, boden, 4, 3) riesenpilz_circle(c.riesenpilz_fly_agaric, boden, 4, 3)
elseif pr:next(1,340) == 10 then elseif pr:next(1,340) == 10 then
bigtype = 2 bigtype = 2
elseif pr:next(1,380) == 1 then elseif pr:next(1,380) == 1 then
@ -249,9 +247,9 @@ minetest.register_on_generated(function(minp, maxp, seed)
elseif pr:next(1,800) == 7 then elseif pr:next(1,800) == 7 then
bigtype = 5 bigtype = 5
elseif pr:next(1,4000) == 1 then elseif pr:next(1,4000) == 1 then
make_circle(c.riesenpilz_lavashroom, boden, pr:next(5,6), 3) riesenpilz_circle(c.riesenpilz_lavashroom, boden, pr:next(5,6), 3)
elseif pr:next(1,5000) == 1 then elseif pr:next(1,5000) == 1 then
make_circle(c.riesenpilz_glowshroom, boden, 3, 3) riesenpilz_circle(c.riesenpilz_glowshroom, boden, 3, 3)
elseif pr:next(1,6000) == 2 then elseif pr:next(1,6000) == 2 then
if pr:next(1,200) == 15 then if pr:next(1,200) == 15 then
bigtype = 4 bigtype = 4

View File

@ -1,3 +0,0 @@
name = riesenpilz
depends = default
optional_depends = digilines,fence_registration,technic

View File

@ -19,7 +19,7 @@ riesenpilz.inform_all = false--minetest.is_singleplayer()
riesenpilz.max_spam = 2 riesenpilz.max_spam = 2
--3d apple --3d apple
riesenpilz.change_apple = false riesenpilz.change_apple = true
--disallows growing a mushroom if it not every node would have a free place --disallows growing a mushroom if it not every node would have a free place
riesenpilz.giant_restrict_area = false riesenpilz.giant_restrict_area = false

Binary file not shown.

Before

Width:  |  Height:  |  Size: 348 B

After

Width:  |  Height:  |  Size: 349 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 B

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 B

After

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 319 B

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 186 B

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 304 B

After

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 214 B

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 183 B

After

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 B

After

Width:  |  Height:  |  Size: 150 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 B

After

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 699 B

After

Width:  |  Height:  |  Size: 718 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 631 B

After

Width:  |  Height:  |  Size: 638 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 499 B

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 694 B

After

Width:  |  Height:  |  Size: 695 B

View File

Before

Width:  |  Height:  |  Size: 305 B

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 703 B

After

Width:  |  Height:  |  Size: 724 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 742 B

After

Width:  |  Height:  |  Size: 761 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 186 B

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 522 B

After

Width:  |  Height:  |  Size: 525 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 974 B

After

Width:  |  Height:  |  Size: 1000 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 B

After

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 B

After

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 297 B

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 B

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 B

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 264 B

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 B

After

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 B

After

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 B

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 195 B

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 177 B

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 B

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 B

After

Width:  |  Height:  |  Size: 98 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 266 B

After

Width:  |  Height:  |  Size: 267 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 625 B

After

Width:  |  Height:  |  Size: 633 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 716 B

After

Width:  |  Height:  |  Size: 734 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 718 B

After

Width:  |  Height:  |  Size: 734 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 519 B

After

Width:  |  Height:  |  Size: 521 B