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

「モジュール:StatTable/ProjectileSpeed」の版間の差分

提供:Apex Data
ナビゲーションに移動 検索に移動
(LineCellのgrid実装によるgrid実現方法の変更)
(チャージ時の重力率に対応)
 
(同じ利用者による、間の11版が非表示)
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 configuration = mw.loadData('Module:StatTable/configuration')
local getArgs  -- lazily initialized
local getArgs  -- lazily initialized
local configuration = {
en = {
graph          = 'Graph',
hitscan        = 'Hitscan',
maxcharge      = 'Max charge',
mincharge      = 'Min charge',
projectilespeed = 'Projectile speed [m/s]',
weaponname      = 'Weapon name',
},
ja = {
graph          = 'グラフ',
hitscan        = 'ヒットスキャン',
maxcharge      = '最大溜め',
mincharge      = '最小溜め',
projectilespeed = '弾速 [m/s]',
weaponname      = '武器名',
},
}


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     = { align = 'center' },
attributes = { align = 'center' },
headerStyle   = { width = '36px' },
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.projectilespeed, 'speed', {
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,
format      = formatFunction,
headerClass = 'st-mobile-graph st-mobile-last',
headerStyle = {
headerStyle = {
['min-width'] = '75px',
['min-width'] = '50px',
['max-width'] = '8em',
['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', {
tableutil.LineCell.new(res.graph, 'speed', {
cellClass  = 'st-desktop-graph',
cellClass  = 'st-desktop st-desktop-graph',
headerClass = 'st-desktop-graph',
footerClass = 'st-desktop',
headerClass = 'st-desktop',
headerStyle = {
headerStyle = {
['min-width'] = '160px',
['min-width'] = '200px',
},
},
}),
}),
98行目: 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