Jump to content
Bonuspunkt

TrueStack

Recommended Posts

Available at Workshop http://steamcommunity.com/sharedfiles/filedetails/?id=788616471

vvv--- original post ----vvv

Displays how much damage it takes to kill you

require "base/internal/ui/reflexcore"

TrueStack =
{
    draw = function()

        -- Early out if HUD shouldn´t be shown.
        if not shouldShowHUD() then return end;

        -- Find player
        local player = getPlayer();

        local textColor = Color(255,255,255,255);

        nvgFontSize(52);
        nvgFontFace("TitilliumWeb-Bold");
        nvgTextAlign(NVG_ALIGN_CENTER, NVG_ALIGN_TOP);
        nvgFontBlur(0);
        nvgFillColor(textColor);

        local armorProtection = player.armorProtection + 1;

        local maxDamage =
            math.min(player.armor, player.health * armorProtection) +
            player.health;

        nvgText(0, 0, maxDamage);
    end
};
registerWidget("TrueStack");

Share this post


Link to post
Share on other sites
        local armorProtection = player.armorProtection + 1;

        local maxDamage =
            math.min(player.armor, player.health * armorProtection) +
            player.health;

Strange formula... I'd be interested in knowing what exactly what the armorProtection variable is... is it a bool 0/1, i.e. you either have protection or your don't or some scalar?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×