Changeset - 698380d66f95
[Not reviewed]
default
0 2 0
silverwing - 4 years ago 2019-11-09 09:57:22

Aedhyarr and drake no longer shoot player
2 files changed with 78 insertions and 67 deletions:
0 comments (0 inline, 0 general)
lse_confrontation.lua
Show inline comments
 
@@ -2154,7 +2154,6 @@ lse_center = room {
 
}
 

	
 
lse_conf_center_intro = cutscene('Лсэрианотр, зал Наэтвьирра', 'Лсэрианотр, зал Наэтвьирра', [[Центральный зал ярко освещен исходящим из стен светом. По периметру зала установлены массивные металлические шкафы, издающие ровный низкий гул. По полу протянуты толстые провода, соединяющие их со статуей в центре зала. Металлическая статуя изображает навьяра, сидящего на троне. Рядом с троном стоят два пилона, высотой около метра. ^Уильям и Аэдхиарр завершают подготовку к запуску Наэтвьирра. При виде вас Уильям достает револьвер и стреляет в вас. В этот же момент в зал врываются ваши соратники. Не раздумывая, Фаэтларр бросается к ближайшему пилону и разрушает его. Мощный электрический разряд вырывается из руки Наэтвьирра и попадает в навьяра. Фаэтларр падает на пол и остается неподвижно лежать. ]], function(s)
 
    lse_drake.enemy = true;
 
    lse_pylon1.hp = 0;
 
    set_music('music/final_battle.ogg');
 
    if ArrayUtils.indexOf(pl.party, 'learr') ~= 0 then
lse_final_battle.lua
Show inline comments
 
@@ -81,36 +81,36 @@ lse_final_battle = battlefield {
 
        while (p == c or p == t or p == s) do
 
            p = rnd(10);
 
        end;
 
        
 

	
 
        if (s < 10) then
 
            s = "0" .. tostring(s);
 
        else
 
            s = tostring(s);
 
        end;
 
        
 

	
 
        if (t < 10) then
 
            t = "0" .. tostring(t);
 
        else
 
            t = tostring(t);
 
        end;
 
        
 

	
 
        if (c < 10) then
 
            c = "0" .. tostring(c);
 
        else
 
            c = tostring(c);
 
        end;
 
        
 

	
 
        if (p < 10) then
 
            p = "0" .. tostring(p);
 
        else
 
            p = tostring(p);
 
        end;
 
        
 

	
 
        lse_generators_shield = "lse_gen_" .. s;
 
        lse_generators_throw = "lse_gen_" .. t;
 
        lse_generators_charge = "lse_gen_" .. c;
 
        lse_generators_pylon = "lse_gen_" .. p;
 
        
 

	
 
        stead.ref(lse_generators_shield).role = "s";
 
        stead.ref(lse_generators_throw).role = "t";
 
        stead.ref(lse_generators_charge).role = "c";
 
@@ -666,58 +666,46 @@ lse_drake = combatant {
 

	
 
        local dist = math.sqrt((s.x - here().plX) * (s.x - here().plX) + (s.y - here().plY) * (s.y - here().plY));
 
        if (dist < 6) then
 
            if (here():canShoot(s.x, s.y, here().plX, here().plY)) then
 
                -- shoot
 
                if (rnd(4) > dist - 2) then
 
                    pl.hp = pl.hp - 1;
 
                    p("Уильям Дрейк стреляет в вас и попадает. ");
 
            if (dist < 4) then
 
                -- try to run away
 
                local x = s.x;
 
                local y = s.y;
 
                if (math.abs(x - pl.x) > math.abs(y - pl.y)) then
 
                    if (x > pl.x) then
 
                        x = x + 1;
 
                    else
 
                        x = x - 1;
 
                    end;
 
                elseif (math.abs(x - pl.x) < math.abs(y - pl.y)) then
 
                    if (y > pl.y) then
 
                        y = y + 1;
 
                    else
 
                        y = y - 1;
 
                    end;
 
                else
 
                    p("Уильям Дрейк стреляет в вас, но промахивается. ");
 
                end;
 
            else
 
                if (dist < 4) then
 
                    -- try to run away
 
                    local x = s.x;
 
                    local y = s.y;
 
                    
 
                    if (math.abs(x - pl.x) > math.abs(y - pl.y)) then
 
                        if (x > pl.x) then
 
                            x = x + 1;
 
                        else
 
                            x = x - 1;
 
                        end;
 
                    elseif (math.abs(x - pl.x) < math.abs(y - pl.y)) then
 
                        if (y > pl.y) then
 
                    if (rnd(2) > 1) then
 
                        if (here():isPassable(x, y + 1)) then
 
                            y = y + 1;
 
                        else
 
                            y = y - 1;
 
                            x = x + 1;
 
                        end;
 
                    else
 
                        if (rnd(2) > 1) then
 
                            if (here():isPassable(x, y + 1)) then
 
                                y = y + 1;
 
                            else
 
                                x = x + 1;
 
                            end;
 
                        if (here():isPassable(x + 1, y)) then
 
                            x = x + 1;
 
                        else
 
                            if (here():isPassable(x + 1, y)) then
 
                                x = x + 1;
 
                            else
 
                                y = y + 1;
 
                            end;
 
                            y = y + 1;
 
                        end;
 
                    end;
 
                    
 
                    if (here():isPassable(x, y)) then
 
                        s.x = x;
 
                        s.y = y;
 
                        p("Уильям Дрейк отступает. ");
 
                    else
 
                        p("Уильям Дрейк ждет. ");
 
                    end;
 
                end;
 
                if (here():isPassable(x, y)) then
 
                    s.x = x;
 
                    s.y = y;
 
                    p("Уильям Дрейк отступает. ");
 
                else
 
                    p("Уильям Дрейк ждет. ");
 
                end;
 
            else
 
                p("Уильям Дрейк ждет. ");
 
            end;
 
        else 
 
            p("Уильям Дрейк ждет. ");
 
@@ -733,7 +721,6 @@ lse_aedhyarr = combatant {
 
        hp = 1;
 
        gun = 6;
 
    };
 
    enemy = true;
 
    disp = "Аэдхиарр";
 
    disp2 = "Аэдхиарра";
 
    disp3 = "Аэдхиарру";
 
@@ -756,27 +743,52 @@ lse_aedhyarr = combatant {
 
        if here() ~= lse_final_battle then
 
            return
 
        end;
 
        -- Аэдхиарр будет пытаться всеми силами париблизиться к игроку на расстояние выстрела и не будет отступать. 
 

	
 
        local dist = math.sqrt((s.x - here().plX) * (s.x - here().plX) + (s.y - here().plY) * (s.y - here().plY));
 
        if (dist < 4 and here():canShoot(s.x, s.y, here().plX, here().plY)) then
 
            -- shoot
 
            if (rnd(2) > dist - 2) then
 
                pl.hp = pl.hp - 1;
 
                p("Аэдхиарр стреляет в вас и попадает. ");
 
        if (dist < 6) then
 
            if (dist < 4) then
 
                -- try to run away
 
                local x = s.x;
 
                local y = s.y;
 
                if (math.abs(x - pl.x) > math.abs(y - pl.y)) then
 
                    if (x > pl.x) then
 
                        x = x + 1;
 
                    else
 
                        x = x - 1;
 
                    end;
 
                elseif (math.abs(x - pl.x) < math.abs(y - pl.y)) then
 
                    if (y > pl.y) then
 
                        y = y + 1;
 
                    else
 
                        y = y - 1;
 
                    end;
 
                else
 
                    if (rnd(2) > 1) then
 
                        if (here():isPassable(x, y + 1)) then
 
                            y = y + 1;
 
                        else
 
                            x = x + 1;
 
                        end;
 
                    else
 
                        if (here():isPassable(x + 1, y)) then
 
                            x = x + 1;
 
                        else
 
                            y = y + 1;
 
                        end;
 
                    end;
 
                end;
 
                if (here():isPassable(x, y)) then
 
                    s.x = x;
 
                    s.y = y;
 
                    p("Уильям Дрейк отступает. ");
 
                else
 
                    p("Уильям Дрейк ждет. ");
 
                end;
 
            else
 
                p("Аэдхиарр стреляет в вас, но промахивается. ");
 
                p("Уильям Дрейк ждет. ");
 
            end;
 
        else
 
            local path = here():getWalkDistance(s.x, s.y, pl.x, pl.y);
 
                
 
            if path then
 
                s.x = path.p[2][1];
 
                s.y = path.p[2][2];
 
                
 
                p("Аэдхиарр приближается к вам. ");
 
            else
 
                p("Аэдхиарр ждет. ");
 
            end;
 
        else 
 
            p("Уильям Дрейк ждет. ");
 
        end;
 
end;
 
};
0 comments (0 inline, 0 general)