1(kern-mk-place
2	'p_voidgap_entrance
3	"Passage to Voidgap"
4	s_dungeon          ; sprite
5	(kern-mk-map nil 19 19 pal_expanded
6	(list
7		"rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn "
8		"rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn "
9		"rn rn rn rn rn rn rn rn rn rn rn rn rn rn r8 rn rn rn rn "
10		"rn rn r8 r8 r8 r8 r8 rn r8 rn rn rn rn rc {{ ra r8 r8 rn "
11		"rn rc {4 {{ {{ {{ {2 re bb ra r8 xx rc {{ {{ {2 .. .. ra "
12		"rc .. {4 {{ {{ {3 .. .. .. .. {4 xx {{ {{ {{ {2 .. .. .! "
13		".. .. .. {1 {1 .. .. .. .. .. .. x! {5 {{ {3 .. .. .! .. "
14		".. .. .. .. .. .. .. .. .. .. .. w+ .. {1 .. .. .. .. .! "
15		".. .. .. .. .. bb .. .. .. .. .. .. .. .. bb .. .. .. .. "
16		".. .. .. .. .. .. .. .. {8 .. .. w+ .. .. .. .. .. .. .! "
17		".. .. .. .. .. .. {8 {c {{ {2 .. .. .. .. .. .. .. .! .. "
18		".. .. bb .. .. {c {{ {{ {{ {2 .. w+ .. .. .. .. .. {8 .! "
19		".. .. .. .. {c {{ {{ rf {{ {2 .. x! .. .. .. .. {4 {{ {a "
20		".. .. .. {4 {{ {{ {{ {{ {3 .. .. xx .. .. .. .. {4 {{ {{ "
21		".. r7 .. .. r3 r5 {{ {{ {2 {8 {8 xx .. r3 r5 .. .. {5 {{ "
22		"r1 rn r1 r1 rn rn r1 r5 {4 {{ {{ xx r3 rn rn r1 r1 r1 r1 "
23		"rn rn rn rn rn rn rn rn r5 {{ {{ rn rn rn rn rn rn rn rn "
24		"rn rn rn rn rn rn rn rn rn r1 r1 rn rn rn rn rn rn rn rn "
25		"rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn "
26
27	)
28	)
29
30	 #f              ; wraps
31	 #t              ; underground
32	 #f              ; large-scale (wilderness)
33	 #f              ; tmp combat place
34	 nil ; subplaces
35	 nil ; neighbors
36
37	 (list ; objects
38		(put (mk-monman) 0 0)
39
40		 (put (mk-windowed-door) 11 8)
41 		(put (mk-windowed-door)  11 10)
42
43		 (put (guard-pt 'knight)  13 8)
44		 (put (guard-pt 'knight)  13 10)
45		 (put (guard-pt 'halberdier)  14 9)
46		 (put (guard-pt 'crossbowman)  15 10)
47		 (put (guard-pt 'crossbowman)  15 8)
48
49		(put (spawn-pt 'cave-goblin-slinger-m) 3 7)
50		(put (spawn-pt 'cave-goblin-berserker-m) 6 12)
51		(put (spawn-pt 'cave-goblin-slinger-m) 4 11)
52		(put (spawn-pt 'cave-goblin-berserker-m) 7 8)
53		(put (spawn-pt 'troll-m) 2 8)
54	 )
55
56	 (list
57		 'on-entry-to-dungeon-room
58	 	'voidgap-room-handle-start
59		) ;; hooks
60 (list  ;; edge entrances
61  (list northwest 18 14)
62  (list southwest 18 6)
63  )
64 )
65
66(mk-place-music p_voidgap_entrance 'ml-castle)
67
68
69(kern-mk-place
70	'p_voidgap_exit
71	"Tunnels at Voidgap"
72	s_dungeon          ; sprite
73	(kern-mk-map nil 19 19 pal_expanded
74	(list
75		"rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn "
76		"rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn "
77		"rn rn rn r8 r8 rn rn rn rn rn rn rn rn rn rn rn rn rn rn "
78		"rn rn rc .. .. ra r8 r8 rn rn rn r8 r8 r8 r8 r8 r8 r8 rn "
79		"r8 rc .. .. {4 {{ {{ {{ ra r8 rc {{ {{ {{ {2 bb .. .. ra "
80		".! .. .. .. .. {1 {5 {{ {{ {{ {{ {{ {{ {{ {2 .. .. .. .. "
81		".! .! .. .. .. .. .. {1 {5 {{ {{ rf {{ {3 .. .. .. .. .. "
82		".. .. .. .. .. .. .. bb .. {1 {5 {{ {3 .. .. .. .. .. .. "
83		".! .. .. .. .. .. .. .. .. .. .. {1 .. .. .. .. .. .. .. "
84		".! .. .. .. .. .. .. .. .. .. .. .. .. .. bb .. .. .. .. "
85		".. .! .. bb .. .. .. .. .. rf .. .. .. .. .. .. .. .. .. "
86		".! .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
87		"{8 {8 {8 .. .. .. .. bb .. .. .. .. .. .. .. .. .. .. .. "
88		"{{ {{ {{ {2 .. .. .. .. .. .. .. .. .. .. .. .. bb .. .. "
89		"{{ {3 {1 .. .. r3 r5 .. .. .. r3 r5 .. .. .. r3 r5 .. .. "
90		"r5 .. r3 r1 r1 rn rn r1 r1 r1 rn rn r1 r1 r1 rn rn r1 r1 "
91		"rn r1 rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn "
92		"rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn "
93		"rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn "
94
95	)
96	)
97
98	 #f              ; wraps
99	 #t              ; underground
100	 #f              ; large-scale (wilderness)
101	 #f              ; tmp combat place
102	 nil ; subplaces
103	 nil ; neighbors
104
105	 nil ; objects
106
107	 (list
108	 	'voidgap-room-handle-end
109		) ;; hooks
110 (list  ;; edge entrances
111  (list northeast 0 14)
112  (list southeast 0 5)
113  )
114 )
115
116(mk-place-music p_voidgap_exit 'ml-dungeon-adventure)
117
118
119(kern-mk-place
120	'p_voidgap_1
121	"Voidgap Tunnels"
122	 nil          ; sprite
123	(kern-mk-map nil 19 19 pal_expanded
124		(list
125		"rn rn rn rn r4 .. .. .. .. .. .. .. .. .. r2 rn rn rn rn "
126		"rn rn rn rn r4 .. .. .. .. .. .. .. .. .. r2 rn rn rn rn "
127		"rn rn rn rn rc .. .. .. .. .. .. .. .. .. ra rn rn rn rn "
128		"rn rn rn .. .. .. .. .. .. .. .. .. .. .. .. .. rn rn rn "
129		"r8 r8 rc .. .. .. .. .. .. .. .. .. .. .. .. .. ra r8 r8 "
130		".. .. .. .. .. .. .A .. .. .. .. .. .. .. .. .. .. .. .. "
131		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
132		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
133		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
134		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
135		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
136		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
137		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
138		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
139		"r1 r1 r5 .. .. .. .. .. .. .. .. .. .. .. .. .. r3 r1 r1 "
140		"rn rn rn .. .. .. .. .. .. .. .. .. .. .. .. .. rn rn rn "
141		"rn rn rn rn r5 .. .. .. .. .. .. .. .. .. r3 rn rn rn rn "
142		"rn rn rn rn r4 .. .. .. .. .. .. .. .. .. r2 rn rn rn rn "
143		"rn rn rn rn r4 .. .. .. .. .. .. .. .. .. r2 rn rn rn rn "
144		)
145	)
146	 #f              ; wraps
147	 #t              ; underground
148	 #f              ; large-scale (wilderness)
149	 #f              ; tmp combat place
150	 nil ; subplaces
151	 nil ; neighbors
152
153	nil; objects
154
155	 (list
156		;'on-entry-to-dungeon-room
157		'voidgap-room-handle-deeps
158	) ;; hooks
159	nil
160)
161
162
163 (kern-mk-place
164	'p_voidgap_2
165	"Voidgap Tunnels"
166	nil          ; sprite
167	(kern-mk-map nil 19 19 pal_expanded
168		(list
169		"rn rn rn rn r4 .. .. .. .. .. .. .. .. .. r2 rn rn rn rn "
170		"rn rn rn rn r4 .. .. .. .. .. .. .. .. .. r2 rn rn rn rn "
171		"rn rn rn rn rc .. .. .. .. .. .. .. .. .. ra rn rn rn rn "
172		"rn rn rn .. .. .. .. .. .. .. .. .. .. .. .. .. rn rn rn "
173		"r8 r8 rc .. .. .. .. .. .. .. .. .. .. .. .. .. ra r8 r8 "
174		".. .. .. .. .. .. .A .. .. .. .. .. .. .. .. .. .. .. .. "
175		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
176		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
177		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
178		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
179		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
180		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
181		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
182		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
183		"r1 r1 r5 .. .. .. .. .. .. .. .. .. .. .. .. .. r3 r1 r1 "
184		"rn rn rn .. .. .. .. .. .. .. .. .. .. .. .. .. rn rn rn "
185		"rn rn rn rn r5 .. .. .. .. .. .. .. .. .. r3 rn rn rn rn "
186		"rn rn rn rn r4 .. .. .. .. .. .. .. .. .. r2 rn rn rn rn "
187		"rn rn rn rn r4 .. .. .. .. .. .. .. .. .. r2 rn rn rn rn "
188		)
189	)
190	 #f              ; wraps
191	 #t              ; underground
192	 #f              ; large-scale (wilderness)
193	 #f              ; tmp combat place
194	 nil ; subplaces
195	 nil ; neighbors
196
197	 nil
198
199	 (list
200		;'on-entry-to-dungeon-room
201		'voidgap-room-handle-deeps
202	) ;; hooks
203	nil
204)
205
206   (kern-mk-place
207	'p_voidgap_3
208	"Voidgap Tunnels"
209	 nil          ; sprite
210	(kern-mk-map nil 19 19 pal_expanded
211		(list
212		"rn rn rn rn r4 .. .. .. .. .. .. .. .. .. r2 rn rn rn rn "
213		"rn rn rn rn r4 .. .. .. .. .. .. .. .. .. r2 rn rn rn rn "
214		"rn rn rn rn rc .. .. .. .. .. .. .. .. .. ra rn rn rn rn "
215		"rn rn rn .. .. .. .. .. .. .. .. .. .. .. .. .. rn rn rn "
216		"r8 r8 rc .. .. .. .. .. .. .. .. .. .. .. .. .. ra r8 r8 "
217		".. .. .. .. .. .. .A .. .. .. .. .. .. .. .. .. .. .. .. "
218		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
219		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
220		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
221		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
222		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
223		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
224		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
225		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
226		"r1 r1 r5 .. .. .. .. .. .. .. .. .. .. .. .. .. r3 r1 r1 "
227		"rn rn rn .. .. .. .. .. .. .. .. .. .. .. .. .. rn rn rn "
228		"rn rn rn rn r5 .. .. .. .. .. .. .. .. .. r3 rn rn rn rn "
229		"rn rn rn rn r4 .. .. .. .. .. .. .. .. .. r2 rn rn rn rn "
230		"rn rn rn rn r4 .. .. .. .. .. .. .. .. .. r2 rn rn rn rn "
231		)
232	)
233	 #f              ; wraps
234	 #t              ; underground
235	 #f              ; large-scale (wilderness)
236	 #f              ; tmp combat place
237	 nil ; subplaces
238	 nil ; neighbors
239
240	 nil
241
242	 (list
243		;'on-entry-to-dungeon-room
244		'voidgap-room-handle-deeps
245	) ;; hooks
246 	nil
247 )
248
249   (kern-mk-place
250	'p_voidgap_4
251	"Voidgap Tunnels"
252	 nil          ; sprite
253	(kern-mk-map nil 19 19 pal_expanded
254		(list
255		"rn rn rn rn r4 .. .. .. .. .. .. .. .. .. r2 rn rn rn rn "
256		"rn rn rn rn r4 .. .. .. .. .. .. .. .. .. r2 rn rn rn rn "
257		"rn rn rn rn rc .. .. .. .. .. .. .. .. .. ra rn rn rn rn "
258		"rn rn rn .. .. .. .. .. .. .. .. .. .. .. .. .. rn rn rn "
259		"r8 r8 rc .. .. .. .. .. .. .. .. .. .. .. .. .. ra r8 r8 "
260		".. .. .. .. .. .. .A .. .. .. .. .. .. .. .. .. .. .. .. "
261		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
262		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
263		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
264		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
265		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
266		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
267		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
268		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
269		"r1 r1 r5 .. .. .. .. .. .. .. .. .. .. .. .. .. r3 r1 r1 "
270		"rn rn rn .. .. .. .. .. .. .. .. .. .. .. .. .. rn rn rn "
271		"rn rn rn rn r5 .. .. .. .. .. .. .. .. .. r3 rn rn rn rn "
272		"rn rn rn rn r4 .. .. .. .. .. .. .. .. .. r2 rn rn rn rn "
273		"rn rn rn rn r4 .. .. .. .. .. .. .. .. .. r2 rn rn rn rn "
274		)
275	)
276	 #f              ; wraps
277	 #t              ; underground
278	 #f              ; large-scale (wilderness)
279	 #f              ; tmp combat place
280	 nil ; subplaces
281	 nil ; neighbors
282
283	 nil
284
285	 (list
286		;'on-entry-to-dungeon-room
287		'voidgap-room-handle-deeps
288	) ;; hooks
289 	nil
290 )
291
292 (kern-mk-place
293	'p_voidgap_5
294	"Voidgap Tunnels"
295	  nil          ; sprite
296	(kern-mk-map nil 19 19 pal_expanded
297		(list
298		"rn rn rn rn r4 .. .. .. .. .. .. .. .. .. r2 rn rn rn rn "
299		"rn rn rn rn r4 .. .. .. .. .. .. .. .. .. r2 rn rn rn rn "
300		"rn rn rn rn rc .. .. .. .. .. .. .. .. .. ra rn rn rn rn "
301		"rn rn rn .. .. .. .. .. .. .. .. .. .. .. .. .. rn rn rn "
302		"r8 r8 rc .. .. .. .. .. .. .. .. .. .. .. .. .. ra r8 r8 "
303		".. .. .. .. .. .. .A .. .. .. .. .. .. .. .. .. .. .. .. "
304		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
305		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
306		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
307		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
308		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
309		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
310		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
311		".. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. "
312		"r1 r1 r5 .. .. .. .. .. .. .. .. .. .. .. .. .. r3 r1 r1 "
313		"rn rn rn .. .. .. .. .. .. .. .. .. .. .. .. .. rn rn rn "
314		"rn rn rn rn r5 .. .. .. .. .. .. .. .. .. r3 rn rn rn rn "
315		"rn rn rn rn r4 .. .. .. .. .. .. .. .. .. r2 rn rn rn rn "
316		"rn rn rn rn r4 .. .. .. .. .. .. .. .. .. r2 rn rn rn rn "
317		)
318	)
319	 #f              ; wraps
320	 #t              ; underground
321	 #f              ; large-scale (wilderness)
322	 #f              ; tmp combat place
323	 nil ; subplaces
324	 nil ; neighbors
325
326	 nil
327
328	 (list
329		;'on-entry-to-dungeon-room
330		'voidgap-room-handle-deeps
331	) ;; hooks
332	nil
333 )
334
335
336(mk-place-music p_voidgap_1 'ml-dungeon-adventure)
337(mk-place-music p_voidgap_2 'ml-dungeon-adventure)
338(mk-place-music p_voidgap_3 'ml-dungeon-adventure)
339(mk-place-music p_voidgap_4 'ml-dungeon-adventure)
340(mk-place-music p_voidgap_5 'ml-dungeon-adventure)
341
342(prmap-linkrooms-2d 'p_voidgap_1 'p_voidgap_2 'p_voidgap_3 'p_voidgap_4 'p_voidgap_5)
343
344(prmap-set-mapdata p_voidgap_1 (prmap-mk-mapdata "voidgap" voidgap-random-type-ns voidgap-random-type-ew voidgap-random-type-area 'deep-terrain-edges 'deep-terrain-area 'deep-room-blitstats 'voidgap-room-custom-hardlinks))
345
346(let ((voidgap-hardlinks (prmap-params-hardlinks (prmap-get-mapdata p_voidgap_1))))
347	(define (link-rm xloc yloc zloc dir target maptemplate passable )
348		(prmap-room-hardlink-set! xloc yloc zloc voidgap-hardlinks dir target maptemplate passable nil)
349		)
350
351;;---------------------------------------------------------
352;; hardlink setup
353;;
354;;			x	y	z	dir		target				template				passable
355
356(link-rm	1	0	0	west	nil					'm_deeptempl_wall		#f)
357(link-rm	0	1	0	south	nil					'm_deeptempl_wall		#f)
358(link-rm	-1	0	0	east	'p_voidgap_entrance	'm_deeptempl_passage	#f)
359(link-rm	0	-1	0	north	nil					'm_deeptempl_wall		#f)
360
361(link-rm	-7	-5	0	east	nil					'm_deeptempl_wall		#f)
362(link-rm	-6	-4	0	south	nil					'm_deeptempl_wall		#f)
363(link-rm	-5	-5	0	west	'p_voidgap_exit	'm_deeptempl_passage	#f)
364(link-rm	-6	-6	0	north	nil					'm_deeptempl_wall		#f)
365)
366
367;;flag for checking if cohesion check still needs to be performed
368(mutable-list-set (prmap-get-mapdata p_voidgap_1) 10 #t)