• 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
Support Air Battle lines
Line 1: Line 1:  
local format = require('Module:StringInterpolation').format
 
local format = require('Module:StringInterpolation').format
 
local getArgs = require('Module:GetArgs')
 
local getArgs = require('Module:GetArgs')
 +
local Ship = require('Module:Ship')
    
function format_category(name)
 
function format_category(name)
Line 43: Line 44:  
     { name = "Equipment 3", note = "shared with expedition selection, resource collection, instant repair and development" },
 
     { name = "Equipment 3", note = "shared with expedition selection, resource collection, instant repair and development" },
 
     { name = "Supply" },
 
     { name = "Supply" },
    { name = "Modernization", extra = true, note = "shared with remodeling line (modernization/remodeling lines are only present in [[KanColle Kai]])" },
   
     { name = "Docking Minor" },
 
     { name = "Docking Minor" },
 
     { name = "Docking Major" },
 
     { name = "Docking Major" },
Line 51: Line 51:  
     { name = "Starting A Sortie" },
 
     { name = "Starting A Sortie" },
 
     { name = "Battle Start" },
 
     { name = "Battle Start" },
 +
    { name = "Air Battle", extra = true },
 
     { name = "Attack", note = "shared with [[Combat#Artillery_Spotting|day]]/[[Combat#Night_Special_Attack_Modifier|night]] special attacks, [[Expedition#Support_expedition|support expedition team]] arrival" },
 
     { name = "Attack", note = "shared with [[Combat#Artillery_Spotting|day]]/[[Combat#Night_Special_Attack_Modifier|night]] special attacks, [[Expedition#Support_expedition|support expedition team]] arrival" },
 
     { name = "Night Battle" },
 
     { name = "Night Battle" },
Line 68: Line 69:  
function format_text(text, line)
 
function format_text(text, line)
 
     return text and line.spoiler and format{templates.spoiler, text = text} or text or ""
 
     return text and line.spoiler and format{templates.spoiler, text = text} or text or ""
 +
end
 +
 +
function isCarrier(base_ship_name, remodel)
 +
    local ship = Ship(base_ship_name .. "/" .. (remodel or ""))
 +
    return ship:type() == 11 or ship:type() == 16 or ship:type() == 18
 
end
 
end
   Line 79: Line 85:  
     local link = args[line.name .. remodel_string .. "/Link"]
 
     local link = args[line.name .. remodel_string .. "/Link"]
 
     local is_empty_pre_kai_line = not remodel and not ja and not en and not jaEn and (args[line.name .. "/Kai"] or args[line.name .. "/Kai/En"] or args[line.name .. "/Kai/Both"])
 
     local is_empty_pre_kai_line = not remodel and not ja and not en and not jaEn and (args[line.name .. "/Kai"] or args[line.name .. "/Kai/En"] or args[line.name .. "/Kai/Both"])
 +
 +
    if line.name == "Night Attack" then
 +
        line.extra = isCarrier(args.ship, remodel)
 +
    elseif line.name == "Air Battle" then
 +
        line.extra = not isCarrier(args.ship, remodel)
 +
    end
 +
 
     if (not remodel and not line.extra or jaEn or ja or en or note) and not is_empty_pre_kai_line then
 
     if (not remodel and not line.extra or jaEn or ja or en or note) and not is_empty_pre_kai_line then
 
         local line_name = count == 0 and (remodel and line.name .. " (" .. remodel .. ")" or line.name) or remodel or line.name
 
         local line_name = count == 0 and (remodel and line.name .. " (" .. remodel .. ")" or line.name) or remodel or line.name
cssedit, gkautomate
7,064

edits

Navigation menu