[logic]
active = ph_door@locked_start

[ph_door@locked_start]
locked = true
closed = true
snd_open_start = trader_door_open_start
snd_close_start = trader_door_close_start
snd_close_stop = trader_door_close_stop
on_info = {+val_deliver_ammo_done} ph_door@open_1

[ph_door@locked_main]
locked = true
closed = true
snd_open_start = trader_door_open_start
snd_close_start = trader_door_close_start
snd_close_stop = trader_door_close_stop
on_info = {!is_smart_in_combat(val_smart_terrain_7_3:val_smart_terrain_7_4:val_smart_terrain_7_5)} ph_door@open_1, {!is_smart_captured(val_smart_terrain_7_3) !is_smart_captured(val_smart_terrain_7_4) !is_smart_captured(val_smart_terrain_7_5)} ph_door@open_2

[ph_door@open_1]
locked = false
closed = false
snd_open_start = trader_door_open_start
snd_close_start = trader_door_close_start
snd_close_stop = trader_door_close_stop
on_info = {=is_smart_in_combat(val_smart_terrain_7_3:val_smart_terrain_7_4:val_smart_terrain_7_5) !get_task_by_smart(val_smart_terrain_7_4)} ph_door@locked_main

[ph_door@open_2]
locked = false
closed = false
snd_open_start = trader_door_open_start
snd_close_start = trader_door_close_start
snd_close_stop = trader_door_close_stop
on_info = {=is_smart_captured(val_smart_terrain_7_3)} ph_door@open_1, {=is_smart_captured(val_smart_terrain_7_4)} ph_door@open_1, {=is_smart_captured(val_smart_terrain_7_5)} ph_door@open_1
