<screen id="CEMETERY" src="swfs/screens/Outside/Cemetery.swf" footstep="Dirt">
	<warning id="LOCATION_CEMETERY"/>
	<unlockRoom id="Outside/Cemetery"/>
	
	<music src="Audio/Music/OUTSIDE/CEMETERY.mp3" fadeIn="10000" channel="MUSIC" loop="true"/>
	<music src="Audio/Ambient/OUTSIDE/CEMETERY.mp3" channel="AMBIENT" fadeIn="5000" loop="true"/>
	
	<goal id="TASK_4_1" remove="true" />
	
	<property type="visible" value="false" assign="object_window" name="thomas" />
	
	
	<!--<property type="visible" value="false" assign="object_window" name="grave_hole" />-->
	<state>
		<requirement type="session" id="M4_MIRROR_PUZZLE_SOLVED" value="true" />
		<requirement type="session" id="M4_GOT_DIRTY_JACKET" value="false" />
		<property type="visible" value="true" assign="object_window" name="grave_hole" />
	</state>
	<state>
		<requirement type="session" id="M4_GOT_DIRTY_JACKET" value="true" />
		<property type="visible" value="false" assign="object_window" name="grave_hole" />
	</state>
	<state>
		<requirement type="session" id="M4_COFFIN_OPENED" value="true"/>
		<property type="visible" value="false" assign="object_window" name="Coffinlid_ON" />
		<property type="visible" value="true" assign="object_window" name="Coffinlid_OFF" />
	</state>
	<state>
		<requirement type="session" id="M4_COFFIN_OPENED" value="false"/>
		<property type="visible" value="true" assign="object_window" name="Coffinlid_ON" />
		<property type="visible" value="false" assign="object_window" name="Coffinlid_OFF" />
	</state>
	<state>
		<requirement type="session" id="M4_GOT_DIRTY_JACKET" value="true" />	
		<requirement type="session" id="M5_POWER_RESTORED" value="false" />	
		<property type="visible" value="true" assign="object_window" name="thomas" />
	</state>

	<state>
		<requirement type="session" id="M4_GOT_DIRTY_JACKET" value="true" />
		<requirement type="session" id="M4_THOMAS_MOURNING" value="false" />
		
		<speech>
			<text src="images/characters/thomas.png" speaker_name="THOMAS" string="M4_THOMAS_CHRISTINE_CEMETERY_1"  audio="Audio/Speech/Outside/Cemetery/4_14_1.mp3"/>
			<text src="images/characters/christine.png" speaker_name="CHRISTINE" string="M4_THOMAS_CHRISTINE_CEMETERY_2" audio="Audio/Speech/Outside/Cemetery/4_14_2.mp3"/>
			<text src="images/characters/thomas.png" speaker_name="THOMAS" string="M4_THOMAS_CHRISTINE_CEMETERY_3"  audio="Audio/Speech/Outside/Cemetery/4_14_3.mp3"/>
			<text src="images/characters/christine.png" speaker_name="CHRISTINE" string="M4_THOMAS_CHRISTINE_CEMETERY_4" audio="Audio/Speech/Outside/Cemetery/4_14_4.mp3"/>
			<text src="images/characters/thomas.png" speaker_name="THOMAS" string="M4_THOMAS_CHRISTINE_CEMETERY_5"  audio="Audio/Speech/Outside/Cemetery/4_14_5.mp3"/>
			<text src="images/characters/christine.png" speaker_name="CHRISTINE" string="M4_THOMAS_CHRISTINE_CEMETERY_6" audio="Audio/Speech/Outside/Cemetery/4_14_6.mp3"/>
			<finish>		
				<session id="M4_THOMAS_MOURNING"/>		
				<session id="ACTIVE_MISSION" value="5" />
				<cinematic id="M4_LEAVE_THOMAS_ALONE"/>
			</finish>
		</speech>
	</state>
	
	
	<state>
		<requirement type="session" id="M4_LIGHTHOUSE_POWERED" value="false" />	
		<property type="visible" value="false" assign="object_window" name="light_beam" />
	</state>
	
	<state>
		<requirement type="session" id="M4_GOT_DIRTY_JACKET" value="false" />
		<requirement type="session" id="M4_MIRROR_PUZZLE_SOLVED" value="true" />
		<goal id="TASK_4_6" priority="4" />
	</state>
	
	<state>
		<requirement type="session" id="VISITED_CEMETERY" value="false"/>
		<session id="VISITED_CEMETERY"/>
		<goal id="TASK_4_3" priority="3" />
	</state>	
	
	<state>
		<requirement type="session" id="M4_MIRROR_PUZZLE_SOLVED"/>
		
		<!--<object name="Mirror_area_1" mouseEnabled="false"/>
		<object name="Mirror_area_2" mouseEnabled="false"/>
		<object name="Mirror_area_3" mouseEnabled="false"/>
		<object name="Mirror_area_4" mouseEnabled="false"/>
		<object name="Mirror_area_5" mouseEnabled="false"/>-->
		
		
		
		<property type="frame" value="solved" assign="active_screen" name="Mirror_area_1" stop="true" />
		<property type="frame" value="solved" assign="active_screen" name="Mirror_area_2" stop="true" />
		<property type="frame" value="solved" assign="active_screen" name="Mirror_area_3" stop="true" />
		<property type="frame" value="solved" assign="active_screen" name="Mirror_area_4" stop="true" />
		<property type="frame" value="solved" assign="active_screen" name="Mirror_area_5" stop="true" />
		
		
		<property type="frame" value="solved" assign="active_screen" name="light1" stop="true" />
		<property type="frame" value="solved" assign="active_screen" name="light2" stop="true" />
		<property type="frame" value="solved" assign="active_screen" name="light3" stop="true" />
		<property type="frame" value="solved" assign="active_screen" name="light4" stop="true" />
		<property type="frame" value="solved" assign="active_screen" name="light5" stop="true" />
		
		<requirement type="session" id="M4_FIRST_TIME_AFTER_MIRROR_PUZZLE_SOLVED" value="false" />
		
		<fadeIn assign="active_screen" name="light_beam" start="0.4" time="600" delay="0" />
		<fadeIn assign="active_screen" name="light4" start="0.4" time="600" delay="600" />
		<fadeIn assign="active_screen" name="light1" start="0.4" time="600" delay="1200" />
		<fadeIn assign="active_screen" name="light2" start="0.4" time="600" delay="1800" />
		<fadeIn assign="active_screen" name="light3" start="0.4" time="600" delay="2400" />		
		<fadeIn assign="active_screen" name="light5" start="0.4" time="600" delay="3000" />
		
		
		<sound src="Audio/SFX/PUZZLES/mirror_complete.mp3" />
		<session id="M4_FIRST_TIME_AFTER_MIRROR_PUZZLE_SOLVED"/>
	</state>
	
	<!--<state>
		<requirement type="session" id="M4_MIRROR_PUZZLE_SOLVED"/>
		<requirement type="session" id="PICKED_MIRROR" value="false" />
		<item name="mirror1" id="MIRROR" src="images/items/coin.png"/>
		
		<session id="PICKED_MIRROR"/>
	</state>-->

	<state>
		<requirement type="session" id="M4_LIGHTHOUSE_POWERED" value="true"/>
		<requirement type="session" id="M4_MIRROR_PUZZLE_SOLVED" value="false"/>
		<error id="MG_MIRROR_INSTRUCTION_0" />
		<minigame src="swfs/minigames/mirror.swf">
			<hint id="MG_MIRROR_HINT_0"/>	
			<hint id="MG_MIRROR_INSTRUCTION_0"/>
			<warning id="MG_MIRROR_HINT_0"/>
			<hint id="MG_MIRROR_HINT_1"/>
			<prize>		
				<goal id="TASK_4_5" remove="true" />
				<session id="M4_MIRROR_PUZZLE_SOLVED" />	
				<portal target="Outside/CEMETERY"/>	
			</prize>
			<leave>
				<portal target="Outside/OUTDOOR_PATHWAY"/>			
			</leave>
		</minigame>
		
	</state>

	
	
	
	


	<object name="thomas" id="THOMAS" cursor="hand">
		<event type="clicked">				
			<requirement type="session" id="M4_THOMAS_MOURNING" value="true" />	
			<requirement type="session" id="M5_POWER_RESTORED" value="false" />
			
			<speech>
				<text src="images/characters/thomas.png" speaker_name="THOMAS" string="M4_THOMAS_CHRISTINE_CEMETERY_7"  audio="Audio/Speech/Outside/Cemetery/4_14_8.mp3"/>
				<finish>		
					
				</finish>
			</speech>
		</event>
	</object>
	
	<object name="HO_area" id="HO_AREA" cursor="hand" tooltip="LOCATION_GRAVE_HO">
		<state>
			<requirement type="session" id="M4_CEMETERY_UNLOCKED"/>
			<requirement type="session" id="SOLVED_CEMETERY" value="false"/>
			<object name="HO_area" id="HO_AREA" cursor="spyglass" />
			<poi value="on" target="active_screen" object="HO_area"/>
		</state>	
		<state>
			<requirement type="session" id="M4_GOT_MIRROR_4"/>
			<requirement type="session" id="SOLVED_CEMETERY_2" value="false"/>
			<requirement type="session" id="M4_THOMAS_DIALOGUE_3_VIEWED"/>
			<object name="HO_area" id="HO_AREA" cursor="spyglass" />
			<poi value="on" target="active_screen" object="HO_area"/>
		</state>
		
		<event type="clicked">
			<requirement type="session" id="M4_CEMETERY_UNLOCKED"/>	
			<requirement type="session" id="SOLVED_CEMETERY" value="false"/>
			<portal target="HO_SCREEN/HO_CEMETERY" hidden_screen="true"/>
		</event>
		<event type="clicked">
			<requirement type="session" id="M4_GOT_MIRROR_4"/>
			<requirement type="session" id="SOLVED_CEMETERY_2" value="false"/>
			<requirement type="session" id="M4_CEMETERY_UNLOCKED"/>	
			<requirement type="session" id="M4_THOMAS_DIALOGUE_3_VIEWED"/>	
			<portal target="HO_SCREEN/HO_CEMETERY" hidden_screen="true" />
		</event>
		<event type="clicked">
			<requirement type="session" id="SOLVED_CEMETERY"/>	
			<requirement type="session" id="M4_MIRROR_PUZZLE_SOLVED" value="false" />	
			<warning id="CEMETERY_AREA3"/>
		</event>	
		<event type="clicked">
			<requirement type="session" id="SOLVED_CEMETERY_2"/>	
			<requirement type="session" id="M4_MIRROR_PUZZLE_SOLVED" value="true" />	
			<warning id="CEMETERY_AREA3"/>
		</event>	
	</object>
	
	
	<object name="nav_pathway" id="NAV_PATHWAY" cursor="south" tooltip="LOCATION_OUTDOOR_PATHWAY_TO">
		<event type="clicked">
			<portal target="Outside/OUTDOOR_PATHWAY"/>
		</event> 				
	</object>
	

	
		
		

	<object name="grave_hole" id="GRAVE_HOLE" cursor="spyglass" >
		<state>
			<requirement type="session" id="M4_MIRROR_PUZZLE_SOLVED" value="true" />
			<requirement type="session" id="M4_GOT_VALVE" value="false" />
			<requirement type="session" id="M4_GOT_DIRTY_JACKET" value="false" />
			<delay time="3000"/>
			<poi value="on" target="active_screen" object="grave_hole" align="origin" type="single" />
		</state>
		
		<event type="clicked">
			
		</event>
		<event type="clicked">
			<requirement type="session" id="M4_GOT_DIRTY_JACKET" value="false" />	
			<window src="swfs/windows/grave_hole.swf">
				<property type="visible" value="false" assign="object_window" name="dirt_dark" />
				
				<state>
					<requirement type="session" id="M4_MIRROR_PUZZLE_SOLVED" value="false" />
					<property type="visible" value="false" assign="object_window" name="Light" />
					<property type="visible" value="true" assign="object_window" name="dirt_dark" />
				</state>
				<state>
					<requirement type="session" id="M4_SHOVEL_USED"/>	
					<property type="frame" value="active" stop="true" assign="object_window" name="dirt" />
					
				</state>
				<object name="overlay" cursor="hand">
					<event type="clicked">
						<requirement type="session" id="M4_MIRROR_PUZZLE_SOLVED" value="false" />
						<warning id="GRAVE_HOLE_TOO_DARK"/>
					</event>
					
					<event type="clicked">
						<requirement type="session" id="M4_SHOVEL_USED" />
						<item name="dirty_jacket" id="DIRTY_JACKET" src="images/items/dirty_jacket.png" large_src="images/items/dirty_jacket_large.png" />
						<items_collected>
							<session id="M4_GOT_DIRTY_JACKET"/>
							<goal id="TASK_4_6" remove="true" />
							<goal id="TASK_4_7" priority="8" />
							<item remove="true" id="SHOVEL"/>
							<session id="M4_THOMAS_MOURNING"/>		
							<session id="ACTIVE_MISSION" value="5" />
							
							<poi value="off" target="active_screen" object="grave_hole" align="right" />
							<property type="visible" value="true" assign="active_screen" name="thomas" />
							<closeWindow/>
							<property type="visible" value="false" assign="active_screen" name="grave_hole" />
							<speech>
								<text src="images/characters/thomas.png" speaker_name="THOMAS" string="M4_THOMAS_CHRISTINE_CEMETERY_1"  audio="Audio/Speech/Outside/Cemetery/4_14_1.mp3"/>
								<text src="images/characters/christine.png" speaker_name="CHRISTINE" string="M4_THOMAS_CHRISTINE_CEMETERY_2" audio="Audio/Speech/Outside/Cemetery/4_14_2.mp3"/>
								<text src="images/characters/thomas.png" speaker_name="THOMAS" string="M4_THOMAS_CHRISTINE_CEMETERY_3"  audio="Audio/Speech/Outside/Cemetery/4_14_3.mp3"/>
								<text src="images/characters/christine.png" speaker_name="CHRISTINE" string="M4_THOMAS_CHRISTINE_CEMETERY_4" audio="Audio/Speech/Outside/Cemetery/4_14_4.mp3"/>
								<text src="images/characters/thomas.png" speaker_name="THOMAS" string="M4_THOMAS_CHRISTINE_CEMETERY_5"  audio="Audio/Speech/Outside/Cemetery/4_14_5.mp3"/>
								<text src="images/characters/christine.png" speaker_name="CHRISTINE" string="M4_THOMAS_CHRISTINE_CEMETERY_6" audio="Audio/Speech/Outside/Cemetery/4_14_6.mp3"/>
								<finish>		
									<cinematic id="M4_LEAVE_THOMAS_ALONE"/>
								</finish>
							</speech>
						</items_collected>
					</event>
					<event type="clicked">	
						<requirement type="session" id="M4_MIRROR_PUZZLE_SOLVED" value="true" />
						<requirement type="session" id="M4_GOT_DIRTY_JACKET" value="false" />	
						<requirement type="session" id="M4_SHOVEL_USED" value="false" />	
						<requirement type="holding_item" id="SHOVEL" warning="GRAVE_HOLE_NEED_A_SHOVEL" />		
						<sound src="Audio/SFX/OUTSIDE/cemetery_shovel_digging.mp3" />
						<session id="M4_SHOVEL_USED"/>
						<item remove="true" id="SHOVEL"/>
						
						<property type="frame" value="activate" stop="false" assign="object_window" name="dirt" />
						<!--
						
						<delay time="2000"/>
						<closeWindow/>
						<window src="swfs/windows/dirty_jacket.swf">
							<event type="clicked">
								<requirement type="session" id="M4_GOT_DIRTY_JACKET" value="false" />	
							</event>						
							<event type="clicked">
								<requirement type="session" id="M4_GOT_DIRTY_JACKET" value="false" />	
								
							</event>
						</window>-->
					</event>
				</object> 
				
			</window>	
		</event> 				
	</object>
	
	
	
	<state>
		<requirement type="session" id="M4_GOT_AUDIOTAPE_8" value="false"/>
		<object name="coffin" id="COFFIN" cursor="spyglass"/>
		<poi value="on" target="active_screen" object="coffin" type="single" />
	</state>
	<state>
		<requirement type="session" id="M4_GOT_AUDIOTAPE_8" value="true"/>
		<object name="coffin" id="COFFIN" cursor="default"/>
		<poi value="off" target="active_screen" object="coffin" type="single" />
	</state>
	<object name="coffin" id="COFFIN">
		<event type="clicked">
			<requirement type="session" id="M4_GOT_AUDIOTAPE_8" value="false"/>
			<window src="swfs/windows/coffin.swf">
				<state>
					<requirement type="session" id="M4_COFFIN_OPENED"/>
					<property type="frame" value="done" stop="true" assign="object_window" name="lid" />
				</state>
				<object name="lid" basic="true" cursor="hand">
					<event type="clicked">						
						<requirement type="session" id="M4_COFFIN_OPENED" value="false" />
						<sound src="Audio/SFX/OUTSIDE/coffin_sliding_open.mp3" />
						<poi value="off" target="active_screen" object="coffin"/>
						<property type="frame" value="activate" stop="false" assign="object_window" name="lid" />
						<property type="visible" value="false" assign="active_screen" name="Coffinlid_ON" />
						<property type="visible" value="true" assign="active_screen" name="Coffinlid_OFF" />
						
					</event>
					<event type="frame" value="done">
						<session id="M4_COFFIN_OPENED"/>
					</event>		
					<event type="clicked">
						<requirement type="session" id="M4_COFFIN_OPENED"/>
						<requirement type="session" id="M4_GOT_AUDIOTAPE_8" value="false"/>
						<session id="M4_GOT_AUDIOTAPE_8"/>
						<unlockAudioTape id="8"/>
						<show_book tab="3"/>
						<poi value="off" target="active_screen" object="coffin" type="single" />
						<object name="coffin" id="COFFIN" assign="active_screen" cursor="default"/>
						<closeWindow/>
						<sound src="Audio/SFX/GAME/tape_collected.mp3" />
					</event>
				</object>
				
				
				
				<!--<object name="cassette" basic="true" cursor="hand">
					<event type="clicked">
						<session id="M4_GOT_AUDIOTAPE_8"/>
						<unlockAudioTape id="8"/>
						<show_book tab="3"/>
						<closeWindow/>
						<sound src="Audio/SFX/GAME/tape_collected.mp3" />
					</event>					
				</object>-->
				
						
			</window>	
		</event> 				
	</object>
	
	<object name="Mirror_area_1" id="MIRROR_AREA_1" basic="true" >
		<state>
			<requirement type="session" id="M4_MIRROR_PUZZLE_SOLVED" value="false"/>
			<object name="Mirror_area_1" id="MIRROR_AREA_1" cursor="hand" />
		</state>
		<event type="clicked">
			<requirement type="session" id="M4_MIRROR_PUZZLE_SOLVED" value="false"/>
			<warning id="CEMETERY_AREA1"/>
		</event>		
	</object>
	<object name="Mirror_area_2" id="MIRROR_AREA_2" basic="true" >
		<state>
			<requirement type="session" id="M4_MIRROR_PUZZLE_SOLVED" value="false"/>
			<object name="Mirror_area_2" id="MIRROR_AREA_2" cursor="hand" />
		</state>
		<event type="clicked">
			<requirement type="session" id="M4_MIRROR_PUZZLE_SOLVED" value="false"/>
			<warning id="CEMETERY_AREA1"/>
		</event>		
	</object>
	<object name="Mirror_area_3" id="MIRROR_AREA_3" basic="true">
		<state>
			<requirement type="session" id="M4_MIRROR_PUZZLE_SOLVED" value="false"/>
			<object name="Mirror_area_3" id="MIRROR_AREA_3" cursor="hand" />
		</state>
		<event type="clicked">
			<requirement type="session" id="M4_MIRROR_PUZZLE_SOLVED" value="false"/>
			<warning id="CEMETERY_AREA1"/>
		</event>		
	</object>
	<object name="Mirror_area_4" id="MIRROR_AREA_4" basic="true">
		<state>
			<requirement type="session" id="M4_MIRROR_PUZZLE_SOLVED" value="false"/>
			<object name="Mirror_area_4" id="MIRROR_AREA_4" cursor="hand" />
		</state>
		<event type="clicked">
			<requirement type="session" id="M4_MIRROR_PUZZLE_SOLVED" value="false"/>
			<warning id="CEMETERY_AREA1"/>
		</event>		
	</object>
	<object name="Mirror_area_5" id="MIRROR_AREA_5" basic="true" cursor="hand">
		<state>
			<requirement type="session" id="M4_MIRROR_PUZZLE_SOLVED" value="false"/>
			<object name="Mirror_area_5" id="MIRROR_AREA_5" cursor="hand" />
		</state>
		<event type="clicked">
			<requirement type="session" id="M4_MIRROR_PUZZLE_SOLVED" value="false"/>
			<warning id="CEMETERY_AREA1"/>
		</event>		
	</object>
	<object name="Lighthouse" id="LIGHTHOUSE" basic="true" cursor="hand">
		<event type="clicked">
			<warning id="CEMETERY_AREA2"/>
		</event>		
	</object>


	<object name="light1" disable_mouse="true"/>
	<object name="light2" disable_mouse="true"/>
	<object name="light3" disable_mouse="true"/>
	<object name="light4" disable_mouse="true"/>
	<object name="light5" disable_mouse="true"/>
	
</screen>