Module:Damage: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 49: Line 49:
         end
         end
     end
     end
    local array_regex = "%d%.%d,%s%d%.%d"
    local passive1 = 0
    local passive2 = 0
    if inArgs('passive1') then
        passive1 = args.passive1
        if string.match(passive1, array_regex) then
            passive1 = split(passive1)
        else
            passive1 = split(frame:preprocess('{{:' .. passive1 .. '}}{{#arrayprint:' .. passive1 .. '}}'))
        end
    end
    if inArgs('passive2') then
        passive2 = args.passive2
        if string.match(passive2, array_regex) then
            passive2 = split(passive2)
        else
            passive2 = split(frame:preprocess('{{:' .. passive2 .. '}}{{#arrayprint:' .. passive2 .. '}}'))
        end
    end
   


     function list(ispvp)
     function list(ispvp)
Line 130: Line 153:
             end
             end
         end
         end
        -- Define passives and fill the respective tables.
        local passive2 = 0


         -- Get a table of merged base & trait values
         -- Get a table of merged base & trait values
Line 139: Line 159:


         if inArgs('passive2') then
         if inArgs('passive2') then
             passive2 = split(args.passive2)
              
 
             for k, v in spairs(ftvals) do
             for k, v in spairs(ftvals) do
                 local dmg_name = k .. '_passive2'
                 local dmg_name = k .. '_passive2'
Line 152: Line 171:
         end
         end


        local passive1 = 0
         if inArgs('passive1') then
         if inArgs('passive1') then
            passive1 = split(args.passive1)


             for k, v in spairs(ftvals) do
             for k, v in spairs(ftvals) do