From b54dfaa80ad685add1108cc328e71b2441ab37aa Mon Sep 17 00:00:00 2001 From: Quinton Lee Date: Fri, 19 May 2017 11:04:01 -0500 Subject: [PATCH] Tournaments: support base formes in /tour banlist --- tournaments/index.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tournaments/index.js b/tournaments/index.js index 17c734168d51..075dcb24c1a9 100644 --- a/tournaments/index.js +++ b/tournaments/index.js @@ -134,16 +134,23 @@ class Tournament { } ban = 'Rule:' + subformat.name; } else { + param = param.toLowerCase(); + let baseForme = false; + if (param.endsWith('-base')) { + baseForme = true; + param = param.substr(0, param.length - 5); + } let search = Dex.dataSearch(param); if (!search || search.length < 1) continue; search = search[0]; if (search.isInexact || search.searchType === 'nature') continue; + ban = search.name; + if (baseForme) ban += '-Base'; if (unban) { - if (format.banlistTable[search.name] === false) continue; + if (format.banlistTable[ban] === false) continue; } else { - if (format.banlistTable[search.name]) continue; + if (format.banlistTable[ban]) continue; } - ban = search.name; } if (unban) { oppositeBan = ban;