🌟 | 現在、 鉄壁ヘッドショットには対応済みです。 鉄壁HSは通常HSと同じダメージになります。LMG及びDMR、チャージライフル、ハンマーポイント弾を除き、すべてのダメージ値が一致していることを確認しています。 |
モジュール:DamageTables
ナビゲーションに移動
検索に移動
このモジュールについての説明文ページを モジュール:DamageTables/doc に作成できます
local p = {} local aw = require('Module:Utility/Library') local iu = require('Module:Utility/Image') local DamageTable = require('Module:DamageTable') local getArgs -- lazily initialized local indexableValues = { damage = 20, beamdamage = 0, ticks = 0, pellet = 1, leg = 0.8, } local copiedValues = { damagemin = 1000, damagemax = 0, beamdamagemin = 0, beamdamagemax = 0, pelletmin = 0, pelletmax = 0, head = 2, legmin = 0, mulmin = 0.85, mulmax = 1.05, skullpiercer = 1, rps = 0, rpsratio1 = 0, rpsratio2 = 0, rpsratio3 = 0, raise = 0, reload = 0, reloadratio2 = 0.95, reloadratio3 = 0.9, extmag0 = 0, extmag1 = 0, extmag2 = 0, extmag3 = 0, } local copiedBooleanValues = { round = false, amped = false, forcegunshield = false, } local copiedStringValues = { skullpiercerrarity = 'legendary', shieldpreset = 'gibbleedthrough', } local function rebuildArguments(base, idx, mul) local ret = {} -- 再構築する変数 for key, value in pairs(indexableValues) do local temp = aw.getAsNumber(base[key .. idx], -1) if temp < 0 then temp = aw.getAsNumber(base[key], -1) if temp < 0 then temp = value end end ret[key] = temp end -- コピーする変数 for key, value in pairs(copiedValues) do ret[key] = aw.getAsNumber(base[key], value) end for key, value in pairs(copiedBooleanValues) do ret[key] = aw.getAsBoolean(base[key], value) end for key, value in pairs(copiedStringValues) do ret[key] = base[key] or value end return ret end local function appendGroupTables(builder, name, args, idx, mul, frame, opts) local args2 = rebuildArguments(args, idx, mul) args2.caption = name args2.mul = mul if opts.useDisruptor then args2.disruptor = args.disruptor else args2.disruptorsup = args.disruptor end if opts.useHammerpoint then args2.hammerpoint = args.hammerpoint else args2.hammerpointsup = args.hammerpoint end builder:append(DamageTable._main(args2, frame)) if args.amped then if name == '通常' then args2.caption = '{{Hopup|増幅バリケード}} 増幅バリケード' else args2.caption = name .. '+{{Hopup|増幅バリケード}} 増幅バリケード' end args2.amped = true builder:append(DamageTable._main(args2, frame)) end end local maxcount = 5 local empty = {} function p._main(args, frame) -- init value local initValues = { lowprofile = 1.05, fortified = 0.85, disruptor = 1, hammerpoint = 1, } -- fix arguments for key, value in pairs(initValues) do args[key] = aw.getAsNumber(args[key], value) end args.amped = aw.getAsBoolean(args.amped, true) -- build node local builder = require('Module:Utility/StringBuilder').new() builder:append('<div class="group-container">\n') appendGroupTables(builder, '通常', args, 1, 1, frame, empty) for i = 2, maxcount do local varname = string.format('name%d', i) if args[varname] then appendGroupTables(builder, args[varname], args, i, 1, frame, empty) end end if args.disruptor > 1 then local caption = string.format('{{Hopup|ディスラプター弾}} {{Epic|ディスラプター弾 (x%s)}}', args.disruptor) appendGroupTables(builder, caption, args, 1, 1, frame, { useDisruptor = true }) end if args.hammerpoint > 1 then local caption = string.format('{{Hopup|ハンマーポイント弾}} {{Epic|ハンマーポイント弾 (x%s)}}', args.hammerpoint) appendGroupTables(builder, caption, args, 1, 1, frame, { useHammerpoint = true }) end -- low profile if args.lowprofile > 1 then builder :append('</div>\n') :append('=== [[小柄]] ===\n') :append('<div class="group-container">\n') appendGroupTables(builder, '小柄', args, 1, args.lowprofile, frame, empty) for i = 2, maxcount do local varname = string.format('name%d', i) if args[varname] then appendGroupTables(builder, '小柄+' .. args[varname], args, i, args.lowprofile, frame, empty) end end if args.disruptor > 1 then local caption = string.format('小柄+{{Hopup|ディスラプター弾}} {{Epic|ディスラプター弾 (x%s)}}', args.disruptor) appendGroupTables(builder, caption, args, 1, args.lowprofile, frame, { useDisruptor = true }) end if args.hammerpoint > 1 then local caption = string.format('小柄+{{Hopup|ハンマーポイント弾}} {{Epic|ハンマーポイント弾 (x%s)}}', args.hammerpoint) appendGroupTables(builder, caption, args, 1, args.lowprofile, frame, { useHammerpoint = true }) end end -- fortified if args.fortified < 1 then builder :append('</div>\n') :append('=== [[鉄壁]] ===\n') :append('<div class="group-container">\n') appendGroupTables(builder, '鉄壁', args, 1, args.fortified, frame, empty) for i = 2, maxcount do local varname = string.format('name%d', i) if args[varname] then appendGroupTables(builder, '鉄壁+' .. args[varname], args, i, args.fortified, frame, empty) end end if args.disruptor > 1 then local caption = string.format('鉄壁+{{Hopup|ディスラプター弾}} {{Epic|ディスラプター弾 (x%s)}}', args.disruptor) appendGroupTables(builder, caption, args, 1, args.fortified, frame, { useDisruptor = true }) end if args.hammerpoint > 1 then local caption = string.format('鉄壁+{{Hopup|ハンマーポイント弾}} {{Epic|ハンマーポイント弾 (x%s)}}', args.hammerpoint) appendGroupTables(builder, caption, args, 1, args.fortified, frame, { useHammerpoint = true }) end end -- close tag builder:append('</div>') return tostring(builder) end function p.main(frame) if not getArgs then getArgs = require('Module:Arguments').getArgs end args = getArgs(frame) return p._main(args, frame) end return p