| 🌟 | 現在、 鉄壁HSは通常HSと同じダメージになります。LMG及びDMR、チャージライフル、ハンマーポイント弾を除き、すべてのダメージ値が一致していることを確認しています。 |
「モジュール:StatTable/ProjectileSpeed」の版間の差分
ナビゲーションに移動
検索に移動
(一部の設定をほかの統計表と同じように変更) |
(空気抵抗の項目を追加) |
||
| 5行目: | 5行目: | ||
local configuration = { | local configuration = { | ||
en = { | en = { | ||
dragcoefficient = 'Drag Coefficient', | |||
graph = 'Graph', | graph = 'Graph', | ||
hitscan = 'Hitscan', | hitscan = 'Hitscan', | ||
| 13行目: | 14行目: | ||
}, | }, | ||
ja = { | ja = { | ||
dragcoefficient = '空気抵抗', | |||
graph = 'グラフ', | graph = 'グラフ', | ||
hitscan = 'ヒットスキャン', | hitscan = 'ヒットスキャン', | ||
| 34行目: | 36行目: | ||
local base = { | local base = { | ||
ammo = stat.ammo, | ammo = stat.ammo, | ||
dragcoeff = stat.projectile_air_resistance, | |||
name = name, | name = name, | ||
shortname = stat.localization['Japanese_Short'], | shortname = stat.localization['Japanese_Short'], | ||
| 75行目: | 78行目: | ||
}), | }), | ||
tableutil.LineValueCell.new(res.projectilespeed, 'speed', { | tableutil.LineValueCell.new(res.projectilespeed, 'speed', { | ||
cellClass = 'st-mobile-graph st-mobile-textshadow | cellClass = 'st-mobile-graph st-mobile-textshadow', | ||
footerClass = 'st-mobile-axis | footerClass = 'st-mobile-axis', | ||
format = formatFunction, | format = formatFunction, | ||
headerStyle = { | |||
['min-width'] = '80px', | |||
['max-width'] = '8em', | |||
}, | |||
preferredGridCount = 3, | |||
}), | |||
tableutil.ValueCell.new(res.dragcoefficient, 'dragcoeff', { | |||
cellClass = 'st-mobile-last', | |||
footerClass = 'st-mobile-last', | |||
headerClass = 'st-mobile-last', | headerClass = 'st-mobile-last', | ||
headerStyle = { | headerStyle = { | ||
| 83行目: | 95行目: | ||
['max-width'] = '8em', | ['max-width'] = '8em', | ||
}, | }, | ||
}), | }), | ||
tableutil.LineCell.new(res.graph, 'speed', { | tableutil.LineCell.new(res.graph, 'speed', { | ||
2021年8月26日 (木) 18:23時点における版
このモジュールについての説明文ページを モジュール:StatTable/ProjectileSpeed/doc に作成できます
local aw = require('Module:Utility/Library')
local tableutil = require('Module:Utility/TableUtil/Apex')
local getArgs -- lazily initialized
local configuration = {
en = {
dragcoefficient = 'Drag Coefficient',
graph = 'Graph',
hitscan = 'Hitscan',
maxcharge = 'Max charge',
mincharge = 'Min charge',
projectilespeed = 'Projectile speed [m/s]',
weaponname = 'Weapon name',
},
ja = {
dragcoefficient = '空気抵抗',
graph = 'グラフ',
hitscan = 'ヒットスキャン',
maxcharge = '最大溜め',
mincharge = '最小溜め',
projectilespeed = '弾速 [m/s]',
weaponname = '武器名',
},
}
local p = {}
function p._main(args)
args = args or {}
local lang = args.lang or 'ja'
local res = configuration[lang]
local stats = mw.loadData('Module:Stat/Weapon')
local dataset = {}
for name, stat in pairs(stats) do
local base = {
ammo = stat.ammo,
dragcoeff = stat.projectile_air_resistance,
name = name,
shortname = stat.localization['Japanese_Short'],
speed = 0.0254 * stat.projectile_speed,
}
local charged = stat.projectile_speed_charged
if aw.isNumberAndGreaterThanZero(charged) then
base.option = res.mincharge
local charge = aw.shallowCopy(base)
charge.option = res.maxcharge
charge.speed = 0.0254 * charged
table.insert(dataset, charge)
end
table.insert(dataset, base)
end
local formatFunction = function(speed)
if speed == math.huge then
return res.hitscan
else
return string.format('%.1f', speed)
end
end
local metadata = {
tableutil.RankCell.new('', 'speed', true),
tableutil.AmmoCell.new('', 'ammo', {
attributes = { align = 'center' },
cellClass = 'st-desktop',
footerClass = 'st-desktop',
headerClass = 'st-desktop',
headerStyle = { width = '36px' },
}),
tableutil.WeaponNameCell.new(res.weaponname, 'name', {
ammoIndex = 'ammo',
attributes = { align = 'left' },
optionIndex = 'option',
shortnameIndex = 'shortname',
}),
tableutil.LineValueCell.new(res.projectilespeed, 'speed', {
cellClass = 'st-mobile-graph st-mobile-textshadow',
footerClass = 'st-mobile-axis',
format = formatFunction,
headerStyle = {
['min-width'] = '80px',
['max-width'] = '8em',
},
preferredGridCount = 3,
}),
tableutil.ValueCell.new(res.dragcoefficient, 'dragcoeff', {
cellClass = 'st-mobile-last',
footerClass = 'st-mobile-last',
headerClass = 'st-mobile-last',
headerStyle = {
['min-width'] = '80px',
['max-width'] = '8em',
},
}),
tableutil.LineCell.new(res.graph, 'speed', {
cellClass = 'st-desktop st-desktop-graph',
footerClass = 'st-desktop',
headerClass = 'st-desktop',
headerStyle = {
['min-width'] = '200px',
},
}),
}
local node = tableutil.createTable(dataset, metadata, opts)
return tostring(node)
end
function p.main(frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
args = getArgs(frame)
return p._main(args)
end
return p