<?xml version="1.0" encoding="windows-1251"?>
<LevelScripts>
  <Script>
    <Action type="SetLevelVar" var="BuildingsCanGetBroken" value="false" />
    <Action type="SetLevelVar" var="HousesGenerateBonuses" value="false" />

    <!--Покажем на домик без дороги.-->
    <Action type="ShowArrow" overBuildingId="BrickHouse" untilSwitch="Switch.HouseExplained" />
    <Action type="ShowSpeechModal" text="Script.06.ConstructRoad1" character="Assistant" 
            posY="500" />
    <Action type="SetSwitch" switch="Switch.HouseExplained" />

    <!--Покажем не разрыв в дороге.-->
    <Action type="ShowArrow" point="810 440" rotation="225" untilSwitch="Switch.RoadBreakExplained" />
    <Action type="ShowSpeechModal" text="Script.06.ConstructRoad2" character="Assistant" 
            mood="sad" posY="500" />
    <Action type="SetSwitch" switch="Switch.RoadBreakExplained" />

    <!--Покажем на инструмент ДОРОГА и подождем пока игрок ее выберет.-->
    <Action type="SetInputFilter" active="true" inputMask="InputMask.HudButtonRoadBuilder" />
    <Action type="ShowArrow" overHudItem="RoadBuilderBtn" untilSwitch="Switch.RoadBuilderPicked" />
    <Action type="HighlightButton" overHudItem="RoadBuilderBtn" untilSwitch="Switch.RoadBuilderPicked"/>
    <Action type="ShowSpeechUntilSwitch" text="Script.06.ConstructRoad3" character="Assistant" 
            posY="500" 
            switch="Switch.RoadBuilderPicked" />
    <Action type="WaitRoadToolActivated"/>
    <Action type="SetSwitch" switch="Switch.RoadBuilderPicked" />
    
    <!--Подождем пока игрок набалуется ДОРОГОЙ.-->
    <Action type="SetInputFilter" active="true" inputMask="InputMask.Map+InputMask.HudButtonRoadBuilder" />"
    <Action type="ShowArrow" point="810 440" rotation="225" untilSwitch="Switch.HouseConnected" />
    <Action type="ShowSpeechUntilSwitch" text="Script.06.ConstructRoad4" character="Assistant" 
            posY="500" switch="Switch.HouseConnected" />
    <Action type="WaitBuildingConnectedToOffice" buildingId="BrickHouse"/>
    <Action type="SetSwitch" switch="Switch.HouseConnected" />

    <!--Просим выключить инструмент.-->
    <Action type="SetInputFilter" active="true" inputMask="InputMask.Map+InputMask.HudButtonRoadBuilder" />
    <Action type="ShowArrow" overHudItem="RoadBuilderBtn" untilSwitch="Switch.RoadDeactivated" />
    <Action type="ShowSpeechUntilSwitch" text="Script.06.ConstructRoad5" character="Assistant" 
       posY="500" switch="Switch.RoadDeactivated" />
    <Action type="WaitRoadToolDeactivated"/>
    <Action type="SetSwitch" switch="Switch.RoadDeactivated" />
    <Action type="SetInputFilter" active="false" />

    <!--Покажем на инструмент БУЛЬДОЗЕР и подождем пока игрок его выберет.-->
    <Action type="Wait" duration="1" />
    <zzzAction type="ShowArrow" overHudItem="BuldozerBtn" untilSwitch="Switch.BuldozerExplained" />
    <Action type="HighlightButton" overHudItem="BuldozerBtn" untilSwitch="Switch.BuldozerExplained" />
    <Action type="ShowSpeechModal" text="Script.06.Buldozer1" character="Assistant" 
            posY="500"  /> posX="350" posY="320"
    <Action type="SetSwitch" switch="Switch.BuldozerExplained" />

    <Action type="ShowSpeechModal" text="Script.06.Intro" character="Assistant" />

    <!--Подождем два домика и сгенерим чек.-->
    <Action type="WaitBuildingConstructed" />
    <Action type="WaitBuildingConstructed" />

    <Action type="CancelUserActions" />
    <Action type="DropCheck" buildingKind="Any" setBuildingId="CheckBuilding" />
    <Action type="Wait" duration="1.0" />
    <Action type="ShowArrow" overBuildingId="CheckBuilding" untilSwitch="Switch.CheckCollected" />
    <Action type="ShowSpeechUntilSwitch" text="Script.06.Check" character="Assistant"  
            switch="Switch.CheckCollected" />
    <Action type="WaitBuildingCheckCollected" buildingId="CheckBuilding" />
    <Action type="SetSwitch" switch="Switch.CheckCollected" />

    <Action type="SetLevelVar" var="HousesGenerateBonuses" value="true" />
  </Script>

  <!--Скрипт по поломках в домах.-->
  <Script>
    <Action type="WaitGoalCompleted" goalId="Goal.6K" />

    <!--Ждем 4К на счету.-->
    <Action type="WaitGoalCompleted" goalId="Goal.Account4K" />

    <!--Ломаем рандомный домик.-->
    <Action type="DamageBuilding" buildingKind="Any" setBuildingId="DamagedBuilding"/>
    <XXXAction type="Wait" duration="1" />

    <!--Показываем на сломанный дом.-->
    <Action type="CancelUserActions" />
    <Action type="ShowArrow" overBuildingId="DamagedBuilding" untilSwitch="Switch.DamagedBuildingSelected" />
    <Action type="SetInputFilter" active="true" inputMask="InputMask.MapBuildingsOwned" />
    <Action type="ShowSpeechModal" text="Script.06.Damage1" character="Assistant" />

    <!--Просим выбрать дом.-->
    <Action type="CancelUserActions" />
    <Action type="ShowSpeechUntilSwitch" text="Script.06.Damage2" character="Assistant" switch="Switch.BuildingRepairStarted" />
    <Action type="WaitBuildingSelected" buildingId="DamagedBuilding" />
    <Action type="SetSwitch" switch="Switch.DamagedBuildingSelected" />

    <!--Просим начать ремонт.-->
    <Action type="SetInputFilter" active="true" inputMask="InputMask.MapBuildingRepair" />
    <Action type="ShowArrow" overBuildingId="DamagedBuilding" overHudItem="RepairBtn" untilSwitch="Switch.BuildingRepairStarted" />
    <Action type="WaitBuildingRepairStarted" buildingId="DamagedBuilding" />
    <Action type="SetSwitch" switch="Switch.BuildingRepairStarted" />

    <Action type="SetLevelVar" var="CanCancelRepair" value="false" />

    <!--Ждем окончания ремонта.-->
    <Action type="SetInputFilter" active="false" />
    <Action type="ShowSpeechUntilSwitch" text="Script.06.Damage3" character="Assistant" switch="Switch.BuildingRepaired" />
    <Action type="WaitBuildingRepaired" buildingId="DamagedBuilding" />
    <Action type="SetSwitch" switch="Switch.BuildingRepaired" />

    <Action type="SetLevelVar" var="CanCancelRepair" value="true" />

    <!--Позволим остальным домикам ломаться.-->
    <Action type="SetLevelVar" var="BuildingsCanGetBroken" value="true" />
    
    <!--Хвалим.-->
    <Action type="ShowSpeechModal" text="Script.06.Damage4" character="Assistant" pauseGame="false" />

  </Script>
</LevelScripts>