Module:Ss

local getArgs = require('Module:Arguments').getArgs local Wdstt = require('Module:Wdstt').main local p = {}

function p.main(frame) local args = getArgs(frame) return p._main(args) end

function has_key(table, key) -- https://stackoverflow.com/a/43108438 return table[key] ~= nil end

function p._main(args) local arg = string.lower(args[1]) local result = {} local unnamed = { ['sr'] = Wdstt({'SR', 'Secret Room'}), ['er'] = Wdstt({'ER', 'End room'}), ['plusle'] = Wdstt({'ID', 'Plusle ID'}), ['minun'] = Wdstt({'ID', 'Minun ID'}), ['ks'] = Wdstt({'KS', 'Kecleon Shop'}), ['box'] = Wdstt({'https://static.wikia.nocookie.net/pmysteryuniverse/images/2/20/Treasure_Chest_S_Yellow_Black.png', 'Secret Room and end room boxes'}), ['h'] = Wdstt({'H', 'Hidden'}), ['b'] = Wdstt({'B', "boss drop"}), ['honey'] = Wdstt({'https://static.wikia.nocookie.net/pmysteryuniverse/images/7/7b/Honey_S.png', "spawn using Honey"}) }

local named = { ['box'] = { ['srer'] = Wdstt({'https://static.wikia.nocookie.net/pmysteryuniverse/images/2/20/Treasure_Chest_S_Yellow_Black.png', 'Secret Room and end room boxes'}), ['ersr'] = Wdstt({'https://static.wikia.nocookie.net/pmysteryuniverse/images/2/20/Treasure_Chest_S_Yellow_Black.png', 'Secret Room and end room boxes'}), ['sr'] = Wdstt({'https://static.wikia.nocookie.net/pmysteryuniverse/images/4/43/Treasure_Chest_S_Yellow.png', 'Secret Room boxes'}), ['er'] = Wdstt({'https://static.wikia.nocookie.net/pmysteryuniverse/images/5/5a/Treasure_Chest_S_Black.png', 'end room boxes'}), },	}

for k, v in pairs(args) do		if type(k) == "number" then table.insert(result, unnamed[v]) elseif type(k) == "string" then if k == "b" then table.insert(result, Wdstt({'B', v.." boss drop"})) elseif k == "box" and not has_key(named["box"], v) then table.insert(result, Wdstt({'https://static.wikia.nocookie.net/pmysteryuniverse/images/5/5a/Treasure_Chest_S_Black.png', v})) else table.insert(result, named[k][v]) end end end

return table.concat(result, "")

end

return p