Improve Showroom Walls, Round 1
parent
aa45537794
commit
fb26f15e27
|
@ -1,5 +1,5 @@
|
|||
ikea = {}
|
||||
ikea.mapgen_options = {departments = {}, min_size = 8, max_size = 16}
|
||||
ikea.mapgen_options = {departments = {}, min_size = 3, max_size = 8}
|
||||
ikea.registered_furniture = {}
|
||||
|
||||
local apipath = minetest.get_modpath("ikea") .. "/api"
|
||||
|
|
|
@ -32,8 +32,8 @@ ikea.register_department({
|
|||
name = "showroom",
|
||||
get_schematic = function(edges, x, z)
|
||||
if edges.e or edges.w or edges.n or edges.s then
|
||||
--return schems.get_outer(Perlin, edges, x, z), nil
|
||||
return schems.floor, nil
|
||||
return schems.get_outer(Perlin, edges, x, z), nil
|
||||
--return schems.floor, nil
|
||||
else
|
||||
return schems.get_inner(Perlin, x, z), nil
|
||||
end
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
local schems = {}
|
||||
schems.floor = schematic.new({x=16,y=1,z=16}, "showroom:floor")
|
||||
local place_opening = util.every_n_mapblocks(4)
|
||||
|
||||
-- Corner North/South East/West Top/Bottom
|
||||
local corner_swb = {x=0,y=0,z=0}
|
||||
|
@ -14,36 +15,50 @@ local corner_net = {x=15,y=10,z=15}
|
|||
|
||||
function schems.get_outer(Perlin, edges, x, z)
|
||||
local schem = schematic.new({x=16,y=16,z=16}, "air")
|
||||
local has_opening = util.bound_perlin(Perlin, 8, x, 4, z) + 1 == 1
|
||||
--local has_opening = util.bound_perlin(Perlin, 3, x, 4, z) == 1
|
||||
|
||||
-- Corners First
|
||||
if edges.n and edges.e then
|
||||
schematic.fill_area(schem, "showroom:wall", corner_swb, corner_swt)
|
||||
elseif edges.n and edges.w then
|
||||
schematic.fill_area(schem, "showroom:wall", corner_seb, corner_set)
|
||||
elseif edges.s and edges.w then
|
||||
schematic.fill_area(schem, "showroom:wall", corner_neb, corner_net)
|
||||
elseif edges.s and edges.e then
|
||||
schematic.fill_area(schem, "showroom:wall", corner_nwb, corner_nwt)
|
||||
elseif edges.n then
|
||||
if edges.s and edges.w then
|
||||
schematic.fill_area(schem, "showroom:wall", corner_swb, corner_set)
|
||||
if has_opening then
|
||||
schematic.fill_area(schem, "air", {x=7,y=0,z=0}, {x=8,y=4,z=0})
|
||||
end
|
||||
elseif edges.s then
|
||||
schematic.fill_area(schem, "showroom:wall", corner_nwb, corner_net)
|
||||
if has_opening then
|
||||
schematic.fill_area(schem, "air", {x=7,y=0,z=15}, {x=8,y=4,z=15})
|
||||
end
|
||||
elseif edges.w then
|
||||
schematic.fill_area(schem, "showroom:wall", corner_seb, corner_net)
|
||||
if has_opening then
|
||||
schematic.fill_area(schem, "air", {x=15,y=0,z=7}, {x=15,y=4,z=8})
|
||||
end
|
||||
elseif edges.e then
|
||||
schematic.fill_area(schem, "showroom:wall", corner_swb, corner_nwt)
|
||||
if has_opening then
|
||||
schematic.fill_area(schem, "air", {x=0,y=0,z=7}, {x=0,y=4,z=8})
|
||||
elseif edges.s and edges.e then
|
||||
schematic.fill_area(schem, "showroom:wall", corner_seb, corner_swt)
|
||||
schematic.fill_area(schem, "showroom:wall", corner_seb, corner_net)
|
||||
elseif edges.n and edges.e then
|
||||
schematic.fill_area(schem, "showroom:wall", corner_neb, corner_nwt)
|
||||
schematic.fill_area(schem, "showroom:wall", corner_neb, corner_set)
|
||||
elseif edges.n and edges.w then
|
||||
schematic.fill_area(schem, "showroom:wall", corner_nwb, corner_net)
|
||||
schematic.fill_area(schem, "showroom:wall", corner_nwb, corner_swt)
|
||||
elseif edges.s then
|
||||
schematic.fill_area(schem, "showroom:wall", corner_swb, corner_set)
|
||||
elseif edges.n then
|
||||
schematic.fill_area(schem, "showroom:wall", corner_nwb, corner_net)
|
||||
elseif edges.e then
|
||||
schematic.fill_area(schem, "showroom:wall", corner_seb, corner_net)
|
||||
elseif edges.w then
|
||||
schematic.fill_area(schem, "showroom:wall", corner_swb, corner_nwt)
|
||||
end
|
||||
|
||||
-- Doorways
|
||||
if edges.s then
|
||||
if place_opening(x) then
|
||||
schematic.fill_area(schem, "air", {x=6,y=0,z=0}, {x=9,y=4,z=0})
|
||||
end
|
||||
end
|
||||
if edges.n then
|
||||
if place_opening(x) then
|
||||
schematic.fill_area(schem, "air", {x=6,y=0,z=15}, {x=9,y=4,z=15})
|
||||
end
|
||||
end
|
||||
if edges.e then
|
||||
if place_opening(z) then
|
||||
schematic.fill_area(schem, "air", {x=15,y=0,z=3}, {x=15,y=4,z=6})
|
||||
end
|
||||
end
|
||||
if edges.w then
|
||||
if place_opening(z) then
|
||||
schematic.fill_area(schem, "air", {x=0,y=0,z=3}, {x=0,y=4,z=6})
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue