// "../deathforth/events/rareloc/weird.txt" $load-rooms
// "../deathforth/rooms/city.txt" $add-rooms

"
:map 1 
:tags bunkerbarracks  
:scriptA bed 0.3 movex 
:scriptB livingset 
:size 18 13 
:off 10 2 
:tiles 
000000000022222200
222222222223333222
233333333331111332
211111111111111112
21111111B111111112
211111111111111112
211211111111111222
211211111111111233
2112A11A11A11A1200
211211111111111200
211222222222222200
222233333333333300
333300000000000000

:map 2 
:tags bunkerstart  
:scriptA bunkerbars -0.3 movey 
:scriptB chair 
:scriptC rebar .drift 
:size 7 9 
:off 10 3 
:tiles 
2222222
2333332
2111112
2112112
2112662
2112662
2112112
2222222
3333333

:map 3 
:tags bunkerendbed  
:scriptA bed 0.3 movex 
:scriptB officedesk -1 movey 
:scriptC bunkermegaloot 
:scriptD skel 
:size 11 8 
:off 10 1 
:tiles 
00022222000
22223332222
23331B13332
21111111112
21111CD1A12
21111111112
22222222222
33333333333

:map 4 
:tags bunkerdining  
:scriptA table-hori 
:scriptB chair 
:scriptC rebar .drift 
:size 13 13 
:off 7 0 
:tiles 
0000222220000
0222233322220
0233311133320
2211111111122
2311111111132
2111B1B1B1112
2111A1A1A1112
2111B1B1B1112
2211111111122
3211111111123
0222211122220
0333222223330
0000333330000

:map 5 
:tags bunkerhall1  
:scriptA 2 zombs-clump 
:scriptB bunkerbars -0.1 movex 
:scriptC bunkerbars 0.1 movex 
:size 10 8 
:off 6 3 
:tiles 
2222222222
2333333332
2111111112
2111111112
21C1111B12
2111111112
2222222222
3333333333

:map 6 
:tags bunkerstairs  
:scriptA bunkerbars -0.3 movey 
:scriptB 6 30 zombs-spread 
:scriptC 3 zombs-clump 
:scriptD 2 zombs-clump 
:size 7 18 
:off 18 7 
:tiles 
2222222
2333332
2111112
2111112
2111112
2211122
321CC23
0266620
0266620
0266620
0266620
0266620
0266620
0266620
0266620
021C120
0222220
0333330

:map 7 
:tags bunkerstorage  
:scriptA bunkerloot 
:scriptB bunkermegaloot 
:scriptC bigshelf -1 movey 
:scriptD cupboard -1 movey 
:size 12 18 
:off 8 0 
:tiles 
022222222220
023323323320
02A12112A120
026636636620
021111111120
022221122220
033321123330
000021120000
222221122222
233331133332
2C1D1111D1C2
211111111112
211111111112
2D1D1111D1D2
211111111112
211111111112
222222222222
333333333333

:map 8 
:tags bunkerhall2  
:scriptA 2 zombs-clump 
:size 10 10 
:off 7 1 
:tiles 
0222222000
0233332000
2211112222
2311113332
2111111A12
2111111112
2111111A12
2211112222
3222222333
0333333000

:map 9 
:tags bunkerbath  
:scriptA bathtoilet -1 movey 
:scriptB bathtub -1 movey 
:scriptC sink -1 movey 
:scriptD bathlootf -1 movey -0.5 movex 
:scriptE stall -1 movey 
:scriptF bathlootf -1 movey 
:size 15 14 
:off 8 1 
:tiles 
000222220000000
000233320000000
000211120000000
222211122222222
233311133333332
2B1E1111CCEAEA2
211111111111112
211111111111112
222222112222222
332333113332333
002F1D111DF2000
002111111112000
002222222222000
003333333333000

:map 10 
:tags bunkerfood  
:scriptA kloote -1 movey 
:scriptB kloot -1 movey 
:scriptC klootf -1 movey 
:size 13 16 
:off 8 3 
:tiles 
0000222220000
0000233320000
2222211122222
2333311133332
2B1A11111A1B2
2111111111112
2122222222212
2133333333312
211B1C1C1B112
2111111111112
2122222222212
2133333333312
211C1C1C1C112
2111111111112
2222222222222
3333333333333

:map 11 
:tags bunkerkitch  
:scriptA kcounter 
:scriptB kloot -1 movey 
:size 11 10 
:off 8 5 
:tiles 
22222222222
23333333332
21B11A11B12
21111111112
21222122212
21333133312
211B111B112
21111111112
22222222222
33333333333
"
value BUNKERROOMS
BUNKERROOMS $parse-rooms

	: bunkerloot1 12 dshot shotgun .drift ;
	: bunkerloot2 30 dbullet pistol .drift ;
	: bunkerloot3 24 dbullet dolt .drift ;
	: bunkerloot4 24 dbullet snubnose .drift ;
	: bunkerloot5 30 drifle rifle .drift ;
	: bunkerloot6 30 drifle hunting .drift ;

	: bunkerlootm1 50 dbullet uzi .drift ;
	: bunkerlootm2 50 drifle ak47 .drift ;
	: bunkerlootm3 30 dshot autoshot .drift ;
	: bunkerlootm4 20 dshot slug .drift ;
	
	: bunkerloot
		0 stack
			' bunkerloot1 shove
			' bunkerloot2 shove
			' bunkerloot3 shove
			' bunkerloot4 shove
			' bunkerloot5 shove
			' bunkerloot6 shove
		shuffles pops execute drop
	;
	
	: bunkermegaloot
		0 stack
			' bunkerlootm1 shove
			' bunkerlootm2 shove
			' bunkerlootm3 shove
			' bunkerlootm4 shove
		shuffles pops execute drop
	;

map{ roomgen{

	: bunkerbars
		spawn special_objects64_base_id 0x 9 + lt .spriteid!
		bbox immovable as-metal
	;

} }
	
locdef{

location: bunker
		max-rooms: 11
		entry-tags: bunkerstart
		script: set-theme-bunker 
		pre-script: set-theme-bunker
		post-script: nad

		: bunker0script
			s edge-inc s random-edge-door "bunkerstair" only-with-door
			2diff %zombs
		;
		
		: bunker1script
			s random-edge-door "bunkerhall1" only-with-door
			2diff %zombs
		;

		: bunker2script
			// e random-edge-door "tutor3" only-with-door
			// s random-edge-door "tutorbath" only-with-door
			// n random-edge-door "bedroom" only-with-door
			// baseball .scatter wrench .scatter
			s random-edge-door "bunkerhall2" only-with-door
		;
		
		: bunker3script
			e random-edge-door "bunkerdining" only-with-door
			skelscat 5diff %zombs
		;
		
		: bunker4script
			n random-edge-door "bunkerkitch" only-with-door
			e random-edge-door "bunkerbarracks" only-with-door
			s random-edge-door "bunkerfood" only-with-door
			skelscat 5diff %zombs
		;
		
		: bunker5script
			n random-edge-door "bunkerstorage" only-with-door
			e random-edge-door "bunkerendbed" only-with-door
			s random-edge-door "bunkerbath" only-with-door
			10diff %zombs
			skelscat skelscat
		;
		
		room-choice: bunkerstart
			room-weight: 300
			room-count: 1
			room-script:
			room-post-script: bunker0script
			filter-only

		room-choice: bunkerstair
			room-weight: 300
			room-count: 1
			room-script: gcloset-theme
			room-post-script: bunker1script
			filter-only

		room-choice: bunkerhall1
			room-weight: 300
			room-count: 1
			room-script: gcloset-theme
			room-post-script: bunker2script
			filter-only

		room-choice: bunkerhall2
			room-weight: 300
			room-count: 1
			room-script: gcloset-theme
			room-post-script: bunker3script
			filter-only
		
		room-choice: bunkerdining
			room-weight: 300
			room-count: 1
			room-script: 
			room-post-script: bunker4script
			filter-only
			
		room-choice: bunkerbarracks
			room-weight: 300
			room-count: 1
			room-script: 
			room-post-script: bunker5script
			filter-only

		room-choice: bunkerstorage
			room-weight: 300
			room-count: 1
			room-script: gcloset-theme
			room-post-script: 2diff %zombs
			filter-only

		room-choice: bunkerfood
			room-weight: 300
			room-count: 1
			room-script: gcloset-theme
			room-post-script: 2diff %zombs
			filter-only		

		room-choice: bunkerendbed
			room-weight: 300
			room-count: 1
			room-post-script: 5diff %zombs
			filter-only

		room-choice: bunkerbath
			room-weight: 300
			room-count: 1
			room-script: floor-bath
			room-post-script: 2diff %zombs

		room-choice: bunkerkitch
			room-weight: 10
			room-count: 1
			room-script: floor-kitchen
			room-post-script: 2diff %zombs
}
			
regiondef{

	 region: forest bunker
		w: 45 // 35
		h: 45 // 35
		script: timeofday o'clock

		no-prefab // Don't build that default city
		on-foot
		
		: make-a-bunker map{
			"bunker" $picklocid addloc prefab{ 5 bunker }
			}
		;

		: setup-bunker-forest
			map{ grass make-a-bunker 50 pines }
		;

		post-script: setup-bunker-forest 5sdiff %zombs
}
