Changeset - 7ae8b304bed1
[Not reviewed]
default
0 1 0
Silverwing - 6 years ago 2019-01-04 13:49:37

chapter 2: kraken fight
1 file changed with 5 insertions and 4 deletions:
0 comments (0 inline, 0 general)
journey_temple.lua
Show inline comments
 
@@ -1005,24 +1005,25 @@ dt_fight = room {
 
        rotation = 90;
 
        dir = 0;
 
        tentacles = {
 
            {hp=200, dir=0, away = 0 };
 
            {hp=200, dir=1, away = 0 };
 
            {hp=200, dir=2, away = 0 };
 
            {hp=200, dir=3, away = 0 };
 
            {hp=200, dir=4, away = 0 };
 
        };
 
    };
 
    nam = "dt_fight";
 
    disp = "Левиафан, рубка";
 
    not_follow = true;
 
    forcedsc = true;
 
    entered = function(s)
 
        s:maketurn();
 
        if (s.state == 0) then
 
            s.state = 1;
 
            local dirs = {0,1,2,3,4,5,6,7};
 
            for i = 1, #s.tentacles do
 
                local cd = rnd(#dirs);
 
                s.tentacles[i].dir = dirs[cd];
 
                table.remove(dirs, cd);
 
            end;
 
        end;
 
@@ -1058,28 +1059,28 @@ dt_fight = room {
 
        if (b > 7) then
 
            b = b - 8;
 
        end;
 
        if (fl < 0) then
 
            fl = fl + 8;
 
        end;
 
        if (l < 0) then
 
            l = l + 8;
 
        end;
 
        if (bl < 0) then
 
            bl = bl + 8;
 
        end;
 
        for i = 1, #s.tentacles do 
 
            pr(s.tentacles[i].hp .. " ");
 
        end;
 
        pr("^");
 
--        for i = 1, #s.tentacles do
 
--            pr(s.tentacles[i].hp .. " ");
 
--        end;
 
--        pr("^");
 
        pr [[Щупальца кракена тянутся к Левиафану. ]];
 
        for i = 1, #s.tentacles do 
 
            if (s.tentacles[i].hp > 0 and s.tentacles[i].dir == s.dir and s.tentacles[i].away == 0) then
 
                pr(s:eval_tentacle(s.tentacles[i]) .. [[ находится прямо перед субмариной. ]]);
 
            end;
 
        end;
 
        for i = 1, #s.tentacles do 
 
            if (s.tentacles[i].hp > 0 and s.tentacles[i].dir == fr and s.tentacles[i].away == 0) then
 
                pr(s:eval_tentacle(s.tentacles[i]) .. [[ находится спереди и справа от субмарины. ]]);
 
            end;
 
        end;
 
        for i = 1, #s.tentacles do 
0 comments (0 inline, 0 general)