Jump to content

Recommended Posts

I have made up a modded character that is basically a copy paste of Wigfrid's life on attack passive. I would like to know which values determine how much on attack recovery she gets back. Heres the code for reference: 
 

Spoiler

 

local function onattack(inst, data)
    local victim = data.target
    if not inst.components.health:IsDead() and IsValidVictim(victim) then
        local total_health = victim.components.health:GetMaxWithPenalty()
        local damage = data.weapon ~= nil and data.weapon.components.weapon.damage or inst.components.combat.defaultdamage
        local percent = (damage <= 0 and 0)
                    or (total_health <= 0 and math.huge)
                    or damage / total_health
        --math and clamp does account for 0 and infinite cases
        local delta = math.clamp(victim.components.combat.defaultdamage * .25 * percent, .33, 2)

        --decay stored battleborn
        if inst.battleborn > 0 then
            local dt = GetTime() - inst.battleborn_time - BATTLEBORN_STORE_TIME
            if dt >= BATTLEBORN_DECAY_TIME then
                inst.battleborn = 0
            elseif dt > 0 then
                local k = dt / BATTLEBORN_DECAY_TIME
                inst.battleborn = Lerp(inst.battleborn, 0, k * k)
            end
        end

        --store new battleborn
        inst.battleborn = inst.battleborn + delta
        inst.battleborn_time = GetTime()

        --consume battleborn if enough has been stored
        if inst.battleborn > BATTLEBORN_TRIGGER_THRESHOLD then
            inst.components.health:DoDelta(inst.battleborn, false, "battleborn")
            inst.components.sanity:DoDelta(inst.battleborn)
            inst.battleborn = 0
        end
    end
end

 

 

        local delta = math.clamp(victim.components.combat.defaultdamage * .25 * percent, .33, 2

This is the line you are looking for. Lower or raise all numbers a little.

You should consider adjusting BATTLEBORN_TRIGGER_THRESHOLD as well.

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
×
  • Create New...