打开/关闭菜单
1687
2.2万
6547
11.8万
舰R百科
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

舰R百科是靠无数志愿编辑者持续地建设更新完善的。编辑非常简单,无需代码知识,请勇于更新页面!
编辑入门 | 资助百科 | 留言讨论页 | 微博@舰R百科 | 百科编辑讨论Q群:366818861

模块:舰娘:修订间差异

舰R百科,玩家自由编辑的战舰少女R百科
Donnyjie留言 | 贡献
无编辑摘要
中二睡神留言 | 贡献
无编辑摘要
 
(未显示1个用户的8个中间版本)
第13行: 第13行:
if type(index) == 'number'  then
if type(index) == 'number'  then
if tonumber(index) < 1000
if tonumber(index) < 1000
then ret = ret .. tostring(index) .. ',' .. name .. '\n'
then ret = ret .. tostring(index) .. ',' .. name .. ',' .. ships[name].rarity .. '\n\n'
end
end
end
end
第21行: 第21行:


p['查找船名'] = function(frame)
p['查找船名'] = function(frame)
    return byIndex[tonumber(frame.args[1])]
if tonumber(frame.args[1]) ~= nil
    then return byIndex[tonumber(frame.args[1])]
    else return byIndex[frame.args[1]]
    end
end
end


p['统计'] = function(frame)
p['统计'] = function(frame)
     local normal = 0
     local normal = 0; local mod = 0; local skin = 0
    local mod = 0
     local total = 0
     local skin = 0
     for index, name in pairs(byIndex) do
     for index, name in pairs(byIndex) do
         if type(index) == 'string'  
         if type(index) == 'string' then
             then skin = skin + 1
             skin = skin + 1
        else
            local gold = ships[name] and ships[name].gold
             if index < 1000
             if gold then
                 then normal = normal + 1
                 local num = tonumber(gold)
            else if index < 2000 then mod = mod + 1 end
                if num and num > 0 then total = total + num end
             end
             end
         end
         elseif index < 1000 then normal = normal + 1
        elseif index < 2000 then mod = mod + 1 end
     end
     end
     if frame.args[1] == '普通' then return normal end
     local arg = frame.args[1]
     if frame.args[1] == '改造' then return mod end
    if arg == '普通'     then return normal end
     if frame.args[1] == '换装' then return skin end
     if arg == '改造'     then return mod end
     if arg == '换装'     then return skin end
    if arg == '换装总价' then return total end
end
end


第92行: 第97行:


local typeName = {
local typeName = {
     CV='航空母舰', CVL='轻型航空母舰', AV='装甲航母', BB='战列舰', BBV='航空战列舰', BC='战列巡洋舰',
     CV='航空母舰', CVL='轻型航母', AV='装甲航母', BB='战列舰', BBV='航空战列舰', BC='战列巡洋舰',
     CA='重巡洋舰', CAV='航空巡洋舰', CLT='重雷装巡洋舰', CL='轻巡洋舰', BM='浅水重炮舰', DD='驱逐舰', SC='重炮潜艇', SS='潜艇', AP='补给舰',
     CA='重巡洋舰', CAV='航空巡洋舰', CLT='重雷装巡洋舰', CL='轻巡洋舰', BM='浅水重炮舰', DD='驱逐舰', SC='重炮潜艇', SS='潜水艇', AP='补给舰',
     DDG='导弹驱逐舰', DDGAA='防空导弹驱逐舰', CBG='大型导弹巡洋舰', BBG='导弹战列舰', CF='飞行甲板巡洋舰', CG='导弹巡洋舰', CGAA='防空导弹巡洋舰',
     DDG='反舰导弹驱逐舰', DDGAA='防空导弹驱逐舰', CBG='导弹大型巡洋舰', BBG='导弹战列舰', CF='航空巡洋舰', CG='反舰导弹巡洋舰', CGAA='防空导弹巡洋舰', SSG='导弹潜艇',
}
}


第123行: 第128行:
     if green == nil then green = '#00D500' end
     if green == nil then green = '#00D500' end
     if red == nil then red = '#FF69B4' end
     if red == nil then red = '#FF69B4' end
     skill = skill:gsub('_G%[_', '<span style="color:' .. green .. ';">')
     skill = skill:gsub('_G%[_', '<span class="skillColorGreen">')
     skill = skill:gsub('_R%[_', '<span style="color:' .. red .. ';">')
     skill = skill:gsub('_R%[_', '<span class="skillColorRed">')
     skill = skill:gsub('_%]_', '</span>')
     skill = skill:gsub('_%]_', '</span>')
     return skill
     return skill
第144行: 第149行:
     local idx = ships[frame.args[1]].index
     local idx = ships[frame.args[1]].index
     return byIndex[idx % 1000]
     return byIndex[idx % 1000]
end
p['格式化价格'] = function(frame)
    local raw = frame.args[1] or ''
    if raw == '' or raw == '0' then return '-' end
    if tonumber(raw) then return raw .. '钻石' end
    return raw
end
end


return p
return p