On Friday, April 19, 2024 at 10:00 PM New York time, all OpenWiki Project sites will be undergoing scheduled maintenance for about 2 hours. Expect read-only access and brief periods of downtime.

Module:Item

From Fire Emblem Wiki, your source on Fire Emblem information. By fans, for fans.

For use with Template:Item.

PlatformGame

If the user inputs the number of a game (e.g. 11 for Fire Emblem: Shadow Dragon), this will output the platform code for use in image file names (e.g. "ds" for Shadow Dragon).

{{#invoke:Item|PlatformGame|<game no>}}

Enter the game's number in the first parameter. If a non-numeral is entered here, it simply returns whatever is entered.

Example:

{{#invoke:Item|PlatformGame|12}}

This will return "ds", as that is the platform code for game 12 (Fire Emblem: New Mystery of the Emblem).


local p = {}

--[[
Get the game's platform code from its number.
]]

function p.PlatformGame(frame)
    game_no = tonumber(frame.args[1])
    if( game_no == nil ) then
        return frame.args[1]
    end

    local g_platform = {
        [1] = "nes01",
        [2] = "nes02",
        [3] = "snes01",
        [4] = "snes02",
        [5] = "snes03",
        [6] = "gba",
        [7] = "gba",
        [8] = "gba",
        [9] = "gcn",
        [10] = "wii",
        [11] = "ds",
        [12] = "ds",
        [13] = "3ds01",
        [14] = "3ds02",
        [15] = "3ds03",
        [16] = "ns01",
        [17] = "ns02"
    }

    return g_platform[game_no]
end

return p