
map{ roomgen{

	: barcounter
		spawn special_objects48_base_id 0x 3 + lt .spriteid!
		rndflip 25 health! bbox immovable as-wood nohit
	;

	: bararcade
		spawn special_objects32_base_id 0x 27 + lt .spriteid!
		bbox as-wood
	;

	: barstool
		spawn special_objects32_base_id 0x 1f + lt .spriteid!
		bbox as-wood
	;	
	
	: mallwindow
		special_objects64_base_id 0x a + tanchor 1- wallhang
		// TODO: SMASH! smash-n-loot
	;
	
	: mallshutter
		special_objects64_base_id 0x b + tanchor 1- wallhang
	;

} }

locdef{
		
location: bar
		max-rooms: 1
		entry-tags: bar
		script: set-theme-cabin 

	: bottle-scatter 6 for bottle .scatter next ;
	: barloot
		bottle-scatter
		new-drunk-npc -3 movey drop
		skelscat
		30 %chance if skelscat then
		1 4 rnd case
			1 of dolt 12 sbullet endof
			2 of shotgun 8 sshot endof
			3 of 3 for molscat next 50 LOOT_GAS spawnscat endof
			4 of pistol 30 sbullet endof
		endcase
	;

		room-choice: bar
			room-weight: 10
			room-count: 1
			room-script: nad 
			room-post-script: barloot
			filter-only

location: gunshop
		max-rooms: 1
		entry-tags: shop
		script: yall-theme 

	: gunshoploot
		3 6 rnd for skelscat next
		3 carts-scatter
		3 for LLammobox next
		90 %chance if pistol .scatter 10 15 rnd sbullet then
		25 %chance if shotgun .scatter pistol .scatter then
		50 %chance if LLammobox then
		10 %chance if LLammobox then
		30 %chance if 1 4 rnd case
			1 of dolt .scatter 12 sbullet endof
			2 of shotgun .scatter 8 sshot endof
			3 of huntcowboy .scatter 15 srifle endof
			4 of niceranged .scatter endof
		endcase	then
	;

		room-choice: shop
			room-weight: 10
			room-count: 1
			room-script: nad 
			room-post-script: 10diff %zombs gunshoploot
			filter-only
			
location: foodshop
		max-rooms: 1
		entry-tags: shop
		script: yall-theme 

	: foodshoploot
		1 3 rnd for skelscat next
		3 carts-scatter
		3 for LLkitchen next
		roomgen{ KLroll 10shelfstock }
		
	;

		room-choice: shop
			room-weight: 10
			room-count: 1
			room-script: nad 
			room-post-script: 10diff %zombs foodshoploot
			filter-only
			
location: drugshop
		max-rooms: 1
		entry-tags: shop
		script: yall-theme 

	: drugshoploot
		1 3 rnd for skelscat next
		2 carts-scatter
		2 3 rnd for 1 LOOT_MEDICAL spawnscat next
		30 %chance if 1 LOOT_FOOD spawnscat then
	;

		room-choice: shop
			room-weight: 10
			room-count: 1
			room-script: nad 
			room-post-script: 10diff %zombs drugshoploot
			filter-only

location: umbrellashop
		max-rooms: 1
		entry-tags: shop
		script: yall-theme 

	: umbrellashoploot
		0 1 rnd for skelscat next
		2 carts-scatter
		2 6 rnd for umbrella .scatter next
		30 %chance if beach .scatter then
	;

		room-choice: shop
			room-weight: 10
			room-count: 1
			room-script: nad 
			room-post-script: 10diff %zombs umbrellashoploot
			filter-only			
			
location: hardwareshop
		max-rooms: 1
		entry-tags: shop
		script: yall-theme 

	: hardwareshoploot
		3 6 rnd for skelscat next
		3 carts-scatter
		1 4 rnd case
			1 of wrench .scatter endof
			2 of shovel .scatter endof
			3 of metal .scatter endof
			4 of sledge .scatter endof
		endcase
		30 %chance if nail .scatter then
		3 6 rnd for 2x4 .scatter next
		20 %chance if pitchfork .scatter then
		60 %chance if 20 40 rnd sgas then 
		30 50 rnd sgas
		15 %chance if crowbar .scatter then
		30 %chance if chainsaw .scatter then
		5 %chance if blowtorch .scatter then
	;

		room-choice: shop
			room-weight: 10
			room-count: 1
			room-script: nad 
			room-post-script: 10diff %zombs hardwareshoploot
			filter-only				
			
location: campingshop
		max-rooms: 1
		entry-tags: shop
		script: yall-theme 

	: campingshoploot
		2 4 rnd for skelscat next
		2 carts-scatter
		1 2 rnd for 1 LOOT_FOOD spawnscat next
		1 5 rnd case
			1 of hatchet .scatter endof
			2 of frying .scatter hatchet .scatter endof
			3 of machete2 .scatter endof
			4 of huntcowboy .scatter 15 srifle endof
			5 of shotgun .scatter 8 sshot endof 
		endcase
		50 %chance if machete1 .scatter then
		fishing .scatter
		5 %chance if blowtorch .scatter then
		20 %chance if 20 50 rnd sgas then
	;

		room-choice: shop
			room-weight: 10
			room-count: 1
			room-script: nad 
			room-post-script: 10diff %zombs campingshoploot
			filter-only

location: petshop
		max-rooms: 1
		entry-tags: shop
		script: yall-theme 

	: petshoploot
		10 20 rnd for skelscat next
		20 30 rnd for femur .scatter next
		2 carts-scatter
		1 3 rnd for 1 LOOT_FOOD spawnscat next
		2 5 rnd for new-veryferaldog next
		new-feraldog
	;
		room-choice: shop
			room-weight: 10
			room-count: 1
			room-script: nad 
			room-post-script: petshoploot
			filter-only				

location: jockshop
		max-rooms: 1
		entry-tags: shop
		script: yall-theme 

	: jockweapons
		for 
		1 5 rnd case
			1 of baseball .scatter endof
			2 of cricket .scatter endof
			3 of golf .scatter endof
			4 of aluminum .scatter endof
			5 of 90 %chance if hockey else xtreme then .scatter endof 
		endcase
		next
	;
	: jockshoploot
		0 2 rnd for skelscat next
		2 carts-scatter
		1 3 rnd jockweapons
		2 for 60 %chance if baseball .scatter then next
	;

		room-choice: shop
			room-weight: 10
			room-count: 1
			room-script: nad 
			room-post-script: 10diff %zombs jockshoploot
			filter-only				

location: sportingshop
		max-rooms: 2
		entry-tags: shop
		script: yall-theme 

	: sportingloot
		jockshoploot campingshoploot 15 25 rnd zombs
	;

		room-choice: shop
			room-weight: 10
			room-count: 1
			room-script:
			room-post-script: 10diff %zombs sportingloot
			filter-only	

		room-choice: restroom
			room-weight: 10
			room-count: 1
			room-script: floor-bath	
			
location: restaurant
		max-rooms: 4
		entry-tags: restaurant
		script: set-theme-restaurant
		post-script: 10diff %zombs nad

	: restaurant-start
		random-door "restroom" only-with-door
		random-door "rest-kitchen" only-with-door
		10diff %zombs
	;		

	: restaurant-loot 1 2 rnd for 1 LOOT_FOOD spawnscat next skelscat 30 %chance if skelscat then ;
	
	: rest-kitchenrooms
		random-door "rest-storage" only-with-door
		restaurant-loot
	;		

		room-choice: restaurant
			room-weight: 10
			room-count: 1
			room-script: 
			room-post-script: restaurant-start map{ room-garbage }
			filter-only		

		room-choice: restroom
			room-weight: 10
			room-count: 1
			room-script: floor-bath
			
		room-choice: rest-kitchen 
			room-weight: 10
			room-count: 1
			room-script: floor-kitchen 
			room-post-script: rest-kitchenrooms
			
		room-choice: rest-storage
			room-weight: 10
			room-count: 1
			room-script: floor-kitchen
			room-post-script: rest-kitchenrooms
			filter-only		
	
location: bookshop
		max-rooms: 2
		entry-tags: shop
		script: set-theme-bookstore

: bookshoploot
	map{ room-papers }
	6 for book scatter next
	randombook scatter
;
		
		room-choice: shop
			room-weight: 10
			room-count: 1
			room-script: 
			room-post-script: 10diff %zombs bookshoploot
			filter-only		
 
		room-choice: restroom
			room-weight: 10
			room-count: 1
			room-script: floor-bath
	
}
		
map{ roomgen{

: storefurniture
	0 10 rnd case
		0 of chair endof
		1 of chair endof
		2 of lazyboy endof
		3 of bed endof
		4 of endtable endof
		5 of smalltable endof
		6 of table endof
		7 of spawn 0x 1a themed spriteid! bbox endof
		8 of spawn 0x 1d themed spriteid! bbox endof
		9 of spawn 0x 1c themed spriteid! bbox endof
		10 of chair endof
	endcase	99 health!
;

} }			

locdef{

location: furnstore
		max-rooms: 2
		entry-tags: furnstore
		script: set-theme-furnstore

		room-choice: furnstore
			room-weight: 10
			room-count: 1
			room-script: 
			room-post-script: 10diff %zombs roomgen{ 10shelfstock }
			filter-only		

		room-choice: restroom
			room-weight: 10
			room-count: 1
			room-script: floor-bath
			
}
