From 396d149ab41c0808393fad3285d51c05889c1bd6 Mon Sep 17 00:00:00 2001 From: Duane Date: Fri, 1 Jul 2016 06:54:33 -0500 Subject: [PATCH] Add fortress designs. --- fortress.lua | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/fortress.lua b/fortress.lua index 516d438..7986d5d 100644 --- a/fortress.lua +++ b/fortress.lua @@ -204,6 +204,48 @@ end local designs = { + { + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,1,0,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,0}, + {0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0}, + {0,1,0,1,0,1,0,0,0,0,0,0,0,1,0,1,0,1,0}, + {0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0}, + {0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,1,0,1,0,1,0,0,0,0,0,0,0,1,0,1,0,1,0}, + {0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0}, + {0,1,0,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + }, + { + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,0}, + {0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0}, + {0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0}, + {0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0}, + {0,1,0,1,0,1,1,1,1,1,0,0,0,1,0,1,0,1,0}, + {0,1,0,1,0,1,0,0,0,0,0,0,0,1,0,1,0,1,0}, + {0,1,0,1,0,1,0,0,0,0,0,0,0,1,0,1,0,1,0}, + {0,1,0,1,0,1,0,0,0,0,0,0,0,1,0,1,0,1,0}, + {0,1,0,1,0,1,0,0,0,0,0,0,0,1,0,1,0,1,0}, + {0,1,0,1,0,1,0,0,0,0,0,0,0,1,0,1,0,1,0}, + {0,1,0,1,0,1,0,0,0,0,0,0,0,1,0,1,0,1,0}, + {0,1,0,1,0,1,0,0,0,0,0,0,0,1,0,1,0,1,0}, + {0,1,0,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,0}, + {0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0}, + {0,1,0,1,1,1,0,0,0,1,1,1,1,1,1,1,0,1,0}, + {0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0}, + {0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + }, { {0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0}, {0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0}, @@ -321,7 +363,7 @@ fun_caves.fortress = function(minp_in, maxp_in, data, area, node) data[ivm] = inner_wall end else - if y2 == 0 and y == minp.y + y2 * cell_size + 1 and data[ivm - area.ystride] ~= node['air'] and math.random(300) == 1 then + if y2 == 0 and y == minp.y + y2 * cell_size + 1 and data[ivm - area.ystride] ~= node['air'] and math.random(700) == 1 then treasure_count = treasure_count + 1 data[ivm] = node['fun_caves:coffer'] else @@ -334,7 +376,7 @@ fun_caves.fortress = function(minp_in, maxp_in, data, area, node) end if floor_type ~= 3 then - local wall_type = math.random(2) + local wall_type = math.random(4) if wall_type == 1 then maze_floor(y2, minp, maxp, data, area, node)