Jump to content

Which values change in Mods


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

 

 

Link to comment
Share on other sites

        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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...