Changeset - 52dda9d3cb07
[Not reviewed]
silverwing - 5 years ago 2019-10-02 17:51:26

Simplify warehouse 32
2 files changed with 2 insertions and 13 deletions:
0 comments (0 inline, 0 general)
stealth.lua
Show inline comments
 
@@ -57,14 +57,13 @@ stealthroom = function(tab)
 
            local g_x = tonumber(s.guards[i].pos) % 10;
 
            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/" .. s.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
 
            elseif math.abs(pl_y - g_y) + math.abs(pl_x - g_x) <= 3 then
 
                rval = rval .. ";images/unseen_enemy.png@" .. tostring((g_x - pl_x) * 64 + 128 + deltax) .. ",".. tostring((pl_y - g_y) * 64 + 128 + deltay);
 
            end;
 
        end;
 

	
 
        rval = rval .. ";images/" .. s.player .. ".png@128,128";
 
        return rval .. ";images/wh32_mask.png";
 
        return rval;
 
    end;
 

	
 
    tab.disp = function(s)
warehouse32.lua
Show inline comments
 
@@ -463,16 +463,6 @@ warehouse_32 = stealthroom {
 
				elseif (pl_x - g_x == 2) then
 
					pr("На западе вы видите охранника. Он смотрит на " .. getDirName(s.guards[i].dir) .. ". ");
 
				end;
 
			else
 
				if (g_x - pl_x == 1 and g_y - pl_y == 1) then
 
					pr("К северо-востоку от вас вы слышите шаги охранника. ");
 
				elseif (g_x - pl_x == 1 and pl_y - g_y == 1) then
 
					pr("К юго-востоку от вас вы слышите шаги охранника. ");
 
				elseif (pl_x - g_x == 1 and g_y - pl_y == 1) then
 
					pr("К северо-западу от вас вы слышите шаги охранника. ");
 
				elseif (pl_x - g_x == 1 and pl_y - g_y == 1) then
 
					pr("К юго-западу от вас вы слышите шаги охранника. ");
 
				end;
 
			end;
 
		end;
 
	end;
0 comments (0 inline, 0 general)