@pkmn/sim 0.8.3 → 0.8.5
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/config/formats.js +163 -212
- package/build/cjs/config/formats.js.map +1 -1
- package/build/cjs/data/abilities.js +370 -165
- package/build/cjs/data/abilities.js.map +1 -1
- package/build/cjs/data/conditions.js +0 -3
- package/build/cjs/data/conditions.js.map +1 -1
- package/build/cjs/data/formats-data.js +330 -312
- package/build/cjs/data/formats-data.js.map +1 -1
- package/build/cjs/data/items.js +2 -2
- package/build/cjs/data/items.js.map +1 -1
- package/build/cjs/data/legality.js +424 -104
- package/build/cjs/data/legality.js.map +1 -1
- package/build/cjs/data/mods/gen1/formats-data.js +22 -22
- package/build/cjs/data/mods/gen1/moves.js +6 -8
- package/build/cjs/data/mods/gen1/moves.js.map +1 -1
- package/build/cjs/data/mods/gen2/formats-data.js +43 -43
- package/build/cjs/data/mods/gen2/formats-data.js.map +1 -1
- package/build/cjs/data/mods/gen2/moves.js +4 -7
- package/build/cjs/data/mods/gen2/moves.js.map +1 -1
- package/build/cjs/data/mods/gen3/abilities.js +6 -5
- package/build/cjs/data/mods/gen3/abilities.js.map +1 -1
- package/build/cjs/data/mods/gen3/formats-data.js +32 -32
- package/build/cjs/data/mods/gen3/formats-data.js.map +1 -1
- package/build/cjs/data/mods/gen3/moves.js +15 -10
- package/build/cjs/data/mods/gen3/moves.js.map +1 -1
- package/build/cjs/data/mods/gen3/scripts.js +11 -6
- package/build/cjs/data/mods/gen3/scripts.js.map +1 -1
- package/build/cjs/data/mods/gen4/abilities.js +8 -2
- package/build/cjs/data/mods/gen4/abilities.js.map +1 -1
- package/build/cjs/data/mods/gen4/moves.js +49 -45
- package/build/cjs/data/mods/gen4/moves.js.map +1 -1
- package/build/cjs/data/mods/gen4/scripts.js +11 -6
- package/build/cjs/data/mods/gen4/scripts.js.map +1 -1
- package/build/cjs/data/mods/gen5/abilities.js +1 -0
- package/build/cjs/data/mods/gen5/abilities.js.map +1 -1
- package/build/cjs/data/mods/gen5/moves.js +44 -66
- package/build/cjs/data/mods/gen5/moves.js.map +1 -1
- package/build/cjs/data/mods/gen6/abilities.js +1 -1
- package/build/cjs/data/mods/gen6/abilities.js.map +1 -1
- package/build/cjs/data/mods/gen6/moves.js +1 -1
- package/build/cjs/data/mods/gen6/moves.js.map +1 -1
- package/build/cjs/data/mods/gen7/abilities.js +2 -2
- package/build/cjs/data/mods/gen7/abilities.js.map +1 -1
- package/build/cjs/data/mods/gen7/moves.js +21 -9
- package/build/cjs/data/mods/gen7/moves.js.map +1 -1
- package/build/cjs/data/mods/gen8/abilities.js +3 -1
- package/build/cjs/data/mods/gen8/abilities.js.map +1 -1
- package/build/cjs/data/mods/gen8/moves.js +6 -2
- package/build/cjs/data/mods/gen8/moves.js.map +1 -1
- package/build/cjs/data/moves.js +760 -770
- package/build/cjs/data/moves.js.map +1 -1
- package/build/cjs/data/rulesets.js +33 -56
- package/build/cjs/data/rulesets.js.map +1 -1
- package/build/cjs/data/text/abilities.js +34 -12
- package/build/cjs/data/text/abilities.js.map +1 -1
- package/build/cjs/data/text/moves.js +9 -9
- package/build/cjs/data/text/moves.js.map +1 -1
- package/build/cjs/sim/battle-actions.js +21 -21
- package/build/cjs/sim/battle-actions.js.map +1 -1
- package/build/cjs/sim/battle.js +4 -5
- package/build/cjs/sim/battle.js.map +1 -1
- package/build/cjs/sim/dex-abilities.d.ts +11 -2
- package/build/cjs/sim/dex-abilities.js +1 -0
- package/build/cjs/sim/dex-abilities.js.map +1 -1
- package/build/cjs/sim/dex-conditions.d.ts +6 -0
- package/build/cjs/sim/dex-conditions.js.map +1 -1
- package/build/cjs/sim/dex-formats.d.ts +2 -0
- package/build/cjs/sim/dex-formats.js +1 -0
- package/build/cjs/sim/dex-formats.js.map +1 -1
- package/build/cjs/sim/dex-moves.d.ts +1 -4
- package/build/cjs/sim/dex-moves.js +0 -1
- package/build/cjs/sim/dex-moves.js.map +1 -1
- package/build/cjs/sim/exported-global-types.d.ts +2 -2
- package/build/cjs/sim/global-types.d.ts +2 -2
- package/build/cjs/sim/pokemon.js +7 -4
- package/build/cjs/sim/pokemon.js.map +1 -1
- package/build/cjs/sim/team-validator.js +1 -1
- package/build/cjs/sim/team-validator.js.map +1 -1
- package/build/cjs/sim/tools/runner.js +1 -1
- package/build/cjs/sim/tools/runner.js.map +1 -1
- package/build/esm/config/formats.mjs +163 -212
- package/build/esm/config/formats.mjs.map +1 -1
- package/build/esm/data/abilities.mjs +370 -165
- package/build/esm/data/abilities.mjs.map +1 -1
- package/build/esm/data/conditions.mjs +0 -3
- package/build/esm/data/conditions.mjs.map +1 -1
- package/build/esm/data/formats-data.mjs +330 -312
- package/build/esm/data/formats-data.mjs.map +1 -1
- package/build/esm/data/items.mjs +2 -2
- package/build/esm/data/items.mjs.map +1 -1
- package/build/esm/data/legality.mjs +424 -104
- package/build/esm/data/legality.mjs.map +1 -1
- package/build/esm/data/mods/gen1/formats-data.mjs +22 -22
- package/build/esm/data/mods/gen1/moves.mjs +6 -8
- package/build/esm/data/mods/gen1/moves.mjs.map +1 -1
- package/build/esm/data/mods/gen2/formats-data.mjs +43 -43
- package/build/esm/data/mods/gen2/formats-data.mjs.map +1 -1
- package/build/esm/data/mods/gen2/moves.mjs +4 -7
- package/build/esm/data/mods/gen2/moves.mjs.map +1 -1
- package/build/esm/data/mods/gen3/abilities.mjs +6 -5
- package/build/esm/data/mods/gen3/abilities.mjs.map +1 -1
- package/build/esm/data/mods/gen3/formats-data.mjs +32 -32
- package/build/esm/data/mods/gen3/formats-data.mjs.map +1 -1
- package/build/esm/data/mods/gen3/moves.mjs +15 -10
- package/build/esm/data/mods/gen3/moves.mjs.map +1 -1
- package/build/esm/data/mods/gen3/scripts.mjs +11 -6
- package/build/esm/data/mods/gen3/scripts.mjs.map +1 -1
- package/build/esm/data/mods/gen4/abilities.mjs +8 -2
- package/build/esm/data/mods/gen4/abilities.mjs.map +1 -1
- package/build/esm/data/mods/gen4/moves.mjs +49 -45
- package/build/esm/data/mods/gen4/moves.mjs.map +1 -1
- package/build/esm/data/mods/gen4/scripts.mjs +11 -6
- package/build/esm/data/mods/gen4/scripts.mjs.map +1 -1
- package/build/esm/data/mods/gen5/abilities.mjs +1 -0
- package/build/esm/data/mods/gen5/abilities.mjs.map +1 -1
- package/build/esm/data/mods/gen5/moves.mjs +44 -66
- package/build/esm/data/mods/gen5/moves.mjs.map +1 -1
- package/build/esm/data/mods/gen6/abilities.mjs +1 -1
- package/build/esm/data/mods/gen6/abilities.mjs.map +1 -1
- package/build/esm/data/mods/gen6/moves.mjs +1 -1
- package/build/esm/data/mods/gen6/moves.mjs.map +1 -1
- package/build/esm/data/mods/gen7/abilities.mjs +2 -2
- package/build/esm/data/mods/gen7/abilities.mjs.map +1 -1
- package/build/esm/data/mods/gen7/moves.mjs +21 -9
- package/build/esm/data/mods/gen7/moves.mjs.map +1 -1
- package/build/esm/data/mods/gen8/abilities.mjs +3 -1
- package/build/esm/data/mods/gen8/abilities.mjs.map +1 -1
- package/build/esm/data/mods/gen8/moves.mjs +6 -2
- package/build/esm/data/mods/gen8/moves.mjs.map +1 -1
- package/build/esm/data/moves.mjs +760 -770
- package/build/esm/data/moves.mjs.map +1 -1
- package/build/esm/data/rulesets.mjs +33 -56
- package/build/esm/data/rulesets.mjs.map +1 -1
- package/build/esm/data/text/abilities.mjs +34 -12
- package/build/esm/data/text/abilities.mjs.map +1 -1
- package/build/esm/data/text/moves.mjs +9 -9
- package/build/esm/data/text/moves.mjs.map +1 -1
- package/build/esm/sim/battle-actions.mjs +21 -21
- package/build/esm/sim/battle-actions.mjs.map +1 -1
- package/build/esm/sim/battle.mjs +4 -5
- package/build/esm/sim/battle.mjs.map +1 -1
- package/build/esm/sim/dex-abilities.d.mts +11 -2
- package/build/esm/sim/dex-abilities.mjs +1 -0
- package/build/esm/sim/dex-abilities.mjs.map +1 -1
- package/build/esm/sim/dex-conditions.d.mts +6 -0
- package/build/esm/sim/dex-conditions.mjs.map +1 -1
- package/build/esm/sim/dex-formats.d.mts +2 -0
- package/build/esm/sim/dex-formats.mjs +1 -0
- package/build/esm/sim/dex-formats.mjs.map +1 -1
- package/build/esm/sim/dex-moves.d.mts +1 -4
- package/build/esm/sim/dex-moves.mjs +0 -1
- package/build/esm/sim/dex-moves.mjs.map +1 -1
- package/build/esm/sim/exported-global-types.d.mts +2 -2
- package/build/esm/sim/global-types.d.mts +2 -2
- package/build/esm/sim/pokemon.mjs +7 -4
- package/build/esm/sim/pokemon.mjs.map +1 -1
- package/build/esm/sim/team-validator.mjs +1 -1
- package/build/esm/sim/team-validator.mjs.map +1 -1
- package/build/esm/sim/tools/runner.mjs +1 -1
- package/build/esm/sim/tools/runner.mjs.map +1 -1
- package/package.json +1 -1
- package/build/types/config/formats.d.ts +0 -1
- package/build/types/data/abilities.d.ts +0 -3
- package/build/types/data/aliases.d.ts +0 -3
- package/build/types/data/conditions.d.ts +0 -3
- package/build/types/data/formats-data.d.ts +0 -3
- package/build/types/data/index.d.ts +0 -11
- package/build/types/data/items.d.ts +0 -3
- package/build/types/data/learnsets.d.ts +0 -3
- package/build/types/data/legality.d.ts +0 -3
- package/build/types/data/mods/gen1/conditions.d.ts +0 -12
- package/build/types/data/mods/gen1/formats-data.d.ts +0 -3
- package/build/types/data/mods/gen1/index.d.ts +0 -7
- package/build/types/data/mods/gen1/moves.d.ts +0 -7
- package/build/types/data/mods/gen1/pokedex.d.ts +0 -3
- package/build/types/data/mods/gen1/rulesets.d.ts +0 -3
- package/build/types/data/mods/gen1/scripts.d.ts +0 -6
- package/build/types/data/mods/gen1/typechart.d.ts +0 -10
- package/build/types/data/mods/gen2/conditions.d.ts +0 -3
- package/build/types/data/mods/gen2/formats-data.d.ts +0 -3
- package/build/types/data/mods/gen2/index.d.ts +0 -8
- package/build/types/data/mods/gen2/items.d.ts +0 -3
- package/build/types/data/mods/gen2/learnsets.d.ts +0 -3
- package/build/types/data/mods/gen2/legality.d.ts +0 -3
- package/build/types/data/mods/gen2/moves.d.ts +0 -6
- package/build/types/data/mods/gen2/pokedex.d.ts +0 -3
- package/build/types/data/mods/gen2/rulesets.d.ts +0 -3
- package/build/types/data/mods/gen2/scripts.d.ts +0 -4
- package/build/types/data/mods/gen2/typechart.d.ts +0 -3
- package/build/types/data/mods/gen3/abilities.d.ts +0 -3
- package/build/types/data/mods/gen3/conditions.d.ts +0 -3
- package/build/types/data/mods/gen3/formats-data.d.ts +0 -3
- package/build/types/data/mods/gen3/index.d.ts +0 -7
- package/build/types/data/mods/gen3/items.d.ts +0 -3
- package/build/types/data/mods/gen3/moves.d.ts +0 -6
- package/build/types/data/mods/gen3/rulesets.d.ts +0 -3
- package/build/types/data/mods/gen3/scripts.d.ts +0 -1
- package/build/types/data/mods/gen4/abilities.d.ts +0 -3
- package/build/types/data/mods/gen4/conditions.d.ts +0 -3
- package/build/types/data/mods/gen4/formats-data.d.ts +0 -3
- package/build/types/data/mods/gen4/index.d.ts +0 -8
- package/build/types/data/mods/gen4/items.d.ts +0 -3
- package/build/types/data/mods/gen4/moves.d.ts +0 -3
- package/build/types/data/mods/gen4/pokedex.d.ts +0 -3
- package/build/types/data/mods/gen4/rulesets.d.ts +0 -3
- package/build/types/data/mods/gen4/scripts.d.ts +0 -1
- package/build/types/data/mods/gen5/abilities.d.ts +0 -3
- package/build/types/data/mods/gen5/conditions.d.ts +0 -3
- package/build/types/data/mods/gen5/formats-data.d.ts +0 -3
- package/build/types/data/mods/gen5/index.d.ts +0 -9
- package/build/types/data/mods/gen5/items.d.ts +0 -3
- package/build/types/data/mods/gen5/moves.d.ts +0 -3
- package/build/types/data/mods/gen5/pokedex.d.ts +0 -3
- package/build/types/data/mods/gen5/rulesets.d.ts +0 -3
- package/build/types/data/mods/gen5/scripts.d.ts +0 -1
- package/build/types/data/mods/gen5/typechart.d.ts +0 -3
- package/build/types/data/mods/gen6/abilities.d.ts +0 -3
- package/build/types/data/mods/gen6/conditions.d.ts +0 -3
- package/build/types/data/mods/gen6/formats-data.d.ts +0 -3
- package/build/types/data/mods/gen6/index.d.ts +0 -8
- package/build/types/data/mods/gen6/items.d.ts +0 -3
- package/build/types/data/mods/gen6/learnsets.d.ts +0 -3
- package/build/types/data/mods/gen6/legality.d.ts +0 -3
- package/build/types/data/mods/gen6/moves.d.ts +0 -3
- package/build/types/data/mods/gen6/pokedex.d.ts +0 -3
- package/build/types/data/mods/gen6/scripts.d.ts +0 -1
- package/build/types/data/mods/gen6/typechart.d.ts +0 -3
- package/build/types/data/mods/gen7/abilities.d.ts +0 -3
- package/build/types/data/mods/gen7/formats-data.d.ts +0 -3
- package/build/types/data/mods/gen7/index.d.ts +0 -7
- package/build/types/data/mods/gen7/items.d.ts +0 -3
- package/build/types/data/mods/gen7/moves.d.ts +0 -3
- package/build/types/data/mods/gen7/pokedex.d.ts +0 -3
- package/build/types/data/mods/gen7/rulesets.d.ts +0 -3
- package/build/types/data/mods/gen7/scripts.d.ts +0 -1
- package/build/types/data/mods/gen8/abilities.d.ts +0 -3
- package/build/types/data/mods/gen8/formats-data.d.ts +0 -3
- package/build/types/data/mods/gen8/index.d.ts +0 -7
- package/build/types/data/mods/gen8/items.d.ts +0 -3
- package/build/types/data/mods/gen8/learnsets.d.ts +0 -3
- package/build/types/data/mods/gen8/legality.d.ts +0 -3
- package/build/types/data/mods/gen8/moves.d.ts +0 -3
- package/build/types/data/mods/gen8/pokedex.d.ts +0 -3
- package/build/types/data/mods/gen8/rulesets.d.ts +0 -3
- package/build/types/data/mods/gen8/scripts.d.ts +0 -1
- package/build/types/data/moves.d.ts +0 -3
- package/build/types/data/natures.d.ts +0 -3
- package/build/types/data/pokedex.d.ts +0 -3
- package/build/types/data/pokemongo.d.ts +0 -31
- package/build/types/data/rulesets.d.ts +0 -3
- package/build/types/data/scripts.d.ts +0 -1
- package/build/types/data/tags.d.ts +0 -15
- package/build/types/data/text/abilities.d.ts +0 -3
- package/build/types/data/text/default.d.ts +0 -3
- package/build/types/data/text/items.d.ts +0 -3
- package/build/types/data/text/moves.d.ts +0 -3
- package/build/types/data/typechart.d.ts +0 -3
- package/build/types/lib/index.d.ts +0 -2
- package/build/types/lib/streams.d.ts +0 -1
- package/build/types/lib/utils.d.ts +0 -139
- package/build/types/sim/battle-actions.d.ts +0 -90
- package/build/types/sim/battle-queue.d.ts +0 -164
- package/build/types/sim/battle-stream.d.ts +0 -67
- package/build/types/sim/battle.d.ts +0 -396
- package/build/types/sim/dex-abilities.d.ts +0 -35
- package/build/types/sim/dex-conditions.d.ts +0 -518
- package/build/types/sim/dex-data.d.ts +0 -169
- package/build/types/sim/dex-formats.d.ts +0 -170
- package/build/types/sim/dex-items.d.ts +0 -110
- package/build/types/sim/dex-moves.d.ts +0 -441
- package/build/types/sim/dex-species.d.ts +0 -289
- package/build/types/sim/dex.d.ts +0 -162
- package/build/types/sim/exported-global-types.d.ts +0 -510
- package/build/types/sim/field.d.ts +0 -30
- package/build/types/sim/global-types.d.ts +0 -510
- package/build/types/sim/index.d.ts +0 -13
- package/build/types/sim/pokemon.d.ts +0 -427
- package/build/types/sim/prng.d.ts +0 -97
- package/build/types/sim/side.d.ts +0 -127
- package/build/types/sim/state.d.ts +0 -42
- package/build/types/sim/team-validator.d.ts +0 -198
- package/build/types/sim/teams.d.ts +0 -26
- package/build/types/sim/tools/exhaustive-runner.d.ts +0 -52
- package/build/types/sim/tools/index.d.ts +0 -2
- package/build/types/sim/tools/random-player-ai.d.ts +0 -32
- package/build/types/sim/tools/runner.d.ts +0 -41
|
@@ -1,427 +0,0 @@
|
|
|
1
|
-
import { Ability, ActiveMove, AnyObject, Battle, BoostsTable, Condition, DynamaxOptions, Effect, GenderName, ID, Item, Move, PokemonSet, PokemonSlot, Side, SideID, SparseBoostsTable, Species, StatIDExceptHP, StatsExceptHPTable, StatsTable } from './exported-global-types';
|
|
2
|
-
/** A Pokemon's move slot. */
|
|
3
|
-
interface MoveSlot {
|
|
4
|
-
id: ID;
|
|
5
|
-
move: string;
|
|
6
|
-
pp: number;
|
|
7
|
-
maxpp: number;
|
|
8
|
-
target?: string;
|
|
9
|
-
disabled: boolean | string;
|
|
10
|
-
disabledSource?: string;
|
|
11
|
-
used: boolean;
|
|
12
|
-
virtual?: boolean;
|
|
13
|
-
}
|
|
14
|
-
interface Attacker {
|
|
15
|
-
source: Pokemon;
|
|
16
|
-
damage: number;
|
|
17
|
-
thisTurn: boolean;
|
|
18
|
-
move?: ID;
|
|
19
|
-
slot: PokemonSlot;
|
|
20
|
-
damageValue?: (number | boolean | undefined);
|
|
21
|
-
}
|
|
22
|
-
export interface EffectState {
|
|
23
|
-
duration?: number | any;
|
|
24
|
-
[k: string]: any;
|
|
25
|
-
}
|
|
26
|
-
export declare const RESTORATIVE_BERRIES: Set<ID>;
|
|
27
|
-
export declare class Pokemon {
|
|
28
|
-
readonly side: Side;
|
|
29
|
-
readonly battle: Battle;
|
|
30
|
-
readonly set: PokemonSet;
|
|
31
|
-
readonly name: string;
|
|
32
|
-
readonly fullname: string;
|
|
33
|
-
readonly level: number;
|
|
34
|
-
readonly gender: GenderName;
|
|
35
|
-
readonly happiness: number;
|
|
36
|
-
readonly pokeball: string;
|
|
37
|
-
readonly dynamaxLevel: number;
|
|
38
|
-
readonly gigantamax: boolean;
|
|
39
|
-
/** Transform keeps the original pre-transformed Hidden Power in Gen 2-4. */
|
|
40
|
-
readonly baseHpType: string;
|
|
41
|
-
readonly baseHpPower: number;
|
|
42
|
-
readonly baseMoveSlots: MoveSlot[];
|
|
43
|
-
moveSlots: MoveSlot[];
|
|
44
|
-
hpType: string;
|
|
45
|
-
hpPower: number;
|
|
46
|
-
/**
|
|
47
|
-
* Index of `pokemon.side.pokemon` and `pokemon.side.active`, which are
|
|
48
|
-
* guaranteed to be the same for active pokemon. Note that this isn't
|
|
49
|
-
* its field position in multi battles - use `getSlot()` for that.
|
|
50
|
-
*/
|
|
51
|
-
position: number;
|
|
52
|
-
details: string;
|
|
53
|
-
baseSpecies: Species;
|
|
54
|
-
species: Species;
|
|
55
|
-
speciesState: EffectState;
|
|
56
|
-
status: ID;
|
|
57
|
-
statusState: EffectState;
|
|
58
|
-
volatiles: {
|
|
59
|
-
[id: string]: EffectState;
|
|
60
|
-
};
|
|
61
|
-
showCure?: boolean;
|
|
62
|
-
/**
|
|
63
|
-
* These are the basic stats that appear on the in-game stats screen:
|
|
64
|
-
* calculated purely from the species base stats, level, IVs, EVs,
|
|
65
|
-
* and Nature, before modifications from item, ability, etc.
|
|
66
|
-
*
|
|
67
|
-
* Forme changes affect these, but Transform doesn't.
|
|
68
|
-
*/
|
|
69
|
-
baseStoredStats: StatsTable;
|
|
70
|
-
/**
|
|
71
|
-
* These are pre-modification stored stats in-battle. At switch-in,
|
|
72
|
-
* they're identical to `baseStoredStats`, but can be temporarily changed
|
|
73
|
-
* until switch-out by effects such as Power Trick and Transform.
|
|
74
|
-
*
|
|
75
|
-
* Stat multipliers from abilities, items, and volatiles, such as
|
|
76
|
-
* Solar Power, Choice Band, or Swords Dance, are not stored in
|
|
77
|
-
* `storedStats`, but applied on top and accessed by `pokemon.getStat`.
|
|
78
|
-
*
|
|
79
|
-
* (Except in Gen 1, where stat multipliers are stored, leading
|
|
80
|
-
* to several famous glitches.)
|
|
81
|
-
*/
|
|
82
|
-
storedStats: StatsExceptHPTable;
|
|
83
|
-
boosts: BoostsTable;
|
|
84
|
-
baseAbility: ID;
|
|
85
|
-
ability: ID;
|
|
86
|
-
abilityState: EffectState;
|
|
87
|
-
item: ID;
|
|
88
|
-
itemState: EffectState;
|
|
89
|
-
lastItem: ID;
|
|
90
|
-
usedItemThisTurn: boolean;
|
|
91
|
-
ateBerry: boolean;
|
|
92
|
-
trapped: boolean | "hidden";
|
|
93
|
-
maybeTrapped: boolean;
|
|
94
|
-
maybeDisabled: boolean;
|
|
95
|
-
illusion: Pokemon | null;
|
|
96
|
-
transformed: boolean;
|
|
97
|
-
maxhp: number;
|
|
98
|
-
/** This is the max HP before Dynamaxing; it's updated for Power Construct etc */
|
|
99
|
-
baseMaxhp: number;
|
|
100
|
-
hp: number;
|
|
101
|
-
fainted: boolean;
|
|
102
|
-
faintQueued: boolean;
|
|
103
|
-
subFainted: boolean | null;
|
|
104
|
-
types: string[];
|
|
105
|
-
addedType: string;
|
|
106
|
-
knownType: boolean;
|
|
107
|
-
/** Keeps track of what type the client sees for this Pokemon. */
|
|
108
|
-
apparentType: string;
|
|
109
|
-
/**
|
|
110
|
-
* If the switch is called by an effect with a special switch
|
|
111
|
-
* message, like U-turn or Baton Pass, this will be the ID of
|
|
112
|
-
* the calling effect.
|
|
113
|
-
*/
|
|
114
|
-
switchFlag: ID | boolean;
|
|
115
|
-
forceSwitchFlag: boolean;
|
|
116
|
-
skipBeforeSwitchOutEventFlag: boolean;
|
|
117
|
-
draggedIn: number | null;
|
|
118
|
-
newlySwitched: boolean;
|
|
119
|
-
beingCalledBack: boolean;
|
|
120
|
-
lastMove: ActiveMove | null;
|
|
121
|
-
lastMoveEncore?: ActiveMove | null;
|
|
122
|
-
lastMoveUsed: ActiveMove | null;
|
|
123
|
-
lastMoveTargetLoc?: number;
|
|
124
|
-
moveThisTurn: string | boolean;
|
|
125
|
-
statsRaisedThisTurn: boolean;
|
|
126
|
-
statsLoweredThisTurn: boolean;
|
|
127
|
-
/**
|
|
128
|
-
* The result of the last move used on the previous turn by this
|
|
129
|
-
* Pokemon. Stomping Tantrum checks this property for a value of false
|
|
130
|
-
* when determine whether to double its power, but it has four
|
|
131
|
-
* possible values:
|
|
132
|
-
*
|
|
133
|
-
* undefined indicates this Pokemon was not active last turn. It should
|
|
134
|
-
* not be used to indicate that a move was attempted and failed, either
|
|
135
|
-
* in a way that boosts Stomping Tantrum or not.
|
|
136
|
-
*
|
|
137
|
-
* null indicates that the Pokemon's move was skipped in such a way
|
|
138
|
-
* that does not boost Stomping Tantrum, either from having to recharge
|
|
139
|
-
* or spending a turn trapped by another Pokemon's Sky Drop.
|
|
140
|
-
*
|
|
141
|
-
* false indicates that the move completely failed to execute for any
|
|
142
|
-
* reason not mentioned above, including missing, the target being
|
|
143
|
-
* immune, the user being immobilized by an effect such as paralysis, etc.
|
|
144
|
-
*
|
|
145
|
-
* true indicates that the move successfully executed one or more of
|
|
146
|
-
* its effects on one or more targets, including hitting with an attack
|
|
147
|
-
* but dealing 0 damage to the target in cases such as Disguise, or that
|
|
148
|
-
* the move was blocked by one or more moves such as Protect.
|
|
149
|
-
*/
|
|
150
|
-
moveLastTurnResult: boolean | null | undefined;
|
|
151
|
-
/**
|
|
152
|
-
* The result of the most recent move used this turn by this Pokemon.
|
|
153
|
-
* At the start of each turn, the value stored here is moved to its
|
|
154
|
-
* counterpart, moveLastTurnResult, and this property is reinitialized
|
|
155
|
-
* to undefined. This property can have one of four possible values:
|
|
156
|
-
*
|
|
157
|
-
* undefined indicates that this Pokemon has not yet finished an
|
|
158
|
-
* attempt to use a move this turn. As this value is only overwritten
|
|
159
|
-
* after a move finishes execution, it is not sufficient for an event
|
|
160
|
-
* to examine only this property when checking if a Pokemon has not
|
|
161
|
-
* moved yet this turn if the event could take place during that
|
|
162
|
-
* Pokemon's move.
|
|
163
|
-
*
|
|
164
|
-
* null indicates that the Pokemon's move was skipped in such a way
|
|
165
|
-
* that does not boost Stomping Tantrum, either from having to recharge
|
|
166
|
-
* or spending a turn trapped by another Pokemon's Sky Drop.
|
|
167
|
-
*
|
|
168
|
-
* false indicates that the move completely failed to execute for any
|
|
169
|
-
* reason not mentioned above, including missing, the target being
|
|
170
|
-
* immune, the user being immobilized by an effect such as paralysis, etc.
|
|
171
|
-
*
|
|
172
|
-
* true indicates that the move successfully executed one or more of
|
|
173
|
-
* its effects on one or more targets, including hitting with an attack
|
|
174
|
-
* but dealing 0 damage to the target in cases such as Disguise. It can
|
|
175
|
-
* also mean that the move was blocked by one or more moves such as
|
|
176
|
-
* Protect. Uniquely, this value can also be true if this Pokemon mega
|
|
177
|
-
* evolved or ultra bursted this turn, but in that case the value should
|
|
178
|
-
* always be overwritten by a move action before the end of that turn.
|
|
179
|
-
*/
|
|
180
|
-
moveThisTurnResult: boolean | null | undefined;
|
|
181
|
-
/**
|
|
182
|
-
* The undynamaxed HP value this Pokemon was reduced to by damage this turn,
|
|
183
|
-
* or false if it hasn't taken damage yet this turn
|
|
184
|
-
*
|
|
185
|
-
* Used for Assurance, Emergency Exit, and Wimp Out
|
|
186
|
-
*/
|
|
187
|
-
hurtThisTurn: number | null;
|
|
188
|
-
lastDamage: number;
|
|
189
|
-
attackedBy: Attacker[];
|
|
190
|
-
timesAttacked: number;
|
|
191
|
-
isActive: boolean;
|
|
192
|
-
activeTurns: number;
|
|
193
|
-
/**
|
|
194
|
-
* This is for Fake-Out-likes specifically - it mostly counts how many move
|
|
195
|
-
* actions you've had since the last time you switched in, so 1/turn normally,
|
|
196
|
-
* +1 for Dancer/Instruct, -1 for shifting/Sky Drop.
|
|
197
|
-
*
|
|
198
|
-
* Incremented before the move is used, so the first move use has
|
|
199
|
-
* `activeMoveActions === 1`.
|
|
200
|
-
*
|
|
201
|
-
* Unfortunately, Truant counts Mega Evolution as an action and Fake
|
|
202
|
-
* Out doesn't, meaning that Truant can't use this number.
|
|
203
|
-
*/
|
|
204
|
-
activeMoveActions: number;
|
|
205
|
-
previouslySwitchedIn: number;
|
|
206
|
-
truantTurn: boolean;
|
|
207
|
-
swordBoost: boolean;
|
|
208
|
-
shieldBoost: boolean;
|
|
209
|
-
syrupTriggered: boolean;
|
|
210
|
-
/** Have this pokemon's Start events run yet? (Start events run every switch-in) */
|
|
211
|
-
isStarted: boolean;
|
|
212
|
-
duringMove: boolean;
|
|
213
|
-
weighthg: number;
|
|
214
|
-
speed: number;
|
|
215
|
-
abilityOrder: number;
|
|
216
|
-
canMegaEvo: string | null | undefined;
|
|
217
|
-
canUltraBurst: string | null | undefined;
|
|
218
|
-
readonly canGigantamax: string | null;
|
|
219
|
-
/**
|
|
220
|
-
* A Pokemon's Tera type if it can Terastallize, false if it is temporarily unable to tera and should have its
|
|
221
|
-
* ability restored upon switching out, or null if its inability to tera is permanent.
|
|
222
|
-
*/
|
|
223
|
-
canTerastallize: string | false | null;
|
|
224
|
-
teraType: string;
|
|
225
|
-
baseTypes: string[];
|
|
226
|
-
terastallized?: string;
|
|
227
|
-
/** A Pokemon's currently 'staleness' with respect to the Endless Battle Clause. */
|
|
228
|
-
staleness?: 'internal' | 'external';
|
|
229
|
-
/** Staleness that will be set once a future action occurs (eg. eating a berry). */
|
|
230
|
-
pendingStaleness?: 'internal' | 'external';
|
|
231
|
-
/** Temporary staleness that lasts only until the Pokemon switches. */
|
|
232
|
-
volatileStaleness?: 'external';
|
|
233
|
-
modifiedStats?: StatsExceptHPTable;
|
|
234
|
-
modifyStat?: (this: Pokemon, statName: StatIDExceptHP, modifier: number) => void;
|
|
235
|
-
recalculateStats?: (this: Pokemon) => void;
|
|
236
|
-
/**
|
|
237
|
-
* An object for storing untyped data, for mods to use.
|
|
238
|
-
*/
|
|
239
|
-
m: {
|
|
240
|
-
gluttonyFlag?: boolean;
|
|
241
|
-
innate?: string;
|
|
242
|
-
originalSpecies?: string;
|
|
243
|
-
[key: string]: any;
|
|
244
|
-
};
|
|
245
|
-
constructor(set: string | AnyObject, side: Side);
|
|
246
|
-
toJSON(): AnyObject;
|
|
247
|
-
get moves(): readonly string[];
|
|
248
|
-
get baseMoves(): readonly string[];
|
|
249
|
-
getSlot(): PokemonSlot;
|
|
250
|
-
toString(): string;
|
|
251
|
-
getDetails: () => {
|
|
252
|
-
side: SideID;
|
|
253
|
-
secret: string;
|
|
254
|
-
shared: string;
|
|
255
|
-
};
|
|
256
|
-
updateSpeed(): void;
|
|
257
|
-
calculateStat(statName: StatIDExceptHP, boost: number, modifier?: number, statUser?: Pokemon): number;
|
|
258
|
-
getStat(statName: StatIDExceptHP, unboosted?: boolean, unmodified?: boolean): number;
|
|
259
|
-
getActionSpeed(): number;
|
|
260
|
-
/**
|
|
261
|
-
* Gets the Pokemon's best stat.
|
|
262
|
-
* Moved to its own method due to frequent use of the same code.
|
|
263
|
-
* Used by Beast Boost, Quark Drive, and Protosynthesis.
|
|
264
|
-
*/
|
|
265
|
-
getBestStat(unboosted?: boolean, unmodified?: boolean): StatIDExceptHP;
|
|
266
|
-
getWeight(): number;
|
|
267
|
-
getMoveData(move: string | Move): MoveSlot | null;
|
|
268
|
-
getMoveHitData(move: ActiveMove): {
|
|
269
|
-
crit: boolean;
|
|
270
|
-
typeMod: number;
|
|
271
|
-
zBrokeProtect: boolean;
|
|
272
|
-
};
|
|
273
|
-
alliesAndSelf(): Pokemon[];
|
|
274
|
-
allies(): Pokemon[];
|
|
275
|
-
adjacentAllies(): Pokemon[];
|
|
276
|
-
foes(all?: boolean): Pokemon[];
|
|
277
|
-
adjacentFoes(): Pokemon[];
|
|
278
|
-
isAlly(pokemon: Pokemon | null): boolean;
|
|
279
|
-
isAdjacent(pokemon2: Pokemon): boolean;
|
|
280
|
-
getUndynamaxedHP(amount?: number): number;
|
|
281
|
-
/** Get targets for Dragon Darts */
|
|
282
|
-
getSmartTargets(target: Pokemon, move: ActiveMove): Pokemon[];
|
|
283
|
-
getAtLoc(targetLoc: number): Pokemon;
|
|
284
|
-
/**
|
|
285
|
-
* Returns a relative location: 1-3, positive for foe, and negative for ally.
|
|
286
|
-
* Use `getAtLoc` to reverse.
|
|
287
|
-
*/
|
|
288
|
-
getLocOf(target: Pokemon): number;
|
|
289
|
-
getMoveTargets(move: ActiveMove, target: Pokemon): {
|
|
290
|
-
targets: Pokemon[];
|
|
291
|
-
pressureTargets: Pokemon[];
|
|
292
|
-
};
|
|
293
|
-
ignoringAbility(): boolean;
|
|
294
|
-
ignoringItem(): boolean;
|
|
295
|
-
deductPP(move: string | Move, amount?: number | null, target?: Pokemon | null | false): number;
|
|
296
|
-
moveUsed(move: ActiveMove, targetLoc?: number): void;
|
|
297
|
-
gotAttacked(move: string | Move, damage: number | false | undefined, source: Pokemon): void;
|
|
298
|
-
getLastAttackedBy(): Attacker | undefined;
|
|
299
|
-
getLastDamagedBy(filterOutSameSide: boolean): Attacker | undefined;
|
|
300
|
-
/**
|
|
301
|
-
* This refers to multi-turn moves like SolarBeam and Outrage and
|
|
302
|
-
* Sky Drop, which remove all choice (no dynamax, switching, etc).
|
|
303
|
-
* Don't use it for "soft locks" like Choice Band.
|
|
304
|
-
*/
|
|
305
|
-
getLockedMove(): string | null;
|
|
306
|
-
getMoves(lockedMove?: string | null, restrictData?: boolean): {
|
|
307
|
-
move: string;
|
|
308
|
-
id: string;
|
|
309
|
-
disabled?: string | boolean;
|
|
310
|
-
disabledSource?: string;
|
|
311
|
-
target?: string;
|
|
312
|
-
pp?: number;
|
|
313
|
-
maxpp?: number;
|
|
314
|
-
}[];
|
|
315
|
-
/** This should be passed the base move and not the corresponding max move so we can check how much PP is left. */
|
|
316
|
-
maxMoveDisabled(baseMove: Move | string): boolean;
|
|
317
|
-
getDynamaxRequest(skipChecks?: boolean): DynamaxOptions | undefined;
|
|
318
|
-
getMoveRequestData(): {
|
|
319
|
-
moves: {
|
|
320
|
-
move: string;
|
|
321
|
-
id: string;
|
|
322
|
-
target?: string;
|
|
323
|
-
disabled?: string | boolean;
|
|
324
|
-
}[];
|
|
325
|
-
maybeDisabled?: boolean | undefined;
|
|
326
|
-
trapped?: boolean | undefined;
|
|
327
|
-
maybeTrapped?: boolean | undefined;
|
|
328
|
-
canMegaEvo?: boolean | undefined;
|
|
329
|
-
canUltraBurst?: boolean | undefined;
|
|
330
|
-
canZMove?: AnyObject | null | undefined;
|
|
331
|
-
canDynamax?: boolean | undefined;
|
|
332
|
-
maxMoves?: DynamaxOptions | undefined;
|
|
333
|
-
canTerastallize?: string | undefined;
|
|
334
|
-
};
|
|
335
|
-
getSwitchRequestData(forAlly?: boolean): AnyObject;
|
|
336
|
-
isLastActive(): boolean;
|
|
337
|
-
positiveBoosts(): number;
|
|
338
|
-
getCappedBoost(boosts: SparseBoostsTable): Partial<BoostsTable>;
|
|
339
|
-
boostBy(boosts: SparseBoostsTable): number;
|
|
340
|
-
clearBoosts(): void;
|
|
341
|
-
setBoost(boosts: SparseBoostsTable): void;
|
|
342
|
-
copyVolatileFrom(pokemon: Pokemon, switchCause?: string | boolean): void;
|
|
343
|
-
transformInto(pokemon: Pokemon, effect?: Effect): boolean;
|
|
344
|
-
/**
|
|
345
|
-
* Changes this Pokemon's species to the given speciesId (or species).
|
|
346
|
-
* This function only handles changes to stats and type.
|
|
347
|
-
* Use formChange to handle changes to ability and sending client messages.
|
|
348
|
-
*/
|
|
349
|
-
setSpecies(rawSpecies: Species, source?: Effect | null, isTransform?: boolean): any;
|
|
350
|
-
/**
|
|
351
|
-
* Changes this Pokemon's forme to match the given speciesId (or species).
|
|
352
|
-
* This function handles all changes to stats, ability, type, species, etc.
|
|
353
|
-
* as well as sending all relevant messages sent to the client.
|
|
354
|
-
*/
|
|
355
|
-
formeChange(speciesId: string | Species, source?: Effect | null, isPermanent?: boolean, message?: string): boolean;
|
|
356
|
-
clearVolatile(includeSwitchFlags?: boolean): void;
|
|
357
|
-
hasType(type: string | string[]): boolean;
|
|
358
|
-
/**
|
|
359
|
-
* This function only puts the pokemon in the faint queue;
|
|
360
|
-
* actually setting of this.fainted comes later when the
|
|
361
|
-
* faint queue is resolved.
|
|
362
|
-
*
|
|
363
|
-
* Returns the amount of damage actually dealt
|
|
364
|
-
*/
|
|
365
|
-
faint(source?: Pokemon | null, effect?: Effect | null): number;
|
|
366
|
-
damage(d: number, source?: Pokemon | null, effect?: Effect | null): number;
|
|
367
|
-
tryTrap(isHidden?: boolean): boolean;
|
|
368
|
-
hasMove(moveid: string): false | "";
|
|
369
|
-
disableMove(moveid: string, isHidden?: boolean | string, sourceEffect?: Effect): void;
|
|
370
|
-
/** Returns the amount of damage actually healed */
|
|
371
|
-
heal(d: number, source?: Pokemon | null, effect?: Effect | null): number | false;
|
|
372
|
-
/** Sets HP, returns delta */
|
|
373
|
-
sethp(d: number): number | undefined;
|
|
374
|
-
trySetStatus(status: string | Condition, source?: Pokemon | null, sourceEffect?: Effect | null): boolean;
|
|
375
|
-
/** Unlike clearStatus, gives cure message */
|
|
376
|
-
cureStatus(silent?: boolean): boolean;
|
|
377
|
-
setStatus(status: string | Condition, source?: Pokemon | null, sourceEffect?: Effect | null, ignoreImmunities?: boolean): boolean;
|
|
378
|
-
/**
|
|
379
|
-
* Unlike cureStatus, does not give cure message
|
|
380
|
-
*/
|
|
381
|
-
clearStatus(): boolean;
|
|
382
|
-
getStatus(): import("./dex-conditions").Condition;
|
|
383
|
-
eatItem(force?: boolean, source?: Pokemon, sourceEffect?: Effect): boolean;
|
|
384
|
-
useItem(source?: Pokemon, sourceEffect?: Effect): boolean;
|
|
385
|
-
takeItem(source?: Pokemon): false | import("./dex-items").Item;
|
|
386
|
-
setItem(item: string | Item, source?: Pokemon, effect?: Effect): boolean;
|
|
387
|
-
getItem(): import("./dex-items").Item;
|
|
388
|
-
hasItem(item: string | string[]): boolean;
|
|
389
|
-
clearItem(): boolean;
|
|
390
|
-
setAbility(ability: string | Ability, source?: Pokemon | null, isFromFormeChange?: boolean, isTransform?: boolean): false | ID | null;
|
|
391
|
-
getAbility(): import("./dex-abilities").Ability;
|
|
392
|
-
hasAbility(ability: string | string[]): boolean;
|
|
393
|
-
clearAbility(): false | ID | null;
|
|
394
|
-
getNature(): import("./dex-data").Nature;
|
|
395
|
-
addVolatile(status: string | Condition, source?: Pokemon | null, sourceEffect?: Effect | null, linkedStatus?: string | Condition | null): boolean | any;
|
|
396
|
-
getVolatile(status: string | Effect): Effect | null;
|
|
397
|
-
removeVolatile(status: string | Effect): boolean;
|
|
398
|
-
removeLinkedVolatiles(linkedStatus: string | Effect, linkedPokemon: Pokemon[]): void;
|
|
399
|
-
getHealth: () => {
|
|
400
|
-
side: SideID;
|
|
401
|
-
secret: string;
|
|
402
|
-
shared: string;
|
|
403
|
-
};
|
|
404
|
-
/**
|
|
405
|
-
* Sets a type (except on Arceus, who resists type changes)
|
|
406
|
-
*/
|
|
407
|
-
setType(newType: string | string[], enforce?: boolean): boolean;
|
|
408
|
-
/** Removes any types added previously and adds another one. */
|
|
409
|
-
addType(newType: string): boolean;
|
|
410
|
-
getTypes(excludeAdded?: boolean, preterastallized?: boolean): string[];
|
|
411
|
-
isGrounded(negateImmunity?: boolean): boolean | null;
|
|
412
|
-
isSemiInvulnerable(): EffectState;
|
|
413
|
-
isSkyDropped(): boolean;
|
|
414
|
-
/** Specifically: is protected against a single-target damaging move */
|
|
415
|
-
isProtected(): boolean;
|
|
416
|
-
/**
|
|
417
|
-
* Like Field.effectiveWeather(), but ignores sun and rain if
|
|
418
|
-
* the Utility Umbrella is active for the Pokemon.
|
|
419
|
-
*/
|
|
420
|
-
effectiveWeather(): ID;
|
|
421
|
-
runEffectiveness(move: ActiveMove): number;
|
|
422
|
-
/** false = immune, true = not immune */
|
|
423
|
-
runImmunity(type: string, message?: string | boolean): boolean;
|
|
424
|
-
runStatusImmunity(type: string, message?: string): boolean;
|
|
425
|
-
destroy(): void;
|
|
426
|
-
}
|
|
427
|
-
export {};
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PRNG
|
|
3
|
-
* Pokemon Showdown - http://pokemonshowdown.com/
|
|
4
|
-
*
|
|
5
|
-
* This simulates the on-cartridge PRNG used in the real games.
|
|
6
|
-
*
|
|
7
|
-
* In addition to potentially allowing us to read replays from in-game,
|
|
8
|
-
* this also makes it possible to record an "input log" (a seed +
|
|
9
|
-
* initial teams + move/switch decisions) and "replay" a simulation to
|
|
10
|
-
* get the same result.
|
|
11
|
-
*
|
|
12
|
-
* @license MIT license
|
|
13
|
-
*/
|
|
14
|
-
/** 64-bit big-endian [high -> low] int */
|
|
15
|
-
export type PRNGSeed = [number, number, number, number];
|
|
16
|
-
/**
|
|
17
|
-
* A PRNG intended to emulate the on-cartridge PRNG for Gen 5 with a 64-bit
|
|
18
|
-
* initial seed.
|
|
19
|
-
*/
|
|
20
|
-
export declare class PRNG {
|
|
21
|
-
readonly initialSeed: PRNGSeed;
|
|
22
|
-
seed: PRNGSeed;
|
|
23
|
-
/** Creates a new source of randomness for the given seed. */
|
|
24
|
-
constructor(seed?: PRNGSeed | null);
|
|
25
|
-
/**
|
|
26
|
-
* Getter to the initial seed.
|
|
27
|
-
*
|
|
28
|
-
* This should be considered a hack and is only here for backwards compatibility.
|
|
29
|
-
*/
|
|
30
|
-
get startingSeed(): PRNGSeed;
|
|
31
|
-
/**
|
|
32
|
-
* Creates a clone of the current PRNG.
|
|
33
|
-
*
|
|
34
|
-
* The new PRNG will have its initial seed set to the seed of the current instance.
|
|
35
|
-
*/
|
|
36
|
-
clone(): PRNG;
|
|
37
|
-
/**
|
|
38
|
-
* Retrieves the next random number in the sequence.
|
|
39
|
-
* This function has three different results, depending on arguments:
|
|
40
|
-
* - random() returns a real number in [0, 1), just like Math.random()
|
|
41
|
-
* - random(n) returns an integer in [0, n)
|
|
42
|
-
* - random(m, n) returns an integer in [m, n)
|
|
43
|
-
* m and n are converted to integers via Math.floor. If the result is NaN, they are ignored.
|
|
44
|
-
*/
|
|
45
|
-
next(from?: number, to?: number): number;
|
|
46
|
-
/**
|
|
47
|
-
* Flip a coin (two-sided die), returning true or false.
|
|
48
|
-
*
|
|
49
|
-
* This function returns true with probability `P`, where `P = numerator
|
|
50
|
-
* / denominator`. This function returns false with probability `1 - P`.
|
|
51
|
-
*
|
|
52
|
-
* The numerator must be a non-negative integer (`>= 0`).
|
|
53
|
-
*
|
|
54
|
-
* The denominator must be a positive integer (`> 0`).
|
|
55
|
-
*/
|
|
56
|
-
randomChance(numerator: number, denominator: number): boolean;
|
|
57
|
-
/**
|
|
58
|
-
* Return a random item from the given array.
|
|
59
|
-
*
|
|
60
|
-
* This function chooses items in the array with equal probability.
|
|
61
|
-
*
|
|
62
|
-
* If there are duplicate items in the array, each duplicate is
|
|
63
|
-
* considered separately. For example, sample(['x', 'x', 'y']) returns
|
|
64
|
-
* 'x' 67% of the time and 'y' 33% of the time.
|
|
65
|
-
*
|
|
66
|
-
* The array must contain at least one item.
|
|
67
|
-
*
|
|
68
|
-
* The array must not be sparse.
|
|
69
|
-
*/
|
|
70
|
-
sample<T>(items: readonly T[]): T;
|
|
71
|
-
/**
|
|
72
|
-
* A Fisher-Yates shuffle. This is how the game resolves speed ties.
|
|
73
|
-
*
|
|
74
|
-
* At least according to V4 in
|
|
75
|
-
* https://github.com/smogon/pokemon-showdown/issues/1157#issuecomment-214454873
|
|
76
|
-
*/
|
|
77
|
-
shuffle<T>(items: T[], start?: number, end?: number): void;
|
|
78
|
-
/**
|
|
79
|
-
* Calculates `a * b + c` (with 64-bit 2's complement integers)
|
|
80
|
-
*
|
|
81
|
-
* If you've done long multiplication, this is the same thing.
|
|
82
|
-
*/
|
|
83
|
-
multiplyAdd(a: PRNGSeed, b: PRNGSeed, c: PRNGSeed): PRNGSeed;
|
|
84
|
-
/**
|
|
85
|
-
* The RNG is a Linear Congruential Generator (LCG) in the form: `x_{n + 1} = (a x_n + c) % m`
|
|
86
|
-
*
|
|
87
|
-
* Where: `x_0` is the seed, `x_n` is the random number after n iterations,
|
|
88
|
-
*
|
|
89
|
-
* ````
|
|
90
|
-
* a = 0x5D588B656C078965
|
|
91
|
-
* c = 0x00269EC3
|
|
92
|
-
* m = 2^64
|
|
93
|
-
* ````
|
|
94
|
-
*/
|
|
95
|
-
nextFrame(seed: PRNGSeed, framesToAdvance?: number): PRNGSeed;
|
|
96
|
-
static generateSeed(): PRNGSeed;
|
|
97
|
-
}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { ActiveMove, AnyObject, Battle, Condition, Effect, ID, Move, PokemonSet, SideID } from './exported-global-types';
|
|
2
|
-
import type { RequestState } from './battle';
|
|
3
|
-
import { Pokemon, EffectState } from './pokemon';
|
|
4
|
-
/** A single action that can be chosen. */
|
|
5
|
-
export interface ChosenAction {
|
|
6
|
-
choice: 'move' | 'switch' | 'instaswitch' | 'revivalblessing' | 'team' | 'shift' | 'pass';
|
|
7
|
-
pokemon?: Pokemon;
|
|
8
|
-
targetLoc?: number;
|
|
9
|
-
moveid: string;
|
|
10
|
-
move?: ActiveMove;
|
|
11
|
-
target?: Pokemon;
|
|
12
|
-
index?: number;
|
|
13
|
-
side?: Side;
|
|
14
|
-
mega?: boolean | null;
|
|
15
|
-
zmove?: string;
|
|
16
|
-
maxMove?: string;
|
|
17
|
-
terastallize?: string;
|
|
18
|
-
priority?: number;
|
|
19
|
-
}
|
|
20
|
-
/** What the player has chosen to happen. */
|
|
21
|
-
export interface Choice {
|
|
22
|
-
cantUndo: boolean;
|
|
23
|
-
error: string;
|
|
24
|
-
actions: ChosenAction[];
|
|
25
|
-
forcedSwitchesLeft: number;
|
|
26
|
-
forcedPassesLeft: number;
|
|
27
|
-
switchIns: Set<number>;
|
|
28
|
-
zMove: boolean;
|
|
29
|
-
mega: boolean;
|
|
30
|
-
ultra: boolean;
|
|
31
|
-
dynamax: boolean;
|
|
32
|
-
terastallize: boolean;
|
|
33
|
-
}
|
|
34
|
-
export declare class Side {
|
|
35
|
-
readonly battle: Battle;
|
|
36
|
-
readonly id: SideID;
|
|
37
|
-
/** Index in `battle.sides`: `battle.sides[side.n] === side` */
|
|
38
|
-
readonly n: number;
|
|
39
|
-
name: string;
|
|
40
|
-
avatar: string;
|
|
41
|
-
foe: Side;
|
|
42
|
-
/** Only exists in multi battle, for the allied side */
|
|
43
|
-
allySide: Side | null;
|
|
44
|
-
team: PokemonSet[];
|
|
45
|
-
pokemon: Pokemon[];
|
|
46
|
-
active: Pokemon[];
|
|
47
|
-
pokemonLeft: number;
|
|
48
|
-
zMoveUsed: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* This will be true in any gen before 8 or if the player (or their battle partner) has dynamaxed once already
|
|
51
|
-
*
|
|
52
|
-
* Use Side.canDynamaxNow() to check if a side can dynamax instead of this property because only one
|
|
53
|
-
* player per team can dynamax on any given turn of a gen 8 Multi Battle.
|
|
54
|
-
*/
|
|
55
|
-
dynamaxUsed: boolean;
|
|
56
|
-
faintedLastTurn: Pokemon | null;
|
|
57
|
-
faintedThisTurn: Pokemon | null;
|
|
58
|
-
totalFainted: number;
|
|
59
|
-
/** only used by Gen 1 Counter */
|
|
60
|
-
lastSelectedMove: ID;
|
|
61
|
-
/** these point to the same object as the ally's, in multi battles */
|
|
62
|
-
sideConditions: {
|
|
63
|
-
[id: string]: EffectState;
|
|
64
|
-
};
|
|
65
|
-
slotConditions: {
|
|
66
|
-
[id: string]: EffectState;
|
|
67
|
-
}[];
|
|
68
|
-
activeRequest: AnyObject | null;
|
|
69
|
-
choice: Choice;
|
|
70
|
-
/**
|
|
71
|
-
* In gen 1, all lastMove stuff is tracked on Side rather than Pokemon
|
|
72
|
-
* (this is for Counter and Mirror Move)
|
|
73
|
-
* This is also used for checking Self-KO clause in Pokemon Stadium 2.
|
|
74
|
-
*/
|
|
75
|
-
lastMove: Move | null;
|
|
76
|
-
constructor(name: string, battle: Battle, sideNum: number, team: PokemonSet[]);
|
|
77
|
-
toJSON(): AnyObject;
|
|
78
|
-
get requestState(): RequestState;
|
|
79
|
-
canDynamaxNow(): boolean;
|
|
80
|
-
getChoice(): string;
|
|
81
|
-
toString(): string;
|
|
82
|
-
getRequestData(forAlly?: boolean): {
|
|
83
|
-
name: string;
|
|
84
|
-
id: SideID;
|
|
85
|
-
pokemon: AnyObject[];
|
|
86
|
-
};
|
|
87
|
-
randomFoe(): Pokemon | null;
|
|
88
|
-
/** Intended as a way to iterate through all foe side conditions - do not use for anything else. */
|
|
89
|
-
foeSidesWithConditions(): Side[];
|
|
90
|
-
foePokemonLeft(): number;
|
|
91
|
-
allies(all?: boolean): Pokemon[];
|
|
92
|
-
foes(all?: boolean): Pokemon[];
|
|
93
|
-
activeTeam(): Pokemon[];
|
|
94
|
-
hasAlly(pokemon: Pokemon): boolean;
|
|
95
|
-
addSideCondition(status: string | Condition, source?: Pokemon | 'debug' | null, sourceEffect?: Effect | null): boolean;
|
|
96
|
-
getSideCondition(status: string | Effect): Effect | null;
|
|
97
|
-
getSideConditionData(status: string | Effect): AnyObject;
|
|
98
|
-
removeSideCondition(status: string | Effect): boolean;
|
|
99
|
-
addSlotCondition(target: Pokemon | number, status: string | Condition, source?: Pokemon | 'debug' | null, sourceEffect?: Effect | null): any;
|
|
100
|
-
getSlotCondition(target: Pokemon | number, status: string | Effect): Effect | null;
|
|
101
|
-
removeSlotCondition(target: Pokemon | number, status: string | Effect): boolean;
|
|
102
|
-
send(...parts: (string | number | Function | AnyObject)[]): void;
|
|
103
|
-
emitRequest(update: AnyObject): void;
|
|
104
|
-
emitChoiceError(message: string, unavailable?: boolean): boolean;
|
|
105
|
-
isChoiceDone(): boolean;
|
|
106
|
-
chooseMove(moveText?: string | number, targetLoc?: number, event?: 'mega' | 'zmove' | 'ultra' | 'dynamax' | 'terastallize' | ''): boolean;
|
|
107
|
-
updateRequestForPokemon(pokemon: Pokemon, update: (req: AnyObject) => boolean): boolean;
|
|
108
|
-
chooseSwitch(slotText?: string): boolean | Side;
|
|
109
|
-
/**
|
|
110
|
-
* The number of pokemon you must choose in Team Preview.
|
|
111
|
-
*
|
|
112
|
-
* Note that PS doesn't support choosing fewer than this number of pokemon.
|
|
113
|
-
* In the games, it is sometimes possible to bring fewer than this, but
|
|
114
|
-
* since that's nearly always a mistake, we haven't gotten around to
|
|
115
|
-
* supporting it.
|
|
116
|
-
*/
|
|
117
|
-
pickedTeamSize(): number;
|
|
118
|
-
chooseTeam(data?: string): boolean;
|
|
119
|
-
chooseShift(): boolean;
|
|
120
|
-
clearChoice(): void;
|
|
121
|
-
choose(input: string): boolean;
|
|
122
|
-
getChoiceIndex(isPass?: boolean): number;
|
|
123
|
-
choosePass(): boolean | Side;
|
|
124
|
-
/** Automatically finish a choice if not currently complete. */
|
|
125
|
-
autoChoose(): boolean;
|
|
126
|
-
destroy(): void;
|
|
127
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Ability, ActiveMove, AnyObject, Condition, Item, Move, Species } from './exported-global-types';
|
|
2
|
-
/**
|
|
3
|
-
* Simulator State
|
|
4
|
-
* Pokemon Showdown - http://pokemonshowdown.com/
|
|
5
|
-
*
|
|
6
|
-
* Helper functions for serializing Battle instances to JSON and back.
|
|
7
|
-
*
|
|
8
|
-
* (You might also consider using input logs instead.)
|
|
9
|
-
*
|
|
10
|
-
* @license MIT
|
|
11
|
-
*/
|
|
12
|
-
import { Battle } from './battle';
|
|
13
|
-
import { Field } from './field';
|
|
14
|
-
import { Pokemon } from './pokemon';
|
|
15
|
-
import { Choice, Side } from './side';
|
|
16
|
-
type Referable = Battle | Field | Side | Pokemon | Condition | Ability | Item | Move | Species;
|
|
17
|
-
export declare const State: {
|
|
18
|
-
REFERABLE?: Set<Function> | undefined;
|
|
19
|
-
serializeBattle(battle: Battle): AnyObject;
|
|
20
|
-
deserializeBattle(serialized: string | /* Battle */ AnyObject): Battle;
|
|
21
|
-
normalize(state: AnyObject): AnyObject;
|
|
22
|
-
normalizeLog(log?: null | string | string[]): string | string[] | null | undefined;
|
|
23
|
-
serializeField(field: Field): AnyObject;
|
|
24
|
-
deserializeField(state: AnyObject, field: Field): void;
|
|
25
|
-
serializeSide(side: Side): AnyObject;
|
|
26
|
-
deserializeSide(state: AnyObject, side: Side): void;
|
|
27
|
-
serializePokemon(pokemon: Pokemon): AnyObject;
|
|
28
|
-
deserializePokemon(state: AnyObject, pokemon: Pokemon): void;
|
|
29
|
-
serializeChoice(choice: Choice, battle: Battle): AnyObject;
|
|
30
|
-
deserializeChoice(state: AnyObject, choice: Choice, battle: Battle): void;
|
|
31
|
-
isActiveMove(obj: AnyObject): obj is import("./dex-moves").ActiveMove;
|
|
32
|
-
serializeActiveMove(move: ActiveMove, battle: Battle): AnyObject;
|
|
33
|
-
deserializeActiveMove(state: AnyObject, battle: Battle): ActiveMove;
|
|
34
|
-
serializeWithRefs(obj: unknown, battle: Battle): unknown;
|
|
35
|
-
deserializeWithRefs(obj: unknown, battle: Battle): any;
|
|
36
|
-
isReferable(obj: object): obj is Referable;
|
|
37
|
-
toRef(obj: Referable): string;
|
|
38
|
-
fromRef(ref: string, battle: Battle): Referable | undefined;
|
|
39
|
-
serialize(obj: object, skip: Set<string>, battle: Battle): AnyObject;
|
|
40
|
-
deserialize(state: AnyObject, obj: object, skip: Set<string>, battle: Battle): void;
|
|
41
|
-
};
|
|
42
|
-
export {};
|