Changeset - 12dc77d6f1ec
[Not reviewed]
default
0 2 0
silverwing - 4 years ago 2019-11-24 12:01:34

Improve battle messaging
2 files changed with 21 insertions and 7 deletions:
0 comments (0 inline, 0 general)
battlefield.lua
Show inline comments
 
@@ -529,11 +529,20 @@ bf_wait = obj {
 
combatant = function(tab)
 
    if (tab.canshoot == nil) then
 
        tab.canshoot = function(s)
 
            if not here():canShoot(here().plX, here().plY, s.x, s.y) then
 
                return false, 'Вы не попадете в цель отсюда!';
 
            end;
 
            local dist = math.sqrt((s.x - here().plX) * (s.x - here().plX) + (s.y - here().plY) * (s.y - here().plY));
 
            return dist < 6 and not tab.ally;
 

	
 
            if tab.ally then
 
                return false, nil;
 
            elseif dist >= 6 then
 
                return false, 'Цель слишком далеко!';
 
            end;
 
            return true;
 
        end;
 
    end;
 
    
 

	
 
    if (tab.onthrust == nil) then
 
        tab.onthrust = function(s)
 
            local dist = math.sqrt((s.x - here().plX) * (s.x - here().plX) + (s.y - here().plY) * (s.y - here().plY));
items.lua
Show inline comments
 
@@ -410,7 +410,7 @@ item_spear = obj {
 
        elseif (o.nohitmsg) then
 
            return o.nohitmsg;
 
        else
 
            return "Я не буду этого делать!";
 
            return "Фаэтларр не станет этого делать!";
 
        end;
 
    end;
 
};
 
@@ -436,7 +436,7 @@ item_colt = obj {
 
		
 
		local canshoot = false;
 
		if (type(o.canshoot) == "function") then
 
			canshoot = o.canshoot(o);
 
			canshoot, noshootmsg = o.canshoot(o);
 
		else
 
			canshoot = o.canshoot;
 
		end;
 
@@ -449,12 +449,14 @@ item_colt = obj {
 
			else
 
				return "";
 
			end;
 
        elseif noshootmsg then
 
            return noshootmsg;
 
		elseif o.noshootsilent then
 
			return
 
		elseif o.noshootmsg then
 
			return o.noshootmsg;
 
		else
 
			return "Я не буду этого делать!";
 
			return "Не стоит этого делать!";
 
		end;
 
	end;
 
	inv = function(s)
 
@@ -487,7 +489,8 @@ item_harpoon = obj {
 
    use = function(s, o)
 
        local canshoot = false;
 
        if (type(o.canshoot) == "function") then
 
            canshoot = o:canshoot();
 
            canshoot, noshootmsg = o:canshoot();
 
            print(canshoot, noshootmsg);
 
        else
 
            canshoot = o.canshoot;
 
        end;
 
@@ -518,12 +521,14 @@ item_harpoon = obj {
 
            else
 
                return "";
 
            end;
 
        elseif noshootmsg then
 
            return noshootmsg;
 
		elseif o.noshootsilent then
 
			return
 
        elseif (o.noshootmsg) then
 
            return o.noshootmsg;
 
        else
 
            return "Я не буду этого делать!";
 
            return "Не стоит этого делать!";
 
        end;
 
    end;
 
    inv = function(s)
0 comments (0 inline, 0 general)