Shrink fortresses and add non-maze levels.
This commit is contained in:
parent
955d4db7ad
commit
f44735e032
3 changed files with 159 additions and 76 deletions
|
@ -43,28 +43,21 @@ local function teleporter(user, area, power)
|
|||
elseif area == 'dungeon' then
|
||||
newpos = {}
|
||||
local base_pos = table.copy(pos)
|
||||
base_pos.x = base_pos.x - (base_pos.x + 32) % 80 + 12
|
||||
base_pos.z = base_pos.z - (base_pos.z + 32) % 80 + 12
|
||||
if power > 0 then
|
||||
base_pos.y = fun_caves.underzones[({'Caina','Phlegethos','Dis','Minauros', 'Phlegethos','Styx'})[power]].lower_bound
|
||||
end
|
||||
|
||||
-- check below the top level
|
||||
base_pos.y = base_pos.y - (base_pos.y + 32) % 80 - 12
|
||||
base_pos.y = base_pos.y - (base_pos.y + 32) % 80 - 15
|
||||
|
||||
for i = 1, 4000 do
|
||||
for i = 1, 8000 do
|
||||
newpos = {
|
||||
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
|
||||
if newpos.x % 16 == 0 then
|
||||
newpos.x = newpos.x + 1
|
||||
end
|
||||
if newpos.z % 16 == 0 then
|
||||
newpos.z = newpos.z + 1
|
||||
end
|
||||
|
||||
if fun_caves.is_fortress(newpos) then
|
||||
break
|
||||
end
|
||||
|
@ -73,9 +66,6 @@ local function teleporter(user, area, power)
|
|||
if not fun_caves.is_fortress(newpos) then
|
||||
return
|
||||
end
|
||||
|
||||
-- place on the top level
|
||||
newpos.y = newpos.y + 10
|
||||
elseif area == 'underworld' then
|
||||
local good = false
|
||||
local base_pos = table.copy(pos)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue