Module:maimai Difficulty: Difference between revisions

no edit summary
imported>Jack980517
No edit summary
imported>Jack980517
No edit summary
Line 6: Line 6:
function p.maimai_difficulty_multi(frame)
function p.maimai_difficulty_multi(frame)
     args=frame:getParent().args
     args=frame:getParent().args
    mw.logObject(args)
     local result = "maimai "
     local result = "maimai "
     if VerToNum({"maimai", args[1]}) <= 2 then
     if VerToNum({"maimai", args[1]}) <= 2 then
Line 13: Line 12:
         result = result .. "difficulty rated "
         result = result .. "difficulty rated "
     end
     end
     if VerToNum({"maimai", args[2]}) <= 2 then
     if args[2] ~= nil and VerToNum({"maimai", args[2]}) <= 2 then
         -- ugly hack; #args can't be used, and since there's (currently) no songs removed in _~_+ and revived later, the only use case is 舞萌 songs.
         -- ugly hack; #args can't be used, and since there's (currently) no songs removed in _~_+ and revived later, the only use case is 舞萌 songs.
         result = result .. "."
         result = result .. "."
Line 32: Line 31:
     }
     }
     local j = 1
     local j = 1
     for i = 1, #args, 2 do
     for i = 1, 99, 2 do -- again, ugly hack
         local startver = args[i]
         if args[i] == nil then break end
         local endver = ""
         local startvernum = VerToNum({"maimai", args[i]})
        if i ~= #args then
         local endvernum = VerToNum({"maimai", args[i + 1]})
            endver = args[i + 1]
         if endvernum == nil then
        end
             endvernum = 99
        -- print('start = ' .. startver .. ' end = ' .. endver)
         local startvernum = VerToNum({"maimai", startver})
         local endvernum = 99
        if endver ~= "" then
             endvernum = VerToNum({"maimai", endver})
         end
         end
         for j = 1, #version_range_borders do
         for j = 1, #version_range_borders do
Line 76: Line 70:
     end
     end
     result = result .. "<br>[[Category:Songs]][[Category:maimai Songs]]"
     result = result .. "<br>[[Category:Songs]][[Category:maimai Songs]]"
     if #args % 2 == 0 then
     if endvernum ~= 99 then
         result = result .. "[[Category:maimai Removed Songs]]"
         result = result .. "[[Category:maimai Removed Songs]]"
     end
     end
Anonymous user