| 🌟 | 現在、 鉄壁HSは通常HSと同じダメージになります。LMG及びDMR、チャージライフル、ハンマーポイント弾を除き、すべてのダメージ値が一致していることを確認しています。 |
「モジュール:StatTable/ProjectileSpeed」の版間の差分
ナビゲーションに移動
検索に移動
(空気抵抗の項目を追加) |
(ボセックコンパウンドボウのシャッターキャップのチャージ時の初弾速に対応) |
||
| 1行目: | 1行目: | ||
local aw = require('Module:Utility/Library') | local aw = require('Module:Utility/Library') | ||
local tableutil = require('Module:Utility/TableUtil/Apex') | local tableutil = require('Module:Utility/TableUtil/Apex') | ||
local Hopup = mw.loadData('Module:Stat/Hopup') | |||
local getArgs -- lazily initialized | local getArgs -- lazily initialized | ||
| 25行目: | 26行目: | ||
local p = {} | local p = {} | ||
function p._main(args) | function p._main(args, __debug) | ||
args = args or {} | args = args or {} | ||
if __debug == nil then | |||
__debug = true | |||
end | |||
local lang = args.lang or 'ja' | local lang = args.lang or 'ja' | ||
| 50行目: | 54行目: | ||
charge.speed = 0.0254 * charged | charge.speed = 0.0254 * charged | ||
table.insert(dataset, charge) | table.insert(dataset, charge) | ||
end | |||
-- Shatter Caps | |||
if (__debug or Hopup.shatter_caps.enabled) and type(stat.shatter_caps) == 'table' and aw.isNumberAndGreaterThanZero(stat.shatter_caps.projectile_speed_charged) then | |||
local shatterCaps = aw.shallowCopy(base) | |||
shatterCaps.option = res.maxcharge | |||
shatterCaps.hopup = { 'shatter_caps' } | |||
shatterCaps.speed = 0.0254 * stat.shatter_caps.projectile_speed_charged | |||
table.insert(dataset, shatterCaps) | |||
end | end | ||
| 74行目: | 87行目: | ||
ammoIndex = 'ammo', | ammoIndex = 'ammo', | ||
attributes = { align = 'left' }, | attributes = { align = 'left' }, | ||
cellClass = 'st-dashed-right st-mobile-none-right st-mobile-padding0-right', | |||
headerColspan = 2, | |||
optionIndex = 'option', | optionIndex = 'option', | ||
shortnameIndex = 'shortname', | shortnameIndex = 'shortname', | ||
}), | |||
tableutil.HopupCell.new(res.hopup, 'hopup', { | |||
attributes = { align = 'left' }, | |||
cellClass = 'st-dashed-left st-mobile-none-left st-mobile-padding0-both', | |||
headerColspan = 0, | |||
}), | }), | ||
tableutil.LineValueCell.new(res.projectilespeed, 'speed', { | tableutil.LineValueCell.new(res.projectilespeed, 'speed', { | ||
| 115行目: | 135行目: | ||
args = getArgs(frame) | args = getArgs(frame) | ||
return p._main(args) | return p._main(args, false) | ||
end | end | ||
return p | return p | ||
2021年8月29日 (日) 00:55時点における版
このモジュールについての説明文ページを モジュール:StatTable/ProjectileSpeed/doc に作成できます
local aw = require('Module:Utility/Library')
local tableutil = require('Module:Utility/TableUtil/Apex')
local Hopup = mw.loadData('Module:Stat/Hopup')
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, __debug)
args = args or {}
if __debug == nil then
__debug = true
end
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
-- Shatter Caps
if (__debug or Hopup.shatter_caps.enabled) and type(stat.shatter_caps) == 'table' and aw.isNumberAndGreaterThanZero(stat.shatter_caps.projectile_speed_charged) then
local shatterCaps = aw.shallowCopy(base)
shatterCaps.option = res.maxcharge
shatterCaps.hopup = { 'shatter_caps' }
shatterCaps.speed = 0.0254 * stat.shatter_caps.projectile_speed_charged
table.insert(dataset, shatterCaps)
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' },
cellClass = 'st-dashed-right st-mobile-none-right st-mobile-padding0-right',
headerColspan = 2,
optionIndex = 'option',
shortnameIndex = 'shortname',
}),
tableutil.HopupCell.new(res.hopup, 'hopup', {
attributes = { align = 'left' },
cellClass = 'st-dashed-left st-mobile-none-left st-mobile-padding0-both',
headerColspan = 0,
}),
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, false)
end
return p