• Welcome to the Kancolle Wiki!
  • If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord

Changes

Jump to navigation Jump to search
no edit summary
Line 1: Line 1:  
local Utils = require('Module:Utils')
 
local Utils = require('Module:Utils')
 
local getArgs = require('Module:GetArgs')
 
local getArgs = require('Module:GetArgs')
 +
local Ship = require('Module:Ship')
    
local seiyuus = {
 
local seiyuus = {
Line 138: Line 139:  
         url = "http://myanimelist.net/people/28053/Yuki_Yamada",
 
         url = "http://myanimelist.net/people/28053/Yuki_Yamada",
 
         ships = {"Agano", "Noshiro", "Sakawa", "Yahagi", },
 
         ships = {"Agano", "Noshiro", "Sakawa", "Yahagi", },
 +
    },
 +
}
 +
 +
local types = {
 +
    ["Destroyers"] = {
 +
        ships = { "Akatsuki", "Akebono", "Akigumo", "Akizuki", "Amatsukaze", "Arare", "Arashi", "Arashio", "Asagumo", "Asashimo", "Asashio", "Ayanami", "Fubuki", "Fumizuki", "Hagikaze", "Hamakaze", "Harusame", "Hatsuharu", "Hatsukaze", "Hatsushimo", "Hatsuyuki", "Hayashimo", "Hibiki", "Ikazuchi", "Inazuma", "Isokaze", "Isonami", "Kagerou", "Kasumi", "Kawakaze", "Kazagumo", "Kikuzuki", "Kisaragi", "Kiyoshimo", "Kuroshio", "Libeccio", "Maikaze", "Makigumo", "Michishio", "Mikazuki", "Miyuki", "Mochizuki", "Murakumo", "Murasame", "Mutsuki", "Naganami", "Nagatsuki", "Nenohi", "Nowaki", "Oboro", "Ooshio", "Samidare", "Satsuki", "Sazanami", "Shigure", "Shikinami", "Shimakaze", "Shiranui", "Shiratsuyu", "Shirayuki", "Suzukaze", "Takanami", "Tanikaze", "Teruzuki", "Tokitsukaze", "Umikaze", "Urakaze", "Ushio", "Uzuki", "Wakaba", "Yamagumo", "Yayoi", "Yukikaze", "Yuudachi", "Yuugumo", "Z1", "Z3" }
 +
    },
 +
    ["Light Cruisers"] = {
 +
        ships = { "Abukuma", "Agano", "Isuzu", "Jintsuu", "Katori", "Kinu", "Kiso", "Kitakami", "Kuma", "Nagara", "Naka", "Natori", "Noshiro", "Ooi", "Ooyodo", "Sakawa", "Sendai", "Tama", "Tatsuta", "Tenryuu", "Yahagi", "Yura", "Yuubari" }
 +
    },
 +
    ["Heavy Cruisers"] = {
 +
        ships = { "Aoba", "Ashigara", "Atago", "Chikuma", "Choukai", "Furutaka", "Haguro", "Kako", "Kinugasa", "Kumano", "Maya", "Mikuma", "Mogami", "Myoukou", "Nachi", "Prinz Eugen", "Suzuya", "Takao", "Tone" }
 +
    },
 +
    ["Battleships"] = {
 +
        ships = { "Bismarck", "Fusou", "Haruna", "Hiei", "Hyuuga", "Ise", "Kirishima", "Kongou", "Littorio", "Musashi", "Mutsu", "Nagato", "Roma", "Yamashiro", "Yamato" }
 +
    },
 +
    ["Light Carriers"] = {
 +
        ships = { "Chitose", "Chiyoda", "Hiyou", "Houshou", "Jun'you", "Ryuuhou", "Ryuujou", "Shouhou", "Zuihou" }
 +
    },
 +
    ["Standard Carriers"] = {
 +
        ships = { "Akagi", "Amagi", "Graf Zeppelin", "Hiryuu", "Kaga", "Katsuragi", "Shoukaku", "Souryuu", "Taihou", "Unryuu", "Zuikaku" }
 +
    },
 +
    ["Submarines"] = {
 +
        ships = { "I-168", "I-19", "I-401", "I-58", "I-8", "Maruyu", "U-511" }
 +
    },
 +
    ["Auxiliaries"] = {
 +
        ships = { "Akashi", "Akitsu Maru", "Akitsushima", "Hayasui", "Kashima", "Katori", "Mizuho", "Taigei" }
 
     },
 
     },
 
}
 
}
Line 143: Line 171:  
local Seasonal = {}
 
local Seasonal = {}
   −
function Seasonal.toc(frame)
+
function gen(args, tbl, type, format)
    local args = getArgs{frame = frame:getParent()}
   
     local result = ""
 
     local result = ""
 
     local i = 0
 
     local i = 0
     for seiyuu, data in pairs(seiyuus) do
+
    local n = 0
 +
     for k, data in pairs(tbl) do
 +
        local j = 0
 
         local ships = Utils.filter(data.ships, function(ship) return Utils.find(args, ship) end)
 
         local ships = Utils.filter(data.ships, function(ship) return Utils.find(args, ship) end)
 
         if #ships > 0 then
 
         if #ships > 0 then
 
             i = i + 1
 
             i = i + 1
 +
            j = j + 1
 +
            n = n + #ships
 
             local ships_str = table.concat(Utils.map(ships, function(ship) return string.format("[[#%s|%s]]", ship, ship) end), ", ")
 
             local ships_str = table.concat(Utils.map(ships, function(ship) return string.format("[[#%s|%s]]", ship, ship) end), ", ")
 
             if data.url then
 
             if data.url then
                 result = result .. string.format("|-\n|[%s %s]\n|%s\n", data.url, seiyuu, ships_str)
+
                 result = result .. string.format("|-\n|[%s %s]\n|%s\n", data.url, k, ships_str)
 +
            elseif type == "types" then
 +
                result = result .. string.format("|-\n|[[#%s|%s]] (%s)\n|%s\n", args[k] or k, k, j, ships_str)
 
             else
 
             else
                 result = result .. string.format("|-\n|%s\n|%s\n", seiyuu, ships_str)
+
                 result = result .. string.format("|-\n|%s\n|%s\n", k, ships_str)
 
             end
 
             end
 
         end
 
         end
 
     end
 
     end
     result = string.format([===[{| class="mw-collapsible mw-collapsed wikitable typography-xl-optout" style="width:100%%"
+
     return format(result, i, n)
 +
end
 +
 
 +
function Seasonal.toc(frame)
 +
    local args = getArgs{frame = frame:getParent()}
 +
    return
 +
        gen(args, types, "types", function(r, i, n) return string.format([===[{| class="mw-collapsible mw-collapsed wikitable typography-xl-optout" style="width:100%%"
 +
|-
 +
!width=20%%|Class
 +
!Ship girls (%s)
 +
]===], n) .. r .. "|}" end)
 +
        .. "\n" ..
 +
        gen(args, seiyuus, "seiyuus", function(r, i, n) return string.format([===[{| class="mw-collapsible mw-collapsed wikitable typography-xl-optout" style="width:100%%"
 
|-
 
|-
 
!width=20%%|[[Glossary#List_of_Vessels_by_Seiyuu|Seiyuu]] (%s)
 
!width=20%%|[[Glossary#List_of_Vessels_by_Seiyuu|Seiyuu]] (%s)
 
!
 
!
]===], i) .. result .. "|}"
+
]===], i) .. r .. "|}" end)
    return result
+
 
 
end
 
end
   
return Seasonal
 
return Seasonal
cssedit, gkautomate
7,064

edits

Navigation menu