@pkmn/sim 0.7.17 → 0.7.18
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/cjs/data/abilities.js +21 -21
- package/build/cjs/data/abilities.js.map +1 -1
- package/build/cjs/data/aliases.js +3 -0
- package/build/cjs/data/aliases.js.map +1 -1
- package/build/cjs/data/formats-data.js +3 -3
- package/build/cjs/data/formats-data.js.map +1 -1
- package/build/cjs/data/items.js +6 -8
- package/build/cjs/data/items.js.map +1 -1
- package/build/cjs/data/learnsets.js +3 -3
- package/build/cjs/data/learnsets.js.map +1 -1
- package/build/cjs/data/mods/gen1/moves.js +1 -1
- package/build/cjs/data/mods/gen1/moves.js.map +1 -1
- package/build/cjs/data/mods/gen1/scripts.js +1 -1
- package/build/cjs/data/mods/gen1/scripts.js.map +1 -1
- package/build/cjs/data/mods/gen2/moves.js +1 -1
- package/build/cjs/data/mods/gen2/moves.js.map +1 -1
- package/build/cjs/data/mods/gen4/moves.js +1 -1
- package/build/cjs/data/mods/gen4/moves.js.map +1 -1
- package/build/cjs/data/mods/gen7/abilities.js +4 -4
- package/build/cjs/data/mods/gen7/abilities.js.map +1 -1
- package/build/cjs/data/moves.js +4 -4
- package/build/cjs/data/moves.js.map +1 -1
- package/build/cjs/data/pokedex.js +11 -11
- package/build/cjs/data/pokedex.js.map +1 -1
- package/build/cjs/sim/battle.js +4 -2
- package/build/cjs/sim/battle.js.map +1 -1
- package/build/cjs/sim/dex-conditions.js.map +1 -1
- package/build/cjs/sim/dex.js +0 -1
- package/build/cjs/sim/dex.js.map +1 -1
- package/build/cjs/sim/pokemon.js +12 -8
- package/build/cjs/sim/pokemon.js.map +1 -1
- package/build/esm/data/abilities.mjs +21 -21
- package/build/esm/data/abilities.mjs.map +1 -1
- package/build/esm/data/aliases.mjs +3 -0
- package/build/esm/data/aliases.mjs.map +1 -1
- package/build/esm/data/formats-data.mjs +3 -3
- package/build/esm/data/formats-data.mjs.map +1 -1
- package/build/esm/data/index.mjs +11 -11
- package/build/esm/data/items.mjs +6 -8
- package/build/esm/data/items.mjs.map +1 -1
- package/build/esm/data/learnsets.mjs +3 -3
- package/build/esm/data/learnsets.mjs.map +1 -1
- package/build/esm/data/mods/gen1/index.mjs +7 -7
- package/build/esm/data/mods/gen1/moves.mjs +1 -1
- package/build/esm/data/mods/gen1/moves.mjs.map +1 -1
- package/build/esm/data/mods/gen1/scripts.mjs +1 -1
- package/build/esm/data/mods/gen1/scripts.mjs.map +1 -1
- package/build/esm/data/mods/gen2/index.mjs +8 -8
- package/build/esm/data/mods/gen2/moves.mjs +1 -1
- package/build/esm/data/mods/gen2/moves.mjs.map +1 -1
- package/build/esm/data/mods/gen3/index.mjs +7 -7
- package/build/esm/data/mods/gen4/index.mjs +8 -8
- package/build/esm/data/mods/gen4/moves.mjs +1 -1
- package/build/esm/data/mods/gen4/moves.mjs.map +1 -1
- package/build/esm/data/mods/gen5/index.mjs +9 -9
- package/build/esm/data/mods/gen6/index.mjs +8 -8
- package/build/esm/data/mods/gen7/abilities.mjs +4 -4
- package/build/esm/data/mods/gen7/abilities.mjs.map +1 -1
- package/build/esm/data/mods/gen7/index.mjs +7 -7
- package/build/esm/data/mods/gen8/index.mjs +7 -7
- package/build/esm/data/moves.mjs +4 -4
- package/build/esm/data/moves.mjs.map +1 -1
- package/build/esm/data/pokedex.mjs +11 -11
- package/build/esm/data/pokedex.mjs.map +1 -1
- package/build/esm/lib/index.mjs +2 -2
- package/build/esm/sim/battle-actions.mjs +1 -1
- package/build/esm/sim/battle-stream.mjs +3 -3
- package/build/esm/sim/battle.mjs +14 -12
- package/build/esm/sim/battle.mjs.map +1 -1
- package/build/esm/sim/dex-abilities.mjs +1 -1
- package/build/esm/sim/dex-conditions.mjs +1 -1
- package/build/esm/sim/dex-conditions.mjs.map +1 -1
- package/build/esm/sim/dex-data.mjs +1 -1
- package/build/esm/sim/dex-formats.mjs +4 -4
- package/build/esm/sim/dex-items.mjs +1 -1
- package/build/esm/sim/dex-moves.mjs +2 -2
- package/build/esm/sim/dex-species.mjs +1 -1
- package/build/esm/sim/dex.mjs +30 -31
- package/build/esm/sim/dex.mjs.map +1 -1
- package/build/esm/sim/field.mjs +2 -2
- package/build/esm/sim/index.mjs +13 -13
- package/build/esm/sim/pokemon.mjs +14 -10
- package/build/esm/sim/pokemon.mjs.map +1 -1
- package/build/esm/sim/side.mjs +4 -4
- package/build/esm/sim/state.mjs +6 -6
- package/build/esm/sim/team-validator.mjs +5 -5
- package/build/esm/sim/teams.mjs +1 -1
- package/build/esm/sim/tools/exhaustive-runner.mjs +4 -4
- package/build/esm/sim/tools/index.mjs +2 -2
- package/build/esm/sim/tools/random-player-ai.mjs +2 -2
- package/build/esm/sim/tools/runner.mjs +6 -6
- package/build/types/sim/dex-conditions.d.ts +7 -6
- package/build/types/sim/pokemon.d.ts +1 -0
- package/package.json +1 -1
package/build/esm/sim/side.mjs
CHANGED
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
*
|
|
19
19
|
* @license MIT
|
|
20
20
|
*/
|
|
21
|
-
import { Utils } from '../lib';
|
|
22
|
-
import { Pokemon } from './pokemon';
|
|
23
|
-
import { State } from './state';
|
|
24
|
-
import { toID } from './dex';
|
|
21
|
+
import { Utils } from '../lib/index.mjs';
|
|
22
|
+
import { Pokemon } from './pokemon.mjs';
|
|
23
|
+
import { State } from './state.mjs';
|
|
24
|
+
import { toID } from './dex.mjs';
|
|
25
25
|
export class Side {
|
|
26
26
|
constructor(name, battle, sideNum, team) {
|
|
27
27
|
this.foe = null; // set in battle.start()
|
package/build/esm/sim/state.mjs
CHANGED
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
|
-
import { Battle } from './battle';
|
|
12
|
-
import { Dex } from './dex';
|
|
13
|
-
import { Field } from './field';
|
|
14
|
-
import { Pokemon } from './pokemon';
|
|
15
|
-
import { PRNG } from './prng';
|
|
16
|
-
import { Side } from './side';
|
|
11
|
+
import { Battle } from './battle.mjs';
|
|
12
|
+
import { Dex } from './dex.mjs';
|
|
13
|
+
import { Field } from './field.mjs';
|
|
14
|
+
import { Pokemon } from './pokemon.mjs';
|
|
15
|
+
import { PRNG } from './prng.mjs';
|
|
16
|
+
import { Side } from './side.mjs';
|
|
17
17
|
// The simulator supports up to 24 different Pokemon on a team. Serialization
|
|
18
18
|
// uses letters instead of numbers to indicate indices/positions, but where
|
|
19
19
|
// the simulator only gives a position to active Pokemon, serialization
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @license MIT
|
|
8
8
|
*/
|
|
9
|
-
import { Dex, toID } from './dex';
|
|
10
|
-
import { Utils } from '../lib';
|
|
11
|
-
import { Tags } from '../data/tags';
|
|
12
|
-
import { Teams } from './teams';
|
|
13
|
-
import { PRNG } from './prng';
|
|
9
|
+
import { Dex, toID } from './dex.mjs';
|
|
10
|
+
import { Utils } from '../lib/index.mjs';
|
|
11
|
+
import { Tags } from '../data/tags.mjs';
|
|
12
|
+
import { Teams } from './teams.mjs';
|
|
13
|
+
import { PRNG } from './prng.mjs';
|
|
14
14
|
/**
|
|
15
15
|
* Represents a set of possible ways to get a Pokémon with a given
|
|
16
16
|
* set.
|
package/build/esm/sim/teams.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Dex, toID } from '../dex';
|
|
2
|
-
import { PRNG } from '../prng';
|
|
3
|
-
import { RandomPlayerAI } from './random-player-ai';
|
|
4
|
-
import { Runner } from './runner';
|
|
1
|
+
import { Dex, toID } from '../dex.mjs';
|
|
2
|
+
import { PRNG } from '../prng.mjs';
|
|
3
|
+
import { RandomPlayerAI } from './random-player-ai.mjs';
|
|
4
|
+
import { Runner } from './runner.mjs';
|
|
5
5
|
export class ExhaustiveRunner {
|
|
6
6
|
constructor(options) {
|
|
7
7
|
this.format = options.format;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './exhaustive-runner';
|
|
2
|
-
export * from './runner';
|
|
1
|
+
export * from './exhaustive-runner.mjs';
|
|
2
|
+
export * from './runner.mjs';
|
|
3
3
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BattlePlayer } from '../battle-stream';
|
|
2
|
-
import { PRNG } from '../prng';
|
|
1
|
+
import { BattlePlayer } from '../battle-stream.mjs';
|
|
2
|
+
import { PRNG } from '../prng.mjs';
|
|
3
3
|
export class RandomPlayerAI extends BattlePlayer {
|
|
4
4
|
constructor(playerStream, options = {}, debug = false) {
|
|
5
5
|
super(playerStream, debug);
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { strict as assert } from 'assert';
|
|
8
8
|
import * as fs from 'fs';
|
|
9
|
-
import { Dex } from '
|
|
10
|
-
import { Battle } from '../battle';
|
|
11
|
-
import * as BattleStreams from '../battle-stream';
|
|
12
|
-
import { State } from '../state';
|
|
13
|
-
import { PRNG } from '../prng';
|
|
14
|
-
import { RandomPlayerAI } from './random-player-ai';
|
|
9
|
+
import { Dex } from '../index.mjs';
|
|
10
|
+
import { Battle } from '../battle.mjs';
|
|
11
|
+
import * as BattleStreams from '../battle-stream.mjs';
|
|
12
|
+
import { State } from '../state.mjs';
|
|
13
|
+
import { PRNG } from '../prng.mjs';
|
|
14
|
+
import { RandomPlayerAI } from './random-player-ai.mjs';
|
|
15
15
|
export class Runner {
|
|
16
16
|
constructor(options) {
|
|
17
17
|
this.format = options.format;
|
|
@@ -27,7 +27,8 @@ export interface EventMethods {
|
|
|
27
27
|
onBeforeSwitchIn?: (this: Battle, pokemon: Pokemon) => void;
|
|
28
28
|
onBeforeSwitchOut?: (this: Battle, pokemon: Pokemon) => void;
|
|
29
29
|
onBeforeTurn?: (this: Battle, pokemon: Pokemon) => void;
|
|
30
|
-
|
|
30
|
+
onChangeBoost?: (this: Battle, boost: SparseBoostsTable, target: Pokemon, source: Pokemon, effect: Effect) => void;
|
|
31
|
+
onTryBoost?: (this: Battle, boost: SparseBoostsTable, target: Pokemon, source: Pokemon, effect: Effect) => void;
|
|
31
32
|
onChargeMove?: CommonHandlers['VoidSourceMove'];
|
|
32
33
|
onCriticalHit?: ((this: Battle, pokemon: Pokemon, source: null, move: ActiveMove) => boolean | void) | boolean;
|
|
33
34
|
onDamage?: (this: Battle, damage: number, target: Pokemon, source: Pokemon, effect: Effect) => number | boolean | null | void;
|
|
@@ -112,7 +113,7 @@ export interface EventMethods {
|
|
|
112
113
|
onFoeBeforeMove?: CommonHandlers['VoidSourceMove'];
|
|
113
114
|
onFoeBeforeSwitchIn?: (this: Battle, pokemon: Pokemon) => void;
|
|
114
115
|
onFoeBeforeSwitchOut?: (this: Battle, pokemon: Pokemon) => void;
|
|
115
|
-
|
|
116
|
+
onFoeTryBoost?: (this: Battle, boost: SparseBoostsTable, target: Pokemon, source: Pokemon, effect: Effect) => void;
|
|
116
117
|
onFoeChargeMove?: CommonHandlers['VoidSourceMove'];
|
|
117
118
|
onFoeCriticalHit?: ((this: Battle, pokemon: Pokemon, source: null, move: ActiveMove) => boolean | void) | boolean;
|
|
118
119
|
onFoeDamage?: (this: Battle, damage: number, target: Pokemon, source: Pokemon, effect: Effect) => number | boolean | null | void;
|
|
@@ -190,7 +191,7 @@ export interface EventMethods {
|
|
|
190
191
|
onSourceBeforeMove?: CommonHandlers['VoidSourceMove'];
|
|
191
192
|
onSourceBeforeSwitchIn?: (this: Battle, pokemon: Pokemon) => void;
|
|
192
193
|
onSourceBeforeSwitchOut?: (this: Battle, pokemon: Pokemon) => void;
|
|
193
|
-
|
|
194
|
+
onSourceTryBoost?: (this: Battle, boost: SparseBoostsTable, target: Pokemon, source: Pokemon, effect: Effect) => void;
|
|
194
195
|
onSourceChargeMove?: CommonHandlers['VoidSourceMove'];
|
|
195
196
|
onSourceCriticalHit?: ((this: Battle, pokemon: Pokemon, source: null, move: ActiveMove) => boolean | void) | boolean;
|
|
196
197
|
onSourceDamage?: (this: Battle, damage: number, target: Pokemon, source: Pokemon, effect: Effect) => number | boolean | null | void;
|
|
@@ -268,7 +269,7 @@ export interface EventMethods {
|
|
|
268
269
|
onAnyBeforeMove?: CommonHandlers['VoidSourceMove'];
|
|
269
270
|
onAnyBeforeSwitchIn?: (this: Battle, pokemon: Pokemon) => void;
|
|
270
271
|
onAnyBeforeSwitchOut?: (this: Battle, pokemon: Pokemon) => void;
|
|
271
|
-
|
|
272
|
+
onAnyTryBoost?: (this: Battle, boost: SparseBoostsTable, target: Pokemon, source: Pokemon, effect: Effect) => void;
|
|
272
273
|
onAnyChargeMove?: CommonHandlers['VoidSourceMove'];
|
|
273
274
|
onAnyCriticalHit?: ((this: Battle, pokemon: Pokemon, source: null, move: ActiveMove) => boolean | void) | boolean;
|
|
274
275
|
onAnyDamage?: (this: Battle, damage: number, target: Pokemon, source: Pokemon, effect: Effect) => number | boolean | null | void;
|
|
@@ -346,7 +347,7 @@ export interface EventMethods {
|
|
|
346
347
|
onBasePowerPriority?: number;
|
|
347
348
|
onBeforeMovePriority?: number;
|
|
348
349
|
onBeforeSwitchOutPriority?: number;
|
|
349
|
-
|
|
350
|
+
onChangeBoostPriority?: number;
|
|
350
351
|
onDamagePriority?: number;
|
|
351
352
|
onDragOutPriority?: number;
|
|
352
353
|
onEffectivenessPriority?: number;
|
|
@@ -410,7 +411,7 @@ export interface PokemonEventMethods extends EventMethods {
|
|
|
410
411
|
onAllyBeforeMove?: CommonHandlers['VoidSourceMove'];
|
|
411
412
|
onAllyBeforeSwitchIn?: (this: Battle, pokemon: Pokemon) => void;
|
|
412
413
|
onAllyBeforeSwitchOut?: (this: Battle, pokemon: Pokemon) => void;
|
|
413
|
-
|
|
414
|
+
onAllyTryBoost?: (this: Battle, boost: SparseBoostsTable, target: Pokemon, source: Pokemon, effect: Effect) => void;
|
|
414
415
|
onAllyChargeMove?: CommonHandlers['VoidSourceMove'];
|
|
415
416
|
onAllyCriticalHit?: ((this: Battle, pokemon: Pokemon, source: null, move: ActiveMove) => boolean | void) | boolean;
|
|
416
417
|
onAllyDamage?: (this: Battle, damage: number, target: Pokemon, source: Pokemon, effect: Effect) => number | boolean | null | void;
|
|
@@ -327,6 +327,7 @@ export declare class Pokemon {
|
|
|
327
327
|
getSwitchRequestData(forAlly?: boolean): AnyObject;
|
|
328
328
|
isLastActive(): boolean;
|
|
329
329
|
positiveBoosts(): number;
|
|
330
|
+
getCappedBoost(boosts: SparseBoostsTable): Partial<BoostsTable>;
|
|
330
331
|
boostBy(boosts: SparseBoostsTable): number;
|
|
331
332
|
clearBoosts(): void;
|
|
332
333
|
setBoost(boosts: SparseBoostsTable): void;
|
package/package.json
CHANGED