@pkmn/randoms 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +2 -10
- package/build/index.js.map +1 -1
- package/build/index.mjs +2 -10
- package/build/index.mjs.map +1 -1
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -516,9 +516,6 @@ var RandomGen8Teams = class {
|
|
|
516
516
|
return team;
|
|
517
517
|
}
|
|
518
518
|
randomNPokemon(n, requiredType, minSourceGen, ruleTable, requireMoves = false) {
|
|
519
|
-
const last = [0, 151, 251, 386, 493, 649, 721, 807, 898, 1010][this.gen];
|
|
520
|
-
if (n <= 0 || n > last)
|
|
521
|
-
throw new Error(`n must be a number between 1 and ${last} (got ${n})`);
|
|
522
519
|
if (requiredType && !this.dex.types.get(requiredType).exists) {
|
|
523
520
|
throw new Error(`"${requiredType}" is not a valid type.`);
|
|
524
521
|
}
|
|
@@ -542,8 +539,6 @@ var RandomGen8Teams = class {
|
|
|
542
539
|
const num = species.num;
|
|
543
540
|
if (num <= 0 || pool.includes(num))
|
|
544
541
|
continue;
|
|
545
|
-
if (num > last)
|
|
546
|
-
break;
|
|
547
542
|
pool.push(num);
|
|
548
543
|
}
|
|
549
544
|
} else {
|
|
@@ -608,6 +603,8 @@ var RandomGen8Teams = class {
|
|
|
608
603
|
continue;
|
|
609
604
|
if (isNotCustom && (species.gen > this.gen || species.isNonstandard && species.isNonstandard !== "Unobtainable"))
|
|
610
605
|
continue;
|
|
606
|
+
if (requiredType && !species.types.includes(requiredType))
|
|
607
|
+
continue;
|
|
611
608
|
if (!formes[hasDexNumber[species.num]])
|
|
612
609
|
formes[hasDexNumber[species.num]] = [];
|
|
613
610
|
formes[hasDexNumber[species.num]].push(species.name);
|
|
@@ -11854,9 +11851,6 @@ var RandomTeams = class {
|
|
|
11854
11851
|
return team;
|
|
11855
11852
|
}
|
|
11856
11853
|
randomNPokemon(n, requiredType, minSourceGen, ruleTable, requireMoves = false) {
|
|
11857
|
-
const last = [0, 151, 251, 386, 493, 649, 721, 807, 898, 1017][this.gen];
|
|
11858
|
-
if (n <= 0 || n > last)
|
|
11859
|
-
throw new Error(`n must be a number between 1 and ${last} (got ${n})`);
|
|
11860
11854
|
if (requiredType && !this.dex.types.get(requiredType).exists) {
|
|
11861
11855
|
throw new Error(`"${requiredType}" is not a valid type.`);
|
|
11862
11856
|
}
|
|
@@ -11880,8 +11874,6 @@ var RandomTeams = class {
|
|
|
11880
11874
|
const num = species.num;
|
|
11881
11875
|
if (num <= 0 || pool.includes(num))
|
|
11882
11876
|
continue;
|
|
11883
|
-
if (num > last)
|
|
11884
|
-
break;
|
|
11885
11877
|
pool.push(num);
|
|
11886
11878
|
}
|
|
11887
11879
|
} else {
|