<?xml version="1.0" ?>

<Scene name="Start" zbase="411" zfactor="0.595">
	<Object type="LBAMap" name="Start_walk" filename="Start.lba" x="0" y="0"/>

	<Audio source="storage"/>

	<!-- Images -->
	<if t="not $just_landed or $just_landed == -1">
		<if t="not $just_landed == -1">

			<if t="$rowboat_has_logo and $rowboat_has_tape and $execute_mockup_cutscene == 0 and not $authorized_for_warehouse and not $bastard_bug_lock_1">
				<Action type="Composite">
					<Action type="SetVar" var="rowboat_mocked_up" value="1" reset="0"/>
					<Action type="SetVar" var="execute_mockup_cutscene" value="1" reset="0"/>
					<Action type="SetVar" var="bastard_bug_lock_1" value="1" reset="0"/>
				</Action>
			</if>

			<Action type="DebugPrint" text="Testpoint A"/>
			<if t="$warehouse_cutscene_state == 0">
				<if t="$rowboat_mocked_up">
					<Object type="Character2D" chr="rowboat_logo_tape" x="300" y="235" direction="S"/>
					<Action type="SetVar" var="rowboat_model" value="rowboat_logo_tape" reset="0"/>
				<else>
					<if t="not $rowboat_has_logo and not $rowboat_has_tape">
						<Object type="Character2D" chr="rowboat" x="300" y="235" direction="S"/>
						<Action type="SetVar" var="rowboat_model" value="rowboat" reset="0"/>
						<else>
						<if t="$rowboat_has_logo">
							<Object type="Character2D" chr="rowboat_logo" x="300" y="235" direction="S"/>
							<Action type="SetVar" var="rowboat_model" value="rowboat_logo" reset="0"/>
						<else>
							<if t="$rowboat_has_tape">
								<Object type="Character2D" chr="rowboat_tape" x="300" y="235" direction="S"/>
								<Action type="SetVar" var="rowboat_model" value="rowboat_tape" reset="0"/>
							</if>
						</else>
						</if>
						</else>
					</if>
				</else>
				</if>

				<if t="not $rowboat_mocked_up">

					<Action color="00FF00" type="ItemAction" rollover="RO_ROWBOAT">
						<Action itemaction="noitem" type="CommandCharacter" chr="$current_character">
							<Job type="Move" x="290" y="240"/>
							<Job type="SetOrientation" direction="NE"/>
							<Job type="Say" key="ROWBOAT_LOOK_01"/>
						</Action>
						<Action itemaction="sticky_tape" type="CommandCharacter" chr="$current_character">
							<Job type="Move" x="290" y="240"/>
							<Job type="SetOrientation" direction="NE"/>
							<Job condition="$seen_scheme" type="Animate" ani="Take"/>
							<Job condition="$seen_scheme" type="SetVar" var="rowboat_mockup_action" value="1" reset="0"/>
							<Job condition="$seen_scheme" type="SetVar" var="rowboat_mockup_action_tape" value="1" reset="0"/>
							<Job condition="$seen_scheme" type="RemoveItem" item="sticky_tape" reset="0"/>
							<Job condition="$seen_scheme and not $rowboat_has_logo" type="Say" key="ROWBOAT_TAPE_STICKED_NO_LOGO_01" nowait="1"/>							
							<Job condition="$seen_scheme" type="SetVar" var="rowboat_has_tape" value="1"/>
							<Job condition="$seen_scheme" type="Animate" ani="TakeBack"/>

							<Job condition="not $seen_scheme" type="Say" key="USE_TAPE_NOT_SEEN_SCHEME_01"/>
						</Action>

						<Action itemaction="kribb_logo" type="CommandCharacter" chr="$current_character">
							<Job type="Move" x="290" y="240"/>
							<Job type="SetOrientation" direction="NE"/>
							<Job condition="$seen_scheme" type="Animate" ani="Take"/>
							<Job condition="$seen_scheme" type="SetVar" var="rowboat_mockup_action" value="1" reset="0"/>
							<Job condition="$seen_scheme" type="SetVar" var="rowboat_mockup_action_logo" value="1" reset="0"/>
							<Job condition="$seen_scheme" type="RemoveItem" item="kribb_logo" reset="0"/>
							<Job condition="$seen_scheme and not $rowboat_has_tape" type="Say" key="ROWBOAT_LOGO_STICKED_NO_TAPE_01" nowait="1"/>
							<Job condition="$seen_scheme" type="SetVar" var="rowboat_has_logo" value="1"/>
							<Job condition="$seen_scheme" type="Animate" ani="TakeBack"/>

							<Job condition="not $seen_scheme" type="Say" key="USE_LOGO_NOT_SEEN_SCHEME_01"/>
						</Action>
					</Action>

					<if t="$current_character == danny">
						<Action color="D0AB1E" type="ItemAction" rollover="RO_LUNA">
							<Action itemaction="noitem" type="Multiple">
								<Action multiple="look" type="CommandCharacter" chr="$current_character">
									<Job type="SetVar" var="approach_target" value="luna"/>
									<Job type="CallAction" ref="ui.ApproachCharacter"/>
									<Job type="CallAction" ref="ui.FaceCharacter"/>
									<Job type="Say" key="LOOKED_AT_LUNA_IN_VARION_01"/>
								</Action>
								<Action multiple="talk" type="CommandCharacter" chr="$current_character">
									<Job type="SetVar" var="approach_target" value="luna"/>
									<Job type="CallAction" ref="ui.ApproachCharacter"/>
									<Job type="CallAction" ref="ui.FaceCharacter"/>
									<Job type="Dialog" dialog="luna_and_danny_after_landing_root"/>
								</Action>
							</Action>

							<Action itemaction="pepper_spray" type="CommandCharacter" chr="$current_character">
								<Job type="Move" x="320" y="250"/>
								<Job type="SetOrientation" direction="NE"/>
								<Job type="Say" key="DANNY_GIVES_PEPER_SPRAY_TO_LUNA_01"/>
								<Job type="Animate" ani="Take"/>
								<Job type="RemoveItem" item="pepper_spray" reset="0"/>
								<Job type="CallAction" ref="M::luna_takes"/> <!-- ovo se nalazi u varion.Warehouse -->
								<Job type="Pause" time="0.5"/>
								<Job type="Animate" ani="TakeBack"/>
							</Action>
						</Action>
					</if>

				</if>

				<if t="$luna_scene == varion.Start and not $execute_mockup_cutscene == 2 and not $authorized_for_warehouse">
					<Action type="DebugPrint" text="ADDITIONAL TEST POINT A"/>
					<Object type="Character2D" chr="luna" x="0" y="0"/>					
				</if>

				<if t="$danny_scene == $active_scene">
					<if t="$varion_init_everything_ready">
						<Action type="DebugPrint" text="ADDITIONAL TEST POINT B"/>
						<Object type="Character2D" chr="danny" x="0" y="0"/>
					<else>
						<Action type="DebugPrint" text="ADDITIONAL TEST POINT C"/>
						<Object type="Character2D" chr="danny" x="0" y="0"/>
						<!-- <Object type="Character2D" chr="danny" x="200" y="300" direction="NE"/> -->
						<Action type="SetVar" var="varion_init_everything_ready" value="1" reset="0"/>
					</else>
					</if>
					<if t="$rowboat_mockup_action">
						<Action type="CommandCharacter" chr="danny">
							<Job condition="$execute_mockup_cutscene == 1" type="LockScene"/>
							<Job type="SetVar" var="rowboat_mockup_action_tape" value="0" reset="0"/>
							<Job type="SetVar" var="rowboat_mockup_action_logo" value="0" reset="0"/>
							<Job type="SetVar" var="rowboat_mockup_action" value="0" reset="0"/>
							<Job condition="$execute_mockup_cutscene == 1" type="Say" key="THERE_THIS_SHOULD_WORK_01"/>
							<Job condition="$execute_mockup_cutscene == 1" type="SetVar" var="switchable_characters" value="danny" reset="0"/>
							<Job condition="$execute_mockup_cutscene == 1" type="Move" x="320" y="250"/>
							<Job condition="$execute_mockup_cutscene == 1" type="SetOrientation" direction="NE"/>
							<Job condition="$execute_mockup_cutscene == 1" type="Dialog" dialog="SEQ_ROWBOAT_MOCKED_UP"/>
						</Action>
					</if>
				</if>
			<else>
				<if t="$danny_scene == varion.Start">
					<Action type="DebugPrint" text="TESTPOINT A-2"/>
					<Object type="Character2D" chr="danny" x="0" y="0">
						<Property name="position_if:$prev_scene == varion.InfrontCargo" value="246,246,S"/>
						<Property name="position_if:$prev_scene == varion.Barrier" value="85,271,SE"/>
					</Object>
				</if>
			</else>
			</if>

		</if>

		<!-- Actions -->

		<Action color="FFFF00" type="CommandCharacter" chr="$current_character" rollover="RO_GOTO_BARRIER|l">
			<Job condition="$current_character == luna"  type="Say" key="LUNA_VARION_NOGO_01"/>
			<Job condition="$current_character == danny" type="Move" x="85" y="271"/>
			<Job condition="$current_character == danny" type="SetOrientation" direction="NW"/>
			<Job condition="$current_character == danny" type="SwitchScene" scene="Barrier"/>
		</Action>
		<Action color="0000FF" type="CommandCharacter" chr="$current_character" rollover="RO_GOTO_INFRONT_WAREHOUSE|u">
			<Job condition="$current_character == luna"  type="Say" key="LUNA_VARION_NOGO_01"/>
			<Job condition="$current_character == danny" type="Move" x="246" y="246"/>
			<Job condition="$current_character == danny" type="SetOrientation" direction="N"/>
			<Job condition="$current_character == danny" type="SwitchScene" scene="InfrontCargo"/>
		</Action>

		<if t="not $taken_pepper">
			<Action color="0066FF" type="Multiple" rollover="RO_SCARY_PLANT">
				<Action multiple="look" type="CommandCharacter" chr="$current_character">
					<Job type="Move" x="160" y="288"/>
					<Job type="SetOrientation" direction="N"/>
					<Job type="Say" key="SCARY_PLANT_LOOK_01"/>
					<Job condition="$current_character == luna" type="Move" x="335" y="240"/>
					<Job condition="not $current_character == danny" type="SetOrientation" direction="SW"/>
				</Action>
				<Action multiple="use" type="CommandCharacter" chr="$current_character" rollover="ui.casual_use_only">
					<Job type="Move" x="160" y="288"/>
					<Job type="SetOrientation" direction="N"/>
					<Job condition="not $current_character == danny" type="Say" key="LUNA_WONT_TAKE_PEPPER_PLANT_01"/>
					<Job condition="$current_character == luna" type="Move" x="335" y="240"/>
					<Job condition="not $current_character == danny" type="SetOrientation" direction="SW"/>
					<Job condition="$current_character == danny" type="Say" key="SCARY_PLANT_TAKE_PEPPER"/>
					<Job condition="$current_character == danny" type="Animate" ani="Take"/>
					<Job condition="$current_character == danny" type="PlaySound" sound="take_flower"/>
					<Job condition="$current_character == danny" type="AddItem" item="pepper" reset="0"/>
					<Job condition="$current_character == danny" type="SetVar" var="taken_pepper" value="1"/>
					<Job condition="$current_character == danny" type="Animate" ani="TakeBack"/>
				</Action>
			</Action>

		<else> <!-- taken pepper -->
			<Action color="0066FF" type="Multiple" rollover="RO_SCARY_PLANT">
				<Action multiple="look" type="CommandCharacter" chr="$current_character">
					<Job type="Move" x="160" y="288"/>
					<Job type="SetOrientation" direction="N"/>
					<Job type="Say" key="SCARY_PLANT_LOOK_01"/>
				</Action>
				<Action multiple="use" type="CommandCharacter" chr="$current_character">
					<Job type="Move" x="160" y="288"/>
					<Job type="SetOrientation" direction="N"/>
					<Job type="Say" key="SCARY_PLANT_USE_01"/>
				</Action>
			</Action>
		</else>
		</if>

		<Action color="FF66FF" type="CommandCharacter" chr="$current_character" rollover="RO_SAUCER">
			<Job type="Move" x="329" y="237"/>
			<Job type="SetOrientation" direction="NE"/>
			<Job type="Say" key="SAUCER_LOOK_01"/>
		</Action>

	<else> <!-- tek su sletjeli (intro) -->

		<Action type="DebugPrint" text="$just_landed"/>
		<Action type="SetVar" var="mazslow_on_varion" value="1" reset="0"/>

		<Action type="SetVar" var="luna_scene" value="varion.Start" reset="0"/>
		<Action type="SetVar" var="danny_scene" value="varion.Start" reset="0"/>
		<Action type="SetVar" var="brawe_scene" value="varion.Prison" reset="0"/>

		<Object type="Character2D" chr="rowboat" x="300" y="235" direction="S"/>

		<Action type="DebugPrint" text="Testpoint B"/>
		<Object type="Character2D" chr="danny" x="300" y="250" direction="NE"/>

		<Object type="Character2D" chr="luna" x="335" y="240" direction="SW"/>

		<Action type="SetVar" var="current_character" value="danny" reset="0"/>
		<Action type="SetVar" var="switchable_characters" value="danny,luna" reset="0"/>
		<Action type="Dialog" dialog="SEQ_LANDED_ON_VARION"/>
	</else>
	</if>

	<if t="$just_landed == -1">
		<Action type="DebugPrint" text="Testpoint C"/>

		<Object type="Character2D" chr="rowboat" x="300" y="235" direction="S"/>
		<Object type="Character2D" chr="danny" x="200" y="300" direction="NE"/>
		<Object type="Character2D" chr="luna" x="335" y="240" direction="SW"/>

		<!-- <Action type="RemoveAllItems" item="*" reset="0"/> -->
		<Action type="SetVar" var="items" value="" reset="0"/>
		<Action type="SetVar" var="luna_items" value="" reset="0"/>
		<Action type="SetVar" var="danny_items" value="" reset="0"/>
		<Action type="SetVar" var="brawe_items" value="" reset="0"/>

		<Action type="SetVar" var="switchable_characters" value="luna,danny" reset="0"/>
		<Action type="SetVar" var="rowboat_following" value="nobody" reset="0"/>
		<Action type="SetVar" var="current_character" value="danny" reset="0"/>

		<Action type="SetVar" var="inv_ignore_notifications" value="1" reset="0"/>
		<Action type="AddItem" item="ID_card" reset="0"/>
		<Action type="SetVar" var="inv_ignore_notifications" value="0" reset="0"/>

		<Action type="UnlockScene"/>
		<Action type="SetVar" var="just_landed" value="0"/>

	</if>

	<!-- Foreground -->
	<Object type="ImageBox" image="Start-Foreground" x="0" y="6" />
	
	
	<if t="$execute_mockup_cutscene == 2">
		<Action type="Dialog" dialog="SEQ_LUNA_IN_ROWBOAT"/>
	</if>
	
	<Action name="M::skip_landed" type="Composite">
		<Action type="EndDialog"/>
		<Action type="ClearJobs" chr="luna"/>
		<Action type="ClearJobs" chr="danny"/>
		<Action type="ClearJobs" chr="she"/>
		<Action type="ClearJobs" chr="brawe"/>
		
		<Action type="SetVar" var="current_character" value="danny" reset="0"/>
		<Action type="SetVar" var="switchable_characters" value="danny,luna" reset="0"/>
		<Action type="SetVar" var="just_landed" value="-1" reset="0"/>
		
		<Action type="UnlockScene"/>
		<Action type="SetVar" var="hint22_rescue" value="1" reset="0"/>
		<Action type="SetVar" var="hint23_infiltrate" value="1" reset="0"/>
		<Action type="ResetScene"/>	
	</Action>
	
	<Action name="M::skip_rowboat_mocked_up" type="Composite">
		<Action type="EndDialog"/>
		<Action type="ClearJobs" chr="luna"/>
		<Action type="ClearJobs" chr="danny"/>
		<Action type="ClearJobs" chr="she"/>
		<Action type="ClearJobs" chr="brawe"/>
	
		<Action type="SetVar" var="luna_scene" value="" reset="0"/>
		<Action type="SetVar" var="execute_mockup_cutscene" value="2" reset="0"/> <!-- u tom dijalogu se i unlocka scena -->
		
		<Action type="SwitchScene" scene="varion.Start"/>	
	</Action>
	

</Scene>
