[logic]
active = sr_idle@wait

[sr_idle@wait]
on_info  = {+jup_aspirant_mother_heart_dialog_yes} sr_idle@cemetery_1 %=clear_smart_terrain(x5_a2) =clear_smart_terrain(x5_a4)%
on_info2 = {+jup_aspirant_mother_heart_dialog_no} sr_idle@quest_control_10 %=clear_smart_terrain(x5_a2) =clear_smart_terrain(x5_a4)%

[sr_idle@cemetery_1]
on_game_timer  = 10 | sr_idle@cemetery_2 %=create_squad(jup_a5_zombi_1_squad:jup_a5) =create_squad(jup_a5_zombi_2_squad:jup_a5) =create_squad(jup_a5_zombi_3_squad:jup_a5)%

[sr_idle@cemetery_2]
on_game_timer  = 30 | sr_idle@cemetery_3 %=create_squad(jup_a5_zombi_4_squad:jup_a5) =create_squad(jup_a5_zombi_5_squad:jup_a5) =create_squad(jup_a5_zombi_6_squad:jup_a5)%

[sr_idle@cemetery_3]
on_game_timer  = 30 | sr_idle@cemetery_4 %=create_squad(jup_a5_zombi_7_squad:jup_a5) =create_squad(jup_a5_zombi_8_squad:jup_a5)%

[sr_idle@cemetery_4]
on_info  = {+jup_a5_zombie_1_offline =is_squad_online(jup_a5_zombi_1_squad)} %=squad_is_offline(jup_a5_zombi_1_squad)%
on_info2 = {+jup_a5_zombie_2_offline =is_squad_online(jup_a5_zombi_2_squad)} %=squad_is_offline(jup_a5_zombi_2_squad)%
on_info3 = {+jup_a5_zombie_3_offline =is_squad_online(jup_a5_zombi_3_squad)} %=squad_is_offline(jup_a5_zombi_3_squad)%
on_info4 = {+jup_a5_zombie_4_offline =is_squad_online(jup_a5_zombi_4_squad)} %=squad_is_offline(jup_a5_zombi_4_squad)%
on_info5 = {+jup_a5_zombie_5_offline =is_squad_online(jup_a5_zombi_5_squad)} %=squad_is_offline(jup_a5_zombi_5_squad)%
on_info6 = {+jup_a5_zombie_6_offline =is_squad_online(jup_a5_zombi_6_squad)} %=squad_is_offline(jup_a5_zombi_6_squad)%
on_info7 = {+jup_a5_zombie_7_offline =is_squad_online(jup_a5_zombi_7_squad)} %=squad_is_offline(jup_a5_zombi_7_squad)%
on_info8 = {+jup_a5_zombie_8_offline =is_squad_online(jup_a5_zombi_8_squad)} %=squad_is_offline(jup_a5_zombi_8_squad)%
on_info9 = {+start_spawn_mother_heart} sr_idle@cemetery_5 %=disable_ui =run_postprocess(black:3009:true) =all_squads_online(jup_a5_zombi_1_squad:jup_a5_zombi_2_squad:jup_a5_zombi_3_squad:jup_a5_zombi_4_squad:jup_a5_zombi_5_squad:jup_a5_zombi_6_squad:jup_a5_zombi_7_squad:jup_a5_zombi_8_squad)%

[sr_idle@cemetery_5]
on_game_timer  = 20 | sr_idle@cemetery_6 %=stop_postprocess(3009) =enable_ui =actor_arrived()%

[sr_idle@cemetery_6]
on_game_timer  = 10 | sr_idle@quest_control_2 %+all_zombies_wake_up%

[sr_idle@quest_control_2]
on_info  = {+jup_aspirant_mother_heart_dialog_1_yes} sr_idle@quest_control_10
on_info2 = {+jup_aspirant_mother_heart_dialog_1_no}  sr_idle@quest_control_3 %=give_task( mother_heart_baloon ) =give_task( mother_heart_lena )%
on_info3 = {+jup_aspirant_mother_heart_dialog_1_self}  sr_idle@quest_control_10
on_info4 = {+actor_aspirant_quest_fail} sr_idle@quest_control_10

[sr_idle@quest_control_3]
on_info  = {+jup_lena_mother_heart_dialog_end -jup_lena_mother_heart_return_dialog_klava} sr_idle@quest_control_10
on_info2 = {+jup_bubble_mother_heart_dialog_end}  sr_idle@quest_control_10
on_info3 = {+jup_lena_mother_heart_dialog_end +jup_lena_mother_heart_return_dialog_klava} sr_idle@quest_control_4 

[sr_idle@quest_control_4]
on_game_timer  = 100 | sr_idle@quest_control_5 %=send_message( bar_a2_duty_leader_message3:bar_a2_duty_leader:russibic_name:30000 )%

[sr_idle@quest_control_5]
on_game_timer  = 50 | sr_idle@quest_control_6 %=give_task( russibic_qwest_3 ) +start_russibic_qwest_3%

[sr_idle@quest_control_6]
on_game_timer  = 43200 | sr_idle@quest_control_7

[sr_idle@quest_control_7]
on_info = {=dist_between_actor_and_smart_ge(jup_a17:150)} sr_idle@quest_control_8 %=remove_squad(jup_a17_rebel_squad)%

[sr_idle@quest_control_8]
on_game_timer  = 30 | sr_idle@quest_control_12 %=create_squad(jup_a17_rebel_new_squad:jup_a17)%

[sr_idle@quest_control_10]
on_game_timer  = 50 | sr_idle@quest_control_11 %=send_message( bar_a2_duty_leader_message3:bar_a2_duty_leader:russibic_name:30000 )%

[sr_idle@quest_control_11]
on_game_timer  = 50 | sr_idle@quest_control_12 %=give_task( russibic_qwest_3 ) +start_russibic_qwest_3%
;
;
;--------------------------------------------------Продолжаем отслеживать квесты после финала в Х-5
;
;
[sr_idle@quest_control_12]
on_info  = {+jup_sher_food_probl_dial_yes} sr_idle@quest_control_13 %=clear_smart_terrain(jup_a18)%
on_info2 = {+jup_sher_food_probl_dial_no} sr_idle@quest_control_15
on_info3 = {+lab_lena_selection_var_two_dialog_end} sr_idle@quest_control_22 %=spawn_object(af_antaeus:af_antaeus_jup_way) =spawn_ids_objects(sr_jup_tonnel_kontr) +jup_tonnel_door_open%

[sr_idle@quest_control_13]
on_game_timer  = 20 | sr_idle@quest_control_14 %=create_squad(jup_a18_agent_3_squad:jup_a18) =create_squad(jup_a18_agent_4_squad:jup_a18) =create_squad(jup_a18_agent_5_squad:jup_a18)%

[sr_idle@quest_control_14]
on_info  = {+jup_a18_agent_4_squad_dead +jup_a18_agent_3_squad_dead +jup_a18_agent_5_squad_dead} sr_idle@quest_control_15 %+jup_sher_food_probl_dial_no%

[sr_idle@quest_control_15]
on_info  = {=is_squad_online(jup_a6_ecolog_squad)} sr_idle@quest_control_16 %=set_squads_neutral_to_actor(jup_a6_ecolog_squad)%

[sr_idle@quest_control_16]
on_info   = {+jup_bot_all_inves_art_dial_end}   sr_idle@quest_control_17 %=create_squad_member(agent_stalker_key:jup_a8_agent_squad)%
on_info2  = {+jup_bot_all_inves_money_dial_end} sr_idle@quest_control_19 %=create_squad_member(agent_stalker_1:jup_a8_agent_squad)%
on_info3  = {+jup_bot_all_inves_think_dial_end} %-jup_bot_all_inves_think_dial_end =remove_squads(jup_a8_agent_squad) -stop_sim_jup_b6%

[sr_idle@quest_control_17]
on_info  = {=actor_has_item(tonnel_key)} sr_idle@quest_control_18 %+actor_has_jup_tonnel_key =spawn_object(af_antaeus:af_antaeus_jup_way) =create_squad(jup_a5_zombied_sim_squad:jup_a5) -stop_sim_jup_b6%

[sr_idle@quest_control_18]
on_info  = {=actor_has_item(af_antaeus)} sr_idle@quest_control_19 %+actor_has_tonnel_af_antaeus =spawn_ids_objects(sr_jup_tonnel_kontr)%

[sr_idle@quest_control_19]
on_info  = {=actor_has_item(jup_shtern_key)} sr_idle@quest_control_20 %+actor_has_jup_shtern_key -stop_sim_jup_b6%

[sr_idle@quest_control_20]
on_info = {+jup_shtern_key_done} sr_idle@quest_control_21 %=spawn_ids_objects(jup_shtern_book)%

[sr_idle@quest_control_21]
on_info  = {=actor_has_item(jup_shtern_book)} sr_idle@quest_control_22 %+actor_has_jup_shtern_book =actor_is_thinking( thoughts_in_my_head_22 )%

[sr_idle@quest_control_22]
on_info   = {+bar_kon_all_inv_heli_dial_1_end}  sr_idle@quest_control_23
on_info2  = {+bar_kon_all_inv_mine_dial_1_end}  sr_idle@quest_control_24
on_info3  = {+bar_kon_all_inv_rec_dial_1_end}   sr_idle@quest_control_24

[sr_idle@quest_control_23]
on_info = {+jup_heli_2_dead +jup_heli_1_dead} sr_idle@quest_control_24 %+all_jup_heli_dead =create_squad(bar_a1_garik_squad:bar_a1)%

[sr_idle@quest_control_24]
on_info = {+bar_kon_all_inv_dial_2_end}  sr_idle@quest_control_25 %=spawn_ids_objects(sr_switch_shtern_bunker:sr_actor_shtern_bunker:tex_document_three:sr_shtern_bunker_1:sr_shtern_bunker_2:sr_shtern_bunker_3:sr_shtern_bunker_4:tex_document_one:tex_document_two)%

[sr_idle@quest_control_25]
on_game_timer  = 20 | sr_idle@quest_control_26 %=create_squad(jup_a33_kiborg_squad:jup_a33) =create_squad(jup_a33_stern_squad:jup_a33)%

[sr_idle@quest_control_26]
on_info = {=actor_has_items(tex_document_one:tex_document_two:tex_document_three) +sr_shtern_bunker_1_done +sr_shtern_bunker_2_done +sr_shtern_bunker_3_done +sr_shtern_bunker_4_done} sr_idle@quest_control_27 %+all_stern_components_done =kill_squad(jup_a26_kib_final_squad)%

[sr_idle@quest_control_27]
on_info = {+actor_rukzak_shtern_done}  sr_idle@quest_control_28 %=create_squad(jup_a33_degtyrev_squad:jup_a33) =create_squad(jup_a33_razrab_squad:jup_a33)%

[sr_idle@quest_control_28]
on_game_timer  = 60 | sr_idle@quest_control_29 %=remove_npc(actor_rukzak) =bomb_explode(actor_rukzak_bomb) +actor_rukzak_shtern_explode +jup_b205_pass_code_valide%

[sr_idle@quest_control_29]
on_info  = {+start_va_freeplay_game} sr_idle@quest_control_32 %=run_postprocess(fade_in:8610) =disable_ui()%
;-------------------------------------------------
;-------------------Конец игры--------------------
;-------------------------------------------------
on_info2 = {+no_freeplay_va_game_over} sr_idle@quest_control_30 %=run_postprocess(fade_in:8610) =disable_ui()%

[sr_idle@quest_control_30]
on_game_timer  = 20 |  sr_idle@quest_control_31 %=run_postprocess(black:3009:true) =add_cs_text_no_blink(av_game_over_text)%

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

[sr_idle@end]
on_game_timer  = 10 | sr_idle@nil %=stop_game_show_credits%

[sr_idle@nil]

;--------------------------------------------------
;--------------Подготовка фриплей игры-------------
;--------------------------------------------------
[sr_idle@quest_control_32]
on_game_timer  = 20 |  sr_idle@quest_control_33 %=run_postprocess(black:3009:true) =add_cs_text_no_blink(av_game_freeplay_text)%

[sr_idle@quest_control_33]
on_game_timer  = 20 |  sr_idle@quest_control_34 %=remove_squads(bar_a2_valera_squad:bar_a2_trio_squad:jup_a33_razrab_squad:bar_a3_southern_zastava_squad:bar_a1_geonezis_squad:bar_a2_dolg_squad:bar_a4_northern_zastava_squad:jup_a33_degtyrev_squad:bar_a2_duty_leader_squad)%

[sr_idle@quest_control_34]
on_game_timer  = 40 |  sr_idle@quest_control_35 %=create_squad(bar_a2_degtyrev_squad:bar_a13) =create_squad(bar_a7_medic_squad:bar_a7)%

[sr_idle@quest_control_35]
on_game_timer  = 20 |  sr_idle@quest_control_36 %=create_squad_member(bar_a2_pilot:bar_a10_dolg_squad:bar_a10_spawn_point)%

[sr_idle@quest_control_36]
on_game_timer  = 20 |  sr_idle@quest_control_37 %=create_squad_member(bar_a1_proveren_3:bar_a1_proveren_squad)%

[sr_idle@quest_control_37]
on_game_timer  = 20 |  sr_idle@quest_control_38 %=create_squad_member(bar_a3_zastava_guarder_1:bar_a8_proveren_squad:bar_a8_spawn_point)%

[sr_idle@quest_control_38]
on_game_timer  = 20 |  sr_idle@quest_control_39 %=create_squad_member(bar_a3_zastava_guarder_2:bar_a8_proveren_squad:bar_a8_spawn_point)%

[sr_idle@quest_control_39]
on_game_timer  = 20 |  sr_idle@quest_control_40 %=create_squad_member(bar_a3_zastava_guarder_3:bar_a8_proveren_squad:bar_a8_spawn_point)%

[sr_idle@quest_control_40]
on_info   = sr_idle@quest_control_41 %=create_squad_member(bar_a3_zastava_guarder_4:bar_a7_proveren_squad)%

[sr_idle@quest_control_41]
on_game_timer  = 20 |  sr_idle@quest_control_42 %=clear_corpses =cleaner_weapons  -level_surge_stop -level_fallout__stop%

[sr_idle@quest_control_42]
on_game_timer  = 30 |  sr_idle@quest_control_43 %=del_cs_text_no_blink =teleport_actor(jupiter_to_bar_walk:jupiter_to_bar_look) =forward_game_time(1) -actor_arrived%

;--------------------------------------------------
;---Заглушка, если левел ченджер не подхватил ГГ---
;--------------------------------------------------
[sr_idle@quest_control_43]
on_info  = {+fplay_degtyr_dialog_end} sr_idle@quest_control_44
on_info2 = {-fplay_degtyr_dialog_end} %=teleport_actor(jupiter_to_bar_walk:jupiter_to_bar_look) -actor_arrived%

;--------------------------------------------------
;----------------------Фриплей---------------------
;--------------------------------------------------
[sr_idle@quest_control_44]
on_info  = {+fplay_lesnik_1_dialog_end} sr_idle@quest_control_45

[sr_idle@quest_control_45]
on_game_timer  = 30 |  sr_idle@nil %=give_task( fplay_aspirant_quest )%
