@pkmn/sim 0.8.4 → 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.
Files changed (246) hide show
  1. package/build/cjs/config/formats.js +101 -153
  2. package/build/cjs/config/formats.js.map +1 -1
  3. package/build/cjs/data/abilities.js +9 -2
  4. package/build/cjs/data/abilities.js.map +1 -1
  5. package/build/cjs/data/conditions.js +0 -3
  6. package/build/cjs/data/conditions.js.map +1 -1
  7. package/build/cjs/data/formats-data.js +28 -25
  8. package/build/cjs/data/formats-data.js.map +1 -1
  9. package/build/cjs/data/items.js +2 -2
  10. package/build/cjs/data/items.js.map +1 -1
  11. package/build/cjs/data/legality.js +424 -104
  12. package/build/cjs/data/legality.js.map +1 -1
  13. package/build/cjs/data/mods/gen1/formats-data.js +22 -22
  14. package/build/cjs/data/mods/gen1/moves.js +6 -8
  15. package/build/cjs/data/mods/gen1/moves.js.map +1 -1
  16. package/build/cjs/data/mods/gen2/formats-data.js +43 -43
  17. package/build/cjs/data/mods/gen2/formats-data.js.map +1 -1
  18. package/build/cjs/data/mods/gen2/moves.js +4 -7
  19. package/build/cjs/data/mods/gen2/moves.js.map +1 -1
  20. package/build/cjs/data/mods/gen3/formats-data.js +32 -32
  21. package/build/cjs/data/mods/gen3/formats-data.js.map +1 -1
  22. package/build/cjs/data/mods/gen3/moves.js +15 -10
  23. package/build/cjs/data/mods/gen3/moves.js.map +1 -1
  24. package/build/cjs/data/mods/gen3/scripts.js +11 -6
  25. package/build/cjs/data/mods/gen3/scripts.js.map +1 -1
  26. package/build/cjs/data/mods/gen4/moves.js +48 -43
  27. package/build/cjs/data/mods/gen4/moves.js.map +1 -1
  28. package/build/cjs/data/mods/gen4/scripts.js +11 -6
  29. package/build/cjs/data/mods/gen4/scripts.js.map +1 -1
  30. package/build/cjs/data/mods/gen5/moves.js +44 -66
  31. package/build/cjs/data/mods/gen5/moves.js.map +1 -1
  32. package/build/cjs/data/mods/gen6/moves.js +1 -1
  33. package/build/cjs/data/mods/gen6/moves.js.map +1 -1
  34. package/build/cjs/data/mods/gen7/moves.js +21 -9
  35. package/build/cjs/data/mods/gen7/moves.js.map +1 -1
  36. package/build/cjs/data/mods/gen8/moves.js +6 -2
  37. package/build/cjs/data/mods/gen8/moves.js.map +1 -1
  38. package/build/cjs/data/moves.js +733 -732
  39. package/build/cjs/data/moves.js.map +1 -1
  40. package/build/cjs/data/rulesets.js +23 -38
  41. package/build/cjs/data/rulesets.js.map +1 -1
  42. package/build/cjs/data/text/abilities.js +2 -1
  43. package/build/cjs/data/text/abilities.js.map +1 -1
  44. package/build/cjs/data/text/moves.js +1 -1
  45. package/build/cjs/sim/battle-actions.js +19 -20
  46. package/build/cjs/sim/battle-actions.js.map +1 -1
  47. package/build/cjs/sim/battle.js +2 -3
  48. package/build/cjs/sim/battle.js.map +1 -1
  49. package/build/cjs/sim/dex-conditions.d.ts +6 -0
  50. package/build/cjs/sim/dex-conditions.js.map +1 -1
  51. package/build/cjs/sim/dex-formats.d.ts +2 -0
  52. package/build/cjs/sim/dex-formats.js +1 -0
  53. package/build/cjs/sim/dex-formats.js.map +1 -1
  54. package/build/cjs/sim/dex-moves.d.ts +1 -4
  55. package/build/cjs/sim/dex-moves.js +0 -1
  56. package/build/cjs/sim/dex-moves.js.map +1 -1
  57. package/build/cjs/sim/team-validator.js +1 -1
  58. package/build/cjs/sim/team-validator.js.map +1 -1
  59. package/build/cjs/sim/tools/runner.js +1 -1
  60. package/build/cjs/sim/tools/runner.js.map +1 -1
  61. package/build/esm/config/formats.mjs +101 -153
  62. package/build/esm/config/formats.mjs.map +1 -1
  63. package/build/esm/data/abilities.mjs +9 -2
  64. package/build/esm/data/abilities.mjs.map +1 -1
  65. package/build/esm/data/conditions.mjs +0 -3
  66. package/build/esm/data/conditions.mjs.map +1 -1
  67. package/build/esm/data/formats-data.mjs +28 -25
  68. package/build/esm/data/formats-data.mjs.map +1 -1
  69. package/build/esm/data/items.mjs +2 -2
  70. package/build/esm/data/items.mjs.map +1 -1
  71. package/build/esm/data/legality.mjs +424 -104
  72. package/build/esm/data/legality.mjs.map +1 -1
  73. package/build/esm/data/mods/gen1/formats-data.mjs +22 -22
  74. package/build/esm/data/mods/gen1/moves.mjs +6 -8
  75. package/build/esm/data/mods/gen1/moves.mjs.map +1 -1
  76. package/build/esm/data/mods/gen2/formats-data.mjs +43 -43
  77. package/build/esm/data/mods/gen2/formats-data.mjs.map +1 -1
  78. package/build/esm/data/mods/gen2/moves.mjs +4 -7
  79. package/build/esm/data/mods/gen2/moves.mjs.map +1 -1
  80. package/build/esm/data/mods/gen3/formats-data.mjs +32 -32
  81. package/build/esm/data/mods/gen3/formats-data.mjs.map +1 -1
  82. package/build/esm/data/mods/gen3/moves.mjs +15 -10
  83. package/build/esm/data/mods/gen3/moves.mjs.map +1 -1
  84. package/build/esm/data/mods/gen3/scripts.mjs +11 -6
  85. package/build/esm/data/mods/gen3/scripts.mjs.map +1 -1
  86. package/build/esm/data/mods/gen4/moves.mjs +48 -43
  87. package/build/esm/data/mods/gen4/moves.mjs.map +1 -1
  88. package/build/esm/data/mods/gen4/scripts.mjs +11 -6
  89. package/build/esm/data/mods/gen4/scripts.mjs.map +1 -1
  90. package/build/esm/data/mods/gen5/moves.mjs +44 -66
  91. package/build/esm/data/mods/gen5/moves.mjs.map +1 -1
  92. package/build/esm/data/mods/gen6/moves.mjs +1 -1
  93. package/build/esm/data/mods/gen6/moves.mjs.map +1 -1
  94. package/build/esm/data/mods/gen7/moves.mjs +21 -9
  95. package/build/esm/data/mods/gen7/moves.mjs.map +1 -1
  96. package/build/esm/data/mods/gen8/moves.mjs +6 -2
  97. package/build/esm/data/mods/gen8/moves.mjs.map +1 -1
  98. package/build/esm/data/moves.mjs +733 -732
  99. package/build/esm/data/moves.mjs.map +1 -1
  100. package/build/esm/data/rulesets.mjs +23 -38
  101. package/build/esm/data/rulesets.mjs.map +1 -1
  102. package/build/esm/data/text/abilities.mjs +2 -1
  103. package/build/esm/data/text/abilities.mjs.map +1 -1
  104. package/build/esm/data/text/moves.mjs +1 -1
  105. package/build/esm/sim/battle-actions.mjs +19 -20
  106. package/build/esm/sim/battle-actions.mjs.map +1 -1
  107. package/build/esm/sim/battle.mjs +2 -3
  108. package/build/esm/sim/battle.mjs.map +1 -1
  109. package/build/esm/sim/dex-conditions.d.mts +6 -0
  110. package/build/esm/sim/dex-conditions.mjs.map +1 -1
  111. package/build/esm/sim/dex-formats.d.mts +2 -0
  112. package/build/esm/sim/dex-formats.mjs +1 -0
  113. package/build/esm/sim/dex-formats.mjs.map +1 -1
  114. package/build/esm/sim/dex-moves.d.mts +1 -4
  115. package/build/esm/sim/dex-moves.mjs +0 -1
  116. package/build/esm/sim/dex-moves.mjs.map +1 -1
  117. package/build/esm/sim/team-validator.mjs +1 -1
  118. package/build/esm/sim/team-validator.mjs.map +1 -1
  119. package/build/esm/sim/tools/runner.mjs +1 -1
  120. package/build/esm/sim/tools/runner.mjs.map +1 -1
  121. package/package.json +1 -1
  122. package/build/types/config/formats.d.ts +0 -1
  123. package/build/types/data/abilities.d.ts +0 -3
  124. package/build/types/data/aliases.d.ts +0 -3
  125. package/build/types/data/conditions.d.ts +0 -3
  126. package/build/types/data/formats-data.d.ts +0 -3
  127. package/build/types/data/index.d.ts +0 -11
  128. package/build/types/data/items.d.ts +0 -3
  129. package/build/types/data/learnsets.d.ts +0 -3
  130. package/build/types/data/legality.d.ts +0 -3
  131. package/build/types/data/mods/gen1/conditions.d.ts +0 -12
  132. package/build/types/data/mods/gen1/formats-data.d.ts +0 -3
  133. package/build/types/data/mods/gen1/index.d.ts +0 -7
  134. package/build/types/data/mods/gen1/moves.d.ts +0 -7
  135. package/build/types/data/mods/gen1/pokedex.d.ts +0 -3
  136. package/build/types/data/mods/gen1/rulesets.d.ts +0 -3
  137. package/build/types/data/mods/gen1/scripts.d.ts +0 -6
  138. package/build/types/data/mods/gen1/typechart.d.ts +0 -10
  139. package/build/types/data/mods/gen2/conditions.d.ts +0 -3
  140. package/build/types/data/mods/gen2/formats-data.d.ts +0 -3
  141. package/build/types/data/mods/gen2/index.d.ts +0 -8
  142. package/build/types/data/mods/gen2/items.d.ts +0 -3
  143. package/build/types/data/mods/gen2/learnsets.d.ts +0 -3
  144. package/build/types/data/mods/gen2/legality.d.ts +0 -3
  145. package/build/types/data/mods/gen2/moves.d.ts +0 -6
  146. package/build/types/data/mods/gen2/pokedex.d.ts +0 -3
  147. package/build/types/data/mods/gen2/rulesets.d.ts +0 -3
  148. package/build/types/data/mods/gen2/scripts.d.ts +0 -4
  149. package/build/types/data/mods/gen2/typechart.d.ts +0 -3
  150. package/build/types/data/mods/gen3/abilities.d.ts +0 -3
  151. package/build/types/data/mods/gen3/conditions.d.ts +0 -3
  152. package/build/types/data/mods/gen3/formats-data.d.ts +0 -3
  153. package/build/types/data/mods/gen3/index.d.ts +0 -7
  154. package/build/types/data/mods/gen3/items.d.ts +0 -3
  155. package/build/types/data/mods/gen3/moves.d.ts +0 -6
  156. package/build/types/data/mods/gen3/rulesets.d.ts +0 -3
  157. package/build/types/data/mods/gen3/scripts.d.ts +0 -1
  158. package/build/types/data/mods/gen4/abilities.d.ts +0 -3
  159. package/build/types/data/mods/gen4/conditions.d.ts +0 -3
  160. package/build/types/data/mods/gen4/formats-data.d.ts +0 -3
  161. package/build/types/data/mods/gen4/index.d.ts +0 -8
  162. package/build/types/data/mods/gen4/items.d.ts +0 -3
  163. package/build/types/data/mods/gen4/moves.d.ts +0 -3
  164. package/build/types/data/mods/gen4/pokedex.d.ts +0 -3
  165. package/build/types/data/mods/gen4/rulesets.d.ts +0 -3
  166. package/build/types/data/mods/gen4/scripts.d.ts +0 -1
  167. package/build/types/data/mods/gen5/abilities.d.ts +0 -3
  168. package/build/types/data/mods/gen5/conditions.d.ts +0 -3
  169. package/build/types/data/mods/gen5/formats-data.d.ts +0 -3
  170. package/build/types/data/mods/gen5/index.d.ts +0 -9
  171. package/build/types/data/mods/gen5/items.d.ts +0 -3
  172. package/build/types/data/mods/gen5/moves.d.ts +0 -3
  173. package/build/types/data/mods/gen5/pokedex.d.ts +0 -3
  174. package/build/types/data/mods/gen5/rulesets.d.ts +0 -3
  175. package/build/types/data/mods/gen5/scripts.d.ts +0 -1
  176. package/build/types/data/mods/gen5/typechart.d.ts +0 -3
  177. package/build/types/data/mods/gen6/abilities.d.ts +0 -3
  178. package/build/types/data/mods/gen6/conditions.d.ts +0 -3
  179. package/build/types/data/mods/gen6/formats-data.d.ts +0 -3
  180. package/build/types/data/mods/gen6/index.d.ts +0 -8
  181. package/build/types/data/mods/gen6/items.d.ts +0 -3
  182. package/build/types/data/mods/gen6/learnsets.d.ts +0 -3
  183. package/build/types/data/mods/gen6/legality.d.ts +0 -3
  184. package/build/types/data/mods/gen6/moves.d.ts +0 -3
  185. package/build/types/data/mods/gen6/pokedex.d.ts +0 -3
  186. package/build/types/data/mods/gen6/scripts.d.ts +0 -1
  187. package/build/types/data/mods/gen6/typechart.d.ts +0 -3
  188. package/build/types/data/mods/gen7/abilities.d.ts +0 -3
  189. package/build/types/data/mods/gen7/formats-data.d.ts +0 -3
  190. package/build/types/data/mods/gen7/index.d.ts +0 -7
  191. package/build/types/data/mods/gen7/items.d.ts +0 -3
  192. package/build/types/data/mods/gen7/moves.d.ts +0 -3
  193. package/build/types/data/mods/gen7/pokedex.d.ts +0 -3
  194. package/build/types/data/mods/gen7/rulesets.d.ts +0 -3
  195. package/build/types/data/mods/gen7/scripts.d.ts +0 -1
  196. package/build/types/data/mods/gen8/abilities.d.ts +0 -3
  197. package/build/types/data/mods/gen8/formats-data.d.ts +0 -3
  198. package/build/types/data/mods/gen8/index.d.ts +0 -7
  199. package/build/types/data/mods/gen8/items.d.ts +0 -3
  200. package/build/types/data/mods/gen8/learnsets.d.ts +0 -3
  201. package/build/types/data/mods/gen8/legality.d.ts +0 -3
  202. package/build/types/data/mods/gen8/moves.d.ts +0 -3
  203. package/build/types/data/mods/gen8/pokedex.d.ts +0 -3
  204. package/build/types/data/mods/gen8/rulesets.d.ts +0 -3
  205. package/build/types/data/mods/gen8/scripts.d.ts +0 -1
  206. package/build/types/data/moves.d.ts +0 -3
  207. package/build/types/data/natures.d.ts +0 -3
  208. package/build/types/data/pokedex.d.ts +0 -3
  209. package/build/types/data/pokemongo.d.ts +0 -31
  210. package/build/types/data/rulesets.d.ts +0 -3
  211. package/build/types/data/scripts.d.ts +0 -1
  212. package/build/types/data/tags.d.ts +0 -15
  213. package/build/types/data/text/abilities.d.ts +0 -3
  214. package/build/types/data/text/default.d.ts +0 -3
  215. package/build/types/data/text/items.d.ts +0 -3
  216. package/build/types/data/text/moves.d.ts +0 -3
  217. package/build/types/data/typechart.d.ts +0 -3
  218. package/build/types/lib/index.d.ts +0 -2
  219. package/build/types/lib/streams.d.ts +0 -1
  220. package/build/types/lib/utils.d.ts +0 -139
  221. package/build/types/sim/battle-actions.d.ts +0 -90
  222. package/build/types/sim/battle-queue.d.ts +0 -164
  223. package/build/types/sim/battle-stream.d.ts +0 -67
  224. package/build/types/sim/battle.d.ts +0 -396
  225. package/build/types/sim/dex-abilities.d.ts +0 -35
  226. package/build/types/sim/dex-conditions.d.ts +0 -518
  227. package/build/types/sim/dex-data.d.ts +0 -169
  228. package/build/types/sim/dex-formats.d.ts +0 -170
  229. package/build/types/sim/dex-items.d.ts +0 -110
  230. package/build/types/sim/dex-moves.d.ts +0 -441
  231. package/build/types/sim/dex-species.d.ts +0 -289
  232. package/build/types/sim/dex.d.ts +0 -162
  233. package/build/types/sim/exported-global-types.d.ts +0 -510
  234. package/build/types/sim/field.d.ts +0 -30
  235. package/build/types/sim/global-types.d.ts +0 -510
  236. package/build/types/sim/index.d.ts +0 -13
  237. package/build/types/sim/pokemon.d.ts +0 -427
  238. package/build/types/sim/prng.d.ts +0 -97
  239. package/build/types/sim/side.d.ts +0 -127
  240. package/build/types/sim/state.d.ts +0 -42
  241. package/build/types/sim/team-validator.d.ts +0 -198
  242. package/build/types/sim/teams.d.ts +0 -26
  243. package/build/types/sim/tools/exhaustive-runner.d.ts +0 -52
  244. package/build/types/sim/tools/index.d.ts +0 -2
  245. package/build/types/sim/tools/random-player-ai.d.ts +0 -32
  246. package/build/types/sim/tools/runner.d.ts +0 -41
@@ -1,510 +0,0 @@
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
- }
@@ -1,13 +0,0 @@
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';