| Line 5: |
Line 5: |
| | local ShipIterator = require("Module:ShipIterator") | | local ShipIterator = require("Module:ShipIterator") |
| | local ShipCapabilities = require("Module:ShipCapabilities") | | local ShipCapabilities = require("Module:ShipCapabilities") |
| | + | local ShipBattleCardKai = require("Module:ShipBattleCardKai") |
| | | | |
| | local args = nil | | local args = nil |
| Line 72: |
Line 73: |
| | day = date[3] < 10 and "0" .. date[3] or date[3], | | day = date[3] < 10 and "0" .. date[3] or date[3], |
| | } | | } |
| | + | end, |
| | + | |
| | + | -- overrides ShipData:card |
| | + | card = function(ship) |
| | + | return ShipBattleCardKai:Asset({ ship:name("/") }) |
| | end, | | end, |
| | | | |
| Line 130: |
Line 136: |
| | elseif prefix == "!" then | | elseif prefix == "!" then |
| | local ship_key = string.sub(arg, 2) | | local ship_key = string.sub(arg, 2) |
| − | if string.sub(ship_key, 1, 1) == "_" and ship then | + | local kv = mw.text.split(ship_key, "%s*~%s*") |
| − | local kv = mw.text.split(ship_key, "%s*~%s*")
| + | local k = kv[1] |
| − | local k = kv[1]
| + | local v = kv[2] |
| − | local v = kv[2]
| + | if k and v then |
| − | if k and v then
| + | if k == "_equipment" then |
| − | if k == "_equipment" then
| + | local equipment = {} |
| − | local equipment = {}
| + | for eq in string.gmatch(v, '([^,]+)') do |
| − | for eq in string.gmatch(v, '([^,]+)') do
| + | table.insert(equipment, { equipment = eq }) |
| − | table.insert(equipment, { equipment = eq })
| + | end |
| − | end
| + | ship._equipment = equipment |
| − | ship._equipment = equipment
| + | else |
| − | else | + | if v ~= "nil" then |
| | ship[k] = tonumber(v) | | ship[k] = tonumber(v) |
| | end | | end |
| Line 165: |
Line 171: |
| | ship._equipment = equipment | | ship._equipment = equipment |
| | else | | else |
| − | ship[k] = tonumber(v) | + | if v ~= "nil" then |
| | + | ship[k] = tonumber(v) |
| | + | end |
| | end | | end |
| | end | | end |
| Line 257: |
Line 265: |
| | "!_level ~ 99", | | "!_level ~ 99", |
| | "!_accuracy ~ 10", | | "!_accuracy ~ 10", |
| | + | "!_luck ~ nil", |
| | + | "!_morale ~ 25", |
| | + | "!FitData.cl0 ~ 56", |
| | + | "!FitData.cl1 ~ 807", |
| | + | "!FitData.cl2 ~ 137", |
| | "!!Destroyer Ro-Class", | | "!!Destroyer Ro-Class", |
| − | "?link", | + | "?card", |
| | "?level", | | "?level", |
| − | "??link", | + | "2x 41cmK, 1x T13K", |
| − | "?test", | + | "?format_morale", |
| − | "Some text..." | + | "?accuracy", |
| | + | "?luck", |
| | + | "??card", |
| | + | "?FitData.cl0", |
| | + | "?FitData.cl1", |
| | + | "?FitData.cl2", |
| | + | "?FitData.crit", |
| | + | "?FitData.hit", |
| | + | "?FitData.error", |
| | + | "?accuracy", |
| | + | "?FitData.fifference", |
| | }) | | }) |
| | ) | | ) |