打开主菜单

少前百科GFwiki β

更改

模块:Gun info

添加55字节2024年4月9日 (星期二)
无编辑摘要
local gtype = gundata.guntype
local speeds = {15,12,7,10,4,6}
local crits typeDefaults = { crit = {20,5,40,20,5,40}, max_rate = {120, 120, 120, 120, 1000, 60} }
local targets = {{0}, {4}, {1}, {2}, {6}, {5}}
root:newline():wikitext('== 战斗数据 =='):newline()
| || || || ||
|}]]):newline()
attrtable:wikitext[[{|! id="pow" | 伤害| id="pow-td" ||-! id="hit" | 命中| id="hit-td" ||-! id="dodge" | 回避| id="dodge-td" ||-! id="rate" | 射速| id="rate-td" ||-! id="armor" | 护甲| id="armor-td" ||-! id="growth" | 成长| id="growth-td" ||}]] attrtable:newline() local gtable ctable = attrtable:tag('table'):attr( local consts = { {'idcritpow', 'growing2暴伤')}, gtable:tag( {'trcrit'):tag(, 'th暴击'):attr}, {id = 'growthspeed', colspan = 5'移速'}:wikitext, {'max_rate', '成长射速上限'}, gtable:tag( {'trap'):tag(, 'td穿甲'):attr}, {id = 'grow-tdrec', colspan = 5'修复'} } local gaid1 constVals = {1 '150%', gundata.crit or typeDefaults.crit[gtype], 2 speeds[gtype], 3 gundata.max_rate or typeDefaults.max_rate[gtype], 5 15, 9 gundata.rec } local gaid2 for i = {1, 3, 4, 2, 8}6 do local gthr tr = gtablectable:tag('tr') for i = 1, 5 do local gth = gthrtr:tag('th'):attr('id', bonuses[gaid1consts[i][1]):wikitext(attrs[gaid2consts[i][2]) local td = tr:tag('td') if i == 2 or i == 4 and gundata.max_rate then local f td:attr{ ['data-attr'] = constVals[i], ['data-mod'] = mw.getCurrentFrame()moddata and moddata[consts[i][1]] or constVals[i] gth} end td:tagwikitext(constVals[i], i < 3 and 'span%'):addClass(or 'max-rate') if i == 4 then td:wikitext(f:expandTemplate{ title='popupPopup', args={ ['内容']=string.format( '射速上限:攻击间隔%d(攻击间隔%d帧/d帧(%s秒)',r2fs(constVals[4])) gundata }}, f:expandTemplate{title = 'Popup', args = { ['内容'] = string.max_rateformat('攻击间隔%d帧(%s秒)', r2fs(gundatamoddata and moddata.max_rateor constVals[4]))
}})
end
if i == 4 and moddata and moddata.max_rate then
local f = mw.getCurrentFrame()
gth:tag('span'):addClass('max-rate-mod'):wikitext(
f:expandTemplate{title='popup', args={['内容']=string.format(
'射速上限:%d(攻击间隔%d帧/%s秒)',
moddata.max_rate, r2fs(moddata.max_rate))
}
}) end
end
if gtype > 4 then local gtdr tr = gtablectable:tag('tr') for i = 1, 5 do gtdr tr:tag('tdth'):attr('id', bonuses[gaid1[i]] .. '-tdround'):wikitext('弹量') end attrtable tr:newlinetag('td'):wikitext(string.format([[attr{|!id="ap"|穿甲!!id="round"|弹量!!id="speed"|移速!!id="crit"|暴击!!id="critpow"|暴伤|-|15|| ['data-attr'] ="%d" data-mod="%d"|%s||%s||data-attr="%d" data-mod="%d"|%s%%||150%%|}]], gundata.round or 0, ['data-mod'] = moddata and moddata.round or 0, tostring(gundata.round or '不适用'), tostring(speeds[gtype]), gundata.crit or crits[gtype], moddata and moddata.crit or crits[gtype], tostring}:wikitext(gundata.crit or crits[gtype]))round) end
local self_pos, effect_poses = getGridPositions(gundata.grid_center or 13, gundata.grid_pos)
local container = moddata and root:tag('div'):attr('id', 'effects') or root