Line 5: |
Line 5: |
| local Formatting = require('Module:Formatting') | | local Formatting = require('Module:Formatting') |
| | | |
− | local U = require('Module:Utils') | + | local U = require('Module:Core') |
| local format = U.format | | local format = U.format |
| | | |
Line 52: |
Line 52: |
| _large_ship_construction_label = "[[Construction#Large_Ship_Construction_Recipe|LSC]]", | | _large_ship_construction_label = "[[Construction#Large_Ship_Construction_Recipe|LSC]]", |
| _buildable_label = "Construction", | | _buildable_label = "Construction", |
− | _drop_label = "[[Drop_List#Drop_List_Table|Drop]]", | + | _drop_label = "Drop", |
| _details_template = " (${details})", | | _details_template = " (${details})", |
| _event_reward_label = "[[Template:Event_Drop|Event Reward]]", | | _event_reward_label = "[[Template:Event_Drop|Event Reward]]", |
| _event_drop_label = "[[Template:Event_Drop|Event Drop]]", | | _event_drop_label = "[[Template:Event_Drop|Event Drop]]", |
− | _node_name_template = "${world}-${map}-${node}", | + | _node_name_template = "${world}-${map} ${node}", |
| _node_formation_template = "-${formation}", | | _node_formation_template = "-${formation}", |
− | _event_node_name_template = "${year} ${quarter} E-${map}-${node}", | + | _event_node_name_template = "${year} ${quarter} E-${map} ${node}", |
| _event_map_name_template = "${year} ${quarter} E-${map}", | | _event_map_name_template = "${year} ${quarter} E-${map}", |
| _date_template = "${year}/${month:2}/${day:2}", | | _date_template = "${year}/${month:2}/${day:2}", |
Line 131: |
Line 131: |
| return format{self._person_template, name = Formatting:format_external_link(person:link()), japanese_name = japanese_name} | | return format{self._person_template, name = Formatting:format_external_link(person:link()), japanese_name = japanese_name} |
| end | | end |
| + | |
| + | local custom_quest_links = { |
| + | ["5A05"] = "Partials/Updates/2018_April_23rd#5A05" |
| + | } |
| | | |
| function ShipMetaKai:availability() | | function ShipMetaKai:availability() |
Line 145: |
Line 149: |
| if buildable then | | if buildable then |
| table.insert(result, self._buildable_label .. format{self._details_template, details = table.concat(buildable, ", ")}) | | table.insert(result, self._buildable_label .. format{self._details_template, details = table.concat(buildable, ", ")}) |
| + | end |
| + | if availability and availability.quest then |
| + | table.insert(result, "Quest: " .. U.ijoin(U.imap(availability.quest, function(label) |
| + | return string.format("[[%s|%s]]", custom_quest_links[label] or string.format("Quests#%s", label), label) |
| + | end), ", ")) |
| end | | end |
| for _, method in ipairs(availability or {}) do | | for _, method in ipairs(availability or {}) do |
Line 169: |
Line 178: |
| end | | end |
| local details_len = #details | | local details_len = #details |
− | if details_len > 0 and self._detailed_availability then | + | if details_len > 0 then |
| details = format{self._details_template, details = table.concat(details, ", ")} | | details = format{self._details_template, details = table.concat(details, ", ")} |
| if details_len > self._max_drops_before_collapsible then | | if details_len > self._max_drops_before_collapsible then |
Line 276: |
Line 285: |
| end | | end |
| local dates = U.isort(U.keys(data)) | | local dates = U.isort(U.keys(data)) |
− | self._vars.implementation_date = #dates > 0 and U.ijoin(U.imap(dates, function (d) | + | self._vars.implementation_date = #dates == 0 and "??" or #dates == 1 and dates[1] or U.ijoin(U.imap(dates, function (d) |
| return string.format("%s (%s)", d, U.ijoin(data[d], ", ")) | | return string.format("%s (%s)", d, U.ijoin(data[d], ", ")) |
− | end), "<br>") or "??" | + | end), "<br>") |
| end | | end |
| | | |