@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.
Files changed (138) hide show
  1. package/build/cjs/config/formats.js +83 -61
  2. package/build/cjs/config/formats.js.map +1 -1
  3. package/build/cjs/data/aliases.js +4 -2
  4. package/build/cjs/data/aliases.js.map +1 -1
  5. package/build/cjs/data/formats-data.js +180 -170
  6. package/build/cjs/data/formats-data.js.map +1 -1
  7. package/build/esm/config/formats.mjs +83 -61
  8. package/build/esm/config/formats.mjs.map +1 -1
  9. package/build/esm/data/aliases.mjs +4 -2
  10. package/build/esm/data/aliases.mjs.map +1 -1
  11. package/build/esm/data/formats-data.mjs +180 -170
  12. package/build/esm/data/formats-data.mjs.map +1 -1
  13. package/build/types/config/formats.d.ts +1 -0
  14. package/build/types/data/abilities.d.ts +3 -0
  15. package/build/types/data/aliases.d.ts +3 -0
  16. package/build/types/data/conditions.d.ts +3 -0
  17. package/build/types/data/formats-data.d.ts +3 -0
  18. package/build/types/data/index.d.ts +11 -0
  19. package/build/types/data/items.d.ts +3 -0
  20. package/build/types/data/learnsets.d.ts +3 -0
  21. package/build/types/data/legality.d.ts +3 -0
  22. package/build/types/data/mods/gen1/conditions.d.ts +12 -0
  23. package/build/types/data/mods/gen1/formats-data.d.ts +3 -0
  24. package/build/types/data/mods/gen1/index.d.ts +7 -0
  25. package/build/types/data/mods/gen1/moves.d.ts +7 -0
  26. package/build/types/data/mods/gen1/pokedex.d.ts +3 -0
  27. package/build/types/data/mods/gen1/rulesets.d.ts +3 -0
  28. package/build/types/data/mods/gen1/scripts.d.ts +6 -0
  29. package/build/types/data/mods/gen1/typechart.d.ts +10 -0
  30. package/build/types/data/mods/gen2/conditions.d.ts +3 -0
  31. package/build/types/data/mods/gen2/formats-data.d.ts +3 -0
  32. package/build/types/data/mods/gen2/index.d.ts +8 -0
  33. package/build/types/data/mods/gen2/items.d.ts +3 -0
  34. package/build/types/data/mods/gen2/learnsets.d.ts +3 -0
  35. package/build/types/data/mods/gen2/legality.d.ts +3 -0
  36. package/build/types/data/mods/gen2/moves.d.ts +6 -0
  37. package/build/types/data/mods/gen2/pokedex.d.ts +3 -0
  38. package/build/types/data/mods/gen2/rulesets.d.ts +3 -0
  39. package/build/types/data/mods/gen2/scripts.d.ts +4 -0
  40. package/build/types/data/mods/gen2/typechart.d.ts +3 -0
  41. package/build/types/data/mods/gen3/abilities.d.ts +3 -0
  42. package/build/types/data/mods/gen3/conditions.d.ts +3 -0
  43. package/build/types/data/mods/gen3/formats-data.d.ts +3 -0
  44. package/build/types/data/mods/gen3/index.d.ts +7 -0
  45. package/build/types/data/mods/gen3/items.d.ts +3 -0
  46. package/build/types/data/mods/gen3/moves.d.ts +6 -0
  47. package/build/types/data/mods/gen3/rulesets.d.ts +3 -0
  48. package/build/types/data/mods/gen3/scripts.d.ts +1 -0
  49. package/build/types/data/mods/gen4/abilities.d.ts +3 -0
  50. package/build/types/data/mods/gen4/conditions.d.ts +3 -0
  51. package/build/types/data/mods/gen4/formats-data.d.ts +3 -0
  52. package/build/types/data/mods/gen4/index.d.ts +8 -0
  53. package/build/types/data/mods/gen4/items.d.ts +3 -0
  54. package/build/types/data/mods/gen4/moves.d.ts +3 -0
  55. package/build/types/data/mods/gen4/pokedex.d.ts +3 -0
  56. package/build/types/data/mods/gen4/rulesets.d.ts +3 -0
  57. package/build/types/data/mods/gen4/scripts.d.ts +1 -0
  58. package/build/types/data/mods/gen5/abilities.d.ts +3 -0
  59. package/build/types/data/mods/gen5/conditions.d.ts +3 -0
  60. package/build/types/data/mods/gen5/formats-data.d.ts +3 -0
  61. package/build/types/data/mods/gen5/index.d.ts +9 -0
  62. package/build/types/data/mods/gen5/items.d.ts +3 -0
  63. package/build/types/data/mods/gen5/moves.d.ts +3 -0
  64. package/build/types/data/mods/gen5/pokedex.d.ts +3 -0
  65. package/build/types/data/mods/gen5/rulesets.d.ts +3 -0
  66. package/build/types/data/mods/gen5/scripts.d.ts +1 -0
  67. package/build/types/data/mods/gen5/typechart.d.ts +3 -0
  68. package/build/types/data/mods/gen6/abilities.d.ts +3 -0
  69. package/build/types/data/mods/gen6/conditions.d.ts +3 -0
  70. package/build/types/data/mods/gen6/formats-data.d.ts +3 -0
  71. package/build/types/data/mods/gen6/index.d.ts +8 -0
  72. package/build/types/data/mods/gen6/items.d.ts +3 -0
  73. package/build/types/data/mods/gen6/learnsets.d.ts +3 -0
  74. package/build/types/data/mods/gen6/legality.d.ts +3 -0
  75. package/build/types/data/mods/gen6/moves.d.ts +3 -0
  76. package/build/types/data/mods/gen6/pokedex.d.ts +3 -0
  77. package/build/types/data/mods/gen6/scripts.d.ts +1 -0
  78. package/build/types/data/mods/gen6/typechart.d.ts +3 -0
  79. package/build/types/data/mods/gen7/abilities.d.ts +3 -0
  80. package/build/types/data/mods/gen7/formats-data.d.ts +3 -0
  81. package/build/types/data/mods/gen7/index.d.ts +7 -0
  82. package/build/types/data/mods/gen7/items.d.ts +3 -0
  83. package/build/types/data/mods/gen7/moves.d.ts +3 -0
  84. package/build/types/data/mods/gen7/pokedex.d.ts +3 -0
  85. package/build/types/data/mods/gen7/rulesets.d.ts +3 -0
  86. package/build/types/data/mods/gen7/scripts.d.ts +1 -0
  87. package/build/types/data/mods/gen8/abilities.d.ts +3 -0
  88. package/build/types/data/mods/gen8/formats-data.d.ts +3 -0
  89. package/build/types/data/mods/gen8/index.d.ts +7 -0
  90. package/build/types/data/mods/gen8/items.d.ts +3 -0
  91. package/build/types/data/mods/gen8/learnsets.d.ts +3 -0
  92. package/build/types/data/mods/gen8/legality.d.ts +3 -0
  93. package/build/types/data/mods/gen8/moves.d.ts +3 -0
  94. package/build/types/data/mods/gen8/pokedex.d.ts +3 -0
  95. package/build/types/data/mods/gen8/rulesets.d.ts +3 -0
  96. package/build/types/data/mods/gen8/scripts.d.ts +1 -0
  97. package/build/types/data/moves.d.ts +3 -0
  98. package/build/types/data/natures.d.ts +3 -0
  99. package/build/types/data/pokedex.d.ts +3 -0
  100. package/build/types/data/pokemongo.d.ts +31 -0
  101. package/build/types/data/rulesets.d.ts +3 -0
  102. package/build/types/data/scripts.d.ts +1 -0
  103. package/build/types/data/tags.d.ts +15 -0
  104. package/build/types/data/text/abilities.d.ts +3 -0
  105. package/build/types/data/text/default.d.ts +3 -0
  106. package/build/types/data/text/items.d.ts +3 -0
  107. package/build/types/data/text/moves.d.ts +3 -0
  108. package/build/types/data/typechart.d.ts +3 -0
  109. package/build/types/lib/index.d.ts +2 -0
  110. package/build/types/lib/streams.d.ts +1 -0
  111. package/build/types/lib/utils.d.ts +139 -0
  112. package/build/types/sim/battle-actions.d.ts +90 -0
  113. package/build/types/sim/battle-queue.d.ts +164 -0
  114. package/build/types/sim/battle-stream.d.ts +67 -0
  115. package/build/types/sim/battle.d.ts +396 -0
  116. package/build/types/sim/dex-abilities.d.ts +35 -0
  117. package/build/types/sim/dex-conditions.d.ts +518 -0
  118. package/build/types/sim/dex-data.d.ts +169 -0
  119. package/build/types/sim/dex-formats.d.ts +170 -0
  120. package/build/types/sim/dex-items.d.ts +110 -0
  121. package/build/types/sim/dex-moves.d.ts +441 -0
  122. package/build/types/sim/dex-species.d.ts +289 -0
  123. package/build/types/sim/dex.d.ts +162 -0
  124. package/build/types/sim/exported-global-types.d.ts +510 -0
  125. package/build/types/sim/field.d.ts +30 -0
  126. package/build/types/sim/global-types.d.ts +510 -0
  127. package/build/types/sim/index.d.ts +13 -0
  128. package/build/types/sim/pokemon.d.ts +427 -0
  129. package/build/types/sim/prng.d.ts +97 -0
  130. package/build/types/sim/side.d.ts +127 -0
  131. package/build/types/sim/state.d.ts +42 -0
  132. package/build/types/sim/team-validator.d.ts +198 -0
  133. package/build/types/sim/teams.d.ts +26 -0
  134. package/build/types/sim/tools/exhaustive-runner.d.ts +52 -0
  135. package/build/types/sim/tools/index.d.ts +2 -0
  136. package/build/types/sim/tools/random-player-ai.d.ts +32 -0
  137. package/build/types/sim/tools/runner.d.ts +41 -0
  138. package/package.json +1 -1
@@ -0,0 +1,518 @@
1
+ import { ActiveMove, AnyObject, Battle, CommonHandlers, Effect, Field, ID, Item, ModdedDex, Pokemon, Side, SparseBoostsTable } from './exported-global-types';
2
+ import { BasicEffect } from './dex-data';
3
+ import type { SecondaryEffect, MoveEventMethods } from './dex-moves';
4
+ export interface EventMethods {
5
+ onDamagingHit?: (this: Battle, damage: number, target: Pokemon, source: Pokemon, move: ActiveMove) => void;
6
+ onEmergencyExit?: (this: Battle, pokemon: Pokemon) => void;
7
+ onAfterEachBoost?: (this: Battle, boost: SparseBoostsTable, target: Pokemon, source: Pokemon, effect: Effect) => void;
8
+ onAfterHit?: MoveEventMethods['onAfterHit'];
9
+ onAfterMega?: (this: Battle, pokemon: Pokemon) => void;
10
+ onAfterSetStatus?: (this: Battle, status: Condition, target: Pokemon, source: Pokemon, effect: Effect) => void;
11
+ onAfterSubDamage?: MoveEventMethods['onAfterSubDamage'];
12
+ onAfterSwitchInSelf?: (this: Battle, pokemon: Pokemon) => void;
13
+ onAfterTerastallization?: (this: Battle, pokemon: Pokemon) => void;
14
+ onAfterUseItem?: (this: Battle, item: Item, pokemon: Pokemon) => void;
15
+ onAfterTakeItem?: (this: Battle, item: Item, pokemon: Pokemon) => void;
16
+ onAfterBoost?: (this: Battle, boost: SparseBoostsTable, target: Pokemon, source: Pokemon, effect: Effect) => void;
17
+ onAfterFaint?: (this: Battle, length: number, target: Pokemon, source: Pokemon, effect: Effect) => void;
18
+ onAfterMoveSecondarySelf?: MoveEventMethods['onAfterMoveSecondarySelf'];
19
+ onAfterMoveSecondary?: MoveEventMethods['onAfterMoveSecondary'];
20
+ onAfterMove?: MoveEventMethods['onAfterMove'];
21
+ onAfterMoveSelf?: CommonHandlers['VoidSourceMove'];
22
+ onAttract?: (this: Battle, target: Pokemon, source: Pokemon) => void;
23
+ onAccuracy?: (this: Battle, accuracy: number, target: Pokemon, source: Pokemon, move: ActiveMove) => number | boolean | null | void;
24
+ onBasePower?: CommonHandlers['ModifierSourceMove'];
25
+ onBeforeFaint?: (this: Battle, pokemon: Pokemon, effect: Effect) => void;
26
+ onBeforeMove?: CommonHandlers['VoidSourceMove'];
27
+ onBeforeSwitchIn?: (this: Battle, pokemon: Pokemon) => void;
28
+ onBeforeSwitchOut?: (this: Battle, pokemon: Pokemon) => void;
29
+ onBeforeTurn?: (this: Battle, pokemon: Pokemon) => void;
30
+ onChangeBoost?: (this: Battle, boost: SparseBoostsTable, target: Pokemon, source: Pokemon, effect: Effect) => void;
31
+ onTryBoost?: (this: Battle, boost: SparseBoostsTable, target: Pokemon, source: Pokemon, effect: Effect) => void;
32
+ onChargeMove?: CommonHandlers['VoidSourceMove'];
33
+ onCriticalHit?: ((this: Battle, pokemon: Pokemon, source: null, move: ActiveMove) => boolean | void) | boolean;
34
+ onDamage?: (this: Battle, damage: number, target: Pokemon, source: Pokemon, effect: Effect) => number | boolean | null | void;
35
+ onDeductPP?: (this: Battle, target: Pokemon, source: Pokemon) => number | void;
36
+ onDisableMove?: (this: Battle, pokemon: Pokemon) => void;
37
+ onDragOut?: (this: Battle, pokemon: Pokemon, source?: Pokemon, move?: ActiveMove) => void;
38
+ onEatItem?: (this: Battle, item: Item, pokemon: Pokemon) => void;
39
+ onEffectiveness?: MoveEventMethods['onEffectiveness'];
40
+ onEntryHazard?: (this: Battle, pokemon: Pokemon) => void;
41
+ onFaint?: CommonHandlers['VoidEffect'];
42
+ onFlinch?: ((this: Battle, pokemon: Pokemon) => boolean | void) | boolean;
43
+ onFractionalPriority?: CommonHandlers['ModifierSourceMove'] | -0.1;
44
+ onHit?: MoveEventMethods['onHit'];
45
+ onImmunity?: (this: Battle, type: string, pokemon: Pokemon) => void;
46
+ onLockMove?: string | ((this: Battle, pokemon: Pokemon) => void | string);
47
+ onMaybeTrapPokemon?: (this: Battle, pokemon: Pokemon) => void;
48
+ onModifyAccuracy?: CommonHandlers['ModifierMove'];
49
+ onModifyAtk?: CommonHandlers['ModifierSourceMove'];
50
+ onModifyBoost?: (this: Battle, boosts: SparseBoostsTable, pokemon: Pokemon) => SparseBoostsTable | void;
51
+ onModifyCritRatio?: CommonHandlers['ModifierSourceMove'];
52
+ onModifyDamage?: CommonHandlers['ModifierSourceMove'];
53
+ onModifyDef?: CommonHandlers['ModifierMove'];
54
+ onModifyMove?: MoveEventMethods['onModifyMove'];
55
+ onModifyPriority?: CommonHandlers['ModifierSourceMove'];
56
+ onModifySecondaries?: (this: Battle, secondaries: SecondaryEffect[], target: Pokemon, source: Pokemon, move: ActiveMove) => void;
57
+ onModifyType?: MoveEventMethods['onModifyType'];
58
+ onModifyTarget?: MoveEventMethods['onModifyTarget'];
59
+ onModifySpA?: CommonHandlers['ModifierSourceMove'];
60
+ onModifySpD?: CommonHandlers['ModifierMove'];
61
+ onModifySpe?: (this: Battle, spe: number, pokemon: Pokemon) => number | void;
62
+ onModifyWeight?: (this: Battle, weighthg: number, pokemon: Pokemon) => number | void;
63
+ onMoveAborted?: CommonHandlers['VoidMove'];
64
+ onNegateImmunity?: ((this: Battle, pokemon: Pokemon, type: string) => boolean | void) | boolean;
65
+ onOverrideAction?: (this: Battle, pokemon: Pokemon, target: Pokemon, move: ActiveMove) => string | void;
66
+ onPrepareHit?: CommonHandlers['ResultSourceMove'];
67
+ onRedirectTarget?: (this: Battle, target: Pokemon, source: Pokemon, source2: Effect, move: ActiveMove) => Pokemon | void;
68
+ onResidual?: (this: Battle, target: Pokemon, source: Pokemon, effect: Effect) => void;
69
+ onSetAbility?: (this: Battle, ability: string, target: Pokemon, source: Pokemon, effect: Effect) => null | void;
70
+ onSetStatus?: (this: Battle, status: Condition, target: Pokemon, source: Pokemon, effect: Effect) => boolean | null | void;
71
+ onSetWeather?: (this: Battle, target: Pokemon, source: Pokemon, weather: Condition) => boolean | void;
72
+ onStallMove?: (this: Battle, pokemon: Pokemon) => boolean | void;
73
+ onSwitchIn?: (this: Battle, pokemon: Pokemon) => void;
74
+ onSwitchOut?: (this: Battle, pokemon: Pokemon) => void;
75
+ onSwap?: (this: Battle, target: Pokemon, source: Pokemon) => void;
76
+ onTakeItem?: ((this: Battle, item: Item, pokemon: Pokemon, source: Pokemon, move?: ActiveMove) => boolean | void) | boolean;
77
+ onWeatherChange?: (this: Battle, target: Pokemon, source: Pokemon, sourceEffect: Effect) => void;
78
+ onTerrainChange?: (this: Battle, target: Pokemon, source: Pokemon, sourceEffect: Effect) => void;
79
+ onTrapPokemon?: (this: Battle, pokemon: Pokemon) => void;
80
+ onTryAddVolatile?: (this: Battle, status: Condition, target: Pokemon, source: Pokemon, sourceEffect: Effect) => boolean | null | void;
81
+ onTryEatItem?: boolean | ((this: Battle, item: Item, pokemon: Pokemon) => boolean | void);
82
+ onTryHeal?: (((this: Battle, relayVar: number, target: Pokemon, source: Pokemon, effect: Effect) => number | boolean | void));
83
+ onTryHit?: MoveEventMethods['onTryHit'];
84
+ onTryHitField?: MoveEventMethods['onTryHitField'];
85
+ onTryHitSide?: CommonHandlers['ResultMove'];
86
+ onInvulnerability?: CommonHandlers['ExtResultMove'];
87
+ onTryMove?: MoveEventMethods['onTryMove'];
88
+ onTryPrimaryHit?: (this: Battle, target: Pokemon, source: Pokemon, move: ActiveMove) => boolean | null | number | void;
89
+ onType?: (this: Battle, types: string[], pokemon: Pokemon) => string[] | void;
90
+ onUseItem?: (this: Battle, item: Item, pokemon: Pokemon) => void;
91
+ onUpdate?: (this: Battle, pokemon: Pokemon) => void;
92
+ onWeather?: (this: Battle, target: Pokemon, source: null, effect: Condition) => void;
93
+ onWeatherModifyDamage?: CommonHandlers['ModifierSourceMove'];
94
+ onModifyDamagePhase1?: CommonHandlers['ModifierSourceMove'];
95
+ onModifyDamagePhase2?: CommonHandlers['ModifierSourceMove'];
96
+ onFoeDamagingHit?: (this: Battle, damage: number, target: Pokemon, source: Pokemon, move: ActiveMove) => void;
97
+ onFoeAfterEachBoost?: (this: Battle, boost: SparseBoostsTable, target: Pokemon, source: Pokemon) => void;
98
+ onFoeAfterHit?: MoveEventMethods['onAfterHit'];
99
+ onFoeAfterSetStatus?: (this: Battle, status: Condition, target: Pokemon, source: Pokemon, effect: Effect) => void;
100
+ onFoeAfterSubDamage?: MoveEventMethods['onAfterSubDamage'];
101
+ onFoeAfterSwitchInSelf?: (this: Battle, pokemon: Pokemon) => void;
102
+ onFoeAfterUseItem?: (this: Battle, item: Item, pokemon: Pokemon) => void;
103
+ onFoeAfterBoost?: (this: Battle, boost: SparseBoostsTable, target: Pokemon, source: Pokemon, effect: Effect) => void;
104
+ onFoeAfterFaint?: (this: Battle, length: number, target: Pokemon, source: Pokemon, effect: Effect) => void;
105
+ onFoeAfterMoveSecondarySelf?: MoveEventMethods['onAfterMoveSecondarySelf'];
106
+ onFoeAfterMoveSecondary?: MoveEventMethods['onAfterMoveSecondary'];
107
+ onFoeAfterMove?: MoveEventMethods['onAfterMove'];
108
+ onFoeAfterMoveSelf?: CommonHandlers['VoidSourceMove'];
109
+ onFoeAttract?: (this: Battle, target: Pokemon, source: Pokemon) => void;
110
+ onFoeAccuracy?: (this: Battle, accuracy: number, target: Pokemon, source: Pokemon, move: ActiveMove) => number | boolean | null | void;
111
+ onFoeBasePower?: CommonHandlers['ModifierSourceMove'];
112
+ onFoeBeforeFaint?: (this: Battle, pokemon: Pokemon, effect: Effect) => void;
113
+ onFoeBeforeMove?: CommonHandlers['VoidSourceMove'];
114
+ onFoeBeforeSwitchIn?: (this: Battle, pokemon: Pokemon) => void;
115
+ onFoeBeforeSwitchOut?: (this: Battle, pokemon: Pokemon) => void;
116
+ onFoeTryBoost?: (this: Battle, boost: SparseBoostsTable, target: Pokemon, source: Pokemon, effect: Effect) => void;
117
+ onFoeChargeMove?: CommonHandlers['VoidSourceMove'];
118
+ onFoeCriticalHit?: ((this: Battle, pokemon: Pokemon, source: null, move: ActiveMove) => boolean | void) | boolean;
119
+ onFoeDamage?: (this: Battle, damage: number, target: Pokemon, source: Pokemon, effect: Effect) => number | boolean | null | void;
120
+ onFoeDeductPP?: (this: Battle, target: Pokemon, source: Pokemon) => number | void;
121
+ onFoeDisableMove?: (this: Battle, pokemon: Pokemon) => void;
122
+ onFoeDragOut?: (this: Battle, pokemon: Pokemon, source?: Pokemon, move?: ActiveMove) => void;
123
+ onFoeEatItem?: (this: Battle, item: Item, pokemon: Pokemon) => void;
124
+ onFoeEffectiveness?: MoveEventMethods['onEffectiveness'];
125
+ onFoeFaint?: CommonHandlers['VoidEffect'];
126
+ onFoeFlinch?: ((this: Battle, pokemon: Pokemon) => boolean | void) | boolean;
127
+ onFoeHit?: MoveEventMethods['onHit'];
128
+ onFoeImmunity?: (this: Battle, type: string, pokemon: Pokemon) => void;
129
+ onFoeLockMove?: string | ((this: Battle, pokemon: Pokemon) => void | string);
130
+ onFoeMaybeTrapPokemon?: (this: Battle, pokemon: Pokemon, source?: Pokemon) => void;
131
+ onFoeModifyAccuracy?: CommonHandlers['ModifierMove'];
132
+ onFoeModifyAtk?: CommonHandlers['ModifierSourceMove'];
133
+ onFoeModifyBoost?: (this: Battle, boosts: SparseBoostsTable, pokemon: Pokemon) => SparseBoostsTable | void;
134
+ onFoeModifyCritRatio?: CommonHandlers['ModifierSourceMove'];
135
+ onFoeModifyDamage?: CommonHandlers['ModifierSourceMove'];
136
+ onFoeModifyDef?: CommonHandlers['ModifierMove'];
137
+ onFoeModifyMove?: MoveEventMethods['onModifyMove'];
138
+ onFoeModifyPriority?: CommonHandlers['ModifierSourceMove'];
139
+ onFoeModifySecondaries?: (this: Battle, secondaries: SecondaryEffect[], target: Pokemon, source: Pokemon, move: ActiveMove) => void;
140
+ onFoeModifySpA?: CommonHandlers['ModifierSourceMove'];
141
+ onFoeModifySpD?: CommonHandlers['ModifierMove'];
142
+ onFoeModifySpe?: (this: Battle, spe: number, pokemon: Pokemon) => number | void;
143
+ onFoeModifyType?: MoveEventMethods['onModifyType'];
144
+ onFoeModifyTarget?: MoveEventMethods['onModifyTarget'];
145
+ onFoeModifyWeight?: (this: Battle, weighthg: number, pokemon: Pokemon) => number | void;
146
+ onFoeMoveAborted?: CommonHandlers['VoidMove'];
147
+ onFoeNegateImmunity?: ((this: Battle, pokemon: Pokemon, type: string) => boolean | void) | boolean;
148
+ onFoeOverrideAction?: (this: Battle, pokemon: Pokemon, target: Pokemon, move: ActiveMove) => string | void;
149
+ onFoePrepareHit?: CommonHandlers['ResultSourceMove'];
150
+ onFoeRedirectTarget?: (this: Battle, target: Pokemon, source: Pokemon, source2: Effect, move: ActiveMove) => Pokemon | void;
151
+ onFoeResidual?: (this: Battle, target: Pokemon & Side, source: Pokemon, effect: Effect) => void;
152
+ onFoeSetAbility?: (this: Battle, ability: string, target: Pokemon, source: Pokemon, effect: Effect) => boolean | void;
153
+ onFoeSetStatus?: (this: Battle, status: Condition, target: Pokemon, source: Pokemon, effect: Effect) => boolean | null | void;
154
+ onFoeSetWeather?: (this: Battle, target: Pokemon, source: Pokemon, weather: Condition) => boolean | void;
155
+ onFoeStallMove?: (this: Battle, pokemon: Pokemon) => boolean | void;
156
+ onFoeSwitchIn?: (this: Battle, pokemon: Pokemon) => void;
157
+ onFoeSwitchOut?: (this: Battle, pokemon: Pokemon) => void;
158
+ onFoeTakeItem?: ((this: Battle, item: Item, pokemon: Pokemon, source: Pokemon, move?: ActiveMove) => boolean | void) | boolean;
159
+ onFoeTerrain?: (this: Battle, pokemon: Pokemon) => void;
160
+ onFoeTrapPokemon?: (this: Battle, pokemon: Pokemon) => void;
161
+ onFoeTryAddVolatile?: (this: Battle, status: Condition, target: Pokemon, source: Pokemon, sourceEffect: Effect) => boolean | null | void;
162
+ onFoeTryEatItem?: boolean | ((this: Battle, item: Item, pokemon: Pokemon) => boolean | void);
163
+ onFoeTryHeal?: (((this: Battle, relayVar: number, target: Pokemon, source: Pokemon, effect: Effect) => number | boolean | void) | ((this: Battle, pokemon: Pokemon) => boolean | void) | boolean);
164
+ onFoeTryHit?: MoveEventMethods['onTryHit'];
165
+ onFoeTryHitField?: MoveEventMethods['onTryHitField'];
166
+ onFoeTryHitSide?: CommonHandlers['ResultMove'];
167
+ onFoeInvulnerability?: CommonHandlers['ExtResultMove'];
168
+ onFoeTryMove?: MoveEventMethods['onTryMove'];
169
+ onFoeTryPrimaryHit?: (this: Battle, target: Pokemon, source: Pokemon, move: ActiveMove) => boolean | null | number | void;
170
+ onFoeType?: (this: Battle, types: string[], pokemon: Pokemon) => string[] | void;
171
+ onFoeWeatherModifyDamage?: CommonHandlers['ModifierSourceMove'];
172
+ onFoeModifyDamagePhase1?: CommonHandlers['ModifierSourceMove'];
173
+ onFoeModifyDamagePhase2?: CommonHandlers['ModifierSourceMove'];
174
+ onSourceDamagingHit?: (this: Battle, damage: number, target: Pokemon, source: Pokemon, move: ActiveMove) => void;
175
+ onSourceAfterEachBoost?: (this: Battle, boost: SparseBoostsTable, target: Pokemon, source: Pokemon) => void;
176
+ onSourceAfterHit?: MoveEventMethods['onAfterHit'];
177
+ onSourceAfterSetStatus?: (this: Battle, status: Condition, target: Pokemon, source: Pokemon, effect: Effect) => void;
178
+ onSourceAfterSubDamage?: MoveEventMethods['onAfterSubDamage'];
179
+ onSourceAfterSwitchInSelf?: (this: Battle, pokemon: Pokemon) => void;
180
+ onSourceAfterUseItem?: (this: Battle, item: Item, pokemon: Pokemon) => void;
181
+ onSourceAfterBoost?: (this: Battle, boost: SparseBoostsTable, target: Pokemon, source: Pokemon, effect: Effect) => void;
182
+ onSourceAfterFaint?: (this: Battle, length: number, target: Pokemon, source: Pokemon, effect: Effect) => void;
183
+ onSourceAfterMoveSecondarySelf?: MoveEventMethods['onAfterMoveSecondarySelf'];
184
+ onSourceAfterMoveSecondary?: MoveEventMethods['onAfterMoveSecondary'];
185
+ onSourceAfterMove?: MoveEventMethods['onAfterMove'];
186
+ onSourceAfterMoveSelf?: CommonHandlers['VoidSourceMove'];
187
+ onSourceAttract?: (this: Battle, target: Pokemon, source: Pokemon) => void;
188
+ onSourceAccuracy?: (this: Battle, accuracy: number, target: Pokemon, source: Pokemon, move: ActiveMove) => number | boolean | null | void;
189
+ onSourceBasePower?: CommonHandlers['ModifierSourceMove'];
190
+ onSourceBeforeFaint?: (this: Battle, pokemon: Pokemon, effect: Effect) => void;
191
+ onSourceBeforeMove?: CommonHandlers['VoidSourceMove'];
192
+ onSourceBeforeSwitchIn?: (this: Battle, pokemon: Pokemon) => void;
193
+ onSourceBeforeSwitchOut?: (this: Battle, pokemon: Pokemon) => void;
194
+ onSourceTryBoost?: (this: Battle, boost: SparseBoostsTable, target: Pokemon, source: Pokemon, effect: Effect) => void;
195
+ onSourceChargeMove?: CommonHandlers['VoidSourceMove'];
196
+ onSourceCriticalHit?: ((this: Battle, pokemon: Pokemon, source: null, move: ActiveMove) => boolean | void) | boolean;
197
+ onSourceDamage?: (this: Battle, damage: number, target: Pokemon, source: Pokemon, effect: Effect) => number | boolean | null | void;
198
+ onSourceDeductPP?: (this: Battle, target: Pokemon, source: Pokemon) => number | void;
199
+ onSourceDisableMove?: (this: Battle, pokemon: Pokemon) => void;
200
+ onSourceDragOut?: (this: Battle, pokemon: Pokemon, source?: Pokemon, move?: ActiveMove) => void;
201
+ onSourceEatItem?: (this: Battle, item: Item, pokemon: Pokemon) => void;
202
+ onSourceEffectiveness?: MoveEventMethods['onEffectiveness'];
203
+ onSourceFaint?: CommonHandlers['VoidEffect'];
204
+ onSourceFlinch?: ((this: Battle, pokemon: Pokemon) => boolean | void) | boolean;
205
+ onSourceHit?: MoveEventMethods['onHit'];
206
+ onSourceImmunity?: (this: Battle, type: string, pokemon: Pokemon) => void;
207
+ onSourceLockMove?: string | ((this: Battle, pokemon: Pokemon) => void | string);
208
+ onSourceMaybeTrapPokemon?: (this: Battle, pokemon: Pokemon) => void;
209
+ onSourceModifyAccuracy?: CommonHandlers['ModifierMove'];
210
+ onSourceModifyAtk?: CommonHandlers['ModifierSourceMove'];
211
+ onSourceModifyBoost?: (this: Battle, boosts: SparseBoostsTable, pokemon: Pokemon) => SparseBoostsTable | void;
212
+ onSourceModifyCritRatio?: CommonHandlers['ModifierSourceMove'];
213
+ onSourceModifyDamage?: CommonHandlers['ModifierSourceMove'];
214
+ onSourceModifyDef?: CommonHandlers['ModifierMove'];
215
+ onSourceModifyMove?: MoveEventMethods['onModifyMove'];
216
+ onSourceModifyPriority?: CommonHandlers['ModifierSourceMove'];
217
+ onSourceModifySecondaries?: (this: Battle, secondaries: SecondaryEffect[], target: Pokemon, source: Pokemon, move: ActiveMove) => void;
218
+ onSourceModifySpA?: CommonHandlers['ModifierSourceMove'];
219
+ onSourceModifySpD?: CommonHandlers['ModifierMove'];
220
+ onSourceModifySpe?: (this: Battle, spe: number, pokemon: Pokemon) => number | void;
221
+ onSourceModifyType?: MoveEventMethods['onModifyType'];
222
+ onSourceModifyTarget?: MoveEventMethods['onModifyTarget'];
223
+ onSourceModifyWeight?: (this: Battle, weighthg: number, pokemon: Pokemon) => number | void;
224
+ onSourceMoveAborted?: CommonHandlers['VoidMove'];
225
+ onSourceNegateImmunity?: ((this: Battle, pokemon: Pokemon, type: string) => boolean | void) | boolean;
226
+ onSourceOverrideAction?: (this: Battle, pokemon: Pokemon, target: Pokemon, move: ActiveMove) => string | void;
227
+ onSourcePrepareHit?: CommonHandlers['ResultSourceMove'];
228
+ onSourceRedirectTarget?: (this: Battle, target: Pokemon, source: Pokemon, source2: Effect, move: ActiveMove) => Pokemon | void;
229
+ onSourceResidual?: (this: Battle, target: Pokemon & Side, source: Pokemon, effect: Effect) => void;
230
+ onSourceSetAbility?: (this: Battle, ability: string, target: Pokemon, source: Pokemon, effect: Effect) => boolean | void;
231
+ onSourceSetStatus?: (this: Battle, status: Condition, target: Pokemon, source: Pokemon, effect: Effect) => boolean | null | void;
232
+ onSourceSetWeather?: (this: Battle, target: Pokemon, source: Pokemon, weather: Condition) => boolean | void;
233
+ onSourceStallMove?: (this: Battle, pokemon: Pokemon) => boolean | void;
234
+ onSourceSwitchIn?: (this: Battle, pokemon: Pokemon) => void;
235
+ onSourceSwitchOut?: (this: Battle, pokemon: Pokemon) => void;
236
+ onSourceTakeItem?: ((this: Battle, item: Item, pokemon: Pokemon, source: Pokemon, move?: ActiveMove) => boolean | void) | boolean;
237
+ onSourceTerrain?: (this: Battle, pokemon: Pokemon) => void;
238
+ onSourceTrapPokemon?: (this: Battle, pokemon: Pokemon) => void;
239
+ onSourceTryAddVolatile?: (this: Battle, status: Condition, target: Pokemon, source: Pokemon, sourceEffect: Effect) => boolean | null | void;
240
+ onSourceTryEatItem?: boolean | ((this: Battle, item: Item, pokemon: Pokemon) => boolean | void);
241
+ onSourceTryHeal?: (((this: Battle, relayVar: number, target: Pokemon, source: Pokemon, effect: Effect) => number | boolean | void) | ((this: Battle, pokemon: Pokemon) => boolean | void) | boolean);
242
+ onSourceTryHit?: MoveEventMethods['onTryHit'];
243
+ onSourceTryHitField?: MoveEventMethods['onTryHitField'];
244
+ onSourceTryHitSide?: CommonHandlers['ResultMove'];
245
+ onSourceInvulnerability?: CommonHandlers['ExtResultMove'];
246
+ onSourceTryMove?: MoveEventMethods['onTryMove'];
247
+ onSourceTryPrimaryHit?: (this: Battle, target: Pokemon, source: Pokemon, move: ActiveMove) => boolean | null | number | void;
248
+ onSourceType?: (this: Battle, types: string[], pokemon: Pokemon) => string[] | void;
249
+ onSourceWeatherModifyDamage?: CommonHandlers['ModifierSourceMove'];
250
+ onSourceModifyDamagePhase1?: CommonHandlers['ModifierSourceMove'];
251
+ onSourceModifyDamagePhase2?: CommonHandlers['ModifierSourceMove'];
252
+ onAnyDamagingHit?: (this: Battle, damage: number, target: Pokemon, source: Pokemon, move: ActiveMove) => void;
253
+ onAnyAfterEachBoost?: (this: Battle, boost: SparseBoostsTable, target: Pokemon, source: Pokemon) => void;
254
+ onAnyAfterHit?: MoveEventMethods['onAfterHit'];
255
+ onAnyAfterSetStatus?: (this: Battle, status: Condition, target: Pokemon, source: Pokemon, effect: Effect) => void;
256
+ onAnyAfterSubDamage?: MoveEventMethods['onAfterSubDamage'];
257
+ onAnyAfterSwitchInSelf?: (this: Battle, pokemon: Pokemon) => void;
258
+ onAnyAfterUseItem?: (this: Battle, item: Item, pokemon: Pokemon) => void;
259
+ onAnyAfterBoost?: (this: Battle, boost: SparseBoostsTable, target: Pokemon, source: Pokemon, effect: Effect) => void;
260
+ onAnyAfterFaint?: (this: Battle, length: number, target: Pokemon, source: Pokemon, effect: Effect) => void;
261
+ onAnyAfterMoveSecondarySelf?: MoveEventMethods['onAfterMoveSecondarySelf'];
262
+ onAnyAfterMoveSecondary?: MoveEventMethods['onAfterMoveSecondary'];
263
+ onAnyAfterMove?: MoveEventMethods['onAfterMove'];
264
+ onAnyAfterMoveSelf?: CommonHandlers['VoidSourceMove'];
265
+ onAnyAttract?: (this: Battle, target: Pokemon, source: Pokemon) => void;
266
+ onAnyAccuracy?: (this: Battle, accuracy: number, target: Pokemon, source: Pokemon, move: ActiveMove) => number | boolean | null | void;
267
+ onAnyBasePower?: CommonHandlers['ModifierSourceMove'];
268
+ onAnyBeforeFaint?: (this: Battle, pokemon: Pokemon, effect: Effect) => void;
269
+ onAnyBeforeMove?: CommonHandlers['VoidSourceMove'];
270
+ onAnyBeforeSwitchIn?: (this: Battle, pokemon: Pokemon) => void;
271
+ onAnyBeforeSwitchOut?: (this: Battle, pokemon: Pokemon) => void;
272
+ onAnyTryBoost?: (this: Battle, boost: SparseBoostsTable, target: Pokemon, source: Pokemon, effect: Effect) => void;
273
+ onAnyChargeMove?: CommonHandlers['VoidSourceMove'];
274
+ onAnyCriticalHit?: ((this: Battle, pokemon: Pokemon, source: null, move: ActiveMove) => boolean | void) | boolean;
275
+ onAnyDamage?: (this: Battle, damage: number, target: Pokemon, source: Pokemon, effect: Effect) => number | boolean | null | void;
276
+ onAnyDeductPP?: (this: Battle, target: Pokemon, source: Pokemon) => number | void;
277
+ onAnyDisableMove?: (this: Battle, pokemon: Pokemon) => void;
278
+ onAnyDragOut?: (this: Battle, pokemon: Pokemon, source?: Pokemon, move?: ActiveMove) => void;
279
+ onAnyEatItem?: (this: Battle, item: Item, pokemon: Pokemon) => void;
280
+ onAnyEffectiveness?: MoveEventMethods['onEffectiveness'];
281
+ onAnyFaint?: CommonHandlers['VoidEffect'];
282
+ onAnyFlinch?: ((this: Battle, pokemon: Pokemon) => boolean | void) | boolean;
283
+ onAnyHit?: MoveEventMethods['onHit'];
284
+ onAnyImmunity?: (this: Battle, type: string, pokemon: Pokemon) => void;
285
+ onAnyLockMove?: string | ((this: Battle, pokemon: Pokemon) => void | string);
286
+ onAnyMaybeTrapPokemon?: (this: Battle, pokemon: Pokemon) => void;
287
+ onAnyModifyAccuracy?: CommonHandlers['ModifierMove'];
288
+ onAnyModifyAtk?: CommonHandlers['ModifierSourceMove'];
289
+ onAnyModifyBoost?: (this: Battle, boosts: SparseBoostsTable, pokemon: Pokemon) => SparseBoostsTable | void;
290
+ onAnyModifyCritRatio?: CommonHandlers['ModifierSourceMove'];
291
+ onAnyModifyDamage?: CommonHandlers['ModifierSourceMove'];
292
+ onAnyModifyDef?: CommonHandlers['ModifierMove'];
293
+ onAnyModifyMove?: MoveEventMethods['onModifyMove'];
294
+ onAnyModifyPriority?: CommonHandlers['ModifierSourceMove'];
295
+ onAnyModifySecondaries?: (this: Battle, secondaries: SecondaryEffect[], target: Pokemon, source: Pokemon, move: ActiveMove) => void;
296
+ onAnyModifySpA?: CommonHandlers['ModifierSourceMove'];
297
+ onAnyModifySpD?: CommonHandlers['ModifierMove'];
298
+ onAnyModifySpe?: (this: Battle, spe: number, pokemon: Pokemon) => number | void;
299
+ onAnyModifyType?: MoveEventMethods['onModifyType'];
300
+ onAnyModifyTarget?: MoveEventMethods['onModifyTarget'];
301
+ onAnyModifyWeight?: (this: Battle, weighthg: number, pokemon: Pokemon) => number | void;
302
+ onAnyMoveAborted?: CommonHandlers['VoidMove'];
303
+ onAnyNegateImmunity?: ((this: Battle, pokemon: Pokemon, type: string) => boolean | void) | boolean;
304
+ onAnyOverrideAction?: (this: Battle, pokemon: Pokemon, target: Pokemon, move: ActiveMove) => string | void;
305
+ onAnyPrepareHit?: CommonHandlers['ResultSourceMove'];
306
+ onAnyPseudoWeatherChange?: (this: Battle, target: Pokemon, source: Pokemon, pseudoWeather: Condition) => void;
307
+ onAnyRedirectTarget?: (this: Battle, target: Pokemon, source: Pokemon, source2: Effect, move: ActiveMove) => Pokemon | void;
308
+ onAnyResidual?: (this: Battle, target: Pokemon & Side, source: Pokemon, effect: Effect) => void;
309
+ onAnySetAbility?: (this: Battle, ability: string, target: Pokemon, source: Pokemon, effect: Effect) => boolean | void;
310
+ onAnySetStatus?: (this: Battle, status: Condition, target: Pokemon, source: Pokemon, effect: Effect) => boolean | null | void;
311
+ onAnySetWeather?: (this: Battle, target: Pokemon, source: Pokemon, weather: Condition) => boolean | void;
312
+ onAnyStallMove?: (this: Battle, pokemon: Pokemon) => boolean | void;
313
+ onAnySwitchIn?: (this: Battle, pokemon: Pokemon) => void;
314
+ onAnySwitchOut?: (this: Battle, pokemon: Pokemon) => void;
315
+ onAnyTakeItem?: ((this: Battle, item: Item, pokemon: Pokemon, source: Pokemon, move?: ActiveMove) => boolean | void) | boolean;
316
+ onAnyTerrain?: (this: Battle, pokemon: Pokemon) => void;
317
+ onAnyTrapPokemon?: (this: Battle, pokemon: Pokemon) => void;
318
+ onAnyTryAddVolatile?: (this: Battle, status: Condition, target: Pokemon, source: Pokemon, sourceEffect: Effect) => boolean | null | void;
319
+ onAnyTryEatItem?: boolean | ((this: Battle, item: Item, pokemon: Pokemon) => boolean | void);
320
+ onAnyTryHeal?: (((this: Battle, relayVar: number, target: Pokemon, source: Pokemon, effect: Effect) => number | boolean | void) | ((this: Battle, pokemon: Pokemon) => boolean | void) | boolean);
321
+ onAnyTryHit?: MoveEventMethods['onTryHit'];
322
+ onAnyTryHitField?: MoveEventMethods['onTryHitField'];
323
+ onAnyTryHitSide?: CommonHandlers['ResultMove'];
324
+ onAnyInvulnerability?: CommonHandlers['ExtResultMove'];
325
+ onAnyTryMove?: MoveEventMethods['onTryMove'];
326
+ onAnyTryPrimaryHit?: (this: Battle, target: Pokemon, source: Pokemon, move: ActiveMove) => boolean | null | number | void;
327
+ onAnyType?: (this: Battle, types: string[], pokemon: Pokemon) => string[] | void;
328
+ onAnyWeatherModifyDamage?: CommonHandlers['ModifierSourceMove'];
329
+ onAnyModifyDamagePhase1?: CommonHandlers['ModifierSourceMove'];
330
+ onAnyModifyDamagePhase2?: CommonHandlers['ModifierSourceMove'];
331
+ onAccuracyPriority?: number;
332
+ onDamagingHitOrder?: number;
333
+ onAfterMoveSecondaryPriority?: number;
334
+ onAfterMoveSecondarySelfPriority?: number;
335
+ onAfterMoveSelfPriority?: number;
336
+ onAfterSetStatusPriority?: number;
337
+ onAnyBasePowerPriority?: number;
338
+ onAnyInvulnerabilityPriority?: number;
339
+ onAnyModifyAccuracyPriority?: number;
340
+ onAnyFaintPriority?: number;
341
+ onAnyPrepareHitPriority?: number;
342
+ onAllyBasePowerPriority?: number;
343
+ onAllyModifyAtkPriority?: number;
344
+ onAllyModifySpAPriority?: number;
345
+ onAllyModifySpDPriority?: number;
346
+ onAttractPriority?: number;
347
+ onBasePowerPriority?: number;
348
+ onBeforeMovePriority?: number;
349
+ onBeforeSwitchOutPriority?: number;
350
+ onChangeBoostPriority?: number;
351
+ onDamagePriority?: number;
352
+ onDragOutPriority?: number;
353
+ onEffectivenessPriority?: number;
354
+ onFoeBasePowerPriority?: number;
355
+ onFoeBeforeMovePriority?: number;
356
+ onFoeModifyDefPriority?: number;
357
+ onFoeModifySpDPriority?: number;
358
+ onFoeRedirectTargetPriority?: number;
359
+ onFoeTrapPokemonPriority?: number;
360
+ onFractionalPriorityPriority?: number;
361
+ onHitPriority?: number;
362
+ onInvulnerabilityPriority?: number;
363
+ onModifyAccuracyPriority?: number;
364
+ onModifyAtkPriority?: number;
365
+ onModifyCritRatioPriority?: number;
366
+ onModifyDefPriority?: number;
367
+ onModifyMovePriority?: number;
368
+ onModifyPriorityPriority?: number;
369
+ onModifySpAPriority?: number;
370
+ onModifySpDPriority?: number;
371
+ onModifySpePriority?: number;
372
+ onModifyTypePriority?: number;
373
+ onModifyWeightPriority?: number;
374
+ onRedirectTargetPriority?: number;
375
+ onResidualOrder?: number;
376
+ onResidualPriority?: number;
377
+ onResidualSubOrder?: number;
378
+ onSourceBasePowerPriority?: number;
379
+ onSourceInvulnerabilityPriority?: number;
380
+ onSourceModifyAccuracyPriority?: number;
381
+ onSourceModifyAtkPriority?: number;
382
+ onSourceModifyDamagePriority?: number;
383
+ onSourceModifySpAPriority?: number;
384
+ onSwitchInPriority?: number;
385
+ onTrapPokemonPriority?: number;
386
+ onTryEatItemPriority?: number;
387
+ onTryHealPriority?: number;
388
+ onTryHitPriority?: number;
389
+ onTryMovePriority?: number;
390
+ onTryPrimaryHitPriority?: number;
391
+ onTypePriority?: number;
392
+ }
393
+ export interface PokemonEventMethods extends EventMethods {
394
+ onAllyDamagingHit?: (this: Battle, damage: number, target: Pokemon, source: Pokemon, move: ActiveMove) => void;
395
+ onAllyAfterEachBoost?: (this: Battle, boost: SparseBoostsTable, target: Pokemon, source: Pokemon) => void;
396
+ onAllyAfterHit?: MoveEventMethods['onAfterHit'];
397
+ onAllyAfterSetStatus?: (this: Battle, status: Condition, target: Pokemon, source: Pokemon, effect: Effect) => void;
398
+ onAllyAfterSubDamage?: MoveEventMethods['onAfterSubDamage'];
399
+ onAllyAfterSwitchInSelf?: (this: Battle, pokemon: Pokemon) => void;
400
+ onAllyAfterUseItem?: (this: Battle, item: Item, pokemon: Pokemon) => void;
401
+ onAllyAfterBoost?: (this: Battle, boost: SparseBoostsTable, target: Pokemon, source: Pokemon, effect: Effect) => void;
402
+ onAllyAfterFaint?: (this: Battle, length: number, target: Pokemon, source: Pokemon, effect: Effect) => void;
403
+ onAllyAfterMoveSecondarySelf?: MoveEventMethods['onAfterMoveSecondarySelf'];
404
+ onAllyAfterMoveSecondary?: MoveEventMethods['onAfterMoveSecondary'];
405
+ onAllyAfterMove?: MoveEventMethods['onAfterMove'];
406
+ onAllyAfterMoveSelf?: CommonHandlers['VoidSourceMove'];
407
+ onAllyAttract?: (this: Battle, target: Pokemon, source: Pokemon) => void;
408
+ onAllyAccuracy?: (this: Battle, accuracy: number, target: Pokemon, source: Pokemon, move: ActiveMove) => number | boolean | null | void;
409
+ onAllyBasePower?: CommonHandlers['ModifierSourceMove'];
410
+ onAllyBeforeFaint?: (this: Battle, pokemon: Pokemon, effect: Effect) => void;
411
+ onAllyBeforeMove?: CommonHandlers['VoidSourceMove'];
412
+ onAllyBeforeSwitchIn?: (this: Battle, pokemon: Pokemon) => void;
413
+ onAllyBeforeSwitchOut?: (this: Battle, pokemon: Pokemon) => void;
414
+ onAllyTryBoost?: (this: Battle, boost: SparseBoostsTable, target: Pokemon, source: Pokemon, effect: Effect) => void;
415
+ onAllyChargeMove?: CommonHandlers['VoidSourceMove'];
416
+ onAllyCriticalHit?: ((this: Battle, pokemon: Pokemon, source: null, move: ActiveMove) => boolean | void) | boolean;
417
+ onAllyDamage?: (this: Battle, damage: number, target: Pokemon, source: Pokemon, effect: Effect) => number | boolean | null | void;
418
+ onAllyDeductPP?: (this: Battle, target: Pokemon, source: Pokemon) => number | void;
419
+ onAllyDisableMove?: (this: Battle, pokemon: Pokemon) => void;
420
+ onAllyDragOut?: (this: Battle, pokemon: Pokemon, source?: Pokemon, move?: ActiveMove) => void;
421
+ onAllyEatItem?: (this: Battle, item: Item, pokemon: Pokemon) => void;
422
+ onAllyEffectiveness?: MoveEventMethods['onEffectiveness'];
423
+ onAllyFaint?: CommonHandlers['VoidEffect'];
424
+ onAllyFlinch?: ((this: Battle, pokemon: Pokemon) => boolean | void) | boolean;
425
+ onAllyHit?: MoveEventMethods['onHit'];
426
+ onAllyImmunity?: (this: Battle, type: string, pokemon: Pokemon) => void;
427
+ onAllyLockMove?: string | ((this: Battle, pokemon: Pokemon) => void | string);
428
+ onAllyMaybeTrapPokemon?: (this: Battle, pokemon: Pokemon) => void;
429
+ onAllyModifyAccuracy?: CommonHandlers['ModifierMove'];
430
+ onAllyModifyAtk?: CommonHandlers['ModifierSourceMove'];
431
+ onAllyModifyBoost?: (this: Battle, boosts: SparseBoostsTable, pokemon: Pokemon) => SparseBoostsTable | void;
432
+ onAllyModifyCritRatio?: CommonHandlers['ModifierSourceMove'];
433
+ onAllyModifyDamage?: CommonHandlers['ModifierSourceMove'];
434
+ onAllyModifyDef?: CommonHandlers['ModifierMove'];
435
+ onAllyModifyMove?: MoveEventMethods['onModifyMove'];
436
+ onAllyModifyPriority?: CommonHandlers['ModifierSourceMove'];
437
+ onAllyModifySecondaries?: (this: Battle, secondaries: SecondaryEffect[], target: Pokemon, source: Pokemon, move: ActiveMove) => void;
438
+ onAllyModifySpA?: CommonHandlers['ModifierSourceMove'];
439
+ onAllyModifySpD?: CommonHandlers['ModifierMove'];
440
+ onAllyModifySpe?: (this: Battle, spe: number, pokemon: Pokemon) => number | void;
441
+ onAllyModifyType?: MoveEventMethods['onModifyType'];
442
+ onAllyModifyTarget?: MoveEventMethods['onModifyTarget'];
443
+ onAllyModifyWeight?: (this: Battle, weighthg: number, pokemon: Pokemon) => number | void;
444
+ onAllyMoveAborted?: CommonHandlers['VoidMove'];
445
+ onAllyNegateImmunity?: ((this: Battle, pokemon: Pokemon, type: string) => boolean | void) | boolean;
446
+ onAllyOverrideAction?: (this: Battle, pokemon: Pokemon, target: Pokemon, move: ActiveMove) => string | void;
447
+ onAllyPrepareHit?: CommonHandlers['ResultSourceMove'];
448
+ onAllyRedirectTarget?: (this: Battle, target: Pokemon, source: Pokemon, source2: Effect, move: ActiveMove) => Pokemon | void;
449
+ onAllyResidual?: (this: Battle, target: Pokemon & Side, source: Pokemon, effect: Effect) => void;
450
+ onAllySetAbility?: (this: Battle, ability: string, target: Pokemon, source: Pokemon, effect: Effect) => boolean | void;
451
+ onAllySetStatus?: (this: Battle, status: Condition, target: Pokemon, source: Pokemon, effect: Effect) => boolean | null | void;
452
+ onAllySetWeather?: (this: Battle, target: Pokemon, source: Pokemon, weather: Condition) => boolean | void;
453
+ onAllySideConditionStart?: (this: Battle, target: Pokemon, source: Pokemon, sideCondition: Condition) => void;
454
+ onAllyStallMove?: (this: Battle, pokemon: Pokemon) => boolean | void;
455
+ onAllySwitchIn?: (this: Battle, pokemon: Pokemon) => void;
456
+ onAllySwitchOut?: (this: Battle, pokemon: Pokemon) => void;
457
+ onAllyTakeItem?: ((this: Battle, item: Item, pokemon: Pokemon, source: Pokemon, move?: ActiveMove) => boolean | void) | boolean;
458
+ onAllyTerrain?: (this: Battle, pokemon: Pokemon) => void;
459
+ onAllyTrapPokemon?: (this: Battle, pokemon: Pokemon) => void;
460
+ onAllyTryAddVolatile?: (this: Battle, status: Condition, target: Pokemon, source: Pokemon, sourceEffect: Effect) => boolean | null | void;
461
+ onAllyTryEatItem?: boolean | ((this: Battle, item: Item, pokemon: Pokemon) => boolean | void);
462
+ onAllyTryHeal?: (((this: Battle, relayVar: number, target: Pokemon, source: Pokemon, effect: Effect) => number | boolean | void) | ((this: Battle, pokemon: Pokemon) => boolean | void) | boolean);
463
+ onAllyTryHit?: MoveEventMethods['onTryHit'];
464
+ onAllyTryHitField?: MoveEventMethods['onTryHitField'];
465
+ onAllyTryHitSide?: CommonHandlers['ResultMove'];
466
+ onAllyInvulnerability?: CommonHandlers['ExtResultMove'];
467
+ onAllyTryMove?: MoveEventMethods['onTryMove'];
468
+ onAllyTryPrimaryHit?: (this: Battle, target: Pokemon, source: Pokemon, move: ActiveMove) => boolean | null | number | void;
469
+ onAllyType?: (this: Battle, types: string[], pokemon: Pokemon) => string[] | void;
470
+ onAllyWeatherModifyDamage?: CommonHandlers['ModifierSourceMove'];
471
+ onAllyModifyDamagePhase1?: CommonHandlers['ModifierSourceMove'];
472
+ onAllyModifyDamagePhase2?: CommonHandlers['ModifierSourceMove'];
473
+ }
474
+ export interface SideEventMethods extends EventMethods {
475
+ onSideStart?: (this: Battle, target: Side, source: Pokemon, sourceEffect: Effect) => void;
476
+ onSideRestart?: (this: Battle, target: Side, source: Pokemon, sourceEffect: Effect) => void;
477
+ onSideResidual?: (this: Battle, target: Side, source: Pokemon, effect: Effect) => void;
478
+ onSideEnd?: (this: Battle, target: Side) => void;
479
+ onSideResidualOrder?: number;
480
+ onSideResidualPriority?: number;
481
+ onSideResidualSubOrder?: number;
482
+ }
483
+ export interface FieldEventMethods extends EventMethods {
484
+ onFieldStart?: (this: Battle, target: Field, source: Pokemon, sourceEffect: Effect) => void;
485
+ onFieldRestart?: (this: Battle, target: Field, source: Pokemon, sourceEffect: Effect) => void;
486
+ onFieldResidual?: (this: Battle, target: Field, source: Pokemon, effect: Effect) => void;
487
+ onFieldEnd?: (this: Battle, target: Field) => void;
488
+ onFieldResidualOrder?: number;
489
+ onFieldResidualPriority?: number;
490
+ onFieldResidualSubOrder?: number;
491
+ }
492
+ export interface PokemonConditionData extends Partial<Condition>, PokemonEventMethods {
493
+ }
494
+ export interface SideConditionData extends Partial<Omit<Condition, 'onStart' | 'onRestart' | 'onEnd'>>, SideEventMethods {
495
+ }
496
+ export interface FieldConditionData extends Partial<Omit<Condition, 'onStart' | 'onRestart' | 'onEnd'>>, FieldEventMethods {
497
+ }
498
+ export type ConditionData = PokemonConditionData | SideConditionData | FieldConditionData;
499
+ export type ModdedConditionData = ConditionData & {
500
+ inherit?: true;
501
+ };
502
+ export declare class Condition extends BasicEffect implements Readonly<BasicEffect & SideConditionData & FieldConditionData & PokemonConditionData> {
503
+ readonly effectType: 'Condition' | 'Weather' | 'Status' | 'Terastal';
504
+ readonly counterMax?: number;
505
+ readonly durationCallback?: (this: Battle, target: Pokemon, source: Pokemon, effect: Effect | null) => number;
506
+ readonly onCopy?: (this: Battle, pokemon: Pokemon) => void;
507
+ readonly onEnd?: (this: Battle, target: Pokemon) => void;
508
+ readonly onRestart?: (this: Battle, target: Pokemon, source: Pokemon, sourceEffect: Effect) => boolean | null | void;
509
+ readonly onStart?: (this: Battle, target: Pokemon, source: Pokemon, sourceEffect: Effect) => boolean | null | void;
510
+ constructor(data: AnyObject);
511
+ }
512
+ export declare class DexConditions {
513
+ readonly dex: ModdedDex;
514
+ readonly conditionCache: Map<ID, Condition>;
515
+ constructor(dex: ModdedDex);
516
+ get(name?: string | Effect | null): Condition;
517
+ getByID(id: ID): Condition;
518
+ }