Changeset - 4e0b6590547a
[Not reviewed]
default
0 2 0
Silverwing - 6 years ago 2018-12-14 18:39:22

Proper show of HitPoints
2 files changed with 12 insertions and 8 deletions:
0 comments (0 inline, 0 general)
battlefield.lua
Show inline comments
 
@@ -131,6 +131,7 @@ hp_indicator:disable();
 

	
 
battlefield = function(tab)
 
    local make_turn = tab.make_turn;
 
    tab.showhp = true;
 
    tab.nosave = true;
 
    tab.noautosave = true;
 
    tab.isPassable = function(s, x, y)
 
@@ -255,7 +256,6 @@ battlefield = function(tab)
 

	
 
    tab.entered = function(s)
 
        s:check_walk();
 
        hp_indicator:enable();
 
        if (type(entered) == 'function') then
 
            return entered(s);
 
        else
 
@@ -263,10 +263,6 @@ battlefield = function(tab)
 
        end;
 
    end;
 
    
 
    tab.left = function(s)
 
        hp_indicator:disable();
 
    end;
 

	
 
    tab.onreload = function(s)
 
        here():make_turn();
 
    end;
utils.lua
Show inline comments
 
@@ -136,10 +136,18 @@ function kh_vroom(disp, target, nam, see
 
	};
 
end;
 
 
--[[room = inherit(room, function(v)
 
    v.forcedsc = true;
 
room = inherit(room, function(v)
 
    v.entered = stead.hook(v.entered, function(f, s, ...)
 
        if s.showhp then
 
            hp_indicator:enable();
 
        else
 
            hp_indicator:disable();
 
        end;
 
        return f(s, ...)
 
    end)
 
 
    return v;
 
end);]]
 
end)
 
 
dlg = inherit(dlg, function(v)
 
    v.hideinv = true;
0 comments (0 inline, 0 general)