Changes

m
no edit summary
Line 4: Line 4:  
-- Remi_Scarlet
 
-- Remi_Scarlet
 
-- I fucking hate lua.
 
-- I fucking hate lua.
+
 
 
-- 10/24/15 Added colorful blue button as per Wsewo's request.
 
-- 10/24/15 Added colorful blue button as per Wsewo's request.
    
-- 11/22/17 Modified by がか
 
-- 11/22/17 Modified by がか
+
 
 
-- checks if data is in the array as a key
 
-- checks if data is in the array as a key
+
 
 
function valid(data, array)
 
function valid(data, array)
 
     local valid = {}
 
     local valid = {}
Line 24: Line 24:  
     end
 
     end
 
end
 
end
+
 
 
-- returns a string representation of a table.
 
-- returns a string representation of a table.
 
-- cannot do recursive tables. Eg, only single dimensional tables will work
 
-- cannot do recursive tables. Eg, only single dimensional tables will work
Line 48: Line 48:  
     return final
 
     return final
 
end
 
end
+
 
 
-- takes a string and returns string with first letter capitalized
 
-- takes a string and returns string with first letter capitalized
 
function capitalize(str)
 
function capitalize(str)
 
     return (str:gsub("^%l", string.upper))
 
     return (str:gsub("^%l", string.upper))
 
end
 
end
+
 
 
-- "info" should be higher level table of information with eg  
 
-- "info" should be higher level table of information with eg  
 
-- {["A"] = {["1"] = {["xp"]="120", ["main_info"] = "ta-class etc"}
 
-- {["A"] = {["1"] = {["xp"]="120", ["main_info"] = "ta-class etc"}
Line 75: Line 75:  
         return size
 
         return size
 
     end
 
     end
+
 
+
 
 
     local numCols = 0
 
     local numCols = 0
 
     for _,bool in pairs(headers) do
 
     for _,bool in pairs(headers) do
 
         if bool then numCols = numCols + 1 end
 
         if bool then numCols = numCols + 1 end
 
     end
 
     end
+
   
 
     -- Will be used to uniquely identify each table with the "button" and the "table content". Normally
 
     -- Will be used to uniquely identify each table with the "button" and the "table content". Normally
 
     -- this would be done with like mw-customtoggle-1-1-enemy or whatnot, but since I can't
 
     -- this would be done with like mw-customtoggle-1-1-enemy or whatnot, but since I can't
Line 87: Line 87:  
     -- rendering to replace the map identifier.
 
     -- rendering to replace the map identifier.
 
     local uniqueID = remiLib.timeHash(info)
 
     local uniqueID = remiLib.timeHash(info)
+
   
 
     local classString = "mw-customtoggle-" .. tostring(uniqueID)
 
     local classString = "mw-customtoggle-" .. tostring(uniqueID)
 
     local idString = "mw-customcollapsible-" .. tostring(uniqueID)
 
     local idString = "mw-customcollapsible-" .. tostring(uniqueID)
+
   
 
     local button = mw.html.create('div')
 
     local button = mw.html.create('div')
 
     button
 
     button
Line 96: Line 96:  
     :addClass("globalbutton")
 
     :addClass("globalbutton")
 
     :wikitext("Show/Hide Nodes and Enemy Encounters")
 
     :wikitext("Show/Hide Nodes and Enemy Encounters")
+
 
 
     local encounterTable = mw.html.create("table")
 
     local encounterTable = mw.html.create("table")
 
     encounterTable
 
     encounterTable
Line 143: Line 143:  
     end
 
     end
 
     encounterTable:node(headerRow)
 
     encounterTable:node(headerRow)
     local letterOrder = {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","Z1", "Z2", "Z3", "Z4", "Z5", "Z6", "Z7", "Z8", "Z9", "ZZ1", "ZZ2", "ZZ3"}
+
     local letterOrder = {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","O1","O2","O3","P","P1","P2","P3","Q","Q1","Q2","Q3","R","S","T","U","V","W","X","Y","Z","Z1", "Z2", "Z3", "Z4", "Z5", "Z6", "Z7", "Z8", "Z9", "ZZ1", "ZZ2", "ZZ3"}
 
     for _,nodeLetter in pairs(letterOrder) do
 
     for _,nodeLetter in pairs(letterOrder) do
 
         local values = info[nodeLetter]
 
         local values = info[nodeLetter]
Line 153: Line 153:  
                 nodeName = nodeName .. "<br>" .. values["label"]
 
                 nodeName = nodeName .. "<br>" .. values["label"]
 
             end
 
             end
+
 
 
             firstCol
 
             firstCol
 
                     :wikitext(nodeName)
 
                     :wikitext(nodeName)
Line 175: Line 175:  
             end
 
             end
 
             firstRow:node(mw.html.create("td"):wikitext(text)):css("text-align","center")
 
             firstRow:node(mw.html.create("td"):wikitext(text)):css("text-align","center")
+
           
 
             -- since first row with rowspan is handled differently, just
 
             -- since first row with rowspan is handled differently, just
 
             -- do it separately
 
             -- do it separately
Line 211: Line 211:  
                             :wikitext("Unknown")
 
                             :wikitext("Unknown")
 
                     end
 
                     end
                     if values[1]["Enemy Air Power"] ~= "" and values[1]["Enemy Air Power"] ~= "0" and values[1]["Enemy Air Power"] ~= "?" then
+
                     if values[1]["Enemy Air Power"] ~= "" and values[1]["Enemy Air Power"] ~= "0" and values[1]["Enemy Air Power"] ~= "?" and values[1]["Enemy Air Power"] ~= nil then
 
                         td
 
                         td
 +
                            :wikitext("AP:")
 +
                            :wikitext(math.ceil(2/3 * values[1]["Enemy Air Power"]))
 +
                            :wikitext("<br>")
 
                             :wikitext("AS:")
 
                             :wikitext("AS:")
 
                             :wikitext(math.ceil(1.5 * values[1]["Enemy Air Power"]))
 
                             :wikitext(math.ceil(1.5 * values[1]["Enemy Air Power"]))
Line 280: Line 283:  
                         if values[i]["Enemy Air Power"] ~= "" and values[i]["Enemy Air Power"] ~= "0" and values[i]["Enemy Air Power"] ~= "?" then
 
                         if values[i]["Enemy Air Power"] ~= "" and values[i]["Enemy Air Power"] ~= "0" and values[i]["Enemy Air Power"] ~= "?" then
 
                             td
 
                             td
 +
                            :wikitext("AP:")
 +
                            :wikitext(math.ceil(2/3 * values[i]["Enemy Air Power"]))
 +
                            :wikitext("<br>")
 
                                 :wikitext("AS:")
 
                                 :wikitext("AS:")
 
                                 :wikitext(math.ceil(1.5 * values[i]["Enemy Air Power"]))
 
                                 :wikitext(math.ceil(1.5 * values[i]["Enemy Air Power"]))
Line 288: Line 294:  
                         row:node(td)
 
                         row:node(td)
 
                     end
 
                     end
+
 
 
                     encounterTable:node(row)
 
                     encounterTable:node(row)
 
                 end
 
                 end
Line 296: Line 302:  
     return tostring(button) .. "\n" .. tostring(encounterTable)
 
     return tostring(button) .. "\n" .. tostring(encounterTable)
 
end
 
end
+
 
 
function splitAndCapitalize(s, split, join)
 
function splitAndCapitalize(s, split, join)
 
     split = split or "_"
 
     split = split or "_"
Line 307: Line 313:  
     return table.concat(result, join)
 
     return table.concat(result, join)
 
end
 
end
+
 
 
-- 1.1. new type pattern parameter: <node>-<pattern number>_<parameter name>
 
-- 1.1. new type pattern parameter: <node>-<pattern number>_<parameter name>
 
-- 1.2. old type pattern parameter: <node letter><pattern number>_<parameter name>
 
-- 1.2. old type pattern parameter: <node letter><pattern number>_<parameter name>
Line 327: Line 333:  
     return { map = true, name = param }
 
     return { map = true, name = param }
 
end
 
end
+
 
 
function parsePattern(param)
 
function parsePattern(param)
 
     local node, number = param:match('^(%w+)-(%d)$')
 
     local node, number = param:match('^(%w+)-(%d)$')
Line 335: Line 341:  
     return node and { node = node, number = tonumber(number) }
 
     return node and { node = node, number = tonumber(number) }
 
end
 
end
+
 
 
function markNodes(mapEncounterTable, list, name)
 
function markNodes(mapEncounterTable, list, name)
 
     if list then
 
     if list then
Line 341: Line 347:  
         for _, pattern in ipairs(patterns) do
 
         for _, pattern in ipairs(patterns) do
 
             pattern = parsePattern(pattern)
 
             pattern = parsePattern(pattern)
             if pattern and mapEncounterTable[pattern.node][pattern.number] then
+
             if pattern and mapEncounterTable[pattern.node] and mapEncounterTable[pattern.node][pattern.number] then
 
                 mapEncounterTable[pattern.node][pattern.number][name] = true
 
                 mapEncounterTable[pattern.node][pattern.number][name] = true
 
             end
 
             end
Line 347: Line 353:  
     end
 
     end
 
end
 
end
+
 
 
function debugPrint(x, i)
 
function debugPrint(x, i)
 
     i = i or 0
 
     i = i or 0
Line 364: Line 370:  
     end
 
     end
 
end
 
end
+
 
 
function p.encounterTemplate(frame)
 
function p.encounterTemplate(frame)
+
 
     local bossNode = frame.args.boss_node
+
     local bossNode
 
     local usedParams = {}
 
     local usedParams = {}
 
     local mapEncounterTable = {}
 
     local mapEncounterTable = {}
+
 
 
     for param, value in pairs(frame.args) do
 
     for param, value in pairs(frame.args) do
 
         if type(param) == "string" then
 
         if type(param) == "string" then
Line 382: Line 388:  
                 end
 
                 end
 
                 if not mapEncounterTable[param.node][param.pattern] then
 
                 if not mapEncounterTable[param.node][param.pattern] then
                     mapEncounterTable[param.node][param.pattern] = {
+
                     mapEncounterTable[param.node][param.pattern] = {}
                        ["Xp"] = "",
  −
                        ["Lv"] = "",
  −
                        ["Node Info"] = "",
  −
                        ["Form"] = "",
  −
                        ["Enemy Air Power"] = "",
  −
                    }
   
                 end
 
                 end
 
                 mapEncounterTable[param.node][param.pattern][param.title] = value
 
                 mapEncounterTable[param.node][param.pattern][param.title] = value
 
                 usedParams[param.title] = true
 
                 usedParams[param.title] = true
 
             elseif param.label then
 
             elseif param.label then
 +
                if not mapEncounterTable[param.node] then
 +
                    mapEncounterTable[param.node] = {}
 +
                end
 
                 mapEncounterTable[param.node].label = value
 
                 mapEncounterTable[param.node].label = value
 
             end
 
             end
 
         end
 
         end
 
     end
 
     end
+
 
 
     markNodes(mapEncounterTable, frame.args.final_form, "isFinalForm")
 
     markNodes(mapEncounterTable, frame.args.final_form, "isFinalForm")
 
     markNodes(mapEncounterTable, frame.args.post_final_form, "isPostFinalForm")
 
     markNodes(mapEncounterTable, frame.args.post_final_form, "isPostFinalForm")
 
     markNodes(mapEncounterTable, frame.args.second_phase, "isSecondPhase")
 
     markNodes(mapEncounterTable, frame.args.second_phase, "isSecondPhase")
+
 
 
     if frame.args.map_xp then
 
     if frame.args.map_xp then
 
         mapEncounterTable.map_xp = frame.args.map_xp
 
         mapEncounterTable.map_xp = frame.args.map_xp
 
         usedParams["Xp"] = true
 
         usedParams["Xp"] = true
 
     end
 
     end
+
 
 
     debugPrint(mapEncounterTable)
 
     debugPrint(mapEncounterTable)
 
     debugPrint(usedParams)
 
     debugPrint(usedParams)
 
     debugPrint(bossNode)
 
     debugPrint(bossNode)
+
 
     return p.renderEncounterTable(mapEncounterTable, usedParams, bossNode, true)
+
     return p.renderEncounterTable(mapEncounterTable, usedParams, bossNode or frame.args.boss_node, true)
+
 
 
end
 
end
+
 
 
function p.replaceWordWithWikicode(str)
 
function p.replaceWordWithWikicode(str)
 
     local nodeInfoImageTable = {
 
     local nodeInfoImageTable = {
Line 420: Line 423:  
         ["ammo"] = '[[File:Ammunition.png|Ammo|25px]]',
 
         ["ammo"] = '[[File:Ammunition.png|Ammo|25px]]',
 
         ["steel"] = '[[File:Steel.png|Steel|25px]]',
 
         ["steel"] = '[[File:Steel.png|Steel|25px]]',
         ["bauxite"] = '[[File:Bauxite.png|Bauxite|25px]]'
+
         ["bauxite"] = '[[File:Bauxite.png|Bauxite|25px]]',
 +
        ["daihatsu"] = '[[File:LandingCraft.png|Landing Craft|30px]]',
 +
        ["anchor"] = '[[File:Transport-drop-off.png|Transport drop-off|40px]]',
 +
        ["instantconstruction"] = '[[File:Instant_construction.jpg|Instant Construction|50px]]',
 +
        ["instantrepair"] = '[[File:Instant_repair.jpg|Instant Repair|50px]]',
 +
        ["devmat"] = '[[File:Development_material.jpg|Development Material|50px]]',
 +
        ["smallfurniture"] = '[[File:Furniture box small.png|Small Furniture Box|50px]]',
 +
        ["mediumfurniture"] = '[[File:Furniture_box_medium.png|Medium Furniture Box|50px]]',
 +
        ["largefurniture"] = '[[File:Furniture_box_large.jpg|Large Furniture Box|50px]]'
 
     }
 
     }
 
     local formTable = {
 
     local formTable = {
         ["line_ahead"] = "[[file:LineAhead.jpg|Formation 1: Line Ahead|40px|center]]",
+
         ["line_ahead"] = "[[file:LineAhead.png|Formation 1: Line Ahead|40px|center]]",
         ["double_line"] = "[[file:DoubleLine.jpg|Formation 2: Double Line|40px|center]]",
+
         ["double_line"] = "[[file:DoubleLine.png|Formation 2: Double Line|40px|center]]",
         ["diamond"] = "[[file:Diamond.jpg|Formation 3: Diamond|40px|center]]",
+
         ["diamond"] = "[[file:Diamond.png|Formation 3: Diamond|40px|center]]",
         ["echelon"] = "[[file:Echelon.jpg|Formation 4: Echelon|40px|center]]",
+
         ["echelon"] = "[[file:Echelon.png|Formation 4: Echelon|40px|center]]",
         ["line_abreast"] = "[[file:LineAbreast.jpg|Formation 5: Line Abreast|40px|center]]",
+
         ["line_abreast"] = "[[file:LineAbreast.png|Formation 5: Line Abreast|40px|center]]",
 +
        ["vanguard"] = "[[file:Vanguard.png|Formation 6: Vanguard|40px|center]]",
 
         ["none"] = "None<br>Displayed",
 
         ["none"] = "None<br>Displayed",
 
         ["cruising_form_1"] = "[[file:Formation_1.png|Cruising Formation 1: Anti-sub|50px|center|link=Combined_Fleet]]",
 
         ["cruising_form_1"] = "[[file:Formation_1.png|Cruising Formation 1: Anti-sub|50px|center|link=Combined_Fleet]]",
Line 454: Line 466:  
         ["dd_ni%-class_late_model[%s$]"] = '[[File:Seikan578Banner.png|2|160px|Destroyer Ni-Class Late Model|link=Destroyer Ni-Class]]',
 
         ["dd_ni%-class_late_model[%s$]"] = '[[File:Seikan578Banner.png|2|160px|Destroyer Ni-Class Late Model|link=Destroyer Ni-Class]]',
 
         ["dd_ni%-class_late_model_elite[%s$]"] = '[[File:Seikan624Banner.png|2|160px|Destroyer Ni-Class Late Model elite|link=Destroyer Ni-Class]]',
 
         ["dd_ni%-class_late_model_elite[%s$]"] = '[[File:Seikan624Banner.png|2|160px|Destroyer Ni-Class Late Model elite|link=Destroyer Ni-Class]]',
 +
        ["dd_ni%-class_kai[%s$]"] = '[[File:Seikan1858Banner.png|2|160px|Destroyer Ni-Class Kai|link=Destroyer Ni-Class]]',
 +
        ["dd_ni%-class_kai_late_model[%s$]"] = '[[File:Seikan1859Banner.png|2|160px|Destroyer Ni-Class Kai Late Model|link=Destroyer Ni-Class]]',
 +
        ["dd_ni%-class_kai_late_model_elite[%s$]"] = '[[File:Seikan1860Banner.png|2|160px|Destroyer Ni-Class Kai Late Model elite|link=Destroyer Ni-Class]]',
 +
        ["dd_ni%-class_kai_late_model_flaghip[%s$]"] = '[[File:Seikan1861Banner.png|2|160px|Destroyer Ni-Class Kai Late Model flagship|link=Destroyer Ni-Class]]',
 
         ["dd_na%-class[%s$]"] = '[[File:Seikan1739Banner.png|2|160px|Destroyer Na-Class|link=Destroyer Na-Class]]',
 
         ["dd_na%-class[%s$]"] = '[[File:Seikan1739Banner.png|2|160px|Destroyer Na-Class|link=Destroyer Na-Class]]',
 
         ["dd_na%-class_elite[%s$]"] = '[[File:Seikan1740Banner.png|2|160px|Destroyer Na-Class elite|link=Destroyer Na-Class]]',
 
         ["dd_na%-class_elite[%s$]"] = '[[File:Seikan1740Banner.png|2|160px|Destroyer Na-Class elite|link=Destroyer Na-Class]]',
Line 470: Line 486:  
         ["cl_tsu%-class[%s$]"] = '[[File:Seikan591Banner.png|2|160px|Light Cruiser Tsu-Class|link=Light Cruiser Tsu-Class]]',
 
         ["cl_tsu%-class[%s$]"] = '[[File:Seikan591Banner.png|2|160px|Light Cruiser Tsu-Class|link=Light Cruiser Tsu-Class]]',
 
         ["cl_tsu%-class_elite[%s$]"] = '[[File:Seikan592Banner.png|2|160px|Light Cruiser Tsu-Class elite|link=Light Cruiser Tsu-Class]]',
 
         ["cl_tsu%-class_elite[%s$]"] = '[[File:Seikan592Banner.png|2|160px|Light Cruiser Tsu-Class elite|link=Light Cruiser Tsu-Class]]',
 +
        ["cl_tsu%-class_flagship[%s$]"] = '[[File:Seikan1862Banner.png|2|160px|Light Cruiser Tsu-Class flagship|link=Light Cruiser Tsu-Class]]',
 
         ["clt_chi%-class[%s$]"] = '[[File:Seikan508Banner.png|2|160px|Torpedo Cruiser Chi-Class|link=Torpedo Cruiser Chi-Class]]',
 
         ["clt_chi%-class[%s$]"] = '[[File:Seikan508Banner.png|2|160px|Torpedo Cruiser Chi-Class|link=Torpedo Cruiser Chi-Class]]',
 
         ["clt_chi%-class_elite[%s$]"] = '[[File:Seikan521Banner.png|2|160px|Torpedo Cruiser Chi-Class elite|link=Torpedo Cruiser Chi-Class]]',
 
         ["clt_chi%-class_elite[%s$]"] = '[[File:Seikan521Banner.png|2|160px|Torpedo Cruiser Chi-Class elite|link=Torpedo Cruiser Chi-Class]]',
Line 525: Line 542:  
         ["battleship_princess[%s$]"] = '[[File:Seikan557Banner.png|2|160px|Battleship Princess|link=Battleship Princess]]',
 
         ["battleship_princess[%s$]"] = '[[File:Seikan557Banner.png|2|160px|Battleship Princess|link=Battleship Princess]]',
 
         ["harbor_princess[%s$]"] = '[[File:Seikan573Banner.png|2|160px|Harbor Princess|link=Harbor Princess]]',
 
         ["harbor_princess[%s$]"] = '[[File:Seikan573Banner.png|2|160px|Harbor Princess|link=Harbor Princess]]',
         ["harbor_princess_4%-5_final_form[%s$]"] = '[[File:Seikan613Banner.png|2|160px|Harbor Princess Final Form|link=Harbor Princess]]',
+
         ["harbor_princess_damaged[%s$]"] = '[[File:Seikan613Banner.png|2|160px|Harbor Princess Final Form|link=Harbor Princess]]',
 
         ["isolated_island_demon[%s$]"] = '[[File:Seikan574Banner.png|2|160px|Isolated Island Demon|link=Isolated Island Demon]]',
 
         ["isolated_island_demon[%s$]"] = '[[File:Seikan574Banner.png|2|160px|Isolated Island Demon|link=Isolated Island Demon]]',
 
         ["isolated_island_princess[%s$]"] = '[[File:Seikan668Banner.png|2|160px|Isolated Island Princess|link=Isolated Island Princess]]',
 
         ["isolated_island_princess[%s$]"] = '[[File:Seikan668Banner.png|2|160px|Isolated Island Princess|link=Isolated Island Princess]]',
Line 578: Line 595:  
         ["new_submarine_princess_b[%s$]"] = '[[File:Seikan1737Banner.png|2|160px|New Submarine Princess Flagship (B)|link=New Submarine Princess]]',
 
         ["new_submarine_princess_b[%s$]"] = '[[File:Seikan1737Banner.png|2|160px|New Submarine Princess Flagship (B)|link=New Submarine Princess]]',
 
         ["new_submarine_princess_c[%s$]"] = '[[File:Seikan1738Banner.png|2|160px|New Submarine Princess Flagship (C)|link=New Submarine Princess]]',
 
         ["new_submarine_princess_c[%s$]"] = '[[File:Seikan1738Banner.png|2|160px|New Submarine Princess Flagship (C)|link=New Submarine Princess]]',
 +
        ["new_submarine_princess_d[%s$]"] = '[[File:Seikan1736Banner.png|2|160px|New Submarine Princess Flagship (D)|link=New Submarine Princess]]',
 
         ["french_battleship_hime[%s$]"] = '[[File:Seikan1745Banner.png|2|160px|French Battleship Princess|link=French Battleship Princess]]',
 
         ["french_battleship_hime[%s$]"] = '[[File:Seikan1745Banner.png|2|160px|French Battleship Princess|link=French Battleship Princess]]',
 
         ["french_battleship_hime_damaged[%s$]"] = '[[File:Seikan1748Banner.png|2|160px|French Battleship Princess - Damaged|link=French Battleship Princess]]',
 
         ["french_battleship_hime_damaged[%s$]"] = '[[File:Seikan1748Banner.png|2|160px|French Battleship Princess - Damaged|link=French Battleship Princess]]',
Line 587: Line 605:  
         ["night_strait_princesses[%s$]"] = '[[File:Seikan1767Banner.png|2|160px|Night Strait Princesses|link=Night Strait Princesses]]',
 
         ["night_strait_princesses[%s$]"] = '[[File:Seikan1767Banner.png|2|160px|Night Strait Princesses|link=Night Strait Princesses]]',
 
         ["night_strait_princesses_damaged[%s$]"] = '[[File:Seikan1770Banner.png|2|160px|Night Strait Princesses - Damaged|link=Night Strait Princesses]]',
 
         ["night_strait_princesses_damaged[%s$]"] = '[[File:Seikan1770Banner.png|2|160px|Night Strait Princesses - Damaged|link=Night Strait Princesses]]',
         ["entombed_AA_guardian_princess[%s$]"] = '[[File:Seikan1773Banner.png|2|160px|Entombed Anti-Air Guardian Princess|link=Entombed Anti-Air Guardian Princess]]'
+
         ["entombed_aa_guardian_princess[%s$]"] = '[[File:Seikan1773Banner.png|2|160px|Entombed Anti-Air Guardian Princess|link=Entombed Anti-Air Guardian Princess]]',
 +
        ["escort_water_princess[%s$]"] = '[[File:Seikan1783Banner.png|2|160px|Escort Water Princess|link=Escort Water Princess]]',
 +
        ["escort_water_princess_damaged[%s$]"] = '[[File:Seikan1786Banner.png|2|160px|Escort Water Princess - Damaged|link=Escort Water Princess]]',
 +
        ["battleship_princess_kai[%s$]"] = '[[File:Seikan1790Banner.png|2|160px|Battleship Princess Kai|link=Battleship Princess Kai]]',
 +
        ["battleship_water_demon_kai[%s$]"] = '[[File:Seikan1793Banner.png|2|160px|Battleship Water Demon Kai|link=Battleship Water Demon Kai]]',
 +
        ["battleship_water_demon_kai_damaged[%s$]"] = '[[File:Seikan1796Banner.png|2|160px|Battleship Water Demon Kai - Damaged|link=Battleship Water Demon Kai]]',
 +
        ["abyssal_crane_princess[%s$]"] = '[[File:Seikan1799Banner.png|2|160px|Abyssal Crane Princess|link=Abyssal Crane Princess]]',
 +
        ["abyssal_crane_princess_damaged[%s$]"] = '[[File:Seikan1802Banner.png|2|160px|Abyssal Crane Princess - Damaged|link=Abyssal Crane Princess]]',
 +
        ["new_submarine_hime_vacation[%s$]"] = '[[File:Seikan1805Banner.png|2|160px|New Submarine Princess - Vacation Mode|link=New Submarine Princess - Vacation Mode]]',
 +
        ["supply_depot_hime_vacation[%s$]"] = '[[File:Seikan1809Banner.png|2|160px|Supply Depot Princess - Vacation Mode|link=Supply Depot Princess - Vacation Mode]]',
 +
        ["supply_depot_hime_vacation_damaged[%s$]"] = '[[File:Seikan1812Banner.png|2|160px|Supply Depot Princess - Vacation Mode - Damaged|link=Supply Depot Princess - Vacation Mode]]',
 +
        ["anchorage_water_demon_vacation_form1[%s$]"] = '[[File:Seikan1815Banner.png|2|160px|Anchorage Water Demon - Vacation Mode|link=Anchorage Water Demon - Vacation Mode]]',
 +
        ["anchorage_water_demon_vacation_form2[%s$]"] = '[[File:Seikan1818Banner.png|2|160px|Anchorage Water Demon - Vacation Mode|link=Anchorage Water Demon - Vacation Mode]]',
 +
        ["german_escort_hime[%s$]"] = '[[File:Seikan1821Banner.png|2|160px|German Escort Princess|link=German Escort Princess]]',
 +
        ["german_escort_hime_damaged[%s$]"] = '[[File:Seikan1824Banner.png|2|160px|German Escort Princess - Damaged|link=German Escort Princess]]',
 +
        ["dock_princess[%s$]"] = '[[File:Seikan1827Banner.png|2|160px|Dock Princess|link=Dock Princess]]',
 +
        ["dock_princess_damaged[%s$]"] = '[[File:Seikan1830Banner.png|2|160px|Dock Princess - Damaged|link=Dock Princess]]',
 +
        ["french_battleship_princess_vacation[%s$]"] = '[[File:Seikan1834Banner.png|2|160px|French Battleship Princess - Vacation Mode|link=French Battleship Princess - Vacation Mode]]',
 +
        ["french_battleship_princess_vacation_damaged[%s$]"] = '[[File:Seikan1837Banner.png|2|160px|French Battleship Princess - Vacation Mode - Damaged|link=French Battleship Princess - Vacation Mode]]',
 +
        ["european_water_princess[%s$]"] = '[[File:Seikan1840Banner.png|2|160px|European Water Princess|link=European Water Princess]]',
 +
        ["european_water_princess_damaged[%s$]"] = '[[File:Seikan1843Banner.png|2|160px|European Water Princess - Damaged|link=European Water Princess]]',
 +
        ["abyssal_nimbus_princess[%s$]"] = '[[File:Seikan1846Banner.png|2|160px|Abyssal Nimbus Princess|link=Abyssal Nimbus Princess]]',
 +
["abyssal_nimbus_princess_damaged[%s$]"] = '[[File:Seikan1849Banner.png|2|160px|Abyssal Nimbus Princess - Damaged|link=Abyssal Nimbus Princess]]',
 +
["abyssal_sun_princess[%s$]"] = '[[File:Seikan1852Banner.png|2|160px|Abyssal Sun Princess|link=Abyssal Sun Princess]]',
 +
        ["abyssal_sun_princess_damaged[%s$]"] = '[[File:Seikan1855Banner.png|2|160px|Abyssal Sun Princess - Damaged|link=Abyssal Sun Princess]]',
 +
        ["blue_heavy_cruiser_hime[%s$]"] = '[[File:Seikan1863Banner.png|2|160px|Heavy Cruiser Princess|link=Heavy Cruiser Princess]]',
 +
        ["blue_heavy_cruiser_hime_final_form[%s$]"] = '[[File:Seikan1864Banner.png|2|160px|Heavy Cruiser Princess|link=Heavy Cruiser Princess]]',
 +
        ["northern_little_sister[%s$]"] = '[[File:Seikan1865Banner.png|2|160px|Nothern Little Sister|link=Nothern Little Sister]]',
 +
        ["northern_little_sister_damaged[%s$]"] = '[[File:Seikan1868Banner.png|2|160px|Nothern Little Sister - Damaged|link=Nothern Little Sister]]',
 
     }
 
     }
+
 
 
     if str ~= nil then
 
     if str ~= nil then
+
 
 
         local originalString = str
 
         local originalString = str
 
         str = string.lower(str)
 
         str = string.lower(str)
+
 
 
         for vesselName,wikicode in pairs(enemyShipTable) do
 
         for vesselName,wikicode in pairs(enemyShipTable) do
 
             str = str:gsub(vesselName,wikicode)
 
             str = str:gsub(vesselName,wikicode)
Line 623: Line 669:  
     end
 
     end
 
end
 
end
+
 
function p.test()
+
function p.test1()
 
     return p.encounterTemplate({
 
     return p.encounterTemplate({
 
         args = {
 
         args = {
Line 648: Line 694:  
     })
 
     })
 
end
 
end
+
 
 
function p.test2()
 
function p.test2()
 
     return p.encounterTemplate({
 
     return p.encounterTemplate({
Line 670: Line 716:  
     })
 
     })
 
end
 
end
+
 
 
function p.test3()
 
function p.test3()
 
     return p.encounterTemplate({
 
     return p.encounterTemplate({
Line 693: Line 739:  
     })
 
     })
 
end
 
end
+
 
 +
function p.tests()
 +
    mw.log(p.test1())
 +
    mw.log(p.test2())
 +
    mw.log(p.test3())
 +
end
 +
 
 
return p
 
return p
444

edits