This commit is contained in:
HybridDog 2013-10-11 13:36:24 +02:00
parent 4133f6ff13
commit 15ff3fbf31
11 changed files with 67 additions and 20 deletions

View File

@ -424,12 +424,30 @@ local BOX_NETHER_SHROOM = {
}, },
} }
pilz("brown", "Brown Mushroom", BOX_BROWN) local BOX_PARASOL = {
pilz("red", "Red Mushroom", BOX_RED) type = "fixed",
pilz("fly_agaric", "Fly Agaric", BOX_FLY_AGARIC) fixed = {
pilz("lavashroom", "Lavashroom", BOX_LAVASHROOM) {-1/16, -8/16, -1/16, 1/16, 0, 1/16},
pilz("glowshroom", "Glowshroom", BOX_GLOWSHROOM) {-2/16, -6/16, -2/16, 2/16, -5/16, 2/16},
pilz("nether_shroom", "Nether Mushroom", BOX_NETHER_SHROOM) {-5/16, -4/16, -5/16, 5/16, -3/16, 5/16},
{-4/16, -3/16, -4/16, 4/16, -2/16, 4/16},
{-3/16, -2/16, -3/16, 3/16, -1/16, 3/16},
},
}
local mushrooms_list = {
{"brown", "Brown Mushroom", BOX_BROWN},
{"red", "Red Mushroom", BOX_RED},
{"fly_agaric", "Fly Agaric", BOX_FLY_AGARIC},
{"lavashroom", "Lavashroom", BOX_LAVASHROOM},
{"glowshroom", "Glowshroom", BOX_GLOWSHROOM},
{"nether_shroom", "Nether Mushroom", BOX_NETHER_SHROOM},
{"parasol", "Parasol Mushroom", BOX_PARASOL},
}
for _,i in ipairs(mushrooms_list) do
pilz(i[1], i[2], i[3])
end

View File

@ -8,6 +8,9 @@ local c_desert_sand = minetest.get_content_id("default:desert_sand")
local c_tree = minetest.get_content_id("default:tree") local c_tree = minetest.get_content_id("default:tree")
local c_leaves = minetest.get_content_id("default:leaves") local c_leaves = minetest.get_content_id("default:leaves")
local c_apple = minetest.get_content_id("default:apple") local c_apple = minetest.get_content_id("default:apple")
local c_jungletree = minetest.get_content_id("default:jungletree")
local c_jungleleaves = minetest.get_content_id("default:jungleleaves")
local c_junglegrass = minetest.get_content_id("default:junglegrass")
local c_cactus = minetest.get_content_id("default:cactus") local c_cactus = minetest.get_content_id("default:cactus")
local c_papyrus = minetest.get_content_id("default:papyrus") local c_papyrus = minetest.get_content_id("default:papyrus")
local c_dry_shrub = minetest.get_content_id("default:dry_shrub") local c_dry_shrub = minetest.get_content_id("default:dry_shrub")
@ -18,6 +21,7 @@ local c_riesenpilz_red = minetest.get_content_id("riesenpilz:red")
local c_riesenpilz_fly_agaric = minetest.get_content_id("riesenpilz:fly_agaric") local c_riesenpilz_fly_agaric = minetest.get_content_id("riesenpilz:fly_agaric")
local c_riesenpilz_lavashroom = minetest.get_content_id("riesenpilz:lavashroom") local c_riesenpilz_lavashroom = minetest.get_content_id("riesenpilz:lavashroom")
local c_riesenpilz_glowshroom = minetest.get_content_id("riesenpilz:glowshroom") local c_riesenpilz_glowshroom = minetest.get_content_id("riesenpilz:glowshroom")
local c_riesenpilz_parasol = minetest.get_content_id("riesenpilz:parasol")
local function find_grond(a,list) local function find_grond(a,list)
@ -49,6 +53,14 @@ local function say_info(info)
minetest.chat_send_all(info) minetest.chat_send_all(info)
end end
local riesenpilz_rarity = riesenpilz.mapgen_rarity
local riesenpilz_size = riesenpilz.mapgen_size
local nosmooth_rarity = -(riesenpilz_rarity/50)+1
local perlin_scale = riesenpilz_size*100/riesenpilz_rarity
local smooth_rarity_full = nosmooth_rarity+perlin_scale/(20*riesenpilz_size)
local smooth_rarity_ran = nosmooth_rarity-perlin_scale/(40*riesenpilz_size)
local smooth_rarity_dif = (smooth_rarity_full-smooth_rarity_ran)*100-1
local GROUND = {c_gr, c_sand, c_dirt, c_desert_sand} local GROUND = {c_gr, c_sand, c_dirt, c_desert_sand}
--local USUAL_STUFF = {"default:leaves","default:apple","default:tree","default:cactus","default:papyrus"} --local USUAL_STUFF = {"default:leaves","default:apple","default:tree","default:cactus","default:papyrus"}
@ -59,21 +71,21 @@ minetest.register_on_generated(function(minp, maxp, seed)
end end
local x0,z0,x1,z1 = minp.x,minp.z,maxp.x,maxp.z -- Assume X and Z lengths are equal 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 env = minetest.env --Should make things a bit faster.
local perlin1 = env:get_perlin(51,3, 0.5, 200) --Get map specific perlin local perlin1 = env:get_perlin(51,3, 0.5, perlin_scale) --Get map specific perlin
--[[if not (perlin1:get2d({x=x0, y=z0}) > 0.53) and not (perlin1:get2d({x=x1, y=z1}) > 0.53) --[[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=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]] and not (perlin1:get2d({x=(x1-x0)/2, y=(z1-z0)/2}) > 0.53) then]]
if not riesenpilz.always_generate if not riesenpilz.always_generate
and not ( perlin1:get2d( {x=x0, y=z0} ) > 0.53 ) --top left and not ( perlin1:get2d( {x=x0, y=z0} ) > nosmooth_rarity ) --top left
and not ( perlin1:get2d( { x = x0 + ( (x1-x0)/2), y=z0 } ) > 0.53 )--top middle and not ( perlin1:get2d( { x = x0 + ( (x1-x0)/2), y=z0 } ) > nosmooth_rarity )--top middle
and not (perlin1:get2d({x=x1, y=z1}) > 0.53) --bottom right and not (perlin1:get2d({x=x1, y=z1}) > nosmooth_rarity) --bottom right
and not (perlin1:get2d({x=x1, y=z0+((z1-z0)/2)}) > 0.53) --right middle and not (perlin1:get2d({x=x1, y=z0+((z1-z0)/2)}) > nosmooth_rarity) --right middle
and not (perlin1:get2d({x=x0, y=z1}) > 0.53) --bottom left and not (perlin1:get2d({x=x0, y=z1}) > nosmooth_rarity) --bottom left
and not (perlin1:get2d({x=x1, y=z0}) > 0.53) --top right and not (perlin1:get2d({x=x1, y=z0}) > nosmooth_rarity) --top right
and not (perlin1:get2d({x=x0+((x1-x0)/2), y=z1}) > 0.53) --left middle and not (perlin1:get2d({x=x0+((x1-x0)/2), y=z1}) > nosmooth_rarity) --left middle
and not (perlin1:get2d({x=(x1-x0)/2, y=(z1-z0)/2}) > 0.53) --middle and not (perlin1:get2d({x=(x1-x0)/2, y=(z1-z0)/2}) > nosmooth_rarity) --middle
and not (perlin1:get2d({x=x0, y=z1+((z1-z0)/2)}) > 0.53) then --bottom middle and not (perlin1:get2d({x=x0, y=z1+((z1-z0)/2)}) > nosmooth_rarity) then --bottom middle
print("[riesenpilz] abort") print("[riesenpilz] abort")
return return
end end
@ -94,7 +106,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
for p_pos in area:iterp(minp, maxp) do --remove tree stuff for p_pos in area:iterp(minp, maxp) do --remove tree stuff
local d_p_pos = data[p_pos] local d_p_pos = data[p_pos]
for _,nam in ipairs({c_tree, c_leaves, c_apple}) do for _,nam in ipairs({c_tree, c_leaves, c_apple, c_jungletree, c_jungleleaves, c_junglegrass}) do
if d_p_pos == nam then if d_p_pos == nam then
data[p_pos] = c_air data[p_pos] = c_air
break break
@ -120,9 +132,17 @@ 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 smooth and (test > 0.73 or (test > 0.43 and pr:next(0,29) > (0.73 - test) * 100 )) then elseif smooth
and (
test > smooth_rarity_full
or (
test > smooth_rarity_ran
and pr:next(0,smooth_rarity_dif) > (smooth_rarity_full - test) * 100
)
) then
in_biome = true in_biome = true
elseif (not smooth) and test > 0.53 then elseif (not smooth)
and test > nosmooth_rarity then
in_biome = true in_biome = true
end end
@ -168,6 +188,8 @@ minetest.register_on_generated(function(minp, maxp, seed)
data[p_boden] = c_dry_shrub data[p_boden] = c_dry_shrub
elseif pr:next(1,80) == 1 then elseif pr:next(1,80) == 1 then
riesenpilz_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
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
riesenpilz_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

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

BIN
rest/riesenpilz_head.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@ -1,11 +1,18 @@
--This file contains configuration options for riesenpilz mod. --This file contains configuration options for riesenpilz mod.
--Enables mapgen. --Enables mapgen.
riesenpilz.enable_mapgen = false riesenpilz.enable_mapgen = true
riesenpilz.always_generate = false riesenpilz.always_generate = false
--Enables smooth transition of biomes. --Enables smooth transition of biomes.
riesenpilz.smooth = false riesenpilz.smooth = false
--rarity in %
riesenpilz.mapgen_rarity = 0.1
--size of the generated... (has an effect to the rarity, too)
riesenpilz.mapgen_size = 50
riesenpilz.info = true riesenpilz.info = true

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 691 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B