Module:ItemData: Difference between revisions

No edit summary
LVL (talk | contribs)
Added bonusbasehealth for colossus
 
(One intermediate revision by the same user not shown)
Line 25: Line 25:
BonusAbilityDurationPercent = true,
BonusAbilityDurationPercent = true,
BonusAttackRangePercent = true,
BonusAttackRangePercent = true,
BonusBaseHealth = true,
BonusBulletSpeedPercent = true,
BonusBulletSpeedPercent = true,
BonusClipSizePercent = true,
BonusClipSizePercent = true,
Line 129: Line 130:
WeaponDamagePerStack = true,
WeaponDamagePerStack = true,
WeaponPowerPerStack = true,
WeaponPowerPerStack = true,
}
-- Mappings from placeholder tokens (used in descriptions) to the actual
-- flat property keys in Data:ItemData.json
local PROPERTY_KEY_OVERRIDES = {
    ["ArcaneSurgeWindow"] = "AbilityDuration",
    -- Add any other mismatches here as they appear
}
}


Line 276: Line 284:
--check Data:ItemData.json for properties
--check Data:ItemData.json for properties
p.get_prop = function(frame)
p.get_prop = function(frame)
local item_name = frame.args[1]
    local item_name = frame.args[1]
local property = frame.args[2]
    local property = frame.args[2]
local raw = frame.args.raw == 'true'
    local raw = frame.args.raw == 'true'
local item = get_json_item(item_name)
    local item = get_json_item(item_name)
if(item == nil) then return "<span style=\"color:red;\">Item Not Found.</span>" end
    if(item == nil) then return "<span style=\"color:red;\">Item Not Found.</span>" end


local prop_value = item[property]
    -- Look up property directly; if missing, try the override table
if (prop_value == nil) then return nil end
    local prop_value = item[property]
    if prop_value == nil and PROPERTY_KEY_OVERRIDES[property] then
        prop_value = item[ PROPERTY_KEY_OVERRIDES[property] ]
    end
    if (prop_value == nil) then return nil end


local display_value
local display_value