// uses events/city/building-pick-layout.df - Commented because special-lots already loads this. Also currently using test/loctestlayout instead.

"../deathforth/rooms/city.txt" $load-rooms
"../deathforth/rooms/office.txt" $add-rooms
"../deathforth/rooms/shop.txt" $add-rooms
"../deathforth/rooms/restroom.txt" $add-rooms

location
		tags: trashed
		max-rooms: 2
		entry-tags: trashed
		
		room-choice: trashed
			room-weight: 10
			room-count: 2
			room-script: nad
			filter-only


map{ regiondef{

	: pick-building

		' curbuild ++
		
		try-special-build if then;

		rowsleft 2 <= 100 %chance and if 0 else auto-picklocid then
		
		dup if
			addloc last-loc-pick-script evaluate
		else drop
			"trashed" $picklocid addloc	make-a-house
//			"trashed" $picklocid addloc	make-apartments
			35 %chance if block-last-build-door then
		then
	;

	: pick-lots
		blocks-init
			6 to blockh
			2 to maxrows
			6 to streeth
			0.35 to greenspace
			1 3 rnd to grassylots
		blocks-start

		pavement

		begin canplot? while

			pick-building next-plot

			canplot? 0= if break then
			block-middle? if LOT_GRASS lastlot = if 1 else 0 then aplot then
		repeat

		street-junk
	;

	: building-pick-setup
		0 to curbuild
		5sdiff %zombs pavement pick-lots
	;
	
} }

regiondef{

	: runme
		mission{ siege-start-dig 50 left-spawn 50 right-spawn }
		building-pick-setup
		50 %chars-up
		3 4 rnd for skelscat next
		1 2 rnd for LLammo next 
		LLweapon cheapweapons .scatter cheapweapons .scatter
	;

	 region: new-locations-test
		w: 27
		h: 18
		script: timeofday o'clock
		on-foot no-rest

		loc-choice: trashed
			loc-weight: 40
			loc-count: 1

			loc-pick-script: make-a-house

		post-script: runme
}
