Module:Damage: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 589: Line 589:
     local hit_count_table = {'total'}
     local hit_count_table = {'total'}
     local awk_table = {''}
     local awk_table = {''}
    local levels_exist = (next(passives) or args.append or trait_count > 0 or args.awk_hits or args.awk_dmg or args.hits)
    local no_max = args.no_max == 'true'


     -- Begin the main loop.
     -- Begin the main loop.
Line 637: Line 639:
             cells[type].th = {}
             cells[type].th = {}


             if (type == 'extra' and args.no_max == 'true') then
             if (type == 'extra' and no_max) then
                 mode_th = new(data.mode)
                 mode_th = new(data.mode)
                 new(data.long, true)
                 new(data.long, true)
Line 643: Line 645:


             if (type == 'passives_normal') then
             if (type == 'passives_normal') then
                 if args.no_max ~= 'true' then
                 if not no_max then
                     mode_th = new(data.mode)
                     mode_th = new(data.mode)
                 else
                 else
                     reverseMultiplySpace(nil, false);
                     reverseMultiplySpace(nil, false);
                 end
                 end
                 if args.no_max ~= true and (next(passives) or args.append or trait_count > 0 or args.awk_hits or args.awk_dmg or args.hits) then
 
                 if (no_max and levels_exist) or not no_max then
                     new(data.base, true)
                     new(data.base, true)
                 end
                 end
Line 744: Line 747:


             if (type == 'hit_count' and not hide) then
             if (type == 'hit_count' and not hide) then
                 if args.no_max == 'true' then
                 if no_max and levels_exist then
                     increaseSpace(mode_th, 'row')
                     increaseSpace(mode_th, 'row')
                elseif levels_exist then
                    reverseMultiplySpace();
                 else
                 else
                     reverseMultiplySpace();
                     reverseMultiplySpace(nil, false);
                 end
                 end
                 local avg_or_each = 'avg'
                 local avg_or_each = 'avg'
Line 770: Line 775:
                 loop_factor = loop_factor * (trait_count + 1)
                 loop_factor = loop_factor * (trait_count + 1)


                 if args.no_max ~= 'true' then
                 if not no_max then
                     for i = 1, loop_factor, 1 do
                     for i = 1, loop_factor, 1 do
                         new(data.avg, true)
                         new(data.avg, true)
Line 781: Line 786:
     end
     end


     if args.no_max == 'true' and args.avg_hits then
     if no_max and args.avg_hits then
         hit_count_table[2] = nil
         hit_count_table[2] = nil
     end
     end