Changeset - 61752b5f04b1
[Not reviewed]
default
0 2 11
Silverwing - 7 years ago 2017-09-23 10:49:44

Warehouse32: overhaul
13 files changed with 69 insertions and 3 deletions:
0 comments (0 inline, 0 general)
images/wh32_bg.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
images/wh32_door.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
images/wh32_guard.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
images/wh32_guard_1.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
images/wh32_guard_2.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
images/wh32_guard_3.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
images/wh32_guard_4.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
images/wh32_mask.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
images/wh32_player.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
images/wh32_shelves.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
images/wh32_wall.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
main.lua
Show inline comments
 
@@ -196,7 +196,7 @@ function init()
 
    ---game init
 
    pl.where = intro;
 
    ---debug
 
    --pl.where = w32_backdoor;
 
    pl.where = warehouse_32;
 
    --put(item_lamp, pl);
 
    --language_known = true;
 
    --pl.where = "leviathan_airlock";
warehouse32.lua
Show inline comments
 
@@ -383,6 +383,72 @@ warehouse_32 = room {
 
    };
 
	nam = "warehouse_32";
 
	nolamp = true;
 
    map = {
 
        {1,1,2,1,1,1,1,1,1,1,1};
 
        {1,3,0,3,0,3,0,3,0,3,1};
 
        {1,0,0,0,0,0,0,0,0,0,1};
 
        {1,3,0,3,0,3,0,3,0,3,1};
 
        {1,0,0,0,0,0,0,0,0,0,1};
 
        {1,3,0,3,0,3,0,3,0,3,1};
 
        {1,0,0,0,0,0,0,0,0,0,1};
 
        {1,3,0,3,0,3,0,3,0,3,1};
 
        {1,0,0,0,0,0,0,0,0,0,1};
 
        {1,3,0,3,0,3,0,3,0,3,1};
 
        {1,1,1,1,2,1,1,1,2,1,1};
 
    };
 
    pic = function(s)
 
        local pl_y = math.floor(tonumber(s.pos) / 10);
 
        local pl_x = tonumber(s.pos) % 10;
 
        local pl_xm = pl_x * 2 + 1;
 
        local deltax = 0;
 
        local deltay = 0;
 
        if pl_x == 0 then
 
            pl_xm = 2;
 
            deltax = 32;
 
        elseif pl_x == 5 then
 
            pl_xm = 10;
 
            deltax = -32;
 
        end;
 
        local pl_ym = pl_y * 2 + 1;
 
        if pl_y == 0 then
 
            pl_ym = 2;
 
            deltay = 32;
 
        elseif pl_y == 5 then
 
            pl_ym = 10;
 
            deltay = -32;
 
        end;
 
        local rval = "images/wh32_bg.png";
 
        
 
        
 
        for x = 0, 8 do
 
            for y = 0, 8 do
 
                print(pl_ym - 4 + y, pl_xm - 4 + x)
 
                if pl_xm - 4 + x > 0 and pl_ym - 4 + y > 0 and pl_xm - 4 + x < 12 and pl_ym - 4 + y < 12 then
 
                    if s.map[pl_ym - 4 + y][pl_xm - 4 + x] == 1 then
 
                        rval = rval .. ";images/wh32_wall.png@" .. tostring((x) * 32) .. "," .. tostring(256 - (y) * 32);
 
                    elseif s.map[pl_ym - 4 + y][pl_xm - 4 + x] == 2 then
 
                        rval = rval .. ";images/wh32_door.png@" .. tostring((x) * 32) .. "," .. tostring(256 - (y) * 32);
 
                    elseif s.map[pl_ym - 4 + y][pl_xm - 4 + x] == 3 then
 
                        rval = rval .. ";images/wh32_shelves.png@" .. tostring((x) * 32) .. "," .. tostring(256 - (y) * 32);
 
                    end;
 
                else
 
                    rval = rval .. ";box:32x32,black,255@" .. tostring((x) * 32) .. "," .. tostring(256 - (y) * 32);
 
                end;
 
            end;
 
        end;
 
        
 
        
 
        for i = 1, #s.guards do
 
            local g_y = math.floor(tonumber(s.guards[i].pos) / 10);
 
            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/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;
 
        end;
 
        
 
        rval = rval .. ";images/wh32_player.png@128,128";
 
        return rval .. ";images/wh32_mask.png";
 
    end;
 
	disp = function(s)
 
		return "Склад 32, " .. s.definitions[s.pos].name;
 
	end;
 
@@ -439,7 +505,7 @@ warehouse_32 = room {
 
                        s.guards[i].dir = s.guards[i].dir + 1;
 
                    else
 
                        s.guards[i].pos = s.definitions[s.guards[i].pos].e3;
 
                        if not s.definitions[s.guards[i].pos].e3 then
 
                        if not s.definitions[s.definitions[s.guards[i].pos].e3].e3 then
 
                            s.guards[i].s = 2;
 
                        end;
 
                    end;
 
@@ -451,7 +517,7 @@ warehouse_32 = room {
 
                        end;
 
                    else
 
                        s.guards[i].pos = s.definitions[s.guards[i].pos].e1;
 
                        if not s.definitions[s.guards[i].pos].e1 then
 
                        if not s.definitions[s.definitions[s.guards[i].pos].e1].e1 then
 
                            s.guards[i].s = 1;
 
                        end;
 
                    end;
0 comments (0 inline, 0 general)