• 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
m
no edit summary
Line 29: Line 29:     
local function getMarriedHp(hp, maxHp)
 
local function getMarriedHp(hp, maxHp)
   return math.min(maxHp, hp + ({4, 4, 4, 5, 6, 7, 7, 8, 8, 9})[math.floor(hp / 10) + 1])
+
   return math.min(maxHp, hp + ({3, 4, 4, 5, 6, 7, 7, 8, 8, 9})[math.floor(hp / 10) + 1])
 
end
 
end
 
local function getScaledStat(baseStat, maxStat, level)
 
local function getScaledStat(baseStat, maxStat, level)
Line 119: Line 119:  
     ship.type == "Light Carrier" and type(ship.asw) == "table" and type(ship.asw[1]) == "number" and ship.asw[1] > 0
 
     ship.type == "Light Carrier" and type(ship.asw) == "table" and type(ship.asw[1]) == "number" and ship.asw[1] > 0
 
   local shipType =
 
   local shipType =
     isCVE and string.format('<span class="explain" title="CVE"></span>', ship.type) or
+
     isCVE and string.format('<span class="explain" title="CVE">%s[[Category:Escort Carriers]]</span>', ship.type) or
 
     ship.type
 
     ship.type
 
   local row2 = '<tr><th colspan="2">' .. JaName .. '</th><th colspan="2">' .. ship.name[3] .. "</th></tr>"
 
   local row2 = '<tr><th colspan="2">' .. JaName .. '</th><th colspan="2">' .. ship.name[3] .. "</th></tr>"
Line 134: Line 134:  
   local maxHp = ship["hp"][2]
 
   local maxHp = ship["hp"][2]
 
   local HPinfo
 
   local HPinfo
   if maxHp then
+
   if maxHp and maxHp ~= '??' then
 
     local marriedHp = getMarriedHp(hp, maxHp)
 
     local marriedHp = getMarriedHp(hp, maxHp)
 
     local maxModHp = math.min(hp + 2, maxHp)
 
     local maxModHp = math.min(hp + 2, maxHp)
Line 306: Line 306:  
       string.format(
 
       string.format(
 
         "%s (%s)",
 
         "%s (%s)",
         formatBuildtime(ship.buildtime[1]),
+
         type(ship.buildtime[1]) == "number" and formatBuildtime(ship.buildtime[1]) or "??",
 
         ship.buildtime[2] and ship.buildtime[3] and "Normal, LSC" or ship.buildtime[2] and "Normal" or
 
         ship.buildtime[2] and ship.buildtime[3] and "Normal, LSC" or ship.buildtime[2] and "Normal" or
           ship.buildtime[3] and "LSC" or
+
           ship.buildtime[3] and "LSC" or "Unbuildable"
          "Unbuildable"
   
       )
 
       )
 
   end
 
   end
Line 461: Line 460:     
local function renderCategories(ship)
 
local function renderCategories(ship)
   local categories = "[[Category:Ships]][[Category:" .. ship["class"] .. "]][[Category:" .. ship["type"] .. "s]]"
+
   local categories = "[[Category:Ships]]"
 +
  if notNil(ship["class"]) then
 +
  categories = categories .. "[[Category:" .. ship["class"] .. "]]"
 +
  end
 +
  if notNil(ship["type"]) then
 +
  categories = categories .. "[[Category:" .. ship["type"] .. "s]]"
 +
  end
 
   if ship["artist"] ~= "Unknown" and ship["artist"] ~= "" then
 
   if ship["artist"] ~= "Unknown" and ship["artist"] ~= "" then
 
     categories = categories .. "[[Category:" .. ship["artist"] .. "]]"
 
     categories = categories .. "[[Category:" .. ship["artist"] .. "]]"
Line 467: Line 472:  
   if ship["seiyuu"] ~= "Unknown" and ship["seiyuu"] ~= "" then
 
   if ship["seiyuu"] ~= "Unknown" and ship["seiyuu"] ~= "" then
 
     categories = categories .. "[[Category:" .. ship["seiyuu"] .. "]]"
 
     categories = categories .. "[[Category:" .. ship["seiyuu"] .. "]]"
  end
  −
  if ship.type == "Light Carrier" and type(ship.asw) == "table" and type(ship.asw[1]) == "number" and ship.asw[1] > 0 then
  −
categories = categories .. "[[Category:Escort Carriers]]"
   
   end
 
   end
 
   return categories
 
   return categories
Line 613: Line 615:  
   local ship = Ship(shipsById[(U.find(shipsByNo, ShipData[key] or key, "name") or {}).id] or key)
 
   local ship = Ship(shipsById[(U.find(shipsByNo, ShipData[key] or key, "name") or {}).id] or key)
 
   local data = {}
 
   local data = {}
   data.id = ship:id() or '???'
+
   data.id = ship:id() or "??"
 
   data.no = ship:true_id()
 
   data.no = ship:true_id()
 
   data.name = {ship:japanese_name() or "", ship:reading() or "", ship:name() or ""}
 
   data.name = {ship:japanese_name() or "", ship:reading() or "", ship:name() or ""}
 
   local class = ship:class()
 
   local class = ship:class()
   data.class = class and class:name() or "???"
+
   data.class = class and class:name() or "??"
 
   data.display_class = ship._display_class
 
   data.display_class = ship._display_class
 
   data.type = ship:formatted_type() or ""
 
   data.type = ship:formatted_type() or ""
Line 634: Line 636:  
   data.aircraft = {}
 
   data.aircraft = {}
 
   data.equip = {}
 
   data.equip = {}
   for _, v in ipairs(ship._equipment) do
+
   for _, v in ipairs(ship._equipment or {}) do
 
     table.insert(data.equip, (v.equipment == nil and '?' or v.equipment or '') .. (v.stars and string.format(' ★+%d', v.stars) or ''))
 
     table.insert(data.equip, (v.equipment == nil and '?' or v.equipment or '') .. (v.stars and string.format(' ★+%d', v.stars) or ''))
 
     table.insert(data.aircraft, v.size or "")
 
     table.insert(data.aircraft, v.size or "")
7,212

edits

Navigation menu