"../deathforth/rooms/city.txt" $load-rooms

load? events/block/sharedcitylayout.df
load? events/city/city-locations.df

map{ regiondef{

	: pick-building

		' curbuild ++

		rowsleft 1 = 75 %chance and if 0 else auto-picklocid then
		
		dup if
			addloc last-loc-pick-script evaluate
		else drop
			"trashed" $picklocid addloc	make-apartments
			75 %chance if block-last-build-door then
		then
	;

	: pick-lots
		blocks-init
			6 to blockh
			2 to maxrows
			5 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
		5diff %zombs pavement pick-lots
	;
	
} }

regiondef{

	: runme
	//	special-lot-setup-example
		building-pick-setup
	;

	 region: block-test
		w: 27
		h: 25
		script: timeofday o'clock

		loc-choice: apartment
			loc-weight: 40
			loc-count: 4

			loc-pick-script: make-apartments

		post-script: runme
}
