Changeset - 6a8a5d28230f
[Not reviewed]
default
0 2 0
Silverwing - 8 years ago 2016-03-03 17:50:17

More fixes
2 files changed with 20 insertions and 21 deletions:
0 comments (0 inline, 0 general)
main.lua
Show inline comments
 
@@ -134,13 +134,13 @@ function init()
 
	pl.where = intro;
 
	put(submarine_leviathan:disable(), dock_mooring);
 
	---debug
 
	-- pl.where = warehouse_32_entry;
 
	-- pl.where = warehouse_32_night;
 
	-- pl.where = w32_mgr;
 
	-- put(item_toolbox, pl);
 
	-- put(item_cogs, pl);
 
	-- put(item_pump_details, pl);
 
	-- put(item_electrodes, pl);
 
	-- put(item_lamp, pl);
 
	put(item_lamp, pl);
 
	-- pl.where = aurora_borealis;
 
	-- move(submarine_leviathan, first_city_entrance);
 
	-- move(submarine_leviathan, first_city_outer_east);
warehouse32.lua
Show inline comments
 
@@ -101,6 +101,7 @@ warehouse_32_night = room {
 
 
warehouse_32_alley_night = darkroom {
 
	nam = "warehouse_32_alley_night";
 
	disp = "Переулок у склада 32";
 
	dsc_halflit = [[
 
		Вы стоите в небольшом грязном переулке неподалеку от склада 32. 
 
	]];
 
@@ -108,8 +109,8 @@ warehouse_32_alley_night = darkroom {
 
		Вы стоите в небольшом грязном переулке неподалеку от склада 32. Здесь совсем темно и вы ничего не видите. 
 
	]];
 
	way = {
 
		vroom("К главному входу", "warehouse_32_night", 0);
 
		vroom("Пройти дальше", "warehouse_32_behind_night", 1);
 
		kh_vroom("К главному входу", "warehouse_32_night", 2);
 
		kh_vroom("Пройти дальше", "warehouse_32_behind_night", 1);
 
	};
 
};
 
 
@@ -185,6 +186,8 @@ w32_mgr = darkroom {
 
	book_inplace = true;
 
	way = {
 
		kh_vroom("Выйти", function(s)
 
			print(w32_mgr.key_inplace);
 
			print(w32_mgr.book_inplace);
 
			if (not w32_mgr.key_inplace or not w32_mgr.book_inplace) then
 
				pr("Стоит вернуть все как было. ");
 
				return false;
 
@@ -300,11 +303,6 @@ w32_mgr_bookcase = obj {
 
	};
 
};
 
 
w32_frontdoor = room {
 
	nam = "w32_frontdoor";
 
	--TODO decide if this s#!t is needed
 
};
 
 
warehouse_32_definitions = {
 
	---line E
 
	["01"] = { name="у задней двери", dsc=[[
 
@@ -400,8 +398,8 @@ warehouse_32_definitions = {
 
		
 
	]], e3 = "41", corner = true};
 
	["52"] = { name="у входа", dsc=[[
 
		К северу от вас расположен главный вход склада. 
 
	]], e3 = "42", ex1 = "w32_frontdoor"};
 
		К северу от вас расположен главный вход склада, но он заперт. 
 
	]], e3 = "42"};
 
	["53"] = { name="тупик", dsc=[[
 
		
 
	]], e3 = "43", corner = true};
 
@@ -481,7 +479,7 @@ warehouse_32 = room {
 
	guardTurn = function(s)
 
		local pl_y = math.floor(tonumber(s.pos) / 10);
 
		local pl_x = tonumber(s.pos) % 10;
 
		print("player:", pl_x, pl_y);
 
		--print("player:", pl_x, pl_y);
 
		--Каждый стражник делает ход, игрок получает сообщения, о том, слышит ли он шаги, откуда и как они движутся
 
		for i = 1, #s.guards do
 
			--TODO play with this random number to assume good gameplay: predictable enough, yet somewhat random
 
@@ -516,7 +514,7 @@ warehouse_32 = room {
 
			
 
			local g_y = math.floor(tonumber(s.guards[i].pos) / 10);
 
			local g_x = tonumber(s.guards[i].pos) % 10;
 
			print("guard:", g_x, g_y)
 
			--print("guard:", g_x, g_y)
 
			--Видимость при разнице не более двух. В прямой видимости - видно, иначе - слышно
 
			--TODO может стоит сделать, чтобы шаги были слышны только при движении стражнека?
 
			if (g_x == pl_x) then
 
@@ -555,11 +553,11 @@ warehouse_32 = room {
 
		end;
 
	end;
 
	makeTurn = function(s)
 
		print("turn");
 
		print(s.guards[1].pos, s.guards[1].dir);
 
		print(s.guards[2].pos, s.guards[2].dir);
 
		print(s.guards[3].pos, s.guards[3].dir);
 
		print(s.guards[4].pos, s.guards[4].dir);
 
		--print("turn");
 
		--print(s.guards[1].pos, s.guards[1].dir);
 
		--print(s.guards[2].pos, s.guards[2].dir);
 
		--print(s.guards[3].pos, s.guards[3].dir);
 
		--print(s.guards[4].pos, s.guards[4].dir);
 
		-- TODO debug
 
		if (s:checkGuardSight()) then
 
			s:guardTurn();
 
@@ -597,9 +595,10 @@ warehouse_32 = room {
 
				if (warehouse_32.hidden) then
 
					path("Спрятаться"):disable();
 
					path("Выбраться из укрытия"):enable();
 
					path("Вперед"):disable();
 
					path("Повернуть налево"):disable();
 
					path("Повернуть направо"):disable();
 
					path("На запад"):disable();
 
					path("На восток"):disable();
 
					path("На север"):disable();
 
					path("На юг"):disable();
 
				else
 
					path("Выбраться из укрытия"):disable();
 
				end;
0 comments (0 inline, 0 general)