<?xml version="1.0" ?>

<Scene name="Windmill" image="null" width="505" zbase="494" zfactor="1.0480">
	<Object type="LBAMap" name="Windmill_walk" filename="Windmill.lba" x="0" y="0"/>

	<Audio source="crossroads"/>

	<!-- Images -->
	<Object type="ImageBox" image="Windmill" x="0" y="0" />

	<!-- ********************** ROWBOAT (mora biti bas tu zbog Z-ordera) ************************* -->
	<if t="$rowboat_following == $current_character">
		<Object type="Character2D" chr="rowboat" x="0" y="0">

			<!-- SETUP STEP 1/3: set STARTING POSITIONS where Rowboat will emerge from (ideally from offscreen) -->
			<Property name="position_if:$prev_scene == jama_spacea.Motel" value="55,200,E"/> <!--   |> isto -->
			<Property name="position_if:$prev_scene == jama_spacea.JamaMap" value="55,200,E"/> <!-- |> isto -->

		</Object>

		<if t="not $prev_scene == $active_scene and not $prev_scene == jama_spacea.WindmillInterior"> <!-- ne copy-pasteati odavde, ovaj dio je samo za ovu scenu -->
			<Action type="CommandCharacter" chr="rowboat">

				<!-- SETUP STEP 2/3: send Rowboat to same DESTINATION POINT regardles where he emerged from -->
				<Job type="Move" x="155" y="245"/>
				<Job type="SetOrientation" direction="SE"/>

			</Action>
			<else>
				<Object type="Character2D" chr="rowboat" x="0" y="0">
					<Property name="position_if:" value="155,245,SE"/> <!-- SETUP STEP 3/3: COPY DESTINATION POSITION AND ORIENTATION here (as starting position), this is needed in case of scene reset (item taken etc.) -->
				</Object>
			</else>
		</if>
	</if>
	<!-- ****************************************************************************************** -->

	<Object type="Character2D" chr="brawe" x="0" y="0">
		<Property name="position_if:$prev_scene == jama_spacea.Motel" value="74,222,SE"/>
		<Property name="position_if:$prev_scene == jama_spacea.JamaMap" value="74,222,SE"/>
		<Property name="position_if:$prev_scene == jama_spacea.WindmillInterior" value="228,269,SW"/>
	</Object>

    <Object type="ImageBox" image="Windmill-Foreground" x="87" y="198" />

	<!-- Actions -->

	<Action color="FFFF00" type="CommandCharacter" chr="brawe" rollover="RO_GOTO_MOTEL|u">
		<Job type="Move" x="74" y="222"/>
		<Job type="SetOrientation" direction="NW"/>
		<Job type="SwitchScene" scene="Motel"/>
	</Action>

	<Action color="FF0000" type="CommandCharacter" chr="brawe" rollover="RO_WINDMILL_GOTO_INSIDE|r">
		<Job type="Move" x="228" y="269"/>
		<Job type="SetOrientation" direction="NE"/>
		<Job type="SwitchScene" scene="WindmillInterior"/>
	</Action>

	<Action color="603913" type="CommandCharacter" chr="brawe" rollover="RO_MOLDMAKER">
		<Job type="Move" x="397" y="270"/>
		<Job type="SetOrientation" direction="NW"/>
		<Job type="Say" key="MOLDMAKER_LOOK_01" />
	</Action>

	<if t="not $charged_battery">
		<Action color="003663" type="ItemAction" rollover="RO_PIG">
			<Action itemaction="noitem" type="CommandCharacter" chr="brawe">
				<Job type="Move" x="420" y="268.5"/>
				<Job type="SetOrientation" direction="NE"/>
				<Job type="Say" key="PIG_LOOK_01"/>
			</Action>
			<Action itemaction="battery" type="CommandCharacter" chr="brawe">
				<Job type="Move" x="420" y="268.5"/>
				<Job type="SetOrientation" direction="NE"/>
				<Job type="Animate" ani="Take"/>
				<Job type="PlaySound" sound="ion_battery_working"/>
				<Job type="Pause" time="1"/>
				<Job type="AddItem" item="recharged_battery"/>
				<Job type="SetVar" var="charged_battery" value="1"/>
				<Job type="RemoveItem" item="battery"/>
				<Job type="Animate" ani="TakeBack"/>
				<Job type="Say" key="BATTERY_RECHARGED"/>
			</Action>
		</Action>
	</if>
	<if t="$charged_battery">
		<Action color="003663" type="CommandCharacter" chr="brawe" rollover="RO_PIG">
			<Job type="Move" x="420" y="268.5"/>
			<Job type="SetOrientation" direction="NE"/>
			<Job type="Say" key="PIG_LOOK_01"/>
		</Action>
	</if>
</Scene>