diff --git a/tesseract.lua b/tesseract.lua index d2ad22a..838f183 100644 --- a/tesseract.lua +++ b/tesseract.lua @@ -30,15 +30,15 @@ local function teleporter(user, area, power) } elseif area == 'hell' then newpos = { - x = (math.random(2)*2-3)*(math.random(math.floor(max_depth/6))+power*math.floor(max_depth/6)), + x = pos.x, y = fun_caves.underzones[({'Caina','Phlegethos','Dis','Minauros', 'Phlegethos','Styx'})[power+1]].ceiling-30, - z = (math.random(2)*2-3)*(math.random(math.floor(max_depth/6))+power*math.floor(max_depth/6)) + z = pos.z, } elseif area == 'sky' then newpos = { - x = (math.random(2)*2-3)*(math.random(math.floor(max_depth/6))+power*math.floor(max_depth/6)), + x = pos.x, y = ({4368, 8768, 13168, 4368, 4368, 4368})[power+1]+76, - z = (math.random(2)*2-3)*(math.random(math.floor(max_depth/6))+power*math.floor(max_depth/6)) + z = pos.z, } elseif area == 'dungeon' then newpos = {} @@ -50,11 +50,11 @@ local function teleporter(user, area, power) -- check below the top level base_pos.y = base_pos.y - (base_pos.y + 32) % 80 - 12 - for i = 1, 1000 do + for i = 1, 4000 do newpos = { - x = (math.random(2)*2-3)*(math.random(math.floor(max_depth/6))+power*math.floor(max_depth/6)), - y = base_pos.y - math.random(50) * 80, - z = (math.random(2)*2-3)*(math.random(math.floor(max_depth/6))+power*math.floor(max_depth/6)) + x = base_pos.x + (math.random(5) - math.random(5)) * 80, + y = base_pos.y - math.random(50) * 80, + z = base_pos.z + (math.random(5) - math.random(5)) * 80, } -- avoid walls @@ -87,9 +87,9 @@ local function teleporter(user, area, power) local c1, c2 for i = 1, 1000 do newpos = { - x = (math.random(2)*2-3)*(math.random(math.floor(max_depth/6))+power*math.floor(max_depth/6)), - y = base_pos.y - math.random(50) * 80, - z = (math.random(2)*2-3)*(math.random(math.floor(max_depth/6))+power*math.floor(max_depth/6)) + x = pos.x, + y = base_pos.y - math.random(50) * 80, + z = pos.z, } c1 = minetest.get_perlin(fun_caves.cave_noise_1):get3d(newpos)