diff --git a/atlantis_catching_the_tail.lua b/atlantis_catching_the_tail.lua --- a/atlantis_catching_the_tail.lua +++ b/atlantis_catching_the_tail.lua @@ -389,9 +389,9 @@ ctt_iraa_l1_end = darkroom { end; obj = { - 'ctt_iraa_keyholes' - 'ctt_iraa_keyhole1' - 'ctt_iraa_keyhole2' + 'ctt_iraa_keyholes', + 'ctt_iraa_keyhole1', + 'ctt_iraa_keyhole2', 'ctt_iraa_keyhole3' }; }; @@ -535,7 +535,7 @@ ctt_iraa_pedestal1 = obj { }; nam = "ctt_iraa_pedestal1"; dsc = function(s) - if (s.state == 0) + if (s.state == 0) then return [[ На {пьедестале слева} установлено коралловое копье. ]]; @@ -565,7 +565,7 @@ ctt_iraa_pedestal2 = obj { }; nam = "ctt_iraa_pedestal2"; dsc = function(s) - if (s.state == 0) + if (s.state == 0) then return [[ На {центральном пьедестале} установлено коралловое копье. ]]; @@ -597,7 +597,7 @@ ctt_iraa_pedestal3 = obj { }; nam = "ctt_iraa_pedestal1"; dsc = function(s) - if (s.state == 0) + if (s.state == 0) then return [[ На {пьедестале справа} установлено коралловое копье. ]]; @@ -826,7 +826,7 @@ ctt_dyp_priest_dlg = dlg { {always=true, "[Я пойду]", [[ Навьяр остается не подвижен. ]], code [[ back(); ]]}; - {tag="lseryanotrr"} + {tag="lseryanotrr"}; {"[Почему?]", [[ [Лсэрианотр - город навьяров. Хевьяр туда не идет]. ]]}; @@ -1007,17 +1007,22 @@ ctt_dyp_temple_l1 = room { }; }; -ctt_dyp_button_const = function(nam, index) - obj { +ctt_dyp_button_ctr = function(nam, index) + return obj { nam = nam; dsc = function(s) + local im = "images/dyp_bg.png"; + for i = 1, #ctt_dyp_temple_l2.buttons[index] do + im = im .. ";images/dyp_" .. tostring(ctt_dyp_temple_l2.buttons[index][i]) .. ".png"; + end; if (ctt_dyp_temple_l2.pressed_buttons[index]) then - return "{Рычаг №"..tostring(index).."} включен."; + return "{Рычаг с символами " .. img(im) .."} включен.^"; else - return "{Рычаг №"..tostring(index).."} выключен."; + return "{Рычаг с символами " .. img(im) .."} выключен.^"; end; end; act = function(s) + ctt_dyp_temple_l2:check(index); return [[ Вы переключаете рычаг и узор на полу комнаты меняется ]]; @@ -1026,13 +1031,14 @@ ctt_dyp_button_const = function(nam, ind end; ctt_dyp_temple_l2 = room { - var = { + var { active_parts = {false, false, false, false, false, false, false, false, false, false, false, false}; pressed_buttons = {false, false, false, false, false, false, false, false}; + solved = false; }; buttons = { {1, 5, 9, 11, 12}; - {1,2,3,4}; + {1, 2, 3, 4}; {4, 8, 10, 11, 12}; {2, 4, 5, 6}; {1, 5, 7, 9, 10, 11, 12}; @@ -1040,20 +1046,388 @@ ctt_dyp_temple_l2 = room { {1, 3, 7, 8}; {3, 7, 9, 10, 11}; }; + pic = function(s) + local pic = 'images/dyp_bg.png'; + local cnt = 0; + for i = 1, #s.active_parts do + if (s.active_parts[i]) then + cnt = cnt + 1; + pic = pic .. ";images/dyp_" .. tostring(i) .. ".png"; + end; + end; + if (cnt > 0) then + return pic; + else + return nil; + end; + end; nam = "Храм Дипатреанотра, второй этаж"; dsc = [[ Большой круглый плохо освещенный зал. В центре зала расположено восемь рычагов, рядом с которыми нанесены какие-то символы. ]]; obj = { - ctt_dyp_button_const("ctt_dyp_b1", 1); - ctt_dyp_button_const("ctt_dyp_b2", 2); - ctt_dyp_button_const("ctt_dyp_b3", 3); - ctt_dyp_button_const("ctt_dyp_b4", 4); - ctt_dyp_button_const("ctt_dyp_b5", 5); - ctt_dyp_button_const("ctt_dyp_b6", 6); - ctt_dyp_button_const("ctt_dyp_b7", 7); - ctt_dyp_button_const("ctt_dyp_b8", 8); + ctt_dyp_button_ctr("ctt_dyp_b1", 1); + ctt_dyp_button_ctr("ctt_dyp_b2", 2); + ctt_dyp_button_ctr("ctt_dyp_b3", 3); + ctt_dyp_button_ctr("ctt_dyp_b4", 4); + ctt_dyp_button_ctr("ctt_dyp_b5", 5); + ctt_dyp_button_ctr("ctt_dyp_b6", 6); + ctt_dyp_button_ctr("ctt_dyp_b7", 7); + ctt_dyp_button_ctr("ctt_dyp_b8", 8); + }; + way = { + kh_vroom("На первый этаж", "ctt_dyp_temple_l1"):disable(); + kh_vroom("На третий этаж", "ctt_dyp_temple_l3"):disable(); + }; + check = function(s, index) + s.pressed_buttons[index] = not s.pressed_buttons[index]; + + for i = 1, #s.active_parts do + s.active_parts[i] = false; + end; + + for i = 1, #s.pressed_buttons do + if (s.pressed_buttons[i]) then + for j = 1, #s.buttons[i] do + s.active_parts[s.buttons[i][j]] = not s.active_parts[s.buttons[i][j]]; + end; + end; + end; + + s.solved = true; + for i = 1, #s.active_parts do + if (not s.active_parts[i]) then + s.solved = false; + break; + end; + end; + + if (s.solved) then + path("На первый этаж"):enable(); + path("На третий этаж"):enable(); + end; + end; +}; + +ctt_dyp_temple_l3 = room { + nam = "Храм Дипатреанотра, третий этаж"; + dsc = [[ + Небольшая овальная комната, в центре которой расположены три статуи. На стене выгравирована надпись на навьярском языке: "[Каждый получит свое. Воин - оружие. Мудрец - знания. Вождь - власть]". + ]]; + entered = function(s) + if (not ctt_dyp_statue1.looked) then + ctt_dyp_statue_ped1:disable(); + end; + if (not ctt_dyp_statue2.looked) then + ctt_dyp_statue_ped2:disable(); + end; + if (not ctt_dyp_statue3.looked) then + ctt_dyp_statue_ped3:disable(); + end; + if (not ctt_dyp_statue1.set or not ctt_dyp_statue2.set or not ctt_dyp_statue3.set) then + lifeon(s); + end; + end; + left = function(s) + lifeoff(s); + end; + life = function(s) + if (ctt_dyp_statue1.set and ctt_dyp_statue2.set and ctt_dyp_statue3.set) then + return [[ + Двери открываются, позволяя вам пройти дальше. + ]]; + end; + end; + way = { + kh_vroom("На второй этаж", "ctt_dyp_temple_l2"):disable(); + kh_vroom("Вглубь храма", "ctt_dyp_temple_corridor_1"):disable(); + }; + obj = { + 'ctt_dyp_spear', + 'ctt_dyp_statue1', + 'ctt_dyp_statue_ped1', + 'ctt_dyp_statue2', + 'ctt_dyp_statue_ped2', + 'ctt_dyp_statue3', + 'ctt_dyp_statue_ped3' }; }; +ctt_dyp_spear = obj { + nam = "ctt_dyp_spear"; + dsc = [[ + На полу у входа лежит коралловое {копье}. + ]]; + act = function(s) + take(s); + return [[ + Вы поднимаете копье. + ]]; + end; +}; +ctt_dyp_lightdisk = obj { + nam = "ctt_dyp_lightdisk"; + dsc = [[ + {светодиск}. + ]]; + act = function(s) + take(s); + return [[ + Вы поднимаете светодиск. + ]]; + end; +}; + +ctt_dyp_key = obj { + nam = "ctt_dyp_key"; + dsc = [[ + {ключ}. + ]]; + act = function(s) + take(s); + return [[ + Вы поднимаете ключ. + ]]; + end; +}; + +ctt_dyp_statue1 = obj { + var { + looked = false; + set = false; + }; + nam = "ctt_dyp_statue1"; + dsc = function(s) + if (s.set) then + return [[ + {Первая статуя} изображает навьяра, задумчиво смотрящего перед собой. В левой руке статуи лежит фигурка ската. + ]]; + else + return [[ + {Первая статуя} изображает навьяра, задумчиво смотрящего перед собой. Левая рука статуи вытянута, словно в ожидании чего-то. + ]]; + end; + end; + act = function(s) + if (not s.looked) then + s.looked = true; + ctt_dyp_statue_ped1:enable(); + return [[ + Вы замечаете выемку в пьедестале под статуей. + ]]; + else + return [[ + Вы не замечаете ничего интересного. + ]]; + end; + end; + use = function(s, o) + if (o == ctt_dyp_ray) then + remove(ctt_dyp_ray); + s.set = true; + return [[ + Вы помещаете фигурку ската в руку статуи. + ]]; + end; + end; +}; + +ctt_dyp_statue2 = obj { + var { + looked = false; + set = false; + }; + nam = "ctt_dyp_statue2"; + dsc = function(s) + if (s.set) then + return [[ + {Вторая статуя} изображает навьяра в боевой стойке. В правой руке статуи лежит фигурка акулы. + ]]; + else + return [[ + {Вторая статуя} изображает навьяра в боевой стойке. Правая рука статуи вытянута, словно в ожидании чего-то. + ]]; + end; + end; + act = function(s) + if (not s.looked) then + s.looked = true; + ctt_dyp_statue_ped2:enable(); + return [[ + Вы замечаете выемку в пьедестале под статуей. + ]]; + else + return [[ + Вы не замечаете ничего интересного. + ]]; + end; + end; + use = function(s, o) + if (o == ctt_dyp_shark) then + remove(ctt_dyp_shark); + s.set = true; + return [[ + Вы помещаете фигурку акулы в руку статуи. + ]]; + end; + end; +}; + +ctt_dyp_statue3 = obj { + var { + looked = false; + set = false; + }; + nam = "ctt_dyp_statue3"; + dsc = function(s) + if (s.set) then + return [[ + {Третья статуя} изображает навьяра, гордо смотрящего вперед. В правой руке статуи лежит фигурка навьяра. + ]]; + else + return [[ + {Третья статуя} изображает навьяра, гордо смотрящего вперед. Правая рука статуи вытянута, словно в ожидании чего-то. + ]]; + end; + end; + act = function(s) + if (not s.looked) then + s.looked = true; + ctt_dyp_statue_ped3:enable(); + return [[ + Вы замечаете выемку в пьедестале под статуей. + ]]; + else + return [[ + Вы не замечаете ничего интересного. + ]]; + end; + end; + use = function(s, o) + if (o == ctt_dyp_navjiarr) then + remove(ctt_dyp_navjiarr); + s.set = true; + return [[ + Вы помещаете фигурку навьяра в руку статуи. + ]]; + end; + end; +}; + +ctt_dyp_statue_ped1 = obj { + nam = "ctt_dyp_statue_ped1"; + dsc = [[ + В пьедестале первой статуи вы замечаете {выемку}. + ]]; + act = [[ + На пьедестале выгравировано копье. + ]]; + use = function(s, o) + if (o == ctt_dyp_spear) then + remove(ctt_dyp_spear); + take(ctt_dyp_shark); + return [[ + Копье полностью входит в выемку. В пьедестале открывается другая выемка, в которой лежит маленькая фигурка акулы. + ]]; + end; + end; +}; + +ctt_dyp_statue_ped2 = obj { + nam = "ctt_dyp_statue_ped2"; + dsc = [[ + В пьедестале второй статуи вы замечаете {выемку}. + ]]; + act = [[ + На пьедестале выгравирован ключ. + ]]; + use = function(s, o) + if (o == ctt_dyp_key) then + remove(ctt_dyp_key); + take(ctt_dyp_navjiarr); + return [[ + Ключ входит в выемку. В пьедестале открывается другая выемка, в которой лежит маленькая фигурка навьяра. + ]]; + end; + end; +}; + +ctt_dyp_statue_ped3 = obj { + nam = "ctt_dyp_statue_ped3"; + dsc = [[ + В пьедестале третьей статуи вы замечаете {выемку}. + ]]; + act = [[ + На пьедестале выгравирован ключ. + ]]; + use = function(s, o) + if (o == ctt_dyp_lightdisk) then + remove(ctt_dyp_lightdisk); + take(ctt_dyp_navjiarr); + return [[ + Светодиск входит в выемку. В пьедестале открывается другая выемка, в которой лежит маленькая фигурка ската. + ]]; + end; + end; +}; + +ctt_dyp_shark = obj { + nam = "ctt_dyp_shark"; + dsp = "Акула"; + inv = [[ + Каменная фигурка акулы. + ]]; +}; + +ctt_dyp_navjiarr = obj { + nam = "ctt_dyp_navjiarr"; + dsp = "Навьяр"; + inv = [[ + Каменная фигурка навьяра. + ]]; +}; + +ctt_dyp_ray = obj { + nam = "ctt_dyp_ray"; + dsp = "Скат"; + inv = [[ + Каменная фигурка ската. + ]]; +}; + +ctt_dyp_temple_corridor_1 = room { + nam = "Храм Дипатреанотра, коридор"; + dsc = [[ + Узкий извилистый темный коридор, ведущий куда-то вглубь скалы. + ]]; + way = { + kh_vroom("Идти дальше", "ctt_dyp_temple_corridor_2"); + kh_vroom("Идти назад", "ctt_dyp_temple_l3"); + }; +}; + +ctt_dyp_temple_corridor_2 = room { + nam = "Храм Дипатреанотра, коридор"; + dsc = [[ + Узкий извилистый темный коридор, ведущий куда-то вглубь скалы. + ]]; + way = { + kh_vroom("Идти дальше", "ctt_dyp_temple_corridor_3"); + kh_vroom("Идти назад", "ctt_dyp_temple_corridor_1"); + }; +}; + +ctt_dyp_temple_corridor_3 = room { + nam = "Храм Дипатреанотра, коридор"; + dsc = [[ + Конец коридора. Массивная каменная дверь закрывает проход. Перед дверью установлен небольшой пьедестал. + ]]; + way = { + kh_vroom("Выйти из храма", "ctt_dyp_temple_entrance"):disable(); + kh_vroom("Идти назад", "ctt_dyp_temple_corridor_2"); + }; + obj = { + "item_navjiarr_chart_dyp"; + }; +}; \ No newline at end of file diff --git a/images/dyp_bg.png b/images/dyp_bg.png new file mode 100644 index 0000000000000000000000000000000000000000..449b653f9ca11eb32135c5aa113bdd7e4c327285 GIT binary patch literal 192 zc%17D@N?(olHy`uVBq!ia0vp^4j|0I1SD0tpLGH$wvr&fV21x7XdWS53l!lj@Q5sC zVBk9f!i-b3`J{n@37#&FAr*7po_FMBP!Kp^aA5y)XO{l9l+X=tXGYpvTRjM6j-mkG ZVl7(5T