Changeset - ac0b2d6f5c08
[Not reviewed]
default
0 3 1
Silverwing - 8 years ago 2016-09-10 11:39:31

More venaedanotrr progress. Image added
4 files changed with 250 insertions and 56 deletions:
0 comments (0 inline, 0 general)
game_over.lua
Show inline comments
 
game_over_eaten_by_octopus = game_over("game_over_eaten_by_octopus", [[
 
    Гигантский спрут мгновенно опутывает вас своими щупальцами. Вы не можете вырваться из стальной хватки чудовища. Металл скафандра скрипит, не выдерживая давления и вы понимаете, что ваши дни сочтены. 
 
]]);
 
 
game_over_eaten_by_shark = room {
 
    nam = "game_over_eaten_by_shark";
 
    disp = "Игра окончена";
 
    hideinv = true;
 
    dsc = [[
 
        Вы не успеваете заметить, как акула разгрызает ваш скафандр острыми зубами. Через несколько мгновений вы умираете. 
 
    ]];
 
};
 
 
game_over_caught = room {
 
	nam = "game_over_caught";
 
	disp = "Игра окончена";
images/ven_chest.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
journey_venaedanotrr.lua
Show inline comments
 
@@ -802,6 +802,66 @@ ven_temple_l1 = labyrinth {
 
            ]];
 
        end;
 
    end;
 
    enter = function(s)
 
        if (exist(ven_shark, s) and ven_shark.active) then
 
            local no = s.map[ven_shark.position].e1;
 
            local ea = s.map[ven_shark.position].e2;
 
            local so = s.map[ven_shark.position].e3;
 
            local we = s.map[ven_shark.position].e4;
 
            if (no and s.oldposition == no) then
 
                walk(game_over_eaten_by_shark);
 
            end;
 
            if (no and s.oldposition == s.map[no].e1) then
 
                ven_shark.position = no;
 
            end;
 
            if (ea and s.oldposition == ea) then
 
                walk(game_over_eaten_by_shark);
 
            end;
 
            if (ea and s.oldposition == s.map[ea].e2) then
 
                ven_shark.position = ea;
 
            end;
 
            if (so and s.oldposition == so) then
 
                walk(game_over_eaten_by_shark);
 
            end;
 
            if (so and s.oldposition == s.map[so].e3) then
 
                ven_shark.position = so;
 
            end;
 
            if (we and s.oldposition == we) then
 
                walk(game_over_eaten_by_shark);
 
            end;
 
            if (we and s.oldposition == s.map[we].e4) then
 
                ven_shark.position = we;
 
            end;
 
                    
 
            if (no and s.oldposition == s.map[no].e2) then
 
                ven_shark.position = no;
 
            end;
 
            if (ea and s.oldposition == s.map[ea].e1) then
 
                ven_shark.position = ea;
 
            end;
 
            if (no and s.oldposition == s.map[no].e4) then
 
                ven_shark.position = no;
 
            end;
 
            if (we and s.oldposition == s.map[we].e1) then
 
                ven_shark.position = we;
 
            end;
 
            if (so and s.oldposition == s.map[so].e2) then
 
                ven_shark.position = so;
 
            end;
 
            if (ea and s.oldposition == s.map[ea].e3) then
 
                ven_shark.position = ea;
 
            end;
 
            if (so and s.oldposition == s.map[so].e4) then
 
                ven_shark.position = so;
 
            end;
 
            if (we and s.oldposition == s.map[we].e3) then
 
                ven_shark.position = we;
 
            end;
 
        end;
 
    end;
 
    obj = {
 
        "ven_octopus";
 
    };
 
    map = {
 
        ["00"] = {
 
            e1 = "10";
 
@@ -834,9 +894,9 @@ ven_temple_l1 = labyrinth {
 
            e4 = "04"
 
        };
 
        ["06"] = {
 
            e1 = "16",
 
            e2 = "07",
 
            e4 = "05"
 
            e1 = "16";
 
            e2 = "07";
 
            e4 = "05";
 
        };
 
        ["07"] = {
 
            e4 = "06"
 
@@ -846,7 +906,21 @@ ven_temple_l1 = labyrinth {
 
            e3 = "00"
 
        };
 
        ["11"] = {
 
            e2 = "12"
 
            e2 = "12",
 
            enter = function(s)
 
                if (not exist(ven_skeleton, s)) then
 
                    move(ven_skeleton, s);
 
                end;
 
                if (not item_ven_spear.taken and not exist(item_ven_spear, s)) then
 
                    move(item_ven_spear, s);
 
                end;
 
            end;
 
            exit = function(s)
 
                remove(ven_skeleton, s);
 
                if (not item_ven_spear.taken) then
 
                    remove(item_ven_spear, s);
 
                end;
 
            end;
 
        };
 
        ["12"] = {
 
            e3 = "02",
 
@@ -874,6 +948,11 @@ ven_temple_l1 = labyrinth {
 
            e1 = "30";
 
            e2 = "21";
 
            e3 = "10";
 
            enter = function(s)
 
                if (not exist(ven_shark, s)) then
 
                    move(ven_shark, s);
 
                end;
 
            end;
 
        };
 
        ["21"] = {
 
            e2 = "22";
 
@@ -898,6 +977,9 @@ ven_temple_l1 = labyrinth {
 
        ["26"] = {
 
            e3 = "16";
 
            e4 = "25";
 
            enter = function(s)
 
                walk(game_over_eaten_by_octopus);
 
            end;
 
        };
 
        ["27"] = {
 
            e1 = "37";
 
@@ -1079,75 +1161,125 @@ ven_shark = obj {
 
    nam = "ven_shark";
 
    dsc = function(s)
 
        --local d = 0;
 
        local no = here().map[here().position].e1;
 
        local ea = here().map[here().position].e2;
 
        local so = here().map[here().position].e3;
 
        local we = here().map[here().position].e4;
 
        if (no and s.position == no) then
 
            return [[
 
                На севере вы видите {акулу}. Она мчится к вам.
 
        local seen = false;
 
        local no = ven_temple_l1.map[ven_temple_l1.position].e1;
 
        local ea = ven_temple_l1.map[ven_temple_l1.position].e2;
 
        local so = ven_temple_l1.map[ven_temple_l1.position].e3;
 
        local we = ven_temple_l1.map[ven_temple_l1.position].e4;
 
        if (s.position == ven_temple_l1.position) then
 
            p [[
 
                Рядом с собой
 
            ]];
 
        end;
 
        if (no and s.position == here().map[no].e1) then
 
            return [[
 
                Вдалеке на севере вы видите {акулу}. Она мчится к вам.
 
        if (no and s.position == no) then
 
            seen = true;
 
            p [[
 
                На севере
 
            ]];
 
        end;
 
        if (no and s.position == ven_temple_l1.map[no].e1) then
 
            seen = true;
 
            p [[
 
                Вдалеке на севере
 
            ]];
 
        end;
 
        if (ea and s.position == ea) then
 
            return [[
 
                На востоке вы видите {акулу}. Она мчится к вам.
 
            seen = true;
 
            p [[
 
                На востоке
 
            ]];
 
        end;
 
        if (ea and s.position == here().map[ea].e2) then
 
            return [[
 
                Вдалеке на востоке вы видите {акулу}. Она мчится к вам.
 
        if (ea and s.position == ven_temple_l1.map[ea].e2) then
 
            seen = true;
 
            p [[
 
                Вдалеке на востоке
 
            ]];
 
        end;
 
        if (so and s.position == so) then
 
            return [[
 
                На юге вы видите {акулу}. Она мчится к вам.
 
            seen = true;
 
            p [[
 
                На юге
 
            ]];
 
        end;
 
        if (so and s.position == here().map[so].e3) then
 
            return [[
 
                Вдалеке на юге вы видите {акулу}. Она мчится к вам.
 
        if (so and s.position == ven_temple_l1.map[so].e3) then
 
            seen = true;
 
            p [[
 
                Вдалеке на юге
 
            ]];
 
        end;
 
        if (we and s.position == we) then
 
            return [[
 
                На западе вы видите {акулу}. Она мчится к вам.
 
            seen = true;
 
            p [[
 
                На западе
 
            ]];
 
        end;
 
        if (we and s.position == here().map[we].e4) then
 
            return [[
 
                Вдалеке на западе вы видите {акулу}. Она мчится к вам.
 
        if (we and s.position == ven_temple_l1.map[we].e4) then
 
            seen = true;
 
            p [[
 
                Вдалеке на западе
 
            ]];
 
        end;
 
                
 
        if (no and s.position == here().map[no].e2 or ea and s.position == here().map[ea].e1) then
 
            return [[
 
                На северо-востоке вы видите {акулу}. Она мчится к вам.
 
        if (no and s.position == ven_temple_l1.map[no].e2 or ea and s.position == ven_temple_l1.map[ea].e1) then
 
            seen = true;
 
            p [[
 
                На северо-востоке
 
            ]];
 
        end;
 
        if (no and s.position == here().map[no].e4 or we and s.position == here().map[we].e1) then
 
            return [[
 
                На северо-западе вы видите {акулу}. Она мчится к вам.
 
        if (no and s.position == ven_temple_l1.map[no].e4 or we and s.position == ven_temple_l1.map[we].e1) then
 
            seen = true;
 
            p [[
 
                На северо-западе
 
            ]];
 
        end;
 
        if (so and s.position == here().map[so].e2 or ea and s.position == here().map[ea].e3) then
 
            return [[
 
                На юго-востоке вы видите {акулу}. Она мчится к вам.
 
        if (so and s.position == ven_temple_l1.map[so].e2 or ea and s.position == ven_temple_l1.map[ea].e3) then
 
            seen = true;
 
            p [[
 
                На юго-востоке
 
            ]];
 
        end;
 
        if (so and s.position == here().map[so].e4 or we and s.position == here().map[we].e3) then
 
            return [[
 
                На юго-западе вы видите {акулу}. Она мчится к вам.
 
        if (so and s.position == ven_temple_l1.map[so].e4 or we and s.position == ven_temple_l1.map[we].e3) then
 
            seen = true;
 
            p [[
 
                На юго-западе
 
            ]];
 
        end;
 
        
 
        return [[
 
            Где-то в лабиринте вас поджидает кровожадная акула. 
 
        ]];
 
        if (seen) then
 
            if (s.active) then
 
                p "вы видите мчащуюся к вам навстречу {акулу}. ";
 
            else
 
                p "вы видите мертвую акулу, пронзенную коралловым копьем. ";
 
            end;
 
        else
 
            if (s.active) then
 
                p [[
 
                    Где-то в лабиринте вас поджидает кровожадная акула. 
 
                ]];
 
            else
 
                return false;
 
            end;
 
        end;
 
    end;
 
    used = function(s, o)
 
        print("fuck you dinosaur shark");
 
        if (o == item_ven_spear) then
 
            local no = ven_temple_l1.map[ven_temple_l1.position].e1;
 
            local ea = ven_temple_l1.map[ven_temple_l1.position].e2;
 
            local so = ven_temple_l1.map[ven_temple_l1.position].e3;
 
            local we = ven_temple_l1.map[ven_temple_l1.position].e4;
 
            if (s.position == no or s.position == ea or s.position == so or s.position == we) then
 
                remove(item_ven_spear, pl);
 
                s.active = false;
 
                return [[
 
                    Вы протыкаете акулу копьем. Она несколько раз дергается и затихает. Копье застревает в теле рыбы и вы не можете вытащить его. 
 
                ]];
 
            else
 
                return [[
 
                    Акула слишком далеко. 
 
                ]];
 
            end;
 
        end;
 
    end;
 
};
 

	
 
@@ -1159,6 +1291,18 @@ ven_chest = obj {
 
    dsc = [[
 
        В конце коридора стоит запертый {сундук}. 
 
    ]];
 
    act = function(s)
 
        walkin("ven_chest_look");
 
    end;
 
};
 

	
 
ven_chest_look = room {
 
    nam = "ven_chest_look";
 
    dsc = function(s)
 
        return [[
 
            На поверхности сундука вы видите обозначения из цветных полос - очевидно это какое-то сообщение.
 
        ]];
 
    emd;
 
};
 

	
 
ven_skeleton = obj {
 
@@ -1166,6 +1310,9 @@ ven_skeleton = obj {
 
    dsc = [[
 
        У одной из стен вы видите {скелет навьяра}. 
 
    ]];
 
    act = [[
 
        Этот скелет очень старый. 
 
    ]];
 
};
 

	
 
item_ven_spear = obj {
 
@@ -1173,6 +1320,7 @@ item_ven_spear = obj {
 
        taken = false;
 
    };
 
    nam = "item_ven_spear";
 
    disp = "Копье";
 
    dsc = [[
 
        В правой руке скелета вы видите {коралловое копье}.
 
    ]];
 
@@ -1189,9 +1337,16 @@ item_ven_spear = obj {
 

	
 
ven_octopus = obj {
 
    nam = "ven_octopus";
 
    dsc = [[
 
        Вы видите огромного {осьминога} на некотором расстоянии к северу от вас. 
 
    ]];
 
    dsc = function(s)
 
        if (ven_temple_l1.position == "06") then
 
            return "Вдалеке к северу вы видите гигантского спрута. Чудовище, кажется, совершенно не заинтересовано вами, однако оно полностью закрывает проход. ";
 
        elseif (ven_temple_l1.position == "16") then
 
            return "К северу вы видите гигантского спрута. Чудовище, кажется, совершенно не заинтересовано вами, однако оно полностью закрывает проход. ";
 
        elseif (ven_temple_l1.position == "25") then
 
            return "К востоку вы видите гигантского спрута. Чудовище, кажется, совершенно не заинтересовано вами, однако оно полностью закрывает проход. ";
 
        end;
 
        return false;
 
    end;
 
    act = [[
 
        "Лучше к нему не приближаться".
 
    ]];
utils.lua
Show inline comments
 
@@ -238,6 +238,15 @@ function darkroom(tab)
 
	return room(tab);
 
end;
 
 
function game_over(nam, dsc)
 
    return room {
 
        nam = nam;
 
        disp = "Игра окончена";
 
        hideinv = true;
 
        dsc = dsc;
 
    };
 
end;
 
 
--[[
 
	Создает комнату с полем для ввода числа длиной не более tab.maxlen
 
	По нажатии enter вызывает метод tab.сheck
 
@@ -385,12 +394,12 @@ labyrinth = function(tab)
 
    lab = room {
 
        var {
 
            position = position;
 
            oldposition = position;
 
        };
 
        nam = tab.nam;
 
        disp = tab.disp;
 
        map = tab.map;
 
        entered = function(s)
 
            print(s.position);
 
        enter = function(s)
 
            path('e1'):disable();
 
            path('e2'):disable();
 
            path('e3'):disable();
 
@@ -411,13 +420,22 @@ labyrinth = function(tab)
 
            if (s.map[s.position].ex) then
 
                path('ex'):enable();
 
            end;
 
            if (type(tab.entered) == 'function') then
 
                tab.entered(s);
 
            if (type(tab.enter) == 'function') then
 
                tab.enter(s);
 
            end;
 
            if (type(s.map[s.position].entered) == 'function') then
 
                s.map[s.position].entered(s);
 
            if (type(s.map[s.position].enter) == 'function') then
 
                s.map[s.position].enter(s);
 
            end;
 
        end;
 
        exit = function(s)
 
            if (type(tab.exit) == 'function') then
 
                tab.exit(s);
 
            end;
 
            if (type(s.map[s.position].exit) == 'function') then
 
                s.map[s.position].exit(s);
 
            end;
 
        end;
 
        obj = tab.obj;
 
        dsc = function(s)
 
            if (type(tab.dsc) == "function") then
 
                return tab.dsc(s);
 
@@ -427,27 +445,35 @@ labyrinth = function(tab)
 
        end;
 
        way = {
 
            kh_vroom(tab.dir1, function()
 
                if (type(lab.position) == "function") then
 
                    lab.map[lab.position].left(lab);
 
                end;
 
                --if (type(lab.position) == "function") then
 
                --    lab.map[lab.position].left(lab);
 
                --end;
 
                lab.oldposition = lab.position;
 
                lab.position = lab.map[lab.position].e1;
 
                return lab;
 
            end, "e1");
 
            kh_vroom(tab.dir2, function()
 
                lab.oldposition = lab.position;
 
                lab.position = lab.map[lab.position].e2;
 
                return lab;
 
            end, "e2");
 
            kh_vroom(tab.dir3, function()
 
                lab.oldposition = lab.position;
 
                lab.position = lab.map[lab.position].e3;
 
                return lab;
 
            end, "e3");
 
            kh_vroom(tab.dir4, function()
 
                lab.oldposition = lab.position;
 
                lab.position = lab.map[lab.position].e4;
 
                return lab;
 
            end, "e4");
 
            kh_vroom(tab.exit, function()
 
                return lab.map[lab.position].ex;
 
            end, "ex");
 
            kh_vroom("Ждать", function()
 
                lab.oldposition = lab.position;
 
                return lab;
 
            end, "wt");
 
        };
 
    };
 
    return lab;
0 comments (0 inline, 0 general)