| 🌟 | 現在、 鉄壁HSは通常HSと同じダメージになります。LMG及びDMR、チャージライフル、ハンマーポイント弾を除き、すべてのダメージ値が一致していることを確認しています。 |
「モジュール:StatTable/DamagePerMagazine」の版間の差分
ナビゲーションに移動
検索に移動
(ボセックコンパウンドボウのシャッターキャップに対応) |
(マガジンのデータ取り扱いの改善) |
||
| 50行目: | 50行目: | ||
end | end | ||
local function addData(dataset, data | local function addData(dataset, data, special, fn) | ||
fn = fn or function(val) return val end | fn = fn or function(val) return val end | ||
local magazinesType = type(magazines) | local magazinesType = type(data.magazines) | ||
-- 拡張マガジンがつく場合 | -- 拡張マガジンがつく場合 | ||
if magazinesType == 'table' then | if magazinesType == 'table' then | ||
if special then | if special then | ||
local mul = data.pellets * math.floor(magazines[4] / data.ammopershot) | local mul = data.pellets * math.floor(data.magazines[4] / data.ammopershot) | ||
_addDataPrivate(dataset, data, fn, mul) | _addDataPrivate(dataset, data, fn, mul) | ||
else | else | ||
for level, magazine in ipairs(magazines) do | for level, magazine in ipairs(data.magazines) do | ||
local data2 = aw.shallowCopy(data) | local data2 = aw.shallowCopy(data) | ||
local mul = data.pellets * math.floor(magazine / data.ammopershot) | local mul = data.pellets * math.floor(magazine / data.ammopershot) | ||
| 71行目: | 71行目: | ||
-- 拡張マガジンがつかない場合 | -- 拡張マガジンがつかない場合 | ||
elseif magazinesType == 'number' then | elseif magazinesType == 'number' then | ||
local mul = data.pellets * math.floor(magazines / data.ammopershot) | local mul = data.pellets * math.floor(data.magazines / data.ammopershot) | ||
_addDataPrivate(dataset, data, fn, mul) | _addDataPrivate(dataset, data, fn, mul) | ||
end | end | ||
| 99行目: | 99行目: | ||
legs = stat.damage.legshot, | legs = stat.damage.legshot, | ||
level = -1, | level = -1, | ||
magazines = stat.magazine, | |||
name = name, | name = name, | ||
pellets = stat.pellet or 1, | pellets = stat.pellet or 1, | ||
| 116行目: | 117行目: | ||
gearStats.backpack.level3.limit * ammoStats.arrows.slot, | gearStats.backpack.level3.limit * ammoStats.arrows.slot, | ||
} | } | ||
baseData.magazines = virtualMagazines | |||
-- Chargefire | -- Chargefire | ||
if aw.isNumberAndGreaterThanX(stat.damage.charged, baseDamage) then | if aw.isNumberAndGreaterThanX(stat.damage.charged, baseDamage) then | ||
baseData.option = res.mincharge | baseData.option = res.mincharge | ||
addData(dataset, baseData | addData(dataset, baseData, special) | ||
local maxChargeData = aw.shallowCopy(baseData) | local maxChargeData = aw.shallowCopy(baseData) | ||
maxChargeData.damage = stat.damage.charged | maxChargeData.damage = stat.damage.charged | ||
maxChargeData.option = res.maxcharge | maxChargeData.option = res.maxcharge | ||
addData(dataset, maxChargeData | addData(dataset, maxChargeData, special) | ||
-- チャージなし | -- チャージなし | ||
else | else | ||
addData(dataset, baseData | addData(dataset, baseData, special) | ||
end | end | ||
| 143行目: | 145行目: | ||
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 | ||
shatterCapsData.option = res.mincharge | shatterCapsData.option = res.mincharge | ||
addData(dataset, shatterCapsData | addData(dataset, shatterCapsData, special) | ||
local shatterCapsMaxChargeData = aw.shallowCopy(shatterCapsData) | local shatterCapsMaxChargeData = aw.shallowCopy(shatterCapsData) | ||
| 150行目: | 152行目: | ||
shatterCapsMaxChargeData.legs = stat.shatter_caps.damage.legshot_charged or stat.shatter_caps.damage.legshot or stat.damage.legshot | shatterCapsMaxChargeData.legs = stat.shatter_caps.damage.legshot_charged or stat.shatter_caps.damage.legshot or stat.damage.legshot | ||
shatterCapsMaxChargeData.option = res.maxcharge | shatterCapsMaxChargeData.option = res.maxcharge | ||
addData(dataset, shatterCapsMaxChargeData | addData(dataset, shatterCapsMaxChargeData, special) | ||
else | else | ||
addData(dataset, shatterCapsData | addData(dataset, shatterCapsData, special) | ||
end | end | ||
end | end | ||
| 166行目: | 168行目: | ||
math.ceil(stat.overheat[4] * stat.firerate), | math.ceil(stat.overheat[4] * stat.firerate), | ||
} | } | ||
addData(dataset, baseData | baseData.magazines = virtualMagazines | ||
addData(dataset, baseData, special) | |||
-- Modded Loader | -- Modded Loader | ||
| 178行目: | 181行目: | ||
local moddedLoaderData = aw.shallowCopy(baseData) | local moddedLoaderData = aw.shallowCopy(baseData) | ||
moddedLoaderData.hopup = { 'modded_loader' } | moddedLoaderData.hopup = { 'modded_loader' } | ||
addData(dataset, moddedLoaderData | moddedLoaderData.magazines = moddedLoaderVirtualMagazines | ||
addData(dataset, moddedLoaderData, special) | |||
end | end | ||
elseif overheatType == 'number' then | elseif overheatType == 'number' then | ||
baseData.magazines = math.ceil(stat.overheat * stat.firerate) | |||
addData(dataset, baseData | addData(dataset, baseData, special) | ||
-- Modded Loader | -- Modded Loader | ||
if stat.category == 'light_machine_gun' then | if stat.category == 'light_machine_gun' then | ||
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 | addData(dataset, moddedLoaderData, special) | ||
end | end | ||
end | end | ||
| 196行目: | 200行目: | ||
-- Charge Rifle | -- Charge Rifle | ||
elseif stat.damage.beam then | elseif stat.damage.beam then | ||
addData(dataset, baseData | addData(dataset, baseData, special, function(val, mul) | ||
return val + apex.calcPartDamage(stat.damage.beam.base, mul) * stat.damage.beam.ticks | return val + apex.calcPartDamage(stat.damage.beam.base, mul) * stat.damage.beam.ticks | ||
end) | end) | ||
| 205行目: | 209行目: | ||
if aw.isNumberAndGreaterThanX(stat.damage.charged, baseDamage) then | if aw.isNumberAndGreaterThanX(stat.damage.charged, baseDamage) then | ||
baseData.option = res.mincharge | baseData.option = res.mincharge | ||
addData(dataset, baseData | addData(dataset, baseData, special) | ||
local maxChargeData = aw.shallowCopy(baseData) | local maxChargeData = aw.shallowCopy(baseData) | ||
| 212行目: | 216行目: | ||
maxChargeData.legs = stat.damage.legshot_charged or stat.damage.legshot | maxChargeData.legs = stat.damage.legshot_charged or stat.damage.legshot | ||
maxChargeData.option = res.maxcharge | maxChargeData.option = res.maxcharge | ||
addData(dataset, maxChargeData | addData(dataset, maxChargeData, special) | ||
-- チャージが無効の場合の通常出力 | -- チャージが無効の場合の通常出力 | ||
else | else | ||
addData(dataset, baseData | addData(dataset, baseData, special) | ||
end | end | ||
| 232行目: | 236行目: | ||
aw.round(1.15 * stat.magazine[4]), | aw.round(1.15 * stat.magazine[4]), | ||
} | } | ||
addData(dataset, moddedLoaderData | moddedLoaderData.magazines = moddedLoaderMagazines | ||
addData(dataset, moddedLoaderData, special) | |||
elseif magazinesType == 'number' then | elseif magazinesType == 'number' then | ||
moddedLoaderData.magazines = aw.round(1.15 * stat.magazine) | |||
addData(dataset, moddedLoaderData | addData(dataset, moddedLoaderData, special) | ||
end | end | ||
end | end | ||
| 245行目: | 250行目: | ||
ampedData.damage = stat.damage.amped | ampedData.damage = stat.damage.amped | ||
ampedData.option = iu.item('シールドセル') .. '<span class="text-desktoponly"> 増幅モード</span>' | ampedData.option = iu.item('シールドセル') .. '<span class="text-desktoponly"> 増幅モード</span>' | ||
addData(dataset, ampedData | addData(dataset, ampedData, special) | ||
end | end | ||
| 256行目: | 261行目: | ||
selectfireReceiverData.hopup = { 'selectfire_receiver' } | selectfireReceiverData.hopup = { 'selectfire_receiver' } | ||
selectfireReceiverData.legs = stat.selectfire_receiver.damage.legshot or stat.damage.legshot | selectfireReceiverData.legs = stat.selectfire_receiver.damage.legshot or stat.damage.legshot | ||
addData(dataset, selectfireReceiverData | addData(dataset, selectfireReceiverData, special) | ||
end | end | ||
| 264行目: | 269行目: | ||
hammerpointRoundsData.damage = math.floor(stat.damage.hammerpoint_rounds * baseDamage) | hammerpointRoundsData.damage = math.floor(stat.damage.hammerpoint_rounds * baseDamage) | ||
hammerpointRoundsData.hopup = { 'hammerpoint_rounds' } | hammerpointRoundsData.hopup = { 'hammerpoint_rounds' } | ||
addData(dataset, hammerpointRoundsData | addData(dataset, hammerpointRoundsData, special) | ||
end | end | ||
| 271行目: | 276行目: | ||
local disruptorRoundsData = aw.shallowCopy(baseData) | local disruptorRoundsData = aw.shallowCopy(baseData) | ||
disruptorRoundsData.hopup = { 'disruptor_rounds' } | disruptorRoundsData.hopup = { 'disruptor_rounds' } | ||
addData(dataset, disruptorRoundsData | addData(dataset, disruptorRoundsData, special, function(val) | ||
return apex.calcDisruptorDamage(val, stat.damage.disruptor_rounds) | return apex.calcDisruptorDamage(val, stat.damage.disruptor_rounds) | ||
end) | end) | ||
| 284行目: | 289行目: | ||
anvilReceiverData.hopup = { 'anvil_receiver' } | anvilReceiverData.hopup = { 'anvil_receiver' } | ||
anvilReceiverData.legs = stat.anvil_receiver.damage.legshot or stat.damage.legshot | anvilReceiverData.legs = stat.anvil_receiver.damage.legshot or stat.damage.legshot | ||
addData(dataset, anvilReceiverData | addData(dataset, anvilReceiverData, special) | ||
end | end | ||
| 298行目: | 303行目: | ||
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 | ||
shatterCapsData.option = res.mincharge | shatterCapsData.option = res.mincharge | ||
addData(dataset, shatterCapsData | addData(dataset, shatterCapsData, special) | ||
local shatterCapsMaxChargeData = aw.shallowCopy(shatterCapsData) | local shatterCapsMaxChargeData = aw.shallowCopy(shatterCapsData) | ||
| 305行目: | 310行目: | ||
shatterCapsMaxChargeData.legs = stat.shatter_caps.damage.legshot_charged or stat.shatter_caps.damage.legshot or stat.damage.legshot | shatterCapsMaxChargeData.legs = stat.shatter_caps.damage.legshot_charged or stat.shatter_caps.damage.legshot or stat.damage.legshot | ||
shatterCapsMaxChargeData.option = res.maxcharge | shatterCapsMaxChargeData.option = res.maxcharge | ||
addData(dataset, shatterCapsMaxChargeData | addData(dataset, shatterCapsMaxChargeData, special) | ||
else | else | ||
addData(dataset, shatterCapsData | addData(dataset, shatterCapsData, special) | ||
end | end | ||
end | end | ||
| 313行目: | 318行目: | ||
-- Boosted Loader | -- Boosted Loader | ||
if (__debug or Hopup.boosted_loader.enabled) and type(stat.boosted_loader) == 'table' 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' } | ||
boostedLoaderData.magazines = stat.boosted_loader.magazine | |||
addData(dataset, boostedLoaderData, special) | |||
end | end | ||
end | end | ||
2021年8月26日 (木) 15:55時点における版
このモジュールについての説明文ページを モジュール:StatTable/DamagePerMagazine/doc に作成できます
local aw = require('Module:Utility/Library')
local apex = require('Module:Utility/ApexLibrary')
local iu = require('Module:Utility/Image')
local tableutil = require('Module:Utility/TableUtil/Apex')
local Hopup = mw.loadData('Module:Stat/Hopup')
local getArgs -- lazily initialized
local configuration = {
en = {
bodyshot = 'Body',
graph = 'Graph',
headshot = 'Head',
headlvl1 = iu.gear('ヘルメット', 1),
headlvl2 = iu.gear('ヘルメット', 2),
headlvl3 = iu.gear('ヘルメット', 3),
legsshot = 'Legs',
infinity = '∞',
maxcharge = 'Max charge',
mincharge = 'Min charge',
weaponname = 'Weapon name',
},
ja = {
bodyshot = '胴',
graph = 'グラフ',
headshot = '頭',
headlvl1 = iu.gear('ヘルメット', 1),
headlvl2 = iu.gear('ヘルメット', 2),
headlvl3 = iu.gear('ヘルメット', 3),
legsshot = '脚',
infinity = '∞',
maxcharge = '最大溜め',
mincharge = '最小溜め',
weaponname = '武器名',
},
}
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) * mul
data.headDmgmag = fn(apex.calcPartDamage(data.damage, head), head) * mul
data.lvl1Dmgmag = fn(apex.calcPartDamage(data.damage, lvl1), lvl1) * mul
data.lvl2Dmgmag = fn(apex.calcPartDamage(data.damage, lvl2), lvl2) * mul
data.lvl3Dmgmag = fn(apex.calcPartDamage(data.damage, lvl3), lvl3) * mul
data.legsDmgmag = fn(apex.calcPartDamage(data.damage, legs), legs) * 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.headshot,
legs = stat.damage.legshot,
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' then
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
-- 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
shatterCapsData.head = stat.shatter_caps.damage.headshot or stat.damage.headshot
shatterCapsData.hopup = { 'shatter_caps' }
shatterCapsData.legs = stat.shatter_caps.damage.legshot or stat.damage.legshot
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
shatterCapsMaxChargeData.head = stat.shatter_caps.damage.headshot_charged or stat.shatter_caps.damage.headshot or stat.damage.headshot
shatterCapsMaxChargeData.legs = stat.shatter_caps.damage.legshot_charged or stat.shatter_caps.damage.legshot or stat.damage.legshot
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, mul)
return val + apex.calcPartDamage(stat.damage.beam.base, mul) * stat.damage.beam.ticks
end)
-- Other
else
-- 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.head = stat.damage.headshot_charged or stat.damage.headshot
maxChargeData.legs = stat.damage.legshot_charged or stat.damage.legshot
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' }
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]),
}
moddedLoaderData.magazines = moddedLoaderMagazines
addData(dataset, moddedLoaderData, special)
elseif magazinesType == 'number' then
moddedLoaderData.magazines = aw.round(1.15 * stat.magazine)
addData(dataset, moddedLoaderData, special)
end
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 = iu.item('シールドセル') .. '<span class="text-desktoponly"> 増幅モード</span>'
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)
selectfireReceiverData.ammopershot = stat.selectfire_receiver.ammo_per_shot or 1
selectfireReceiverData.damage = stat.selectfire_receiver.damage.base
selectfireReceiverData.head = stat.selectfire_receiver.damage.headshot or stat.damage.headshot
selectfireReceiverData.hopup = { 'selectfire_receiver' }
selectfireReceiverData.legs = stat.selectfire_receiver.damage.legshot or stat.damage.legshot
addData(dataset, selectfireReceiverData, special)
end
-- Hammerpoint Rounds
if (__debug or Hopup.hammerpoint_rounds.enabled) and aw.isNumberAndGreaterThanX(stat.damage.hammerpoint_rounds, 1) then
local hammerpointRoundsData = aw.shallowCopy(baseData)
hammerpointRoundsData.damage = math.floor(stat.damage.hammerpoint_rounds * baseDamage)
hammerpointRoundsData.hopup = { 'hammerpoint_rounds' }
addData(dataset, hammerpointRoundsData, special)
end
-- Disruptor Rounds
if (__debug or Hopup.disruptor_rounds.enabled or special) and aw.isNumberAndGreaterThanX(stat.damage.disruptor_rounds, 1) then
local disruptorRoundsData = aw.shallowCopy(baseData)
disruptorRoundsData.hopup = { 'disruptor_rounds' }
addData(dataset, disruptorRoundsData, special, function(val)
return apex.calcDisruptorDamage(val, stat.damage.disruptor_rounds)
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
anvilReceiverData.head = stat.anvil_receiver.damage.headshot or stat.damage.headshot
anvilReceiverData.hopup = { 'anvil_receiver' }
anvilReceiverData.legs = stat.anvil_receiver.damage.legshot or stat.damage.legshot
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
shatterCapsData.head = stat.shatter_caps.damage.headshot or stat.damage.headshot
shatterCapsData.hopup = { 'shatter_caps' }
shatterCapsData.legs = stat.shatter_caps.damage.legshot or stat.damage.legshot
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
shatterCapsMaxChargeData.head = stat.shatter_caps.damage.headshot_charged or stat.shatter_caps.damage.headshot or stat.damage.headshot
shatterCapsMaxChargeData.legs = stat.shatter_caps.damage.legshot_charged or stat.shatter_caps.damage.legshot or stat.damage.legshot
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-both st-mobile-none-both st-mobile-padding0-both',
headerColspan = 0,
}),
tableutil.HopupCell.new(res.hopup, 'hopup', {
attributes = { align = 'left' },
cellClass = 'st-dashed-left st-mobile-none-left 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'] = '40px',
['max-width'] = '4em',
},
}),
tableutil.LineValueCell.new(res.bodyshot, 'bodyDmgmag', {
startIndex = 'legsDmgmag',
endIndex = 'lvl1Dmgmag',
cellClass = 'st-mobile-graph st-mobile-textshadow',
footerClass = 'st-mobile-axis',
format = aw.comma,
headerClass = 'st-mobile-last',
headerStyle = {
['min-width'] = '80px',
['max-width'] = '8em',
},
preferredGridCount = 3,
maximumValue = 2000,
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'] = '40px',
['max-width'] = '4em',
},
}),
tableutil.ValueCell.new(res.headlvl2, 'lvl2Dmgmag', {
cellClass = 'st-desktop',
footerClass = 'st-desktop',
format = aw.comma,
headerClass = 'st-desktop',
headerStyle = {
['min-width'] = '40px',
['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'] = '40px',
['max-width'] = '4em',
},
}),
tableutil.LineCell.new(res.graph, 'bodyDmgmag', {
startIndex = 'legsDmgmag',
endIndex = 'lvl1Dmgmag',
cellClass = 'st-desktop st-desktop-graph',
footerClass = 'st-desktop',
headerClass = 'st-desktop',
headerStyle = {
['min-width'] = '200px',
},
maximumValue = 2500,
}),
}
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