Module:Traits: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 55: Line 55:
         },
         },
         [STR.CRITICAL] = {
         [STR.CRITICAL] = {
             mp = 120,
             mp = 120
            def = 50
         },
         },
         [STR.HASTE] = {
         [STR.HASTE] = {
Line 158: Line 157:
                 end
                 end
                 local base_detail = args[short_detail]
                 local base_detail = args[short_detail]
                local short_detail_disguise = short_detail


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


                 local end_value = (tonumber(multiplier) / 100) * tonumber(base_detail or 0);
                 local function calcEndValue(base)
                if end_value <= 0 then
                    local end_value = (tonumber(multiplier) / 100) * tonumber(base or 0);
                    end_value = '-'
                    if end_value <= 0 then
                        end_value = '-'
                    end
                    return end_value .. suffix
                 end
                 end
                 local detail_cell = tr3:tag('td'):wikitext(end_value .. suffix);
 
                local end_value = calcEndValue(base_detail)
               
                if args[short_detail_disguise .. '_enhanced'] ~= nil then
                    end_value = end_value .. "<br/>'''" .. frame:expandTemplate{
                        title = 'Tt',
                        args = {
                            calcEndValue(args[short_detail_disguise .. '_enhanced']) .. "'''",
                            "Final Enhanced Skill"
                        }
                    }
                end
 
                 local detail_cell = tr3:tag('td'):wikitext(end_value);
             end
             end
         end
         end