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

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

提供:Apex Data
ナビゲーションに移動 検索に移動
(LineCellのgrid実装によるgrid実現方法の変更)
(ボセックコンパウンドボウの物資投下武器化に対応)
 
(同じ利用者による、間の40版が非表示)
1行目: 1行目:
local aw       = require('Module:Utility/Library')
local aw           = require('Module:Utility/Library')
local iu       = require('Module:Utility/Image')
local apex          = require('Module:Utility/ApexLibrary')
local tableutil = require('Module:Utility/TableUtil/Apex')
local iu           = require('Module:Utility/Image')
local Hopup     = mw.loadData('Module:Stat/Hopup')
local scale        = require('Module:Utility/Scale')
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 = {
local function _addDataPrivate(dataset, data, fn, mul)
__debug__enableAllHopup = false,
local head = data.head
en = {
local lvl1 = apex.calcHeadshotMultiplier(head, apex.HEAD_HLMLV1)
dmgmag    = 'Damage per Mag',
local lvl2 = apex.calcHeadshotMultiplier(head, apex.HEAD_HLMLV2)
graph      = 'Graph',
local lvl3 = apex.calcHeadshotMultiplier(head, apex.HEAD_HLMLV3)
hopup      = 'Hop-Up',
local legs = data.legs
infinity  = '∞',
data.bodyDmgmag = fn(data.damage, 1, 1)                              * mul
maxcharge  = 'Max charge',
data.headDmgmag = fn(apex.calcPartDamage(data.damage, head), head, 1) * mul
mincharge  = 'Min charge',
data.lvl1Dmgmag = fn(apex.calcPartDamage(data.damage, lvl1), lvl1, 1) * mul
weaponname = 'Weapon name',
data.lvl2Dmgmag = fn(apex.calcPartDamage(data.damage, lvl2), lvl2, 1) * mul
},
data.lvl3Dmgmag = fn(apex.calcPartDamage(data.damage, lvl3), lvl3, 1) * mul
ja = {
data.legsDmgmag = fn(apex.calcPartDamage(data.damage, legs), legs, 1) * mul
dmgmag    = 'マガジン当たりのダメージ',
data.flLgDmgmag = fn(apex.calcDamageFromPartAndPassive(data.damage, legs, 0.85), legs, 0.85) * mul
graph      = 'グラフ',
table.insert(dataset, data)
hopup      = 'ホップアップ',
end
infinity  = '∞',
maxcharge  = '最大溜め',
mincharge  = '最小溜め',
weaponname = '武器名',
},
}


local function addData(dataset, data, magazines, special)
local function addData(dataset, data, special, fn)
local magazinesType = type(magazines)
fn = fn or function(val) return val end
local magazinesType = type(data.magazines)
-- 拡張マガジンがつく場合
-- 拡張マガジンがつく場合
if magazinesType == 'table' then
if magazinesType == 'table' then
if special then
if special then
local specialData = aw.shallowCopy(data)
local mul = data.pellets * math.floor(data.magazines[4] / data.ammopershot)
specialData.dmgmag = data.dmgmag * math.floor(magazines[4] / data.ammopershot)
_addDataPrivate(dataset, data, fn, mul)
table.insert(dataset, specialData)
else
else
for level, magazine in ipairs(magazines) do
for level, magazine in ipairs(data.magazines) do
local magData  = aw.shallowCopy(data)
local data2 = aw.shallowCopy(data)
magData.dmgmag = data.dmgmag * math.floor(magazine / data.ammopershot)
local mul  = data.pellets * math.floor(magazine / data.ammopershot)
magData.level = level - 1
data2.level = level - 1
table.insert(dataset, magData)
_addDataPrivate(dataset, data2, fn, mul)
end
end
end
end
47行目: 45行目:
-- 拡張マガジンがつかない場合
-- 拡張マガジンがつかない場合
elseif magazinesType == 'number' then
elseif magazinesType == 'number' then
local nomagData = aw.shallowCopy(data)
local mul = data.pellets * math.floor(data.magazines / data.ammopershot)
nomagData.dmgmag = data.dmgmag * math.floor(magazines / data.ammopershot)
_addDataPrivate(dataset, data, fn, mul)
table.insert(dataset, nomagData)
end
end
end
end


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'
69行目: 69行目:
ammoicon    = stat.ammo,
ammoicon    = stat.ammo,
ammopershot = stat.ammo_per_shot or 1,
ammopershot = stat.ammo_per_shot or 1,
dmgmag     = baseDamage,
damage     = baseDamage,
head        = stat.damage_head_scale,
legs        = stat.damage_legs_scale,
level      = -1,
level      = -1,
magazines  = stat.magazine,
name        = name,
name        = name,
pellets    = stat.pellet or 1,
shortname  = stat.localization['Japanese_Short'],
shortname  = stat.localization['Japanese_Short'],
}
}
-- マガジンがバックパック (L-スターEMG)
-- Mag is inf
if stat.magazine == math.huge then
if stat.magazine == math.huge then
if aw.isNumberAndGreaterThanZero(stat.firerate.auto) then
-- Bocek Compound Bow
if stat.ammo == 'arrows' or stat.ammo == 'special_arrows' then
if special then
baseData.magazines = stat.magazine_reserve
else
local ammoStats = mw.loadData('Module:Stat/Ammo')
local gearStats = mw.loadData('Module:Stat/Gear')
local virtualMagazines = {
gearStats.backpack.level0.limit * ammoStats.arrows.slot,
gearStats.backpack.level1.limit * ammoStats.arrows.slot,
gearStats.backpack.level2.limit * ammoStats.arrows.slot,
gearStats.backpack.level3.limit * ammoStats.arrows.slot,
}
baseData.magazines = virtualMagazines
end
-- Chargefire
if aw.isNumberAndGreaterThanX(stat.damage.charged, baseDamage) then
baseData.option = res.mincharge
addData(dataset, baseData, special)
local maxChargeData  = aw.shallowCopy(baseData)
maxChargeData.damage = stat.damage.charged
maxChargeData.option = res.maxcharge
addData(dataset, maxChargeData, special)
-- チャージなし
else
addData(dataset, baseData, special)
end
-- Shatter Caps
if (__debug or Hopup.shatter_caps.enabled) and type(stat.shatter_caps) == 'table' and aw.isNumberAndGreaterThanX(stat.shatter_caps.damage.base, 1) and aw.isNumberAndGreaterThanX(stat.shatter_caps.pellet, 1) then
local shatterCapsData    = aw.shallowCopy(baseData)
shatterCapsData.damage  = stat.shatter_caps.damage.base
if stat.shatter_caps.damage_head_scale then
shatterCapsData.head = stat.shatter_caps.damage_head_scale
end
shatterCapsData.hopup    = { 'shatter_caps' }
if stat.shatter_caps.damage_legs_scale then
shatterCapsData.legs = stat.shatter_caps.damage_legs_scale
end
shatterCapsData.pellets  = stat.shatter_caps.pellet
if aw.isNumberAndGreaterThanX(stat.shatter_caps.damage.charged, stat.shatter_caps.damage.base) then
shatterCapsData.option = res.mincharge
addData(dataset, shatterCapsData, special)
local shatterCapsMaxChargeData    = aw.shallowCopy(shatterCapsData)
shatterCapsMaxChargeData.damage  = stat.shatter_caps.damage.charged
if stat.shatter_caps.damage.headshot_charged then
shatterCapsMaxChargeData.head = stat.shatter_caps.damage.headshot_charged
end
if stat.shatter_caps.damage.legshot_charged then
shatterCapsMaxChargeData.legs = stat.shatter_caps.damage.legshot_charged
end
shatterCapsMaxChargeData.option  = res.maxcharge
addData(dataset, shatterCapsMaxChargeData, special)
else
addData(dataset, shatterCapsData, special)
end
end
-- L-STAR EMG
elseif aw.isNumberAndGreaterThanZero(stat.firerate) then
local overheatType = type(stat.overheat)
local overheatType = type(stat.overheat)
if overheatType == 'table' then
if overheatType == 'table' then
local virtualMagazines = {
local virtualMagazines = {
math.ceil(stat.overheat[1] * stat.firerate.auto),
math.ceil(stat.overheat[1] * stat.firerate),
math.ceil(stat.overheat[2] * stat.firerate.auto),
math.ceil(stat.overheat[2] * stat.firerate),
math.ceil(stat.overheat[3] * stat.firerate.auto),
math.ceil(stat.overheat[3] * stat.firerate),
math.ceil(stat.overheat[4] * stat.firerate.auto),
math.ceil(stat.overheat[4] * stat.firerate),
}
}
addData(dataset, baseData, virtualMagazines, special)
baseData.magazines = virtualMagazines
addData(dataset, baseData, special)
-- 改造ローダー
-- Modded Loader
if stat.category == 'light_machine_gun' then
if stat.category == 'light_machine_gun' then
local moddedLoaderVirtualMagazines = {
local moddedLoaderVirtualMagazines = {
math.ceil(1.15 * stat.overheat[1] * stat.firerate.auto),
math.ceil(1.15 * stat.overheat[1] * stat.firerate),
math.ceil(1.15 * stat.overheat[2] * stat.firerate.auto),
math.ceil(1.15 * stat.overheat[2] * stat.firerate),
math.ceil(1.15 * stat.overheat[3] * stat.firerate.auto),
math.ceil(1.15 * stat.overheat[3] * stat.firerate),
math.ceil(1.15 * stat.overheat[4] * stat.firerate.auto),
math.ceil(1.15 * stat.overheat[4] * stat.firerate),
}
}
local moddedLoaderData = aw.shallowCopy(baseData)
local moddedLoaderData = aw.shallowCopy(baseData)
moddedLoaderData.hopup = { 'modded_loader' }
moddedLoaderData.hopup = { 'modded_loader' }
addData(dataset, moddedLoaderData, moddedLoaderVirtualMagazines, special)
moddedLoaderData.magazines = moddedLoaderVirtualMagazines
addData(dataset, moddedLoaderData, special)
end
end
elseif overheatType == 'number' then
elseif overheatType == 'number' then
local virtualMagazine = math.ceil(stat.overheat * stat.firerate.auto)
baseData.magazines = math.ceil(stat.overheat * stat.firerate)
addData(dataset, baseData, virtualMagazines, special)
addData(dataset, baseData, special)
-- 改造ローダー
-- Modded Loader
if stat.category == 'light_machine_gun' then
if stat.category == 'light_machine_gun' then
local virtualMagazine = math.ceil(stat.overheat * stat.firerate.auto)
local moddedLoaderData     = aw.shallowCopy(baseData)
local moddedLoaderData = aw.shallowCopy(baseData)
moddedLoaderData.hopup     = { 'modded_loader' }
moddedLoaderData.hopup = { 'modded_loader' }
moddedLoaderData.magazines = math.ceil(stat.overheat * stat.firerate)
addData(dataset, moddedLoaderData, virtualMagazines, special)
addData(dataset, moddedLoaderData, special)
end
end
end
end
end
end
-- チャージビーム (チャージライフル)
-- Charge Rifle
elseif stat.damage.beam then
elseif stat.damage.beam then
local tickData = aw.shallowCopy(baseData)
addData(dataset, baseData, special, function(val, part, passive)
tickData.dmgmag = baseDamage + stat.damage.beam.base * stat.damage.beam.ticks
return val + apex.calcDamageFromPartAndPassive(stat.damage.beam.base, part, passive) * stat.damage.beam.ticks
addData(dataset, tickData, stat.magazine, special)
end)
-- 散弾 (ショットガン・トリプルテイク)
elseif aw.isNumberAndGreaterThanX(stat.pellet, 1) then
local pelletData = aw.shallowCopy(baseData)
pelletData.dmgmag = baseDamage * stat.pellet
addData(dataset, pelletData, stat.magazine, special)
-- ハンマーポイント弾 (モザンビーク)
if (configuration.__debug__enableAllHopup or Hopup.hammerpoint_rounds.enabled) and aw.isNumberAndGreaterThanX(stat.damage.hammerpoint_rounds, 1) then
local pelletUnshieldedData = aw.shallowCopy(pelletData)
pelletUnshieldedData.dmgmag = math.floor(stat.damage.hammerpoint_rounds * baseDamage) * stat.pellet
pelletUnshieldedData.hopup  = { 'hammerpoint_rounds' }
addData(dataset, pelletUnshieldedData, stat.magazine, special)
end
-- それ以外
-- Other
else
else
-- チャージ (30-30リピーター・ボセックコンパウンドボウ)
-- Chargefire
if aw.isNumberAndGreaterThanX(stat.damage.charged, baseDamage) then
if aw.isNumberAndGreaterThanX(stat.damage.charged, baseDamage) then
local minChargeData  = aw.shallowCopy(baseData)
baseData.option = res.nocharge
minChargeData.option = res.mincharge
addData(dataset, baseData, special)
addData(dataset, minChargeData, stat.magazine, special)
local maxChargeData = aw.shallowCopy(baseData)
local maxChargeData   = aw.shallowCopy(baseData)
maxChargeData.dmgmag = stat.damage.charged
maxChargeData.damage  = stat.damage.charged
if stat.damage.headshot_charged then
maxChargeData.head = stat.damage.headshot_charged
end
if stat.damage.legshot_charged then
maxChargeData.legs = stat.damage.legshot_charged
end
maxChargeData.option = res.maxcharge
maxChargeData.option = res.maxcharge
addData(dataset, maxChargeData, stat.magazine, special)
addData(dataset, maxChargeData, special)
-- チャージが無効の場合の通常出力
-- チャージが無効の場合の通常出力
else
else
addData(dataset, baseData, stat.magazine, special)
addData(dataset, baseData, special)
end
-- 改造ローダー (ディヴォーションLMG・M600スピットファイア・ランページ)
if stat.category == 'light_machine_gun' then
local moddedLoaderData = aw.shallowCopy(baseData)
moddedLoaderData.hopup = { 'modded_loader' }
local magazinesType = type(stat.magazine)
if magazinesType == 'table' then
local moddedLoaderMagazines = {
aw.round(1.15 * stat.magazine[1]),
aw.round(1.15 * stat.magazine[2]),
aw.round(1.15 * stat.magazine[3]),
aw.round(1.15 * stat.magazine[4]),
}
addData(dataset, moddedLoaderData, moddedLoaderMagazines, special)
elseif magazinesType == 'number' then
local moddedLoaderMagazine = aw.round(1.15 * stat.magazine)
addData(dataset, moddedLoaderData, moddedLoaderMagazine, special)
end
end
end
-- ミニガン「シーラ」
-- Modded Loader
if stat.ammo == 'minigun' then
if stat.category == 'light_machine_gun' or stat.ammo == 'minigun' then
local moddedLoaderData = aw.shallowCopy(baseData)
local moddedLoaderData     = aw.shallowCopy(baseData)
moddedLoaderData.hopup = { 'modded_loader' }
moddedLoaderData.hopup     = { 'modded_loader' }
moddedLoaderData.magazines = apex.getMagazineWithModdedLoader(stat.magazine)
if type(stat.magazine) == 'number' then
addData(dataset, moddedLoaderData, special)
local moddedLoaderMagazine = aw.round(1.15 * stat.magazine)
addData(dataset, moddedLoaderData, moddedLoaderMagazine, special)
end
end
end
-- 増幅モード (センチネル)
-- Amped mode
if aw.isNumberAndGreaterThanX(stat.damage.amped, baseDamage) then
if aw.isNumberAndGreaterThanX(stat.damage.amped, baseDamage) then
local ampedData    = aw.shallowCopy(baseData)
local ampedData    = aw.shallowCopy(baseData)
ampedData.ammoicon = ampedData.ammo .. '_amped'
ampedData.ammoicon = ampedData.ammo .. '_amped'
ampedData.dmgmag   = stat.damage.amped
ampedData.damage   = stat.damage.amped
ampedData.option  = iu.item('シールドセル') .. '<span class="text-desktoponly"> 増幅モード</span>'
ampedData.option  = res.amped
addData(dataset, ampedData, stat.magazine, special)
addData(dataset, ampedData, special)
end
-- Selectfire Receiver (HAVOC Rifle)
if (__debug or Hopup.selectfire_receiver.enabled) and type(stat.selectfire_receiver) == 'table' and stat.selectfire_receiver.damage and aw.isNumberAndGreaterThanX(stat.selectfire_receiver.damage.base, baseDamage) then
local selectfireReceiverData = aw.shallowCopy(baseData)
if stat.selectfire_receiver.ammo_per_shot then
selectfireReceiverData.ammopershot = stat.selectfire_receiver.ammo_per_shot
end
selectfireReceiverData.damage = stat.selectfire_receiver.damage.base
if stat.selectfire_receiver.damage_head_scale then
selectfireReceiverData.head = stat.selectfire_receiver.damage_head_scale
end
selectfireReceiverData.hopup = { 'selectfire_receiver' }
if stat.selectfire_receiver.damage_legs_scale then
selectfireReceiverData.legs = stat.selectfire_receiver.damage_legs_scale
end
addData(dataset, selectfireReceiverData, special)
end
end
-- セレクトファイアレシーバー (ハボックライフル)
-- Skullpiercer Rifling
if (configuration.__debug__enableAllHopup or Hopup.selectfire_receiver.enabled) and stat.selectfire_receiver and stat.selectfire_receiver.damage and aw.isNumberAndGreaterThanX(stat.selectfire_receiver.damage.base, baseDamage) then
if (__debug or Hopup.skullpiercer_rifling.enabled) and type(stat.skullpiercer_rifling) == 'table' and aw.isNumberAndGreaterThanX(stat.skullpiercer_rifling.damage_head_scale, 1) then
local selectfireReceiverData      = aw.shallowCopy(baseData)
local skullpiercerRiflingData = aw.shallowCopy(baseData)
selectfireReceiverData.ammopershot = stat.selectfire_receiver.ammo_per_shot or 1
skullpiercerRiflingData.head = stat.skullpiercer_rifling.damage_head_scale
selectfireReceiverData.dmgmag      = stat.selectfire_receiver.damage.base
skullpiercerRiflingData.hopup = { 'skullpiercer_rifling' }
selectfireReceiverData.hopup       = { 'selectfire_receiver' }
addData(dataset, skullpiercerRiflingData, special)
addData(dataset, selectfireReceiverData, stat.magazine, special)
end
end
-- ハンマーポイント弾 (P2020)
-- Hammerpoint Rounds
if (configuration.__debug__enableAllHopup or Hopup.hammerpoint_rounds.enabled) and aw.isNumberAndGreaterThanX(stat.damage.hammerpoint_rounds, 1) then
if (__debug or Hopup.hammerpoint_rounds.enabled) and type(stat.hammerpoint_rounds) == 'table' and aw.isNumberAndGreaterThanX(stat.hammerpoint_rounds.damage_unshielded_scale, 1) then
local hammerpointRoundsData  = aw.shallowCopy(baseData)
local hammerpointRoundsData  = aw.shallowCopy(baseData)
hammerpointRoundsData.dmgmag = math.floor(stat.damage.hammerpoint_rounds * baseDamage)
hammerpointRoundsData.damage = math.floor(stat.hammerpoint_rounds.damage_unshielded_scale * baseDamage)
hammerpointRoundsData.hopup  = { 'hammerpoint_rounds' }
hammerpointRoundsData.hopup  = { 'hammerpoint_rounds' }
addData(dataset, hammerpointRoundsData, stat.magazine, special)
addData(dataset, hammerpointRoundsData, special)
end
end
-- ディスラプター弾 (オルタネーター・RE-45オート)
-- Disruptor Rounds
if (configuration.__debug__enableAllHopup or Hopup.disruptor_rounds.enabled or special) and aw.isNumberAndGreaterThanX(stat.damage.disruptor_rounds, 1) then
if (__debug or Hopup.disruptor_rounds.enabled or special) and type(stat.disruptor_rounds) == 'table' and aw.isNumberAndGreaterThanX(stat.disruptor_rounds.damage_shield_scale, 1) then
local disruptorRoundsData = aw.shallowCopy(baseData)
local disruptorRoundsData = aw.shallowCopy(baseData)
disruptorRoundsData.dmgmag = math.floor(stat.damage.disruptor_rounds * baseDamage)
disruptorRoundsData.hopup = { 'disruptor_rounds' }
disruptorRoundsData.hopup = { 'disruptor_rounds' }
addData(dataset, disruptorRoundsData, special, function(val)
addData(dataset, disruptorRoundsData, stat.magazine, special)
return apex.calcDisruptorDamage(val, stat.disruptor_rounds.damage_shield_scale)
end)
end
end
-- アンビルレシーバー (VK-47フラットライン・R-301カービン)
-- Anvil Receiver
if (configuration.__debug__enableAllHopup or Hopup.anvil_receiver.enabled) and stat.anvil_receiver and aw.isNumberAndGreaterThanX(stat.anvil_receiver.damage.base, baseDamage) then
if (__debug or Hopup.anvil_receiver.enabled) and type(stat.anvil_receiver) == 'table' and aw.isNumberAndGreaterThanX(stat.anvil_receiver.damage.base, baseDamage) then
local anvilReceiverData      = aw.shallowCopy(baseData)
local anvilReceiverData      = aw.shallowCopy(baseData)
anvilReceiverData.ammopershot = stat.anvil_receiver.ammo_per_shot or 2
anvilReceiverData.ammopershot = stat.anvil_receiver.ammo_per_shot or 2
anvilReceiverData.dmgmag     = stat.anvil_receiver.damage.base
anvilReceiverData.damage     = stat.anvil_receiver.damage.base
if stat.anvil_receiver.damage_head_scale then
anvilReceiverData.head    = stat.anvil_receiver.damage_head_scale
end
anvilReceiverData.hopup      = { 'anvil_receiver' }
anvilReceiverData.hopup      = { 'anvil_receiver' }
addData(dataset, anvilReceiverData, stat.magazine, special)
if stat.anvil_receiver.damage_legs_scale then
anvilReceiverData.legs    = stat.anvil_receiver.damage_legs_scale
end
addData(dataset, anvilReceiverData, special)
end
end
-- シャッターキャップ (30-30リピーター・ボセックコンパウンドボウ)
-- Shatter Caps
if (configuration.__debug__enableAllHopup or Hopup.shatter_caps.enabled) and stat.shatter_caps and aw.isNumberAndGreaterThanX(stat.shatter_caps.damage.base, 1) and aw.isNumberAndGreaterThanX(stat.shatter_caps.pellet, 1) then
if (__debug or Hopup.shatter_caps.enabled) and type(stat.shatter_caps) == 'table' and aw.isNumberAndGreaterThanX(stat.shatter_caps.damage.base, 1) and aw.isNumberAndGreaterThanX(stat.shatter_caps.pellet, 1) then
local shatterCapsData    = aw.shallowCopy(baseData)
shatterCapsData.damage  = stat.shatter_caps.damage.base
if stat.shatter_caps.damage_head_scale then
shatterCapsData.head = stat.shatter_caps.damage_head_scale
end
shatterCapsData.hopup    = { 'shatter_caps' }
if stat.shatter_caps.damage_legs_scale then
shatterCapsData.legs = stat.shatter_caps.damage_legs_scale
end
shatterCapsData.pellets  = stat.shatter_caps.pellet
if aw.isNumberAndGreaterThanX(stat.shatter_caps.damage.charged, stat.shatter_caps.damage.base) then
if aw.isNumberAndGreaterThanX(stat.shatter_caps.damage.charged, stat.shatter_caps.damage.base) then
local shatterCapsMinChargeData = aw.shallowCopy(baseData)
shatterCapsData.option = res.nocharge
shatterCapsMinChargeData.dmgmag = stat.shatter_caps.damage.base * stat.shatter_caps.pellet
addData(dataset, shatterCapsData, special)
shatterCapsMinChargeData.option = res.mincharge
shatterCapsMinChargeData.hopup  = { 'shatter_caps' }
addData(dataset, shatterCapsMinChargeData, stat.magazine, special)
local shatterCapsMaxChargeData = aw.shallowCopy(shatterCapsMinChargeData)
local shatterCapsMaxChargeData   = aw.shallowCopy(shatterCapsData)
shatterCapsMaxChargeData.dmgmag = stat.shatter_caps.damage.charged * stat.shatter_caps.pellet
shatterCapsMaxChargeData.damage  = stat.shatter_caps.damage.charged
shatterCapsMaxChargeData.option = res.maxcharge
if stat.shatter_caps.damage.headshot_charged then
addData(dataset, shatterCapsMaxChargeData, stat.magazine, special)
shatterCapsMaxChargeData.head = stat.shatter_caps.damage.headshot_charged
end
if stat.shatter_caps.damage.legshot_charged then
shatterCapsMaxChargeData.legs = stat.shatter_caps.damage.legshot_charged
end
shatterCapsMaxChargeData.option   = res.maxcharge
addData(dataset, shatterCapsMaxChargeData, special)
else
else
local shatterCapsData = aw.shallowCopy(baseData)
addData(dataset, shatterCapsData, special)
shatterCapsData.dmgmag = stat.shatter_caps.damage.base * stat.shatter_caps.pellet
shatterCapsData.hopup  = { 'shatter_caps' }
addData(dataset, shatterCapsData, stat.magazine, special)
end
end
end
end
-- アンビルレシーバー (ウィングマン・ヘムロックバーストAR)
-- Boosted Loader
if (configuration.__debug__enableAllHopup or Hopup.boosted_loader.enabled) and stat.boosted_loader then
if (__debug or Hopup.boosted_loader.enabled) and type(stat.boosted_loader) == 'table' then
local boostedLoaderData = aw.shallowCopy(baseData)
local boostedLoaderData     = aw.shallowCopy(baseData)
boostedLoaderData.hopup = { 'boosted_loader' }
boostedLoaderData.hopup     = { 'boosted_loader' }
addData(dataset, boostedLoaderData, stat.boosted_loader.magazine, special)
boostedLoaderData.magazines = stat.boosted_loader.magazine
addData(dataset, boostedLoaderData, special)
end
end
end
end
end
end
local formatFunction = function(dmgmag)
if dmgmag == math.huge then
return res.infinity
else
return aw.comma(dmgmag)
end
end
local metadata = {
local metadata = {
tableutil.RankCell.new('', 'dmgmag', true),
tableutil.RankCell.new('', 'bodyDmgmag', true),
tableutil.AmmoCell.new('', 'ammoicon', {
tableutil.AmmoCell.new('', 'ammoicon', {
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', {
280行目: 349行目:
ammoIndex      = 'ammo',
ammoIndex      = 'ammo',
attributes    = { align = 'left' },
attributes    = { align = 'left' },
cellClass      = 'st-dashed-both st-mobile-none-both st-mobile-padding0-both',
cellClass      = 'st-dashed-right st-mobile-none-right st-mobile-padding0-both',
headerColspan  = 0,
headerColspan  = 0,
}),
}),
tableutil.HopupCell.new(res.hopup, 'hopup', {
tableutil.HopupCell.new(res.hopup, 'hopup', {
attributes    = { align = 'left' },
attributes    = { align = 'left' },
cellClass      = 'st-dashed-left st-mobile-none-left st-mobile-padding0-left',
cellClass      = 'st-mobile-padding0-both',
headerColspan  = 0,
headerColspan  = 0,
}),
}),
tableutil.LineValueCell.new(res.dmgmag, 'dmgmag', {
tableutil.ValueCell.new(res.legsshot, 'legsDmgmag', {
cellClass  = 'st-mobile-graph st-mobile-textshadow st-mobile-last',
cellClass  = 'st-desktop',
format      = formatFunction,
footerClass = 'st-desktop',
headerClass = 'st-mobile-graph st-mobile-last',
format      = aw.comma,
headerClass = 'st-desktop',
headerStyle = {
headerStyle = {
['min-width'] = '75px',
['min-width'] = '50px',
['max-width'] = '8em',
['max-width'] = '4em',
},
}),
tableutil.LineValueCell.new(res.bodyshot, 'bodyDmgmag', {
startIndex    = 'legsDmgmag',
endIndex      = 'lvl1Dmgmag',
subStartIndex = 'flLgDmgmag',
subEndIndex  = 'lvl1Dmgmag',
cellClass    = 'st-mobile-graph st-mobile-medium st-mobile-textshadow',
footerClass  = 'st-mobile-axis',
format        = aw.comma,
headerClass  = 'st-mobile-last',
headerStyle  = {
['min-width'] = '50px',
['max-width'] = '4em',
},
},
itemName      = res.normal,
subItemName  = res.fortified,
maximumValue  = 10000,
preferredGridCount = 3,
scale        = scale.LogScale.new():setClamp(true),
ticksFormat = function(val)
return string.format('%sk', 0.001 * val)
end,
}),
}),
tableutil.LineCell.new(res.graph, 'dmgmag', {
tableutil.ValueCell.new(res.headlvl3, 'lvl3Dmgmag', {
cellClass  = 'st-desktop-graph',
cellClass  = 'st-desktop',
headerClass = 'st-desktop-graph',
footerClass = 'st-desktop',
format      = aw.comma,
headerClass = 'st-desktop',
headerStyle = {
headerStyle = {
['min-width'] = '160px',
['min-width'] = '50px',
['max-width'] = '4em',
},
}),
tableutil.ValueCell.new(res.headlvl2, 'lvl2Dmgmag', {
cellClass  = 'st-desktop',
footerClass = 'st-desktop',
format      = aw.comma,
headerClass = 'st-desktop',
headerStyle = {
['min-width'] = '50px',
['max-width'] = '4em',
},
}),
tableutil.ValueCell.new(res.headlvl1, 'lvl1Dmgmag', {
cellClass  = 'st-mobile-last',
footerClass = 'st-mobile-last',
format      = aw.comma,
headerClass = 'st-mobile-last',
headerStyle = {
['min-width'] = '50px',
['max-width'] = '4em',
},
}),
tableutil.LineCell.new(res.graph, 'bodyDmgmag', {
startIndex    = 'legsDmgmag',
endIndex      = 'lvl1Dmgmag',
subStartIndex = 'flLgDmgmag',
subEndIndex  = 'lvl1Dmgmag',
cellClass    = 'st-desktop st-desktop-graph',
footerClass  = 'st-desktop',
headerClass  = 'st-desktop',
headerStyle  = {
['min-width'] = '200px',
},
},
hoverEnabled  = true,
hoverFormat  = aw.comma,
itemName      = res.normal,
subItemName  = res.fortified,
maximumValue  = 10000,
scale        = scale.LogScale.new():setClamp(true),
}),
}),
}
}
315行目: 448行目:
args = getArgs(frame)
args = getArgs(frame)
return p._main(args)
return p._main(args, false)
end
end


return p
return p

2022年8月10日 (水) 13:56時点における最新版

このモジュールについての説明文ページを モジュール:StatTable/DamagePerMagazine/doc に作成できます

local aw            = require('Module:Utility/Library')
local apex          = require('Module:Utility/ApexLibrary')
local iu            = require('Module:Utility/Image')
local scale         = require('Module:Utility/Scale')
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 function _addDataPrivate(dataset, data, fn, mul)
	local head = data.head
	local lvl1 = apex.calcHeadshotMultiplier(head, apex.HEAD_HLMLV1)
	local lvl2 = apex.calcHeadshotMultiplier(head, apex.HEAD_HLMLV2)
	local lvl3 = apex.calcHeadshotMultiplier(head, apex.HEAD_HLMLV3)
	local legs = data.legs
	data.bodyDmgmag = fn(data.damage, 1, 1)                               * mul
	data.headDmgmag = fn(apex.calcPartDamage(data.damage, head), head, 1) * mul
	data.lvl1Dmgmag = fn(apex.calcPartDamage(data.damage, lvl1), lvl1, 1) * mul
	data.lvl2Dmgmag = fn(apex.calcPartDamage(data.damage, lvl2), lvl2, 1) * mul
	data.lvl3Dmgmag = fn(apex.calcPartDamage(data.damage, lvl3), lvl3, 1) * mul
	data.legsDmgmag = fn(apex.calcPartDamage(data.damage, legs), legs, 1) * mul
	data.flLgDmgmag = fn(apex.calcDamageFromPartAndPassive(data.damage, legs, 0.85), legs, 0.85) * mul
	table.insert(dataset, data)
end

local function addData(dataset, data, special, fn)
	fn = fn or function(val) return val end
	
	local magazinesType  = type(data.magazines)
	
	-- 拡張マガジンがつく場合
	if magazinesType == 'table' then
		if special then
			local mul = data.pellets * math.floor(data.magazines[4] / data.ammopershot)
			_addDataPrivate(dataset, data, fn, mul)
		else
			for level, magazine in ipairs(data.magazines) do
				local data2 = aw.shallowCopy(data)
				local mul   = data.pellets * math.floor(magazine / data.ammopershot)
				data2.level = level - 1
				_addDataPrivate(dataset, data2, fn, mul)
			end
		end
	
	-- 拡張マガジンがつかない場合
	elseif magazinesType == 'number' then
		local mul = data.pellets * math.floor(data.magazines / data.ammopershot)
		_addDataPrivate(dataset, data, fn, mul)
	end
end

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 special     = aw.stringstarts(stat.ammo, 'special_')
		local baseDamage  = stat.damage.base
		local baseData = {
			ammo        = stat.ammo,
			ammoicon    = stat.ammo,
			ammopershot = stat.ammo_per_shot or 1,
			damage      = baseDamage,
			head        = stat.damage_head_scale,
			legs        = stat.damage_legs_scale,
			level       = -1,
			magazines   = stat.magazine,
			name        = name,
			pellets     = stat.pellet or 1,
			shortname   = stat.localization['Japanese_Short'],
		}
		
		-- Mag is inf
		if stat.magazine == math.huge then
			-- Bocek Compound Bow
			if stat.ammo == 'arrows' or stat.ammo == 'special_arrows' then
				if special then
					baseData.magazines = stat.magazine_reserve
				else
					local ammoStats = mw.loadData('Module:Stat/Ammo')
					local gearStats = mw.loadData('Module:Stat/Gear')
					local virtualMagazines = {
						gearStats.backpack.level0.limit * ammoStats.arrows.slot,
						gearStats.backpack.level1.limit * ammoStats.arrows.slot,
						gearStats.backpack.level2.limit * ammoStats.arrows.slot,
						gearStats.backpack.level3.limit * ammoStats.arrows.slot,
					}
					baseData.magazines = virtualMagazines
				end
				
				-- Chargefire
				if aw.isNumberAndGreaterThanX(stat.damage.charged, baseDamage) then
					baseData.option = res.mincharge
					addData(dataset, baseData, special)
					
					local maxChargeData  = aw.shallowCopy(baseData)
					maxChargeData.damage = stat.damage.charged
					maxChargeData.option = res.maxcharge
					addData(dataset, maxChargeData, special)
				
				-- チャージなし
				else
					addData(dataset, baseData, special)
				end
				
				-- Shatter Caps
				if (__debug or Hopup.shatter_caps.enabled) and type(stat.shatter_caps) == 'table' and aw.isNumberAndGreaterThanX(stat.shatter_caps.damage.base, 1) and aw.isNumberAndGreaterThanX(stat.shatter_caps.pellet, 1) then
					local shatterCapsData    = aw.shallowCopy(baseData)
					shatterCapsData.damage   = stat.shatter_caps.damage.base
					if stat.shatter_caps.damage_head_scale then
						shatterCapsData.head = stat.shatter_caps.damage_head_scale
					end
					shatterCapsData.hopup    = { 'shatter_caps' }
					if stat.shatter_caps.damage_legs_scale then
						shatterCapsData.legs = stat.shatter_caps.damage_legs_scale
					end
					shatterCapsData.pellets  = stat.shatter_caps.pellet
						
					if aw.isNumberAndGreaterThanX(stat.shatter_caps.damage.charged, stat.shatter_caps.damage.base) then
						shatterCapsData.option = res.mincharge
						addData(dataset, shatterCapsData, special)
							
						local shatterCapsMaxChargeData    = aw.shallowCopy(shatterCapsData)
						shatterCapsMaxChargeData.damage   = stat.shatter_caps.damage.charged
						if stat.shatter_caps.damage.headshot_charged then
							shatterCapsMaxChargeData.head = stat.shatter_caps.damage.headshot_charged
						end
						if stat.shatter_caps.damage.legshot_charged then
							shatterCapsMaxChargeData.legs = stat.shatter_caps.damage.legshot_charged
						end
						shatterCapsMaxChargeData.option   = res.maxcharge
						addData(dataset, shatterCapsMaxChargeData, special)
					else
						addData(dataset, shatterCapsData, special)
					end
				end
			
			-- L-STAR EMG
			elseif aw.isNumberAndGreaterThanZero(stat.firerate) then
				local overheatType = type(stat.overheat)
				if overheatType == 'table' then
					local virtualMagazines = {
						math.ceil(stat.overheat[1] * stat.firerate),
						math.ceil(stat.overheat[2] * stat.firerate),
						math.ceil(stat.overheat[3] * stat.firerate),
						math.ceil(stat.overheat[4] * stat.firerate),
					}
					baseData.magazines = virtualMagazines
					addData(dataset, baseData, special)
					
					-- Modded Loader
					if stat.category == 'light_machine_gun' then
						local moddedLoaderVirtualMagazines = {
							math.ceil(1.15 * stat.overheat[1] * stat.firerate),
							math.ceil(1.15 * stat.overheat[2] * stat.firerate),
							math.ceil(1.15 * stat.overheat[3] * stat.firerate),
							math.ceil(1.15 * stat.overheat[4] * stat.firerate),
						}
						local moddedLoaderData = aw.shallowCopy(baseData)
						moddedLoaderData.hopup = { 'modded_loader' }
						moddedLoaderData.magazines = moddedLoaderVirtualMagazines
						addData(dataset, moddedLoaderData, special)
					end
				elseif overheatType == 'number' then
					baseData.magazines = math.ceil(stat.overheat * stat.firerate)
					addData(dataset, baseData, special)
					
					-- Modded Loader
					if stat.category == 'light_machine_gun' then
						local moddedLoaderData     = aw.shallowCopy(baseData)
						moddedLoaderData.hopup     = { 'modded_loader' }
						moddedLoaderData.magazines = math.ceil(stat.overheat * stat.firerate)
						addData(dataset, moddedLoaderData, special)
					end
				end
			end
		
		-- Charge Rifle
		elseif stat.damage.beam then
			addData(dataset, baseData, special, function(val, part, passive)
				return val + apex.calcDamageFromPartAndPassive(stat.damage.beam.base, part, passive) * stat.damage.beam.ticks
			end)
		
		-- Other
		else
			-- Chargefire
			if aw.isNumberAndGreaterThanX(stat.damage.charged, baseDamage) then
				baseData.option = res.nocharge
				addData(dataset, baseData, special)
				
				local maxChargeData    = aw.shallowCopy(baseData)
				maxChargeData.damage   = stat.damage.charged
				if stat.damage.headshot_charged then
					maxChargeData.head = stat.damage.headshot_charged
				end
				if stat.damage.legshot_charged then
					maxChargeData.legs = stat.damage.legshot_charged
				end
				maxChargeData.option = res.maxcharge
				addData(dataset, maxChargeData, special)
			
			-- チャージが無効の場合の通常出力
			else
				addData(dataset, baseData, special)
			end
			
			-- Modded Loader
			if stat.category == 'light_machine_gun' or stat.ammo == 'minigun' then
				local moddedLoaderData     = aw.shallowCopy(baseData)
				moddedLoaderData.hopup     = { 'modded_loader' }
				moddedLoaderData.magazines = apex.getMagazineWithModdedLoader(stat.magazine)
				addData(dataset, moddedLoaderData, special)
			end
			
			-- Amped mode
			if aw.isNumberAndGreaterThanX(stat.damage.amped, baseDamage) then
				local ampedData    = aw.shallowCopy(baseData)
				ampedData.ammoicon = ampedData.ammo .. '_amped'
				ampedData.damage   = stat.damage.amped
				ampedData.option   = res.amped
				addData(dataset, ampedData, special)
			end
			
			-- Selectfire Receiver (HAVOC Rifle)
			if (__debug or Hopup.selectfire_receiver.enabled) and type(stat.selectfire_receiver) == 'table' and stat.selectfire_receiver.damage and aw.isNumberAndGreaterThanX(stat.selectfire_receiver.damage.base, baseDamage) then
				local selectfireReceiverData = aw.shallowCopy(baseData)
				if stat.selectfire_receiver.ammo_per_shot then
					selectfireReceiverData.ammopershot = stat.selectfire_receiver.ammo_per_shot
				end
				selectfireReceiverData.damage = stat.selectfire_receiver.damage.base
				if stat.selectfire_receiver.damage_head_scale then
					selectfireReceiverData.head = stat.selectfire_receiver.damage_head_scale
				end
				selectfireReceiverData.hopup = { 'selectfire_receiver' }
				if stat.selectfire_receiver.damage_legs_scale then
					selectfireReceiverData.legs = stat.selectfire_receiver.damage_legs_scale
				end
				addData(dataset, selectfireReceiverData, special)
			end
			
			-- Skullpiercer Rifling 
			if (__debug or Hopup.skullpiercer_rifling.enabled) and type(stat.skullpiercer_rifling) == 'table' and aw.isNumberAndGreaterThanX(stat.skullpiercer_rifling.damage_head_scale, 1) then
				local skullpiercerRiflingData = aw.shallowCopy(baseData)
				skullpiercerRiflingData.head = stat.skullpiercer_rifling.damage_head_scale
				skullpiercerRiflingData.hopup = { 'skullpiercer_rifling' }
				addData(dataset, skullpiercerRiflingData, special)
			end
			
			-- Hammerpoint Rounds
			if (__debug or Hopup.hammerpoint_rounds.enabled) and type(stat.hammerpoint_rounds) == 'table' and aw.isNumberAndGreaterThanX(stat.hammerpoint_rounds.damage_unshielded_scale, 1) then
				local hammerpointRoundsData  = aw.shallowCopy(baseData)
				hammerpointRoundsData.damage = math.floor(stat.hammerpoint_rounds.damage_unshielded_scale * baseDamage)
				hammerpointRoundsData.hopup  = { 'hammerpoint_rounds' }
				addData(dataset, hammerpointRoundsData, special)
			end
			
			-- Disruptor Rounds
			if (__debug or Hopup.disruptor_rounds.enabled or special) and type(stat.disruptor_rounds) == 'table' and aw.isNumberAndGreaterThanX(stat.disruptor_rounds.damage_shield_scale, 1) then
				local disruptorRoundsData = aw.shallowCopy(baseData)
				disruptorRoundsData.hopup = { 'disruptor_rounds' }
				addData(dataset, disruptorRoundsData, special, function(val)
					return apex.calcDisruptorDamage(val, stat.disruptor_rounds.damage_shield_scale)
				end)
			end
			
			-- Anvil Receiver
			if (__debug or Hopup.anvil_receiver.enabled) and type(stat.anvil_receiver) == 'table' and aw.isNumberAndGreaterThanX(stat.anvil_receiver.damage.base, baseDamage) then
				local anvilReceiverData       = aw.shallowCopy(baseData)
				anvilReceiverData.ammopershot = stat.anvil_receiver.ammo_per_shot or 2
				anvilReceiverData.damage      = stat.anvil_receiver.damage.base
				if stat.anvil_receiver.damage_head_scale then
					anvilReceiverData.head    = stat.anvil_receiver.damage_head_scale
				end
				anvilReceiverData.hopup       = { 'anvil_receiver' }
				if stat.anvil_receiver.damage_legs_scale then
					anvilReceiverData.legs    = stat.anvil_receiver.damage_legs_scale
				end
				addData(dataset, anvilReceiverData, special)
			end
				
			-- Shatter Caps
			if (__debug or Hopup.shatter_caps.enabled) and type(stat.shatter_caps) == 'table' and aw.isNumberAndGreaterThanX(stat.shatter_caps.damage.base, 1) and aw.isNumberAndGreaterThanX(stat.shatter_caps.pellet, 1) then
				local shatterCapsData    = aw.shallowCopy(baseData)
				shatterCapsData.damage   = stat.shatter_caps.damage.base
				if stat.shatter_caps.damage_head_scale then
					shatterCapsData.head = stat.shatter_caps.damage_head_scale
				end
				shatterCapsData.hopup    = { 'shatter_caps' }
				if stat.shatter_caps.damage_legs_scale then
					shatterCapsData.legs = stat.shatter_caps.damage_legs_scale
				end
				shatterCapsData.pellets  = stat.shatter_caps.pellet
					
				if aw.isNumberAndGreaterThanX(stat.shatter_caps.damage.charged, stat.shatter_caps.damage.base) then
					shatterCapsData.option = res.nocharge
					addData(dataset, shatterCapsData, special)
						
					local shatterCapsMaxChargeData    = aw.shallowCopy(shatterCapsData)
					shatterCapsMaxChargeData.damage   = stat.shatter_caps.damage.charged
					if stat.shatter_caps.damage.headshot_charged then
						shatterCapsMaxChargeData.head = stat.shatter_caps.damage.headshot_charged
					end
					if stat.shatter_caps.damage.legshot_charged then
						shatterCapsMaxChargeData.legs = stat.shatter_caps.damage.legshot_charged
					end
					shatterCapsMaxChargeData.option   = res.maxcharge
					addData(dataset, shatterCapsMaxChargeData, special)
				else
					addData(dataset, shatterCapsData, special)
				end
			end
				
			-- Boosted Loader
			if (__debug or Hopup.boosted_loader.enabled) and type(stat.boosted_loader) == 'table' then
				local boostedLoaderData     = aw.shallowCopy(baseData)
				boostedLoaderData.hopup     = { 'boosted_loader' }
				boostedLoaderData.magazines = stat.boosted_loader.magazine
				addData(dataset, boostedLoaderData, special)
			end
		end
	end
	
	local metadata = {
		tableutil.RankCell.new('', 'bodyDmgmag', true),
		tableutil.AmmoCell.new('', 'ammoicon', {
			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  = 3,
			optionIndex    = 'option',
			shortnameIndex = 'shortname',
		}),
		tableutil.MagazineCell.new(res.mag, 'level', {
			ammoIndex      = 'ammo',
			attributes     = { align = 'left' },
			cellClass      = 'st-dashed-right st-mobile-none-right st-mobile-padding0-both',
			headerColspan  = 0,
		}),
		tableutil.HopupCell.new(res.hopup, 'hopup', {
			attributes     = { align = 'left' },
			cellClass      = 'st-mobile-padding0-both',
			headerColspan  = 0,
		}),
		tableutil.ValueCell.new(res.legsshot, 'legsDmgmag', {
			cellClass   = 'st-desktop',
			footerClass = 'st-desktop',
			format      = aw.comma,
			headerClass = 'st-desktop',
			headerStyle = {
				['min-width'] = '50px',
				['max-width'] = '4em',
			},
		}),
		tableutil.LineValueCell.new(res.bodyshot, 'bodyDmgmag', {
			startIndex    = 'legsDmgmag',
			endIndex      = 'lvl1Dmgmag',
			subStartIndex = 'flLgDmgmag',
			subEndIndex   = 'lvl1Dmgmag',
			cellClass     = 'st-mobile-graph st-mobile-medium st-mobile-textshadow',
			footerClass   = 'st-mobile-axis',
			format        = aw.comma,
			headerClass   = 'st-mobile-last',
			headerStyle   = {
				['min-width'] = '50px',
				['max-width'] = '4em',
			},
			itemName      = res.normal,
			subItemName   = res.fortified,
			maximumValue  = 10000,
			preferredGridCount = 3,
			scale         = scale.LogScale.new():setClamp(true),
			ticksFormat = function(val)
				return string.format('%sk', 0.001 * val)
			end,
		}),
		tableutil.ValueCell.new(res.headlvl3, 'lvl3Dmgmag', {
			cellClass   = 'st-desktop',
			footerClass = 'st-desktop',
			format      = aw.comma,
			headerClass = 'st-desktop',
			headerStyle = {
				['min-width'] = '50px',
				['max-width'] = '4em',
			},
		}),
		tableutil.ValueCell.new(res.headlvl2, 'lvl2Dmgmag', {
			cellClass   = 'st-desktop',
			footerClass = 'st-desktop',
			format      = aw.comma,
			headerClass = 'st-desktop',
			headerStyle = {
				['min-width'] = '50px',
				['max-width'] = '4em',
			},
		}),
		tableutil.ValueCell.new(res.headlvl1, 'lvl1Dmgmag', {
			cellClass   = 'st-mobile-last',
			footerClass = 'st-mobile-last',
			format      = aw.comma,
			headerClass = 'st-mobile-last',
			headerStyle = {
				['min-width'] = '50px',
				['max-width'] = '4em',
			},
		}),
		tableutil.LineCell.new(res.graph, 'bodyDmgmag', {
			startIndex    = 'legsDmgmag',
			endIndex      = 'lvl1Dmgmag',
			subStartIndex = 'flLgDmgmag',
			subEndIndex   = 'lvl1Dmgmag',
			cellClass     = 'st-desktop st-desktop-graph',
			footerClass   = 'st-desktop',
			headerClass   = 'st-desktop',
			headerStyle   = {
				['min-width'] = '200px',
			},
			hoverEnabled  = true,
			hoverFormat   = aw.comma,
			itemName      = res.normal,
			subItemName   = res.fortified,
			maximumValue  = 10000,
			scale         = scale.LogScale.new():setClamp(true),
		}),
	}
	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