@pkmn/randoms 0.5.10 → 0.5.11

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/src/gen6.ts CHANGED
@@ -409,7 +409,11 @@ export class RandomGen6Teams extends RandomGen7Teams {
409
409
  case 'originpulse': case 'surf':
410
410
  return {cull: moves.has('hydropump') || moves.has('scald')};
411
411
  case 'scald':
412
- return {cull: moves.has('waterfall') || moves.has('waterpulse')};
412
+ return {cull: (
413
+ moves.has('waterfall') ||
414
+ moves.has('waterpulse') ||
415
+ (species.id === 'quagsire' && movePool.includes('recover'))
416
+ )};
413
417
 
414
418
  // Status:
415
419
  case 'glare': case 'headbutt':
@@ -567,7 +571,7 @@ export class RandomGen6Teams extends RandomGen7Teams {
567
571
  case 'Unburden':
568
572
  return (!!species.isMega || abilities.has('Prankster') || !counter.setupType && !moves.has('acrobatics'));
569
573
  case 'Water Absorb':
570
- return (moves.has('raindance') || abilities.has('Drizzle') || abilities.has('Volt Absorb'));
574
+ return (moves.has('raindance') || ['Drizzle', 'Unaware', 'Volt Absorb'].some(a => abilities.has(a)));
571
575
  case 'Weak Armor':
572
576
  return counter.setupType !== 'Physical';
573
577
  }
@@ -794,9 +798,8 @@ export class RandomGen6Teams extends RandomGen7Teams {
794
798
  const ivs = {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31};
795
799
 
796
800
  const types = new Set(species.types);
797
- const abilities = new Set(Object.values(species.abilities));
801
+ let abilities = new Set(Object.values(species.abilities));
798
802
  if (species.unreleasedHidden) abilities.delete(species.abilities.H);
799
-
800
803
  let availableHP = 0;
801
804
  for (const setMoveid of movePool) {
802
805
  if (setMoveid.startsWith('hiddenpower')) availableHP++;
@@ -995,10 +998,10 @@ export class RandomGen6Teams extends RandomGen7Teams {
995
998
  moves.add('thunder');
996
999
  }
997
1000
 
998
- const battleOnly = species.battleOnly && !species.requiredAbility;
999
- const baseSpecies: Species = battleOnly ? this.dex.species.get(species.battleOnly as string) : species;
1000
-
1001
- const abilityData = Object.values(baseSpecies.abilities).map(a => this.dex.abilities.get(a));
1001
+ if (species.battleOnly && !species.requiredAbility) {
1002
+ abilities = new Set(Object.values(this.dex.species.get(species.battleOnly as string).abilities));
1003
+ }
1004
+ const abilityData = [...abilities].map(a => this.dex.abilities.get(a));
1002
1005
  Utils.sortBy(abilityData, abil => -abil.rating);
1003
1006
 
1004
1007
  if (abilityData.length > 1) {
package/src/gen8.ts CHANGED
@@ -563,7 +563,7 @@ export class RandomTeams {
563
563
 
564
564
  banReason = ruleTable.check('basepokemon:' + toID(species.baseSpecies));
565
565
  if (banReason) continue;
566
- if (banReason !== '' || this.dex.species.get(species.baseSpecies).isNonstandard === species.isNonstandard) {
566
+ if (banReason !== '' || this.dex.species.get(species.baseSpecies).isNonstandard !== species.isNonstandard) {
567
567
  const nonexistentCheck = Tags.nonexistent.genericFilter!(species) && nonexistentBanReason;
568
568
  let tagWhitelisted = false;
569
569
  let tagBlacklisted = false;
@@ -588,10 +588,10 @@ export class RandomTeams {
588
588
  }
589
589
  }
590
590
  }
591
+ speciesPool.push(species);
591
592
  const num = species.num;
592
593
  if (pool.includes(num)) continue;
593
594
  pool.push(num);
594
- speciesPool.push(species);
595
595
  }
596
596
  }
597
597
 
@@ -2261,7 +2261,7 @@ export class RandomTeams {
2261
2261
  PUBL: 87,
2262
2262
  PU: 88, "(PU)": 88, NFE: 88,
2263
2263
  };
2264
- const customScale: {[k: string]: number} = {delibird: 100, luvdisc: 100, spinda: 100, unown: 100};
2264
+ const customScale: {[k: string]: number} = {delibird: 100, glalie: 76, luvdisc: 100, spinda: 100, unown: 100};
2265
2265
 
2266
2266
  level = customScale[species.id] || tierScale[species.tier] || 80;
2267
2267
  // Arbitrary levelling base on data files (typically winrate-influenced)