#
# (Scroll down past the lines starting with # for the map scripts.)
#
# TODO:
# - Add safehouse maps
# - Document all existing tiles and specials
#
#
#
# Start a line with the # symbol to indicate a comment
# Do not initiate comments elsewhere in the line
#
# All lines without comments must be either totally empty or have the pattern:
# (whitespace) COMMAND (whitespace) VALUE
# I reccomend using tabs to separate the command and value for clarity and organization
# Leading tabs to indicate hierarchy aren't required, but help for readability
#
#
#
#OBJECT	SITEMAP	-- tells the game you're making a site map
#	NAME	GENERIC_EXAMPLE -- labels the map, needed to add it to a level
#	USE	GENERIC_FRONTDOOR -- build a map of this type first, then draw the
#					specified changes over it (useful for inheriting common motifs, in this
#					case it pre-builds a front door with exits around the spawn point)
#	TILE	RESTRICTED  -- name of the tile you'd like to draw with, in this case creates a high security area
#		XSTART	-10 -- leftmost extreme of the rectangle to draw (here, ten tiles left of start)
#		XEND	10  -- rightmost extreme of the rectangle to draw
#		YSTART	1   -- topmost extreme of the rectangle to draw 
#		YEND	21  -- bottommost extreme of the rectangle to draw
#		ZSTART	0   -- lowest floor to draw this on (0 is ground floor, 1 is one story up, etc)
#		ZEND	0   -- highest floor to draw this on
#		NOTE	ADD -- this tile should be COMBINED with existing tiles there (useful for securing areas, doors, etc)
#	SCRIPT	ROOM -- the command SCRIPT specifies a C++ method to call on the specified area; scripts must be programmed
#					into the code but can do arbitrarily complicated things, and are used for complex
#					tasks that are impossible to do using the config files.
#		XSTART	-5
#		XEND	5
#		YSTART	3
#		YEND	8 (omitting a coordinate sets it to 0, as is here for the z coordinates)
#	SPECIAL	TABLE -- name of the special feature you'd like to draw
#		XSTART	-10
#		XEND	10
#		YSTART	1
#		YEND	21
#		Z	0 -- naming a coordinate without START or END assigns the value to both of them, as here with Z
#		FREQ	5 -- draw this special about once every (5) tiles in this area
#	UNIQUE	NUCLEAR_ONOFF -- name of the special to add uniquely to a single random open secure tile, if one is available
#	LOOT	POLICERECORDS -- name of a type of stealable loot you want on this map
#		WEIGHT	10 -- weighting on how frequently a loot on the ground will be of this type, relative to any other
#				loots specified (all loot freq's added, then it rolls randomly inside that range...
#				so police records with freq 10 and chemicals with freq 20 gives a 2/3 chance that a
#				given loot will be a chemical, and a 1/3 chance that it'll be police records)
#
#
#
# MAX/MIN X: -34/+34
# MAX/MIN Y:  00/+22
# MAX/MIN Z:  00/+09
# Going beyond these limits may crash the game
#
# Player starts at X = 0, Y = 1, Z = 0 when visiting a site
# Starting position varies when under siege
#
#
#
# USING STAIRS:
#
# - You can manually place stairs through SPECIAL STAIRS_UP and SPECIAL STAIRS_DOWN. You'll need to use both;
# the game doesn't automatically place down stairs over up stairs and vice versa, and it's entirely possible to
# get trapped on a level after climbing stairs that you can't get back down.
#
# - SCRIPT STAIRS will avoid this problem. Specify a volume that covers multiple z-levels and either stretches
# along the X or Y axis for at least two tiles, and the script will automatically create stairs up and down on
# each level. This is what is used to create the apartment stairwells in the game.
#
# - SCRIPT STAIRS_RANDOM will randomly place stairs to connect z-levels. It will place on upwards stairs
# on every designated level except the top one and a corresponding downward stairs for each one up.
#
#
#
# SCRIPTS:
#
# ROOM          - Random room generator, will generate either a room, or a maze of rooms, depending on the size of the area.
# HALLWAY_YAXIS - Carves out a single tile wide hallway vertically down the map, then plots rooms on either side of the hallway.
# STAIRS        - Creates a nice stairwell with alternating up and down stairs.
# STAIRS_RANDOM - Connect z-levels with randomly placed stairs.
#
#
# NOTE: Loot is currently not using this system.


OBJECT	SITEMAP
	NAME	GENERIC_FRONTDOOR
	TILE	OUTDOOR
		XSTART	-1
		XEND	1
		YSTART	0
		YEND	1
		ZSTART	0
		ZEND	0
	TILE	EXIT
		XSTART	-1
		XEND	1
		YSTART	0
		YEND	1
		ZSTART	0
		ZEND	0
		NOTE	ADD
	TILE	OUTDOOR
		X	0
		Y	1
		Z	0
	TILE	DOOR
		X	0
		Y	2
		Z	0

OBJECT	SITEMAP
	NAME	GENERIC_UNSECURE
	USE	GENERIC_FRONTDOOR
	SCRIPT	ROOM
		XSTART	-12
		XEND	12
		YSTART	3
		YEND	15
		ZSTART	0
		ZEND	0

OBJECT	SITEMAP
	NAME	GENERIC_SECURE
	USE	GENERIC_UNSECURE
	TILE	RESTRICTED
		XSTART	-12
		XEND	12
		YSTART	2
		YEND	15
		ZSTART	0
		ZEND	0
		NOTE	ADD

OBJECT	SITEMAP
	NAME	GENERIC_ONEROOM
	USE	GENERIC_FRONTDOOR
	TILE	OPEN
		XSTART	-4
		XEND	4
		YSTART	3
		YEND	10
		ZSTART	0
		ZEND	0

OBJECT	SITEMAP
	NAME	BUSINESS_CAFE
	USE	GENERIC_ONEROOM
	SPECIAL	RESTAURANT_TABLE
		XSTART	-4
		XEND	4
		YSTART	3
		YEND	10
		ZSTART	0
		ZEND	0
		FREQ	10

OBJECT	SITEMAP
	NAME	BUSINESS_INTERNETCAFE
	USE	BUSINESS_CAFE
	SPECIAL	CAFE_COMPUTER
		XSTART	-4
		XEND	4
		YSTART	3
		YEND	10
		ZSTART	0
		ZEND	0
		FREQ	10

OBJECT	SITEMAP
	NAME	BUSINESS_RESTRICTEDCAFE
	USE	BUSINESS_CAFE
	SPECIAL	CLUB_BOUNCER	
		X	0
		Y	1
		Z	0
	TILE	RESTRICTED
		XSTART	-4
		XEND	4
		YSTART	3
		YEND	10
		ZSTART	0
		ZEND	0

OBJECT	SITEMAP
	NAME	INDUSTRY_SWEATSHOP
	USE	GENERIC_SECURE
	SPECIAL	SWEATSHOP_EQUIPMENT
		XSTART	-12
		XEND	12
		YSTART	3
		YEND	15
		ZSTART	0
		ZEND	0
		FREQ	10
	LOOT	FINECLOTH
		WEIGHT	100

OBJECT	SITEMAP
	NAME	INDUSTRY_POLLUTER
	USE	GENERIC_SECURE	
	SPECIAL	POLLUTER_EQUIPMENT
		XSTART	-12
		XEND	12
		YSTART	3
		YEND	15
		ZSTART	0
		ZEND	0
		FREQ	10
	LOOT	CHEMICAL
		WEIGHT	100

OBJECT	SITEMAP
	NAME	INDUSTRY_NUCLEAR
	USE	GENERIC_SECURE
	UNIQUE	NUCLEAR_ONOFF

OBJECT	SITEMAP
	NAME	GOVERNMENT_INTELLIGENCEHQ
	USE	GENERIC_SECURE
	UNIQUE	INTEL_SUPERCOMPUTER

OBJECT	SITEMAP
	NAME	CORPORATE_HEADQUARTERS
	USE	GENERIC_SECURE
	UNIQUE	CORPORATE_FILES

OBJECT	SITEMAP
	NAME	CORPORATE_HOUSE
	USE	GENERIC_FRONTDOOR
	TILE	GRASSY
		X	-1
		Y	2
	TILE	GRASSY
		X	1
		Y	2
	TILE	EXIT
		X	-2
		YSTART	0
		YEND	1
	TILE	EXIT
		X	2
		YSTART	0
		YEND	1
	TILE	OPEN
		X	0
		YSTART	3
		YEND	5
	TILE	OPEN
		XSTART	-5
		XEND	0
		Y	4
	TILE	OPEN
		XSTART	-8
		XEND	-6
		YSTART	3
		YEND	5
	TILE	GRASSY
		XSTART	-4
		XEND	-1
		Y	3
	TILE	GRASSY
		XSTART	-4
		XEND	-2
		Y	5
	TILE	GRASSY
		XSTART	1
		XEND	4
		YSTART	3
		YEND	4
	TILE	GRASSY
		XSTART	2
		XEND	4
		Y	5
	TILE	DOOR
		X	-7
		Y	6
	TILE	DOOR
		X	0
		Y	6
	TILE	OPEN
		XSTART	-8
		XEND	-4
		YSTART	7
		YEND	9
	TILE	DOOR
		X	-3
		Y	8
	TILE	OPEN
		XSTART	-2
		XEND	2
		YSTART	7
		YEND	9
	TILE	DOOR
		X	3
		Y	8
	TILE	OPEN
		XSTART	4
		XEND	8
		YSTART	7
		YEND	9
	TILE	DOOR
		X	7
		Y	6
	TILE	OPEN
		XSTART	6
		XEND	8
		YSTART	3
		YEND	5
	TILE	DOOR
		X	-7
		Y	10
	TILE	DOOR
		X	7
		Y	10
	TILE	RESTRICTED
		XSTART	-10
		XEND	10
		YSTART	6
		YEND	10
		NOTE	ADD
	TILE	RESTRICTED
		XSTART	5
		XEND	9
		YSTART	2
		YEND	6
		NOTE	ADD
	SCRIPT	ROOM
		XSTART	-12
		XEND	-5
		YSTART	11
		YEND	16
	SCRIPT	ROOM
		XSTART	6
		XEND	13
		YSTART	11
		YEND	16
	TILE	RESTRICTED
		XSTART	-13
		XEND	-5
		YSTART	10
		YEND	17
		NOTE	ADD
	TILE	RESTRICTED
		XSTART	5
		XEND	13
		YSTART	10
		YEND	17
		NOTE	ADD
	TILE	DOOR
		X	-5
		Y	12
	TILE	DOOR
		X	5
		Y	12
	TILE	OPEN
		XSTART	-4
		XEND	4
		Y	12
	TILE	GRASSY
		XSTART	-4
		XEND	4
		Y	11
	TILE	DOOR
		X	0
		Y	13
	SCRIPT	ROOM
		XSTART	-4
		XEND	5
		YSTART	14
		YEND	19
	TILE	OUTDOOR
		XSTART	-4
		XEND	4
		YSTART	3
		YEND	5
		NOTE	ADD
	TILE	OUTDOOR
		XSTART	-4
		YEND	4
		YSTART	11
		YEND	12
		NOTE	ADD
	TILE	RESTRICTED
		XSTART	-4
		XEND	4
		YSTART	13
		YEND	18
		NOTE	ADD
	UNIQUE	HOUSE_PHOTOS
	UNIQUE	HOUSE_CEO

OBJECT	SITEMAP
	NAME	GOVERNMENT_ARMYBASE
	USE	GENERIC_FRONTDOOR
# Entry area
	TILE	GRASSY
		XSTART	-20
		XEND	20
		YSTART	3
		YEND	4
	TILE	GRASSY
		XSTART	-8
		XEND	8
		YSTART	5
		YEND	6
# Blast out rooms
	SCRIPT  ROOM
		XSTART	-28
		XEND	-21
		YSTART	3
		YEND	11
	SCRIPT  ROOM
		XSTART	-20
		XEND	-9
		YSTART	6
		YEND	11
	SCRIPT  ROOM
		XSTART	-8
		XEND	9
		YSTART	8
		YEND	11
	SCRIPT  ROOM
		XSTART	22
		XEND	29
		YSTART	3
		YEND	11
	SCRIPT  ROOM
		XSTART	10
		XEND	21
		YSTART	6
		YEND	11
	SCRIPT  ROOM
		XSTART	-20
		XEND	21
		YSTART	12
		YEND	20
# Add connections
	TILE	DOOR
		X	-21
		Y	4
	TILE	DOOR
		X	21
		Y	4
	TILE	DOOR
		X	-21
		Y	9
	TILE	DOOR
		X	21
		Y	9
	TILE	DOOR
		X	-9
		Y	9
	TILE	DOOR
		X	9
		Y	9
	TILE	DOOR
		X	-1
		Y	7
	TILE	DOOR
		X	1
		Y	7
	TILE	DOOR
		X	-16
		Y	11
	TILE	DOOR
		X	16
		Y	11
# Lock it down
	TILE	RESTRICTED
		XSTART	-28
		XEND	28
		YSTART	3
		YEND	19
		NOTE	ADD
	UNIQUE	ARMYBASE_ARMORY

OBJECT	SITEMAP
	NAME	LABORATORY_GENETICS
	USE	GENERIC_SECURE
	SPECIAL	LAB_GENETIC_CAGEDANIMALS
		XSTART	-12
		XEND	12
		YSTART	3
		YEND	15
		ZSTART	0
		ZEND	0
		FREQ	20
	SPECIAL	LAB_EQUIPMENT
		XSTART	-12
		XEND	12
		YSTART	3
		YEND	15
		ZSTART	0
		ZEND	0
		FREQ	20

OBJECT	SITEMAP
	NAME	LABORATORY_COSMETICS
	USE	GENERIC_SECURE
	SPECIAL	LAB_COSMETICS_CAGEDANIMALS
		XSTART	-12
		XEND	12
		YSTART	3
		YEND	15
		ZSTART	0
		ZEND	0
		FREQ	20
	SPECIAL	LAB_EQUIPMENT
		XSTART	-12
		XEND	12
		YSTART	3
		YEND	15
		ZSTART	0
		ZEND	0
		FREQ	20

OBJECT	SITEMAP
	NAME	GENERIC_LOBBY
	USE	GENERIC_SECURE
	TILE	OPEN
		X	0
		Y	3
		Z	0

OBJECT	SITEMAP
	NAME	GOVERNMENT_POLICESTATION
	USE	GENERIC_LOBBY
	UNIQUE	POLICESTATION_LOCKUP

OBJECT	SITEMAP
	NAME	GOVERNMENT_COURTHOUSE
	USE	GENERIC_LOBBY
	UNIQUE	COURTHOUSE_LOCKUP
	UNIQUE	COURTHOUSE_JURYROOM

OBJECT	SITEMAP
	NAME	GOVERNMENT_PRISON
	USE	GENERIC_LOBBY
	UNIQUE	PRISON_CONTROL_LOW
	SCRIPT	ROOM
		XSTART	-12
		XEND	12
		YSTART	3
		YEND	15
		ZSTART	1
		ZEND	2
	TILE	RESTRICTED
		XSTART	-28
		XEND	28
		YSTART	3
		YEND	19
		ZSTART   1
		ZEND  2
		NOTE	ADD
	UNIQUE	PRISON_CONTROL_MEDIUM
	   Z  1
	UNIQUE	PRISON_CONTROL_HIGH
	   Z  2
	SCRIPT STAIRS_RANDOM
	   XSTART	-28
		XEND	28
		YSTART	3
		YEND	19
		ZSTART   0
		ZEND  2

OBJECT	SITEMAP
	NAME	MEDIA_AMRADIO
	USE	GENERIC_SECURE
	UNIQUE	RADIO_BROADCASTSTUDIO

OBJECT	SITEMAP
	NAME	MEDIA_CABLENEWS
	USE	GENERIC_SECURE
	UNIQUE	NEWS_BROADCASTSTUDIO

# XEND on the hallway script used by the apartment
# block determines the width of the connected
# rooms to either side of the hallway
OBJECT	SITEMAP
	NAME	RESIDENTIAL_APARTMENT
	USE	GENERIC_FRONTDOOR
	TILE	OPEN
	SCRIPT	HALLWAY_YAXIS
		XSTART	0
		XEND	7
		YSTART	3
		YEND	18
		ZSTART	0
		ZEND	6
	TILE	OPEN
		X	0
		YSTART	18
		YEND	19
		ZSTART	0
		ZEND	6
	SCRIPT	STAIRS
		XSTART	-1
		XEND	1
		YSTART	19
		YEND	19
		ZSTART	0
		ZEND	6
	TILE	RESTRICTED
		XSTART	-9
		XEND	-1
		YSTART	3
		YEND	18
		ZSTART	0
		ZEND	6
		NOTE	ADD
	TILE	RESTRICTED
		XSTART	1
		XEND	9
		YSTART	6
		YEND	18
		ZSTART	0
		ZEND	0
		NOTE	ADD
	TILE	RESTRICTED
		XSTART	1
		XEND	9
		YSTART	3
		YEND	18
		ZSTART	1
		ZEND	6
		NOTE	ADD
	SPECIAL	APARTMENT_LANDLORD
		X	2
		Y	5
		Z	0
	SPECIAL	APARTMENT_SIGN
		X	0
		Y	2
		Z	0
		

OBJECT	SITEMAP
	NAME	OUTDOOR_OPEN
	TILE	EXIT
		XSTART	-3
		XEND	3
		YSTART	0
		YEND	6
		ZSTART	0
		ZEND	0
	TILE	OUTDOOR
		XSTART	-2
		XEND	2
		YSTART	1
		YEND	5
		ZSTART	0
		ZEND	0

OBJECT	SITEMAP
	NAME	OUTDOOR_PUBLICPARK
	TILE	EXIT
		XSTART	-5
		XEND	5
		YSTART	0
		YEND	10
	TILE	OUTDOOR
		XSTART	-4
		XEND	4
		YSTART	1
		YEND	9
	TILE	GRASSY
		XSTART	-3
		XEND	-1
		YSTART	2
		YEND	4
		NOTE	ADD
	TILE	GRASSY
		XSTART	1
		XEND	3
		YSTART	2
		YEND	4
		NOTE	ADD
	TILE	GRASSY
		XSTART	1
		XEND	3
		YSTART	6
		YEND	8
		NOTE	ADD
	TILE	GRASSY
		XSTART	-3
		XEND	-1
		YSTART	6
		YEND	8
		NOTE	ADD
	TILE	BLOCK
		XSTART	-4
		XEND	-1
		Y	1
	TILE	BLOCK
		XSTART	1
		XEND	4
		Y	1
	TILE	BLOCK
		XSTART	-4
		XEND	-1
		Y	9
	TILE	BLOCK
		XSTART	1
		XEND	4
		Y	9
	TILE	BLOCK
		X	-4
		YSTART	2
		YEND	4
	TILE	BLOCK
		X	4
		YSTART	2
		YEND	4
	TILE	BLOCK
		X	-4
		YSTART	6
		YEND	8
	TILE	BLOCK
		X	4
		YSTART	6
		YEND	8

OBJECT	SITEMAP
	NAME	OUTDOOR_LATTESTAND
	USE	OUTDOOR_OPEN
	SPECIAL	RESTAURANT_TABLE
		XSTART	-2
		XEND	2
		YSTART	1
		YEND	5
		ZSTART	0
		ZEND	0
		FREQ	10

OBJECT	SITEMAP
	NAME	OUTDOOR_HOMELESS
	TILE	EXIT
		XSTART	-5
		XEND	4
		YSTART	0
		YEND	10
	TILE	OUTDOOR
		XSTART	-4
		XEND	4
		YSTART	1
		YEND	9
	TILE	BLOCK
		X	5
		YSTART	0
		YEND	10
	TILE	GRASSY
		XSTART	-2
		XEND	4
		YSTART	1
		YEND	9
		NOTE	ADD
	SPECIAL	TENT
		XSTART	-3
		XEND	4
		YSTART	1
		YEND	9
		ZSTART	0
		ZEND	0
		FREQ	4