@pkmn/sim 0.7.58 → 0.7.59
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 +83 -61
- package/build/cjs/config/formats.js.map +1 -1
- package/build/cjs/data/aliases.js +4 -2
- package/build/cjs/data/aliases.js.map +1 -1
- package/build/cjs/data/formats-data.js +180 -170
- package/build/cjs/data/formats-data.js.map +1 -1
- package/build/esm/config/formats.mjs +83 -61
- package/build/esm/config/formats.mjs.map +1 -1
- package/build/esm/data/aliases.mjs +4 -2
- package/build/esm/data/aliases.mjs.map +1 -1
- package/build/esm/data/formats-data.mjs +180 -170
- package/build/esm/data/formats-data.mjs.map +1 -1
- package/build/types/config/formats.d.ts +1 -0
- package/build/types/data/abilities.d.ts +3 -0
- package/build/types/data/aliases.d.ts +3 -0
- package/build/types/data/conditions.d.ts +3 -0
- package/build/types/data/formats-data.d.ts +3 -0
- package/build/types/data/index.d.ts +11 -0
- package/build/types/data/items.d.ts +3 -0
- package/build/types/data/learnsets.d.ts +3 -0
- package/build/types/data/legality.d.ts +3 -0
- package/build/types/data/mods/gen1/conditions.d.ts +12 -0
- package/build/types/data/mods/gen1/formats-data.d.ts +3 -0
- package/build/types/data/mods/gen1/index.d.ts +7 -0
- package/build/types/data/mods/gen1/moves.d.ts +7 -0
- package/build/types/data/mods/gen1/pokedex.d.ts +3 -0
- package/build/types/data/mods/gen1/rulesets.d.ts +3 -0
- package/build/types/data/mods/gen1/scripts.d.ts +6 -0
- package/build/types/data/mods/gen1/typechart.d.ts +10 -0
- package/build/types/data/mods/gen2/conditions.d.ts +3 -0
- package/build/types/data/mods/gen2/formats-data.d.ts +3 -0
- package/build/types/data/mods/gen2/index.d.ts +8 -0
- package/build/types/data/mods/gen2/items.d.ts +3 -0
- package/build/types/data/mods/gen2/learnsets.d.ts +3 -0
- package/build/types/data/mods/gen2/legality.d.ts +3 -0
- package/build/types/data/mods/gen2/moves.d.ts +6 -0
- package/build/types/data/mods/gen2/pokedex.d.ts +3 -0
- package/build/types/data/mods/gen2/rulesets.d.ts +3 -0
- package/build/types/data/mods/gen2/scripts.d.ts +4 -0
- package/build/types/data/mods/gen2/typechart.d.ts +3 -0
- package/build/types/data/mods/gen3/abilities.d.ts +3 -0
- package/build/types/data/mods/gen3/conditions.d.ts +3 -0
- package/build/types/data/mods/gen3/formats-data.d.ts +3 -0
- package/build/types/data/mods/gen3/index.d.ts +7 -0
- package/build/types/data/mods/gen3/items.d.ts +3 -0
- package/build/types/data/mods/gen3/moves.d.ts +6 -0
- package/build/types/data/mods/gen3/rulesets.d.ts +3 -0
- package/build/types/data/mods/gen3/scripts.d.ts +1 -0
- package/build/types/data/mods/gen4/abilities.d.ts +3 -0
- package/build/types/data/mods/gen4/conditions.d.ts +3 -0
- package/build/types/data/mods/gen4/formats-data.d.ts +3 -0
- package/build/types/data/mods/gen4/index.d.ts +8 -0
- package/build/types/data/mods/gen4/items.d.ts +3 -0
- package/build/types/data/mods/gen4/moves.d.ts +3 -0
- package/build/types/data/mods/gen4/pokedex.d.ts +3 -0
- package/build/types/data/mods/gen4/rulesets.d.ts +3 -0
- package/build/types/data/mods/gen4/scripts.d.ts +1 -0
- package/build/types/data/mods/gen5/abilities.d.ts +3 -0
- package/build/types/data/mods/gen5/conditions.d.ts +3 -0
- package/build/types/data/mods/gen5/formats-data.d.ts +3 -0
- package/build/types/data/mods/gen5/index.d.ts +9 -0
- package/build/types/data/mods/gen5/items.d.ts +3 -0
- package/build/types/data/mods/gen5/moves.d.ts +3 -0
- package/build/types/data/mods/gen5/pokedex.d.ts +3 -0
- package/build/types/data/mods/gen5/rulesets.d.ts +3 -0
- package/build/types/data/mods/gen5/scripts.d.ts +1 -0
- package/build/types/data/mods/gen5/typechart.d.ts +3 -0
- package/build/types/data/mods/gen6/abilities.d.ts +3 -0
- package/build/types/data/mods/gen6/conditions.d.ts +3 -0
- package/build/types/data/mods/gen6/formats-data.d.ts +3 -0
- package/build/types/data/mods/gen6/index.d.ts +8 -0
- package/build/types/data/mods/gen6/items.d.ts +3 -0
- package/build/types/data/mods/gen6/learnsets.d.ts +3 -0
- package/build/types/data/mods/gen6/legality.d.ts +3 -0
- package/build/types/data/mods/gen6/moves.d.ts +3 -0
- package/build/types/data/mods/gen6/pokedex.d.ts +3 -0
- package/build/types/data/mods/gen6/scripts.d.ts +1 -0
- package/build/types/data/mods/gen6/typechart.d.ts +3 -0
- package/build/types/data/mods/gen7/abilities.d.ts +3 -0
- package/build/types/data/mods/gen7/formats-data.d.ts +3 -0
- package/build/types/data/mods/gen7/index.d.ts +7 -0
- package/build/types/data/mods/gen7/items.d.ts +3 -0
- package/build/types/data/mods/gen7/moves.d.ts +3 -0
- package/build/types/data/mods/gen7/pokedex.d.ts +3 -0
- package/build/types/data/mods/gen7/rulesets.d.ts +3 -0
- package/build/types/data/mods/gen7/scripts.d.ts +1 -0
- package/build/types/data/mods/gen8/abilities.d.ts +3 -0
- package/build/types/data/mods/gen8/formats-data.d.ts +3 -0
- package/build/types/data/mods/gen8/index.d.ts +7 -0
- package/build/types/data/mods/gen8/items.d.ts +3 -0
- package/build/types/data/mods/gen8/learnsets.d.ts +3 -0
- package/build/types/data/mods/gen8/legality.d.ts +3 -0
- package/build/types/data/mods/gen8/moves.d.ts +3 -0
- package/build/types/data/mods/gen8/pokedex.d.ts +3 -0
- package/build/types/data/mods/gen8/rulesets.d.ts +3 -0
- package/build/types/data/mods/gen8/scripts.d.ts +1 -0
- package/build/types/data/moves.d.ts +3 -0
- package/build/types/data/natures.d.ts +3 -0
- package/build/types/data/pokedex.d.ts +3 -0
- package/build/types/data/pokemongo.d.ts +31 -0
- package/build/types/data/rulesets.d.ts +3 -0
- package/build/types/data/scripts.d.ts +1 -0
- package/build/types/data/tags.d.ts +15 -0
- package/build/types/data/text/abilities.d.ts +3 -0
- package/build/types/data/text/default.d.ts +3 -0
- package/build/types/data/text/items.d.ts +3 -0
- package/build/types/data/text/moves.d.ts +3 -0
- package/build/types/data/typechart.d.ts +3 -0
- package/build/types/lib/index.d.ts +2 -0
- package/build/types/lib/streams.d.ts +1 -0
- package/build/types/lib/utils.d.ts +139 -0
- package/build/types/sim/battle-actions.d.ts +90 -0
- package/build/types/sim/battle-queue.d.ts +164 -0
- package/build/types/sim/battle-stream.d.ts +67 -0
- package/build/types/sim/battle.d.ts +396 -0
- package/build/types/sim/dex-abilities.d.ts +35 -0
- package/build/types/sim/dex-conditions.d.ts +518 -0
- package/build/types/sim/dex-data.d.ts +169 -0
- package/build/types/sim/dex-formats.d.ts +170 -0
- package/build/types/sim/dex-items.d.ts +110 -0
- package/build/types/sim/dex-moves.d.ts +441 -0
- package/build/types/sim/dex-species.d.ts +289 -0
- package/build/types/sim/dex.d.ts +162 -0
- package/build/types/sim/exported-global-types.d.ts +510 -0
- package/build/types/sim/field.d.ts +30 -0
- package/build/types/sim/global-types.d.ts +510 -0
- package/build/types/sim/index.d.ts +13 -0
- package/build/types/sim/pokemon.d.ts +427 -0
- package/build/types/sim/prng.d.ts +97 -0
- package/build/types/sim/side.d.ts +127 -0
- package/build/types/sim/state.d.ts +42 -0
- package/build/types/sim/team-validator.d.ts +198 -0
- package/build/types/sim/teams.d.ts +26 -0
- package/build/types/sim/tools/exhaustive-runner.d.ts +52 -0
- package/build/types/sim/tools/index.d.ts +2 -0
- package/build/types/sim/tools/random-player-ai.d.ts +32 -0
- package/build/types/sim/tools/runner.d.ts +41 -0
- package/package.json +1 -1
|
@@ -0,0 +1,510 @@
|
|
|
1
|
+
type Mutable<T> = {
|
|
2
|
+
-readonly [P in keyof T]: T[P];
|
|
3
|
+
};
|
|
4
|
+
type Battle = import('./battle').Battle;
|
|
5
|
+
type BattleQueue = import('./battle-queue').BattleQueue;
|
|
6
|
+
type BattleActions = import('./battle-actions').BattleActions;
|
|
7
|
+
type Field = import('./field').Field;
|
|
8
|
+
type Action = import('./battle-queue').Action;
|
|
9
|
+
type MoveAction = import('./battle-queue').MoveAction;
|
|
10
|
+
type ActionChoice = import('./battle-queue').ActionChoice;
|
|
11
|
+
type ModdedDex = import('./dex').ModdedDex;
|
|
12
|
+
type Pokemon = import('./pokemon').Pokemon;
|
|
13
|
+
type PRNGSeed = import('./prng').PRNGSeed;
|
|
14
|
+
type Side = import('./side').Side;
|
|
15
|
+
type TeamValidator = import('./team-validator').TeamValidator;
|
|
16
|
+
type PokemonSources = import('./team-validator').PokemonSources;
|
|
17
|
+
/** An ID must be lowercase alphanumeric. */
|
|
18
|
+
type ID = '' | string & {
|
|
19
|
+
__isID: true;
|
|
20
|
+
};
|
|
21
|
+
type PokemonSlot = '' | string & {
|
|
22
|
+
__isSlot: true;
|
|
23
|
+
};
|
|
24
|
+
interface AnyObject {
|
|
25
|
+
[k: string]: any;
|
|
26
|
+
}
|
|
27
|
+
type GenderName = 'M' | 'F' | 'N' | '';
|
|
28
|
+
type StatIDExceptHP = 'atk' | 'def' | 'spa' | 'spd' | 'spe';
|
|
29
|
+
type StatID = 'hp' | StatIDExceptHP;
|
|
30
|
+
type StatsExceptHPTable = {
|
|
31
|
+
[stat in StatIDExceptHP]: number;
|
|
32
|
+
};
|
|
33
|
+
type StatsTable = {
|
|
34
|
+
[stat in StatID]: number;
|
|
35
|
+
};
|
|
36
|
+
type SparseStatsTable = Partial<StatsTable>;
|
|
37
|
+
type BoostID = StatIDExceptHP | 'accuracy' | 'evasion';
|
|
38
|
+
type BoostsTable = {
|
|
39
|
+
[boost in BoostID]: number;
|
|
40
|
+
};
|
|
41
|
+
type SparseBoostsTable = Partial<BoostsTable>;
|
|
42
|
+
type Nonstandard = 'Past' | 'Future' | 'Unobtainable' | 'CAP' | 'LGPE' | 'Custom' | 'Gigantamax';
|
|
43
|
+
type PokemonSet = import('./teams').PokemonSet;
|
|
44
|
+
/**
|
|
45
|
+
* Describes a possible way to get a move onto a pokemon.
|
|
46
|
+
*
|
|
47
|
+
* First character is a generation number, 1-7.
|
|
48
|
+
* Second character is a source ID, one of:
|
|
49
|
+
*
|
|
50
|
+
* - M = TM/HM
|
|
51
|
+
* - T = tutor
|
|
52
|
+
* - L = start or level-up, 3rd char+ is the level
|
|
53
|
+
* - R = restricted (special moves like Rotom moves)
|
|
54
|
+
* - E = egg
|
|
55
|
+
* - D = Dream World, only 5D is valid
|
|
56
|
+
* - S = event, 3rd char+ is the index in .eventData
|
|
57
|
+
* - V = Virtual Console or Let's Go transfer, only 7V/8V is valid
|
|
58
|
+
* - C = NOT A REAL SOURCE, see note, only 3C/4C is valid
|
|
59
|
+
*
|
|
60
|
+
* C marks certain moves learned by a pokemon's prevo. It's used to
|
|
61
|
+
* work around the chainbreeding checker's shortcuts for performance;
|
|
62
|
+
* it lets the pokemon be a valid father for teaching the move, but
|
|
63
|
+
* is otherwise ignored by the learnset checker (which will actually
|
|
64
|
+
* check prevos for compatibility).
|
|
65
|
+
*/
|
|
66
|
+
type MoveSource = string;
|
|
67
|
+
declare namespace TierTypes {
|
|
68
|
+
type Singles = "AG" | "Uber" | "(Uber)" | "OU" | "(OU)" | "UUBL" | "UU" | "RUBL" | "RU" | "NUBL" | "NU" | "(NU)" | "PUBL" | "PU" | "(PU)" | "ZUBL" | "ZU" | "NFE" | "LC";
|
|
69
|
+
type Doubles = "DUber" | "(DUber)" | "DOU" | "(DOU)" | "DBL" | "DUU" | "(DUU)" | "NFE" | "LC";
|
|
70
|
+
type Other = "Unreleased" | "Illegal" | "CAP" | "CAP NFE" | "CAP LC";
|
|
71
|
+
}
|
|
72
|
+
interface EventInfo {
|
|
73
|
+
generation: number;
|
|
74
|
+
level?: number;
|
|
75
|
+
/** true: always shiny, 1: sometimes shiny, false | undefined: never shiny */
|
|
76
|
+
shiny?: boolean | 1;
|
|
77
|
+
gender?: GenderName;
|
|
78
|
+
nature?: string;
|
|
79
|
+
ivs?: SparseStatsTable;
|
|
80
|
+
perfectIVs?: number;
|
|
81
|
+
/** true: has hidden ability, false | undefined: never has hidden ability */
|
|
82
|
+
isHidden?: boolean;
|
|
83
|
+
abilities?: string[];
|
|
84
|
+
maxEggMoves?: number;
|
|
85
|
+
moves?: string[];
|
|
86
|
+
pokeball?: string;
|
|
87
|
+
from?: string;
|
|
88
|
+
/** Japan-only events can't be transferred to international games in Gen 1 */
|
|
89
|
+
japan?: boolean;
|
|
90
|
+
/** For Emerald event eggs to allow Pomeg glitched moves */
|
|
91
|
+
emeraldEventEgg?: boolean;
|
|
92
|
+
}
|
|
93
|
+
type Effect = Ability | Item | ActiveMove | Species | Condition | Format;
|
|
94
|
+
interface CommonHandlers {
|
|
95
|
+
ModifierEffect: (this: Battle, relayVar: number, target: Pokemon, source: Pokemon, effect: Effect) => number | void;
|
|
96
|
+
ModifierMove: (this: Battle, relayVar: number, target: Pokemon, source: Pokemon, move: ActiveMove) => number | void;
|
|
97
|
+
ResultMove: boolean | ((this: Battle, target: Pokemon, source: Pokemon, move: ActiveMove) => boolean | null | "" | void);
|
|
98
|
+
ExtResultMove: boolean | ((this: Battle, target: Pokemon, source: Pokemon, move: ActiveMove) => boolean | null | number | "" | void);
|
|
99
|
+
VoidEffect: (this: Battle, target: Pokemon, source: Pokemon, effect: Effect) => void;
|
|
100
|
+
VoidMove: (this: Battle, target: Pokemon, source: Pokemon, move: ActiveMove) => void;
|
|
101
|
+
ModifierSourceEffect: (this: Battle, relayVar: number, source: Pokemon, target: Pokemon, effect: Effect) => number | void;
|
|
102
|
+
ModifierSourceMove: (this: Battle, relayVar: number, source: Pokemon, target: Pokemon, move: ActiveMove) => number | void;
|
|
103
|
+
ResultSourceMove: boolean | ((this: Battle, source: Pokemon, target: Pokemon, move: ActiveMove) => boolean | null | "" | void);
|
|
104
|
+
ExtResultSourceMove: boolean | ((this: Battle, source: Pokemon, target: Pokemon, move: ActiveMove) => boolean | null | number | "" | void);
|
|
105
|
+
VoidSourceEffect: (this: Battle, source: Pokemon, target: Pokemon, effect: Effect) => void;
|
|
106
|
+
VoidSourceMove: (this: Battle, source: Pokemon, target: Pokemon, move: ActiveMove) => void;
|
|
107
|
+
}
|
|
108
|
+
interface EffectData {
|
|
109
|
+
name?: string;
|
|
110
|
+
desc?: string;
|
|
111
|
+
duration?: number;
|
|
112
|
+
durationCallback?: (this: Battle, target: Pokemon, source: Pokemon, effect: Effect | null) => number;
|
|
113
|
+
effectType?: string;
|
|
114
|
+
infiltrates?: boolean;
|
|
115
|
+
isNonstandard?: Nonstandard | null;
|
|
116
|
+
shortDesc?: string;
|
|
117
|
+
}
|
|
118
|
+
type ModdedEffectData = EffectData | Partial<EffectData> & {
|
|
119
|
+
inherit: true;
|
|
120
|
+
};
|
|
121
|
+
type EffectType = 'Condition' | 'Pokemon' | 'Move' | 'Item' | 'Ability' | 'Format' | 'Nature' | 'Ruleset' | 'Weather' | 'Status' | 'Terastal' | 'Rule' | 'ValidatorRule';
|
|
122
|
+
interface BasicEffect extends EffectData {
|
|
123
|
+
id: ID;
|
|
124
|
+
effectType: EffectType;
|
|
125
|
+
exists: boolean;
|
|
126
|
+
fullname: string;
|
|
127
|
+
gen: number;
|
|
128
|
+
sourceEffect: string;
|
|
129
|
+
toString: () => string;
|
|
130
|
+
}
|
|
131
|
+
type ConditionData = import('./dex-conditions').ConditionData;
|
|
132
|
+
type ModdedConditionData = import('./dex-conditions').ModdedConditionData;
|
|
133
|
+
type Condition = import('./dex-conditions').Condition;
|
|
134
|
+
type MoveData = import('./dex-moves').MoveData;
|
|
135
|
+
type ModdedMoveData = import('./dex-moves').ModdedMoveData;
|
|
136
|
+
type ActiveMove = import('./dex-moves').ActiveMove;
|
|
137
|
+
type Move = import('./dex-moves').Move;
|
|
138
|
+
type MoveTarget = import('./dex-moves').MoveTarget;
|
|
139
|
+
type ItemData = import('./dex-items').ItemData;
|
|
140
|
+
type ModdedItemData = import('./dex-items').ModdedItemData;
|
|
141
|
+
type Item = import('./dex-items').Item;
|
|
142
|
+
type AbilityData = import('./dex-abilities').AbilityData;
|
|
143
|
+
type ModdedAbilityData = import('./dex-abilities').ModdedAbilityData;
|
|
144
|
+
type Ability = import('./dex-abilities').Ability;
|
|
145
|
+
type SpeciesData = import('./dex-species').SpeciesData;
|
|
146
|
+
type ModdedSpeciesData = import('./dex-species').ModdedSpeciesData;
|
|
147
|
+
type SpeciesFormatsData = import('./dex-species').SpeciesFormatsData;
|
|
148
|
+
type ModdedSpeciesFormatsData = import('./dex-species').ModdedSpeciesFormatsData;
|
|
149
|
+
type LearnsetData = import('./dex-species').LearnsetData;
|
|
150
|
+
type ModdedLearnsetData = import('./dex-species').ModdedLearnsetData;
|
|
151
|
+
type Species = import('./dex-species').Species;
|
|
152
|
+
type PokemonGoData = import('./dex-species').PokemonGoData;
|
|
153
|
+
type FormatData = import('./dex-formats').FormatData;
|
|
154
|
+
type FormatList = import('./dex-formats').FormatList;
|
|
155
|
+
type ModdedFormatData = import('./dex-formats').ModdedFormatData;
|
|
156
|
+
type Format = import('./dex-formats').Format;
|
|
157
|
+
interface NatureData {
|
|
158
|
+
name: string;
|
|
159
|
+
plus?: StatIDExceptHP;
|
|
160
|
+
minus?: StatIDExceptHP;
|
|
161
|
+
}
|
|
162
|
+
type ModdedNatureData = NatureData | Partial<Omit<NatureData, 'name'>> & {
|
|
163
|
+
inherit: true;
|
|
164
|
+
};
|
|
165
|
+
type Nature = import('./dex-data').Nature;
|
|
166
|
+
type GameType = 'singles' | 'doubles' | 'triples' | 'rotation' | 'multi' | 'freeforall';
|
|
167
|
+
type SideID = 'p1' | 'p2' | 'p3' | 'p4';
|
|
168
|
+
interface GameTimerSettings {
|
|
169
|
+
dcTimer: boolean;
|
|
170
|
+
dcTimerBank: boolean;
|
|
171
|
+
starting: number;
|
|
172
|
+
grace: number;
|
|
173
|
+
addPerTurn: number;
|
|
174
|
+
maxPerTurn: number;
|
|
175
|
+
maxFirstTurn: number;
|
|
176
|
+
timeoutAutoChoose: boolean;
|
|
177
|
+
accelerate: boolean;
|
|
178
|
+
}
|
|
179
|
+
type SpreadMoveTargets = (Pokemon | false | null)[];
|
|
180
|
+
type SpreadMoveDamage = (number | boolean | undefined)[];
|
|
181
|
+
type ZMoveOptions = ({
|
|
182
|
+
move: string;
|
|
183
|
+
target: MoveTarget;
|
|
184
|
+
} | null)[];
|
|
185
|
+
interface DynamaxOptions {
|
|
186
|
+
maxMoves: ({
|
|
187
|
+
move: string;
|
|
188
|
+
target: MoveTarget;
|
|
189
|
+
disabled?: boolean;
|
|
190
|
+
})[];
|
|
191
|
+
gigantamax?: string;
|
|
192
|
+
}
|
|
193
|
+
interface BattleScriptsData {
|
|
194
|
+
gen: number;
|
|
195
|
+
}
|
|
196
|
+
interface ModdedBattleActions {
|
|
197
|
+
inherit?: true;
|
|
198
|
+
afterMoveSecondaryEvent?: (this: BattleActions, targets: Pokemon[], pokemon: Pokemon, move: ActiveMove) => undefined;
|
|
199
|
+
calcRecoilDamage?: (this: BattleActions, damageDealt: number, move: Move, pokemon: Pokemon) => number;
|
|
200
|
+
canMegaEvo?: (this: BattleActions, pokemon: Pokemon) => string | undefined | null;
|
|
201
|
+
canUltraBurst?: (this: BattleActions, pokemon: Pokemon) => string | null;
|
|
202
|
+
canZMove?: (this: BattleActions, pokemon: Pokemon) => ZMoveOptions | void;
|
|
203
|
+
canDynamax?: (this: BattleActions, pokemon: Pokemon, skipChecks?: boolean) => DynamaxOptions | void;
|
|
204
|
+
forceSwitch?: (this: BattleActions, damage: SpreadMoveDamage, targets: SpreadMoveTargets, source: Pokemon, move: ActiveMove, moveData: ActiveMove, isSecondary?: boolean, isSelf?: boolean) => SpreadMoveDamage;
|
|
205
|
+
getActiveMaxMove?: (this: BattleActions, move: Move, pokemon: Pokemon) => ActiveMove;
|
|
206
|
+
getActiveZMove?: (this: BattleActions, move: Move, pokemon: Pokemon) => ActiveMove;
|
|
207
|
+
getMaxMove?: (this: BattleActions, move: Move, pokemon: Pokemon) => Move | undefined;
|
|
208
|
+
getSpreadDamage?: (this: BattleActions, damage: SpreadMoveDamage, targets: SpreadMoveTargets, source: Pokemon, move: ActiveMove, moveData: ActiveMove, isSecondary?: boolean, isSelf?: boolean) => SpreadMoveDamage;
|
|
209
|
+
getZMove?: (this: BattleActions, move: Move, pokemon: Pokemon, skipChecks?: boolean) => string | true | undefined;
|
|
210
|
+
hitStepAccuracy?: (this: BattleActions, targets: Pokemon[], pokemon: Pokemon, move: ActiveMove) => boolean[];
|
|
211
|
+
hitStepBreakProtect?: (this: BattleActions, targets: Pokemon[], pokemon: Pokemon, move: ActiveMove) => undefined;
|
|
212
|
+
hitStepMoveHitLoop?: (this: BattleActions, targets: Pokemon[], pokemon: Pokemon, move: ActiveMove) => SpreadMoveDamage;
|
|
213
|
+
hitStepTryImmunity?: (this: BattleActions, targets: Pokemon[], pokemon: Pokemon, move: ActiveMove) => boolean[];
|
|
214
|
+
hitStepStealBoosts?: (this: BattleActions, targets: Pokemon[], pokemon: Pokemon, move: ActiveMove) => undefined;
|
|
215
|
+
hitStepTryHitEvent?: (this: BattleActions, targets: Pokemon[], pokemon: Pokemon, move: ActiveMove) => (boolean | '')[];
|
|
216
|
+
hitStepInvulnerabilityEvent?: (this: BattleActions, targets: Pokemon[], pokemon: Pokemon, move: ActiveMove) => boolean[];
|
|
217
|
+
hitStepTypeImmunity?: (this: BattleActions, targets: Pokemon[], pokemon: Pokemon, move: ActiveMove) => boolean[];
|
|
218
|
+
moveHit?: (this: BattleActions, target: Pokemon | null, pokemon: Pokemon, move: ActiveMove, moveData?: ActiveMove, isSecondary?: boolean, isSelf?: boolean) => number | undefined | false;
|
|
219
|
+
runAction?: (this: BattleActions, action: Action) => void;
|
|
220
|
+
runMegaEvo?: (this: BattleActions, pokemon: Pokemon) => boolean;
|
|
221
|
+
runMove?: (this: BattleActions, moveOrMoveName: Move | string, pokemon: Pokemon, targetLoc: number, sourceEffect?: Effect | null, zMove?: string, externalMove?: boolean, maxMove?: string, originalTarget?: Pokemon) => void;
|
|
222
|
+
runMoveEffects?: (this: BattleActions, damage: SpreadMoveDamage, targets: SpreadMoveTargets, source: Pokemon, move: ActiveMove, moveData: ActiveMove, isSecondary?: boolean, isSelf?: boolean) => SpreadMoveDamage;
|
|
223
|
+
runSwitch?: (this: BattleActions, pokemon: Pokemon) => boolean;
|
|
224
|
+
runZPower?: (this: BattleActions, move: ActiveMove, pokemon: Pokemon) => void;
|
|
225
|
+
secondaries?: (this: BattleActions, targets: SpreadMoveTargets, source: Pokemon, move: ActiveMove, moveData: ActiveMove, isSelf?: boolean) => void;
|
|
226
|
+
selfDrops?: (this: BattleActions, targets: SpreadMoveTargets, source: Pokemon, move: ActiveMove, moveData: ActiveMove, isSecondary?: boolean) => void;
|
|
227
|
+
spreadMoveHit?: (this: BattleActions, targets: SpreadMoveTargets, pokemon: Pokemon, move: ActiveMove, moveData?: ActiveMove, isSecondary?: boolean, isSelf?: boolean) => [SpreadMoveDamage, SpreadMoveTargets];
|
|
228
|
+
targetTypeChoices?: (this: BattleActions, targetType: string) => boolean;
|
|
229
|
+
terastallize?: (this: BattleActions, pokemon: Pokemon) => void;
|
|
230
|
+
tryMoveHit?: (this: BattleActions, target: Pokemon, pokemon: Pokemon, move: ActiveMove) => number | undefined | false | '';
|
|
231
|
+
tryPrimaryHitEvent?: (this: BattleActions, damage: SpreadMoveDamage, targets: SpreadMoveTargets, pokemon: Pokemon, move: ActiveMove, moveData: ActiveMove, isSecondary?: boolean) => SpreadMoveDamage;
|
|
232
|
+
trySpreadMoveHit?: (this: BattleActions, targets: Pokemon[], pokemon: Pokemon, move: ActiveMove, notActive?: boolean) => boolean;
|
|
233
|
+
useMove?: (this: BattleActions, move: Move, pokemon: Pokemon, target?: Pokemon | null, sourceEffect?: Effect | null, zMove?: string, maxMove?: string) => boolean;
|
|
234
|
+
useMoveInner?: (this: BattleActions, move: Move, pokemon: Pokemon, target?: Pokemon | null, sourceEffect?: Effect | null, zMove?: string, maxMove?: string) => boolean;
|
|
235
|
+
getDamage?: (this: BattleActions, pokemon: Pokemon, target: Pokemon, move: string | number | ActiveMove, suppressMessages: boolean) => number | undefined | null | false;
|
|
236
|
+
modifyDamage?: (this: BattleActions, baseDamage: number, pokemon: Pokemon, target: Pokemon, move: ActiveMove, suppressMessages?: boolean) => void;
|
|
237
|
+
mutateOriginalSpecies?: (this: BattleActions, species: Species, deltas: AnyObject) => Species;
|
|
238
|
+
getFormeChangeDeltas?: (this: BattleActions, formeChangeSpecies: Species, pokemon?: Pokemon) => AnyObject;
|
|
239
|
+
getMixedSpecies?: (this: BattleActions, originalName: string, megaName: string, pokemon?: Pokemon) => Species;
|
|
240
|
+
}
|
|
241
|
+
interface ModdedBattleSide {
|
|
242
|
+
canDynamaxNow?: (this: Side) => boolean;
|
|
243
|
+
getRequestData?: (this: Side, forAlly?: boolean) => {
|
|
244
|
+
name: string;
|
|
245
|
+
id: ID;
|
|
246
|
+
pokemon: AnyObject[];
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
interface ModdedBattlePokemon {
|
|
250
|
+
inherit?: true;
|
|
251
|
+
lostItemForDelibird?: Item | null;
|
|
252
|
+
boostBy?: (this: Pokemon, boost: SparseBoostsTable) => boolean | number;
|
|
253
|
+
clearBoosts?: (this: Pokemon) => void;
|
|
254
|
+
calculateStat?: (this: Pokemon, statName: StatIDExceptHP, boost: number, modifier?: number) => number;
|
|
255
|
+
cureStatus?: (this: Pokemon, silent?: boolean) => boolean;
|
|
256
|
+
deductPP?: (this: Pokemon, move: string | Move, amount?: number | null, target?: Pokemon | null | false) => number;
|
|
257
|
+
eatItem?: (this: Pokemon, force?: boolean, source?: Pokemon, sourceEffect?: Effect) => boolean;
|
|
258
|
+
formeChange?: (this: Pokemon, speciesId: string | Species, source: Effect, isPermanent?: boolean, message?: string) => boolean;
|
|
259
|
+
hasType?: (this: Pokemon, type: string | string[]) => boolean;
|
|
260
|
+
getAbility?: (this: Pokemon) => Ability;
|
|
261
|
+
getActionSpeed?: (this: Pokemon) => number;
|
|
262
|
+
getItem?: (this: Pokemon) => Item;
|
|
263
|
+
getMoveRequestData?: (this: Pokemon) => {
|
|
264
|
+
moves: {
|
|
265
|
+
move: string;
|
|
266
|
+
id: ID;
|
|
267
|
+
target?: string;
|
|
268
|
+
disabled?: boolean;
|
|
269
|
+
}[];
|
|
270
|
+
maybeDisabled?: boolean;
|
|
271
|
+
trapped?: boolean;
|
|
272
|
+
maybeTrapped?: boolean;
|
|
273
|
+
canMegaEvo?: boolean;
|
|
274
|
+
canUltraBurst?: boolean;
|
|
275
|
+
canZMove?: ZMoveOptions;
|
|
276
|
+
};
|
|
277
|
+
getMoves?: (this: Pokemon, lockedMove?: string | null, restrictData?: boolean) => {
|
|
278
|
+
move: string;
|
|
279
|
+
id: string;
|
|
280
|
+
disabled?: string | boolean;
|
|
281
|
+
disabledSource?: string;
|
|
282
|
+
target?: string;
|
|
283
|
+
pp?: number;
|
|
284
|
+
maxpp?: number;
|
|
285
|
+
}[];
|
|
286
|
+
getStat?: (this: Pokemon, statName: StatIDExceptHP, unboosted?: boolean, unmodified?: boolean, fastReturn?: boolean) => number;
|
|
287
|
+
getTypes?: (this: Pokemon, excludeAdded?: boolean, preterastallized?: boolean) => string[];
|
|
288
|
+
getWeight?: (this: Pokemon) => number;
|
|
289
|
+
hasAbility?: (this: Pokemon, ability: string | string[]) => boolean;
|
|
290
|
+
hasItem?: (this: Pokemon, item: string | string[]) => boolean;
|
|
291
|
+
isGrounded?: (this: Pokemon, negateImmunity: boolean | undefined) => boolean | null;
|
|
292
|
+
modifyStat?: (this: Pokemon, statName: StatIDExceptHP, modifier: number) => void;
|
|
293
|
+
moveUsed?: (this: Pokemon, move: ActiveMove, targetLoc?: number) => void;
|
|
294
|
+
recalculateStats?: (this: Pokemon) => void;
|
|
295
|
+
runImmunity?: (this: Pokemon, type: string, message?: string | boolean) => boolean;
|
|
296
|
+
setAbility?: (this: Pokemon, ability: string | Ability, source: Pokemon | null, isFromFormeChange: boolean) => string | false;
|
|
297
|
+
setItem?: (this: Pokemon, item: string | Item, source?: Pokemon, effect?: Effect) => boolean;
|
|
298
|
+
setStatus?: (this: Pokemon, status: string | Condition, source: Pokemon | null, sourceEffect: Effect | null, ignoreImmunities: boolean) => boolean;
|
|
299
|
+
takeItem?: (this: Pokemon, source: Pokemon | undefined) => boolean | Item;
|
|
300
|
+
transformInto?: (this: Pokemon, pokemon: Pokemon, effect: Effect | null) => boolean;
|
|
301
|
+
useItem?: (this: Pokemon, source?: Pokemon, sourceEffect?: Effect) => boolean;
|
|
302
|
+
ignoringAbility?: (this: Pokemon) => boolean;
|
|
303
|
+
ignoringItem?: (this: Pokemon) => boolean;
|
|
304
|
+
getLinkedMoves?: (this: Pokemon, ignoreDisabled?: boolean) => string[];
|
|
305
|
+
hasLinkedMove?: (this: Pokemon, moveid: string) => boolean;
|
|
306
|
+
}
|
|
307
|
+
interface ModdedBattleQueue extends Partial<BattleQueue> {
|
|
308
|
+
resolveAction?: (this: BattleQueue, action: ActionChoice, midTurn?: boolean) => Action[];
|
|
309
|
+
}
|
|
310
|
+
interface ModdedField extends Partial<Field> {
|
|
311
|
+
suppressingWeather?: (this: Field) => boolean;
|
|
312
|
+
}
|
|
313
|
+
interface ModdedBattleScriptsData extends Partial<BattleScriptsData> {
|
|
314
|
+
inherit?: string;
|
|
315
|
+
actions?: ModdedBattleActions;
|
|
316
|
+
pokemon?: ModdedBattlePokemon;
|
|
317
|
+
queue?: ModdedBattleQueue;
|
|
318
|
+
field?: ModdedField;
|
|
319
|
+
side?: ModdedBattleSide;
|
|
320
|
+
boost?: (this: Battle, boost: SparseBoostsTable, target: Pokemon, source?: Pokemon | null, effect?: Effect | string | null, isSecondary?: boolean, isSelf?: boolean) => boolean | null | 0;
|
|
321
|
+
debug?: (this: Battle, activity: string) => void;
|
|
322
|
+
getActionSpeed?: (this: Battle, action: AnyObject) => void;
|
|
323
|
+
init?: (this: ModdedDex) => void;
|
|
324
|
+
maybeTriggerEndlessBattleClause?: (this: Battle, trappedBySide: boolean[], stalenessBySide: ('internal' | 'external' | undefined)[]) => boolean | undefined;
|
|
325
|
+
natureModify?: (this: Battle, stats: StatsTable, set: PokemonSet) => StatsTable;
|
|
326
|
+
nextTurn?: (this: Battle) => void;
|
|
327
|
+
runAction?: (this: Battle, action: Action) => void;
|
|
328
|
+
spreadModify?: (this: Battle, baseStats: StatsTable, set: PokemonSet) => StatsTable;
|
|
329
|
+
start?: (this: Battle) => void;
|
|
330
|
+
suppressingWeather?: (this: Battle) => boolean;
|
|
331
|
+
trunc?: (n: number) => number;
|
|
332
|
+
win?: (this: Battle, side?: SideID | '' | Side | null) => boolean;
|
|
333
|
+
faintMessages?: (this: Battle, lastFirst?: boolean, forceCheck?: boolean, checkWin?: boolean) => boolean | undefined;
|
|
334
|
+
tiebreak?: (this: Battle) => boolean;
|
|
335
|
+
checkWin?: (this: Battle, faintQueue?: Battle['faintQueue'][0]) => true | undefined;
|
|
336
|
+
}
|
|
337
|
+
interface TypeData {
|
|
338
|
+
damageTaken: {
|
|
339
|
+
[attackingTypeNameOrEffectid: string]: number;
|
|
340
|
+
};
|
|
341
|
+
HPdvs?: SparseStatsTable;
|
|
342
|
+
HPivs?: SparseStatsTable;
|
|
343
|
+
isNonstandard?: Nonstandard | null;
|
|
344
|
+
}
|
|
345
|
+
type ModdedTypeData = TypeData | Partial<Omit<TypeData, 'name'>> & {
|
|
346
|
+
inherit: true;
|
|
347
|
+
};
|
|
348
|
+
type TypeInfo = import('./dex-data').TypeInfo;
|
|
349
|
+
interface PlayerOptions {
|
|
350
|
+
name?: string;
|
|
351
|
+
avatar?: string;
|
|
352
|
+
rating?: number;
|
|
353
|
+
team?: PokemonSet[] | string | null;
|
|
354
|
+
seed?: PRNGSeed;
|
|
355
|
+
}
|
|
356
|
+
interface TextObject {
|
|
357
|
+
desc?: string;
|
|
358
|
+
shortDesc?: string;
|
|
359
|
+
}
|
|
360
|
+
interface Plines {
|
|
361
|
+
activate?: string;
|
|
362
|
+
addItem?: string;
|
|
363
|
+
block?: string;
|
|
364
|
+
boost?: string;
|
|
365
|
+
cant?: string;
|
|
366
|
+
changeAbility?: string;
|
|
367
|
+
damage?: string;
|
|
368
|
+
end?: string;
|
|
369
|
+
heal?: string;
|
|
370
|
+
move?: string;
|
|
371
|
+
start?: string;
|
|
372
|
+
transform?: string;
|
|
373
|
+
}
|
|
374
|
+
interface TextFile extends TextObject {
|
|
375
|
+
name: string;
|
|
376
|
+
gen1?: ModdedTextObject;
|
|
377
|
+
gen2?: ModdedTextObject;
|
|
378
|
+
gen3?: ModdedTextObject;
|
|
379
|
+
gen4?: ModdedTextObject;
|
|
380
|
+
gen5?: ModdedTextObject;
|
|
381
|
+
gen6?: ModdedTextObject;
|
|
382
|
+
gen7?: ModdedTextObject;
|
|
383
|
+
gen8?: ModdedTextObject;
|
|
384
|
+
}
|
|
385
|
+
interface MovePlines extends Plines {
|
|
386
|
+
alreadyStarted?: string;
|
|
387
|
+
blockSelf?: string;
|
|
388
|
+
clearBoost?: string;
|
|
389
|
+
endFromItem?: string;
|
|
390
|
+
fail?: string;
|
|
391
|
+
failSelect?: string;
|
|
392
|
+
failTooHeavy?: string;
|
|
393
|
+
failWrongForme?: string;
|
|
394
|
+
megaNoItem?: string;
|
|
395
|
+
prepare?: string;
|
|
396
|
+
removeItem?: string;
|
|
397
|
+
startFromItem?: string;
|
|
398
|
+
startFromZEffect?: string;
|
|
399
|
+
switchOut?: string;
|
|
400
|
+
takeItem?: string;
|
|
401
|
+
typeChange?: string;
|
|
402
|
+
upkeep?: string;
|
|
403
|
+
}
|
|
404
|
+
interface AbilityText extends TextFile, Plines {
|
|
405
|
+
activateFromItem?: string;
|
|
406
|
+
activateNoTarget?: string;
|
|
407
|
+
copyBoost?: string;
|
|
408
|
+
transformEnd?: string;
|
|
409
|
+
}
|
|
410
|
+
interface MoveText extends TextFile, MovePlines {
|
|
411
|
+
}
|
|
412
|
+
interface ItemText extends TextFile, Plines {
|
|
413
|
+
}
|
|
414
|
+
interface PokedexText extends TextFile {
|
|
415
|
+
}
|
|
416
|
+
interface DefaultText extends AnyObject {
|
|
417
|
+
}
|
|
418
|
+
interface ModdedTextObject extends TextObject, Plines {
|
|
419
|
+
}
|
|
420
|
+
declare namespace RandomTeamsTypes {
|
|
421
|
+
interface TeamDetails {
|
|
422
|
+
megaStone?: number;
|
|
423
|
+
zMove?: number;
|
|
424
|
+
snow?: number;
|
|
425
|
+
hail?: number;
|
|
426
|
+
rain?: number;
|
|
427
|
+
sand?: number;
|
|
428
|
+
sun?: number;
|
|
429
|
+
stealthRock?: number;
|
|
430
|
+
spikes?: number;
|
|
431
|
+
toxicSpikes?: number;
|
|
432
|
+
stickyWeb?: number;
|
|
433
|
+
rapidSpin?: number;
|
|
434
|
+
defog?: number;
|
|
435
|
+
screens?: number;
|
|
436
|
+
illusion?: number;
|
|
437
|
+
statusCure?: number;
|
|
438
|
+
teraBlast?: number;
|
|
439
|
+
}
|
|
440
|
+
interface FactoryTeamDetails {
|
|
441
|
+
megaCount?: number;
|
|
442
|
+
zCount?: number;
|
|
443
|
+
forceResult: boolean;
|
|
444
|
+
weather?: string;
|
|
445
|
+
typeCount: {
|
|
446
|
+
[k: string]: number;
|
|
447
|
+
};
|
|
448
|
+
typeComboCount: {
|
|
449
|
+
[k: string]: number;
|
|
450
|
+
};
|
|
451
|
+
baseFormes: {
|
|
452
|
+
[k: string]: number;
|
|
453
|
+
};
|
|
454
|
+
has: {
|
|
455
|
+
[k: string]: number;
|
|
456
|
+
};
|
|
457
|
+
weaknesses: {
|
|
458
|
+
[k: string]: number;
|
|
459
|
+
};
|
|
460
|
+
resistances: {
|
|
461
|
+
[k: string]: number;
|
|
462
|
+
};
|
|
463
|
+
gigantamax?: boolean;
|
|
464
|
+
}
|
|
465
|
+
interface RandomSet {
|
|
466
|
+
name: string;
|
|
467
|
+
species: string;
|
|
468
|
+
gender: string | boolean;
|
|
469
|
+
moves: string[];
|
|
470
|
+
ability: string;
|
|
471
|
+
evs: SparseStatsTable;
|
|
472
|
+
ivs: SparseStatsTable;
|
|
473
|
+
item: string;
|
|
474
|
+
level: number;
|
|
475
|
+
shiny: boolean;
|
|
476
|
+
nature?: string;
|
|
477
|
+
happiness?: number;
|
|
478
|
+
dynamaxLevel?: number;
|
|
479
|
+
gigantamax?: boolean;
|
|
480
|
+
teraType?: string;
|
|
481
|
+
role?: Role;
|
|
482
|
+
}
|
|
483
|
+
interface RandomFactorySet {
|
|
484
|
+
name: string;
|
|
485
|
+
species: string;
|
|
486
|
+
gender: string;
|
|
487
|
+
item: string;
|
|
488
|
+
ability: string;
|
|
489
|
+
shiny: boolean;
|
|
490
|
+
level: number;
|
|
491
|
+
happiness: number;
|
|
492
|
+
evs: SparseStatsTable;
|
|
493
|
+
ivs: SparseStatsTable;
|
|
494
|
+
nature: string;
|
|
495
|
+
moves: string[];
|
|
496
|
+
dynamaxLevel?: number;
|
|
497
|
+
gigantamax?: boolean;
|
|
498
|
+
}
|
|
499
|
+
interface RandomSetData {
|
|
500
|
+
role: Role;
|
|
501
|
+
movepool: string[];
|
|
502
|
+
teraTypes?: string[];
|
|
503
|
+
preferredTypes?: string;
|
|
504
|
+
}
|
|
505
|
+
interface RandomSpeciesData {
|
|
506
|
+
level?: number;
|
|
507
|
+
sets: RandomSetData[];
|
|
508
|
+
}
|
|
509
|
+
type Role = '' | 'Fast Attacker' | 'Setup Sweeper' | 'Wallbreaker' | 'Tera Blast user' | 'Bulky Attacker' | 'Bulky Setup' | 'Fast Bulky Setup' | 'Bulky Support' | 'Fast Support' | 'AV Pivot' | 'Doubles Fast Attacker' | 'Doubles Setup Sweeper' | 'Doubles Wallbreaker' | 'Doubles Bulky Attacker' | 'Doubles Bulky Setup' | 'Offensive Protect' | 'Bulky Protect' | 'Doubles Support' | 'Choice Item user' | 'Z-Move user' | 'Staller' | 'Spinner';
|
|
510
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { Battle, extractChannelMessages } from './battle';
|
|
2
|
+
export * as BattleStreams from './battle-stream';
|
|
3
|
+
export * as Streams from '../lib/streams';
|
|
4
|
+
export * from './state';
|
|
5
|
+
export { Dex, toID, ModData, RuleTable } from './dex';
|
|
6
|
+
export { Pokemon } from './pokemon';
|
|
7
|
+
export { PRNG } from './prng';
|
|
8
|
+
export { RandomPlayerAI } from './tools/random-player-ai';
|
|
9
|
+
export { Side } from './side';
|
|
10
|
+
export { Teams } from './teams';
|
|
11
|
+
export { TeamValidator } from './team-validator';
|
|
12
|
+
export { Tags } from '../data/tags';
|
|
13
|
+
export * from './exported-global-types';
|