Line 2: |
Line 2: |
| 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')
| + | local Ship = require('Module:Ship') |
| | | |
| local templates = { | | local templates = { |
Line 51: |
Line 51: |
| { name = "Attack", note = "shared with [[Combat#Artillery_Spotting|day]]/[[Combat#Night_Special_Attack_Modifier|night]] special attacks, [[Expedition#Support_expedition|support expedition team]] arrival", id = 16 }, | | { name = "Attack", note = "shared with [[Combat#Artillery_Spotting|day]]/[[Combat#Night_Special_Attack_Modifier|night]] special attacks, [[Expedition#Support_expedition|support expedition team]] arrival", id = 16 }, |
| { name = "Night Battle", id = 18 }, | | { name = "Night Battle", id = 18 }, |
− | { name = "Night Attack", extra = true, id = 17 }, | + | { name = "Night Attack", extra = true, id = 17, note = "shared with air battle", note_types = { 14 } }, |
| { name = "MVP", id = 23 }, | | { name = "MVP", id = 23 }, |
| { name = "Minor Damage 1", id = 19 }, | | { name = "Minor Damage 1", id = 19 }, |
Line 179: |
Line 179: |
| return 0 | | return 0 |
| | | |
| + | end |
| + | |
| + | function checkNoteTypes(ship_name, types) |
| + | local ship = Ship(ship_name) |
| + | local shipKai = Ship(ship_name .. "/Kai") |
| + | return Utils.find(types, ship:type()) or Utils.find(types, shipKai:type()) |
| end | | end |
| | | |
Line 225: |
Line 231: |
| added = added + insertRow(result, "Mk.II Mod.2", args.explicit, line, added) | | added = added + insertRow(result, "Mk.II Mod.2", args.explicit, line, added) |
| | | |
− | if line.note and added > 0 then | + | if line.note and added > 0 and (not line.note_types or checkNoteTypes(args.explicit.ship, line.note_types)) then |
| table.insert(result, format{templates.note, note = line.note}) | | table.insert(result, format{templates.note, note = line.note}) |
| end | | end |