Changeset - b9ee30253047
[Not reviewed]
default
0 1 0
Silverwing - 6 years ago 2017-12-23 23:16:57

iyh labyrinth fixed
1 file changed with 14 insertions and 31 deletions:
0 comments (0 inline, 0 general)
atlantis_iyhehevjiarr.lua
Show inline comments
 
@@ -531,7 +531,7 @@ iyh_labyrinth_template = {
 
	[3]= {[1]={l={5, 1}, f={4,1}},				[2]={f={2,2}}};
 
	[4]= {[1]={}, 								[2]={f={3,2}}};
 
	[5]= {[1]={l={37, 1}, f={6,1} },			[2]={f={3,2}}};
 
	[6]= {[1]={l={33, 1}, r={7,1}},  			[2]={f={5,2}}};
 
	[6]= {[1]={l={7,1}, r={33, 1}},  			[2]={f={5,2}}};
 
	[7]= {[1]={l={12,1}, f={11,1}, r={8,1}},	[2]={f={6,2}}};
 
	[8]= {[1]={l={10,1}, r={9,1}}, 				[2]={f={7,2}}};
 
	[9]= {[1]={}, 								[2]={f={8,2}}};
 
@@ -567,44 +567,27 @@ iyh_labyrinth_template = {
 
 
iyh_labyrinth = room {
 
	var {
 
		position = 1;
 
		location = 1;
 
		direction = 1;
 
	};
 
	no_exit = [[Нет смысла покидать Левиафан здесь. ]];
 
	nam = "Штурвал Левиафана";
 
    forcedsc = true;
 
    entered = function(s)
 
        s:update();
 
    end;   
 
	dsc = function(s)
 
		pr [[Вы находитесь в глубоком и узком ущелье. ]];
 
		if (iyh_labyrinth_template[s.position][s.direction]["f"]) then    
 
		if (iyh_labyrinth_template[s.location][s.direction]["f"]) then    
 
			pr [[Ущелье продолжается вперед. ]];
 
		end;
 
		if (iyh_labyrinth_template[s.position][s.direction]["l"] and iyh_labyrinth_template[s.position][s.direction]["r"]) then
 
		if (iyh_labyrinth_template[s.location][s.direction]["l"] and iyh_labyrinth_template[s.location][s.direction]["r"]) then
 
			pr [[Влево и вправо уходят ответвления. ]];
 
		elseif (iyh_labyrinth_template[s.position][s.direction]["l"]) then
 
		elseif (iyh_labyrinth_template[s.location][s.direction]["l"]) then
 
			pr [[Влево уходит ответвление. ]];
 
		elseif (iyh_labyrinth_template[s.position][s.direction]["r"]) then
 
		elseif (iyh_labyrinth_template[s.location][s.direction]["r"]) then
 
			pr [[Вправо уходит ответвление. ]];
 
		elseif (not iyh_labyrinth_template[s.position][s.direction]["f"]) then
 
		elseif (not iyh_labyrinth_template[s.location][s.direction]["f"]) then
 
			pr [[Дальше пути нет. ]];
 
		end;
 
	end;
 
	update = function(s)
 
        print(s.position, s.direction);
 
        iyh_lab_forward:disable();
 
        iyh_lab_left:disable();
 
        iyh_lab_right:disable();
 
        if (iyh_labyrinth_template[s.position][s.direction]["f"]) then    
 
            iyh_lab_forward:enable();
 
        end;
 
        if (iyh_labyrinth_template[s.position][s.direction]["l"]) then    
 
            iyh_lab_left:enable();
 
        end;
 
        if (iyh_labyrinth_template[s.position][s.direction]["r"]) then    
 
            iyh_lab_right:enable();
 
        end;
 
	end;
 
	obj = {
 
		"iyh_lab_forward",
 
@@ -622,8 +605,8 @@ iyh_lab_forward = obj {
 
		local p = iyh_labyrinth.position;
 
		local d = iyh_labyrinth.direction;
 
		
 
		if (type(iyh_labyrinth_template[p][d]["f"]) == 'string') then
 
			walk(iyh_labyrinth_template[p][d]["f"]);
 
		if (type(iyh_labyrinth_template[p][d]) == 'string') then
 
			walk(iyh_labyrinth_template[p][d]);
 
		else
 
			iyh_labyrinth.position = iyh_labyrinth_template[p][d]["f"][1];
 
			iyh_labyrinth.direction = iyh_labyrinth_template[p][d]["f"][2];
 
@@ -641,8 +624,8 @@ iyh_lab_left = obj {
 
		local p = iyh_labyrinth.position;
 
		local d = iyh_labyrinth.direction;
 
		
 
		if (type(iyh_labyrinth_template[p][d]["l"]) == 'string') then
 
			walk(iyh_labyrinth_template[p][d]["l"]);
 
		if (type(iyh_labyrinth_template[p][d]) == 'string') then
 
			walk(iyh_labyrinth_template[p][d]);
 
		else
 
			iyh_labyrinth.position = iyh_labyrinth_template[p][d]["l"][1];
 
			iyh_labyrinth.direction = iyh_labyrinth_template[p][d]["l"][2];
 
@@ -660,8 +643,8 @@ iyh_lab_right = obj {
 
		local p = iyh_labyrinth.position;
 
		local d = iyh_labyrinth.direction;
 
		
 
		if (type(iyh_labyrinth_template[p][d]["r"]) == 'string') then
 
			walk(iyh_labyrinth_template[p][d]["r"]);
 
		if (type(iyh_labyrinth_template[p][d]) == 'string') then
 
			walk(iyh_labyrinth_template[p][d]);
 
		else
 
			iyh_labyrinth.position = iyh_labyrinth_template[p][d]["r"][1];
 
			iyh_labyrinth.direction = iyh_labyrinth_template[p][d]["r"][2];
 
@@ -692,7 +675,7 @@ iyh_rear_entrance = room {
 
		Вы находитесь в конце ущелья. Луч прожектора освещает небольшой проход в скале. 
 
	]];
 
	way = {
 
		kh_vroom("Отойти от штурвала", "iyh_rear_entrance_foot");
 
		kh_vroom("Отойти от штурвала", "leviathan_wheelhouse");
 
		kh_vroom("В ущелье", function(s)
 
			iyh_labyrinth.position = 23;
 
			iyh_labyrinth.direction = 2;
0 comments (0 inline, 0 general)