Module:Traits: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 150: Line 150:
                 local short_detail = prop_short[detail_key]
                 local short_detail = prop_short[detail_key]
                 local detail_content = args[short_detail .. trait_count]
                 local detail_content = args[short_detail .. trait_count]
                 local multiplier = detail_content or default_value[short_detail]
                 local multiplier = detail_content or default_value[short_detail] or 100
                 if multiplier ~= nil then
                 local suffix = ''
                    local suffix = ''
                if short_detail == 'mp' or short_detail == 'mp_recovery' then
                    if short_detail == 'mp' or short_detail == 'mp_recovery' 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
                    suffix = STR.SEC
                        suffix = STR.SEC
                    end
                    local end_value = (tonumber(multiplier or 100) / 100) * tonumber(args[short_detail] or 0);
                    if end_value <= 0 then
                        end_value = '-'
                    end
                    local detail_cell = tr3:tag('td'):wikitext(end_value .. suffix);
                 end
                 end
                local base_detail = args[short_detail]
                -- Fix Regen 1.
                if short_detail == 'mp_recovery' then
                    base_detail = args.mp
                end
                local end_value = (tonumber(multiplier) / 100) * tonumber(base_detail or 0);
                if end_value <= 0 then
                    end_value = '-'
                end
                local detail_cell = tr3:tag('td'):wikitext(end_value .. suffix);
             end
             end
         end
         end