- 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
Line 25:
Line 25:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Line 105:
Line 137:
− return Formatting:format_edit_link(self._ship_data_module, self._edit_link_text, self._ship_data_documentation) +
− return Formatting:format_ship_back(back), Formatting:extra_style_background_image(back and back > 7, back and back > 6) or "" +
− return Formatting:format_ship_rarity(self._ship:rarity()) +
− return Formatting:format_link(self._ship:link()) +
Line 124:
Line 156:
− return format{self._localized_name_template, localized_name = Formatting:format_stat(localized_name)} +
− return "" +
− return Formatting:tooltip(Formatting:format_stat(self._ship:japanese_name()), Formatting:format_stat(self._ship:reading())) +
Line 142:
Line 174:
− return format{self._nick_template, nick = nick, japanese_nick = japanese_nick} +
− return "" +
− return Formatting:format_stat_with_max(self._ship:id(), self._ship:true_id()) +
− return Formatting:format_stat(class and class:name()) +
Line 162:
Line 194:
− return ship_type +
− return ShipCardKai:card{ship = self._ship} +
Line 175:
Line 207:
− return hp +
− return Formatting:format_stat_with_max(self._ship:firepower(), self._ship:firepower_max()) +
− return Formatting:format_stat_with_max(self._ship:armor(), self._ship:armor_max()) +
− return Formatting:format_stat_with_max(self._ship:torpedo(), self._ship:torpedo_max()) +
Line 211:
Line 243:
− return result +
− return Formatting:format_stat_with_max(self._ship:aa(), self._ship:aa_max()) +
− return Formatting:format_stat(self._ship:total_space()) +
Line 243:
Line 275:
− return result +
− return Formatting:format_speed(self._ship:speed()) +
Line 271:
Line 303:
− return result +
− return Formatting:format_range(self._ship:range()) +
− return Formatting:format_stat_with_max(self._ship:luck(), self._ship:luck_max()) +
− return self._ship:remodel_level() and self._remodel_level or self._build_time +
Line 289:
Line 321:
− return Formatting:format_remodel_level_and_cost(remodel_level, self._ship:remodel_cost(), self._ship:remodel_blueprint()) +
Line 301:
Line 333:
− return Formatting:format_stat_with_max(Formatting:seconds_to_hms(self._ship:build_time() * 60), table.concat(buildable_methods, ", ")) +
− return build_time and Formatting:tooltip(self._unbuildable, Formatting:seconds_to_hms(build_time * 60)) or self._unbuildable +
Line 310:
Line 342:
− return Formatting:format_stat(self._ship:slots()) +
Line 349:
Line 381:
− return table.concat(slots) +
− return Formatting:format_stat(self._ship:fuel()), Formatting:format_stat(self._ship:ammo()) +
− return Formatting:format_modernization_bonuses(self._ship:modernization()) +
− return Formatting:format_resources(self._ship:scrap()) +
Line 373:
Line 405:
− self._icons = { +
Line 389:
Line 421:
− self._labels = {} +
− +
− self._icons[k] = Formatting:format_image{v} +
− self._labels[k] = Formatting:format_stat_name(k) +
+
+
+
+
− local vars = {} +
− local collapsible = self._args.collapsible+
− vars.table_class = collapsible and "mw-collapsible mw-collapsed" or ""+
− vars.table_id = collapsible and collapsible ~= "true" and ("mw-customcollapsible-" .. collapsible) or ""+
− vars.edit_link = self:edit_link()
− vars.rarity = self:rarity()
− vars.icons = self._icons
− vars.labels = self._labels
− vars.top_bg_color, vars.top_extra_style = self:bg_color()
− vars.name = self:name()
− vars.localized_name = self:localized_name()
− vars.id = self:id()
− vars.japanese_name = self:japanese_name()
− vars.nick = self:nick()
− vars.class = self:class()
− vars.type = self:type()
− vars.image = self:image()
− vars.hp = self:hp()
− vars.firepower = self:firepower()
− vars.armor = self:armor()
− vars.torpedo = self:torpedo()
− vars.evasion = self:evasion()
− vars.aa = self:aa()
− vars.aircraft = self:aircraft()
− vars.asw = self:asw()
− vars.speed = self:speed()
− vars.los = self:los()
− vars.range = self:range()
− vars.luck = self:luck()
− vars.fuel, vars.ammo = self:consumption()
− vars.modernization = self:modernization()
− vars.scrap = self:scrap()
− vars.build_remodel_header = self:build_remodel_header()
− vars.build_remodel_info = self:build_remodel_info()
− vars.slots = self:slots()
− vars.slot_details = self:slot_details()
−
Extensibility 2
_nick_template = " (''${nick} ${japanese_nick}'')",
_nick_template = " (''${nick} ${japanese_nick}'')",
_overridden_category_template = "[[Category:Pages that override data modules]]",
_overridden_category_template = "[[Category:Pages that override data modules]]",
_fields = {
"edit_link",
"rarity",
"bg_color",
"name",
"localized_name",
"id",
"japanese_name",
"nick",
"class",
"type",
"image",
"hp",
"firepower",
"armor",
"torpedo",
"evasion",
"aa",
"aircraft",
"asw",
"speed",
"los",
"range",
"luck",
"consumption",
"modernization",
"scrap",
"build_remodel_header",
"build_remodel_info",
"slots",
"slot_details",
},
_slot_template = [[|- align=center style="background-color: whitesmoke; line-height: 1.1;"
_slot_template = [[|- align=center style="background-color: whitesmoke; line-height: 1.1;"
| style="width: 36px; height: 36px; background-color: ${color};${extra_style}" | ${icon}
| style="width: 36px; height: 36px; background-color: ${color};${extra_style}" | ${icon}
function ShipInfoKai:edit_link()
function ShipInfoKai:edit_link()
self._vars.edit_link = Formatting:format_edit_link(self._ship_data_module, self._edit_link_text, self._ship_data_documentation)
end
end
function ShipInfoKai:bg_color()
function ShipInfoKai:bg_color()
local back = self._ship:back()
local back = self._ship:back()
self._vars.top_bg_color, self._vars.top_extra_style = Formatting:format_ship_back(back), Formatting:extra_style_background_image(back and back > 7, back and back > 6) or ""
end
end
function ShipInfoKai:rarity()
function ShipInfoKai:rarity()
self._vars.rarity = Formatting:format_ship_rarity(self._ship:rarity())
end
end
function ShipInfoKai:name()
function ShipInfoKai:name()
self._vars.name = Formatting:format_link(self._ship:link())
end
end
local localized_name = self._ship:localized_name()
local localized_name = self._ship:localized_name()
if localized_name then
if localized_name then
self._vars.localized_name = format{self._localized_name_template, localized_name = Formatting:format_stat(localized_name)}
else
else
self._vars.localized_name = ""
end
end
end
end
function ShipInfoKai:japanese_name()
function ShipInfoKai:japanese_name()
self._vars.japanese_name = Formatting:tooltip(Formatting:format_stat(self._ship:japanese_name()), Formatting:format_stat(self._ship:reading()))
end
end
japanese_nick = Formatting:tooltip(japanese_nick, reading_nick)
japanese_nick = Formatting:tooltip(japanese_nick, reading_nick)
end
end
self._vars.nick = format{self._nick_template, nick = nick, japanese_nick = japanese_nick}
end
end
self._vars.nick = ""
end
end
function ShipInfoKai:id()
function ShipInfoKai:id()
self._vars.id = Formatting:format_stat_with_max(self._ship:id(), self._ship:true_id())
end
end
function ShipInfoKai:class()
function ShipInfoKai:class()
local class = self._ship:class()
local class = self._ship:class()
self._vars.class = Formatting:format_stat(class and class:name())
end
end
ship_type = "(" .. ship_type .. ")"
ship_type = "(" .. ship_type .. ")"
end
end
self._vars.type = ship_type
end
end
function ShipInfoKai:image()
function ShipInfoKai:image()
self._vars.image = ShipCardKai:card{ship = self._ship}
end
end
return Formatting:tooltip(hp, format{self._kekkon_max_template, value = Formatting:format_stat(hp_max)})
return Formatting:tooltip(hp, format{self._kekkon_max_template, value = Formatting:format_stat(hp_max)})
end
end
self._vars.hp = hp
end
end
function ShipInfoKai:firepower()
function ShipInfoKai:firepower()
self._vars.firepower = Formatting:format_stat_with_max(self._ship:firepower(), self._ship:firepower_max())
end
end
function ShipInfoKai:armor()
function ShipInfoKai:armor()
self._vars.armor = Formatting:format_stat_with_max(self._ship:armor(), self._ship:armor_max())
end
end
function ShipInfoKai:torpedo()
function ShipInfoKai:torpedo()
self._vars.torpedo = Formatting:format_stat_with_max(self._ship:torpedo(), self._ship:torpedo_max())
end
end
result = result .. self._overridden_category_template
result = result .. self._overridden_category_template
end
end
self._vars.evasion = result
end
end
function ShipInfoKai:aa()
function ShipInfoKai:aa()
self._vars.aa = Formatting:format_stat_with_max(self._ship:aa(), self._ship:aa_max())
end
end
function ShipInfoKai:aircraft()
function ShipInfoKai:aircraft()
self._vars.aircraft = Formatting:format_stat(self._ship:total_space())
end
end
result = result .. self._overridden_category_template
result = result .. self._overridden_category_template
end
end
self._vars.asw = result
end
end
function ShipInfoKai:speed()
function ShipInfoKai:speed()
self._vars.speed = Formatting:format_speed(self._ship:speed())
end
end
result = result .. self._overridden_category_template
result = result .. self._overridden_category_template
end
end
self._vars.los = result
end
end
function ShipInfoKai:range()
function ShipInfoKai:range()
self._vars.range = Formatting:format_range(self._ship:range())
end
end
function ShipInfoKai:luck()
function ShipInfoKai:luck()
self._vars.luck = Formatting:format_stat_with_max(self._ship:luck(), self._ship:luck_max())
end
end
function ShipInfoKai:build_remodel_header()
function ShipInfoKai:build_remodel_header()
self._vars.build_remodel_header = self._ship:remodel_level() and self._remodel_level or self._build_time
end
end
local remodel_level = self._ship:remodel_level()
local remodel_level = self._ship:remodel_level()
if remodel_level then
if remodel_level then
self._vars.build_remodel_info = Formatting:format_remodel_level_and_cost(remodel_level, self._ship:remodel_cost(), self._ship:remodel_blueprint())
else
else
local buildable = self._ship:buildable()
local buildable = self._ship:buildable()
table.insert(buildable_methods, self._large_ship_construction)
table.insert(buildable_methods, self._large_ship_construction)
end
end
self._vars.build_remodel_info = Formatting:format_stat_with_max(Formatting:seconds_to_hms(self._ship:build_time() * 60), table.concat(buildable_methods, ", "))
else
else
local build_time = self._ship:build_time()
local build_time = self._ship:build_time()
self._vars.build_remodel_info = build_time and Formatting:tooltip(self._unbuildable, Formatting:seconds_to_hms(build_time * 60)) or self._unbuildable
end
end
end
end
function ShipInfoKai:slots()
function ShipInfoKai:slots()
self._vars.slots = Formatting:format_stat(self._ship:slots())
end
end
})
})
end
end
self._vars.slot_details = table.concat(slots)
end
end
function ShipInfoKai:consumption()
function ShipInfoKai:consumption()
self._vars.fuel, self._vars.ammo = Formatting:format_stat(self._ship:fuel()), Formatting:format_stat(self._ship:ammo())
end
end
function ShipInfoKai:modernization()
function ShipInfoKai:modernization()
self._vars.modernization = Formatting:format_modernization_bonuses(self._ship:modernization())
end
end
function ShipInfoKai:scrap()
function ShipInfoKai:scrap()
self._vars.scrap = Formatting:format_resources(self._ship:scrap())
end
end
function ShipInfoKai:create_infobox_prep()
function ShipInfoKai:create_infobox_prep()
local icons = {
hp = StatIcons.hp,
hp = StatIcons.hp,
firepower = StatIcons.firepower,
firepower = StatIcons.firepower,
ammo = ResourceIcons.ammo,
ammo = ResourceIcons.ammo,
}
}
local labels = {}
for k,v in pairs(self._icons) do
for k,v in pairs(icons) do
icons[k] = Formatting:format_image{v}
labels[k] = Formatting:format_stat_name(k)
end
end
self._vars = {icons = icons, labels = labels}
local collapsible = self._args.collapsible
self._vars.table_class = collapsible and "mw-collapsible mw-collapsed" or ""
self._vars.table_id = collapsible and collapsible ~= "true" and ("mw-customcollapsible-" .. collapsible) or ""
end
end
function ShipInfoKai:format_template()
function ShipInfoKai:format_template()
for _, field in ipairs(self._fields) do
self[field](self)
end
return format(self._template, self._vars)
return format(self._template, vars)
end
end