diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-10-13 02:47:08 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-10-13 02:47:08 -0300 |
commit | 71fd1ac27f0b3f44a96c33ff511e4f462e31a636 (patch) | |
tree | 3f0bbef557b4c242f0a7093ecf7e481d4ce8f418 /npc/maze0 | |
parent | 3c00014739c395c1d225b6392713f9d77a1ecd30 (diff) | |
download | serverdata-71fd1ac27f0b3f44a96c33ff511e4f462e31a636.tar.gz serverdata-71fd1ac27f0b3f44a96c33ff511e4f462e31a636.tar.bz2 serverdata-71fd1ac27f0b3f44a96c33ff511e4f462e31a636.tar.xz serverdata-71fd1ac27f0b3f44a96c33ff511e4f462e31a636.zip |
Works almost perfectly, there's only one problem: Islands.
It's *random*, not *algorithimical*. This means it can fail at making a path
from an edge to the other.
Diffstat (limited to 'npc/maze0')
-rw-r--r-- | npc/maze0/config.txt | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/npc/maze0/config.txt b/npc/maze0/config.txt index 32a55894a..07bc3222d 100644 --- a/npc/maze0/config.txt +++ b/npc/maze0/config.txt @@ -191,7 +191,7 @@ function script ParseMaze { // Can we do this? // Case 1: We're in the edge - if (.@y == MAZE_MY) + if (.@y == MAZE_MY-1) return false; // Case 2: Down direction is invalid? @@ -206,7 +206,7 @@ function script ParseMaze { // Can we do this? // Case 1: We're in the edge - if (.@x == MAZE_MX) + if (.@x == MAZE_MX-1) return false; // Case 2: Right direction is invalid? @@ -260,7 +260,7 @@ function script GenerateMaze { MAZEMAPTYPE_DEADS, MAZEMAPTYPE_DEADE, MAZEMAPTYPE_CURVESE; // NE edge - else if (.@x == MAZE_MX) + else if (.@x == MAZE_MX-1) setarray getd(MazeVar(.@x, .@y, "_ALLOWEDTYPES")), MAZEMAPTYPE_DEADS, MAZEMAPTYPE_DEADW, MAZEMAPTYPE_CURVESW; @@ -273,7 +273,7 @@ function script GenerateMaze { // Case 2: Right column - } else if (.@y == MAZE_MY) { + } else if (.@y == MAZE_MY-1) { // SW edge if (.@x == 0) @@ -281,7 +281,7 @@ function script GenerateMaze { MAZEMAPTYPE_DEADN, MAZEMAPTYPE_DEADE, MAZEMAPTYPE_CURVENE; // SE edge - else if (.@x == MAZE_MX) + else if (.@x == MAZE_MX-1) setarray getd(MazeVar(.@x, .@y, "_ALLOWEDTYPES")), MAZEMAPTYPE_DEADN, MAZEMAPTYPE_DEADW, MAZEMAPTYPE_CURVENW; @@ -367,21 +367,22 @@ function script GenerateMaze { // Sanity Check - for (.@y=0; .@y < MAZE_MY; .@y++) { - for (.@x=0; .@x < MAZE_MX; .@x++) { - .@mid=getd(MazeVar(.@x, .@y, "_ID")); - .@v$=MazeVar(.@x, .@y); - .@n$=getd(.@v$+"$["+MAZENORTH+"]"); - .@w$=getd(.@v$+"$["+MAZE_WEST+"]"); - .@e$=getd(.@v$+"$["+MAZE_EAST+"]"); - .@s$=getd(.@v$+"$["+MAZESOUTH+"]"); - debugmes "\t%s\t\t\t", .@n$; - debugmes "%s|%s|%s", .@w$, .@s$, .@e$; + if ($@GM_OVERRIDE) { + for (.@y=0; .@y < MAZE_MY; .@y++) { + for (.@x=0; .@x < MAZE_MX; .@x++) { + .@mid=getd(MazeVar(.@x, .@y, "_ID")); + .@v$=MazeVar(.@x, .@y); + .@n$=getd(.@v$+"$["+MAZENORTH+"]"); + .@w$=getd(.@v$+"$["+MAZE_WEST+"]"); + .@e$=getd(.@v$+"$["+MAZE_EAST+"]"); + .@s$=getd(.@v$+"$["+MAZESOUTH+"]"); + debugmes "\t%s\t\t\t", .@n$; + debugmes "%s|%s|%s\t\t", .@w$, .@s$, .@e$; + } + debugmes "%s (%d)", .@v$, .@mid; } - debugmes "%s (%d)", .@v$, .@mid; } - freeloop(false); debugmes "[STATUS] Finished"; end; |