🌟 | 現在、 鉄壁ヘッドショットには対応済みです。 鉄壁HSは通常HSと同じダメージになります。LMG及びDMR、チャージライフル、ハンマーポイント弾を除き、すべてのダメージ値が一致していることを確認しています。 |
「モジュール:StatTable/Damage」の版間の差分
ナビゲーションに移動
検索に移動
(不要なホップアップヘッダーのクラス指定を削除) |
(スカルピアサーライフリングに対応) |
||
(同じ利用者による、間の19版が非表示) | |||
1行目: | 1行目: | ||
local aw | local aw = require('Module:Utility/Library') | ||
local apex | local apex = require('Module:Utility/ApexLibrary') | ||
local iu | local iu = require('Module:Utility/Image') | ||
local tableutil = require('Module:Utility/TableUtil/Apex') | local tableutil = require('Module:Utility/TableUtil/Apex') | ||
local Hopup | local Hopup = mw.loadData('Module:Stat/Hopup') | ||
local configuration = mw.loadData('Module:StatTable/configuration') | |||
local getArgs -- lazily initialized | local getArgs -- lazily initialized | ||
local function addData(dataset, data, fn) | local function addData(dataset, data, fn) | ||
57行目: | 15行目: | ||
local lvl3 = apex.calcHeadshotMultiplier(head, apex.HEAD_HLMLV3) | local lvl3 = apex.calcHeadshotMultiplier(head, apex.HEAD_HLMLV3) | ||
local legs = data.legs | local legs = data.legs | ||
data. | data.bodyDamage = fn(data.damage, 1, 1) * data.pellets | ||
data.headDamage = fn(apex.calcPartDamage(data. | data.headDamage = fn(apex.calcPartDamage(data.damage, head), head, 1) * data.pellets | ||
data.lvl1Damage = fn(apex.calcPartDamage(data. | data.lvl1Damage = fn(apex.calcPartDamage(data.damage, lvl1), lvl1, 1) * data.pellets | ||
data.lvl2Damage = fn(apex.calcPartDamage(data. | data.lvl2Damage = fn(apex.calcPartDamage(data.damage, lvl2), lvl2, 1) * data.pellets | ||
data.lvl3Damage = fn(apex.calcPartDamage(data. | data.lvl3Damage = fn(apex.calcPartDamage(data.damage, lvl3), lvl3, 1) * data.pellets | ||
data.legsDamage = fn(apex.calcPartDamage(data. | data.legsDamage = fn(apex.calcPartDamage(data.damage, legs), legs, 1) * data.pellets | ||
data.flLgDamage = fn(apex.calcDamageFromPartAndPassive(data.damage, legs, 0.85), legs, 0.85) * data.pellets | |||
table.insert(dataset, data) | table.insert(dataset, data) | ||
end | end | ||
82行目: | 41行目: | ||
local baseData = { | local baseData = { | ||
ammo = stat.ammo, | ammo = stat.ammo, | ||
ammoicon = stat.ammo, | |||
head = stat. | damage = stat.damage.base, | ||
legs = stat. | head = stat.damage_head_scale, | ||
legs = stat.damage_legs_scale, | |||
name = name, | name = name, | ||
pellets = stat.pellet or 1, | pellets = stat.pellet or 1, | ||
91行目: | 51行目: | ||
local special = aw.stringstarts(stat.ammo, 'special_') | local special = aw.stringstarts(stat.ammo, 'special_') | ||
-- | -- Charge Rifle | ||
if stat.damage.beam then | if stat.damage.beam then | ||
for t = 0, stat.damage.beam.ticks do | for t = 0, stat.damage.beam.ticks do | ||
local tickData = aw.shallowCopy(baseData) | local tickData = aw.shallowCopy(baseData) | ||
tickData.option = aw.getQuantityString(res.ticks, t) | |||
addData(dataset, tickData, function(val, part, passive) | |||
return val + apex.calcDamageFromPartAndPassive(stat.damage.beam.base, part, passive) * t | |||
addData(dataset, tickData, function(val, | |||
return val + apex. | |||
end) | end) | ||
end | end | ||
108行目: | 64行目: | ||
elseif aw.isNumberAndGreaterThanX(stat.pellet, 1) then | elseif aw.isNumberAndGreaterThanX(stat.pellet, 1) then | ||
for p = 1, stat.pellet do | for p = 1, stat.pellet do | ||
local pelletData = aw.shallowCopy(baseData) | local pelletData = aw.shallowCopy(baseData) | ||
pelletData.option = aw.getQuantityString(res.pellets, p) | |||
pelletData.pellets = p | pelletData.pellets = p | ||
addData(dataset, pelletData) | addData(dataset, pelletData) | ||
-- | -- Hammerpoint Rounds (Mozambique Shotgun) | ||
if (configuration.__debug__enableAllHopup or Hopup.hammerpoint_rounds.enabled) and aw.isNumberAndGreaterThanX(stat. | if (configuration.__debug__enableAllHopup or Hopup.hammerpoint_rounds.enabled) and type(stat.hammerpoint_rounds) == 'table' and aw.isNumberAndGreaterThanX(stat.hammerpoint_rounds.damage_unshielded_scale, 1) then | ||
local pelletUnshieldedData = aw.shallowCopy(pelletData) | local pelletUnshieldedData = aw.shallowCopy(pelletData) | ||
pelletUnshieldedData. | pelletUnshieldedData.damage = math.floor(stat.hammerpoint_rounds.damage_unshielded_scale * baseDamage) | ||
pelletUnshieldedData.hopup = { 'hammerpoint_rounds' } | pelletUnshieldedData.hopup = { 'hammerpoint_rounds' } | ||
addData(dataset, pelletUnshieldedData) | addData(dataset, pelletUnshieldedData) | ||
end | end | ||
end | end | ||
-- | -- Other | ||
else | else | ||
-- | -- Chargefire | ||
if aw.isNumberAndGreaterThanX(stat.damage.charged, baseDamage) then | if aw.isNumberAndGreaterThanX(stat.damage.charged, baseDamage) then | ||
baseData.option = res.mincharge | |||
addData(dataset, baseData) | |||
addData(dataset, | |||
local maxChargeData = aw.shallowCopy(baseData) | local maxChargeData = aw.shallowCopy(baseData) | ||
maxChargeData. | 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) | addData(dataset, maxChargeData) | ||
146行目: | 101行目: | ||
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. | ampedData.ammoicon = stat.ammo .. '_amped' | ||
ampedData. | ampedData.damage = stat.damage.amped | ||
ampedData.option = | ampedData.option = res.amped | ||
addData(dataset, ampedData) | addData(dataset, ampedData) | ||
end | end | ||
-- | -- Selectfire Receiver (HAVOC Rifle) | ||
if (__debug 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.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) | local selectfireReceiverData = aw.shallowCopy(baseData) | ||
selectfireReceiverData. | selectfireReceiverData.damage = stat.selectfire_receiver.damage.base or stat.damage.base | ||
selectfireReceiverData.head | if stat.selectfire_receiver.damage_head_scale then | ||
selectfireReceiverData.head = stat.selectfire_receiver.damage_head_scale | |||
end | |||
selectfireReceiverData.hopup = { 'selectfire_receiver' } | selectfireReceiverData.hopup = { 'selectfire_receiver' } | ||
selectfireReceiverData.legs | if stat.selectfire_receiver.damage_legs_scale then | ||
selectfireReceiverData.legs = stat.selectfire_receiver.damage_legs_scale | |||
end | |||
addData(dataset, selectfireReceiverData) | addData(dataset, selectfireReceiverData) | ||
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) | |||
end | end | ||
-- | -- Hammerpoint Rounds (P2020) | ||
if (__debug or Hopup.hammerpoint_rounds.enabled) and aw.isNumberAndGreaterThanX(stat. | 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. | hammerpointRoundsData.damage = math.floor(stat.hammerpoint_rounds.damage_unshielded_scale * baseDamage) | ||
hammerpointRoundsData.hopup = { 'hammerpoint_rounds' } | hammerpointRoundsData.hopup = { 'hammerpoint_rounds' } | ||
addData(dataset, hammerpointRoundsData) | addData(dataset, hammerpointRoundsData) | ||
end | end | ||
-- | -- Disruptor Rounds | ||
if (__debug or Hopup.disruptor_rounds.enabled or special) and aw.isNumberAndGreaterThanX(stat. | 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.hopup | disruptorRoundsData.hopup = { 'disruptor_rounds' } | ||
addData(dataset, disruptorRoundsData, function(val) | addData(dataset, disruptorRoundsData, function(val) | ||
return apex.calcDisruptorDamage(val, stat. | return apex.calcDisruptorDamage(val, stat.disruptor_rounds.damage_shield_scale) | ||
end) | end) | ||
end | end | ||
-- | -- Anvil Receiver | ||
if (__debug 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. | anvilReceiverData.damage = stat.anvil_receiver.damage.base | ||
anvilReceiverData.head | 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' } | ||
anvilReceiverData.legs | if stat.anvil_receiver.damage_legs_scale then | ||
anvilReceiverData.legs = stat.anvil_receiver.damage_legs_scale | |||
end | |||
addData(dataset, anvilReceiverData) | addData(dataset, anvilReceiverData) | ||
end | end | ||
-- | -- Shatter Caps | ||
if (__debug 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 | ||
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 | ||
for p = 1, stat.shatter_caps.pellet do | for p = 1, stat.shatter_caps.pellet do | ||
local shatterCapsMinChargeData = aw.shallowCopy(baseData) | local shatterCapsMinChargeData = aw.shallowCopy(baseData) | ||
shatterCapsMinChargeData. | shatterCapsMinChargeData.damage = stat.shatter_caps.damage.base | ||
shatterCapsMinChargeData.head | if stat.shatter_caps.damage_head_scale then | ||
shatterCapsMinChargeData.head = stat.shatter_caps.damage_head_scale | |||
end | |||
shatterCapsMinChargeData.hopup = { 'shatter_caps' } | shatterCapsMinChargeData.hopup = { 'shatter_caps' } | ||
if stat.shatter_caps.damage_legs_scale then | |||
shatterCapsMinChargeData.legs = stat.shatter_caps.damage_legs_scale | |||
shatterCapsMinChargeData. | |||
end | end | ||
shatterCapsMinChargeData.option = string.format(res.mixins, res.mincharge, aw.getQuantityString(res.pellets, p)) | |||
shatterCapsMinChargeData.pellets = p | shatterCapsMinChargeData.pellets = p | ||
addData(dataset, shatterCapsMinChargeData) | addData(dataset, shatterCapsMinChargeData) | ||
local shatterCapsMaxChargeData = aw.shallowCopy(shatterCapsMinChargeData) | local shatterCapsMaxChargeData = aw.shallowCopy(shatterCapsMinChargeData) | ||
shatterCapsMaxChargeData. | shatterCapsMaxChargeData.damage = stat.shatter_caps.damage.charged | ||
if stat.shatter_caps.damage.headshot_charged then | |||
shatterCapsMaxChargeData.head = stat.shatter_caps.damage.headshot_charged | |||
end | end | ||
if stat.shatter_caps.damage.legshot_charged then | |||
shatterCapsMaxChargeData.legs = stat.shatter_caps.damage.legshot_charged | |||
end | |||
shatterCapsMaxChargeData.option = string.format(res.mixins, res.maxcharge, aw.getQuantityString(res.pellets, p)) | |||
addData(dataset, shatterCapsMaxChargeData) | addData(dataset, shatterCapsMaxChargeData) | ||
end | end | ||
else | else | ||
for p = 1, stat.shatter_caps.pellet do | for p = 1, stat.shatter_caps.pellet do | ||
local shatterCapsData = aw.shallowCopy(baseData) | local shatterCapsData = aw.shallowCopy(baseData) | ||
shatterCapsData. | shatterCapsData.damage = stat.shatter_caps.damage.base | ||
if stat.shatter_caps.damage_head_scale then | |||
shatterCapsData.head = stat.shatter_caps.damage_head_scale | |||
end | end | ||
shatterCapsData.hopup = { 'shatter_caps' } | |||
if stat.shatter_caps.damage_legs_scale then | |||
shatterCapsData.legs = stat.shatter_caps.damage_legs_scale | |||
end | |||
shatterCapsData.option = aw.getQuantityString(res.pellets, p) | |||
addData(dataset, shatterCapsData) | addData(dataset, shatterCapsData) | ||
end | end | ||
240行目: | 211行目: | ||
local metadata = { | local metadata = { | ||
tableutil.RankCell.new('', ' | tableutil.RankCell.new('', 'bodyDamage', true), | ||
tableutil.AmmoCell.new('', ' | tableutil.AmmoCell.new('', 'ammoicon', { | ||
attributes = { align = 'center' }, | attributes = { align = 'center' }, | ||
cellClass = 'st-desktop', | cellClass = 'st-desktop', | ||
258行目: | 229行目: | ||
tableutil.HopupCell.new(res.hopup, 'hopup', { | tableutil.HopupCell.new(res.hopup, 'hopup', { | ||
attributes = { align = 'left' }, | attributes = { align = 'left' }, | ||
cellClass = ' | cellClass = 'st-mobile-padding0-both', | ||
headerColspan = 0, | headerColspan = 0, | ||
}), | }), | ||
266行目: | 237行目: | ||
headerClass = 'st-desktop', | headerClass = 'st-desktop', | ||
headerStyle = { | headerStyle = { | ||
['min-width'] = ' | ['min-width'] = '50px', | ||
['max-width'] = '4em', | ['max-width'] = '4em', | ||
}, | }, | ||
}), | }), | ||
tableutil.LineValueCell.new(res.bodyshot, ' | tableutil.LineValueCell.new(res.bodyshot, 'bodyDamage', { | ||
startIndex | startIndex = 'legsDamage', | ||
endIndex | endIndex = 'lvl1Damage', | ||
cellClass | subStartIndex = 'flLgDamage', | ||
footerClass = 'st-mobile-axis', | subEndIndex = 'lvl1Damage', | ||
headerStyle = { | cellClass = 'st-mobile-graph st-mobile-medium st-mobile-textshadow', | ||
['min-width'] = ' | footerClass = 'st-mobile-axis', | ||
['max-width'] = ' | headerStyle = { | ||
['min-width'] = '50px', | |||
['max-width'] = '4em', | |||
}, | }, | ||
maximumValue = 150, | itemName = res.normal, | ||
subItemName = res.fortified, | |||
maximumValue = 150, | |||
preferredGridCount = 3, | preferredGridCount = 3, | ||
}), | }), | ||
287行目: | 262行目: | ||
headerClass = 'st-desktop', | headerClass = 'st-desktop', | ||
headerStyle = { | headerStyle = { | ||
['min-width'] = ' | ['min-width'] = '50px', | ||
['max-width'] = '4em', | ['max-width'] = '4em', | ||
}, | }, | ||
296行目: | 271行目: | ||
headerClass = 'st-desktop', | headerClass = 'st-desktop', | ||
headerStyle = { | headerStyle = { | ||
['min-width'] = ' | ['min-width'] = '50px', | ||
['max-width'] = '4em', | ['max-width'] = '4em', | ||
}, | }, | ||
305行目: | 280行目: | ||
headerClass = 'st-mobile-last', | headerClass = 'st-mobile-last', | ||
headerStyle = { | headerStyle = { | ||
['min-width'] = ' | ['min-width'] = '50px', | ||
['max-width'] = '4em', | ['max-width'] = '4em', | ||
}, | }, | ||
}), | }), | ||
tableutil.LineCell.new(res.graph, ' | tableutil.LineCell.new(res.graph, 'bodyDamage', { | ||
startIndex | startIndex = 'legsDamage', | ||
endIndex | endIndex = 'lvl1Damage', | ||
cellClass | subStartIndex = 'flLgDamage', | ||
footerClass = 'st-desktop', | subEndIndex = 'lvl1Damage', | ||
headerClass = 'st-desktop', | cellClass = 'st-desktop st-desktop-graph', | ||
headerStyle = { | footerClass = 'st-desktop', | ||
headerClass = 'st-desktop', | |||
headerStyle = { | |||
['min-width'] = '200px', | ['min-width'] = '200px', | ||
}, | }, | ||
maximumValue = 200, | hoverEnabled = true, | ||
itemName = res.normal, | |||
subItemName = res.fortified, | |||
maximumValue = 200, | |||
}), | }), | ||
} | } |
2022年8月10日 (水) 13:43時点における最新版
このモジュールについての説明文ページを モジュール:StatTable/Damage/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 configuration = mw.loadData('Module:StatTable/configuration') local getArgs -- lazily initialized local function addData(dataset, data, fn) fn = fn or function(val) return val end 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.bodyDamage = fn(data.damage, 1, 1) * data.pellets data.headDamage = fn(apex.calcPartDamage(data.damage, head), head, 1) * data.pellets data.lvl1Damage = fn(apex.calcPartDamage(data.damage, lvl1), lvl1, 1) * data.pellets data.lvl2Damage = fn(apex.calcPartDamage(data.damage, lvl2), lvl2, 1) * data.pellets data.lvl3Damage = fn(apex.calcPartDamage(data.damage, lvl3), lvl3, 1) * data.pellets data.legsDamage = fn(apex.calcPartDamage(data.damage, legs), legs, 1) * data.pellets data.flLgDamage = fn(apex.calcDamageFromPartAndPassive(data.damage, legs, 0.85), legs, 0.85) * data.pellets table.insert(dataset, data) 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 baseDamage = stat.damage.base local baseData = { ammo = stat.ammo, ammoicon = stat.ammo, damage = stat.damage.base, head = stat.damage_head_scale, legs = stat.damage_legs_scale, name = name, pellets = stat.pellet or 1, shortname = stat.localization['Japanese_Short'], } local special = aw.stringstarts(stat.ammo, 'special_') -- Charge Rifle if stat.damage.beam then for t = 0, stat.damage.beam.ticks do local tickData = aw.shallowCopy(baseData) tickData.option = aw.getQuantityString(res.ticks, t) addData(dataset, tickData, function(val, part, passive) return val + apex.calcDamageFromPartAndPassive(stat.damage.beam.base, part, passive) * t end) end -- 散弾 (ショットガン・トリプルテイク) elseif aw.isNumberAndGreaterThanX(stat.pellet, 1) then for p = 1, stat.pellet do local pelletData = aw.shallowCopy(baseData) pelletData.option = aw.getQuantityString(res.pellets, p) pelletData.pellets = p addData(dataset, pelletData) -- Hammerpoint Rounds (Mozambique Shotgun) if (configuration.__debug__enableAllHopup or Hopup.hammerpoint_rounds.enabled) and type(stat.hammerpoint_rounds) == 'table' and aw.isNumberAndGreaterThanX(stat.hammerpoint_rounds.damage_unshielded_scale, 1) then local pelletUnshieldedData = aw.shallowCopy(pelletData) pelletUnshieldedData.damage = math.floor(stat.hammerpoint_rounds.damage_unshielded_scale * baseDamage) pelletUnshieldedData.hopup = { 'hammerpoint_rounds' } addData(dataset, pelletUnshieldedData) end end -- Other else -- Chargefire if aw.isNumberAndGreaterThanX(stat.damage.charged, baseDamage) then baseData.option = res.mincharge addData(dataset, baseData) 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) -- チャージが無効の場合の通常出力 else addData(dataset, baseData) end -- Amped mode if aw.isNumberAndGreaterThanX(stat.damage.amped, baseDamage) then local ampedData = aw.shallowCopy(baseData) ampedData.ammoicon = stat.ammo .. '_amped' ampedData.damage = stat.damage.amped ampedData.option = res.amped addData(dataset, ampedData) 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.damage = stat.selectfire_receiver.damage.base or stat.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) 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) end -- Hammerpoint Rounds (P2020) 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) 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, 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.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) 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 if aw.isNumberAndGreaterThanX(stat.shatter_caps.damage.charged, stat.shatter_caps.damage.base) then for p = 1, stat.shatter_caps.pellet do local shatterCapsMinChargeData = aw.shallowCopy(baseData) shatterCapsMinChargeData.damage = stat.shatter_caps.damage.base if stat.shatter_caps.damage_head_scale then shatterCapsMinChargeData.head = stat.shatter_caps.damage_head_scale end shatterCapsMinChargeData.hopup = { 'shatter_caps' } if stat.shatter_caps.damage_legs_scale then shatterCapsMinChargeData.legs = stat.shatter_caps.damage_legs_scale end shatterCapsMinChargeData.option = string.format(res.mixins, res.mincharge, aw.getQuantityString(res.pellets, p)) shatterCapsMinChargeData.pellets = p addData(dataset, shatterCapsMinChargeData) local shatterCapsMaxChargeData = aw.shallowCopy(shatterCapsMinChargeData) 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 = string.format(res.mixins, res.maxcharge, aw.getQuantityString(res.pellets, p)) addData(dataset, shatterCapsMaxChargeData) end else for p = 1, stat.shatter_caps.pellet do 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.option = aw.getQuantityString(res.pellets, p) addData(dataset, shatterCapsData) end end end end end local metadata = { tableutil.RankCell.new('', 'bodyDamage', 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 = 2, optionIndex = 'option', shortnameIndex = 'shortname', }), tableutil.HopupCell.new(res.hopup, 'hopup', { attributes = { align = 'left' }, cellClass = 'st-mobile-padding0-both', headerColspan = 0, }), tableutil.ValueCell.new(res.legsshot, 'legsDamage', { cellClass = 'st-desktop', footerClass = 'st-desktop', headerClass = 'st-desktop', headerStyle = { ['min-width'] = '50px', ['max-width'] = '4em', }, }), tableutil.LineValueCell.new(res.bodyshot, 'bodyDamage', { startIndex = 'legsDamage', endIndex = 'lvl1Damage', subStartIndex = 'flLgDamage', subEndIndex = 'lvl1Damage', cellClass = 'st-mobile-graph st-mobile-medium st-mobile-textshadow', footerClass = 'st-mobile-axis', headerStyle = { ['min-width'] = '50px', ['max-width'] = '4em', }, itemName = res.normal, subItemName = res.fortified, maximumValue = 150, preferredGridCount = 3, }), tableutil.ValueCell.new(res.headlvl3, 'lvl3Damage', { cellClass = 'st-desktop', footerClass = 'st-desktop', headerClass = 'st-desktop', headerStyle = { ['min-width'] = '50px', ['max-width'] = '4em', }, }), tableutil.ValueCell.new(res.headlvl2, 'lvl2Damage', { cellClass = 'st-desktop', footerClass = 'st-desktop', headerClass = 'st-desktop', headerStyle = { ['min-width'] = '50px', ['max-width'] = '4em', }, }), tableutil.ValueCell.new(res.headlvl1, 'lvl1Damage', { cellClass = 'st-mobile-last', footerClass = 'st-mobile-last', headerClass = 'st-mobile-last', headerStyle = { ['min-width'] = '50px', ['max-width'] = '4em', }, }), tableutil.LineCell.new(res.graph, 'bodyDamage', { startIndex = 'legsDamage', endIndex = 'lvl1Damage', subStartIndex = 'flLgDamage', subEndIndex = 'lvl1Damage', cellClass = 'st-desktop st-desktop-graph', footerClass = 'st-desktop', headerClass = 'st-desktop', headerStyle = { ['min-width'] = '200px', }, hoverEnabled = true, itemName = res.normal, subItemName = res.fortified, maximumValue = 200, }), } local node = tableutil.createTable(dataset, metadata) 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