Changeset - b51e69907cae
[Not reviewed]
default
0 18 0
Silverwing - 6 years ago 2017-12-24 19:00:46

dyp game fixed
18 files changed with 17 insertions and 11 deletions:
0 comments (0 inline, 0 general)
atlantis_dyp.lua
Show inline comments
 
@@ -149,7 +149,7 @@ dyp_obelisk_puzzle = room {
 
                end;
 
            end;
 
            if k % 2 == 0 then
 
                for i = 1, 16 do
 
                for i = 16, 1, -1 do
 
                    if s.state[i] == 14 then
 
                        s.state[i] = 15;
 
                    elseif s.state[i] == 15 then
 
@@ -163,34 +163,39 @@ dyp_obelisk_puzzle = room {
 
        local p = 'images/dyp15.png';
 
        for i = 1, #s.state do
 
            local f = s.state[i];
 
            p = p .. ';images/dyp15_' .. tostring(f) .. '.png@' .. tostring(((i - 1) % 4) * 40) .. ',' .. tostring(math.floor((i - 1) / 4) * 40);
 
            p = p .. ';images/dyp15_' .. tostring(f) .. '.png@' .. tostring(math.floor((i - 1) / 4) * 40) .. ',' .. tostring((3 - (i - 1) % 4) * 40);
 
        end;
 
        return p;
 
    end;
 
    dsc = [[У самого основания обелиска вы видите небольшое изображение, вырезанное в камне. Некогда оно было разрезано на шестнадцать частей, а части перепутаны между собой. ]];
 
    click = function(s, x, y)
 
        local tx = math.floor(x / 40);
 
        local ty = math.floor(y / 40);
 
        local ty = math.floor(x / 40);
 
        local tx = 3 - math.floor(y / 40);
 
        local tile = tx + ty * 4 + 1;
 
        if (s.state[tile] ~= 12) then
 
            if (tile - 4 > 0) and s.state[tile - 4] == 12 then
 
        if (s.state[tile] ~= 15) then
 
            if (tile - 4 > 0) and s.state[tile - 4] == 15 then
 
                tx = s.state[tile];
 
                s.state[tile] = s.state[tile - 4];
 
                s.state[tile - 4] = tx;
 
            elseif tx > 0 and s.state[tile - 1] == 12 then
 
            elseif tx > 0 and s.state[tile - 1] == 15 then
 
                tx = s.state[tile];
 
                s.state[tile] = s.state[tile - 1];
 
                s.state[tile - 1] = tx;
 
            elseif tx < 3 and s.state[tile + 1] == 12 then
 
            elseif tx < 3 and s.state[tile + 1] == 15 then
 
                tx = s.state[tile];
 
                s.state[tile] = s.state[tile + 1];
 
                s.state[tile + 1] = tx;
 
            elseif (tile + 4) <= 16 and s.state[tile + 4] == 12 then
 
            elseif (tile + 4) <= 16 and s.state[tile + 4] == 15 then
 
                tx = s.state[tile];
 
                s.state[tile] = s.state[tile + 4];
 
                s.state[tile + 4] = tx;
 
            end;
 
        end;
 
        local f = "";
 
        for i = 1, #s.state do
 
            f = f .. "," .. tostring(s.state[i]);
 
        end;
 
        print(f);
 
        if not s:check_win() then
 
            walkin(here());
 
        else
 
@@ -201,7 +206,7 @@ dyp_obelisk_puzzle = room {
 
    end;
 
    check_win = function(s)
 
        for i = 1, #s.state do
 
            if s.state[i] ~= i - 1 then
 
            if s.state[i] ~= 16 - i then
 
                return false;
 
            end;
 
        end;
 
@@ -280,7 +285,7 @@ dyp_librarian_dlg = dlg {
 
    entered = function(s)
 
        if atl_iyh_state == 10 and not s.lse then
 
            s.lse = true;
 
            pon("lseryanotrr");
 
            pon("lse");
 
        end;
 
    
 
        if language_known then
images/dyp15_0.png
Show inline comments
 
binary diff not shown
Show images
images/dyp15_1.png
Show inline comments
 
binary diff not shown
Show images
images/dyp15_10.png
Show inline comments
 
binary diff not shown
Show images
images/dyp15_11.png
Show inline comments
 
binary diff not shown
Show images
images/dyp15_12.png
Show inline comments
 
binary diff not shown
Show images
images/dyp15_13.png
Show inline comments
 
binary diff not shown
Show images
images/dyp15_14.png
Show inline comments
 
binary diff not shown
Show images
images/dyp15_15.png
Show inline comments
 
binary diff not shown
Show images
images/dyp15_2.png
Show inline comments
 
binary diff not shown
Show images
images/dyp15_3.png
Show inline comments
 
binary diff not shown
Show images
images/dyp15_4.png
Show inline comments
 
binary diff not shown
Show images
images/dyp15_5.png
Show inline comments
 
binary diff not shown
Show images
images/dyp15_6.png
Show inline comments
 
binary diff not shown
Show images
images/dyp15_7.png
Show inline comments
 
binary diff not shown
Show images
images/dyp15_8.png
Show inline comments
 
binary diff not shown
Show images
images/dyp15_9.png
Show inline comments
 
binary diff not shown
Show images
main.lua
Show inline comments
 
@@ -206,6 +206,7 @@ function init()
 
    ---game init
 
    pl.where = intro;
 
    ---debug
 
    
 
    --pl.where = "item_book_dlg";
 
    --pl.where = "dyp_obelisk_puzzle";
 
    --language_known = true;
0 comments (0 inline, 0 general)