{
"version": 3,
"sources": ["../../../server/chat-plugins/othermetas.ts"],
"sourcesContent": ["/**\n * Other Metagames chat plugin\n * Lets users see elements of Pokemon in various Other Metagames.\n * Originally by Spandan.\n * @author dhelmise\n*/\n\nimport { Utils } from '../../lib';\n\ninterface StoneDeltas {\n\tbaseStats: { [stat in StatID]: number };\n\tbst: number;\n\tweighthg: number;\n\theightm: number;\n\ttype?: string;\n}\n\ntype TierShiftTiers = 'UU' | 'RUBL' | 'RU' | 'NUBL' | 'NU' | 'PUBL' | 'PU' | 'ZUBL' | 'ZU' | 'NFE' | 'LC';\n\nfunction getMegaStone(stone: string, mod = 'gen9'): Item | null {\n\tlet dex = Dex;\n\tif (mod && toID(mod) in Dex.dexes) dex = Dex.mod(toID(mod));\n\tconst item = dex.items.get(stone);\n\tif (!item.exists) {\n\t\tif (toID(stone) === 'dragonascent') {\n\t\t\tconst move = dex.moves.get(stone);\n\t\t\treturn {\n\t\t\t\tid: move.id,\n\t\t\t\tname: move.name,\n\t\t\t\tfullname: move.name,\n\t\t\t\tmegaEvolves: 'Rayquaza',\n\t\t\t\tmegaStone: 'Rayquaza-Mega',\n\t\t\t\texists: true,\n\t\t\t\t// Adding extra values to appease typescript\n\t\t\t\tgen: 6,\n\t\t\t\tnum: -1,\n\t\t\t\teffectType: 'Item',\n\t\t\t\tsourceEffect: '',\n\t\t\t} as Item;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\tif (!(item.forcedForme && !item.zMove) && !item.megaStone &&\n\t\t!item.isPrimalOrb && !item.name.startsWith(\"Rusted\")) return null;\n\treturn item;\n}\n\nexport const commands: Chat.ChatCommands = {\n\tom: 'othermetas',\n\tothermetas(target, room, user) {\n\t\ttarget = toID(target);\n\t\tconst omLink = `- Other Metagames Forum
`;\n\n\t\tif (!target) {\n\t\t\tthis.runBroadcast();\n\t\t\treturn this.sendReplyBox(omLink);\n\t\t}\n\n\t\tif (target === 'all') {\n\t\t\tthis.runBroadcast();\n\t\t\tif (this.broadcasting) {\n\t\t\t\tthrow new Chat.ErrorMessage(`\"!om all\" is too spammy to broadcast.`);\n\t\t\t}\n\t\t\t// Display OMotM formats, with forum thread links as caption\n\t\t\tthis.parse(`/formathelp omofthemonth`);\n\n\t\t\t// Display the rest of OM formats, with OM hub/index forum links as caption\n\t\t\tthis.parse(`/formathelp othermetagames`);\n\t\t\treturn this.sendReply(`|raw|