<data>
	<features>
		<featureTemplate r_name="'mainFeatureTemplate'" r_enabled="1" r_shape="'random1'"/>
		<featureTemplate 	r_name="'patternFeatureTemplate'" r_template="'mainFeatureTemplate'"
											r_shape="'asciiPattern'"
											featureIsKnown="0"/>
		<featureTemplate 	r_name="'multiWallFeatureTemplate'" r_template="'patternFeatureTemplate'"
											r_checkConnection="0"/>

		<!-- pattern
			' ' : anything
			'.' : simpleGround
			'#' : simpleWall or nothing
			'=' : simpleWall
			'_' : nothing
		-->	
		<!-- stairs -->
		<featureTemplate 	r_name="'stair1x2NTemplate'" r_template="'multiWallFeatureTemplate'"
											direction="''"
											r_checkConnection="0"
											r_asciiDesignTranslation="asciiDesignTranslation+simplifyArray({{'a','advanced'+direction+'stair1x2N_0'},{'b','advanced'+direction+'stair1x2N_1'}}, 1)"
											r_asciiPattern="{	' # ',
																				'###',
																				'###',
																				' . '}"
											r_asciiDesign="{'   ',
																			'#a#',
																			'#b#',
																			'   '}"/>
		<featureTemplate r_name="'upstair1x2NTemplate'" r_template="'stair1x2NTemplate'" direction="'Up'"/>
		<featureTemplate r_name="'downstair1x2NTemplate'" r_template="'stair1x2NTemplate'" direction="'Down'"/>

		<featureTemplate 	r_name="'stair1x2STemplate'" r_template="'multiWallFeatureTemplate'"
											direction="''"
											r_checkConnection="0"
											r_asciiDesignTranslation="asciiDesignTranslation+simplifyArray({{'a','advanced'+direction+'stair1x2S_0'},{'b','advanced'+direction+'stair1x2S_1'}}, 1)"
											r_asciiPattern="{	' . ',
																				'###',
																				'###',
																				' # '}"
											r_asciiDesign="{'   ',
																			'#a#',
																			'#b#',
																			'   '}"/>
		<featureTemplate r_name="'upstair1x2STemplate'" r_template="'stair1x2STemplate'" direction="'Up'"/>
		<featureTemplate r_name="'downstair1x2STemplate'" r_template="'stair1x2STemplate'" direction="'Down'"/>
		

		<!-- decorative tiles -->
		<featureTemplate 	r_name="'wall2x1Template'" r_template="'multiWallFeatureTemplate'"
											r_enabled="wall2x1count>0"
											r_asciiDesignTranslation="asciiDesignTranslation+eval(simplifyArray({{'a','wall2x1'+mainDesignName+$0+'0'},{'b','wall2x1'+mainDesignName+$0+'1'}}, 1),1D(wall2x1count)-1)"
											r_asciiPattern="{	' ## ',
																				'####',
																				' .. '}"
											r_asciiDesign="{'    ',
																			' ab ',
																			'    '}"/>

		<featureTemplate 	r_name="'wall1x2Template'" r_template="'multiWallFeatureTemplate'"
											r_enabled="wall1x2count>0"
											r_asciiDesignTranslation="asciiDesignTranslation+eval(simplifyArray({{'a','wall1x2'+mainDesignName+$0+'0'},{'b','wall1x2'+mainDesignName+$0+'1'}}, 1),1D(wall1x2count)-1)"
											r_asciiPattern="{	' # ',
																				'###',
																				'###',
																				' . '}"
											r_asciiDesign="{'   ',
																			' a ',
																			' b ',
																			'   '}"/>

		<featureTemplate 	r_name="'wall2x2Template'" r_template="'multiWallFeatureTemplate'"
											r_enabled="wall2x2count>0"
											r_asciiDesignTranslation="asciiDesignTranslation+eval(simplifyArray({{'a','wall2x2'+mainDesignName+$0+'0'},{'b','wall2x2'+mainDesignName+$0+'1'},{'c','wall2x2'+mainDesignName+$0+'2'},{'d','wall2x2'+mainDesignName+$0+'3'}}, 1),1D(wall2x2count)-1)"
											r_asciiPattern="{	' ## ',
																				'####',
																				'####',
																				' .. '}"
											r_asciiDesign="{'    ',
																			' ab ',
																			' cd ',
																			'    '}"/>

		<featureTemplate 	r_name="'wallInner1x1Template'" r_template="'multiWallFeatureTemplate'"
											r_enabled="wallInner1x1count>0"
											featureVariation="featureVariation=(1D4-1)"
											r_asciiDesignTranslation="asciiDesignTranslation+eval(simplifyArray({{'a','wallInner1x1'+mainDesignName+$0},{'b','standardWallInFeature'}}, 1),1D(wallInner1x1count)-1)"
											r_asciiPattern="{{'_ ',' ='},{' _','= '},{'= ',' _'},{' =','_ '}}[featureVariation]"
											r_asciiDesign	="{{'a ',' b'},{' a','b '},{'b ',' a'},{' b','a '}}[featureVariation]"/>
																			
		<featureTemplate 	r_name="'wallInner2x2Template'" r_template="'multiWallFeatureTemplate'"
											r_enabled="wallInner2x2count>0"
											featureVariation="featureVariation=(1D4-1)"
											r_asciiDesignTranslation="asciiDesignTranslation+eval(simplifyArray({{'a','wallInner2x2'+mainDesignName+$0+'0'},{'b','wallInner2x2'+mainDesignName+$0+'1'},{'c','wallInner2x2'+mainDesignName+$0+'2'},{'d','wallInner2x2'+mainDesignName+$0+'3'},{'e','standardWallInFeature'}}, 1),1D(wallInner2x2count)-1)"
											r_asciiPattern="{{'__ ','__ ','  ='},{' __',' __','=  '},{'=  ',' __',' __'},{'  =','__ ','__ '}}[featureVariation]"
											r_asciiDesign	="{{'ab ','cd ','  e'},{' ab',' cd','e  '},{'e  ',' ab',' cd'},{'  e','ab ','cd '}}[featureVariation]"/>
		<!-- rooms -->
		<featureTemplate	r_name="'finalPrison'" r_template="'patternFeatureTemplate'"
											r_mandatory="1"
											r_asciiDesignTranslation="asciiDesignTranslation+simplifyArray({{'a','bloodCultMemberTile'},
																																											{'b','bloodCultLeaderTile'},
																																											{'p','princessTile'},
																																											{'X','downstairPortal'},
																																											{'D','DemonInvocator'},
																																											{'0',(gameParameters.childrenAlive>0)?'kidTile':groundTile},
																																											{'1',(gameParameters.childrenAlive>1)?'kidTile':groundTile},
																																											{'2',(gameParameters.childrenAlive>2)?'kidTile':groundTile},
																																											{'3',(gameParameters.childrenAlive>3)?'kidTile':groundTile},
																																											{'4',(gameParameters.childrenAlive>4)?'kidTile':groundTile},
																																											{'5',(gameParameters.childrenAlive>5)?'kidTile':groundTile},
																																											{'6',(gameParameters.childrenAlive>6)?'kidTile':groundTile},
																																											{'7',(gameParameters.childrenAlive>7)?'kidTile':groundTile}}, 1)"
											r_asciiPattern="{	'      #########      ',
																				'      #       #######',
																				'      #             #',
																				' ######             #',
																				'.#                  #',
																				' ######             #',
																				'      #             #',
																				'      #       #######',
																				'      #########      '}"
											r_asciiDesign="{	'      #########      ',
																				'      #...X...#######',
																				'      #.......#....7#',
																				' ######..a~a..#...53#',
																				'.+....+..~D~b.+..p01#',
																				' ######..a~a..#...42#',
																				'      #.......#....6#',
																				'      #.......#######',
																				'      #########      '}"/>
		
	</features>
</data>