| Line 4: |
Line 4: |
| | local ResourceIcons = require('Module:Data/Asset') | | local ResourceIcons = require('Module:Data/Asset') |
| | local StatIcons = require('Module:Data/Asset') | | local StatIcons = require('Module:Data/Asset') |
| | + | local DataCaps = require("Module:Data/Caps") |
| | local Formatting = require('Module:Formatting') | | local Formatting = require('Module:Formatting') |
| | local EquipmentLink = require('Module:EquipmentLink') | | local EquipmentLink = require('Module:EquipmentLink') |
| Line 23: |
Line 24: |
| | _kekkon_template = "After marriage: ${value}; Upper bound: ${max}", | | _kekkon_template = "After marriage: ${value}; Upper bound: ${max}", |
| | _remodel_level_stat_value_template = "At remodel level: ${value}", | | _remodel_level_stat_value_template = "At remodel level: ${value}", |
| | + | _simple_nick_template = " (''${nick}'')", |
| | _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]]", |
| Line 191: |
Line 193: |
| | local japanese_nick = self._ship:japanese_nick() | | local japanese_nick = self._ship:japanese_nick() |
| | local reading_nick = self._ship:reading_nick() | | local reading_nick = self._ship:reading_nick() |
| − | if reading_nick then | + | if japanese_nick and reading_nick then |
| | japanese_nick = tostring(Formatting:japanese_text(Formatting:format_stat(japanese_nick), Formatting:format_stat(reading_nick))) | | japanese_nick = tostring(Formatting:japanese_text(Formatting:format_stat(japanese_nick), Formatting:format_stat(reading_nick))) |
| | end | | end |
| − | self._vars.nick = format{self._nick_template, nick = nick, japanese_nick = japanese_nick} | + | if japanese_nick then |
| | + | self._vars.nick = format{self._nick_template, nick = nick, japanese_nick = japanese_nick} |
| | + | else |
| | + | self._vars.nick = format{self._simple_nick_template, nick = nick} |
| | + | end |
| | else | | else |
| | self._vars.nick = "" | | self._vars.nick = "" |
| Line 280: |
Line 286: |
| | evasion = Formatting:tooltip(evasion, format{self._remodel_level_stat_value_template, value = Formatting:format_stat(self._ship:evasion_leveled(remodel_level))}) | | evasion = Formatting:tooltip(evasion, format{self._remodel_level_stat_value_template, value = Formatting:format_stat(self._ship:evasion_leveled(remodel_level))}) |
| | end | | end |
| − | evasion_max = Formatting:tooltip(evasion_max, format{self._kekkon_max_template, value = Formatting:format_stat(self._ship:evasion_leveled(175))}) | + | evasion_max = Formatting:tooltip(evasion_max, format{self._kekkon_max_template, value = Formatting:format_stat(self._ship:evasion_leveled(DataCaps.ship_level))}) |
| | end | | end |
| | local result = Formatting:format_stat_with_max(evasion, evasion_max) | | local result = Formatting:format_stat_with_max(evasion, evasion_max) |
| Line 319: |
Line 325: |
| | asw = Formatting:tooltip(asw, format{self._remodel_level_stat_value_template, value = Formatting:format_stat(self._ship:asw_leveled(remodel_level))}) | | asw = Formatting:tooltip(asw, format{self._remodel_level_stat_value_template, value = Formatting:format_stat(self._ship:asw_leveled(remodel_level))}) |
| | end | | end |
| − | asw_max = Formatting:tooltip(asw_max, format{self._kekkon_max_template, value = Formatting:format_stat(self._ship:asw_leveled(175))}) | + | asw_max = Formatting:tooltip(asw_max, format{self._kekkon_max_template, value = Formatting:format_stat(self._ship:asw_leveled(DataCaps.ship_level))}) |
| | end | | end |
| | local result = Formatting:format_stat_with_max(asw, asw_max) | | local result = Formatting:format_stat_with_max(asw, asw_max) |
| Line 354: |
Line 360: |
| | los = Formatting:tooltip(los, format{self._remodel_level_stat_value_template, value = Formatting:format_stat(self._ship:los_leveled(remodel_level))}) | | los = Formatting:tooltip(los, format{self._remodel_level_stat_value_template, value = Formatting:format_stat(self._ship:los_leveled(remodel_level))}) |
| | end | | end |
| − | los_max = Formatting:tooltip(los_max, format{self._kekkon_max_template, value = Formatting:format_stat(self._ship:los_leveled(175))}) | + | los_max = Formatting:tooltip(los_max, format{self._kekkon_max_template, value = Formatting:format_stat(self._ship:los_leveled(DataCaps.ship_level))}) |
| | end | | end |
| | local result = Formatting:format_stat_with_max(los, los_max) | | local result = Formatting:format_stat_with_max(los, los_max) |
| Line 378: |
Line 384: |
| | local remodel_from = self._ship:remodel_from() | | local remodel_from = self._ship:remodel_from() |
| | if remodel_from then | | if remodel_from then |
| − | self._vars.build_remodel_info = Formatting:format_remodel_level_and_item_cost(self._ship:remodel_level(), self._ship:remodel_blueprint(), self._ship:remodel_catapult(), self._ship:remodel_report(), self._ship:remodel_gunmat(), self._ship:remodel_airmat()) | + | self._vars.build_remodel_info = Formatting:format_remodel_level_and_item_cost( |
| | + | self._ship:remodel_level(), |
| | + | self._ship:remodel_blueprint(), self._ship:remodel_catapult(), self._ship:remodel_report(), |
| | + | self._ship:remodel_gunmat(), self._ship:remodel_airmat(), self._ship:remodel_armament() |
| | + | ) |
| | self._vars.remodel_cost = format{self._remodel_cost_template, remodel_cost = Formatting:format_resources(self._ship:remodel_cost())} | | self._vars.remodel_cost = format{self._remodel_cost_template, remodel_cost = Formatting:format_resources(self._ship:remodel_cost())} |
| | else | | else |
| Line 523: |
Line 533: |
| | local labels = {} | | local labels = {} |
| | for k,v in pairs(icons) do | | for k,v in pairs(icons) do |
| − | icons[k] = Formatting:format_image{v, size = "20px"} | + | icons[k] = Formatting:format_image{v, size = "18px"} |
| | labels[k] = Formatting:format_stat_name(k) | | labels[k] = Formatting:format_stat_name(k) |
| | end | | end |