Module:AbilityTable: Difference between revisions

Jump to navigation Jump to search
Vergir (talk | contribs)
m moveslow upgrades
Vergir (talk | contribs)
moveslow/dashslow cells read props from stat_to_props; dashslow skips GroundDashReductionPercent for Heavy Barrage (with help from vergir-bot LLM)
Line 52: Line 52:
     },
     },
     ["moveslow"] = {
     ["moveslow"] = {
    ["Grapple Arm"] = "Applies a short strong slow when the victim reaches Bebop.",
        ["Grapple Arm"] = "Applies a short strong slow when the victim reaches Bebop.",
     }
     },
}
}


Line 65: Line 65:
     },
     },
     ["moveslow"] = {
     ["moveslow"] = {
    "Riposte", -- has a 40% 4s slow somehow? (SlowPercent + SlowDuration)
        "Riposte", -- has a 40% 4s slow somehow? (SlowPercent + SlowDuration)
    "Grasping Hands", -- has SlowPercent
        "Grasping Hands", -- has SlowPercent
     },
     },
     ["dashslow"] = {
     ["dashslow"] = {
    "Itani Lo Sahn" -- has GroundDashReductionPercent but also disables stamina.
        "Itani Lo Sahn", -- has GroundDashReductionPercent but also disables stamina.
     }
     },
}
 
-- Per-ability prop overrides for dashslow: maps ability name to a subset of props to
-- use instead of the full stat_to_props["dashslow"] list.
-- Use when an ability has a prop that doesn't represent an enemy dash slow.
local dashslow_prop_overrides = {
    ["Heavy Barrage"] = { "MaxGroundDashReductionPercent", "MoveSpeedAndDashSlowPct", "EnemyDashSlowPercent" },
}
}


Line 330: Line 337:
-- Upgrade deltas are additive; notes track totals.
-- Upgrade deltas are additive; notes track totals.
local function pct_stat_cells(ability, col_name, fields)
local function pct_stat_cells(ability, col_name, fields)
     local cells = {}
     local cells = {}
     local notes = {}
     local notes = {}


     local first_field, first_tier, first_val = find_first_value(ability, fields)
     local first_field, first_tier, first_val = find_first_value(ability, fields)
Line 340: Line 347:
     cells[col_name] = cell_str
     cells[col_name] = cell_str


    -- Scan upgrades for changes after the first value.
     local upgrades = ability["Upgrades"]
     local upgrades = ability["Upgrades"]
     if type(upgrades) == "table" then
     if type(upgrades) == "table" then
         local running   = first_val
         local running   = first_val
         local seen_first = (first_tier == nil)
         local seen_first = (first_tier == nil)


Line 350: Line 356:
                 if first_tier == i then
                 if first_tier == i then
                     seen_first = true
                     seen_first = true
                 else
                 elseif seen_first then
                    -- Check if any of our fields has a delta in this tier
                     local delta = nil
                     local delta = nil
                     for _, field in ipairs(fields) do
                     for _, field in ipairs(fields) do
Line 357: Line 362:
                         if v and v ~= 0 then delta = math.abs(v); break end
                         if v and v ~= 0 then delta = math.abs(v); break end
                     end
                     end
                     if seen_first and delta then
                     if delta then
                         local total = running + delta
                         local total = running + delta
                         table.insert(notes, "T" .. i .. " upgrade increases "
                         table.insert(notes, "T" .. i .. " upgrade increases "
Line 374: Line 379:


local function moveslow_cells(ability)
local function moveslow_cells(ability)
     return pct_stat_cells(ability, "Move Slow", { "SlowPercent", "EnemySlowPct", "MoveSlowPercent" })
     return pct_stat_cells(ability, "Move Slow", stat_to_props["moveslow"])
end
end


local function dashslow_cells(ability)
local function dashslow_cells(ability)
     return pct_stat_cells(ability, "Dash Slow", {
    local fields = dashslow_prop_overrides[ability["Name"]] or stat_to_props["dashslow"]
        "GroundDashReductionPercent", "MaxGroundDashReductionPercent",
     return pct_stat_cells(ability, "Dash Slow", fields)
        "MoveSpeedAndDashSlowPct", "EnemyDashSlowPercent",
    })
end
end