<screen id="MAIN_ENTRANCE_2" src="swfs/screens/Outside/Main Entrance 2.swf" footstep="CobbleStone">
	<unlockRoom id="Outside/Main_Entrance_2"/>
	<unlockMap id="Outside/MAIN_ENTRANCE_2"/>
	<unlockMap id="Outside/GARDEN"/>
	
	<warning id="LOCATION_OUTSIDE_MAIN_ENTRANCE_2"/>
	
	<music src="Audio/Music/OUTSIDE/DOCK.mp3" fadeIn="5000" channel="MUSIC" loop="true"/>
	<music src="Audio/Ambient/OUTSIDE/MAIN_ENTRANCE_2.mp3" channel="AMBIENT" fadeIn="5000" loop="true"/>
	
	<!--Complete task of unlocking gate-->
	
	
	
	<property type="visible" value="false" assign="object_window" name="thomas" />
	
	<state>
		<requirement type="session" id="SOLVED_FOUNTAIN"/>
		<requirement type="session" id="M1_FILLED_BUCKET"/>
		<property type="visible" value="true" assign="object_window" name="fountain_area" />
		<object name="fountain" basic="true" assign="active_screen" cursor="default"/>
		<poi value="off" target="active_screen" object="fountain" align="right" />
	</state>
	
	
	<state>
		<requirement type="session" id="M1_DOOR_ANIMATION"/>	
		<property type="visible" value="false" assign="active_screen" name="open_door" />
		<property type="visible" value="true" assign="active_screen" name="door_open" />
	</state>
	<state>
		<requirement type="session" id="M1_DOOR_ANIMATION" value="false" />	
		<property type="visible" value="false" assign="object_window" name="door_open" />
	</state>
	<state>
		<requirement type="session" id="M1_MAIN_ENTRANCE_VISITED" value="false" />	
		<session id="M1_MAIN_ENTRANCE_VISITED" />	
		<goal id="TASK_1_4" priority="3" />
	</state>
	<state>
		<requirement type="session" id="M1_VINCENT_EVENT_VIEWED" value="false" />	
		<property type="visible" value="false" assign="object_window" name="broken_window" />
	</state>
	<state>
		<requirement type="session" id="M1_VINCENT_EVENT_VIEWED" value="true" />	
		<property type="visible" value="true" assign="object_window" name="broken_window" />
		<property type="visible" value="false" assign="object_window" name="animation" />
	</state>
	<state>
		<requirement type="session" id="M1_ROTATING_SYMBOLS_SOLVED" value="true" />	
		<requirement type="session" id="M1_DOOR_ANIMATION" value="false" />	
		<property type="frame" value="activate" stop="false" assign="active_screen" name="open_door" />
		<session id="M1_DOOR_ANIMATION" />	
		<sound src="Audio/SFX/OUTSIDE/main_entrance_2_door_open.mp3" />
	</state>
	
	
	<!--
	<state>
		<requirement type="session" id="M1_GOT_SHEARS"/>
		<requirement type="session" id="M1_GOT_LOG" value="false"/>
		<poi value="on" target="active_screen" object="nav_Garden" align="right" />
	</state>
	-->
	
	<state>
		<!--<requirement type="session" id="M1_ROTATING_SYMBOLS_SOLVED" value="false" />
		<property type="visible" value="false" assign="object_window" name="door_open" />-->
	</state>
	
	<state>
		<requirement type="session" id="M1_ROTATING_SYMBOLS_SOLVED"/>
		<requirement type="session" id="M1_CUTSCENE_2_PLAYED" value="false" />
		<!-- <cinematic id="CUTSCENE 2"/>-->
		<session id="M1_CUTSCENE_2_PLAYED"/>
		<!-- enter the asylum task -->
	</state>
	
		
	<object name="nav_Main_Hall" id="NAV_MAIN_HALL" cursor="north" tooltip="LOCATION_MAINHALL_TO">	
		<!--
		<state>
			<requirement type="session" id="M1_MOON_GEM" value="true"/>
			<requirement type="session" id="M1_ROTATING_SYMBOLS_SOLVED" value="false"/>
			<poi value="on" target="active_screen" object="nav_Main_Hall" align="right" />
		</state>
		-->
		<state>
			<requirement type="session" id="M1_ROTATING_SYMBOLS_SOLVED" value="false"/>
			<object name="nav_Main_Hall" id="NAV_MAIN_HALL" cursor="puzzle"/>
		</state>
		<!--<state>
			<requirement type="session" id="M1_GEM_CLEARED" value="false" />
			<goal id="TASK_1_3" priority="2"/>
		</state>-->
		
		<event type="clicked">

			<requirement type="session" id="M1_ROTATING_SYMBOLS_SOLVED" value="false" />	
			<requirement type="session" id="M1_DIALOGUE_1" value="true" />
			<requirement type="session" id="M1_VICTOR_EVENT_VIEWED" value="true"/>
			<minigame src="swfs/minigames/RotateDials.swf">

					
				<!--
				<hint id="MG_ROTATING_PUZZLE_HINT_1"/>	
				<hint id="MG_ROTATING_PUZZLE_HINT_0"/>
				-->
				<prize>		
					<session id="M1_ROTATING_SYMBOLS_SOLVED" />	
					<portal target="Outside/MAIN_ENTRANCE_2"/>	
				</prize>
				<leave>
					<portal target="Outside/MAIN_ENTRANCE_2"/>			
				</leave>
				
			</minigame>
			<requirement type="session" id="MG_RDIALS_DROPPED" value="true" />
			<error id="MG_ROTATING_PUZZLE_HINT_0" />
		</event>

		<event type="clicked">

			<requirement type="session" id="M1_ROTATING_SYMBOLS_SOLVED" value="false" />	
			<requirement type="session" id="M1_DIALOGUE_1" value="false" />
			<requirement type="session" id="M1_VICTOR_EVENT_VIEWED" value="false"/>
			<requirement type="session" id="M1_VINCENT_EVENT_VIEWED" value="true"/>
			<minigame src="swfs/minigames/RotateDials.swf">
				
					
				<hint id="MG_ROTATING_PUZZLE_HINT_1"/>	
				<hint id="MG_ROTATING_PUZZLE_HINT_0"/>
				<prize>		
					<session id="M1_ROTATING_SYMBOLS_SOLVED" />	
					<portal target="Outside/MAIN_ENTRANCE_2"/>	
				</prize>
				<leave>
					<portal target="Outside/MAIN_ENTRANCE_2"/>			
				</leave>
				
			</minigame>
			<requirement type="session" id="MG_RDIALS_DROPPED" value="true" />
			<error id="MG_ROTATING_PUZZLE_HINT_0" />
		</event>
		
		<event type="clicked">
			<requirement type="session" id="M1_ROTATING_SYMBOLS_SOLVED"/>	
			<requirement type="session" id="ACTIVE_MISSION" value="1"/>	
			
			<fadeOutMusic/>
			<music src="Audio/Music/CUTSCENES/cutscene_2.mp3" fadeIn="500" channel="CUTSCENE" loop="false" />
			<cutscene src="swfs/cutscenes/cutscene2.swf" border="false">
				<finish>		
					<portal target="Floor1/MAIN_HALL" />
					<session id="M1_CUTSCENE_PLAYED"/>
					<session id="ACTIVE_MISSION" value="2"/>
				</finish>
			</cutscene>	
		</event>

		<event type="clicked">
			<requirement type="session" id="M1_ROTATING_SYMBOLS_SOLVED"/>	
			<requirement type="session" id="M1_CUTSCENE_PLAYED"/>
			<portal target="Floor1/MAIN_HALL" />
		</event>
	</object>
	<object name="nav_MainEntrance" id="NAV_MAINENTRANCE" cursor="south" tooltip="LOCATION_MAINENTRANCE_TO">
		<event type="clicked">
			<requirement type="session" id="M1_VINCENT_EVENT_VIEWED" />
			<requirement type="session" id="M1_DIALOGUE_1" value="false" />
			<portal target="Outside/MAIN_ENTRANCE"/>
		</event> 
		<event type="clicked">
			<requirement type="session" id="M1_DIALOGUE_1" value="true" />
			<requirement type="session" id="M1_VICTOR_EVENT_VIEWED" value="true"/>
			<portal target="Outside/MAIN_ENTRANCE"/>
		</event> 	
	</object>
	<object name="nav_Garden" id="NAV_GARDEN" cursor="west" tooltip="LOCATION_GARDEN_TO">
		<event type="clicked">
			<requirement type="session" id="M1_DIALOGUE_1" value="false" />
			<requirement type="session" id="M1_VINCENT_EVENT_VIEWED" />
			<portal target="Outside/GARDEN"/>
		</event> 		
		<event type="clicked">
			<requirement type="session" id="M1_DIALOGUE_1" value="true" />
			<requirement type="session" id="M1_VICTOR_EVENT_VIEWED" value="true"/>
			<portal target="Outside/GARDEN"/>
		</event> 
	</object>

	<object name="animation">
		<event type="frame" value="break">
			<sound src="Audio/SFX/OUTSIDE/main_entrance_2_window.mp3" />			
		</event>
	</object>
	
	<state>
		<requirement type="session" id="M1_VINCENT_EVENT_VIEWED"/>
		<property type="frame" value="completed" stop="true" assign="object_window" name="animation" />
	</state>
	<state>
		<requirement type="session" id="M1_VINCENT_EVENT_VIEWED" value="false"/>
		<property type="frame" value="activate" stop="false" assign="object_window" name="animation" />
		<delay time="2500" force="true" />
		<cinematic id="VINCENT_BREAK_OUT_OF_WINDOW" />
		<session id="M1_VINCENT_EVENT_VIEWED" />
	</state>
	
	
	
	
	
	<!-- 
	<state>
		<requirement type="session" id="SOLVED_FOUNTAIN_2" value="false"/>
		<requirement type="session" id="M2_GOT_RAG"/>

		<poi value="on" target="active_screen" object="fountain"/>
	</state>-->
	
	
	<object name="fountain" basic="true" tooltip="LOCATION_FOUNTAIN">
		<state>
			<requirement type="session" id="SOLVED_FOUNTAIN" value="false"/>
			<object name="fountain" basic="true" cursor="spyglass"/>
			<property type="visible" value="false" assign="object_window" name="fountain_area" />
			<poi value="on" target="active_screen" object="fountain" align="origin" />
		</state>
		<state>
			<requirement type="session" id="SOLVED_FOUNTAIN" />
			<requirement type="session" id="SOLVED_FOUNTAIN_2" value="false"/>
			<requirement type="session" id="M5_VALVE_TURNED" />
			<property type="visible" value="false" assign="object_window" name="fountain_area" />
			<object name="fountain" basic="true" cursor="spyglass"/>
			<poi value="on" target="active_screen" object="fountain" align="origin"/>
		</state>
		<state>
			<requirement type="session" id="M1_GOT_BUCKET" value="true"/>
			<requirement type="session" id="SOLVED_FOUNTAIN" />
			<requirement type="session" id="M1_FILLED_BUCKET" value="false"/>
			<property type="visible" value="false" assign="object_window" name="fountain_area" />
			<object name="fountain" basic="true" cursor="hand"/>
			<!--<poi value="on" target="active_screen" object="fountain" align="right" />-->
		</state>
			<state>
			<requirement type="session" id="M1_GOT_BUCKET" value="true"/>
			<requirement type="session" id="SOLVED_FOUNTAIN" value="false" />
			<requirement type="session" id="M1_FILLED_BUCKET" value="false"/>
			<property type="visible" value="false" assign="object_window" name="fountain_area" />
			<object name="fountain" basic="true" cursor="spyglass"/>
			<!--<poi value="on" target="active_screen" object="fountain" align="right" />-->
		</state>
		
		<event type="clicked">
			<requirement type="session" id="M1_DIALOGUE_1" value="true" />
			<requirement type="session" id="M1_VICTOR_EVENT_VIEWED" value="true"/>
			<requirement type="session" id="M1_VINCENT_EVENT_VIEWED"/>
			<requirement type="holding_item" id="BUCKET" value="false" />
			<requirement type="session" id="SOLVED_FOUNTAIN" value="false"/>
			<portal target="HO_SCREEN/HO_FOUNTAIN" hidden_screen="true" />
		</event> 
		<event type="clicked">
			<requirement type="session" id="M1_DIALOGUE_1" value="false" />
			<requirement type="session" id="M1_VINCENT_EVENT_VIEWED"/>
			<requirement type="holding_item" id="BUCKET" value="false" />
			<requirement type="session" id="SOLVED_FOUNTAIN" value="false"/>
			<portal target="HO_SCREEN/HO_FOUNTAIN" hidden_screen="true" />
		</event> 
		<event type="clicked">
			<requirement type="session" id="M1_VINCENT_EVENT_VIEWED" />
			<requirement type="session" id="SOLVED_FOUNTAIN" />
			<requirement type="session" id="SOLVED_FOUNTAIN_2" value="false"/>
			<requirement type="session" id="M5_VALVE_TURNED" />
			<portal target="HO_SCREEN/HO_FOUNTAIN" hidden_screen="true" />
		</event> 
		<event type="clicked">
			<requirement type="session" id="SOLVED_FOUNTAIN"/>
			<requirement type="item" id="BUCKET" />
			<requirement type="holding_item" id="BUCKET" value="false" />
			<warning id="ERROR_FILL_BUCKET_WITH_WATER" />
		</event>
		<event type="clicked">
			<!--<requirement type="session" id="SOLVED_FOUNTAIN"/>-->
			<requirement type="holding_item" id="BUCKET" />
			<item remove="true" id="BUCKET" />		
			<item name="filled_bucket" id="FILLED_BUCKET" src="images/items/filled_bucket.png" large_src="images/items/filled_bucket_large.png" />
			
			<sound src="Audio/SFX/OUTSIDE/main_entrance_2_bucket_water.mp3" />
			<items_collected>
				<session id="M1_FILLED_BUCKET"/>
				<requirement type="session" id="SOLVED_FOUNTAIN"/>
				<property type="visible" value="true" assign="object_window" name="fountain_area" />
				<object name="fountain" basic="true" assign="active_screen" cursor="default"/>
				<poi value="off" target="active_screen" object="fountain" align="right" />
			</items_collected>	
		</event>
		<event type="clicked">
			<requirement type="item" id="RAG" />
			<requirement type="holding_item" id="RAG" value="false" />
			<warning id="WET_RAG_WITH_WATER" />
		</event>
		<event type="clicked">
			<requirement type="holding_item" id="RAG" />
			<item remove="true" id="RAG" />		
			<item name="wet_rag" id="WET_RAG" src="images/items/wet_rag.png" />
			<!--<poi value="off" target="active_screen" object="fountain"/>-->
			<items_collected>
				<session id="M1_GOT_WET_RAG"/>
				
			</items_collected>	
		</event>
	</object>
	<state>
		<requirement type="session" id="M1_DIALOGUE_1"/>
		<requirement type="session" id="M1_VICTOR_EVENT_VIEWED" value="false"/>
		<property type="frame" value="activate" stop="false" assign="active_screen" name="victor" />
		<sound src="Audio/SFX/OUTSIDE/main_entrance_2_victor.mp3"/>		
		
		<object name="victor">
			<event type="frame" value="active">			
				<delay time="1000"/>
				<session id="M1_VICTOR_EVENT_VIEWED" />
				<cinematic id="VICTOR_WATCHING_FROM_BROKEN_WINDOW" />
			</event>
		</object>
	</state>
	<state>
		<requirement type="session" id="M1_VINCENT_EVENT_VIEWED"/>
		<requirement type="session" id="M1_GOT_AUDIO_TAPE_1" value="false"/>
		<poi value="on" target="active_screen" object="plaque" align="origin" type="single" />
	</state>
	<state>
		<requirement type="session" id="M1_GOT_AUDIO_TAPE_1"/>
		<property type="visible" value="false" assign="object_window" name="plaque" />
	</state>
	<object name="plaque" id="PLAQUE" cursor="spyglass">
		<event type="clicked">
			<window src="swfs/windows/plaque.swf">
				<state>
					<requirement type="session" id="M1_GOT_AUDIO_TAPE_1" value="true"/>
					<property type="visible" value="false" assign="object_window" name="audiotape" />
				</state>
				<object name="audiotape" id="AUDIOTAPE" cursor="hand" >
					<event type="clicked">
						<requirement type="session" id="M1_GOT_AUDIO_TAPE_1" value="false"/>
						<requirement type="session" id="M1_VINCENT_EVENT_VIEWED"/>
						<poi value="off" target="active_screen" object="plaque" align="right" />
						<!--<property type="visible" value="true" assign="active_screen" name="broken_window" />
						<property type="visible" value="false" assign="object_window" name="animation" />-->
						<property type="visible" value="false" assign="object_window" name="audiotape" />
						<!--<item name="audio_tape_1" id="AUDIO_TAPE_1" src="images/items/wet_rag.png" />-->
						<!--<cinematic id="PICKED_AUDIO_TAPE_1" />-->
						<closeWindow/>
						<unlockAudioTape id="1"/>
						<session id="M1_GOT_AUDIO_TAPE_1"/>
						<show_book tab="3"/>
						<sound src="Audio/SFX/GAME/tape_collected.mp3" />
						<property type="visible" value="false" assign="active_screen" name="plaque" />
					</event>
				</object>
			</window>
		</event>
		
	</object>
	<state>
		<requirement type="session" id="DEMO_MODE" value="false" />
		<requirement type="session" id="SOLVED_DEN"/>
		<requirement type="session" id="M2_VIEWED_THOMAS_DIALOGUE" value="false"/>
		<property type="visible" value="true" assign="object_window" name="thomas" />
		
		<sound src="Audio/SFX/OUTSIDE/garden_viggo_first.mp3" />
		
	</state>
	
	<object name="thomas" id="THOMAS" cursor="hand">
		<event type="clicked">
			<requirement type="session" id="M2_VIEWED_THOMAS_DIALOGUE" value="false"/>
			
			<speech>
				<text src="images/characters/thomas.png" speaker_name="THOMAS" string="M2_THOMAS_CHRISTINE_ENTRANCE_1" audio="Audio/Speech/Outside/Main Entrance/2_7_1.mp3" />
				<text src="images/characters/christine.png" speaker_name="CHRISTINE" string="M2_THOMAS_CHRISTINE_ENTRANCE_2" audio="Audio/Speech/Outside/Main Entrance/2_7_2.mp3"/>
				<text src="images/characters/thomas.png" speaker_name="THOMAS" string="M2_THOMAS_CHRISTINE_ENTRANCE_3" audio="Audio/Speech/Outside/Main Entrance/2_7_3.mp3"/>
				<text src="images/characters/thomas.png" speaker_name="THOMAS" string="M2_THOMAS_CHRISTINE_ENTRANCE_4" audio="Audio/Speech/Outside/Main Entrance/2_7_4.mp3"/>
				<text src="images/characters/christine.png" speaker_name="CHRISTINE" string="M2_THOMAS_CHRISTINE_ENTRANCE_5" audio="Audio/Speech/Outside/Main Entrance/2_7_5.mp3"/>
				<text src="images/characters/thomas.png" speaker_name="THOMAS" string="M2_THOMAS_CHRISTINE_ENTRANCE_6" audio="Audio/Speech/Outside/Main Entrance/2_7_6.mp3"/>
				<finish>						
					<cinematic id="M2_THOMAS_DIALOGUE_MAIN_ENTRANCE" />
					<session id="M2_VIEWED_THOMAS_DIALOGUE" />	
					<property type="visible" value="false" assign="object_window" name="thomas" />
				</finish>
			</speech>	
			
		</event>
	</object>
	
	<object name="area1" id="AREA1" cursor="hand">
		<event type="clicked">
			<warning id="ENTRANCE_ASYLUM"/>
		</event>
	</object>	
	<object name="window" id="WINDOW" cursor="hand">
		<event type="clicked">
			<warning id="ENTRANCE_BROKEN_WINDOW"/>
		</event>
	</object>
	<object name="fountain_area" id="FOUNTAIN_AREA" cursor="hand" tooltip="LOCATION_FOUNTAIN">
		<event type="clicked">
			<warning id="ENTRANCE_FOUNTAIN"/>
		</event>
	</object>
	
</screen>