diff --git a/interfaces.d.ts b/interfaces.d.ts index ef265d1e6..c129b4720 100644 --- a/interfaces.d.ts +++ b/interfaces.d.ts @@ -224,3 +224,36 @@ export interface Card { energyType?: 'Normal' | // https://www.tcgdex.net/database/ecard/ecard1/160 'Special' // https://www.tcgdex.net/database/ecard/ecard1/158 } + +/** + * Filter for cards legality + */ +export interface Filter { + includes: { + /** + * series to be included + */ + series: Array + /** + * Set to be included in the filter + * ex: swsh1 + */ + sets: Array + /** + * Filter by regulation Marks on the cards + * ex: 'D' + */ + regulationMark: Array + } + excludes: { + /** + * sets to be excluded + */ + sets: Array + /** + * Global Ids of banned cards + * ex: swsh1-1 + */ + cards: Array + } +} diff --git a/legals.ts b/legals.ts new file mode 100644 index 000000000..2428e14a4 --- /dev/null +++ b/legals.ts @@ -0,0 +1,132 @@ +import { Filter } from './interfaces' + +/** + * File Explanation + * + * The main goal of this file is to update quickly the current list of authorized/banned cards in the standard and expanded formats + * + * For included cards/set/etc we are currently using the April post of each years (note: posts seems to be coming each April) + * - 2022: https://www.pokemon.com/us/pokemon-news/2022-pokemon-tcg-championship-series-season-format-rotation/ + * - 2021: https://www.pokemon.com/us/pokemon-news/2021-season-pokemon-tcg-format-rotation/ + * - 2020: https://www.pokemon.com/us/pokemon-news/2020-season-pokemon-tcg-format-rotation/ + * + * For banned cards we are currently following this webpage + * - https://www.pokemon.com/us/pokemon-tcg-banned-card-list/ + */ + +/** + * for each cards the compiler will check + * - if the card is in the `series` list + * - if the card is in the `sets` list + * - if the card is in the `regulationMark` list + * + * then it will check if the card is currently excluded + * - if the card is in the `sets` list + * - if the card is in the `cards` list + */ + +export const standard: Filter = { + includes: { + series: ['sm', 'swsh'], + sets: ['sm9', 'det1', 'sm10', 'sm11', 'sm115', 'sm12'], + regulationMark: ['D'] + }, + excludes: { + sets: [], + cards: [ + // SM + 'smp-SM85', + + 'sm35-45', + + 'sm5-114', + + 'sm6-83', + + 'sm8-90', + 'sm8-91', + + 'sm10-78', + 'sm10-165', + 'sm10-178', + + 'sm11-206', + 'sm11-253', + + 'sm115-58', + 'sm115-68', + + 'sm12-186', + 'sm12-194', + 'sm12-265', + ] + } +} + +export const expanded: Filter = { + includes: { + series: ['bw', 'xy', 'sm', 'swsh'], + sets: [], + regulationMark: [] + }, + excludes: { + sets: [], + cards: [ + // BW + 'bw3-67', + + 'bw5-110', + + 'bw9-101', + 'bw9-115', + + // XY + 'xy1-124', + + 'xy2-23', + + 'xy4-99', + 'xy4-118', + + 'xy5-133', + 'xy5-158', + + 'xy6-77', + 'xy6-106', + + 'xy7-74', + 'xy7-75', + + 'xy9-98', + 'xy9-109', + + 'g1-71', + + // SM + 'smp-SM85', + + 'sm35-45', + + 'sm5-114', + + 'sm6-83', + + 'sm8-90', + 'sm8-91', + + 'sm10-78', + 'sm10-165', + 'sm10-178', + + 'sm11-206', + 'sm11-253', + + 'sm115-58', + 'sm115-68', + + 'sm12-186', + 'sm12-194', + 'sm12-265', + ] + } +}