[logic@freedom_yar]
active = walker@start
suitable = {=check_npc_name(jup_b19_freedom_yar)}
post_combat_time = 0,0
prior = 200
on_death = death
on_hit = hit


[walker@gen]
def_state_moving = patrol
def_state_standing = guard_na
combat_ignore_cond = {=check_enemy_name(jup_b19_zombied_1) -jup_b19_actor_damaged_zombied} true, {=check_enemy_name(jup_b19_zombied_2) -jup_b19_actor_damaged_zombied} true, {=check_enemy_name(sim_default) =fighting_dist_ge(30)} true
danger = danger
wounded = wounded
gather_items_enabled = false
help_wounded_enabled = false
corpse_detection_enabled = false
on_info2 = {+jup_b19_yar_enemy_or_dead =is_alive} %=kill_npc%
on_offline = {-jup_b19_yar_enemy_or_dead} %+jup_b19_yar_enemy_or_dead%


[camper@gen]
radius = 1
def_state_moving = rush
;def_state_standing = rush
def_state_campering = hide_na
def_state_campering_fire = hide_sniper_fire
combat_ignore_cond = {=check_enemy_name(jup_b19_zombied_1) -jup_b19_actor_damaged_zombied} true, {=check_enemy_name(jup_b19_zombied_2) -jup_b19_actor_damaged_zombied} true, {=check_enemy_name(sim_default) =fighting_dist_ge(30)} true
gather_items_enabled = false
help_wounded_enabled = false
corpse_detection_enabled = false
attack_sound = false
no_retreat = true 
wounded = wounded         
on_info2 = {+jup_b19_yar_enemy_or_dead =is_alive} %=kill_npc%
on_offline = {-jup_b19_yar_enemy_or_dead} %+jup_b19_yar_enemy_or_dead%


[walker@start];:walker@gen
path_walk = yar_1_walk
path_look = yar_1_look
on_info = {=see_actor -jup_b19_arrived} %+jup_b19_arrived%
on_info2 = {+jup_b19_arrived_done} walker@meet
meet = no_meet
def_state_moving = patrol
def_state_standing = guard_na
combat_ignore_cond = true ;{=check_enemy_name(jup_b19_zombied_1) -jup_b19_actor_damaged_zombied} true, {=check_enemy_name(jup_b19_zombied_2) -jup_b19_actor_damaged_zombied} true, {=check_enemy_name(sim_default) =fighting_dist_ge(30)} true
danger = danger
wounded = wounded
gather_items_enabled = false
help_wounded_enabled = false
corpse_detection_enabled = false

[walker@meet];:walker@gen
path_walk = yar_1_walk
path_look = yar_1_look
on_info = {+jup_b19_following_yar} walker@move_to_position
meet = meet@hunter
def_state_moving = patrol
def_state_standing = guard_na
combat_ignore_cond = true ;{=check_enemy_name(jup_b19_zombied_1) -jup_b19_actor_damaged_zombied} true, {=check_enemy_name(jup_b19_zombied_2) -jup_b19_actor_damaged_zombied} true, {=check_enemy_name(sim_default) =fighting_dist_ge(30)} true
danger = danger
wounded = wounded
gather_items_enabled = false
help_wounded_enabled = false
corpse_detection_enabled = false

[walker@move_to_position]:walker@gen
path_walk = yar_2_walk
path_look = yar_2_look
on_info = {+jup_b19_actor_damaged_zombied} camper@move_to_position %=play_sound(jup_b19_freedom_yar_zombie_hit)%
on_signal = point2 | walker@move_to_position_2 
meet = no_meet

[walker@move_to_position_2]:walker@gen
path_walk = yar_3_walk
path_look = yar_3_look
on_info = {+jup_b19_actor_damaged_zombied} camper@move_to_position %=play_sound(jup_b19_freedom_yar_zombie_hit)%
on_signal = point3 | walker@move_to_position_3 %=play_sound(jup_b19_freedom_yar_about_zombie)%
meet = no_meet

[walker@move_to_position_3]:walker@gen
path_walk = yar_4_walk
path_look = yar_4_look
on_info = {+jup_b19_actor_damaged_zombied} camper@move_to_position %=play_sound(jup_b19_freedom_yar_zombie_hit)%
on_signal = point4 | walker@move_to_position_4 %=play_sound(jup_b19_freedom_yar_about_zombie)%
meet = no_meet

[walker@move_to_position_4]:walker@gen
path_walk = yar_5_walk
path_look = yar_5_look
on_info = {+jup_b19_actor_damaged_zombied} camper@move_to_position %=play_sound(jup_b19_freedom_yar_zombie_hit)%
on_signal = point5 | walker@move_to_position_9 %=play_sound(jup_b19_freedom_yar_about_zombie)%
meet = no_meet

[walker@move_to_position_9]:walker@gen
path_walk = yar_10_walk
path_look = yar_10_look
on_info = {+jup_b19_actor_damaged_zombied} camper@move_to_position %=play_sound(jup_b19_freedom_yar_zombie_hit)%
on_signal = point10 | walker@move_to_position_10
meet = no_meet

[walker@move_to_position_10]:walker@gen
path_walk = yar_11_walk
path_look = yar_11_look
on_info = {+jup_b19_actor_damaged_zombied} camper@move_to_position %=play_sound(jup_b19_freedom_yar_zombie_hit)%
on_signal = point11 | walker@move_to_position_11
meet = no_meet

[walker@move_to_position_11]:walker@gen
path_walk = yar_12_walk
path_look = yar_12_look
on_info = {+jup_b19_actor_damaged_zombied} camper@move_to_position %=play_sound(jup_b19_freedom_yar_zombie_hit)%
on_signal = point12 | camper@move_to_position_12 ;walker@move_to_position_12
meet = no_meet
out_restr = jup_b19_sr_actor_close_by_yar

[camper@move_to_position]:camper@gen
path_walk = yar_12_walk
path_look = yar_12_look
on_info = {=npc_in_zone(jup_b19_sr_actor_close_by_yar)} camper@move_to_position_12 ;walker@move_to_position_12
meet = no_meet
out_restr = jup_b19_sr_actor_close_by_yar

[camper@move_to_position_12]:camper@gen
path_walk = yar_12_walk
path_look = yar_15_look
on_info = {!actor_in_zone(jup_b19_sr_actor_close_by_yar)} %=play_sound(jup_b19_freedom_yar_come_here)%, walker@timer_to_ready %+jup_b19_merc_spawned -jup_b19_actor_damaged_zombied%
meet = no_meet
out_restr = jup_b19_sr_actor_close_by_yar


[walker@timer_to_ready]
path_walk = yar_12_walk
path_look = yar_15_look
def_state_standing = hide_na
on_game_timer = 40 | walker@ready %=play_sound(jup_b19_freedom_yar_suspense)%
combat_ignore_cond = {=check_enemy_name(jup_b19_zombied_1) -jup_b19_actor_damaged_zombied} true, {=check_enemy_name(jup_b19_zombied_2) -jup_b19_actor_damaged_zombied} true, {=check_enemy_name(jup_b19_merc)} true,  {=check_enemy_name(sim_default) =fighting_dist_ge(30)} true 
danger = danger
meet = no_meet
wounded = wounded
gather_items_enabled = false
help_wounded_enabled = false
corpse_detection_enabled = false
out_restr = jup_b19_sr_actor_close_by_yar

[walker@ready]
path_walk = yar_12_walk
path_look = yar_15_look
combat_ignore_cond = {=check_enemy_name(jup_b19_zombied_1) -jup_b19_actor_damaged_zombied} true, {=check_enemy_name(jup_b19_zombied_2) -jup_b19_actor_damaged_zombied} true, {=check_enemy_name(jup_b19_merc)} true, {=check_enemy_name(sim_default) =fighting_dist_ge(30)} true
on_info = {+jup_b19_mercs_can_fight} remark@fight 
on_info2 = {+jup_b19_fight_begun} remark@fight 
danger = danger
def_state_standing = hide_na
meet = no_meet
wounded = wounded
gather_items_enabled = false
help_wounded_enabled = false
corpse_detection_enabled = false
out_restr = jup_b19_sr_actor_close_by_yar

[remark@fight]
anim = hide_sniper_fire ;hide
target = path | jup_b19_yar_15_look,0
on_info = %=play_sound(jup_b19_freedom_yar_guessed_short)%
on_signal = sound_end | camper@fight %+jup_b19_fight_begun%
gather_items_enabled = false
help_wounded_enabled = false
corpse_detection_enabled = false
combat_ignore_cond = {=check_enemy_name(jup_b19_zombied_1) -jup_b19_actor_damaged_zombied} true, {=check_enemy_name(jup_b19_zombied_2) -jup_b19_actor_damaged_zombied} true, {=check_enemy_name(jup_b19_merc)} true, {=check_enemy_name(sim_default) =fighting_dist_ge(30)} true
danger = danger	
meet = no_meet 
wounded = wounded
out_restr = jup_b19_sr_actor_close_by_yar

[camper@fight]
path_walk = yar_12_walk
path_look = yar_15_look
radius = 0
no_retreat = true 
def_state_moving = sneak
def_state_moving_fire = sneak_fire
def_state_campering = hide_na
def_state_campering_fire = hide_sniper_fire
combat_ignore_cond = {=check_enemy_name(jup_b19_zombied_1) -jup_b19_actor_damaged_zombied} true, {=check_enemy_name(jup_b19_zombied_2) -jup_b19_actor_damaged_zombied} true, {=check_enemy_name(sim_default) =fighting_dist_ge(30)} true
on_info = {!squad_exist(jup_b19_merc_squad) -jup_b19_actor_damaged_zombied} walker@after_fire
on_info2 = {!squad_exist(jup_b19_merc_squad) +jup_b19_actor_damaged_zombied !squad_exist(jup_b19_kopatci_zombied_squad) -jup_b19_freedom_yar_explanations_done} walker@after_fire
on_info3 = {!squad_exist(jup_b19_merc_squad) +jup_b19_actor_damaged_zombied !squad_exist(jup_b19_kopatci_zombied_squad) +jup_b19_freedom_yar_explanations_done} walker@after_remark
danger = danger
attack_sound = false
meet = meet@camper
wounded = wounded
gather_items_enabled = false
help_wounded_enabled = false
corpse_detection_enabled = false
out_restr = jup_b19_sr_actor_close_by_yar


[walker@after_fire]
path_walk = yar_13_walk
path_look = yar_13_look
def_state_moving = assault
def_state_standing = guard_na
on_signal = remark | remark@after_fire
combat_ignore_cond = {=check_enemy_name(jup_b19_zombied_1) -jup_b19_actor_damaged_zombied} true, {=check_enemy_name(jup_b19_zombied_2) -jup_b19_actor_damaged_zombied} true, {=check_enemy_name(sim_default) =fighting_dist_ge(30)} true
on_info = {+jup_b19_actor_damaged_zombied =squad_exist(jup_b19_kopatci_zombied_squad)} camper@fight %=play_sound(jup_b19_freedom_yar_zombie_hit)% 
danger = danger
meet = no_meet    
wounded = wounded         
gather_items_enabled = false
help_wounded_enabled = false
corpse_detection_enabled = false
;out_restr = jup_b19_sr_actor_close_by_yar


[remark@after_fire]
anim = guard_na
target = story | actor
on_info = {-jup_b19_freedom_yar_explanations_done} %=play_sound(jup_b19_freedom_yar_explanations) +jup_b19_freedom_yar_explanations_done%
on_signal = sound_end | walker@after_remark 
on_info2 = {+jup_b19_actor_damaged_zombied =squad_exist(jup_b19_kopatci_zombied_squad) =is_playing_sound} camper@fight %=stop_sound%, {+jup_b19_actor_damaged_zombied =squad_exist(jup_b19_kopatci_zombied_squad) !is_playing_sound} camper@fight 
;on_info3 = {+jup_b19_freedom_yar_explanations_done} walker@after_remark
meet = no_meet
combat_ignore_cond = {=check_enemy_name(jup_b19_zombied_1) -jup_b19_actor_damaged_zombied} true, {=check_enemy_name(jup_b19_zombied_2) -jup_b19_actor_damaged_zombied} true, {=check_enemy_name(sim_default) =fighting_dist_ge(30)} true
danger = danger
wounded = wounded
gather_items_enabled = false
help_wounded_enabled = false
corpse_detection_enabled = false
;out_restr = jup_b19_sr_actor_close_by_yar

[walker@after_remark]
path_walk = yar_13_walk
path_look = yar_13_look
def_state_moving = patrol
def_state_standing = guard_na
on_info = {+jup_b19_yar_dont_teleport_actor_to_yanov} walker@checkpoint %-jup_b19_dont_break%
on_info2 = {+jup_b19_actor_damaged_zombied -jup_b19_zombied_dead} camper@fight
;on_info3 = {+jup_b19_yar_switch_smart_terrain} %=teleport_npc(jup_a6_spawn_point)%
combat_ignore_cond = {=check_enemy_name(jup_b19_zombied_1) -jup_b19_actor_damaged_zombied} true, {=check_enemy_name(jup_b19_zombied_2) -jup_b19_actor_damaged_zombied} true, {=check_enemy_name(sim_default) =fighting_dist_ge(30)} true
danger = danger
meet = meet@final   
wounded = wounded    
gather_items_enabled = false
help_wounded_enabled = false
corpse_detection_enabled = false
;out_restr = jup_b19_sr_actor_close_by_yar
        
[walker@checkpoint]
path_walk = yar_comeback_2_walk
path_look = yar_comeback_2_look
combat_ignore_cond = {=check_enemy_name(jup_b19_zombied_1) -jup_b19_actor_damaged_zombied} true, {=check_enemy_name(jup_b19_zombied_2) -jup_b19_actor_damaged_zombied} true, {=check_enemy_name(sim_default) =fighting_dist_ge(30)} true 
def_state_moving = rush
def_state_standing = guard_na
on_signal = check | walker@go_to_yanov
meet = no_meet
wounded = wounded
gather_items_enabled = false
help_wounded_enabled = false
corpse_detection_enabled = false


[walker@go_to_yanov]
path_walk = yar_comeback_1_walk
path_look = yar_comeback_1_look
combat_ignore_cond = {=check_enemy_name(jup_b19_zombied_1) -jup_b19_actor_damaged_zombied} true, {=check_enemy_name(jup_b19_zombied_2) -jup_b19_actor_damaged_zombied} true, {=check_enemy_name(sim_default) =fighting_dist_ge(30)} true 
def_state_moving = rush
def_state_standing = guard_na
on_signal = switch | %+jup_b19_yar_switch_smart_terrain%
meet = no_meet
wounded = wounded
gather_items_enabled = false
help_wounded_enabled = false
corpse_detection_enabled = false
out_restr = jup_a6_sr_noweap


[meet@hunter]
close_anim		= guard_na
close_victim    = actor
close_distance  = 3
close_snd_hello = {=actor_has_weapon} meet_hide_weapon, nil
close_snd_bye   = nil
abuse			= true
use				= {+jup_b19_ui_input_enabled} self, false
trade_enable 	= false
allow_break 	= false
meet_dialog		= {+jup_b19_arrived -jup_b19_following_yar} jup_b19_freedom_yar_prepare_start

[meet@final]
close_anim		= guard_na
close_victim    = actor
close_distance  = 3
close_snd_hello = {=actor_has_weapon} meet_hide_weapon, nil
close_snd_bye   = nil
;use			= {=actor_has_weapon} false, true
use				= true
abuse			= true
trade_enable 	= false
allow_break 	= false
meet_dialog		= jup_b19_freedom_yar_done_start

[meet@camper]
close_distance  = 0
close_snd_hello = nil
close_snd_bye   = nil
use = false
snd_on_use =  {=has_enemy} meet_use_no_fight, {!has_enemy} nil
abuse           = false
;snd_on_use = {=has_enemy} meet_use_no_fight, nil

[meet]
;close_anim      = guard
close_victim    = actor
use			= {=actor_enemy} false, true
abuse			= true
trade_enable 	= false
allow_break 	= false

[wounded]
hp_state 		= 0|wounded_heavy@help_heavy
hp_state_see 	= 0|wounded_heavy@help_heavy
hp_victim 		= 0|nil
hp_fight 		= 0|false
hp_cover		= 0|false

[danger]
ignore_distance = 0
ignore_distance_grenade = 0
ignore_distance_corpse = 0
ignore_distance_hit = 0
ignore_distance_sound = 0

[hit]
on_info =  {!actor_enemy} %=restore_health =stop_sound%, %=stop_sound%

[death]
on_info = %+jup_b19_yar_enemy_or_dead =stop_sound%