Module:ShipPage

local U = require("Module:Utils") local format = require("Module:Utils").format local Formatting = require("Module:Formatting") local BaseData = require("Module:BaseData") local Ship = require("Module:Ship") local ShipGraphicKai = require('Module:ShipGraphicKai') local ShipCardKai = require('Module:ShipCardKai') local ShipBattleCardKai = require('Module:ShipBattleCardKai') local ShipMetaKai = require("Module:ShipMetaKai") local ShipInfoKai = require("Module:ShipInfoKai") local ShipCategoriesKai = require("Module:ShipCategoriesKai")

-- can't use Ship:remodel_to_level normally for some reason local reversible_forms = {}

function ship_remodel_forms(ship_name, seasonal_forms, ship_suffix, j)   j = j or 1 ship_suffix = ship_suffix or "" local forms = { ship_name .. "/" .. ship_suffix } local success, ship_data = U.requireModule(ship_name) if not success then return forms end local form_data = ship_data[ship_suffix] if seasonal_forms then for suffix, data in pairs(ship_data) do           if (data._seasonal == true or data._season) and data._name and data._suffix then table.insert(seasonal_forms, data._name .. "/" .. data._suffix) end end end local i = 0 while form_data and form_data._remodel_to and not U.find(forms, form_data._remodel_to) and i < 10 and j <= 3 do       local ship_name_next, ship_suffix_next = Ship:process_ship_key(form_data._remodel_to) if ship_name_next ~= ship_name then return U.concat(forms, ship_remodel_forms(ship_name_next, seasonal_forms, ship_suffix_next, j + 1)) else table.insert(forms, form_data._remodel_to) form_data = ship_data[ship_suffix_next] if form_data._remodel_to_level then reversible_forms[form_data._name .. "/" .. (form_data._suffix or "")] = true end end i = i + 1 end return forms end

local ShipPage = {

_header = "${notice}${ship_meta}${clear}${ship_infoboxes}${ship_categories}",

_ship_infobox = [[

${title}
${infobox} ]],

_ship_infobox_titles = { "Basic", "Upgrade", "Second Upgrade", "Third Upgrade", "Fourth Upgrade", "Fifth Upgrade" },

_gallery_link = [=[*View ${ship_name} CG]=], _ship_type_link = [=[*List of ${ship_type}s]=], _wikipedia_link = [=[*Wikipedia entry on ${ship_type} ${ship_name}]=],

_sandbox_notice = [=[This is a testing ship page, it does not correspond to an actual ship. ]=],

_gallery_tabber = [[

]],

_gallery_normal = [[

]],

_gallery_damaged = [[

]],

_footer_sections = [=[

CG
${gallery}