Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
t-engine4
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hachem_Muche
t-engine4
Commits
accfd911
Commit
accfd911
authored
8 years ago
by
DarkGod
Browse files
Options
Downloads
Patches
Plain Diff
fixed maze generator with werid values of widen
parent
c0d6fc4c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
game/engines/default/engine/generator/map/Maze.lua
+8
-1
8 additions, 1 deletion
game/engines/default/engine/generator/map/Maze.lua
game/modules/tome/data/zones/infinite-dungeon/zone.lua
+0
-2
0 additions, 2 deletions
game/modules/tome/data/zones/infinite-dungeon/zone.lua
with
8 additions
and
3 deletions
game/engines/default/engine/generator/map/Maze.lua
+
8
−
1
View file @
accfd911
...
...
@@ -35,11 +35,17 @@ function _M:init(zone, map, grid_list, data)
end
function
_M
:
generate
(
lev
,
old_lev
)
local
lastx
,
lasty
=
0
,
0
local
do_tile
=
function
(
i
,
j
,
wall
)
for
ii
=
0
,
self
.
data
.
widen_w
-
1
do
for
jj
=
0
,
self
.
data
.
widen_h
-
1
do
self
.
map
(
i
*
self
.
data
.
widen_w
+
ii
,
j
*
self
.
data
.
widen_h
+
jj
,
Map
.
TERRAIN
,
self
:
resolve
(
wall
and
"wall"
or
"floor"
))
end
end
self
.
map
.
room_map
[
i
][
j
].
maze_wall
=
wall
if
not
wall
then
lastx
=
math.max
(
lastx
,
i
)
lasty
=
math.max
(
lasty
,
j
)
end
end
for
i
=
0
,
self
.
data
.
w
-
1
do
for
j
=
0
,
self
.
data
.
h
-
1
do
...
...
@@ -94,7 +100,8 @@ function _M:generate(lev, old_lev)
end
-- Always starts at 1, 1
local
ux
,
uy
=
1
*
self
.
data
.
widen_w
,
1
*
self
.
data
.
widen_h
local
dx
,
dy
=
math.floor
(
self
.
map
.
w
/
2
)
*
2
-
1
-
2
*
(
1
-
math
.
mod
(
self
.
map
.
w
,
2
)),
math.floor
(
self
.
map
.
h
/
2
)
*
2
-
1
-
2
*
(
1
-
math
.
mod
(
self
.
map
.
h
,
2
))
local
dx
,
dy
=
lastx
*
self
.
data
.
widen_w
,
lasty
*
self
.
data
.
widen_h
-- local dx, dy = math.floor(self.map.w/2)*2-1-2*(1-math.mod(self.map.w,2)), math.floor(self.map.h/2)*2-1-2*(1-math.mod(self.map.h,2))
self
.
map
(
ux
,
uy
,
Map
.
TERRAIN
,
self
:
resolve
(
"up"
))
self
.
map
.
room_map
[
ux
][
uy
].
special
=
"exit"
if
lev
<
self
.
zone
.
max_level
or
self
.
data
.
force_last_stair
then
...
...
This diff is collapsed.
Click to expand it.
game/modules/tome/data/zones/infinite-dungeon/zone.lua
+
0
−
2
View file @
accfd911
...
...
@@ -172,7 +172,6 @@ return {
zone
:
triggerHook
{
"InfiniteDungeon:getLayouts"
,
layouts
=
layouts
}
local
layout
=
rng
.
table
(
layouts
)
local
layout
=
layouts
[
4
]
data
.
generator
.
map
=
layout
local
vgrids
=
{
...
...
@@ -196,7 +195,6 @@ return {
}
zone
:
triggerHook
{
"InfiniteDungeon:getGrids"
,
grids
=
vgrids
}
local
vgrid
=
rng
.
table
(
vgrids
)
-- local vgrid = vgrids[#vgrids]
data
.
generator
.
map
.
floor
=
vgrid
.
floor
data
.
generator
.
map
[
'.'
]
=
vgrid
.
floor
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment