Module:AbilityTable: Difference between revisionsGive feedback
Jump to navigation
Jump to search
dashslow: auto-detect caster GroundDashReductionPercent and note it; moveslow: note ChannelSlowPercent caster slow; remove dashslow_prop_overrides (with help from vergir-bot LLM) |
Fix dashslow caster-slow detection: scan only enemy-targeted props in upgrades, not GroundDashReductionPercent itself (with help from vergir-bot LLM) |
||
| Line 383: | Line 383: | ||
return cells | return cells | ||
end | end | ||
-- The enemy-targeted dash slow props (everything except GroundDashReductionPercent, | |||
-- which can be either a caster self-slow or an enemy debuff depending on context). | |||
local dashslow_enemy_props = { "MaxGroundDashReductionPercent", "MoveSpeedAndDashSlowPct", "EnemyDashSlowPercent" } | |||
local function dashslow_cells(ability) | local function dashslow_cells(ability) | ||
local props = stat_to_props["dashslow"] | local props = stat_to_props["dashslow"] | ||
-- If GroundDashReductionPercent is set at base AND | -- If GroundDashReductionPercent is set at base AND any enemy-targeted dash slow prop | ||
-- exists anywhere (base or upgrades), the base value is a caster self-slow | -- exists anywhere (base or upgrades), the base value is a caster self-slow rather than | ||
-- | -- an enemy debuff. Exclude it from the main value and note it instead. | ||
local caster_dash_slow = nil | local caster_dash_slow = nil | ||
local base_ground = num_val(ability["GroundDashReductionPercent"]) | local base_ground = num_val(ability["GroundDashReductionPercent"]) | ||
if base_ground and base_ground ~= 0 then | if base_ground and base_ground ~= 0 then | ||
local has_enemy_prop = false | |||
for _, p in ipairs(dashslow_enemy_props) do | |||
local | |||
for _, p in ipairs( | |||
local v = num_val(ability[p]) | local v = num_val(ability[p]) | ||
if v and v ~= 0 then | if v and v ~= 0 then has_enemy_prop = true; break end | ||
end | end | ||
if not | if not has_enemy_prop then | ||
local upgrades = ability["Upgrades"] | local upgrades = ability["Upgrades"] | ||
if type(upgrades) == "table" then | if type(upgrades) == "table" then | ||
for _, tier in ipairs(upgrades) do | for _, tier in ipairs(upgrades) do | ||
if type(tier) == "table" then | if type(tier) == "table" then | ||
for _, p in ipairs( | for _, p in ipairs(dashslow_enemy_props) do | ||
local v = num_val(tier[p]) | local v = num_val(tier[p]) | ||
if v and v ~= 0 then | if v and v ~= 0 then has_enemy_prop = true; break end | ||
end | end | ||
end | end | ||
if | if has_enemy_prop then break end | ||
end | end | ||
end | end | ||
end | end | ||
if | if has_enemy_prop then | ||
caster_dash_slow = math.abs(base_ground) | caster_dash_slow = math.abs(base_ground) | ||
local filtered = {} | local filtered = {} | ||
for _, p in ipairs(props) do | for _, p in ipairs(props) do | ||