[logic]
active = sr_idle@wait

[sr_idle@wait]
on_info = {+pr_a16_fp_agent_squad_dead +pr_a16_fp_1_agent_squad_dead +pr_a16_fp_2_agent_squad_dead} sr_idle@quest_control_1 %+pr_a16_all_agents_dead%

[sr_idle@quest_control_1]
on_info = {=actor_has_item(flash_radar_pripyat)} sr_idle@quest_control_2 %+level_pripyat_to_radar_ok%

[sr_idle@quest_control_2]
on_game_timer = 30 | sr_idle@quest_control_3 %=give_task( fplay_glomar_1_quest )%

[sr_idle@quest_control_3]
on_info = {=dist_between_actor_and_smart_ge(pr_a16:300) +fplay_glomar_1_dialog_end} sr_idle@quest_control_4 %=remove_squads(radar_a10_stalker_squad) +pr_a16_under_stalkers%

[sr_idle@quest_control_4]
on_info = sr_idle@quest_control_5 %=create_squad(pr_a16_stalker_squad:pr_a16)%

[sr_idle@quest_control_5]
on_info = {+pr_a21_fp_agent_squad_dead +pr_a21_fp_1_agent_squad_dead} sr_idle@quest_control_6 %=remove_squads(bar_a3_dolg_squad)%

[sr_idle@quest_control_6]
on_info = sr_idle@quest_control_7 %=create_squad(bar_a3_fp_dolg_squad:bar_a3)%

[sr_idle@quest_control_7]
on_info  = {=dist_between_actor_and_smart_ge(pr_a21:300) +fplay_inkv_dialog_money} sr_idle@quest_control_8 %=send_message( bar_a2_dolg_3_message:bar_a2_dolg_3:bar_a2_dolg_3_name:30000 ) =give_money_to_actor(10000)%
on_info2 = {=dist_between_actor_and_smart_ge(pr_a21:300) +fplay_inkv_dialog_habar} sr_idle@quest_control_7_1 %=spawn_ids_objects(inkviz_treasure)%

[sr_idle@quest_control_7_1]
on_game_timer = 30 | sr_idle@quest_control_8 %=send_message( bar_a2_dolg_3_message1:bar_a2_dolg_3:bar_a2_dolg_3_name:30000 ) =set_treasure_spot(inkviz_treasure)%

[sr_idle@quest_control_8]
on_info = sr_idle@quest_control_9 %=create_squad(pr_a21_fp_dolg_squad:pr_a21) +fplay_inkv_quest_done%

[sr_idle@quest_control_9]
on_info = {+fplay_gupi_quest_done +fplay_winchester_quest_done} sr_idle@quest_control_10 %+spawn_pr_a24_degtyrev_squad%

[sr_idle@quest_control_10]
on_info = {=dist_between_actor_and_smart_ge(pr_a12:200)} sr_idle@quest_control_11 %=create_squad(pr_a12_fp_lena_squad:pr_a12)%

[sr_idle@quest_control_11]
on_info = sr_idle@quest_control_12 %=remove_squads(bar_a2_sesa_squad:bar_a2_degtyrev_squad) =create_squad(bar_a13_fp_contra_squad:bar_a13)%

[sr_idle@quest_control_12]
on_info = {=dist_between_actor_and_smart_ge(pr_a24:200)} sr_idle@quest_control_13 %=create_squad(pr_a24_fp_degtyrev_squad:pr_a24)%

[sr_idle@quest_control_13]
on_info = {=squad_exist(pr_a24_fp_degtyrev_squad)} sr_idle@quest_control_14 %=give_task( fplay_degtyr_2_quest ) +actor_can_speak_fplay_degtyr_2_quest%

[sr_idle@quest_control_14]
on_info = {+fplay_stalkerden_dialog_end} sr_idle@quest_control_15 %=remove_squads(pr_a24_fp_degtyrev_squad) +stop_spawn_pr_a6_sim_agent%

[sr_idle@quest_control_15]
on_game_timer = 30 | sr_idle@quest_control_16 %=create_squad(pr_a7_fp_degtyrev_squad:pr_a7) =clear_smart_terrain(pr_a6)%

[sr_idle@quest_control_16]
on_info = sr_idle@quest_control_17 %=spawn_ids_objects(sr_pr_a6_out_restr_1:sr_pr_a6_out_restr_2:sr_pr_a6_out_restr_3:sr_pr_a6_out_restr_4)%

[sr_idle@quest_control_17]
on_game_timer = 30 | sr_idle@quest_control_18 %=create_squad(pr_a6_fp_agent_squad:pr_a6) =create_squad(pr_a6_fp_agent_1_squad:pr_a6)%

[sr_idle@quest_control_18]
on_game_timer = 30 | sr_idle@quest_control_19 %=create_squad(pr_a6_fp_agent_2_squad:pr_a6) =create_squad(pr_a6_fp_agent_3_squad:pr_a6)%

[sr_idle@quest_control_19]
on_game_timer = 30 | sr_idle@quest_control_20 %=send_message( pr_a7_stalker_degtyrev_message:pr_a7_stalker_degtyrev:jup_stalker_dectyrev_name:15000 )%

[sr_idle@quest_control_20]
on_game_timer = 10 | sr_idle@quest_control_21 %=give_task( fplay_quest_final )%
;
;-------------------------------диалог с Дегтяревым
;

[sr_idle@quest_control_21]
on_info  = {+fplay_final_degtyr_dialog_attack_end}  sr_idle@quest_control_22
on_info2 = {+fplay_final_degtyr_dialog_defense_end} sr_idle@quest_control_37
;
;------------------------------------------------Атака
;

[sr_idle@quest_control_22]
on_info  = {+pr_a6_fp_agent_squad_dead =squad_in_zone(pr_a7_fp_degtyrev_squad:sr_pr_a6_out_restr_1)} sr_idle@quest_control_23 %+pr_a7_fp_degtyrev_in_zone%
on_info2 = {=dist_between_actor_and_smart_ge(pr_a6:150)} sr_idle@nil %=clear_smart_terrain(pr_a6) +fplay_quest_final_reversed =clear_heli_customstatic%

[sr_idle@quest_control_23]
on_info = {+pr_a6_fp_agent_1_squad_dead +pr_a6_fp_agent_2_squad_dead +pr_a6_fp_agent_3_squad_dead} sr_idle@quest_control_24 %=create_squad(pr_a6_body_hrapov_squad:pr_a6)%
on_info2 = {=dist_between_actor_and_smart_ge(pr_a6:150)} sr_idle@nil %=clear_smart_terrain(pr_a6) +fplay_quest_final_reversed =clear_heli_customstatic%

[sr_idle@quest_control_24]
on_game_timer = 10 | sr_idle@quest_control_25 %=create_squad(pr_a6_hrapov_squad:pr_a6)%
on_info = {=dist_between_actor_and_smart_ge(pr_a6:150)} sr_idle@nil %=clear_smart_terrain(pr_a6) +fplay_quest_final_reversed =clear_heli_customstatic%

[sr_idle@quest_control_25]
on_info  = {+hrapov_has_actor_hit +pr_a6_body_hrapov_squad_dead} sr_idle@quest_control_26 %=actor_show_weapon(false)%
on_info2 = {=dist_between_actor_and_smart_ge(pr_a6:150)} sr_idle@nil %=clear_smart_terrain(pr_a6) +fplay_quest_final_reversed =clear_heli_customstatic%

[sr_idle@quest_control_26]
on_info  = {+fplay_final_hrapov_dialog_end} sr_idle@quest_control_27 %=actor_show_weapon(true)%
on_info2 = {=dist_between_actor_and_smart_ge(pr_a6:150)} sr_idle@nil %=clear_smart_terrain(pr_a6) +fplay_quest_final_reversed =actor_show_weapon(true) =clear_heli_customstatic%

[sr_idle@quest_control_27]
on_game_timer = 100 | sr_idle@quest_control_28 %+may_kill_hrapov%
on_info  = {+pr_a6_hrapov_squad_dead} sr_idle@quest_control_28

[sr_idle@quest_control_28]
on_game_timer  = 10 |  sr_idle@quest_control_29 %=show_freeplay_dialog(st_freeplay_text_yes_no:true)%

[sr_idle@quest_control_29]
on_info  = {+pri_a28_actor_in_zone_leave} sr_idle@quest_control_30 %=disable_ui =run_postprocess(black:3009:true)%
on_info2 = {+pri_a28_actor_in_zone_stay}  sr_idle@quest_control_33 %=disable_ui =run_postprocess(black:3009:true)%

[sr_idle@quest_control_30]
on_game_timer  = 10 |  sr_idle@quest_control_31 %=teleport_actor(pr_no_smart_actor_walk:pr_no_smart_actor_look) =add_cs_text_no_blink(av_game_over_text)%

[sr_idle@quest_control_31]
on_game_timer  = 130 |  sr_idle@quest_control_32 %=del_cs_text_no_blink%

[sr_idle@quest_control_32]
on_game_timer  = 10 | sr_idle@nil %=run_tutorial(outro_game)%

[sr_idle@quest_control_33]
on_game_timer  = 10 | {=squad_exist(pr_a7_fp_degtyrev_squad)} sr_idle@quest_control_34 %=respawn_squad_new_smart(pr_a7_fp_degtyrev_squad:pr_a24:pr_a24_fp_1_degtyrev_squad)%
on_game_timer2 = 10 | {!squad_exist(pr_a7_fp_degtyrev_squad)} sr_idle@quest_control_36

[sr_idle@quest_control_34]
on_info = {=squad_exist(pr_a24_fp_1_degtyrev_squad)} sr_idle@quest_control_35 %=teleport_actor(pr_a24_actor_walk:pr_a24_actor_look) -level_surge_stop%

[sr_idle@quest_control_35]
on_game_timer  = 20 | sr_idle@nil %=forward_game_time(2) =stop_postprocess(3009) =enable_ui%

[sr_idle@quest_control_36]
on_game_timer  = 20 | sr_idle@quest_control_35 %=teleport_actor(pr_a24_actor_walk:pr_a24_actor_look) -level_surge_stop%
;
;
;
;------------------------------------------------Защита
;

[sr_idle@quest_control_37]
on_info = {+pr_a7_fp_agent_1_squad_dead +pr_a7_fp_agent_2_squad_dead +pr_a7_fp_agent_3_squad_dead +pr_a7_fp_agent_squad_dead} sr_idle@quest_control_38 %+pr_a7_all_fp_agent_squad_dead%
on_info2 = {=dist_between_actor_and_smart_ge(pr_a7:150)} sr_idle@nil %=clear_smart_terrain(pr_a7) +fplay_quest_final_reversed%

[sr_idle@quest_control_38]
on_info  = {=dist_between_actor_and_smart_ge(pr_a7:150)} sr_idle@nil %=clear_smart_terrain(pr_a7) +fplay_quest_final_reversed%
on_info2 = {+fplay_final_degtyr_2_dialog_end} sr_idle@quest_control_39 %=disable_ui =run_postprocess(black:3009:true)%

[sr_idle@quest_control_39]
on_info = sr_idle@quest_control_40 %=teleport_actor(pr_a1_smart_actor_walk:pr_a1_smart_actor_look)%

[sr_idle@quest_control_40]
on_info = sr_idle@quest_control_41 %=remove_squads(pr_a7_fp_degtyrev_squad) =create_squad(pr_a1_hrapov_squad:pr_a1)%

[sr_idle@quest_control_41]
on_info = {!squad_exist(pr_a7_fp_degtyrev_squad)} sr_idle@quest_control_42 %=create_squad(pr_a1_fp_degtyrev_squad:pr_a1)%

[sr_idle@quest_control_42]
on_info = {=is_squad_online(pr_a1_fp_degtyrev_squad)} sr_idle@quest_control_43

[sr_idle@quest_control_43]
on_game_timer  = 20 | sr_idle@quest_control_44 %=stop_postprocess(3009) =enable_ui%

[sr_idle@quest_control_44]
on_info = {+pr_a1_degtyrev_on_pos +pr_a1_sesa_on_pos +pr_a1_lena_on_pos} sr_idle@quest_control_45 %+actor_arrived_at_stadion%
on_info2 = {=dist_between_actor_and_smart_ge(pr_a1:150)} sr_idle@nil %=clear_smart_terrain(pr_a1) +fplay_quest_final_reversed =clear_heli_customstatic%

[sr_idle@quest_control_45]
on_info  = {+hrapov_has_actor_hit +pr_a1_body_hrapov_squad_dead} sr_idle@quest_control_46 %=actor_show_weapon(false)%
on_info2 = {=dist_between_actor_and_smart_ge(pr_a1:150)} sr_idle@nil %=clear_smart_terrain(pr_a1) +fplay_quest_final_reversed =clear_heli_customstatic%

[sr_idle@quest_control_46]
on_info  = {+fplay_final_hrapov_dialog_end} sr_idle@quest_control_47 %=actor_show_weapon(true)%
on_info2 = {=dist_between_actor_and_smart_ge(pr_a1:150)} sr_idle@nil %=clear_smart_terrain(pr_a1) +fplay_quest_final_reversed =actor_show_weapon(true) =clear_heli_customstatic%

[sr_idle@quest_control_47]
on_game_timer = 100 | sr_idle@quest_control_48 %+may_kill_hrapov%
on_info  = {+pr_a1_hrapov_squad_dead} sr_idle@quest_control_48

[sr_idle@quest_control_48]
on_game_timer  = 10 |  sr_idle@quest_control_49 %=show_freeplay_dialog(st_freeplay_text_yes_no:true)%

[sr_idle@quest_control_49]
on_info  = {+pri_a28_actor_in_zone_leave} sr_idle@quest_control_50 %=disable_ui =run_postprocess(black:3009:true)%
on_info2 = {+pri_a28_actor_in_zone_stay}  sr_idle@quest_control_53 %=disable_ui =run_postprocess(black:3009:true)%

[sr_idle@quest_control_50]
on_game_timer  = 10 |  sr_idle@quest_control_51 %=teleport_actor(pr_no_smart_actor_walk:pr_no_smart_actor_look) =add_cs_text_no_blink(av_game_over_text)%

[sr_idle@quest_control_51]
on_game_timer  = 130 |  sr_idle@quest_control_52 %=del_cs_text_no_blink%

[sr_idle@quest_control_52]
on_game_timer  = 10 | sr_idle@nil %=run_tutorial(outro_game)%

[sr_idle@quest_control_53]
on_game_timer  = 10 | {=squad_exist(pr_a1_fp_degtyrev_squad)} sr_idle@quest_control_34 %=respawn_squad_new_smart(pr_a1_fp_degtyrev_squad:pr_a24:pr_a24_fp_1_degtyrev_squad)%
on_game_timer2 = 10 | {!squad_exist(pr_a1_fp_degtyrev_squad)} sr_idle@quest_control_54

[sr_idle@quest_control_54]
on_game_timer  = 20 | sr_idle@quest_control_35 %=teleport_actor(pr_a24_actor_walk:pr_a24_actor_look) -level_surge_stop%

[sr_idle@nil]
