模块:舰娘:修订间差异
无编辑摘要 |
无编辑摘要 |
||
第5行: | 第5行: | ||
local p = { } | local p = { } | ||
p['属性'] = function(frame) | p['属性'] = function(frame) | ||
第36行: | 第21行: | ||
return ship.cap1 + ship.cap2 + ship.cap3 + ship.cap4 | return ship.cap1 + ship.cap2 + ship.cap3 + ship.cap4 | ||
end | end | ||
local typeName = { | |||
CV='航空母舰', CVL='轻型航空母舰', AV='装甲航母', BB='战列舰', BBV='航空战列舰', BC='战列巡洋舰', | |||
CA='重巡洋舰', CLT='重雷装巡洋舰', CL='轻巡洋舰', BM='浅水重炮舰', DD='驱逐舰', SC='重炮潜艇', SS='潜艇', AP='补给舰' | |||
} | |||
p['舰种代码'] = function(frame) | p['舰种代码'] = function(frame) | ||
local ship = ships[frame.args[1]] | local ship = ships[frame.args[1]] | ||
if ship == nil then return '' end | if ship == nil then return '' end | ||
return | return ship.type:lower() | ||
end | end | ||
第46行: | 第36行: | ||
local ship = ships[frame.args[1]] | local ship = ships[frame.args[1]] | ||
if ship == nil then return '' end | if ship == nil then return '' end | ||
return ship.type | return typeName[ship.type] | ||
end | end | ||
2016年10月23日 (日) 02:18的版本
{{#invoke:舰娘|统计|普通}}、{{#invoke:舰娘|统计|改造}}、{{#invoke:舰娘|统计|换装}}
Lua错误 在模块:特殊数据的第3行:attempt to index local 'data' (a boolean value)、Lua错误 在模块:特殊数据的第3行:attempt to index local 'data' (a boolean value)、Lua错误 在模块:特殊数据的第3行:attempt to index local 'data' (a boolean value)
{{#invoke:舰娘|查找船名|1001}}
Lua错误 在模块:特殊数据的第3行:attempt to index local 'data' (a boolean value)
{{#invoke:舰娘|属性|atk|胡德}}
Lua错误 在模块:特殊数据的第3行:attempt to index local 'data' (a boolean value)
{{#invoke:舰娘|评分|atkMax|密苏里|BB}}
Lua错误 在模块:特殊数据的第3行:attempt to index local 'data' (a boolean value)
{{#invoke:舰娘|评分|atkMax|自定义|BB|90}}
Lua错误 在模块:特殊数据的第3行:attempt to index local 'data' (a boolean value)
{{#invoke:舰娘|搭载|列克星敦}}
Lua错误 在模块:特殊数据的第3行:attempt to index local 'data' (a boolean value)
{{#invoke:舰娘|舰种代码|胡德}}
Lua错误 在模块:特殊数据的第3行:attempt to index local 'data' (a boolean value)
{{#invoke:舰娘|舰种名称|胡德}}
Lua错误 在模块:特殊数据的第3行:attempt to index local 'data' (a boolean value)
{{#invoke:舰娘|改造编号|胡德}}
Lua错误 在模块:特殊数据的第3行:attempt to index local 'data' (a boolean value)
{{#invoke:舰娘|改造编号|格拉摩根}}
Lua错误 在模块:特殊数据的第3行:attempt to index local 'data' (a boolean value)
{{#invoke:舰娘|技能描述|胡德·改}}
Lua错误 在模块:特殊数据的第3行:attempt to index local 'data' (a boolean value)
{{#invoke:舰娘|技能描述2|胡德·改}}
Lua错误 在模块:特殊数据的第3行:attempt to index local 'data' (a boolean value)
local data = mw.loadData("模块:特殊数据")
local ships = data.ships
local skills = data.skills
local byIndex = data.byIndex
local p = { }
p['属性'] = function(frame)
local ship = ships[frame.args[2]]
local default = frame.args[3]
if default == nil then default = '' end
if ship == nil then return default end
local ret = ship[frame.args[1]]
if ret == nil then return default end
return ret
end
p['搭载'] = function(frame)
local ship = ships[frame.args[1]]
if ship == nil then return '' end
return ship.cap1 + ship.cap2 + ship.cap3 + ship.cap4
end
local typeName = {
CV='航空母舰', CVL='轻型航空母舰', AV='装甲航母', BB='战列舰', BBV='航空战列舰', BC='战列巡洋舰',
CA='重巡洋舰', CLT='重雷装巡洋舰', CL='轻巡洋舰', BM='浅水重炮舰', DD='驱逐舰', SC='重炮潜艇', SS='潜艇', AP='补给舰'
}
p['舰种代码'] = function(frame)
local ship = ships[frame.args[1]]
if ship == nil then return '' end
return ship.type:lower()
end
p['舰种名称'] = function(frame)
local ship = ships[frame.args[1]]
if ship == nil then return '' end
return typeName[ship.type]
end
p['改造编号'] = function(frame)
local ship = ships[frame.args[1]]
if ship == nil then return '' end
local ret = ship
if ship.index < 1000 then
ship = ships[byIndex[ship.index + 1000]]
if ship ~= nil then ret = ship end
end
return ret.index
end
p['技能描述'] = function(frame)
local ship = ships[frame.args[1]]
if ship == nil or ship.skill == nil then return '' end
return skills[ship.skill]
end
p['技能描述2'] = function(frame)
local ship = ships[frame.args[1]]
if ship == nil or ship.skill2 == nil then return '' end
return skills[ship.skill2]
end
return p