🌟現在、鉄壁 鉄壁ヘッドショットには対応済みです。
鉄壁HSは通常HSと同じダメージになります。LMG及びDMR、チャージライフル、ハンマーポイント弾を除き、すべてのダメージ値が一致していることを確認しています。

モジュール:StatTable/ProjectileSpeed

提供:Apex Data
2021年8月30日 (月) 11:14時点におけるMntone (トーク | 投稿記録)による版 (モバイル向けモバイル専用の幅クラス実装によりデスクトップ向けの幅を他と同じように改善)
ナビゲーションに移動 検索に移動

このモジュールについての説明文ページを モジュール: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-mobile-padding0-both',
			headerColspan  = 0,
		}),
		tableutil.LineValueCell.new(res.projectilespeed, '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.dragcoefficient, 'dragcoeff', {
			cellClass   = 'st-mobile-last',
			footerClass = 'st-mobile-last',
			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