diff --git a/atlantis.lua b/atlantis.lua --- a/atlantis.lua +++ b/atlantis.lua @@ -18,6 +18,7 @@ global { atl_lfc_state = 0; atl_lfc_panic = 0; + atl_lfc_panic_warning = 0; atl_lfc_hallrooms = 0; atl_lfc_electric = 0; atl_lfc_board = 0; @@ -53,7 +54,13 @@ atl_illuminator = obj { atl_intersect_phone = obj { nam = "Телефон"; dsc = [[На одной из стен укреплен {телефонный аппарат} в герметичном контейнере. ]]; - act = [[Вам незачем кому-то звонить. ]]; + act = function(s) + if (atl_lfc_state == 1 and atl_lfc_panic == 1 and atl_lfc_panic_warning == 0) then + walkin("panic_first_warning_dlg"); + else + return [[Вам незачем кому-то звонить. ]]; + end; + end; }; atl_intersect_suit = obj { @@ -194,18 +201,43 @@ atl_aqua_main_corridor = room { }; }; -atl_intersection_aqua_dom = room { +atl_intersection = inherit(room, function(v) + v.disp = "Атлантида, межсекционный коридор"; + v.dsc = [[Небольшой коридор, соединяющий секции станции, заполнен ярким светом электрических ламп. ]]; + v.entered = function(s) + if (atl_lfc_state == 1) then + if (atl_lfc_panic == 1) then + if (atl_lfc_panic_warning == 0) then + pr([[Когда вы проходите мимо, телефон начинает звонить. ]]); + end; + elseif (atl_lfc_panic == 2) then + if (atl_lfc_panic_warning < 2) then + atl_lfc_panic_warning = 2; + end; + elseif (atl_lfc_panic == 3) then + walk("game_over_banished_lfc"); + end; + end; + end; + v.left = function(s) + if (atl_lfc_state == 1) then + atl_lfc_panic_warning = 1; + end; + end; + if (not v.obj) then + v.obj = {}; + end; + table.insert(v.obj, "atl_illuminator"); + table.insert(v.obj, "atl_intersect_phone"); + table.insert(v.obj, "atl_intersect_suit"); +end); + +atl_intersection_aqua_dom = atl_intersection { nam = "Атлантида, межсекционный коридор"; - dsc = [[Небольшой коридор, соединяющий секции станции, заполнен ярким светом электрических ламп. ]]; way = { kh_vroom("В секцию \"Аква\"", "atl_aqua_main_corridor"); kh_vroom("В секцию \"Доминус\"", "atl_dom_main_near_aqua"); }; - obj = { - "atl_illuminator", - "atl_intersect_phone", - "atl_intersect_suit" - }; }; atl_dom_main_near_aqua = room {