Module:Abilities/card: Difference between revisionsGive feedback
Jump to navigation
Jump to search
Fix Fire Scarabs T3 upgrade description: suppress "0 DPS" and show "Increased Spirit scaling". Refactor create_description to handle scaling‑only properties |
Gammaton32 (talk | contribs) weapon power scaling value |
||
| Line 317: | Line 317: | ||
local hero = get_hero_data(hero_key) | local hero = get_hero_data(hero_key) | ||
value = prop.Value + hero.HeavyMeleeDamage * prop.Scale.Value | value = prop.Value + hero.HeavyMeleeDamage * prop.Scale.Value | ||
elseif prop.Scale and prop.Scale.Type == 'weapon_power' then | |||
local hero = get_hero_data(hero_key) | |||
value = hero.Weapon.BulletDamage * hero.Weapon.BulletsPerBurst * (prop.Scale.Value + 100) / 100 | |||
end | end | ||
| Line 388: | Line 391: | ||
local alt_boxes = {} | local alt_boxes = {} | ||
for k, prop in pairs(props) do | |||
-- Some props don't have values, as those come from upgrades | |||
-- For now, we will ignore these and only show data for the base ability | |||
if prop.Value then | |||
local icon = Icon.getAttrIcon(prop.Type) | |||
local value = prop.Value | |||
if prop.Scale and prop.Scale.Type == 'weapon_power' then | |||
local hero = get_hero_data(hero_key) | |||
value = hero.Weapon.BulletDamage * hero.Weapon.BulletsPerBurst * (prop.Scale.Value + 100) / 100 | |||
end | |||
local alt_box = frame:expandTemplate{ | |||
title = "Ability_card_v2/Card/AltBox", | |||
args = { | |||
key = prop.Key, | |||
value = value, | |||
icon = icon and icon.img, | |||
icon_link = icon and icon.link, | |||
icon_color = icon and icon.color, | |||
icon_size = icon and icon.size, | |||
scale_value = prop.Scale and commonutils.round_to_sig_fig(prop.Scale.Value, 3), | |||
scale_type = prop.Scale and prop.Scale.Type, | |||
hide = value == 0 and "true" or "false", | |||
} | |||
} | |||
table.insert(alt_boxes, alt_box) | |||
end | |||
end | |||
return alt_boxes | return alt_boxes | ||