@@ -698,6 +698,7 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str
698
698
let nationalSearch = null ;
699
699
let unreleasedSearch = null ;
700
700
let fullyEvolvedSearch = null ;
701
+ let restrictedSearch = null ;
701
702
let singleTypeSearch = null ;
702
703
let randomOutput = 0 ;
703
704
let tierInequalitySearch = false ;
@@ -957,6 +958,14 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str
957
958
break ;
958
959
}
959
960
961
+ if ( [ 'restricted legendary' , 'restrictedlegendary' , 'restricted' ] . includes ( target ) ) {
962
+ if ( restrictedSearch === isNotSearch ) return { error : "A search cannot include and exclude 'restricted legendary'." } ;
963
+ if ( parameters . length > 1 ) return { error : "The parameter 'restricted legendary' cannot have alternative parameters." } ;
964
+ restrictedSearch = ! isNotSearch ;
965
+ orGroup . skip = true ;
966
+ break ;
967
+ }
968
+
960
969
if ( target === 'recovery' ) {
961
970
const recoveryMoves = [
962
971
"healorder" , "junglehealing" , "lifedew" , "milkdrink" , "moonlight" , "morningsun" , "recover" ,
@@ -1130,7 +1139,7 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str
1130
1139
}
1131
1140
if (
1132
1141
showAll && searches . length === 0 && singleTypeSearch === null &&
1133
- megaSearch === null && gmaxSearch === null && fullyEvolvedSearch === null && sort === null
1142
+ megaSearch === null && gmaxSearch === null && fullyEvolvedSearch === null && restrictedSearch === null && sort === null
1134
1143
) {
1135
1144
return {
1136
1145
error : "No search parameters other than 'all' were found. Try '/help dexsearch' for more information on this command." ,
@@ -1142,6 +1151,8 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str
1142
1151
const megaSearchResult = megaSearch === null || megaSearch === ! ! species . isMega ;
1143
1152
const gmaxSearchResult = gmaxSearch === null || gmaxSearch === species . name . endsWith ( '-Gmax' ) ;
1144
1153
const fullyEvolvedSearchResult = fullyEvolvedSearch === null || fullyEvolvedSearch !== species . nfe ;
1154
+ const restrictedSearchResult = restrictedSearch === null ||
1155
+ restrictedSearch === species . tags . includes ( 'Restricted Legendary' ) ;
1145
1156
if (
1146
1157
species . gen <= mod . gen &&
1147
1158
(
@@ -1151,7 +1162,8 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str
1151
1162
( ! species . tier . startsWith ( "CAP" ) || capSearch ) &&
1152
1163
megaSearchResult &&
1153
1164
gmaxSearchResult &&
1154
- fullyEvolvedSearchResult
1165
+ fullyEvolvedSearchResult &&
1166
+ restrictedSearchResult
1155
1167
) {
1156
1168
dex [ species . id ] = species ;
1157
1169
}
0 commit comments