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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
32 BYTE
VARCH1[] = { 2, 4, 3, 0, 3, 1, 3, 4, 0, 7, 48, 0, 51, 39, 47, 44, 0, 0 };
33 BYTE
VARCH2[] = { 2, 4, 3, 0, 3, 1, 3, 4, 0, 8, 48, 0, 51, 39, 47, 44, 0, 0 };
34 BYTE
VARCH3[] = { 2, 4, 3, 0, 3, 1, 3, 4, 0, 6, 48, 0, 51, 39, 47, 44, 0, 0 };
35 BYTE
VARCH4[] = { 2, 4, 3, 0, 3, 1, 3, 4, 0, 9, 48, 0, 51, 39, 47, 44, 0, 0 };
36 BYTE
VARCH5[] = { 2, 4, 3, 0, 3, 1, 3, 4, 0, 14, 48, 0, 51, 39, 47, 44, 0, 0 };
37 BYTE
VARCH6[] = { 2, 4, 3, 0, 3, 1, 3, 4, 0, 13, 48, 0, 51, 39, 47, 44, 0, 0 };
38 BYTE
VARCH7[] = { 2, 4, 3, 0, 3, 1, 3, 4, 0, 16, 48, 0, 51, 39, 47, 44, 0, 0 };
39 BYTE
VARCH8[] = { 2, 4, 3, 0, 3, 1, 3, 4, 0, 15, 48, 0, 51, 39, 47, 44, 0, 0 };
40 BYTE
VARCH9[] = { 2, 4, 3, 0, 3, 8, 3, 4, 0, 7, 48, 0, 51, 42, 47, 44, 0, 0 };
41 BYTE
VARCH10[] = { 2, 4, 3, 0, 3, 8, 3, 4, 0, 8, 48, 0, 51, 42, 47, 44, 0, 0 };
42 BYTE
VARCH11[] = { 2, 4, 3, 0, 3, 8, 3, 4, 0, 6, 48, 0, 51, 42, 47, 44, 0, 0 };
43 BYTE
VARCH12[] = { 2, 4, 3, 0, 3, 8, 3, 4, 0, 9, 48, 0, 51, 42, 47, 44, 0, 0 };
44 BYTE
VARCH13[] = { 2, 4, 3, 0, 3, 8, 3, 4, 0, 14, 48, 0, 51, 42, 47, 44, 0, 0 };
45 BYTE
VARCH14[] = { 2, 4, 3, 0, 3, 8, 3, 4, 0, 13, 48, 0, 51, 42, 47, 44, 0, 0 };
46 BYTE
VARCH15[] = { 2, 4, 3, 0, 3, 8, 3, 4, 0, 16, 48, 0, 51, 42, 47, 44, 0, 0 };
47 BYTE
VARCH16[] = { 2, 4, 3, 0, 3, 8, 3, 4, 0, 15, 48, 0, 51, 42, 47, 44, 0, 0 };
48 BYTE
VARCH17[] = { 2, 3, 2, 7, 3, 4, 0, 7, 141, 39, 47, 44, 0, 0 };
49 BYTE
VARCH18[] = { 2, 3, 2, 7, 3, 4, 0, 8, 141, 39, 47, 44, 0, 0 };
50 BYTE
VARCH19[] = { 2, 3, 2, 7, 3, 4, 0, 6, 141, 39, 47, 44, 0, 0 };
51 BYTE
VARCH20[] = { 2, 3, 2, 7, 3, 4, 0, 9, 141, 39, 47, 44, 0, 0 };
52 BYTE
VARCH21[] = { 2, 3, 2, 7, 3, 4, 0, 14, 141, 39, 47, 44, 0, 0 };
53 BYTE
VARCH22[] = { 2, 3, 2, 7, 3, 4, 0, 13, 141, 39, 47, 44, 0, 0 };
54 BYTE
VARCH23[] = { 2, 3, 2, 7, 3, 4, 0, 16, 141, 39, 47, 44, 0, 0 };
55 BYTE
VARCH24[] = { 2, 3, 2, 7, 3, 4, 0, 15, 141, 39, 47, 44, 0, 0 };
56 BYTE
VARCH25[] = { 2, 4, 3, 0, 3, 4, 3, 1, 0, 7, 48, 0, 51, 39, 47, 44, 0, 0 };
57 BYTE
VARCH26[] = { 2, 4, 3, 0, 3, 4, 3, 1, 0, 8, 48, 0, 51, 39, 47, 44, 0, 0 };
58 BYTE
VARCH27[] = { 2, 4, 3, 0, 3, 4, 3, 1, 0, 6, 48, 0, 51, 39, 47, 44, 0, 0 };
59 BYTE
VARCH28[] = { 2, 4, 3, 0, 3, 4, 3, 1, 0, 9, 48, 0, 51, 39, 47, 44, 0, 0 };
60 BYTE
VARCH29[] = { 2, 4, 3, 0, 3, 4, 3, 1, 0, 14, 48, 0, 51, 39, 47, 44, 0, 0 };
61 BYTE
VARCH30[] = { 2, 4, 3, 0, 3, 4, 3, 1, 0, 13, 48, 0, 51, 39, 47, 44, 0, 0 };
62 BYTE
VARCH31[] = { 2, 4, 3, 0, 3, 4, 3, 1, 0, 16, 48, 0, 51, 39, 47, 44, 0, 0 };
63 BYTE
VARCH32[] = { 2, 4, 3, 0, 3, 4, 3, 1, 0, 15, 48, 0, 51, 39, 47, 44, 0, 0 };
64 BYTE
VARCH33[] = { 2, 4, 2, 0, 3, 8, 3, 4, 0, 7, 142, 0, 51, 42, 47, 44, 0, 0 };
65 BYTE
VARCH34[] = { 2, 4, 2, 0, 3, 8, 3, 4, 0, 8, 142, 0, 51, 42, 47, 44, 0, 0 };
66 BYTE
VARCH35[] = { 2, 4, 2, 0, 3, 8, 3, 4, 0, 6, 142, 0, 51, 42, 47, 44, 0, 0 };
67 BYTE
VARCH36[] = { 2, 4, 2, 0, 3, 8, 3, 4, 0, 9, 142, 0, 51, 42, 47, 44, 0, 0 };
68 BYTE
VARCH37[] = { 2, 4, 2, 0, 3, 8, 3, 4, 0, 14, 142, 0, 51, 42, 47, 44, 0, 0 };
69 BYTE
VARCH38[] = { 2, 4, 2, 0, 3, 8, 3, 4, 0, 13, 142, 0, 51, 42, 47, 44, 0, 0 };
70 BYTE
VARCH39[] = { 2, 4, 2, 0, 3, 8, 3, 4, 0, 16, 142, 0, 51, 42, 47, 44, 0, 0 };
71 BYTE
VARCH40[] = { 2, 4, 2, 0, 3, 8, 3, 4, 0, 15, 142, 0, 51, 42, 47, 44, 0, 0 };
72 BYTE
HARCH1[] = { 3, 2, 3, 3, 0, 2, 5, 9, 49, 46, 0, 40, 45, 0 };
73 BYTE
HARCH2[] = { 3, 2, 3, 3, 0, 2, 5, 6, 49, 46, 0, 40, 45, 0 };
74 BYTE
HARCH3[] = { 3, 2, 3, 3, 0, 2, 5, 8, 49, 46, 0, 40, 45, 0 };
75 BYTE
HARCH4[] = { 3, 2, 3, 3, 0, 2, 5, 7, 49, 46, 0, 40, 45, 0 };
76 BYTE
HARCH5[] = { 3, 2, 3, 3, 0, 2, 5, 15, 49, 46, 0, 40, 45, 0 };
77 BYTE
HARCH6[] = { 3, 2, 3, 3, 0, 2, 5, 16, 49, 46, 0, 40, 45, 0 };
78 BYTE
HARCH7[] = { 3, 2, 3, 3, 0, 2, 5, 13, 49, 46, 0, 40, 45, 0 };
79 BYTE
HARCH8[] = { 3, 2, 3, 3, 0, 2, 5, 14, 49, 46, 0, 40, 45, 0 };
80 BYTE
HARCH9[] = { 3, 2, 3, 3, 0, 8, 5, 9, 49, 46, 0, 43, 45, 0 };
81 BYTE
HARCH10[] = { 3, 2, 3, 3, 0, 8, 5, 6, 49, 46, 0, 43, 45, 0 };
82 BYTE
HARCH11[] = { 3, 2, 3, 3, 0, 8, 5, 8, 49, 46, 0, 43, 45, 0 };
83 BYTE
HARCH12[] = { 3, 2, 3, 3, 0, 8, 5, 7, 49, 46, 0, 43, 45, 0 };
84 BYTE
HARCH13[] = { 3, 2, 3, 3, 0, 8, 5, 15, 49, 46, 0, 43, 45, 0 };
85 BYTE
HARCH14[] = { 3, 2, 3, 3, 0, 8, 5, 16, 49, 46, 0, 43, 45, 0 };
86 BYTE
HARCH15[] = { 3, 2, 3, 3, 0, 8, 5, 13, 49, 46, 0, 43, 45, 0 };
87 BYTE
HARCH16[] = { 3, 2, 3, 3, 0, 8, 5, 14, 49, 46, 0, 43, 45, 0 };
88 BYTE
HARCH17[] = { 3, 2, 1, 3, 0, 8, 5, 9, 140, 46, 0, 43, 45, 0 };
89 BYTE
HARCH18[] = { 3, 2, 1, 3, 0, 8, 5, 6, 140, 46, 0, 43, 45, 0 };
90 BYTE
HARCH19[] = { 3, 2, 1, 3, 0, 8, 5, 8, 140, 46, 0, 43, 45, 0 };
91 BYTE
HARCH20[] = { 3, 2, 1, 3, 0, 8, 5, 7, 140, 46, 0, 43, 45, 0 };
92 BYTE
HARCH21[] = { 3, 2, 1, 3, 0, 8, 5, 15, 140, 46, 0, 43, 45, 0 };
93 BYTE
HARCH22[] = { 3, 2, 1, 3, 0, 8, 5, 16, 140, 46, 0, 43, 45, 0 };
94 BYTE
HARCH23[] = { 3, 2, 1, 3, 0, 8, 5, 13, 140, 46, 0, 43, 45, 0 };
95 BYTE
HARCH24[] = { 3, 2, 1, 3, 0, 8, 5, 14, 140, 46, 0, 43, 45, 0 };
96 BYTE
HARCH25[] = { 3, 2, 3, 3, 0, 5, 2, 9, 49, 46, 0, 40, 45, 0 };
97 BYTE
HARCH26[] = { 3, 2, 3, 3, 0, 5, 2, 6, 49, 46, 0, 40, 45, 0 };
98 BYTE
HARCH27[] = { 3, 2, 3, 3, 0, 5, 2, 8, 49, 46, 0, 40, 45, 0 };
99 BYTE
HARCH28[] = { 3, 2, 3, 3, 0, 5, 2, 7, 49, 46, 0, 40, 45, 0 };
100 BYTE
HARCH29[] = { 3, 2, 3, 3, 0, 5, 2, 15, 49, 46, 0, 40, 45, 0 };
101 BYTE
HARCH30[] = { 3, 2, 3, 3, 0, 5, 2, 16, 49, 46, 0, 40, 45, 0 };
102 BYTE
HARCH31[] = { 3, 2, 3, 3, 0, 5, 2, 13, 49, 46, 0, 40, 45, 0 };
103 BYTE
HARCH32[] = { 3, 2, 3, 3, 0, 5, 2, 14, 49, 46, 0, 40, 45, 0 };
104 BYTE
HARCH33[] = { 3, 2, 1, 3, 0, 9, 5, 9, 140, 46, 0, 40, 45, 0 };
105 BYTE
HARCH34[] = { 3, 2, 1, 3, 0, 9, 5, 6, 140, 46, 0, 40, 45, 0 };
106 BYTE
HARCH35[] = { 3, 2, 1, 3, 0, 9, 5, 8, 140, 46, 0, 40, 45, 0 };
107 BYTE
HARCH36[] = { 3, 2, 1, 3, 0, 9, 5, 7, 140, 46, 0, 40, 45, 0 };
108 BYTE
HARCH37[] = { 3, 2, 1, 3, 0, 9, 5, 15, 140, 46, 0, 40, 45, 0 };
109 BYTE
HARCH38[] = { 3, 2, 1, 3, 0, 9, 5, 16, 140, 46, 0, 40, 45, 0 };
110 BYTE
HARCH39[] = { 3, 2, 1, 3, 0, 9, 5, 13, 140, 46, 0, 40, 45, 0 };
111 BYTE
HARCH40[] = { 3, 2, 1, 3, 0, 9, 5, 14, 140, 46, 0, 40, 45, 0 };
112 BYTE
USTAIRS[] = { 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 72, 77, 0, 0, 76, 0, 0, 0, 0, 0, 0 };
113 BYTE
DSTAIRS[] = { 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 48, 71, 0, 0, 50, 78, 0, 0, 0, 0, 0 };
114 BYTE
WARPSTAIRS[] = { 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 158, 160, 0, 0, 159, 0, 0, 0, 0, 0, 0 };
115 BYTE
CRUSHCOL[] = { 3, 3, 3, 1, 3, 2, 6, 3, 3, 3, 3, 0, 0, 0, 0, 83, 0, 0, 0, 0 };
116 BYTE
BIG1[] = { 2, 2, 3, 3, 3, 3, 113, 0, 112, 0 };
117 BYTE
BIG2[] = { 2, 2, 3, 3, 3, 3, 114, 115, 0, 0 };
118 BYTE
BIG3[] = { 1, 2, 1, 1, 117, 116 };
119 BYTE
BIG4[] = { 2, 1, 2, 2, 118, 119 };
120 BYTE
BIG5[] = { 2, 2, 3, 3, 3, 3, 120, 122, 121, 123 };
121 BYTE
BIG6[] = { 1, 2, 1, 1, 125, 124 };
122 BYTE
BIG7[] = { 2, 1, 2, 2, 126, 127 };
123 BYTE
BIG8[] = { 2, 2, 3, 3, 3, 3, 128, 130, 129, 131 };
124 BYTE
BIG9[] = { 2, 2, 1, 3, 1, 3, 133, 135, 132, 134 };
125 BYTE
BIG10[] = { 2, 2, 2, 2, 3, 3, 136, 137, 3, 3 };
133 BYTE
PANCREAS1[] = { 5, 3, 3, 3, 3, 3,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, 1, 0, 0, 4, 0, 16 },
179 { 0, 6, 0, 0, 1, 1, 0, 4, 0, 15 },
180 { 0, 0, 0, 0, 1, 1, 0, 1, 4, 13 },
181 { 8, 8, 8, 8, 1, 1, 0, 1, 1, 13 },
182 { 8, 8, 4, 8, 1, 1, 0, 1, 1, 10 },
183 { 0, 0, 0, 1, 1, 1, 1, 1, 1, 11 },
184 { 1, 1, 1, 1, 1, 1, 2, 2, 8, 2 },
185 { 0, 1, 0, 1, 1, 4, 1, 1, 0, 16 },
186 { 0, 0, 0, 1, 1, 1, 1, 1, 4, 11 },
187 { 1, 1, 4, 1, 1, 1, 0, 2, 2, 2 },
188 { 1, 1, 1, 1, 1, 1, 6, 2, 6, 2 },
189 { 4, 1, 1, 1, 1, 1, 6, 2, 6, 2 },
190 { 2, 2, 2, 1, 1, 1, 4, 1, 1, 11 },
191 { 4, 1, 1, 1, 1, 1, 2, 2, 2, 2 },
192 { 1, 1, 4, 1, 1, 1, 2, 2, 1, 2 },
193 { 4, 1, 1, 1, 1, 1, 1, 2, 2, 2 },
194 { 2, 2, 6, 1, 1, 1, 4, 1, 1, 11 },
195 { 4, 1, 1, 1, 1, 1, 2, 2, 6, 2 },
196 { 1, 2, 2, 1, 1, 1, 4, 1, 1, 11 },
197 { 0, 1, 1, 0, 1, 1, 0, 1, 1, 10 },
198 { 2, 1, 1, 3, 1, 1, 2, 1, 1, 14 },
199 { 1, 1, 0, 1, 1, 2, 1, 1, 0, 1 },
200 { 0, 4, 0, 1, 1, 1, 0, 1, 1, 14 },
201 { 4, 1, 0, 1, 1, 0, 1, 1, 0, 1 },
202 { 0, 1, 0, 4, 1, 1, 0, 1, 1, 15 },
203 { 1, 1, 1, 1, 1, 1, 0, 2, 2, 2 },
204 { 0, 1, 1, 2, 1, 1, 2, 1, 4, 10 },
205 { 2, 1, 1, 1, 1, 1, 0, 4, 0, 16 },
206 { 1, 1, 4, 1, 1, 2, 0, 1, 2, 1 },
207 { 2, 1, 1, 2, 1, 1, 1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 },
237 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
238 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
239 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
240 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
241 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
242 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
243 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
246 static BOOL
DRLG_L2PlaceMiniSet(BYTE *miniset,
int tmin,
int tmax,
int cx,
int cy, BOOL setview,
int ldir)
248 int sx, sy, sw, sh, xx, yy, i, ii, numt, bailcnt;
254 if (tmax - tmin == 0) {
257 numt =
random_(0, tmax - tmin) + tmin;
260 for (i = 0; i < numt; i++) {
264 for (bailcnt = 0; !found && bailcnt < 200; bailcnt++) {
266 if (sx >=
nSx1 && sx <= nSx2 && sy >=
nSy1 && sy <=
nSy2) {
269 if (cx != -1 && sx >= cx - sw && sx <= cx + 12) {
274 if (cy != -1 && sy >= cy - sh && sy <= cy + 12) {
280 for (yy = 0; yy < sh && found == TRUE; yy++) {
281 for (xx = 0; xx < sw && found == TRUE; xx++) {
282 if (miniset[ii] != 0 &&
dungeon[xx + sx][yy + sy] != miniset[ii]) {
285 if (
dflags[xx + sx][yy + sy] != 0) {
293 if (sx ==
DMAXX - sw) {
296 if (sy ==
DMAXY - sh) {
302 if (bailcnt >= 200) {
306 for (yy = 0; yy < sh; yy++) {
307 for (xx = 0; xx < sw; xx++) {
308 if (miniset[ii] != 0) {
309 dungeon[xx + sx][yy + sy] = miniset[ii];
316 if (setview == TRUE) {
334 int sx, sy, sw, sh, xx, yy, ii, kk;
340 for (sy = 0; sy <
DMAXY - sh; sy++) {
341 for (sx = 0; sx <
DMAXX - sw; sx++) {
344 if (sx >=
nSx1 && sx <= nSx2 && sy >=
nSy1 && sy <=
nSy2) {
347 for (yy = 0; yy < sh && found == TRUE; yy++) {
348 for (xx = 0; xx < sw && found == TRUE; xx++) {
349 if (miniset[ii] != 0 &&
dungeon[xx + sx][yy + sy] != miniset[ii]) {
352 if (
dflags[xx + sx][yy + sy] != 0) {
360 for (yy = std::max(sy - sh, 0); yy < std::min(sy + 2 * sh,
DMAXY) && found == TRUE; yy++) {
361 for (xx = std::max(sx - sw, 0); xx < std::min(sx + 2 * sw,
DMAXX); xx++) {
363 if (
dungeon[xx][yy] == miniset[kk]) {
369 if (found == TRUE &&
random_(0, 100) < rndper) {
370 for (yy = 0; yy < sh; yy++) {
371 for (xx = 0; xx < sw; xx++) {
372 if (miniset[kk] != 0) {
373 dungeon[xx + sx][yy + sy] = miniset[kk];
385 int x, y, i, j, k, rv;
388 for (y = 0; y <
DMAXY; y++) {
389 for (x = 0; x <
DMAXX; x++) {
390 if ((x < nSx1 || x >
nSx2) && (y < nSy1 || y >
nSy2) &&
random_(0, 4) == 0) {
404 for (j = y - 2; j < y + 2; j++) {
405 for (i = x - 2; i < x + 2; i++) {
427 for (y = 1; y <
DMAXY; y++) {
428 for (x = 1; x <
DMAXX; x++) {
433 for (i = 0; i < 2; i++) {
434 if (
SPATSL2[i].strig == sd[0][0]) {
445 if (patflag == TRUE) {
466 for (j = 0; j <
DMAXY; j++) {
467 for (i = 0; i <
DMAXX; i++) {
510 for (j = 0; j < rh; j++) {
511 for (i = 0; i < rw; i++) {
513 dungeon[i + rx1][j + ry1] = *sp;
523 static void DefineRoom(
int nX1,
int nY1,
int nX2,
int nY2, BOOL ForceHW)
538 if (ForceHW == TRUE) {
539 for (i = nX1; i < nX2; i++) {
547 for (i = nX1 + 1; i <= nX2 - 1; i++) {
552 for (j = nY1 + 1; j <= nY2; j++) {
555 for (i = nX1 + 1; i < nX2; i++) {
595 static void AddHall(
int nX1,
int nY1,
int nX2,
int nY2,
int nHd)
616 while (p2->
pNext != NULL) {
635 static void CreateRoom(
int nX1,
int nY1,
int nX2,
int nY2,
int nRDest,
int nHDir, BOOL ForceHW,
int nH,
int nW)
637 int nAw, nAh, nRw, nRh, nRx1, nRy1, nRx2, nRy2, nHw, nHh, nHx1, nHy1, nHx2, nHy2, nRid;
664 if (ForceHW == TRUE) {
669 nRx1 =
random_(0, nX2 - nX1) + nX1;
670 nRy1 =
random_(0, nY2 - nY1) + nY1;
708 if (ForceHW == TRUE) {
720 nHx1 =
random_(0, nRx2 - nRx1 - 2) + nRx1 + 1;
727 nHx1 =
random_(0, nRx2 - nRx1 - 2) + nRx1 + 1;
735 nHy1 =
random_(0, nRy2 - nRy1 - 2) + nRy1 + 1;
742 nHy1 =
random_(0, nRy2 - nRy1 - 2) + nRy1 + 1;
747 AddHall(nHx1, nHy1, nHx2, nHy2, nHDir);
751 CreateRoom(nX1 + 2, nY1 + 2, nRx1 - 2, nRy2 - 2, nRid, 2, 0, 0, 0);
752 CreateRoom(nRx2 + 2, nRy1 + 2, nX2 - 2, nY2 - 2, nRid, 4, 0, 0, 0);
753 CreateRoom(nX1 + 2, nRy2 + 2, nRx2 - 2, nY2 - 2, nRid, 1, 0, 0, 0);
754 CreateRoom(nRx1 + 2, nY1 + 2, nX2 - 2, nRy1 - 2, nRid, 3, 0, 0, 0);
756 CreateRoom(nX1 + 2, nY1 + 2, nRx2 - 2, nRy1 - 2, nRid, 3, 0, 0, 0);
757 CreateRoom(nRx1 + 2, nRy2 + 2, nX2 - 2, nY2 - 2, nRid, 1, 0, 0, 0);
758 CreateRoom(nX1 + 2, nRy1 + 2, nRx1 - 2, nY2 - 2, nRid, 2, 0, 0, 0);
759 CreateRoom(nRx2 + 2, nY1 + 2, nX2 - 2, nRy2 - 2, nRid, 4, 0, 0, 0);
763 static void GetHall(
int *nX1,
int *nY1,
int *nX2,
int *nY2,
int *nHd)
777 static void ConnectHall(
int nX1,
int nY1,
int nX2,
int nY2,
int nHd)
779 int nCurrd, nDx, nDy, nRp, nOrigX1, nOrigY1, fMinusFlag, fPlusFlag;
780 BOOL fDoneflag, fInroom;
789 nDx = abs(nX2 - nX1);
790 nDy = abs(nY2 - nY1);
798 if (nX1 >= 38 && nCurrd == 2) {
801 if (nY1 >= 38 && nCurrd == 3) {
804 if (nX1 <= 1 && nCurrd == 4) {
807 if (nY1 <= 1 && nCurrd == 1) {
810 if (
predungeon[nX1][nY1] == 67 && (nCurrd == 1 || nCurrd == 4)) {
813 if (
predungeon[nX1][nY1] == 66 && (nCurrd == 1 || nCurrd == 2)) {
816 if (
predungeon[nX1][nY1] == 69 && (nCurrd == 4 || nCurrd == 3)) {
819 if (
predungeon[nX1][nY1] == 65 && (nCurrd == 2 || nCurrd == 3)) {
828 if (fMinusFlag < 50) {
829 if (nCurrd != 1 && nCurrd != 3) {
835 if (fPlusFlag < 50) {
836 if (nCurrd != 1 && nCurrd != 3) {
853 nDx = abs(nX2 - nX1);
854 nDy = abs(nY2 - nY1);
861 if (nX2 <= nX1 || nX1 >=
DMAXX) {
873 if (nY2 <= nY1 || nY1 >=
DMAXY) {
880 if (nDy < 10 && nX1 == nX2 && (nCurrd == 2 || nCurrd == 4)) {
881 if (nY2 <= nY1 || nY1 >=
DMAXY) {
887 if (nDx < 10 && nY1 == nY2 && (nCurrd == 1 || nCurrd == 3)) {
888 if (nX2 <= nX1 || nX1 >=
DMAXX) {
894 if (nDy == 1 && nDx > 1 && (nCurrd == 1 || nCurrd == 3)) {
895 if (nX2 <= nX1 || nX1 >=
DMAXX) {
901 if (nDx == 1 && nDy > 1 && (nCurrd == 2 || nCurrd == 4)) {
902 if (nY2 <= nY1 || nX1 >=
DMAXX) {
908 if (nDx == 0 &&
predungeon[nX1][nY1] != 32 && (nCurrd == 2 || nCurrd == 4)) {
909 if (nX2 <= nOrigX1 || nX1 >=
DMAXX) {
915 if (nDy == 0 &&
predungeon[nX1][nY1] != 32 && (nCurrd == 1 || nCurrd == 3)) {
916 if (nY2 <= nOrigY1 || nY1 >=
DMAXY) {
922 if (nX1 == nX2 && nY1 == nY2) {
932 for (k = 0;
Patterns[k][4] != 255; k++) {
936 for (l = 0; l < 9 && nOk == 254; l++) {
938 if (l == 3 || l == 6) {
942 if (x >= 0 && x < DMAXX && y >= 0 && y <
DMAXY) {
1003 for (j = 0; j <
DMAXY; j++) {
1004 for (i = 0; i <
DMAXX; i++) {
1024 static BOOL
DL2_Cont(BOOL x1f, BOOL y1f, BOOL x2f, BOOL y2f)
1026 if (x1f && x2f && y1f && y2f) {
1029 if (x1f && x2f && (y1f || y2f)) {
1032 if (y1f && y2f && (x1f || x2f)) {
1044 for (jj = 0; jj <
DMAXY; jj++) {
1045 for (ii = 0; ii <
DMAXX; ii++) {
1059 for (jj = y1; jj <= y2; jj++) {
1060 for (ii = x1; ii <= x2; ii++) {
1064 for (jj = y1; jj <= y2; jj++) {
1068 for (ii = x1; ii <= x2; ii++) {
1078 for (ii = x1 + 1; ii < x2; ii++) {
1092 for (jj = y1 + 1; jj < y2; jj++) {
1110 int ii, jj, xx, yy, x1, x2, y1, y2;
1111 BOOL xf1, xf2, yf1, yf2;
1121 xf1 = xf2 = yf1 = yf2 = FALSE;
1127 xf1 = yf1 = yf2 = TRUE;
1134 xf2 = yf1 = yf2 = TRUE;
1141 yf1 = xf1 = xf2 = TRUE;
1148 yf2 = xf1 = xf2 = TRUE;
1151 if (
DL2_Cont(xf1, yf1, xf2, yf2)) {
1173 while (yf1 || yf2) {
1177 if (y2 ==
DMAXY - 1) {
1180 if (y2 - y1 >= 14) {
1204 if (x2 - x1 >= 12) {
1207 for (jj = y1; jj <= y2; jj++) {
1223 while (yf1 || yf2) {
1227 if (y2 ==
DMAXY - 1) {
1230 if (y2 - y1 >= 14) {
1254 if (x2 - x1 >= 12) {
1257 for (jj = y1; jj <= y2; jj++) {
1273 while (xf1 || xf2) {
1277 if (x2 ==
DMAXX - 1) {
1280 if (x2 - x1 >= 14) {
1301 if (y2 ==
DMAXY - 1) {
1304 if (y2 - y1 >= 12) {
1307 for (ii = x1; ii <= x2; ii++) {
1323 while (xf1 || xf2) {
1327 if (x2 ==
DMAXX - 1) {
1330 if (x2 - x1 >= 14) {
1354 if (y2 - y1 >= 12) {
1357 for (ii = x1; ii <= x2; ii++) {
1382 int i, j, nHx1, nHy1, nHx2, nHy2, nHd, ForceH, ForceW;
1418 GetHall(&nHx1, &nHy1, &nHx2, &nHy2, &nHd);
1422 for (j = 0; j <
DMAXY; j++) {
1423 for (i = 0; i <
DMAXX; i++) {
1470 for (j = 0; j <
DMAXY; j++) {
1471 for (i = 0; i <
DMAXX; i++) {
1482 long v1, v2, v3, v4, lv;
1488 v1 = SDL_SwapLE16(*(MegaTiles + 0)) + 1;
1489 v2 = SDL_SwapLE16(*(MegaTiles + 1)) + 1;
1490 v3 = SDL_SwapLE16(*(MegaTiles + 2)) + 1;
1491 v4 = SDL_SwapLE16(*(MegaTiles + 3)) + 1;
1493 for (j = 0; j <
MAXDUNY; j += 2)
1495 for (i = 0; i <
MAXDUNX; i += 2) {
1499 dPiece[i + 1][j + 1] = v4;
1504 for (j = 0; j <
DMAXY; j++) {
1506 for (i = 0; i <
DMAXX; i++) {
1509 v1 = SDL_SwapLE16(*(MegaTiles + 0)) + 1;
1510 v2 = SDL_SwapLE16(*(MegaTiles + 1)) + 1;
1511 v3 = SDL_SwapLE16(*(MegaTiles + 2)) + 1;
1512 v4 = SDL_SwapLE16(*(MegaTiles + 3)) + 1;
1516 dPiece[xx + 1][yy + 1] = v4;
1575 for (j = 0; j <
DMAXY; j++) {
1577 for (i = 0; i <
DMAXX; i++) {
1593 for (j = 0; j <
DMAXY; j++) {
1595 for (i = 0; i <
DMAXX; i++) {
1627 for (j = 0; j <
DMAXY; j++) {
1628 for (i = 0; i <
DMAXX; i++) {
1656 for (j = 0; j <
DMAXY; j++) {
1657 for (i = 0; i <
DMAXX; i++) {
1666 for (j = 1; j <
DMAXY - 1; j++) {
1667 for (i = 1; i <
DMAXX - 1; i++) {
1691 for (j = 1; j <
DMAXX - 1; j++) {
1692 for (i = 1; i <
DMAXY - 1; i++) {
1722 for (j = 1; j <
DMAXY; j++) {
1723 for (i = 1; i <
DMAXX; i++) {
1762 }
else if (entry == 1) {
1899 for (j = 0; j <
DMAXY; j++) {
1900 for (i = 0; i <
DMAXX; i++) {
1913 for (j = 0; j <
MAXDUNY; j++) {
1914 for (i = 0; i <
MAXDUNX; i++) {
1915 if (
dPiece[i][j] == 541) {
1917 }
else if (
dPiece[i][j] == 178) {
1919 }
else if (
dPiece[i][j] == 551) {
1921 }
else if (
dPiece[i][j] == 542) {
1923 }
else if (
dPiece[i][j] == 553) {
1925 }
else if (
dPiece[i][j] == 13) {
1927 }
else if (
dPiece[i][j] == 17) {
1935 for (j = 0; j <
MAXDUNY; j++) {
1936 for (i = 0; i <
MAXDUNX; i++) {
1937 if (
dPiece[i][j] == 132) {
1940 }
else if (
dPiece[i][j] == 135 ||
dPiece[i][j] == 139) {
1950 int i, j, rw, rh, pc;
1951 BYTE *pLevelMap, *lm;
1957 for (j = 0; j <
DMAXY; j++) {
1958 for (i = 0; i <
DMAXX; i++) {
1970 for (j = 0; j < rh; j++) {
1971 for (i = 0; i < rw; i++) {
1981 for (j = 0; j <
DMAXY; j++) {
1982 for (i = 0; i <
DMAXX; i++) {
1992 for (j = 0; j <
MAXDUNY; j++) {
1993 for (i = 0; i <
MAXDUNX; i++) {
1995 if (
dPiece[i][j] == 541) {
1998 if (
dPiece[i][j] == 178) {
2001 if (
dPiece[i][j] == 551) {
2004 if (
dPiece[i][j] == 542) {
2007 if (
dPiece[i][j] == 553) {
2010 if (
dPiece[i][j] == 13) {
2013 if (
dPiece[i][j] == 17) {
2019 for (j = 0; j <
MAXDUNY; j++) {
2020 for (i = 0; i <
MAXDUNX; i++) {
2021 if (
dPiece[i][j] == 132) {
2024 }
else if (
dPiece[i][j] == 135 ||
dPiece[i][j] == 139) {
2041 BYTE *pLevelMap, *lm;
2047 for (j = 0; j <
DMAXY; j++) {
2048 for (i = 0; i <
DMAXX; i++) {
2060 for (j = 0; j < rh; j++) {
2061 for (i = 0; i < rw; i++) {
2071 for (j = 0; j <
DMAXY; j++) {
2072 for (i = 0; i <
DMAXX; i++) {
2078 for (j = 0; j <
DMAXY; j++) {
2079 for (i = 0; i <
DMAXX; i++) {