Skip to content

Fix issues around scaleability and Runegraft of the Bound #8980

@Wires77

Description

@Wires77

Revisiting this code when looking over this PR makes me realize there are a few more hidden gotchas here.

  1. Making a mod unscalable in a LIST mod doesn't do anything. An example of this would be "banners also cause enemies to take (%d+)%% increased damage". This code only checks for unscalable at the LIST level, not for each subMod:
    function ModStoreClass:ScaleAddMod(mod, scale, replace)
    local unscalable = false
    for _, effects in ipairs(mod) do
    if effects.unscalable then
    unscalable = true
    break
    end
    end
    if scale == 1 or unscalable then
    self:AddMod(mod)
    else
    local scaledMod = copyTable(mod)
    local subMod = scaledMod
    if type(scaledMod.value) == "table" then
  2. Unscaleable mods get added twice. I tested "take no extra damage from critical strikes" and saw the value double (even though there is a hard cap on a lot of these unscalable mods
image

In short, I'll merge this PR but I needed to write this down somewhere so it can be refactored again, with proper test cases added for all these corner cases.

Originally posted by @Wires77 in #8977 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions