[logic]
active = ph_idle@wait

[ph_idle@wait]
on_actor_in_zone = sr_teleport_zone | ph_code@locked

[ph_code@locked]
on_check_code1 = 10 | %+check_radar_x%
on_check_code2 = 20 | %+check_military_x%
on_check_code3 = 30 | %+check_limansk_x%
on_check_code4 = 40 | %+check_darkscape_x%
on_check_code5 = 50 | %+check_aver_x%
on_check_code6 = 60 | %+check_chaes_x%
on_check_code7 = 70 | %+check_laba_x%
on_check_code8 = 80 | %+check_redlim_x%
;
on_info  = {+check_radar_x} ph_idle@open_1 %-actor_in_teleport%
on_info2 = {+check_military_x} ph_idle@open_2 %-actor_in_teleport%
on_info3 = {+check_limansk_x} ph_idle@open_3 %-actor_in_teleport%
on_info4 = {+check_darkscape_x} ph_idle@open_4 %-actor_in_teleport%
on_info5 = {+check_aver_x} ph_idle@open_5 %-actor_in_teleport%
on_info6 = {+check_chaes_x} ph_idle@open_6 %-actor_in_teleport%
on_info7 = {+check_laba_x} ph_idle@open_7 %-actor_in_teleport%
on_info8 = {+check_redlim_x} ph_idle@open_8 %-actor_in_teleport%

[ph_idle@open]
nonscript_usable = false
tips = teleport_x
on_info = {-redlim_x -radar_x -military_x -limansk_x -darkscape_x -aver_x -chaes_x -laba_x} ph_idle@wait_1 %-check_redlim_x -check_radar_x -check_military_x -check_limansk_x -check_darkscape_x -check_aver_x -check_chaes_x -check_laba_x%

[ph_idle@wait_1]
on_actor_not_in_zone = sr_teleport_zone | ph_idle@wait

[ph_idle@open_1]
on_info = {+access_radar_resolved} ph_idle@open %+radar_x%
on_info2 = {-access_radar_resolved} ph_code@locked %-check_radar_x%

[ph_idle@open_2]
on_info = {+access_military_resolved} ph_idle@open %+military_x%
on_info2 = {-access_military_resolved} ph_code@locked %-check_military_x%

[ph_idle@open_3]
on_info = {+access_limansk_resolved} ph_idle@open %+limansk_x%
on_info2 = {-access_limansk_resolved} ph_code@locked %-check_limansk_x%

[ph_idle@open_4]
on_info = {+access_darkscape_resolved} ph_idle@open %+darkscape_x%
on_info2 = {-access_darkscape_resolved} ph_code@locked %-check_darkscape_x%

[ph_idle@open_5]
on_info = {+access_aver_resolved} ph_idle@open %+aver_x%
on_info2 = {-access_aver_resolved} ph_code@locked %-check_aver_x%

[ph_idle@open_6]
on_info = {+access_chaes_resolved} ph_idle@open %+chaes_x%
on_info2 = {-access_chaes_resolved} ph_code@locked %-check_chaes_x%

[ph_idle@open_7]
on_info = {+access_laba_resolved} ph_idle@open %+laba_x%
on_info2 = {-access_laba_resolved} ph_code@locked %-check_laba_x%

[ph_idle@open_8]
on_info = {+access_redlim_resolved} ph_idle@open %+redlim_x%
on_info2 = {-access_redlim_resolved} ph_code@locked %-check_redlim_x%
