Compare commits
7 Commits
nalc-1.0
...
nalc-1.2.0
Author | SHA1 | Date | |
---|---|---|---|
06525f43eb | |||
cd44a194ec | |||
739d63eeda | |||
2869aed00a | |||
f594c91ca3 | |||
35687b0957 | |||
c3826283ea |
Before Width: | Height: | Size: 249 B |
Before Width: | Height: | Size: 356 B |
BIN
/frying.mp3
@ -1,2 +0,0 @@
|
|||||||
frying from http://freesound.org/people/davidkay/sounds/132472/ (WTFPL)
|
|
||||||
cutting from http://freesound.org/people/nhaudio/sounds/192416/ (WTFPL)
|
|
BIN
/mush45_b.png
Before Width: | Height: | Size: 211 B |
BIN
/mush45_b0.png
Before Width: | Height: | Size: 234 B |
BIN
/mush45_b1.png
Before Width: | Height: | Size: 210 B |
BIN
/mush45_b2.png
Before Width: | Height: | Size: 257 B |
BIN
/mush45_bm.png
Before Width: | Height: | Size: 211 B |
BIN
/mush45_bm2.png
Before Width: | Height: | Size: 211 B |
BIN
/mush45_bm3.png
Before Width: | Height: | Size: 211 B |
BIN
/mush45_bm4.png
Before Width: | Height: | Size: 211 B |
BIN
/mush45_r.png
Before Width: | Height: | Size: 233 B |
BIN
/mush45_r0.png
Before Width: | Height: | Size: 234 B |
BIN
/mush45_rm.png
Before Width: | Height: | Size: 234 B |
BIN
/mush45_rm2.png
Before Width: | Height: | Size: 239 B |
BIN
/mush45_rm3.png
Before Width: | Height: | Size: 234 B |
BIN
/mush45_rm4.png
Before Width: | Height: | Size: 238 B |
Before Width: | Height: | Size: 303 B |
Before Width: | Height: | Size: 276 B |
203
/old_mapgen.lua
@ -1,203 +0,0 @@
|
|||||||
--[[
|
|
||||||
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
36
init.lua
@ -334,7 +334,7 @@ function riesenpilz.parasol(pos, nodes, area, w, h)
|
|||||||
|
|
||||||
for _,j in pairs({
|
for _,j in pairs({
|
||||||
{bhead2, 0, c.head_brown_bright},
|
{bhead2, 0, c.head_brown_bright},
|
||||||
{bhead1, -1, c.head_binge}
|
{bhead1, -1, c.head_beige}
|
||||||
}) 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]
|
||||||
@ -348,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_binge
|
nodes[area:index(pos.x+w*k, pos.y+h-2, pos.z-l*k)] = c.head_beige
|
||||||
nodes[area:index(pos.x+l*k, pos.y+h-2, pos.z+w*k)] = c.head_binge
|
nodes[area:index(pos.x+l*k, pos.y+h-2, pos.z+w*k)] = c.head_beige
|
||||||
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
|
||||||
@ -895,7 +895,7 @@ 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 = minetest.register_fence
|
local add_fence = default.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 _,i in pairs({
|
for _,i in pairs({
|
||||||
@ -980,8 +980,8 @@ for _,i in pairs({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
typ = "head",
|
typ = "head",
|
||||||
name = "binge",
|
name = "beige",
|
||||||
textures = {"head_binge.png", "head_white.png", "head_binge.png"},
|
textures = {"head_beige.png", "head_white.png", "head_beige.png"},
|
||||||
sapling = "parasol"
|
sapling = "parasol"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1034,7 +1034,14 @@ for _,i in pairs({
|
|||||||
|
|
||||||
if add_fence
|
if add_fence
|
||||||
and i.fence ~= false then
|
and i.fence ~= false then
|
||||||
add_fence({fence_of = nodename})
|
add_fence(
|
||||||
|
nodename.."_fence",
|
||||||
|
{
|
||||||
|
material = nodename,
|
||||||
|
texture = textures[#textures],
|
||||||
|
groups = node_groups,
|
||||||
|
sounds = sounds,
|
||||||
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1084,7 +1091,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_binge = minetest.get_content_id("riesenpilz:head_binge"),
|
head_beige = minetest.get_content_id("riesenpilz:head_beige"),
|
||||||
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"),
|
||||||
@ -1122,6 +1129,11 @@ 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
|
||||||
@ -1249,6 +1261,14 @@ 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
|
||||||
|
@ -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 = true
|
riesenpilz.change_apple = false
|
||||||
|
|
||||||
--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
|
||||||
|
Before Width: | Height: | Size: 305 B After Width: | Height: | Size: 305 B |