<?xml version="1.0" ?>

<Scene name="Intro01" image="null" hide_ui="1">

    <if t="$intro_ani != 0">
        <Audio source="intro_music"/>
    </if>
	<Action name="Skip_Intro" type="Composite">
		<Action type="SetVar" var="intro_ani" value="0" reset="0"/>
		<Action type="SetVar" var="click_to_continue_visible" value="1" reset="0"/>
		<Action type="SetVar" var="click_to_continue_textkey" value="CLICK_TO_CONTINUE_01" reset="0"/>
		<Action type="StopSound" sound="intro_music" fade_time="2"/>
		<Action type="SwitchScene" scene="ship.Cockpit"/>
	</Action>

	<if t="$outro_ani == 0">
		<if t="not $cutscene_state == 7">

			<!-- BEGIN INTRO -->

			<!-- clean up (executes on every reset) -->
			<Action type="SetVar" var="intro_caption_text_1" value="INTRO_TEXT_BLANK_01" reset="0"/>
			<Action type="SendEventToObject" obj_name="LABEL_INTRO_CAPTION_1" event="UpdateText"/>
			<Action type="SendEventToObject" obj_name="LABEL_INTRO_CAPTION_SMALL" event="UpdateText"/>
			<Action type="SendEventToObject" obj_name="LABEL_INTRO_CAPTION_1_LONG" event="UpdateText"/>
			<Action type="SetVar" var="intro_caption_text_2" value="INTRO_TEXT_BLANK_01" reset="0"/>
			<Action type="SendEventToObject" obj_name="LABEL_INTRO_CAPTION_2" event="UpdateText"/>

			<if t="$intro_ani == 0">
				<!-- imagery -->
                <!-- force dynamic textures to load -->
				<Object type="ImageBox" image="Watt" x="426" y="320" alpha="0.01"/>
				
                <Action type="LockScene"/>
				<Action type="SetVar" var="skip_action" value="Skip_Intro" reset="0"/>
				<Animator type="DelayedCommand" time="0.1" cmd="set_var intro_ani 1;reset_scene"/>
			</if>

			<if t="$intro_ani == 1">

				<!-- imagery -->
				<Object type="ImageBox" image="Watt" x="65" y="10" alpha="0">
					<Animator type="AlphaFader" speed="0.35" dest_alpha="1.0"/>
					<Animator type="Scaler" speed_w="-15" speed_h="-15"/>
					<Animator type="Mover" speed_x="7.5" speed_y="7.5"/>
					<Animator type="AlphaFader" speed="-2" dest_alpha="0.0" delay="5"/>
				</Object>

				<!-- texts -->
				<Action type="SetVar" var="intro_caption_text_1" value="INTRO_TEXT_01" reset="0"/>
				<Action type="SendEventToObject" obj_name="LABEL_INTRO_CAPTION_1" event="UpdateText"/>
				<Action type="SetVar" var="intro_caption_text_2" value="INTRO_TEXT_02" reset="0"/>
				<Action type="SendEventToObject" obj_name="LABEL_INTRO_CAPTION_2" event="UpdateText"/>

				<!-- advancement control -->
				<Animator type="DelayedAction" time="5.5">
					<Action type="SetVar" var="intro_ani" value="2"/>
				</Animator>
			</if>

			<if t="$intro_ani == 2">

				<!-- imagery -->
				<Object type="ImageBox" image="Ion_Drive" x="0" y="10" alpha="0">
					<Animator type="AlphaFader" speed="1" dest_alpha="1.0"/>
					<Animator type="AlphaFader" speed="-2" dest_alpha="0.0" delay="3"/>
				</Object>

				<!-- texts -->
				<Action type="SetVar" var="intro_caption_text_1" value="INTRO_TEXT_03" reset="0"/>
				<Action type="SendEventToObject" obj_name="LABEL_INTRO_CAPTION_1" event="UpdateText"/>

				<!-- advancement control -->
				<Animator type="DelayedAction" time="3.5">
					<Action type="SetVar" var="intro_ani" value="3"/>
				</Animator>
			</if>

			<if t="$intro_ani == 3">

				<!-- imagery -->
				<Object type="ImageBox" image="Space_past" x="0" y="-100" w="526" h="420" alpha="0">
					<Animator type="AlphaFader" speed="2" dest_alpha="1.0"/>
					<Animator type="Scaler" speed_w="-10" speed_h="-10"/>
					<Animator type="Mover" speed_y="10"/>
					<Animator type="AlphaFader" speed="-2" dest_alpha="0.0" delay="7"/>
				</Object>

				<Object type="ImageBox" image="Rocket_Ship_past" alpha="0" x="90" y="190">
					<Animator type="AlphaFader" speed="2" dest_alpha="1.0" delay="0.5"/>
					<Animator type="Mover" speed_x="20" speed_y="-15"/>
					<Animator type="AlphaFader" speed="-2" dest_alpha="0.0" delay="7"/>
				</Object>

				<Object type="ImageBox" image="Planet_past" x="0" y="115" w="299" h="303" alpha="0">
					<Animator type="AlphaFader" speed="2" dest_alpha="1.0"/>
					<Animator type="Scaler" speed_w="-10" speed_h="-10"/>
					<Animator type="Mover" speed_y="5"/>
					<Animator type="AlphaFader" speed="-2" dest_alpha="0.0" delay="7"/>
				</Object>

				<!-- texts -->
				<Action type="SetVar" var="intro_caption_text_1" value="INTRO_TEXT_04" reset="0"/>
				<Action type="SendEventToObject" obj_name="LABEL_INTRO_CAPTION_1" event="UpdateText"/>
				<Action type="SetVar" var="intro_caption_text_2" value="INTRO_TEXT_05" reset="0"/>
				<Action type="SendEventToObject" obj_name="LABEL_INTRO_CAPTION_2" event="UpdateText"/>

				<!-- advancement control -->
				<Animator type="DelayedAction" time="7.5">
					<Action type="SetVar" var="intro_ani" value="4"/>
				</Animator>
			</if>

			<if t="$intro_ani == 4">

				<!-- imagery -->
				<Object type="ImageBox" image="City_past" x="-50" y="-50" w="526" h="420" alpha="0">
					<Animator type="AlphaFader" speed="2" dest_alpha="1.0"/>
					<Animator type="Scaler" speed_w="-15" speed_h="-15"/>
					<Animator type="Mover" speed_x="7.5" speed_y="7.5"/>
					<Animator type="AlphaFader" speed="-2" dest_alpha="0.0" delay="4"/>
				</Object>

				<!-- texts -->
				<Action type="SetVar" var="intro_caption_text_1" value="INTRO_TEXT_06" reset="0"/>
				<Action type="SendEventToObject" obj_name="LABEL_INTRO_CAPTION_1" event="UpdateText"/>

				<!-- advancement control -->
				<Animator type="DelayedAction" time="4.5">
					<Action type="SetVar" var="intro_ani" value="5"/>
				</Animator>
			</if>

			<if t="$intro_ani == 5">

				<!-- imagery -->
				<Object type="ImageBox" image="Kribbs_past" x="100" y="100" w="225" h="168" alpha="0">
					<Animator type="AlphaFader" speed="1" dest_alpha="1.0"/>
					<Animator type="Scaler" speed_w="15" speed_h="15"/>
					<Animator type="Mover" speed_x="-7.5" speed_y="-7.5"/>
					<Animator type="AlphaFader" speed="-2" dest_alpha="0.0" delay="5.5"/>
				</Object>

				<!-- texts -->
				<Action type="SetVar" var="intro_caption_text_1" value="INTRO_TEXT_07" reset="0"/>
				<Action type="SendEventToObject" obj_name="LABEL_INTRO_CAPTION_1_LONG" event="UpdateText"/>
				<!--
 				<Action type="SetVar" var="intro_caption_text_2" value="INTRO_TEXT_08" reset="0"/>
				<Action type="SendEventToObject" obj_name="LABEL_INTRO_CAPTION_2" event="UpdateText"/> 
				-->

				<!-- advancement control -->
				<Animator type="DelayedAction" time="6">
					<Action type="SetVar" var="intro_ani" value="6"/>
				</Animator>
			</if>

			<if t="$intro_ani == 6">

				<!-- imagery -->
				<Object type="ImageBox" image="Space2_past" x="0" y="0" w="426" h="320" alpha="0">
					<Animator type="AlphaFader" speed="2" dest_alpha="1.0"/>
					<Animator type="Scaler" speed_w="15" speed_h="15"/>
					<Animator type="Mover" speed_x="-7.5" speed_y="-7.5"/>
					<Animator type="AlphaFader" speed="-2" dest_alpha="0.0" delay="5.5"/>
				</Object>

				<!-- texts -->
				<Action type="SetVar" var="intro_caption_text_1" value="INTRO_TEXT_09" reset="0"/>
				<Action type="SendEventToObject" obj_name="LABEL_INTRO_CAPTION_1" event="UpdateText"/>
				<Action type="SetVar" var="intro_caption_text_2" value="INTRO_TEXT_10" reset="0"/>
				<Action type="SendEventToObject" obj_name="LABEL_INTRO_CAPTION_2" event="UpdateText"/>

				<!-- advancement control -->
				<Animator type="DelayedAction" time="6">
					<Action type="SetVar" var="intro_ani" value="7"/>
				</Animator>
			</if>

			<if t="$intro_ani == 7">

				<!-- imagery -->
				<Object type="ImageBox" image="Space3_past" x="0" y="-450" w="876" h="770" alpha="0">
					<Animator type="AlphaFader" speed="2" dest_alpha="1.0"/>
					<Animator type="Scaler" speed_w="-4.5" speed_h="-4.5"/>
					<Animator type="Mover" speed_y="8.5"/>
				</Object>
				<Object type="ImageBox" image="Space" x="0" y="-450" w="876" h="770" alpha="0">
					<Animator type="AlphaFader" speed="0.1" dest_alpha="1.0" delay="8"/>
					<Animator type="Scaler" speed_w="-4.5" speed_h="-4.5"/>
					<Animator type="Mover" speed_y="8.5"/>
				</Object>

				<Object type="ImageBox" image="Station_past" x="70" y="50">
					<Animator type="Mover" speed_y="-10"/>
					<Animator type="AlphaFader" speed="-1" dest_alpha="0.0" delay="5"/>
				</Object>

				<Object type="ImageBox" image="Cateia_Logo" x="100" y="110" w="220" h="100" alpha="0">
					<Animator type="AlphaFader" speed="0.5" dest_alpha="1.0" delay="8"/>
					<Animator type="Scaler" speed_w="0" speed_h="0" delay="8"/>
					<Animator type="Mover" speed_x="0" speed_y="0" delay="8"/>
					<Animator type="AlphaFader" speed="-1" dest_alpha="0.0" delay="14"/>
				</Object>

				<Object type="ImageBox" image="Petar_Logo" x="110" y="110" w="220" h="130" alpha="0">
					<Animator type="AlphaFader" speed="0.5" dest_alpha="1.0" delay="14"/>
					<Animator type="Scaler" speed_w="0" speed_h="0" delay="14"/>
					<Animator type="Mover" speed_x="0" speed_y="-0" delay="14"/>
					<Animator type="AlphaFader" speed="-1" dest_alpha="0.0" delay="18"/>
				</Object>

				<Object type="ImageBox" image="Box_Logo" x="130" y="50" w="170" h="220" alpha="0">
					<Animator type="AlphaFader" speed="0.2" dest_alpha="1.0" delay="18"/>
					<Animator type="Scaler" speed_w="7" speed_h="10" delay="18"/>
					<Animator type="Mover" speed_x="-3.5" speed_y="-5" delay="18"/>
					<Animator type="AlphaFader" speed="-0.5" dest_alpha="0.0" delay="29"/>
				</Object>


				<Object type="ImageBox" image="Schminkell" x="400" y="30" w="400" h="350">
					<Animator type="Mover" speed_x="-30" speed_y="10" dest_x="-500" delay="27"/>
				</Object>


				<Animator type="DelayedAction" time="36"> <Action type="PlaySound" sound="ship"/> </Animator>
				
				<Object type="ImageBox" image="intro/Intro.1" x="223" y="120">
					<Animator type="FrameAnimation" base_name="intro/Intro." start_frame="1" end_frame="311" time="10" delay="37" loop="0"/>
				</Object>

				<!-- texts -->
				<Action type="SetVar" var="intro_caption_text_1" value="INTRO_TEXT_11" reset="0"/>
				<Action type="SendEventToObject" obj_name="LABEL_INTRO_CAPTION_1_LONG" event="UpdateText"/>

				<Action type="SetVar" var="intro_caption_text_1" value="INTRO_TEXT_12" reset="0"/>
				<Action type="SendEventToObject" obj_name="LABEL_INTRO_CAPTION_SMALL" event="UpdateText"/>

				<!-- advancement control -->
				<Animator type="DelayedAction" time="42">
					<Action type="SetVar" var="intro_ani" value="0" reset="0"/>
					<Action type="SetVar" var="click_to_continue_visible" value="1" reset="0"/>
					<Action type="SetVar" var="click_to_continue_textkey" value="CLICK_TO_CONTINUE_01" reset="0"/>
					<Action type="StopSound" sound="ship" fade_time="2"/>
					<Action type="SwitchScene" scene="ship.Cockpit" fade_time="5"/>
					<Action type="StopSound" sound="intro_music" fade_time="2"/>
				</Animator>

			</if>

			<!-- intro text captioning system (foreground) -->
			<Object type="Label" name="LABEL_INTRO_CAPTION_1" textkey="$intro_caption_text_1" alpha="0" effect="border" font="hheaven:1.2" color="FFE3AF" horz_formatting="center_wrapped" x="0" y="260" w="426" h="64">
				<Animator type="AlphaFader" speed="3.5"/>
				<Animator type="AlphaFader" speed="-4.5" delay="3"/>
			</Object>

			<Object type="Label" name="LABEL_INTRO_CAPTION_SMALL" textkey="$intro_caption_text_1" alpha="0" effect="border" font="hheaven" color="FFFFFF" horz_formatting="left_wrapped" x="10" y="270" w="426" h="64">
				<Animator type="AlphaFader" speed="1.5" dest_alpha="1.0" delay="34" />
				<Animator type="AlphaFader" speed="-0.5" delay="37"/>
			</Object>

			<Object type="Label" name="LABEL_INTRO_CAPTION_1_LONG" textkey="$intro_caption_text_1" alpha="0" effect="border" font="hheaven:1.2" color="FFE3AF" horz_formatting="center_wrapped" x="0" y="260" w="426" h="64">
				<Animator type="AlphaFader" speed="0.5"/>
				<Animator type="AlphaFader" speed="-1.5" delay="5"/>
			</Object>

			<Object type="Label" name="LABEL_INTRO_CAPTION_2" textkey="$intro_caption_text_2" alpha="0" effect="border" font="hheaven:1.2" color="FFE3AF" horz_formatting="center_wrapped" x="0" y="260" w="426" h="64">
				<Animator type="AlphaFader" speed="3.5" delay="4"/>
				<Animator type="AlphaFader" speed="-4.5" delay="7"/>
			</Object>

		<!-- END INTRO -->
		</if>

		<if t="$cutscene_state == 7">
			<Action type="SetVar" var="skip_action" value="M::skip_terra_station_visiting" reset="0"/>
			<!-- <Action type="Dialog" dialog="SEQ_GOING_TO_TERRA_INTRO"/> -->
			<Animator type="DelayedAction" time="1">
				<Action type="SetVar" var="terra_intro_label" value="TERRA_01" reset="0"/>
				<Action type="SendEventToObject" obj_name="TERRA_INTRO_LABEL_BRAWE" event="UpdateText"/>
			</Animator>

			<Animator type="DelayedAction" time="6">
				<Action type="SetVar" var="terra_intro_label" value="TERRA_01b" reset="0"/>
				<Action type="SendEventToObject" obj_name="TERRA_INTRO_LABEL_BRAWE" event="UpdateText"/>
			</Animator>

			<Animator type="DelayedAction" time="10">
				<Action type="SetVar" var="terra_intro_label" value="TERRA_LABEL_EMPTY_01" reset="0"/>
				<Action type="SendEventToObject" obj_name="TERRA_INTRO_LABEL_BRAWE" event="UpdateText"/>
				<Action type="SetVar" var="terra_intro_label" value="TERRA_02" reset="0"/>
				<Action type="SendEventToObject" obj_name="TERRA_INTRO_LABEL_KRALEK" event="UpdateText"/>
			</Animator>

			<Animator type="DelayedAction" time="12.5">
				<Action type="SetVar" var="terra_intro_label" value="TERRA_LABEL_EMPTY_01" reset="0"/>
				<Action type="SendEventToObject" obj_name="TERRA_INTRO_LABEL_KRALEK" event="UpdateText"/>
			</Animator>

			<Action type="PlaySound" sound="ship"/>

			<Object type="ImageBox" image="intro/Intro.1" x="223" y="120">
				<Animator type="FrameAnimation" base_name="intro/Intro." start_frame="1" end_frame="311" time="15" />
			</Object>

			<Animator type="DelayedAction" time="10.5">
				<Action type="SwitchScene" scene="terra_nuova.Station" fade_time="5"/>
			</Animator>

			<Object type="Label" name="TERRA_INTRO_LABEL_BRAWE" textkey="$terra_intro_label" font="hheaven" color="FFFFFF" horz_formatting="center_wrapped" effect="border" x="0" y="240" w="426" h="64"/>
			<Object type="Label" name="TERRA_INTRO_LABEL_KRALEK" textkey="$terra_intro_label" font="hheaven" color="FFFF00" horz_formatting="center_wrapped" effect="border" x="0" y="240" w="426" h="64"/>

		</if>
	<else>
		<!--
 		<if t="$outro_state == 0">
			<Action type="Dialog" dialog="SEQ_OUTRO"/>
		</if>
		-->
		<if t="$outro_state == 0">

			<Animator type="DelayedAction" time="1">
				<Action type="SetVar" var="terra_intro_label" value="OUTRO_01" reset="0"/>
				<Action type="SendEventToObject" obj_name="TERRA_LABEL_OUTRO_DANNY" event="UpdateText"/>
			</Animator>

			<Animator type="DelayedAction" time="4">
				<Action type="SetVar" var="terra_intro_label" value="TERRA_LABEL_EMPTY_01" reset="0"/>
				<Action type="SendEventToObject" obj_name="TERRA_LABEL_OUTRO_DANNY" event="UpdateText"/>
				<Action type="SetVar" var="terra_intro_label" value="OUTRO_02" reset="0"/>
				<Action type="SendEventToObject" obj_name="TERRA_LABEL_OUTRO_BRAWE" event="UpdateText"/>
			</Animator>

			<Animator type="DelayedAction" time="7">
				<Action type="SetVar" var="terra_intro_label" value="TERRA_LABEL_EMPTY_01" reset="0"/>
				<Action type="SendEventToObject" obj_name="TERRA_LABEL_OUTRO_DANNY" event="UpdateText"/>
			</Animator>

			<Animator type="DelayedAction" time="8">
				<Action type="SetVar" var="terra_intro_label" value="TERRA_LABEL_EMPTY_01" reset="0"/>
				<Action type="SendEventToObject" obj_name="TERRA_LABEL_OUTRO_BRAWE" event="UpdateText"/>
				<Action type="SetVar" var="terra_intro_label" value="GAME_OVER_01" reset="0"/>
				<Action type="SendEventToObject" obj_name="TERRA_LABEL_GAME_OVER" event="UpdateText"/>
				<Action type="SetVar" var="terra_intro_label" value="TERRA_LABEL_EMPTY_01" reset="0"/>
			</Animator>

			<Object type="ImageBox" image="intro/Intro.1" x="223" y="120">
				<Animator type="FrameAnimation" base_name="intro/Intro." start_frame="1" end_frame="311" time="15" loop="0" />
				<Animator type="DelayedAction" time="13">
					<Action type="UnlockScene"/>
					<Action type="SwitchScene" scene="menu.MainMenu" fade_time="5"/>
				</Animator>
			</Object>

			<Object type="Label" name="TERRA_LABEL_OUTRO_BRAWE" textkey="$terra_intro_label" font="hheaven" color="FFFFFF" horz_formatting="center_wrapped" effect="border" x="0" y="240" w="426" h="64"/>
			<Object type="Label" name="TERRA_LABEL_OUTRO_DANNY" textkey="$terra_intro_label" font="hheaven" color="FFFF00" horz_formatting="center_wrapped" effect="border" x="0" y="240" w="426" h="64"/>

			<Object type="Label" name="TERRA_LABEL_GAME_OVER" textkey="$terra_intro_label" font="hheaven:1.6" color="FFFFFF" horz_formatting="center_wrapped" effect="border" x="0" y="130" w="426" h="64"/>

		</if>

	</else>
	</if>

	<Action name="M::skip_terra_station_visiting" type="Composite">
		<!--
		<Action type="EndDialog"/>
		<Action type="ClearJobs" chr="brawe"/>
		<Action type="ClearJobs" chr="kralek"/>
		-->
		<Action type="SetVar" var="cutscene_state" value="8" reset="0"/>
		<Action type="SwitchScene" scene="terra_nuova.Office"/>
	</Action>

</Scene>
