| 🌟 | 現在、 鉄壁HSは通常HSと同じダメージになります。LMG及びDMR、チャージライフル、ハンマーポイント弾を除き、すべてのダメージ値が一致していることを確認しています。 |
「モジュール:StatTable/ProjectileSpeed」の版間の差分
ナビゲーションに移動
検索に移動
(ソートインジケーター非表示バグによるクラス名命名規則変更によるクラス指定の変更) |
(チャージ時の重力率に対応) |
||
| (同じ利用者による、間の8版が非表示) | |||
| 1行目: | 1行目: | ||
local aw | 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 configuration = mw.loadData('Module:StatTable/configuration') | |||
local getArgs -- lazily initialized | local getArgs -- lazily initialized | ||
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' | ||
| 34行目: | 20行目: | ||
local base = { | local base = { | ||
ammo = stat.ammo, | ammo = stat.ammo, | ||
dragcoeff = stat.projectile_drag_coefficient, | |||
gscale = stat.projectile_gravity_scale, | |||
name = name, | name = name, | ||
shortname = stat.localization['Japanese_Short'], | shortname = stat.localization['Japanese_Short'], | ||
| 44行目: | 32行目: | ||
local charge = aw.shallowCopy(base) | local charge = aw.shallowCopy(base) | ||
if aw.isNumberAndGreaterThanZero(stat.projectile_gravity_scale_charged) then | |||
charge.gscale = stat.projectile_gravity_scale_charged | |||
end | |||
charge.option = res.maxcharge | charge.option = res.maxcharge | ||
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 | ||
| 62行目: | 62行目: | ||
tableutil.RankCell.new('', 'speed', true), | tableutil.RankCell.new('', 'speed', true), | ||
tableutil.AmmoCell.new('', 'ammo', { | tableutil.AmmoCell.new('', 'ammo', { | ||
attributes | attributes = { align = 'center' }, | ||
headerStyle | cellClass = 'st-desktop', | ||
footerClass = 'st-desktop', | |||
headerClass = 'st-desktop', | |||
headerStyle = { width = '36px' }, | |||
}), | }), | ||
tableutil.WeaponNameCell.new(res.weaponname, 'name', { | tableutil.WeaponNameCell.new(res.weaponname, 'name', { | ||
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.LineValueCell.new(res. | tableutil.HopupCell.new(res.hopup, 'hopup', { | ||
cellClass = 'st-mobile-graph st-mobile-textshadow st-mobile-last', | attributes = { align = 'left' }, | ||
cellClass = 'st-mobile-padding0-both', | |||
headerColspan = 0, | |||
}), | |||
tableutil.LineValueCell.new(res.projspeed, 'speed', { | |||
cellClass = 'st-mobile-graph st-mobile-medium st-mobile-textshadow', | |||
footerClass = 'st-mobile-axis', | |||
format = formatFunction, | |||
headerStyle = { | |||
['min-width'] = '50px', | |||
['max-width'] = '6em', | |||
}, | |||
preferredGridCount = 3, | |||
}), | |||
tableutil.ValueCell.new(res.dragcoeff, 'dragcoeff', { | |||
cellClass = 'st-mobile-last', | |||
footerClass = 'st-mobile-last', | |||
headerClass = 'st-mobile-last', | |||
headerStyle = { | |||
['min-width'] = '50px', | |||
['max-width'] = '6em', | |||
}, | |||
}), | |||
tableutil.ValueCell.new(res.gravscale, 'gscale', { | |||
cellClass = 'st-mobile-last', | |||
footerClass = 'st-mobile-last', | footerClass = 'st-mobile-last', | ||
format = | format = function(val) | ||
if val then | |||
return string.format('%.0f%%', 100 * val) | |||
else | |||
return '?' | |||
end | |||
end, | |||
headerClass = 'st-mobile-last', | headerClass = 'st-mobile-last', | ||
headerStyle = { | headerStyle = { | ||
['min-width'] = ' | ['min-width'] = '50px', | ||
['max-width'] = ' | ['max-width'] = '6em', | ||
}, | }, | ||
}), | }), | ||
tableutil.LineCell.new(res.graph, 'speed', { | tableutil.LineCell.new(res.graph, 'speed', { | ||
| 87行目: | 121行目: | ||
headerClass = 'st-desktop', | headerClass = 'st-desktop', | ||
headerStyle = { | headerStyle = { | ||
['min-width'] = ' | ['min-width'] = '200px', | ||
}, | }, | ||
}), | }), | ||
| 101行目: | 135行目: | ||
args = getArgs(frame) | args = getArgs(frame) | ||
return p._main(args) | return p._main(args, false) | ||
end | end | ||
return p | return p | ||
2021年9月3日 (金) 16:08時点における最新版
このモジュールについての説明文ページを モジュール:StatTable/ProjectileSpeed/doc に作成できます
local aw = require('Module:Utility/Library')
local tableutil = require('Module:Utility/TableUtil/Apex')
local Hopup = mw.loadData('Module:Stat/Hopup')
local configuration = mw.loadData('Module:StatTable/configuration')
local getArgs -- lazily initialized
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_drag_coefficient,
gscale = stat.projectile_gravity_scale,
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)
if aw.isNumberAndGreaterThanZero(stat.projectile_gravity_scale_charged) then
charge.gscale = stat.projectile_gravity_scale_charged
end
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-mobile-padding0-both',
headerColspan = 0,
}),
tableutil.LineValueCell.new(res.projspeed, 'speed', {
cellClass = 'st-mobile-graph st-mobile-medium st-mobile-textshadow',
footerClass = 'st-mobile-axis',
format = formatFunction,
headerStyle = {
['min-width'] = '50px',
['max-width'] = '6em',
},
preferredGridCount = 3,
}),
tableutil.ValueCell.new(res.dragcoeff, 'dragcoeff', {
cellClass = 'st-mobile-last',
footerClass = 'st-mobile-last',
headerClass = 'st-mobile-last',
headerStyle = {
['min-width'] = '50px',
['max-width'] = '6em',
},
}),
tableutil.ValueCell.new(res.gravscale, 'gscale', {
cellClass = 'st-mobile-last',
footerClass = 'st-mobile-last',
format = function(val)
if val then
return string.format('%.0f%%', 100 * val)
else
return '?'
end
end,
headerClass = 'st-mobile-last',
headerStyle = {
['min-width'] = '50px',
['max-width'] = '6em',
},
}),
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