Line 2: |
Line 2: |
| local shipdb = require("Module:ShipDatabase") | | local shipdb = require("Module:ShipDatabase") |
| shipmodule.data = shipdb.KanmusuData | | shipmodule.data = shipdb.KanmusuData |
| + | |
| + | function shipmodule.getIDNum(frame) |
| + | local shipNum = frame.args[1] |
| + | -- Getting ship ID, number, & info |
| + | if (tonumber(string.sub(shipNum, 1, 3)) == nil and string.sub(shipNum, 1, 4) ~= "Mist" ) then -- if given a name instead of ID, this searches the db for the ship's corresponding ID |
| + | shipNum = shipdb.findID(frame) |
| + | end |
| + | return shipNum |
| + | end |
| | | |
| function shipmodule.KanmusuInfo(frame) -- Kanmusu Info Template | | function shipmodule.KanmusuInfo(frame) -- Kanmusu Info Template |
Line 165: |
Line 174: |
| local StatTable = '<table>' .. row1 .. row2 .. row3 .. row4 .. row5 .. row6 .. row7 .. row8 .. row9 .. row10 .. '</table>' | | local StatTable = '<table>' .. row1 .. row2 .. row3 .. row4 .. row5 .. row6 .. row7 .. row8 .. row9 .. row10 .. '</table>' |
| return StatTable | | return StatTable |
− | end
| |
− |
| |
− | function shipmodule.dispNumRows(frame)
| |
− | local shipNum = frame.args[1]
| |
− | -- Getting ship ID, number, & info
| |
− | if (tonumber(string.sub(shipNum, 1, 3)) == nil and string.sub(shipNum, 1, 4) ~= "Mist" ) then -- if given a name instead of ID, this searches the db for the ship's corresponding ID
| |
− | shipNum = shipdb.findID(frame)
| |
− | end
| |
− |
| |
− | -- ship ID for Musashi Kai 2
| |
− | if shipNum == "346" then
| |
− | return 5
| |
− | else
| |
− | return 4
| |
− | end
| |
| end | | end |
| | | |
Line 207: |
Line 201: |
| local numRows = 4 | | local numRows = 4 |
| -- ship ID for Musashi Kai 2 | | -- ship ID for Musashi Kai 2 |
− | if shipNum == 346 then | + | if shipNum == "346" then |
| numRows = 5 | | numRows = 5 |
| end | | end |