🌟 | 現在、 鉄壁ヘッドショットには対応済みです。 鉄壁HSは通常HSと同じダメージになります。LMG及びDMR、チャージライフル、ハンマーポイント弾を除き、すべてのダメージ値が一致していることを確認しています。 |
モジュール:Utility/Image
ナビゲーションに移動
検索に移動
このモジュールについての説明文ページを モジュール:Utility/Image/doc に作成できます
local p = {} local cfg = mw.loadData('Module:Utility/Image/configuration') local aw = require('Module:Utility/Library') local nu = require('Module:Utility/Name') local function buildClasses(base, params) local classes = {} for _, value in ipairs({ 'body', 'rarity', 'size' }) do local baseClassName = base[value] local param = params[value] if param ~= nil then local classname = string.format(baseClassName, param) table.insert(classes, classname) else table.insert(classes, baseClassName) end end return table.concat(classes, ' ') end local function imagecore(cfg2, name, opts, altname) if opts.link and opts.link ~= '' then opts.link = string.format(opts.link, name) end local filename = opts.filename or string.format(cfg2.filename, name) local classtext = buildClasses(cfg2.classes or cfg.classes, opts) return string.format( '[[File:%s|%dpx|link=%s|alt=%s|class=%s]]', filename, opts.size, opts.link, altname or name, classtext) end function p.attachment(name, level, opts) local newopts = opts and aw.shallowCopy(opts) or {} newopts.link = newopts.link or cfg.attachment.default_link or cfg.default_link newopts.rarity = newopts.rarity or cfg.levels[math.min(5, 1 + level)] newopts.size = newopts.size or cfg.attachment.default_size or cfg.default_size return imagecore(cfg.attachment, name, newopts) end function p.gear(name, level, opts) local newopts = opts and aw.shallowCopy(opts) or {} newopts.link = newopts.link or cfg.gear.default_link or cfg.default_link newopts.rarity = newopts.rarity or cfg.levels[math.min(5, 1 + level)] newopts.size = newopts.size or cfg.gear.default_size or cfg.default_size if name == 'バックパック' then newopts.filename = string.format(cfg.gear.filename_backpack, math.max(0, math.min(level, 3))) end return imagecore(cfg.gear, name, newopts) end function p.ammo(id, opts) local linkname, name if aw.stringends(id, '_revved_up') then local baseid = string.sub(id, 1, string.len(id) - 10) linkname = nu.ammo(baseid) name = '連射速度上昇時' .. linkname elseif aw.stringends(id, '_amped') then local baseid = string.sub(id, 1, string.len(id) - 6) linkname = nu.ammo(baseid) name = '増幅時' .. linkname else linkname = nu.ammo(id) name = linkname end local newopts = opts and aw.shallowCopy(opts) or {} newopts.link = newopts.link or cfg.ammo.default_link or cfg.default_link newopts.size = newopts.size or cfg.ammo.default_size or cfg.default_size if newopts.link and newopts.link ~= '' then newopts.link = string.format(newopts.link, linkname) end local filename = string.format(cfg.ammo.filename, name) return string.format( '[[File:%s|x%dpx|link=%s|alt=%s]]', filename, newopts.size, newopts.link, name) end local function image(cfg2, name, opts, altname, rarity) opts = opts and aw.shallowCopy(opts) or {} opts.link = opts.link or cfg2.items and cfg2.items[name].default_link or cfg2.default_link or cfg.default_link opts.rarity = opts.rarity or cfg2.items and cfg2.items[name].default_rarity or cfg2.default_rarity or cfg.default_rarity opts.size = opts.size or cfg2.items and cfg2.items[name].default_size or cfg2.default_size or cfg.default_size return imagecore(cfg2, name, opts, altname) end function p.grenade(name, opts) return image(cfg.grenade, name, opts) end function p.hopup(id, opts) opts = opts or {} local name = nu.hopup(id, 'ja') local altname = nu.hopup(id, opts and opts.lang) if not opts.rarity then opts.rarity = mw.loadData('Module:Stat/Hopup')[id].rarity end return image(cfg.hopup, name, opts, altname, rarity) end function p.item(name, opts) return image(cfg.item, name, opts) end function p.scope(name, opts) return image(cfg.scope, name, opts) end function p.passive(id, opts) local name = nu.passive(id, 'ja') local altname = nu.passive(id, opts and opts.lang) return image(cfg.passive, name, opts, altname) end function p.tactical(id, opts) local name = nu.tactical(id, 'ja') local altname = nu.tactical(id, opts and opts.lang) return image(cfg.tactical, name, opts, altname) end return p