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