Module:Traits: Difference between revisions

No change in size ,  14 January 2023
no edit summary
No edit summary
No edit summary
Line 148: Line 148:
             if indexOf(trait_name, detail) then
             if indexOf(trait_name, detail) then
                 local short_detail = prop_short[detail_key]
                 local short_detail = prop_short[detail_key]
                 local short_detail_disguise = short_detail
                 local short_detail_improved = short_detail


                 -- Fix Regen 1.
                 -- Fix Regen 1.
                 if short_detail == 'mp_recovery' then
                 if short_detail == 'mp_recovery' then
                     short_detail_disguise = 'mp'
                     short_detail_improved = 'mp'
                 end
                 end


                 local detail_content = args[short_detail_disguise .. trait_count]
                 local detail_content = args[short_detail_improved .. trait_count]
                 local multiplier = detail_content or default_value[short_detail_disguise] or 100
                 local multiplier = detail_content or default_value[short_detail_improved] or 100
                 local suffix = ''
                 local suffix = ''
                 if short_detail_disguise == 'mp' then
                 if short_detail_improved == 'mp' then
                     suffix = STR.MP
                     suffix = STR.MP
                 elseif short_detail == 'cd' or short_detail == 'duration' then
                 elseif short_detail == 'cd' or short_detail == 'duration' then
Line 164: Line 164:
                 end
                 end


                 local base_detail = args[short_detail_disguise]
                 local base_detail = args[short_detail_improved]


                 local function calcEndValue(base)
                 local function calcEndValue(base)
Line 181: Line 181:
                 local end_value = calcEndValue(base_detail)
                 local end_value = calcEndValue(base_detail)


                 if args[short_detail_disguise .. '_enhanced'] ~= nil then
                 if args[short_detail_improved .. '_enhanced'] ~= nil then
                     end_value = end_value .. "<br/>'''" .. frame:expandTemplate{
                     end_value = end_value .. "<br/>'''" .. frame:expandTemplate{
                         title = 'Tt',
                         title = 'Tt',
                         args = {calcEndValue(args[short_detail_disguise .. '_enhanced']) .. "'''",
                         args = {calcEndValue(args[short_detail_improved .. '_enhanced']) .. "'''",
                                 "Final Enhanced Skill"}
                                 "Final Enhanced Skill"}
                     }
                     }