◆少前百科是非盈利性、非官方的少女前线维基百科。
◆如果您发现某些内容错误/空缺,请勇于修正/添加!参与进来其实很容易!点这里 加入少前百科
◆有任何意见、建议、纠错,欢迎在 GFwiki:反馈与建议 提出和讨论。编辑事务讨论QQ群:597764980,微博@GFwiki少前百科
◆To foreigners,You can use twitter to contact us.
Icon Nyto Silver.png

更改

跳转至: 导航搜索

模块:Gun info

添加740字节2023年3月25日 (六) 23:55
无编辑摘要
local data = mw.loadData('Module:Gun info/data')
local infobox = require('Module:Infobox').infobox
local guntype = { {'手枪', '冲锋枪', '步枪', '突击步枪', '机枪', '霰弹枪', [0] = '所有枪种'},
{'HG', 'SMG', 'RF', 'AR', 'MG', 'SG'} }
end
local function makeEffectTable(self_pos, effect_poses, target, effect, parent) local effect_table = rootparent:tag('table'):addClass('effect-table'):tag('tr') local effect_grid = effect_table:tag('td'):tag('table'):addClass('effect-grid')
local index = 1
for i = 0, 2 do
local tr = effect_tableeffect_grid:tag('tr')
for j = 1, 3 do
local td = tr:tag('td')
end
end
local effect_text = effect_table:tag('td')
effect_text:wikitext('<span style="background:white;color:#333">影响格效果</span><br>')
local targets = {}
for _, v in ipairs(target) do targets[#targets+1] = guntype[1][v] end
effect_text:wikitext(string.format('对%s有效', table.concat(targets, '、')))
local effects = {}
for i = 1, #effect - 1, 2 do
local aname = attrs[effect[i]]
local sign = effect[i+1] > 0 and '+' or ''
effects[#effects+1] = aname .. sign .. tostring(effect[i+1]) .. '%'
end
effect_text:wikitext('<br>' .. table.concat(effects, ' '))
end
local speeds = {15,12,7,10,4,6}
local crits = {20,5,40,20,5,40}
root:wikitext('== 战斗数据 ==') root:newline()
local ratios = { gundata.life, gundata.power, gundata.rate,
gundata.hit, gundata.dodge, gundata.armor or 0 }
end
local attrtable = root:tag('div'):attr('id', 'attr-table')
if gundata.round then attrtable:tagnewline('div') :wikitext('<div>弹量</div><div>' .string. tostringformat(gundata.round) .. '</div>')[[{|!穿甲!!弹量!!移速!!暴击!!暴伤|- :attr{|id = 'attr"ap-td"|15|id="round', ['-td" data-attr'="%d" data-mod="%d"|%s|id="speed-td"|%s||id="crit-td"|%s||id="critpow-td"|150%|}]] = , gundata.roundor 0, ['data-mod'] = moddata and moddata.round or nil}0, end attrtable:tag tostring(gundata.round or 'div不适用'):wikitext('<div>移速</div><div>' .. , tostring(speeds[gundata.guntype]) .. '</div>'), attrtable:tag('div'):wikitext('<div>暴击</div><div>' .. tostring(gundata.crit or crits[gundata.guntype]) )) local self_pos, effect_poses = getGridPositions(gundata.grid_center or 13, gundata. '</div>'grid_pos) attrtablelocal container = moddata and root:tag('div'):wikitext(css{ display = 'flex', ['flex-wrap'] = '<div>暴伤</div><div>150%</div>wrap') local self_pos local effect_poses} or root makeEffectTable(self_pos, effect_poses = getGridPositions(, gundata.grid_center or 13effect_target, gundata.grid_pos) makeEffectTable(self_poseffect, effect_posescontainer)
if moddata then
self_pos, effect_poses = getGridPositions(moddata.grid_center or 13, moddata.grid_pos)
makeEffectTable(self_pos, effect_poses, moddata.effect_target, moddata.effect, container)
end
root:newline()

导航菜单