Module:SeasonVariables

From JoJo's Bizarre Encyclopedia - JoJo Wiki
Revision as of 06:56, 19 July 2023 by Vish (talk | contribs)
Jump to navigation Jump to search

Documentation for this module may be created at Module:SeasonVariables/doc

local p = {}

function p.main(frame)
    local input = frame.args[1]
    local abbreviations = {
        PB = "Phantom Blood",
        BT = "Battle Tendency",
        SC = "Stardust Crusaders",
        DU = "Diamond is Unbreakable",
        GW = "Golden Wind",
        SO = "Stone Ocean",
        SBR = "Steel Ball Run",
        JJL = "JoJolion",
        TJL = "The JOJOLands",
        ["TSKR Episode (%d+) %(OVA%)"] = "Thus Spoke Kishibe Rohan",
        ["Episode (%d+) %(OVA%)"] = "JoJo's Bizarre Adventure"
    }
    for abbreviation, full_name in pairs(abbreviations) do
        local episode_number = string.match(input, abbreviation)
        if episode_number then
            return full_name .. " Episode " .. episode_number .. ": " .. string.sub(input, string.len(episode_number) + string.len(abbreviation) + 5)
        end
    end
    return input
end

return p