模块:敌舰2:修订间差异
来自舰R百科
更多操作
无编辑摘要 |
无编辑摘要 |
||
| (未显示同一用户的11个中间版本) | |||
| 第10行: | 第10行: | ||
speedType['航战'] = 1 | speedType['航战'] = 1 | ||
speedType['战巡'] = 1 | speedType['战巡'] = 1 | ||
speedType['导驱'] = 1 | |||
speedType['防驱'] = 1 | |||
speedType['导巡'] = 1 | |||
speedType['防巡'] = 1 | |||
speedType['导战'] = 1 | speedType['导战'] = 1 | ||
speedType['大巡'] = 1 | speedType['大巡'] = 1 | ||
speedType[' | speedType['旗舰'] = 1 | ||
speedType['要塞'] = 1 | speedType['要塞'] = 1 | ||
speedType['港口'] = 1 | speedType['港口'] = 1 | ||
| 第27行: | 第28行: | ||
speedType['驱逐'] = 2 | speedType['驱逐'] = 2 | ||
speedType['补给'] = 2 | speedType['补给'] = 2 | ||
speedType[' | speedType['导潜'] = 3 | ||
speedType['潜艇'] = 3 | speedType['潜艇'] = 3 | ||
speedType['炮潜'] = 3 | speedType['炮潜'] = 3 | ||
| 第38行: | 第39行: | ||
local function formatEnemyShip(ship) | local function formatEnemyShip(ship) | ||
local colorName = { 'black', 'green', 'blue', 'purple', ' | local colorName = { 'black', 'green', 'blue', 'purple', '#e77f00', 'red' } | ||
local ret = '[[' | local ret = '[[' | ||
| 第55行: | 第56行: | ||
local node = frame.args[1] | local node = frame.args[1] | ||
local label = frame.args[2] | local label = frame.args[2] | ||
if label == nil or label == '' then label = node:sub( | if label == nil or label == '' then label = node:sub(-1,-1) end | ||
local shipNum = frame.args[3] | local shipNum = frame.args[3] | ||
if shipNum == nil then shipNum = 6 end | if shipNum == nil then shipNum = 6 end | ||
| 第74行: | 第75行: | ||
m = m + 1 | m = m + 1 | ||
local ship = eShips[shipId] | local ship = eShips[shipId] | ||
ret = ret .. '||' .. formatEnemyShip(ship) | local bg = '' | ||
if ship.type == '潜艇' or ship.type == '炮潜' then bg = 'style="background-color:#fcf3cf;"|' end | |||
if ship.type == '雷巡' then bg = 'style="background-color:#edf5d5;"|' end | |||
if ship.type == '导战' or ship.type == '导巡' or ship.type == '导驱' then bg = 'style="background-color:#fadbd8;"|' end | |||
if ship.type == '大巡' or ship.type == '防巡' or ship.type == '防驱' then bg = 'style="background-color:#fae5d3 "|' end | |||
ret = ret .. '||' .. bg .. formatEnemyShip(ship) | |||
rec = rec + ship.rec | rec = rec + ship.rec | ||
air = air + ship.air | air = air + ship.air | ||
| 第91行: | 第97行: | ||
if speedCnt[2] ~= 0 then s2 = speed[2] / speedCnt[2] end | if speedCnt[2] ~= 0 then s2 = speed[2] / speedCnt[2] end | ||
local s = math.min(s1, s2) | local s = math.min(s1, s2) | ||
s = tonumber(string.format("%.1f", s)) | |||
if speedCnt[1] ~= 0 and speedCnt[2] ~= 0 then s = math.floor(s) end | |||
local bg2 = '' | |||
if speedCnt[1] == 0 and speedCnt[2] == 0 then | if speedCnt[1] == 0 and speedCnt[2] == 0 then | ||
s = speed[3] / speedCnt[3] | s = speed[3] / speedCnt[3] | ||
s = tonumber(string.format("%.1f", s)) | |||
rec = '(' .. lv .. ')' | rec = '(' .. lv .. ')' | ||
bg2 = 'style="background-color:#fcf3cf;"|' | |||
end | end | ||
ret = ret .. '||' .. rec .. '||' .. formatFloat(air) .. '||' .. | local air2 = air*1.5 | ||
local air3 = air*3 | |||
ret = ret .. '||' .. bg2 .. rec .. '||' .. formatFloat(air) .. '||' .. formatFloat(air2) .. '||'.. formatFloat(air3) .. '||' .. s .. '\n' | |||
end | end | ||
return '|rowspan=' .. n .. '|' .. label .. '|' .. ret | return '|rowspan=' .. n .. '|' .. label .. '|' .. ret | ||