Changeset - 2a6cebe6e43e
[Not reviewed]
default
0 4 0
Silverwing - 7 years ago 2017-04-15 08:57:43

422
4 files changed with 56 insertions and 18 deletions:
0 comments (0 inline, 0 general)
atlantis.lua
Show inline comments
 
@@ -71,48 +71,56 @@ atl_aqua_corridor_b = room {
 
				pr("Люк наглухо задраен. Вы не сможете его открыть. ");
 
				return false;
 
			elseif (atl_lev_state == 1) then
 
				return "atl_lev_radcliffe_dlg";
 
			else
 
				return "atl_aqua_leviathan_dock";
 
			end;
 
		end);
 
		kh_vroom("В гостевой док B", function()
 
			pr("Люк наглухо задраен. Вы не сможете его открыть. ");
 
			return false;
 
		end);
 
		kh_vroom("В гостевой док C", function()
 
			pr("Люк наглухо задраен. Вы не сможете его открыть. ");
 
			return false;
 
		end);
 
		kh_vroom("В главный коридор", "atl_aqua_main_corridor");
 
	};
 
	obj = {
 
		"atl_illuminators",
 
		"atl_nih_tubes_aqua_b"
 
	};
 
};
 
 
atl_entry = lcutscene("atl_entry", "Левиафан, рубка", function(s)
 
    if (ArrayUtils.indexOf(pl.party, "wright") ~= 0) then
 
        return [[Несколько недель Левиафан полным ходом несется по направлению к танственной точке, отмеченной на карте. Путешествие происходит спокойно -- могучие машины субмарины уверенно двигают ее вперед. Хотя субмарина явно требует большего экипажа, вы неплохо справляетесь вдвое и добираетесь до места назначения. Здесь, на океанском дне вы видите несколько больших металлических и стеклянных куполов, освещенных электрическими огнями. Приблизившись, вы быстро находите путь в одно из строений. Как только Левиафан проникает внутрь, массивные ворота закрываются, оставляя вас взаперти. ]];
 
    else
 
        return [[Несколько недель Левиафан полным ходом несется по направлению к танственной точке, отмеченной на карте. Путешествие происходит спокойно -- могучие машины субмарины уверенно двигают ее вперед. Управлять субмариной в одиночку нелегкая работа. Вы почти не спите, опасаясь оставлять движение корабль без внимания. К счатью, вы без проблем добираетесь до места назначения. Здесь, на океанском дне вы видите несколько больших металлических и стеклянных куполов, освещенных электрическими огнями. Приблизившись, вы быстро находите путь в одно из строений. Как только Левиафан проникает внутрь, массивные ворота закрываются, оставляя вас взаперти. ]];
 
    end;
 
end, "Вы прибыли на Атлантиду", leviathan_wheelhouse);
 
 
atl_aqua_leviathan_dock = room {
 
	var {
 
		visited = false;
 
	};
 
	nam = "Атлантида, Аква, гостевой док A";
 
	enter = function(s)
 
		if (not s.visited) then
 
			s.visited = true;
 
			walk(atlantis_intro_dock);
 
		end;
 
		if (atl_iyh_state == 8) then
 
			atl_iyh_state = 9;
 
			if (atl_iof_learr_dead) then
 
				walk('iyh_outro_aikerjarr');
 
			else
 
				walk('iyh_outro_learr');
 
			end;
 
		end;
 
	end;
 
	dsc = [[Просторное помещение, предназнавенное для размещения субмарин, прибывающих на станцию. В настоящий момент в этом доке расположен Левиафан. Под потолком, на высоте примерно в пять метров укреплены балки, по которым могут перемещаться крюки подъемных кранов. Снизу, под водой, огромный люк закрывает доступ внутрь дока. Несколько легких подвижных мостиков находятся на поверхности воды. ]];
 
	view = [[Левиафан находится в просторном доке. Под потолком на высоте пяти метров укреплены балки, по которым могут перемещаться крюки подъемных кранов. Внизу расположен закрытый люк, закрывающий вам путь наружу. ]];
 
	way = {
 
		kh_vroom("В коридор B", "atl_aqua_corridor_b");
 
	};
leviathan.lua
Show inline comments
 
@@ -543,49 +543,48 @@ leviathan_life_support = darkroom {
 
};
 
 
leviathan_airtanks = obj {
 
	nam = "leviathan_airtanks";
 
	dsc = function(s)
 
		local percent = submarine_leviathan.air_level / 432000 * 100;
 
		if (percent < 1) then
 
			return [[Большую часть помещения занимают {кислородные баллоны}. Толстые стенки из прочного сплава способны выдержать огромное давление. Судя по показаниям приборов, баллоны пусты. ]]
 
		else
 
			return [[Большую часть помещения занимают {кислородные баллоны}. Толстые стенки из прочного сплава способны выдержать огромное давление. Судя по показаниям приборов, баллоны заполнены на ]] .. tostring(math.floor(percent + 0.5)) .. "%. ";
 
		end;
 
	end;
 
	seen_level = 1;
 
};
 
 
leviathan_airregen = obj {
 
	nam = "leviathan_airregen";
 
	dsc = function(s)
 
        if (submarine_leviathan.refit) then
 
            return [[{Установка регенерации воздуха} расположена в углу и, судя по показаниям приборов, отлично работает. ]];
 
        else
 
            return [[{Установка регенерации воздуха} сейчас находится в плачевном состоянии - часть деталей отсутствуют, еще некоторые поломаны. ]];
 
        end;
 
    end;
 
    end;
 
	seen_level = 1;
 
};
 
 
leviathan_wheelhouse = darkroom {
 
	nam = "leviathan_wheelhouse";
 
    has_light = function(s)
 
        return submarine_leviathan.power_on and submarine_leviathan.battery;
 
    end;   
 
	disp = "Левиафан, рубка";
 
	leviathan = true;
 
	dsc_lit = function(s)
 
		local view = "";
 
		if (type(where(submarine_leviathan).view) == "function") then
 
			view = where(submarine_leviathan):view();
 
		else
 
			view = where(submarine_leviathan).view;
 
		end;
 
		
 
		return [[Небольшое помещение в передней части субмарины освещено ярким светом электрических ламп. Через три огромных иллюминатора вы можете увидеть происходящее снаружи субмарины. ]] .. (view);
 
	end;
 
	dsc_halflit = function(s)
 
		local view = "";
 
		if (type(where(submarine_leviathan).view) == "function") then
 
			view = where(submarine_leviathan):view();
 
@@ -842,53 +841,52 @@ leviathan_dlg = dlg {
 
			leviathan_dlg:pon("atlantis");
 
		end;
 
		if (temple_found and where(submarine_leviathan) ~= iyh_far_from_entrance_foot) then
 
			leviathan_dlg:pon("old_temple");
 
		end;
 
		if (nearest_cities_found) then
 
			if (where(submarine_leviathan) ~= ctt_iraa_city) then
 
				leviathan_dlg:pon("iraaphaanotrr");
 
			end;
 
			if (where(submarine_leviathan) ~= ctt_dyp_city) then
 
				leviathan_dlg:pon("dypatreanotrr");
 
			end;
 
		end;
 
		if (iraaphaanotrr_temple_found and where(submarine_leviathan) ~= ctt_iraa_near_temple) then
 
			leviathan_dlg:pon("iraaphaanotrr_temple");
 
		end;
 
		if (dypatreanotrr_temple_found and where(submarine_leviathan) ~= ctt_dyp_temple_entrance) then
 
			leviathan_dlg:pon("dypatreanotrr_temple");
 
		end;
 
	end;
 
	enter = function(s)
 
		s.update_options();
 
	end;
 
	phr = {
 
		{tag="atlantis", always = "true", "Атлантида", function()
 
			return "Вы прибыли в Атлантиду";
 
		end, function()
 
		{tag="atlantis", always = "true", "Атлантида", nil, function()
 
			move(submarine_leviathan, "atl_aqua_leviathan_dock");
 
			leviathan_dlg:update_options();
 
            walk(atl_entry);         
 
		end},
 
		{tag="old_temple", always = "true", "Старый храм", function()
 
			return "Вы прибыли в старый храм";
 
		end, function()
 
			move(submarine_leviathan, "iyh_far_from_entrance_foot");
 
			leviathan_dlg:update_options();
 
		end},
 
		{tag="iraaphaanotrr", always = "true", "Ираафаанотр", function()
 
			return "Вы прибыли в Ираафаанотр";
 
		end, function()
 
			move(submarine_leviathan, "ctt_iraa_city");
 
			leviathan_dlg:update_options();
 
		end},
 
		{tag="iraaphaanotrr_temple", always = "true", "Храм Ираафаанотра", function()
 
			return "Вы прибыли в храм Ираафаанотра";
 
		end, function()
 
			move(submarine_leviathan, "ctt_iraa_near_temple");
 
			leviathan_dlg:update_options();
 
		end},
 
		{tag="dypatreanotrr", always = "true", "Дипатреанотр", function()
 
			return "Вы прибыли в Дипатреанотр";
 
		end, function()
 
			move(submarine_leviathan, "ctt_dyp_city");
 
			leviathan_dlg:update_options();
main.lua
Show inline comments
 
@@ -163,62 +163,71 @@ function init()
 
	warehouse18_init();
 
	warehouse32_init();
 
    
 
    local nums = {1,2,3,4,5,6};
 
    for i = 1, 4 do 
 
        local index = rnd(#nums);
 
        table.insert(dt_code, nums[index]);
 
        table.remove(nums, index);
 
    end;
 
    nums = {1,2,3,4,5,6};
 
    for i = 1, 3 do 
 
        local index = rnd(#nums);
 
        table.insert(dt_buttons, nums[index]);
 
        table.remove(nums, index);
 
    end;
 
	---game init
 
	pl.where = intro;
 
	---debug	
 
    --pl.where = "atlantis_intro_dock";
 
    
 
    ---leviathan
 
    --pl.where = "leviathan_airlock";
 
    --submarine_leviathan.airpump = false;
 
    
 
    --leviathan_airlock.has_light = true;
 
    --leviathan_wardroom.has_light = true;
 
    --leviathan_wheelhouse.has_light = true;
 
    --leviathan_corridor.has_light = true;
 
    --leviathan_cabin_1.has_light = true;
 
    --leviathan_cabin_2.has_light = true;
 
    --leviathan_cabin_3.has_light = true;
 
    --leviathan_cabin_4.has_light = true;
 
    --leviathan_cabin_5.has_light = true;
 
    --leviathan_captains_cabin.has_light = true;
 
    --leviathan_cargo_hold.has_light = true;
 
    --leviathan_engines.has_light = true;
 
    --leviathan_lower_deck.has_light = true;
 
    --leviathan_life_support.has_light = true;
 
    leviathan_airlock.has_light = true;
 
    leviathan_wardroom.has_light = true;
 
    leviathan_wheelhouse.has_light = true;
 
    leviathan_corridor.has_light = true;
 
    leviathan_cabin_1.has_light = true;
 
    leviathan_cabin_2.has_light = true;
 
    leviathan_cabin_3.has_light = true;
 
    leviathan_cabin_4.has_light = true;
 
    leviathan_cabin_5.has_light = true;
 
    leviathan_captains_cabin.has_light = true;
 
    leviathan_cargo_hold.has_light = true;
 
    leviathan_engines.has_light = true;
 
    leviathan_lower_deck.has_light = true;
 
    leviathan_life_support.has_light = true;
 
    submarine_leviathan.air_level = 432000;
 
    submarine_leviathan.battery = true; 
 
    submarine_leviathan.battery_charge = 100;
 
    submarine_leviathan.circuit_breaks = 0;
 
    submarine_leviathan.valves_to_replace = 0;
 
    submarine_leviathan.power_on = true
 
    pl.party = {'wright'};
 
    atlantis_found = true;
 
    pl.where = leviathan_wheelhouse;
 
	--[[
 
	---IYH
 
	lifeon(char_learr);
 
	lifeon(char_wright);
 
	lifeon(char_radcliffe);
 
	lifeon(char_anna);
 
	lifeon(char_aikerjarr_lev);
 
	pl.party = {'learr', 'wright', 'radcliffe', 'anna'};
 
	atlantis_found = true;
 
	move(submarine_leviathan, "ctt_dyp_temple_entrance");
 
	--move(submarine_leviathan, "iyh_far_from_entrance_foot");
 
	pl.where = leviathan_wheelhouse;
 
	submarine_leviathan.battery = true; -- Состояние батареи 
 
	submarine_leviathan.battery_charge = 100; -- Уровень заряда батареи
 
	submarine_leviathan.circuit_breaks = 0; -- Разрывы цепи
 
	submarine_leviathan.valves_to_replace = 0; -- Количество клапанов, которые нужно заменить для полноценной работы
 
	submarine_leviathan.power_on = true; -- включена ли энергия
 
	submarine_leviathan.air_level = 432000; -- запас воздуха. Максимум - 5 дней(5 * 24 * 60 * 60 = 432000)
 
	submarine_leviathan.airpump = false;
 
	leviathan_airlock.has_light = true;
 
	leviathan_wardroom.has_light = true;
 
	leviathan_wheelhouse.has_light = true;
 
	leviathan_corridor.has_light = true;
 
	leviathan_cabin_1.has_light = true;
utils.lua
Show inline comments
 
@@ -274,48 +274,71 @@ end;
 
 
function game_over(nam, dsc)
 
    return room {
 
        nam = nam;
 
        disp = "Игра окончена";
 
        hideinv = true;
 
        dsc = dsc;
 
    };
 
end;
 
 
function cutscene(nam, disp, dsc, nxt, entered)
 
    return room {
 
        nam = nam;
 
        disp = disp;
 
        entered = entered;
 
        hideinv = true;
 
        cutscene = true;
 
        dsc = dsc;
 
        obj = {
 
            vway("continue", "{Продолжить}", nxt);
 
        };
 
    };
 
end;
 
 
function lcutscene(nam, disp, dsc, msg, nxt)
 
    return room {
 
        var {
 
            state = 0;
 
        };
 
        nam = nam;
 
        disp = disp;
 
        enter = function(s)
 
            if (s.state == 1) then
 
                walk(nxt);
 
                pn(msg);
 
            end;
 
            s.state = 1;
 
        end;
 
        dsc = dsc;
 
        obj = {
 
            kh_vobj("continue", "{Продолжить}", function(s)
 
                walk(nxt);
 
            end);
 
        };
 
    };
 
end;
 
 
--[[
 
	Создает комнату с полем для ввода числа длиной не более tab.maxlen
 
	По нажатии enter вызывает метод tab.сheck
 
	Приглашение для ввода: tab.label
 
	Вводимый текст: tab.input
 
]]
 
function input_number(tab)
 
	if (not tab.maxlen) then
 
		tab.maxlen = 2;
 
	end;
 
	tab.forcedsc = true;
 
	tab.noinv = true;
 
	tab.input = "";
 
	tab.dsc = function(s)
 
		pr(tab.label .. tab.input .. "_");
 
		return false;
 
		--return tab.label .. tab.input .. "_";
 
	end;
 
	tab.entered = function(s)
 
		s.input = "";
 
		hook_keys('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'backspace', 'return', 'escape');
 
	end;
 
	tab.left = function(s)
 
		unhook_keys('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'backspace', 'return', 'escape');
0 comments (0 inline, 0 general)