diff --git a/warehouse32.lua b/warehouse32.lua --- a/warehouse32.lua +++ b/warehouse32.lua @@ -274,6 +274,7 @@ w32_mgr_bookcase = obj { end; used = function(s, o) if (o == item_w32_key) then + s.state = 0; w32_mgr.key_inplace = true; remove(item_w32_key, pl); put(item_w32_key, s); @@ -444,6 +445,9 @@ warehouse_32 = room { if pl_y - g_y == 0 or pl_x - g_x == 0 and math.abs(pl_y - g_y) + math.abs(pl_x - g_x) < 3 then rval = rval .. ";images/wh32_guard_" .. tostring(s.guards[i].dir) .. ".png@" .. tostring((g_x - pl_x) * 64 + 128 + deltax) .. ",".. tostring((pl_y - g_y) * 64 + 128 + deltay); end; + if math.abs(pl_y - g_y) == 1 and math.abs(pl_x - g_x) == 1 then + rval = rval .. ";images/uneen_enemy.png@" .. tostring((g_x - pl_x) * 64 + 128 + deltax) .. ",".. tostring((pl_y - g_y) * 64 + 128 + deltay); + end; end; rval = rval .. ";images/wh32_player.png@128,128"; @@ -500,7 +504,7 @@ warehouse_32 = room { --Каждый стражник делает ход, игрок получает сообщения, о том, слышит ли он шаги, откуда и как они движутся for i = 1, #s.guards do if (rnd(10) < 9) then - if (s.guards[i].s == 1) then + --[[if (s.guards[i].s == 1) then if s.guards[i].dir ~= 3 then s.guards[i].dir = s.guards[i].dir + 1; else @@ -521,8 +525,8 @@ warehouse_32 = room { s.guards[i].s = 1; end; end; - end; - --[[if (s.guards[i].s == 1) then + end;]] + if (s.guards[i].s == 1) then s.guards[i].s = 2; s.guards[i].dir = s.guards[i].dir + 1; if (s.guards[i].dir > 4) then @@ -547,7 +551,7 @@ warehouse_32 = room { s.guards[i].pos = s.definitions[s.guards[i].pos].e4; end; end; - end;]] + end; end; local g_y = math.floor(tonumber(s.guards[i].pos) / 10);