Module:AbilityTable: Difference between revisionsGive feedback
Jump to navigation
Jump to search
Fix dashslow caster-slow detection: scan only enemy-targeted props in upgrades, not GroundDashReductionPercent itself (with help from vergir-bot LLM) |
Remove dashslow_enemy_props constant; iterate stat_to_props["dashslow"] inline with skip condition (with help from vergir-bot LLM) |
||
| Line 383: | Line 383: | ||
return cells | return cells | ||
end | end | ||
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 any | -- If GroundDashReductionPercent is set at base AND any other dashslow 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 | ||
-- an enemy debuff. Exclude it from the main value and note it instead. | -- 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 | local has_enemy_prop = false | ||
for _, p in ipairs( | for _, p in ipairs(stat_to_props["dashslow"]) do | ||
local v = num_val(ability[p]) | if p ~= "GroundDashReductionPercent" then | ||
local v = num_val(ability[p]) | |||
if v and v ~= 0 then has_enemy_prop = true; break end | |||
end | |||
end | end | ||
if not has_enemy_prop then | if not has_enemy_prop then | ||
| Line 407: | Line 405: | ||
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(stat_to_props["dashslow"]) do | ||
local v = num_val(tier[p]) | if p ~= "GroundDashReductionPercent" then | ||
local v = num_val(tier[p]) | |||
if v and v ~= 0 then has_enemy_prop = true; break end | |||
end | |||
end | end | ||
end | end | ||