🌟 | 現在、 鉄壁ヘッドショットには対応済みです。 鉄壁HSは通常HSと同じダメージになります。LMG及びDMR、チャージライフル、ハンマーポイント弾を除き、すべてのダメージ値が一致していることを確認しています。 |
モジュール:StatTable/ProjectileSpeed
ナビゲーションに移動
検索に移動
このモジュールについての説明文ページを モジュール: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) 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