@pkmn/sim 0.5.17 → 0.5.20

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/data/moves.ts CHANGED
@@ -7815,9 +7815,8 @@ export const Moves: {[moveid: string]: MoveData} = {
7815
7815
  pp: 10,
7816
7816
  priority: 0,
7817
7817
  flags: {snatch: 1, heal: 1},
7818
- onHit(target, source, move) {
7818
+ onTryHit(source) {
7819
7819
  if (!this.canSwitch(source.side)) {
7820
- delete move.selfdestruct;
7821
7820
  this.attrLastMove('[still]');
7822
7821
  this.add('-fail', source);
7823
7822
  return this.NOT_FAIL;
@@ -9911,9 +9910,8 @@ export const Moves: {[moveid: string]: MoveData} = {
9911
9910
  pp: 10,
9912
9911
  priority: 0,
9913
9912
  flags: {snatch: 1, heal: 1, dance: 1},
9914
- onHit(target, source, move) {
9913
+ onTryHit(source) {
9915
9914
  if (!this.canSwitch(source.side)) {
9916
- delete move.selfdestruct;
9917
9915
  this.attrLastMove('[still]');
9918
9916
  this.add('-fail', source);
9919
9917
  return this.NOT_FAIL;
package/data/pokedex.ts CHANGED
@@ -459,6 +459,7 @@ export const Pokedex: {[speciesid: string]: SpeciesData} = {
459
459
  color: "Black",
460
460
  prevo: "Rattata-Alola",
461
461
  evoLevel: 20,
462
+ evoCondition: "at night",
462
463
  eggGroups: ["Field"],
463
464
  },
464
465
  raticatealolatotem: {
@@ -2391,6 +2392,7 @@ export const Pokedex: {[speciesid: string]: SpeciesData} = {
2391
2392
  color: "Purple",
2392
2393
  prevo: "Cubone",
2393
2394
  evoLevel: 28,
2395
+ evoCondition: "at night",
2394
2396
  eggGroups: ["Monster"],
2395
2397
  },
2396
2398
  marowakalolatotem: {
@@ -8096,6 +8098,7 @@ export const Pokedex: {[speciesid: string]: SpeciesData} = {
8096
8098
  prevo: "Sneasel",
8097
8099
  evoType: "levelHold",
8098
8100
  evoItem: "Razor Claw",
8101
+ evoCondition: "at night",
8099
8102
  eggGroups: ["Field"],
8100
8103
  },
8101
8104
  magnezone: {
@@ -12224,6 +12227,7 @@ export const Pokedex: {[speciesid: string]: SpeciesData} = {
12224
12227
  color: "Red",
12225
12228
  prevo: "Tyrunt",
12226
12229
  evoLevel: 39,
12230
+ evoCondition: "during the day",
12227
12231
  eggGroups: ["Monster", "Dragon"],
12228
12232
  },
12229
12233
  amaura: {
@@ -12251,6 +12255,7 @@ export const Pokedex: {[speciesid: string]: SpeciesData} = {
12251
12255
  color: "Blue",
12252
12256
  prevo: "Amaura",
12253
12257
  evoLevel: 39,
12258
+ evoCondition: "at night",
12254
12259
  eggGroups: ["Monster"],
12255
12260
  },
12256
12261
  sylveon: {
@@ -12970,6 +12975,7 @@ export const Pokedex: {[speciesid: string]: SpeciesData} = {
12970
12975
  color: "Brown",
12971
12976
  prevo: "Yungoos",
12972
12977
  evoLevel: 20,
12978
+ evoCondition: "during the day",
12973
12979
  eggGroups: ["Field"],
12974
12980
  otherFormes: ["Gumshoos-Totem"],
12975
12981
  formeOrder: ["Gumshoos", "Gumshoos-Totem"],
@@ -13212,7 +13218,7 @@ export const Pokedex: {[speciesid: string]: SpeciesData} = {
13212
13218
  color: "Red",
13213
13219
  prevo: "Rockruff",
13214
13220
  evoLevel: 25,
13215
- evoCondition: "during the night",
13221
+ evoCondition: "at night",
13216
13222
  eggGroups: ["Field"],
13217
13223
  },
13218
13224
  lycanrocdusk: {
@@ -16400,6 +16406,7 @@ export const Pokedex: {[speciesid: string]: SpeciesData} = {
16400
16406
  prevo: "Sneasel-Hisui",
16401
16407
  evoType: "useItem",
16402
16408
  evoItem: "Razor Claw",
16409
+ evoCondition: "during the day",
16403
16410
  eggGroups: ["Field"],
16404
16411
  },
16405
16412
  overqwil: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pkmn/sim",
3
- "version": "0.5.17",
3
+ "version": "0.5.20",
4
4
  "description": "An automatically generated extraction of just the simulator portion of Pokémon Showdown",
5
5
  "homepage": "https://psim.us",
6
6
  "main": "build/sim/index.js",
package/sim/battle.ts CHANGED
@@ -2078,13 +2078,7 @@ export class Battle {
2078
2078
  denominator = numerator[1];
2079
2079
  numerator = numerator[0];
2080
2080
  }
2081
- let nextMod = 0;
2082
- if (this.event.ceilModifier) {
2083
- nextMod = Math.ceil(numerator * 4096 / (denominator || 1));
2084
- } else {
2085
- nextMod = this.trunc(numerator * 4096 / (denominator || 1));
2086
- }
2087
-
2081
+ const nextMod = this.trunc(numerator * 4096 / (denominator || 1));
2088
2082
  this.event.modifier = ((previousMod * nextMod + 2048) >> 12) / 4096;
2089
2083
  }
2090
2084
 
@@ -1,4 +1,5 @@
1
1
  import {ObjectReadWriteStream} from '../../lib/streams';
2
+ import {ID} from '../exported-global-types';
2
3
  import {Dex, toID} from '../dex';
3
4
  import {PRNG, PRNGSeed} from '../prng';
4
5
  import {RandomPlayerAI} from './random-player-ai';